# Linear Algebra/Sets, Functions, Relations

Linear Algebra
 ← Techniques of Proof Sets, Functions, Relations Licensing And History →

### Sets

Mathematicians work with collections called sets. A set can be given as a listing between curly braces as in ${\displaystyle \{1,4,9,16\}}$, or, if that's unwieldy, by using set-builder notation as in ${\displaystyle \{x\,{\big |}\,x^{5}-3x^{3}+2=0\}}$ (read "the set of all ${\displaystyle x}$ such that \ldots"). We name sets with capital roman letters as with the primes ${\displaystyle P=\{2,3,5,7,11,\ldots \,\}}$, except for a few special sets such as the real numbers ${\displaystyle \mathbb {R} }$, and the complex numbers ${\displaystyle \mathbb {C} }$. To denote that something is an element (or member) of a set we use "${\displaystyle {}\in {}}$", so that ${\displaystyle 7\in \{3,5,7\}}$ while ${\displaystyle 8\not \in \{3,5,7\}}$.

What distinguishes a set from any other type of collection is the Principle of Extensionality, that two sets with the same elements are equal. Because of this principle, in a set repeats collapse ${\displaystyle \{7,7\}=\{7\}}$ and order doesn't matter ${\displaystyle \{2,\pi \}=\{\pi ,2\}}$.

We use "${\displaystyle \subset }$" for the subset relationship: ${\displaystyle \{2,\pi \}\subset \{2,\pi ,7\}}$ and "${\displaystyle \subseteq }$" for subset or equality (if ${\displaystyle A}$ is a subset of ${\displaystyle B}$ but ${\displaystyle A\neq B}$ then ${\displaystyle A}$ is a proper subset of ${\displaystyle B}$). These symbols may be flipped, for instance ${\displaystyle \{2,\pi ,5\}\supset \{2,5\}}$.

Because of Extensionality, to prove that two sets are equal ${\displaystyle A=B}$, just show that they have the same members. Usually we show mutual inclusion, that both ${\displaystyle A\subseteq B}$ and ${\displaystyle A\supseteq B}$.

### Set operations

Venn diagrams are handy here. For instance, ${\displaystyle x\in P}$ can be pictured

and "${\displaystyle P\subseteq Q}$" looks like this.

Note that this is a repeat of the diagram for "if \ldots then ..." propositions. That's because "${\displaystyle P\subseteq Q}$" means "if ${\displaystyle x\in P}$ then ${\displaystyle x\in Q}$".

In general, for every propositional logic operator there is an associated set operator. For instance, the complement of ${\displaystyle P}$ is ${\displaystyle P^{\text{comp}}=\{x\,{\big |}\,{\text{not }}(x\in P)\}}$

the union is ${\displaystyle P\cup Q=\{x\,{\big |}\,(x\in P){\text{ or }}(x\in Q)\}}$

and the intersection is ${\displaystyle P\cap Q=\{x\,{\big |}\,(x\in P){\text{ and }}(x\in Q)\}.}$

}}When two sets share no members their intersection is the empty set ${\displaystyle \{\}}$, symbolized ${\displaystyle \varnothing }$. Any set has the empty set for a subset, by the "vacuously true" property of the definition of implication.

### Sequences

We shall also use collections where order does matter and where repeats do not collapse. These are sequences, denoted with angle brackets: ${\displaystyle \langle 2,3,7\rangle \neq \langle 2,7,3\rangle }$. A sequence of length ${\displaystyle 2}$ is sometimes called an ordered pair and written with parentheses: ${\displaystyle (\pi ,3)}$. We also sometimes say "ordered triple", "ordered ${\displaystyle 4}$-tuple", etc. The set of ordered ${\displaystyle n}$-tuples of elements of a set ${\displaystyle A}$ is denoted ${\displaystyle A^{n}}$. Thus the set of pairs of reals is ${\displaystyle \mathbb {R} ^{2}}$.

### Functions

We first see functions in elementary Algebra, where they are presented as formulas (e.g., ${\displaystyle f(x)=16x^{2}-100}$), but progressing to more advanced Mathematics reveals more general functions— trigonometric ones, exponential and logarithmic ones, and even constructs like absolute value that involve piecing together parts— and we see that functions aren't formulas, instead the key idea is that a function associates with its input ${\displaystyle x}$ a single output ${\displaystyle f(x)}$.

Consequently, a function or map is defined to be a set of ordered pairs ${\displaystyle (x,f(x)\,)}$ such that ${\displaystyle x}$ suffices to determine ${\displaystyle f(x)}$, that is: if ${\displaystyle x_{1}=x_{2}}$ then ${\displaystyle f(x_{1})=f(x_{2})}$ (this requirement is referred to by saying a function is well-defined).\footnote{More on this is in the section on isomorphisms}

Each input ${\displaystyle x}$ is one of the function's arguments and each output ${\displaystyle f(x)}$ is a value. The set of all arguments is ${\displaystyle f}$'s domain and the set of output values is its range. Usually we don't need know what is and is not in the range and we instead work with a superset of the range, the codomain. The notation for a function ${\displaystyle f}$ with domain ${\displaystyle X}$ and codomain ${\displaystyle Y}$ is ${\displaystyle f:X\to Y}$.

We sometimes instead use the notation ${\displaystyle x{\stackrel {f}{\longmapsto }}16x^{2}-100}$, read "${\displaystyle x}$ maps under ${\displaystyle f}$ to ${\displaystyle 16x^{2}-100}$", or "${\displaystyle 16x^{2}-100}$ is the "image' of ${\displaystyle x}$'.

Some maps, like ${\displaystyle x\mapsto \sin(1/x)}$, can be thought of as combinations of simple maps, here, ${\displaystyle g(y)=\sin(y)}$ applied to the image of ${\displaystyle f(x)=1/x}$. The composition of ${\displaystyle g:Y\to Z}$ with ${\displaystyle f:X\to Y}$, is the map sending ${\displaystyle x\in X}$ to ${\displaystyle g(\,f(x)\,)\in Z}$. It is denoted ${\displaystyle g\circ f:X\to Z}$. This definition only makes sense if the range of ${\displaystyle f}$ is a subset of the domain of ${\displaystyle g}$.

Observe that the identity map ${\displaystyle {\mbox{id}}:Y\to Y}$ defined by ${\displaystyle {\mbox{id}}(y)=y}$ has the property that for any ${\displaystyle f:X\to Y}$, the composition ${\displaystyle {\mbox{id}}\circ f}$ is equal to ${\displaystyle f}$. So an identity map plays the same role with respect to function composition that the number ${\displaystyle 0}$ plays in real number addition, or that the number ${\displaystyle 1}$ plays in multiplication.

In line with that analogy, define a left inverse of a map ${\displaystyle f:X\to Y}$ to be a function ${\displaystyle g:{\text{range}}(f)\to X}$ such that ${\displaystyle g\circ f}$ is the identity map on ${\displaystyle X}$. Of course, a right inverse of ${\displaystyle f}$ is a ${\displaystyle h:Y\to X}$ such that ${\displaystyle f\circ h}$ is the identity.

A map that is both a left and right inverse of ${\displaystyle f}$ is called simply an inverse. An inverse, if one exists, is unique because if both ${\displaystyle g_{1}}$ and ${\displaystyle g_{2}}$ are inverses of ${\displaystyle f}$ then ${\displaystyle g_{1}(x)=g_{1}\circ (f\circ g_{2})(x)=(g_{1}\circ f)\circ g_{2}(x)=g_{2}(x)}$ (the middle equality comes from the associativity of function composition), so we often call it "the" inverse, written ${\displaystyle f^{-1}}$. For instance, the inverse of the function ${\displaystyle f:\mathbb {R} \to \mathbb {R} }$ given by ${\displaystyle f(x)=2x-3}$ is the function ${\displaystyle f^{-1}:\mathbb {R} \to \mathbb {R} }$ given by ${\displaystyle f^{-1}(x)=(x+3)/2}$.

The superscript "${\displaystyle f^{-1}}$" notation for function inverse can be confusing— it doesn't mean ${\displaystyle 1/f(x)}$. It is used because it fits into a larger scheme. Functions that have the same codomain as domain can be iterated, so that where ${\displaystyle f:X\to X}$, we can consider the composition of ${\displaystyle f}$ with itself: ${\displaystyle f\circ f}$, and ${\displaystyle f\circ f\circ f}$, etc.

Naturally enough, we write ${\displaystyle f\circ f}$ as ${\displaystyle f^{2}}$ and ${\displaystyle f\circ f\circ f}$ as ${\displaystyle f^{3}}$, etc. Note that the familiar exponent rules for real numbers obviously hold: ${\displaystyle f^{i}\circ f^{j}=f^{i+j}}$ and ${\displaystyle (f^{i})^{j}=f^{i\cdot j}}$. The relationship with the prior paragraph is that, where ${\displaystyle f}$ is invertible, writing ${\displaystyle f^{-1}}$ for the inverse and ${\displaystyle f^{-2}}$ for the inverse of ${\displaystyle f^{2}}$, etc., gives that these familiar exponent rules continue to hold, once ${\displaystyle f^{0}}$ is defined to be the identity map.

If the codomain ${\displaystyle Y}$ equals the range of ${\displaystyle f}$ then we say that the function is onto (or surjective). A function has a right inverse if and only if it is onto (this is not hard to check). If no two arguments share an image, if ${\displaystyle x_{1}\neq x_{2}}$ implies that ${\displaystyle f(x_{1})\neq f(x_{2})}$, then the function is one-to-one (or injective). A function has a left inverse if and only if it is one-to-one (this is also not hard to check).

By the prior paragraph, a map has an inverse if and only if it is both onto and one-to-one; such a function is a correspondence. It associates one and only one element of the domain with each element of the range (for example, finite sets must have the same number of elements to be matched up in this way). Because a composition of one-to-one maps is one-to-one, and a composition of onto maps is onto, a composition of correspondences is a correspondence.

We sometimes want to shrink the domain of a function. For instance, we may take the function ${\displaystyle f:\mathbb {R} \to \mathbb {R} }$ given by ${\displaystyle f(x)=x^{2}}$ and, in order to have an inverse, limit input arguments to nonnegative reals ${\displaystyle {\hat {f}}:\mathbb {R} ^{+}\to \mathbb {R} }$. Technically, ${\displaystyle {\hat {f}}}$ is a different function than ${\displaystyle f}$; we call it the restriction of ${\displaystyle f}$ to the smaller domain.

A final point on functions: neither ${\displaystyle x}$ nor ${\displaystyle f(x)}$ need be a number. As an example, we can think of ${\displaystyle f(x,y)=x+y}$ as a function that takes the ordered pair ${\displaystyle (x,y)}$ as its argument.

### Relations

Some familiar operations are obviously functions: addition maps ${\displaystyle (5,3)}$ to ${\displaystyle 8}$. But what of "${\displaystyle <}$" or "${\displaystyle =}$"? We here take the approach of rephrasing "${\displaystyle 3<5}$" to "${\displaystyle (3,5)}$ is in the relation ${\displaystyle <}$". That is, define a binary relation on a set ${\displaystyle A}$ to be a set of ordered pairs of elements of ${\displaystyle A}$. For example, the ${\displaystyle <}$ relation is the set ${\displaystyle \{(a,b)\,{\big |}\,a; some elements of that set are ${\displaystyle (3,5)}$, ${\displaystyle (3,7)}$, and ${\displaystyle (1,100)}$.

Another binary relation on the natural numbers is equality; this relation is formally written as the set ${\displaystyle \{\ldots ,(-1,-1),(0,0),(1,1),\ldots \}}$.

Still another example is "closer than ${\displaystyle 10}$", the set ${\displaystyle \{(x,y)\,{\big |}\,|x-y|<10\}}$. Some members of that relation are ${\displaystyle (1,10)}$, ${\displaystyle (10,1)}$, and ${\displaystyle (42,44)}$. Neither ${\displaystyle (11,1)}$ nor ${\displaystyle (1,11)}$ is a member.

Those examples illustrate the generality of the definition. All kinds of relationships (e.g., "both numbers even" or "first number is the second with the digits reversed") are covered under the definition.

### Equivalence Relations

We shall need to say, formally, that two objects are alike in some way. While these alike things aren't identical, they are related (e.g., two integers that "give the same remainder when divided by ${\displaystyle 2}$").

A binary relation ${\displaystyle \{(a,b),\ldots \}}$ is an equivalence relationwhen it satisfies

1. reflexivity: any object is related to itself;
2. symmetry: if ${\displaystyle a}$ is related to ${\displaystyle b}$ then ${\displaystyle b}$ is related to ${\displaystyle a}$;
3. transitivity: if ${\displaystyle a}$ is related to ${\displaystyle b}$ and ${\displaystyle b}$ is related to ${\displaystyle c}$ then ${\displaystyle a}$ is related to ${\displaystyle c}$.

(To see that these conditions formalize being the same, read them again, replacing "is related to" with "is like".)

Some examples (on the integers): "${\displaystyle =}$" is an equivalence relation, "${\displaystyle <}$" does not satisfy symmetry, "same sign" is a equivalence, while "nearer than ${\displaystyle 10}$" fails transitivity.

### Partitions

In "same sign" ${\displaystyle \{(1,3),(-5,-7),(-1,-1),\ldots \}}$ there are two kinds of pairs, the first with both numbers positive and the second with both negative. So integers fall into exactly one of two classes, positive or negative.

A partition of a set ${\displaystyle S}$ is a collection of subsets ${\displaystyle \{S_{1},S_{2},\ldots \}}$ such that every element of ${\displaystyle S}$ is in one and only one ${\displaystyle S_{i}}$: ${\displaystyle S_{1}\cup S_{2}\cup \ldots {}=S}$, and if ${\displaystyle i}$ is not equal to ${\displaystyle j}$ then ${\displaystyle S_{i}\cap S_{j}=\varnothing }$. Picture ${\displaystyle S}$ being decomposed into distinct parts.

Thus, the first paragraph says "same sign" partitions the integers into the positives and the negatives.

Similarly, the equivalence relation "=" partitions the integers into one-element sets.

Another example is the fractions. Of course, ${\displaystyle 2/3}$ and ${\displaystyle 4/6}$ are equivalent fractions. That is, for the set ${\displaystyle S=\{n/d\,{\big |}\,n,d\in \mathbb {Z} {\text{ and }}d\neq 0\}}$, we define two elements ${\displaystyle n_{1}/d_{1}}$ and ${\displaystyle n_{2}/d_{2}}$ to be equivalent if ${\displaystyle n_{1}d_{2}=n_{2}d_{1}}$. We can check that this is an equivalence relation, that is, that it satisfies the above three conditions. With that, ${\displaystyle S}$ is divided up into parts.

Before we show that equivalence relations always give rise to partitions, we first illustrate the argument. Consider the relationship between two integers of "same parity", the set ${\displaystyle \{(-1,3),(2,4),(0,0),\ldots \}}$ (i.e., "give the same remainder when divided by ${\displaystyle 2}$"). We want to say that the natural numbers split into two pieces, the evens and the odds, and inside a piece each member has the same parity as each other. So for each ${\displaystyle x}$ we define the set of numbers associated with it: ${\displaystyle S_{x}=\{y\,{\big |}\,(x,y)\in {\text{same parity}}\}}$. Some examples are ${\displaystyle S_{1}=\{\ldots ,-3,-1,1,3,\ldots \}}$, and ${\displaystyle S_{4}=\{\ldots ,-2,0,2,4,\ldots \}}$, and ${\displaystyle S_{-1}=\{\ldots ,-3,-1,1,3,\ldots \}}$. These are the parts, e.g., ${\displaystyle S_{1}}$ is the odds.

}}Theorem An equivalence relation induces a partition on the underlying set.

Proof

Call the set ${\displaystyle S}$ and the relation ${\displaystyle R}$. In line with the illustration in the paragraph above, for each ${\displaystyle x\in S}$ define ${\displaystyle S_{x}=\{y\,{\big |}\,(x,y)\in R\}}$.

Observe that, as ${\displaystyle x}$ is a member if ${\displaystyle S_{x}}$, the union of all these sets is ${\displaystyle S}$. So we will be done if we show that distinct parts are disjoint: if ${\displaystyle S_{x}\neq S_{y}}$ then ${\displaystyle S_{x}\cap S_{y}=\varnothing }$. We will verify this through the contrapositive, that is, we wlll assume that ${\displaystyle S_{x}\cap S_{y}\neq \varnothing }$ in order to deduce that ${\displaystyle S_{x}=S_{y}}$.

Let ${\displaystyle p}$ be an element of the intersection. Then by definition of ${\displaystyle S_{x}}$ and ${\displaystyle S_{y}}$, the two ${\displaystyle (x,p)}$ and ${\displaystyle (y,p)}$ are members of ${\displaystyle R}$, and by symmetry of this relation ${\displaystyle (p,x)}$ and ${\displaystyle (p,y)}$ are also members of ${\displaystyle R}$. To show that ${\displaystyle S_{x}=S_{y}}$ we will show each is a subset of the other.

Assume that ${\displaystyle q\in S_{x}}$ so that ${\displaystyle (q,x)\in R}$. Use transitivity along with ${\displaystyle (x,p)\in R}$ to conclude that ${\displaystyle (q,p)}$ is also an element of ${\displaystyle R}$. But ${\displaystyle (p,y)\in R}$ so another use of transitivity gives that ${\displaystyle (q,y)\in R}$. Thus ${\displaystyle q\in S_{y}}$. Therefore ${\displaystyle q\in S_{x}}$ implies ${\displaystyle q\in S_{y}}$, and so ${\displaystyle S_{x}\subseteq S_{y}}$.

The same argument in the other direction gives the other inclusion, and so the two sets are equal, completing the contrapositive argument.

}}We call each part of a partition an equivalence class (or informally, "part").

We somtimes pick a single element of each equivalence class to be the class representative.

Usually when we pick representatives we have some natural scheme in mind. In that case we call them the canonical representatives.

An example is the simplest form of a fraction. We've defined ${\displaystyle 3/5}$ and ${\displaystyle 9/15}$ to be equivalent fractions. In everyday work we often use the "simplest form" or "reduced form" fraction as the class representatives.

Linear Algebra
 ← Techniques of Proof Sets, Functions, Relations Licensing And History →