2.1 Sets
Basic operations:
- Union: A∪B=x:x∈Aorx∈B
- Intersection: A∩B=x:x∈Aandx∈B
- Difference: A∖B=x:x∈Aandx∈/B
- Complement: Ac=U∖A (where U is the universal set)
De Morgan”s Laws:
(A∪B)c=Ac∩Bc,(A∩B)c=Ac∪Bc
Power set: P(A)=B:B⊆A. If ∣A∣=nThen ∣P(A)∣=2n.
2.2 Relations
A binary relation R from set A to set B is a subset of A×B.
A relation R on A is:
- Reflexive: ∀a∈A, (a,a)∈R.
- Symmetric: (a,b)∈R⟹(b,a)∈R.
- Antisymmetric: (a,b)∈R and (b,a)∈R⟹a=b.
- Transitive: (a,b)∈R and (b,c)∈R⟹(a,c) \in R$.
Equivalence relation: reflexive, symmetric, transitive. Partitions the set into equivalence classes.
Partial order: reflexive, antisymmetric, transitive. Written (A,⪯).
A Hasse diagram is a graphical representation of a finite poset (A,⪯): an element a Is drawn below b whenever a≺b (i.e., a⪯b and a=b), and an edge is drawn From a to b whenever b covers a (there is no c with a≺c≺b).
Worked Example. Show that R on ′Z′ defined by aRb iff a≡b(mod5) is An equivalence relation. Describe the equivalence classes.
Solution
Reflexive: a−a=0=5⋅0So a≡a(mod5) for all a.
Symmetric: If a≡b(mod5)Then 5∣(a−b)So 5∣(b−a)Giving b≡a(mod5).
Transitive: If 5∣(a−b) and 5∣(b−c)Then 5∣(a−b)+(b−c)=a−cSo a≡c(mod5).
The equivalence classes are [0]=5k:k∈′Z′ [1]=5k+1:k∈′Z′ [2]=5k+2:k∈′Z′ [3]=5k+3:k∈′Z′ [4]=5k+4:k∈′Z′. There are exactly 5 equivalence classes, forming the quotient ′Z′/5′Z′.
Worked Example. Let ⪯ be divisibility on A=1,2,3,4,6,12: a⪯b iff a∣b. Verify this is a partial order and identify the cover relations.
Solution
Reflexive: a∣a for all a∈A. ✓
Antisymmetric: If a∣b and b∣aThen b=ka and a=lb for positive k,l So a=lkaGiving lk=1 and l=k=1Hence a=b. ✓
Transitive: If a∣b and b∣cThen c=lb=l(ka)=(lk)aSo a∣c. ✓
Cover relations (b covers a when a∣b and no element lies strictly between):
- 12 covers 6, 4
- 6 covers 2, 3
- 4 covers 2
- 3 covers 1
- 2 covers 1
Reading from bottom to top the Hasse diagram is: 1 at the bottom with edges to 2 and 3; 2 connects up to 4 and 6; 3 connects up to 6; 4 and 6 connect up to 12 at the top.
2.3 Functions
A function f:A→B is a relation where each a∈A appears exactly once as a first element.
- Injective (one-to-one): f(a1)=f(a2)⟹a1=a2.
- Surjective (onto): for every b∈BThere exists a∈A with f(a)=b.
- Bijective: both injective and surjective.
Theorem 2.1. If A and B are finite sets, f:A→B is:
- Injective if and only if ∣A∣≤∣B∣.
- Surjective if and only if ∣A∣≥∣B∣.
- Bijective if and only if ∣A∣=∣B∣.
Theorem 2.2 (Pigeonhole Principle). If ∣A∣>∣B∣Then no function f:A→B is injective. Equivalently, placing n items into m boxes with n>m forces at least one box to contain at least ⌈n/m⌉ items.
Function composition. Given f:A→B and g:B→CThe composition g∘f:A→C is defined by (g∘f)(a)=g(f(a)) for all a∈A.
Theorem 2.3. If f:A→B and g:B→C are both injective, then g∘f is injective.
Proof. Suppose (g∘f)(a1)=(g∘f)(a2). Then g(f(a1))=g(f(a2)). Since g is Injective, f(a1)=f(a2). Since f is injective, a1=a2. Hence g∘f is injective. ■
Theorem 2.4. If f:A→B and g:B→C are both surjective, then g∘f is surjective.
Proof. Let c∈C. Since g is surjective, ∃b∈B with g(b)=c. Since f is Surjective, ∃a∈A with f(a)=b. Then (g∘f)(a)=g(f(a))=g(b)=c. Hence g∘f is surjective. ■
Corollary 2.5. The composition of two bijections is a bijection.
A function f:A→B is invertible if there exists f−1:B→A such that f^{-1} \circ f = \mathrm{id{}_A and f \circ f^{-1} = \mathrm{id{}_B. A function is invertible If and only if it is bijective.
2.4 Countability
Definition. A set S is countable if it is finite or countably infinite. A set is countably infinite if there exists a bijection ′N′→S. A set that is not countable Is uncountable.
Theorem 2.6. ′Z′ is countably infinite.
Proof. The function f:′N′→′Z′ defined by
f(n)={n/2−(n+1)/2ifnisevenifnisodd
Is a bijection, enumerating 0,−1,1,−2,2,−3,3,… ■
Theorem 2.7. ′Q′ is countably infinite.
Proof. Every positive rational can be written as p/q with p,q∈′N′+. Arrange the Pairs (p,q) in an infinite grid and traverse them diagonally:
1/1,1/2,2/1,3/1,1/3,1/4,2/3,3/2,4/1,…
Skipping duplicates (where p/q=p′/q′ in reduced form) yields an enumeration of ′Q′+. Extending with negatives and zero gives an enumeration of ′Q′. ■
Theorem 2.8 (Cantor, 1891). ′R′ is uncountable.
Proof (Diagonal argument). Suppose for contradiction that ′R′ is countable. Then the Interval [0,1) can be listed as r1,r2,r3,… where each ri has a unique decimal Expansion ri=0.di1di2di3… with each dij∈0,1,…,9 (choosing the expansion that does not end in all 9s to avoid dual representations).
Define s=0.s1s2s3… by
si={56ifdii=5ifdii=5
Then s∈[0,1) and s differs from ri in the i-th decimal place for every i So s∈/r1,r2,…Contradicting the assumption that the list was complete. Therefore ′R′ is uncountable. ■