Logic and the set theory - Lecture 15: Relations in How to Prove It.

Logic and the set theory
Lecture 15: Relations in How to Prove It.
S. Choi
Department of Mathematical Science
KAIST, Daejeon, South Korea
Fall semester, 2012
S. Choi (KAIST)
Logic and set theory
October 30, 2012
1 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
Ordering relations
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
Ordering relations
Closures
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
Ordering relations
Closures
Equivalence relations
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
Ordering relations
Closures
Equivalence relations
Course homepages: http://mathsci.kaist.ac.kr/~schoi/logic.html
and the moodle page http://moodle.kaist.ac.kr
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
About this lecture
Ordered pairs and Cartesian products
Relations
More about relations
Ordering relations
Closures
Equivalence relations
Course homepages: http://mathsci.kaist.ac.kr/~schoi/logic.html
and the moodle page http://moodle.kaist.ac.kr
Grading and so on in the moodle. Ask questions in moodle.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
2 / 15
Introduction
Some helpful references
Sets, Logic and Categories, Peter J. Cameron, Springer. Read Chapters 3,4,5.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
3 / 15
Introduction
Some helpful references
Sets, Logic and Categories, Peter J. Cameron, Springer. Read Chapters 3,4,5.
http://plato.stanford.edu/contents.html has much resource.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
3 / 15
Introduction
Some helpful references
Sets, Logic and Categories, Peter J. Cameron, Springer. Read Chapters 3,4,5.
http://plato.stanford.edu/contents.html has much resource.
Introduction to set theory, Hrbacek and Jech, CRC Press. (Chapter 2)
S. Choi (KAIST)
Logic and set theory
October 30, 2012
3 / 15
Cartesian products
Cartesian products
A, B sets. A × B = {(a, b)|a ∈ A ∧ b ∈ B}.
R × R Cartesian plane (Introduced by Descartes,.. used by Newton) First
algebraic interpretation of curves...
P(x, y ) The truth set of P(x, y ) = {(a, b) ∈ A × B|P(a, b)}.
x + y = 1: {(a, b) ∈ R × R|a + b = 1}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
4 / 15
Cartesian products
Theorem
Suppose that A, B, C, D are sets.
(i) A × (B ∩ C) = (A × B) ∩ (A × C).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
5 / 15
v)
Cartesian products
Theorem
Suppose that A, B, C, D are sets.
(i) A × (B ∩ C) = (A × B) ∩ (A × C).
A × (B ∪ C) = (A × B) ∪ (A × C).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
5 / 15
v)
Cartesian products
Theorem
Suppose that A, B, C, D are sets.
(i) A × (B ∩ C) = (A × B) ∩ (A × C).
A × (B ∪ C) = (A × B) ∪ (A × C).
(A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
5 / 15
v)
Cartesian products
Theorem
Suppose that A, B, C, D are sets.
(i) A × (B ∩ C) = (A × B) ∩ (A × C).
A × (B ∪ C) = (A × B) ∪ (A × C).
(A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D).
(A × B) ∪ (C × D) ⊂ (A ∪ C) × (B ∪ D).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
5 / 15
v)
Cartesian products
Theorem
Suppose that A, B, C, D are sets.
(i) A × (B ∩ C) = (A × B) ∩ (A × C).
A × (B ∪ C) = (A × B) ∪ (A × C).
(A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D).
(A × B) ∪ (C × D) ⊂ (A ∪ C) × (B ∪ D).
A × ∅ = ∅ × A = ∅.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
5 / 15
v)
Cartesian products
Proof of 1
(v)
Given
A, B, C
S. Choi (KAIST)
Goal
A × (B ∩ C) = (A × B) ∩ (A × C)
Logic and set theory
October 30, 2012
6 / 15
Cartesian products
Proof of 1
S. Choi (KAIST)
Given
A, B, C
Goal
A × (B ∩ C) = (A × B) ∩ (A × C)
Given
A, B, C
Goal
A × (B ∩ C) ⊂ (A × B) ∩ (A × C)
(A × B) ∩ (A × C) ⊂ A × (B ∩ C)
Logic and set theory
October 30, 2012
6 / 15
Cartesian products
Proof of 1
⊂ part only
Given
A, B, C
a, b
S. Choi (KAIST)
Goal
(a, b) ∈ A × (B ∩ C) → (a, b) ∈ (A × B) ∩ (A × C)
Logic and set theory
October 30, 2012
7 / 15
Cartesian products
Proof of 1
⊂ part only
Given
A, B, C
a, b
Goal
(a, b) ∈ A × (B ∩ C) → (a, b) ∈ (A × B) ∩ (A × C)
Given
A, B, C
(a, b) ∈ A × (B ∩ C)
S. Choi (KAIST)
Goal
(a, b) ∈ (A × B) ∧ (a, b) ∈ (A × C)
Logic and set theory
October 30, 2012
7 / 15
Relations
Example
A and B are sets. Then R ⊂ A × B is a relation from A to B.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
8 / 15
Relations
Example
A and B are sets. Then R ⊂ A × B is a relation from A to B.
Domain of R: Dom(R) := {a ∈ A|∃b ∈ B((a, b) ∈ B)}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
8 / 15
Relations
Example
A and B are sets. Then R ⊂ A × B is a relation from A to B.
Domain of R: Dom(R) := {a ∈ A|∃b ∈ B((a, b) ∈ B)}.
Range of R: Ran(R) := {b ∈ B|∃a ∈ A((a, b) ∈ A)}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
8 / 15
Relations
Example
A and B are sets. Then R ⊂ A × B is a relation from A to B.
Domain of R: Dom(R) := {a ∈ A|∃b ∈ B((a, b) ∈ B)}.
Range of R: Ran(R) := {b ∈ B|∃a ∈ A((a, b) ∈ A)}.
R −1 := {(b, a) ∈ B × A|(a, b) ∈ R}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
8 / 15
Relations
Example
A and B are sets. Then R ⊂ A × B is a relation from A to B.
Domain of R: Dom(R) := {a ∈ A|∃b ∈ B((a, b) ∈ B)}.
Range of R: Ran(R) := {b ∈ B|∃a ∈ A((a, b) ∈ A)}.
R −1 := {(b, a) ∈ B × A|(a, b) ∈ R}.
If S is a relation from B to another set C, then
S ◦ R := {(a, c) ∈ A × C|∃b ∈ B((a, b) ∈ R ∧ (b, c) ∈ S)}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
8 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
L = {(s, r ) ∈ S × R| The student s lives in a room r.}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
L = {(s, r ) ∈ S × R| The student s lives in a room r.}.
L−1 = {(r , s) ∈ R × S| The room r has s as a tenant}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
L = {(s, r ) ∈ S × R| The student s lives in a room r.}.
L−1 = {(r , s) ∈ R × S| The room r has s as a tenant}.
E ◦ L−1 = {(r , c) ∈ R × C|∃s ∈ S((r , s) ∈ L−1 ∧ (s, c) ∈ E)}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
L = {(s, r ) ∈ S × R| The student s lives in a room r.}.
L−1 = {(r , s) ∈ R × S| The room r has s as a tenant}.
E ◦ L−1 = {(r , c) ∈ R × C|∃s ∈ S((r , s) ∈ L−1 ∧ (s, c) ∈ E)}.
= {(r , c) ∈ R × C| The student s lives in a room r and enrolled in course c.}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Examples
E = {(c, s) ∈ C × S| The student s is enrolled in course c }.
E −1 = {(s, c) ∈ S × C| The course c has s as a student}.
L = {(s, r ) ∈ S × R| The student s lives in a room r.}.
L−1 = {(r , s) ∈ R × S| The room r has s as a tenant}.
E ◦ L−1 = {(r , c) ∈ R × C|∃s ∈ S((r , s) ∈ L−1 ∧ (s, c) ∈ E)}.
= {(r , c) ∈ R × C| The student s lives in a room r and enrolled in course c.}.
= {(r , c) ∈ R × C| Some student living in a room r is enrolled in course c.}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
9 / 15
Relations
Theorem
(R −1 )−1 = R.
Dom(R −1 ) = Ran(R).
Ran(R −1 ) = Dom(R).
T ◦ (S ◦ R) = (T ◦ S) ◦ R.
(S ◦ R)−1 = R −1 ◦ S −1 . ( note order)
S. Choi (KAIST)
Logic and set theory
October 30, 2012
10 / 15
Relations
Proof of 5
Given
R, S
S. Choi (KAIST)
Goal
(S ◦ R)−1 = R −1 ◦ S −1
Logic and set theory
October 30, 2012
11 / 15
Relations
Proof of 5
S. Choi (KAIST)
Given
R, S
Goal
(S ◦ R)−1 = R −1 ◦ S −1
Given
R, S
Goal
(S ◦ R)−1 ⊂ R −1 ◦ S −1
R −1 ◦ S −1 ⊂ (S ◦ R)−1
Logic and set theory
October 30, 2012
11 / 15
Relations
Proof of 5
Given
R, S
Goal
(S ◦ R)−1 = R −1 ◦ S −1
Given
R, S
Goal
(S ◦ R)−1 ⊂ R −1 ◦ S −1
R −1 ◦ S −1 ⊂ (S ◦ R)−1
Given
R, S
(s, r ) ∈ (S ◦ R)−1
S. Choi (KAIST)
Goal
(s, r ) ∈ R −1 ◦ S −1
Logic and set theory
October 30, 2012
11 / 15
Relations
Proof of 5
Given
R, S
Goal
(S ◦ R)−1 = R −1 ◦ S −1
Given
R, S
Goal
(S ◦ R)−1 ⊂ R −1 ◦ S −1
R −1 ◦ S −1 ⊂ (S ◦ R)−1
Given
R, S
(s, r ) ∈ (S ◦ R)−1
Given
R, S
(r , s) ∈ (S ◦ R)
S. Choi (KAIST)
Goal
(s, r ) ∈ R −1 ◦ S −1
Goal
∃t((s, t) ∈ S −1 ∧ (t, r ) ∈ R −1 )
Logic and set theory
October 30, 2012
11 / 15
Relations
Proof of 5 continued
Given
R, S
∃p((r , p) ∈ R ∧ (p, s) ∈ S)
S. Choi (KAIST)
Goal
∃t((s, t) ∈ S −1 ∧ (t, r ) ∈ R −1 )
Logic and set theory
October 30, 2012
12 / 15
Relations
Proof of 5 continued
Given
R, S
∃p((r , p) ∈ R ∧ (p, s) ∈ S)
Given
R, S
((r , p0 ) ∈ R ∧ (s, p0 ) ∈ S)
S. Choi (KAIST)
Goal
∃t((s, t) ∈ S −1 ∧ (t, r ) ∈ R −1 )
Goal
∃t((r , t) ∈ R ∧ (t, s) ∈ S)
Logic and set theory
October 30, 2012
12 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
One can draw a directed graph for a relation with itself. (See P. 181 HTP).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
One can draw a directed graph for a relation with itself. (See P. 181 HTP).
Example: A = {1, 2}, B = {∅, {1}, {2}, {1, 2}}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
One can draw a directed graph for a relation with itself. (See P. 181 HTP).
Example: A = {1, 2}, B = {∅, {1}, {2}, {1, 2}}.
I
S = {(x, y ) ∈ B × B|x ⊂ y }.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
One can draw a directed graph for a relation with itself. (See P. 181 HTP).
Example: A = {1, 2}, B = {∅, {1}, {2}, {1, 2}}.
I
I
S = {(x, y ) ∈ B × B|x ⊂ y }.
{{∅, ∅}, {∅, {1}}, {∅, {2}}, {∅, {1, 2}}, {{1}, {1}}, {{1}, {1, 2}},
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Relations as graphs
One can draw diagrams to represent the relations: particularly when it is finite.
(See Page 175 HTP).
A relation with itself. R ⊂ A × A.
The identity relation iA = {(x, y ) ∈ A|x = y }.
One can draw a directed graph for a relation with itself. (See P. 181 HTP).
Example: A = {1, 2}, B = {∅, {1}, {2}, {1, 2}}.
I
I
I
S = {(x, y ) ∈ B × B|x ⊂ y }.
{{∅, ∅}, {∅, {1}}, {∅, {2}}, {∅, {1, 2}}, {{1}, {1}}, {{1}, {1, 2}},
{{2}, {2}}, {{2}, {1, 2}}, {{1, 2}, {1, 2}}}.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
13 / 15
More about relations
Types of self relations
A reflexive relation: R ⊂ A × A is reflexive if ∀x ∈ A(xRx).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
14 / 15
More about relations
Types of self relations
A reflexive relation: R ⊂ A × A is reflexive if ∀x ∈ A(xRx).
R is symmetric if ∀x∀y (xRy → yRx).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
14 / 15
More about relations
Types of self relations
A reflexive relation: R ⊂ A × A is reflexive if ∀x ∈ A(xRx).
R is symmetric if ∀x∀y (xRy → yRx).
R is transitive if ∀x∀y ∀z((xRy ∧ yRz) → xRz).
S. Choi (KAIST)
Logic and set theory
October 30, 2012
14 / 15
More about relations
Types of self relations
A reflexive relation: R ⊂ A × A is reflexive if ∀x ∈ A(xRx).
R is symmetric if ∀x∀y (xRy → yRx).
R is transitive if ∀x∀y ∀z((xRy ∧ yRz) → xRz).
Z. x < y . x ≤ y ....
S. Choi (KAIST)
Logic and set theory
October 30, 2012
14 / 15
More about relations
Types of self relations
A reflexive relation: R ⊂ A × A is reflexive if ∀x ∈ A(xRx).
R is symmetric if ∀x∀y (xRy → yRx).
R is transitive if ∀x∀y ∀z((xRy ∧ yRz) → xRz).
Z. x < y . x ≤ y ....
S. Choi (KAIST)
Logic and set theory
October 30, 2012
14 / 15
More about relations
Theorem
1
R ⊂ A × A is reflexive iff iA ⊂ R.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
15 / 15
More about relations
Theorem
1
R ⊂ A × A is reflexive iff iA ⊂ R.
2
R is symmetric iff R −1 = R.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
15 / 15
More about relations
Theorem
1
R ⊂ A × A is reflexive iff iA ⊂ R.
2
R is symmetric iff R −1 = R.
3
R is transitive iff R ◦ R ⊂ R.
S. Choi (KAIST)
Logic and set theory
October 30, 2012
15 / 15