<<

3P ≡ Elements of Theory Let be an on a nonempty set A. The quotient set A/≡ = {[x]: x ∈ A} is a partition of A.

Chapter 3: Relations and Functions Proof. 1 For any x, y ∈ A, by 3.13 (iii), January 28 & 30, 2014 [x] 6= [y] =⇒ [x] ∩ [y] = ∅. [ 2 A = [x]. Indeed, [x] = {a ∈ A : x ≡ a}⊆ A for any x ∈ A, which x∈A [ Teacher: Fan Yang leads to [x] ⊆ A. x∈A [ On the other hand, A ⊆ [x] since x∈A [ [ y ∈ A =⇒ y ∈ [y] ⊆ [x] =⇒ y ∈ [x]. x∈A x∈A 1/36 2/36

The converse of the preceding theorem also holds: Theorem 3.16 Let Π be a partition of a nonempty set A. The relation ≡ defined as follows is an equivalence relation on A: for any x, y ∈ A, x ≡ y ⇐⇒ there exists X ∈ Π such that x, y ∈ X.

X

Y Functions

Z Proof. By definition, ≡ is clearly reflexive and symmetric. It remains to show that ≡ is transitive. For any x, y, z ∈ A such that x ≡ y and y ≡ z, by the definition of ≡, there exist X, Y ∈ Π such that x, y ∈ X and y, z ∈ Y . Hence y ∈ X ∩ Y 6= ∅, which implies X = Y as Π is a partition. It then follows that x, z ∈ X = Y , thereby x ≡ z. 3/36 4/36 (x1, x2)

(y1, y2)

(z1, z2)

Definition 3.17 A is a binary relation F such that for each x ∈dom F, there is The squaring function f : R → R is defined as f (x) = x2. The action of a unique y such that (x, y) ∈ F. f on particular elements of R can be described by writing √ The unique y is called the value of F at x, denoted byF (x). −2 7→ 4, 2 7→ 2, 2 7→ 4, 3 7→ 9, etc. If dom F = X and ran F ⊆ Y , then we write F : X → Y and say that F is Each individual action can be represented by an : a function from X into Y , or that F maps X into Y. √ (−2, 4), ( 2, 2), (2, 4), (3, 9), etc. X Y X Y The set y1 y1 2 F = {(x, y) ∈ R × R | y = x } x1 y2 x1 y2 x2 y3 x2 y3 of all such ordered pairs adequately represents the squaring function x3 y4 x3 y4 f , and is called the graph of f . In , we simply take this set F y5 y5 of ordered pairs to be the function f . F R Clearly, the set F ⊆ R × R is a relation such that for any x ∈dom F, there is a unique y such that (x, y) ∈ F. For example: The relation F = {(x, y) ∈ R × R | y = x2} is a function, + dom F = R and ran F = R ∪ {0}. We write F : R → R. The relation R = {(x, y) ∈ R × R | x2 + y 2 = 4} is not a function, 5/36 since e.g., (0, 2), (0, −2) ∈ R. 6/36

The domain of a function can be a set of ordered pairs or n-. For Definition 3.19 example, addition is a function + : R × R → R. In this case, in place of Let F : X → Y be a function from X into Y . +((a, b)), we write either +(a, b) or a + b. If ran F = Y , then we say that F is surjective or F is a function from X ontoY. Fact 3.18 If for any x , x ∈ X, If F and G are functions for which dom F = dom G and 1 2 x1 6= x2 =⇒ F(x1) 6= F(x2), F(x) = G(x) then we say that F is one-to-one or injective. for every x ∈ dom F, then F = G. If F is both surjective and injective, then F is called a .

Proof. Indeed, by the definition of functions, we have that X Y X Y X Y y (x, y) ∈ F ⇐⇒ x ∈ dom F and y = F(x) 1 x1 y21 x1 y1 x1 y1 ⇐⇒ x ∈ dom G and y = G(x) (by assumption) x2 y3 x2 y2 x2 y2 x y x y x y ⇐⇒ (x, y) ∈ G. 3 42 3 3 3 3 y5 y4 F F F Hence F = G. surjective injective bijection

7/36 8/36 (x1, x2)

(y1, y2)

(z1, z2)

Note: A function F : X → Y is surjective iff for each y ∈ Y , there exists Definition 3.20 x ∈ X such that F(x) = y. A relation R is said to be single-rooted iff for each y ∈ ranR, there is only one x such that xRy. For example: Consider the function F : R → R, defined as F(x) = x2. X Y + y1 F is not surjective, since ran F = R ∪ {0}= 6 R. x1 y2

F is not injective, since e.g. F(2) = 4 = F(−2). x2 y3

x3 y4 3 Consider the function G : R → R, defined as G(x) = x . y √ 5 G is surjective, since for each y ∈ R, we have that G( 3 y) = y. R 3 3 not single-rooted G is injective, since G(x1) = G(x2) =⇒ x1 = x2 =⇒ x1 = x2. Thus G is a bijection. Clearly, if F is a function, then F is single-rooted iff F is one-to-one.

9/36 10/36

Theorem 3K Definition 3.21 Let F be a relation. Let F be an arbitrary relation, and A a set. (a)F [A ∪ B] = F[A] ∪ F[B]. The restriction of F to A is the set (b)F [A ∩ B] ⊆ F[A] ∩ F[B]. Equality holds if F is single-rooted. F  A = {(x, y) | xFy ∧ x ∈ A}. (b)F [A] − F[B] ⊆ F[A − B]. Equality holds if F is single-rooted. The of A under F is the set F[A] = ran (F  A) = {y | ∃x ∈ A(xFy)}. X Y x y In particular, if F is a function, then F[A] = {F(x) | x ∈ A}. 1 1 y2 x2 y X Y X Y 3 a0 a0 x3 y4 0 a1 0 a1 F 1 a2 1 a2 2 a3 2 a3 Proof. (a). y ∈ F[A ∪ B] ⇐⇒ ∃x ∈ A ∪ B s.t. xFy a a 3 4 3 4 ⇐⇒ (∃x ∈ A s.t. xFy ) or (∃x ∈ B s.t. xFy) F F ⇐⇒ y ∈ F[A] or y ∈ F[B] ⇐⇒ y ∈ F[A] ∪ F[B].

11/36 12/36 Definition 3.22 Let F be a relation. The inverse of F is the set (b). y ∈ F[A ∩ B] ⇐⇒ ∃x ∈ A ∩ B s.t. xFy F −1 = {(y, x) | xFy}. =⇒ (∃x ∈ A s.t. xFy) and (∃x0 ∈ B s.t. x0Fy) ⇐⇒ y ∈ F[A] and y ∈ F[B] Note: (F −1)−1 = F ⇐⇒ y ∈ F[A] ∩ F[B]. In general, even if F is a function, F −1 is not necessarily a If F is single-rooted, then in the second line of the above expression, function, but F −1 is a single-rooted relation, i.e., for any x = x0, which means that the second arrow is reversible. x ∈ ran F −1, there is only one y such that yF −1x.

(c). y ∈ F[A] − F[B] ⇐⇒ y ∈ F[A] and y ∈/ F[B] Since the inverse of a function is always single-rooted, the following ⇐⇒ (∃x ∈ A s.t. xFy) and (¬∃x ∈ B(xFy)) corollary is an immediate consequence of the Theorem 3K. =⇒ ∃x ∈ A − B s.t. xFy Corollary 3L ⇐⇒ y ∈ F[A − B]. For any function G and sets A, B: If F is single-rooted, then the thrid arrow is reversible. (a)G −1[A ∪ B] = G−1[A] ∪ G−1[B]. (b)G −1[A ∩ B] = G−1[A] ∩ G−1[B]. (b)G −1[A] − G−1[B] = G−1[A − B]

13/36 14/36

0 Definition 3.23 Since F is a function, we derive that y = y . Furthermore, since G is a function, yGz and yGz0 implies that z = z0, as desired. Let F, G be arbitrary relations. The composition of F and G is the set G ◦ F = {(x, z) | ∃y(xFy ∧ yGz)}. For any x ∈ X, we have that (x, F(x)) ∈ F and (F(x), G(F(x))) ∈ G, thus (x, G(F(x))) ∈ G ◦ F, which implies that G ◦ F(x) = G(F(x)), as X Y Z G ◦ F is a function.

y1 z1 x1 z2 Theorem 3I x2 y2 z3 x3 For any relations F and G, y3 z4 (G ◦ F)−1 = F −1 ◦ G−1. F G Proof. For any ordered pair (z, x), Theorem 3H If F : X → Y and G : Y → Z are functions, then G ◦ F : X → Z is a (z, x) ∈ (G ◦ F)−1 ⇐⇒ (x, z) ∈ G ◦ F function, and G ◦ F(x) = G(F(x)) for all x ∈ X. ⇐⇒ xFy ∧ yGz, for some y − − Proof. We first check that G ◦ F is a function. Suppose that x(G ◦ F)z ⇐⇒ yF 1x ∧ zG 1y, for some y 0 0 and x(G ◦ F)z . Then there exist y, y ∈ Y such that ⇐⇒ (z, x) ∈ F −1 ◦ G−1 xFy ∧ yGz and xFy 0 ∧ y 0Gz0.

15/36 16/36 Definition 3.24 −1 Given a nonempty set A. The idA : A → A on A is “⇐=”: Suppose F is one-to-one. It is easy to see that F is a function defined as from ran F ⊆ Y into X. We extend F −1 to a function G : Y → X with idA = {(x, x) | x ∈ A}. the required property. Pick an arbitrary a ∈ X. Define

Clearly, idA(x) = x for all x ∈ A. X Y y1 Theorem 3J ( x y F −1(y), if y ∈ ran F 1 2 Let F : X → Y be a function, A 6= ∅. G(y) = x2 y3 a, otherwise. x y (a) There exists a function G : Y → X (a “left inverse”) such 3 4 y5 that G ◦ F = idX iff F is one-to-one. F (b) There exists a function H : Y → X (a “right inverse”) such Now, for any x ∈ X, F(x) ∈ ran F, thereby that F ◦ H = idY iff F is surjective. G ◦ F(x) = G(F(x)) = F −1(F(x)) = x = id (x). Proof. (a) “=⇒”: Suppose G is a left inverse of F. For any a, b ∈ X, X Hence G ◦ F = idX , namely, G is the left inverse of F. F(a) = F(b) =⇒ G ◦ F(a) = G ◦ F(b) =⇒ idX (a) = idX (b) =⇒ a = b.

17/36 18/36

(b) “=⇒”: Suppose H is a right inverse of F. For any y ∈ Y ,

y = idY (y) = F ◦ H(y) = F(H(y)), where H(y) ∈ X, thus F is surjective. “⇐=”: Suppose F is surjective. The idea is that for each y ∈ Y = ran F, we choose an x ∈ X such that F(x) = y, and let H(y) = x. Now, by of Choice, for the relation F −1, there is a function For one y, we know there exists an appropriate x, but in general we H ⊆ F −1 such that dom H =dom F −1 = Y . have no way of defining any particular choice of x. So to guarantee Next, we check that H is a right inverse of F. For any y ∈ Y , that we indeed can form the function H : Y → X, an axiom is needed: (y, H(y)) ∈ H ⊆ F −1 =⇒ (y, H(y)) ∈ F −1 =⇒ (H(y), y) ∈ F, X x1 Y x y 2 1 thus F(H(y)) = y= id (y). x3 y2 Y x4 y3 . x5 . x6 . F −1 .

Axiom of Choice (First form) For any relation R, there is a function H ⊆ R with dom H = dom R.

19/36 20/36 Definition 3.25 Let A and B be sets. The set of all functions F from A into B is denoted Example 3.3: If A and B are finite sets with a and b elements, A by B. That is, respectively, then the set AB has ba elements. AB = {F ⊆ A × B | F : A → B is a function}. A B y ω 1 Example 3.1: Let ω = {0, 1, 2,... }. Then {0, 1} is the set of all x1 y2 function f : ω → {0, 1}. Such an f can be viewed as an infinite binary x2 y3 . . hf (0), f (1), f (2),... i of 0’s and 1’s. . . xa yb Example 3.2: We have that Note that for each of the a elements of A, we can choose among b A ∅ = {f ⊆ A × ∅ | f : A → ∅} = ∅ points in B into which it could be mapped. Thus, the number of ways of for any set A 6= ∅. On the other hand, making all a such choices is b ····· b. |{z} a times ∅B = {f ⊆ ∅ × B | f : ∅ → B} = {∅} for any set B. In particular, ∅∅ = {∅}.

21/36 22/36

For a function F : I → A, we sometimes write Fi for the value F(i).

We sometimes represent a set F of sets as a collection of indexed sets: Infinite Cartesian Products F = {Fi | i ∈ I}. This set F corresponds to a function F such that I ⊆ dom F and

F(i) = Fi , for each i ∈ I.

23/36 24/36 We have defined finite Cartesian products as Example 3.5: If the index set I = ω = {0, 1, 2,... }, then

A1 × · · · × An = (A1 × · · · × An−1) × An Y [ | {z } | {z } Hn = {f : ω → Hn | ∀n ∈ ω(f (n) ∈ Hn)}. n n−1 n∈ω n∈ω for each n. In general, we define infinite Cartesian product as follows: Q So n∈ω Hn consists of “ω-” that have for their nth term Definition 3.26 some member of Hn. A typical member is a “thread” in the following Let I be a set, and H a function such that I ⊆ dom H. Define the picture that selects a point from each set. Cartesian product of the Hi ’s for all i ∈ I as Y [ Hi = {f : I → Hi | ∀i ∈ I(f (i) ∈ Hi )}. i∈I i∈I

... Example 3.4: If for every i ∈ I, we have Hi = A for some fixed set A, H0 H1 H2 H3 H4 then Y Y [ Example 3.6: In particular, if I = ∅, then Hi = A = {f : I → A | ∀i ∈ I(f (i) ∈ A)} i∈I i∈I i∈I Y [ Hi = {f : ∅ → Hi | ∀i ∈ ∅(f (i) ∈ Hi )} = {f : ∅ → ∅} = {∅}. I = {f : I → A | ∀i ∈ I(f (i) ∈ A)} = A. i∈∅ i∈∅

25/36 26/36

Q We have so far encountered two forms of . The two If Hi is empty for some i ∈ I, then i∈I Hi = ∅. Conversely, if Hi 6= ∅ for Q forms are equivalent. each i ∈ I, do we know that i∈I Hi 6= ∅? This requires an axiom: Recall the first form: Axiom of Choice (2nd form) Axiom of Choice (First form) For any set I and any function H with I ⊆ dom H, if Hi 6= ∅ for all i ∈ I, Q For any relation R, there is a function F ⊆ R with dom F = dom R. then i∈I Hi 6= ∅.

dom R ran R y1 x1 y2 x2 y3 x3 y4 . . y5 H H H H H ... y6 i0 i1 i2 i3 i4 . R .

27/36 28/36 Theorem 6M The First and the Second form of Axiom of Choice are equivalent, that Proof. (of Theorem 6M) (1)=⇒(2): Suppose I is a set and H is a is, the following two statements are equivalent: function such that I ⊆ dom H and Hi 6= ∅ for all i ∈ I. We want to show that (1) For any relation R, there is a function F ⊆ R with dom F = dom R. Y [ Hi = {f : I → Hi | ∀i ∈ I(f (i) ∈ Hi )}= 6 ∅. (2) For any set I and any function H with I ⊆ dom H, if Hi 6= ∅ for all Q i∈I i∈I i ∈ I, then i∈I Hi 6= ∅. Q If I = ∅ then i∈I Hi = {∅}= 6 ∅. Now, assume I 6= ∅. In order to utilize Recall: (1), consider the relation A function F : I → A is a set R = {(i, x) | i ∈ I ∧ x ∈ Hi }. F = {(i, F(i)) | i ∈ I}. By (1), there is a function F ⊆ R with dom F = dom R = I. For each Let R be a relation. For any set A, i ∈ I, we have that R[A] = {y | ∃x ∈ A((x, y) ∈ R)}. (i, F(i)) ∈ F ⊆ R =⇒ (i, F(i)) ∈ R =⇒ F(i) ∈ Hi . In particular, for every i ∈ dom R, Hence we conclude that F ∈ Q H , as desired. R[{i}] = {y | (i, y) ∈ R}, i∈I i i.e., y ∈ R[{i}] ⇐⇒ (i, y) ∈ R.

29/36 30/36

(2)=⇒(1): Let R be an arbitrary relation. If R = ∅, then the empty function F = ∅ satisfies the condition in (1). Now, assume R 6= ∅. Let dom R = I. In order to utilize (2), consider the function H : I → {R[{i}] | i ∈ I} defined as

Hi = R[{i}], for all i ∈ I. Since i ∈ dom R, we have that R[{i}] 6= ∅ for each i ∈ I. By (2), Operations Q i∈I Hi 6= ∅, meaning that there exists a function Y [ F ∈ Hi = {f : I → Hi | ∀i ∈ I(f (i) ∈ Hi )}. (∗) i∈I i∈I

Clearly, dom F = I = dom R. It remains to check that F ⊆ R.

We have that (∗) implies that F(i) ∈ Hi = R[{i}] for any i ∈ I, namely, (i, F(i)) ∈ R for any i ∈ I, which implies F ⊆ R.

31/36 32/36 Let ≡ be an equivalence relation on A = {0, 1, 2} defined by x ≡ y ⇐⇒ 2 | x − y. Thus there are two distinct equivalence classes: Definition 3.27 [0] = [2] = {0, 2} and [1] = {1}, An n-ary on a set A is a function from A × · · · × A into A. | {z } n and S/≡ = {[0], [1]} = {{0, 2}, {1}}. Consider the following operation ∗ on A: For example x ∗ y = min{x, y} for all x, y ∈ A. Addition + : Z × Z → Z, multiplication · : Z × Z → Z are binary operations on Z. Instead of writing +(m, n) and ·(m, n), we will Can the following expression define an operation on the set A/≡ write m + n and m · n. [x] [y] = [x ∗ y] for all [x], [y] ∈ A/ ? The function s : ω → ω defined by ≡

s(n) = n + 1 Answer: No. Since [0] = [2] requires [0] [1] = [2] [1], whereas

is a unary operation on ω. [0] [1] = [0 ∗ 1] = [0], 6 = [2] [1] = [2 ∗ 1] = [1].

33/36 34/36

Example 3.7: Let + be the ordinary addition on Z, and ≡ the Let ∗ be an operation on a non- A, and ≡ an equivalence equivalence relation on Z defined by relation on A. x ≡ y ⇐⇒ 3 | x − y. Define an operation on the quotient set A/ by putting ≡ Define an operation ⊕ on the quotient set Z/≡ by [x] [y] = [x ∗ y] for all [x], [y] ∈ A/≡. [x] ⊕ [y] = [x + y] for all x, y ∈ Z. We say that is well-defined if for all x, x0, y, y 0 ∈ A, Show that ⊕ is well-defined.

0 0 0 0 0 0 [x] = [x ] and [y] = [y ], Proof. Let x, x , y, y ∈ Z be such that [x] = [x ] and [y] = [y ]. We proceed to show that imply that [x + y] = [x0 + y 0]. [x] [y] = [x0] [y 0], From the assumption [x] = [x0] and [y] = [y 0] it follows that or equivalently 3 | x − x0 and 3 | y − y 0, [x ∗ y] = [x0 ∗ y 0]. which imply that 3 | (x − x0) + (y − y 0), i.e., 3 | (x + y) − (x0 + y 0), namely [x + y] = [x0 + y 0]. 35/36 36/36