1.2: Relations. Mappings
( \newcommand{\kernel}{\mathrm{null}\,}\)
Relations
In §1, we have already considered sets of ordered pairs, such as Cartesian products A×B or sets of the form {(x,y)|P(x,y)} (cf. §§1–3, Problem 7). If the pair (x,y) is an element of such a set R, we write
(x,y)∈R
treating (x,y) as one thing. Note that this does not imply that x and y taken separately are members of R (in which case we would write x,y∈R). We call x, y the terms of (x,y).
In mathematics, it is customary to call any set of ordered pairs a relation. For example, all sets listed in Problem 7 of §§1–3 are relations. Since relations are sets, equality R=S for relations means that they consist of the same elements (ordered pairs), i.e., that
(x,y)∈R⟺(x,y)∈S
If (x,y)∈R, we call y an R-relative of x; we also say that y is R-related to x or that the relation R holds between x and y (in this order). Instead of (x,y)∈R, we also write xRy, and often replace “R” by special symbols like <, ∼, etc. Thus, in case (i) of Problem 7 above, “xRy” means that x<y.
Replacing all pairs (x,y)∈R by the inverse pairs (y,x), we obtain a new relation, called the inverse of R and denoted R−1. Clearly, xR−1y iff yRx; thus
R−1={(x,y)|yRx}={(y,x)|xRy}.
Hence R, in turn, is the inverse of R−1; i.e.,
(R−1)−1=R.
For example, the relations < and > between numbers are inverse to each other; so also are the relations ⊆ and ⊇ between sets. (We may treat “⊆” as the name of the set of all pairs (X,Y) such that X⊆Y in a given space.)
If R contains the pairs (x,x′),(y,y′),(z,z′),..., we shall write
R=(xyz…x′y′z′ );e.g.,R=(14132211).
To obtain R−1, we simply interchange the upper and lower rows in Equation ???.
Definition 1
The set of all left terms x of pairs (x,y)∈R is called the domain of R, denoted DR. The set of all right terms of these pairs is called the range of R, denoted D′R. Clearly, x∈DR iff xRy for some y. In symbols,
x∈DR⟺(∃y)xRy;similarly,y∈D′R⟺(∃x)xRy.
In Equation ???, DR is the upper row, and D′R is the lower row. Clearly,
DR−1=D′RandD′R−1=DR.
For example, if
R=(141221),
then
DR=D′R−1={1,4}andD′R=DR−1={1,2}.
Definition 2
The image of a set A under a relation R (briefly, the R−image of A) is the set of all R-relatives of elements of A, denoted R[A]. The inverse image of A under R is the image of A under the inverse relation, i.e., R−1[A]. If A consists of a single element, A=x, then R[A] and R−1[A] are also written R[x] and R−1[x], respectively, instead of R[x] and R−1[x].
Let
R=(11122333371345341351),A={1,2},B={2,4}.
Then
R[1]={1,3,4};R[2]={3,5};R[3]={1,3,4,5};R[5]=∅;R−1[1]={1,3,7};R−1[2]=∅;R−1[3]={1,2,3};R−1[4]={1,3};R[A]={1,3,4,5};R−1[A]={1,3,7};R[B]={3,5}.
By definition, R[x] is the set of all R-relatives of x. Thus
y∈R[x]iff(x,y)∈R;i.e.,xRy.
More generally, y∈R[A] means that (x,y)∈R for some x∈A. In symbols,
y∈R[A]⟺(∃x∈A)(x,y)∈R.
Note that R[A] is always defined.
Mappings
We shall now consider an especially important kind of relation.
Definition 3
A relation R is called a mapping (map), or a function, or a transformation, iff every element x∈DR has a unique R-relative, so that R[x] consists of a single element. This unique element is denoted by R(x) and is called the function value at x (under R). Thus R(x) is the only member of R[x].
If, in addition, different elements of DR have different images, R is called a one-to-one (or one-one) map. In this case,
x≠y(x,y∈DR) implies R(x)≠R(y);
equivalently,
R(x)=R(y) implies x=y.
In other words, no two pairs belonging to R have the same left, or the same right, terms. This shows that R is one to one iff R−1, too, is a map. Mappings are often denoted by the letters f,g,h,F,ψ, etc.
A mapping f is said to be “from A to B” iff Df=A and D′f⊆B; we then write
f:A→B("f maps A into B")
If, in particular, Df=A and D′f=B, we call f a map of A onto B, and we write
f:A⟶ontoB("f maps A onto B")
If f is both onto and one to one, we write
f:A⟷B
(f:A⟷B means that f is one to one).
All pairs belonging to a mapping f have the form (x,f(x)) where f(x) is the function value at x, i.e., the unique f-relative of x,x∈Df. Therefore, in order to define some function f, it suffices to specify its domain Df and the function value f(x) for each x∈Df . We shall often use such definitions. It is customary to say that f is defined on A (or “f is a function on A”) iff A=Df.
(a) The relation
R={(x,y)|x is the wife of y}
is a one-to-one map of the set of all wives onto the set of all husbands. R−1 is here a one-to-one map of the set of all husbands (=D′R) onto
the set of all wives (=DR).
(b) The relation
f={(x,y)|y is the father of x}
is a map of the set of all people onto the set of their fathers. It is not one to one since several persons may have the same father (f-relative), and so x≠x′ does not imply f(x)≠f(x′).
(c) Let
g=(12342238)
Then g is a map of Dg={1,2,3,4} onto D′g={2,3,8}, with
g(1)=2,g(2)=2,g(3)=3,g(4)=8
(As noted above, these formulas may serve to define g.) It is not one to one since g(1)=g(2), so g−1 is not a map.
(d) Consider
f:N→N, with f(x)=2x for each x∈N
By what was said above, f is well defined. It is one to one since x≠y implies 2x≠2y. Here Df=N( the naturals ), but D′f consists of even naturals only. Thus f is not onto N (it is onto a smaller set, the even naturals); f−1 maps the even naturals onto all of N.
The domain and range of a relation may be quite arbitrary sets. In particular, we can consider functions f in which each element of the domain Df is itself an ordered pair (x,y) or n-tuple (x1,x2,…,xn). Such mappings are called functions of two (respectively, n) variables. To any n -tuple (x1,…,xn) that belongs to Df, the function f assigns a unique function value, denoted by f(x1,…,xn). It is convenient to regard x1,x2,…,xn as certain variables; then the function value, too, becomes a variable depending on the x1,…,xn. Often Df consists of all ordered n-tuples of elements taken from a set A, i.e., Df=An (cross-product of n sets, each equal to A). The range may be an arbitrary set B; so f:An→B. Similarly, f:A×B→C is a function of two variables, with Df=A×B,D′f⊆C.
Functions of two variables are also called (binary) operations. For example, addition of natural numbers may be treated as a map f:N×N→N, with f(x,y)=x+y.
Definition 4
A relation R is said to be
(i) reflexive iff we have xRx for each x∈DR;
(ii) symmetric iff xRy always implies yRx;
(iii) transitive iff xRy combined with yRz always implies xRz.
R is called an equivalence relation on a set A iff A=DR and R has all the three properties (i), (ii), and (iii). For example, such is the equality relation on A (also called the identity map on A) denoted
IA={(x,y)|x∈A,x=y}
Equivalence relations are often denoted by special symbols resembling equality, such as ≡,≈,∼, etc. The formula xRy, where R is such a symbol, is read
"x is equivalent (orR-equivalent) to y,"
and R[x]={y|xRy} (i.e., the R-image of x) is called the R-equivalence class (briefly R-class) of x in A; it consists of all elements that are R-equivalent to x and hence to each other (for xRy and xRz imply first yRx, by symmetry, and hence yRz, by transitivity). Each such element is called a representative of the given R-class, or its generator. We often write [x] for R[x].
(a') The inequality relation < between real numbers is transitive since
x<y and y<z implies x<z
it is neither reflexive nor symmetric. (Why?)
(b') The inclusion relation ⊆ between sets is reflexive (for A⊆A) and transitive ( for A⊆B and B⊆C implies A⊆C), but it is not symmetric.
(c') The membership relation ∈ between an element and a set is neither reflexive nor symmetric nor transitive (x∈A and A∈M does not imply x∈M).
(d') Let R be the parallelism relation between lines in a plane, i.e., the set of all pairs (X,Y), where X and Y are parallel lines. Writing ‖ for R, we have X\|X, X\| Y implies Y \| X, and (X \| Y and Y \| Z) implies X \| Z, so R is an equivalence relation. An R -class here consists of all lines parallel to a given line in the plane.
(e') Congruence of triangles is an equivalence relation. (Why?)
If R (also written \equiv) is an equivalence relation on A, then all R-classes are disjoint from each other, and A is their union.
- Proof
-
Take two R-classes, [p] \neq[q]. Seeking a contradiction, suppose they are not disjoint, so
(\exists x) \quad x \in[p] \text{ and } x \in[q];
i.e., p \equiv x \equiv q and hence p \equiv q . But then, by symmetry and transitivity,
y \in[p] \Leftrightarrow y \equiv p \Leftrightarrow y \equiv q \Leftrightarrow y \in[q];
i.e., [p] and [q] consist of the same elements y, contrary to assumption [q] \neq[q]. Thus, indeed, any two (distinct) R-classes are disjoint.
Also, by reflexivity,
(\forall x \in A) \quad x \equiv x
i.e., x \in[x] . Thus each x \in A is in some R-class (namely, in [x] ) ; of A is in the union of such classes,
A \subseteq \bigcup_{x} R[x]
Conversely,
(\forall x) \quad R[x] \subseteq A
since
y \in R[x] \Rightarrow x R y \Rightarrow y R x \Rightarrow(y, x) \in R \Rightarrow y \in D_{R}=A
by definition. Thus A contains all R[x], hence their union, and so
A=\bigcup_{x} R[x] . \square