跳转到内容

离散数学 · 集合、关系、函数与基数

Notation Used in These Notes

跳转到:Notation Used in These Notes

Symbols used throughout these notes:

SymbolMeaning
x∈yx \in y / x∉yx \notin ymembership / non-membership
x⊆yx \subseteq ysubset (for any zz, z∈x⇒z∈yz\in x \Rightarrow z\in y)
x∪yx \cup y, x∩yx \cap y, x∖yx \setminus yunion, intersection, set difference
∅\varnothingthe empty set
P(x)\mathcal{P}(x)power set
⋃x\bigcup xgeneral (big) union
x×yx \times yCartesian product
a R ba\,R\,b(a,b)∈R(a,b)\in R (relation notation)
R−1R^{-1}, S∘RS\circ Rinverse relation, composite relation
[a]R[a]_Requivalence class of aa under RR
A⩽BA \leqslant BAA is dominated by BB: there is an injection A→BA\to B
A≈BA \approx BAA is equinumerous to BB: there is a bijection A→BA\to B
A≉BA \not\approx BAA is not equinumerous to BB
BA=(A→B)B^A = (A\to B), 2A=(A→{0,1})2^A=(A\to\{0,1\}), A2=A×AA^2=A\times Afunction-space / product shorthand

1. Naive Set Theory (朴素集合论)

跳转到:1. Naive Set Theory (朴素集合论)
  • An element of a set can itself be a set.
  • Membership: x∈yx\in y means "xx is an element of yy".
  • Equality (extensionality): x=yx=y iff for any zz, z∈x⇔z∈yz\in x \Leftrightarrow z\in y.
  • Subset: x⊆yx\subseteq y iff for any zz, if z∈xz\in x then z∈yz\in y.
  • x=yx=y iff x⊆yx\subseteq y and y⊆xy\subseteq x.
  • Union: z∈x∪y⇔z∈x or z∈yz\in x\cup y \Leftrightarrow z\in x \text{ or } z\in y.
  • Intersection: z∈x∩y⇔z∈x and z∈yz\in x\cap y \Leftrightarrow z\in x \text{ and } z\in y.
  • Set-theoretic difference: z∈x∖y⇔z∈x and z∉yz\in x\setminus y \Leftrightarrow z\in x \text{ and } z\notin y.
  • Empty set: ∅\varnothing satisfies "for any zz, z∉∅z\notin\varnothing".
  • Enumerated set: x∈{a1,a2,a3}⇔x=a1 or x=a2 or x=a3x\in\{a_1,a_2,a_3\} \Leftrightarrow x=a_1 \text{ or } x=a_2 \text{ or } x=a_3.
  • Set-builder: x∈{y∣y2−3y+2=0}⇔x2−3x+2=0x\in\{y \mid y^2-3y+2=0\} \Leftrightarrow x^2-3x+2=0.
  • Power set (幂集): y∈P(x)⇔y⊆xy\in\mathcal{P}(x) \Leftrightarrow y\subseteq x.
  • General union: y∈⋃x⇔y\in\bigcup x \Leftrightarrow there exists zz such that z∈xz\in x and y∈zy\in z.
  • Indexed union: y∈⋃i=0+∞xi⇔y\in\bigcup_{i=0}^{+\infty} x_i \Leftrightarrow there exists i∈Ni\in\mathbb{N} such that y∈xiy\in x_i.
  • Indexed intersection: y∈⋂i=0+∞xi⇔y\in\bigcap_{i=0}^{+\infty} x_i \Leftrightarrow for any i∈Ni\in\mathbb{N}, y∈xiy\in x_i.
  • Ordered pairs: (x,y)(x,y).
  • Equality of pairs: (x,y)=(u,v)⇔x=u and y=v(x,y)=(u,v) \Leftrightarrow x=u \text{ and } y=v.
  • Cartesian product: x×y={(u,v)∣u∈x and v∈y}x\times y = \{(u,v)\mid u\in x \text{ and } v\in y\}.

1.2 Example 1 — monotonicity of P\mathcal{P}, ⋃\bigcup and A=⋃P(A)A=\bigcup\mathcal{P}(A)

跳转到:1.2 Example 1 — monotonicity of P\mathcal{P}P, ⋃\bigcup⋃ and A=⋃P(A)A=\bigcup\mathcal{P}(A)A=⋃P(A)

Claims: (a) if A⊆BA\subseteq B then P(A)⊆P(B)\mathcal{P}(A)\subseteq\mathcal{P}(B); (b) if A⊆BA\subseteq B then ⋃A⊆⋃B\bigcup A\subseteq\bigcup B; (c) A=⋃P(A)A=\bigcup\mathcal{P}(A).

  • (a) Method: take an arbitrary element X∈P(A)X\in\mathcal{P}(A), so X⊆AX\subseteq A; since A⊆BA\subseteq B, X⊆BX\subseteq B, hence X∈P(B)X\in\mathcal{P}(B).
  • (b) Method: take x∈⋃Ax\in\bigcup A; there is Y∈AY\in A with x∈Yx\in Y; since A⊆BA\subseteq B, Y∈BY\in B, so x∈⋃Bx\in\bigcup B.
  • (c) Method: (⊆)(\subseteq) for x∈Ax\in A, the singleton {x}⊆A\{x\}\subseteq A so {x}∈P(A)\{x\}\in\mathcal{P}(A), and x∈{x}x\in\{x\} gives x∈⋃P(A)x\in\bigcup\mathcal{P}(A). (⊇)(\supseteq) for x∈⋃P(A)x\in\bigcup\mathcal{P}(A) there is Y∈P(A)Y\in\mathcal{P}(A) with x∈Yx\in Y; Y⊆AY\subseteq A so x∈Ax\in A.
  • Transferable pattern: prove set equality S=TS=T by the two inclusions S⊆TS\subseteq T and T⊆ST\subseteq S; prove an inclusion by taking an arbitrary element and unfolding the membership definitions.

1.3 Example 2 — P\mathcal{P} over ∩\cap, and ×\times over ⋃\bigcup

跳转到:1.3 Example 2 — P\mathcal{P}P over ∩\cap∩, and ×\times× over ⋃\bigcup⋃

Claims: (a) P(A)∩P(B)=P(A∩B)\mathcal{P}(A)\cap\mathcal{P}(B)=\mathcal{P}(A\cap B); (b) A×⋃B=⋃{A×X∣X∈B}A\times\bigcup B = \bigcup\{A\times X \mid X\in B\}.

  • (a) (⊆)(\subseteq) X∈P(A)∩P(B)X\in\mathcal{P}(A)\cap\mathcal{P}(B) gives X⊆AX\subseteq A and X⊆BX\subseteq B, so every a∈Xa\in X lies in A∩BA\cap B, hence X⊆A∩BX\subseteq A\cap B, i.e. X∈P(A∩B)X\in\mathcal{P}(A\cap B). (⊇)(\supseteq) X⊆A∩BX\subseteq A\cap B gives X⊆AX\subseteq A and X⊆BX\subseteq B.
  • (b) (⊆)(\subseteq) for (a,x)∈A×⋃B(a,x)\in A\times\bigcup B, x∈⋃Bx\in\bigcup B gives some X∈BX\in B with x∈Xx\in X, so (a,x)∈A×X(a,x)\in A\times X; the key step is A×X∈{A×X∣X∈B}A\times X\in\{A\times X\mid X\in B\}, hence (a,x)∈⋃{A×X∣X∈B}(a,x)\in\bigcup\{A\times X\mid X\in B\}. (⊇)(\supseteq) reverse: an element of the big union lies in some A×XA\times X with X∈BX\in B, write it as (a,x)(a,x) with a∈Aa\in A, x∈X⊆⋃Bx\in X\subseteq\bigcup B.

  • Definition: subsets of A×BA\times B are binary relations from AA to BB; subsets of A×AA\times A are also called binary relations on AA.
  • Notation: write a R ba\,R\,b for (a,b)∈R(a,b)\in R.

2.2 Properties of a relation RR on AA

跳转到:2.2 Properties of a relation RRR on AAA
  • reflexive on AA (自反性): ∀a∈A. (a R a)\forall a\in A.\ (a\,R\,a).
  • symmetric (对称性): ∀a,b∈A. if a R b then b R a\forall a,b\in A.\ \text{if } a\,R\,b \text{ then } b\,R\,a.
  • antisymmetric (反对称性): ∀a,b∈A. if a R b and b R a then a=b\forall a,b\in A.\ \text{if } a\,R\,b \text{ and } b\,R\,a \text{ then } a=b.
  • transitive (传递性): ∀a,b,c∈A. if a R b and b R c then a R c\forall a,b,c\in A.\ \text{if } a\,R\,b \text{ and } b\,R\,c \text{ then } a\,R\,c.
  • Inverse: if R⊆A×BR\subseteq A\times B, then R−1={(x,y)∈B×A∣y R x}R^{-1}=\{(x,y)\in B\times A \mid y\,R\,x\}.
  • Composition: if R⊆A×BR\subseteq A\times B and S⊆B×CS\subseteq B\times C, then S∘R:={(x,z)∈A×C∣∃y (x R y∧y S z)}S\circ R := \{(x,z)\in A\times C \mid \exists y\,(x\,R\,y \wedge y\,S\,z)\}.
  • Theorem 6: (R−1)−1=R(R^{-1})^{-1}=R; (S∘R)−1=R−1∘S−1(S\circ R)^{-1}=R^{-1}\circ S^{-1}; R∘(S∘T)=(R∘S)∘TR\circ(S\circ T)=(R\circ S)\circ T (associativity).
  • Theorem 7: R∘(S∪T)=(R∘S)∪(R∘T)R\circ(S\cup T)=(R\circ S)\cup(R\circ T).
  • Theorem 8 (characterizations), with IA:={(a,b)∈A×A∣a=b}I_A:=\{(a,b)\in A\times A\mid a=b\}:
    • RR reflexive on AA iff IA⊆RI_A\subseteq R.
    • RR symmetric iff R=R−1R=R^{-1}.
    • RR transitive iff R∘R⊆RR\circ R\subseteq R.
    • RR antisymmetric iff R∩R−1⊆IAR\cap R^{-1}\subseteq I_A.

3. Equivalence Relations, Classes, and Partitions

跳转到:3. Equivalence Relations, Classes, and Partitions

3.1 Equivalence relations and classes

跳转到:3.1 Equivalence relations and classes
  • Definition: R⊆A×AR\subseteq A\times A is an equivalence relation on AA if it is reflexive, symmetric, and transitive.
  • Equivalence class: for an equivalence relation RR on AA and a∈Aa\in A, [a]R:={b∈A∣a R b}[a]_R:=\{b\in A\mid a\,R\,b\}; aa is a representative element of [a]R[a]_R.
  • Theorem 11: for an equivalence relation RR and a,b∈Aa,b\in A,  a R b⇔[a]R=[b]R\ a\,R\,b \Leftrightarrow [a]_R=[b]_R.
    • (⇒)(\Rightarrow) for any cc, c∈[a]R⇔a R c⇔b R c⇔c∈[b]Rc\in[a]_R \Leftrightarrow a\,R\,c \Leftrightarrow b\,R\,c \Leftrightarrow c\in[b]_R (middle step uses a R ba\,R\,b with symmetry+transitivity).
    • (⇐)(\Leftarrow) by reflexivity b∈[b]R=[a]Rb\in[b]_R=[a]_R, hence a R ba\,R\,b.
  • Theorem 12: for an equivalence relation RR and a,b∈Aa,b\in A,  a R b⇔[a]R∩[b]R≠∅\ a\,R\,b \Leftrightarrow [a]_R\cap[b]_R\neq\varnothing.
    • (⇒)(\Rightarrow) a R ba\,R\,b gives [a]R=[b]R[a]_R=[b]_R, and a∈[a]Ra\in[a]_R so the (equal) class is nonempty.
    • (⇐)(\Leftarrow) if c∈[a]R∩[b]Rc\in[a]_R\cap[b]_R, then a R ca\,R\,c and b R cb\,R\,c, so [a]R=[c]R=[b]R[a]_R=[c]_R=[b]_R, hence a R ba\,R\,b.
  • Partition: P⊆P(A)P\subseteq\mathcal{P}(A) is a partition of AA if (i) ∀B∈P. B≠∅\forall B\in P.\ B\neq\varnothing; (ii) ∀B,B′∈P. if B≠B′ then B∩B′=∅\forall B,B'\in P.\ \text{if } B\neq B' \text{ then } B\cap B'=\varnothing (pairwise disjoint); (iii) ⋃P=A\bigcup P=A.
  • Theorem 2 (partition ⇒\Rightarrow equivalence relation): if PP is a partition of AA, then R={(a,b)∈A×A∣∃B∈P. a∈B and b∈B}R=\{(a,b)\in A\times A\mid \exists B\in P.\ a\in B \text{ and } b\in B\} is an equivalence relation on AA, and PP is exactly the set of all equivalence classes of RR, i.e. P={[a]R∣a∈A}P=\{[a]_R\mid a\in A\}.
    • reflexive: each a∈Aa\in A lies in some B∈PB\in P (since ⋃P=A\bigcup P=A), so a R aa\,R\,a.
    • symmetric: from the symmetric form of RR's definition.
    • transitive: a R ba\,R\,b and b R cb\,R\,c give blocks B1,B2∈PB_1,B_2\in P with a,b∈B1a,b\in B_1 and b,c∈B2b,c\in B_2; blocks of a partition are identical or disjoint, and b∈B1∩B2b\in B_1\cap B_2 forces B1=B2B_1=B_2, so a R ca\,R\,c.
    • P={[a]R}P=\{[a]_R\}: each block B∈PB\in P is nonempty, pick a∈Ba\in B, then B=[a]RB=[a]_R; conversely each a∈Aa\in A lies in some block BB and [a]R=B[a]_R=B.

4. Closures: Transitive and Reflexive-Transitive

跳转到:4. Closures: Transitive and Reflexive-Transitive

4.1 Transitive closure (传递闭包)

跳转到:4.1 Transitive closure (传递闭包)
  • Definition 1 (universal/order-theoretic form): for a relation RR on AA, R′R' is the transitive closure of RR if (i) R⊆R′R\subseteq R'; (ii) R′R' is transitive; (iii) for every TT, if R⊆TR\subseteq T and TT is transitive, then R′⊆TR'\subseteq T. (I.e. R′R' is the smallest transitive relation containing RR.)
  • Definition 2 (constructive form): RnR^n is the nn-fold composition of RR, and R+R^+ is the transitive closure:
    • R1≜RR^1 \triangleq R;
    • Rn+1≜Rn∘RR^{n+1} \triangleq R^n\circ R;
    • R+≜⋃n∈Z+RnR^+ \triangleq \bigcup_{n\in\mathbb{Z}^+} R^n.
    • Remark (原文): the textbook writes R∗R^*, but it should generally be written R+R^+.
  • Theorem 3: the two definitions above are equivalent.

Supporting lemmas:

  • Lemma 4 (monotonicity of ∘\circ): if R1⊆R1′R_1\subseteq R_1' and R2⊆R2′R_2\subseteq R_2', then R1∘R2⊆R1′∘R2′R_1\circ R_2\subseteq R_1'\circ R_2'.
  • Lemma 5: if Rn⊆TR_n\subseteq T for every nn, then ⋃nRn⊆T\bigcup_n R_n\subseteq T (stated for an arbitrary indexed family {Rn}\{R_n\}; later instantiated with Rn=RnR_n=R^n).
  • Lemma 6: R⊆R+R\subseteq R^+.
  • Lemma 7: Rn∘Rm=Rn+mR^n\circ R^m = R^{n+m}.
  • Lemma 8: R+R^+ is transitive. Proof: a R+ ba\,R^+\,b and b R+ cb\,R^+\,c give n,mn,m with a Rn ba\,R^n\,b and b Rm cb\,R^m\,c; then a Rn+m ca\,R^{n+m}\,c (Lemma 7), so a R+ ca\,R^+\,c.
  • Lemma 9: if R⊆TR\subseteq T and TT is transitive, then R+⊆TR^+\subseteq T. Proof by induction: R1⊆TR^1\subseteq T; if Rn⊆TR^n\subseteq T then Rn+1=Rn∘R⊆T∘T⊆TR^{n+1}=R^n\circ R\subseteq T\circ T\subseteq T (transitivity); hence R+=⋃n∈Z+Rn⊆TR^+=\bigcup_{n\in\mathbb{Z}^+}R^n\subseteq T.
  • Lemma 10: there is at most one least relation that is a superset of RR and is transitive.
  • Adding these lemmas together proves Theorem 3.

4.2 Reflexive transitive closure (自反传递闭包)

跳转到:4.2 Reflexive transitive closure (自反传递闭包)
  • Definition 11 (universal form): R′R' is the reflexive transitive closure of RR if (i) R⊆R′R\subseteq R'; (ii) R′R' transitive; (iii) R′R' reflexive; (iv) for every TT, if R⊆TR\subseteq T, TT transitive and TT reflexive, then R′⊆TR'\subseteq T. (原文该普遍形用 R′R' 记闭包,构造形 R∗R^* 见 Definition 12。)
  • Definition 12 (constructive form): R0≜IA={(a,a)∣a∈A}R^0\triangleq I_A=\{(a,a)\mid a\in A\}, and R∗≜⋃n∈NRnR^*\triangleq\bigcup_{n\in\mathbb{N}}R^n (so the index starts at 00, adding the identity for reflexivity).
  • Theorem 13: the two definitions of the reflexive transitive closure are equivalent.

  • Definition (function): a relation F⊆A×BF\subseteq A\times B is a function from AA into BB iff (i) ∀x∈A. ∃y. (x F y)\forall x\in A.\ \exists y.\ (x\,F\,y) (totality), and (ii) ∀x∀y∀y′. (if x F y and x F y′ then y=y′)\forall x\forall y\forall y'.\ (\text{if } x\,F\,y \text{ and } x\,F\,y' \text{ then } y=y') (single-valuedness). AA is the domain, BB the codomain.
  • Notation: write F:A→BF:A\to B for a function from AA into BB; F(x)F(x) is the unique element with (x,F(x))∈F(x,F(x))\in F.
  • Theorem 17 (function extensionality): for F,G:A→BF,G:A\to B,  F=G⇔∀x∈A. F(x)=G(x)\ F=G \Leftrightarrow \forall x\in A.\ F(x)=G(x).
  • Theorem 18 (composition is a function): for F:B→CF:B\to C and G:A→BG:A\to B, F∘GF\circ G is a function and (F∘G)(x)=F(G(x))(F\circ G)(x)=F(G(x)) for all x∈Ax\in A.

5.2 Special classes of functions

跳转到:5.2 Special classes of functions

For f:A→Bf:A\to B:

  • one-to-one / injection (单射): ∀a,a′∈A. if f(a)=f(a′) then a=a′\forall a,a'\in A.\ \text{if } f(a)=f(a') \text{ then } a=a'.
  • onto / surjection (满射): ∀b∈B. ∃a∈A. f(a)=b\forall b\in B.\ \exists a\in A.\ f(a)=b.
  • bijection (one-to-one correspondence, 双射): both an injection and a surjection.
  • Theorem 20 (composition), for F:B→CF:B\to C, G:A→BG:A\to B:
    • F,GF,G injections ⇒F∘G\Rightarrow F\circ G injection.
    • F,GF,G surjections ⇒F∘G\Rightarrow F\circ G surjection.
    • F∘GF\circ G injection ⇒G\Rightarrow G injection (only the inner map is forced).
    • F∘GF\circ G surjection ⇒F\Rightarrow F surjection (only the outer map is forced).
  • Theorem 21: if F:A→BF:A\to B is a bijection, then F−1⊆B×AF^{-1}\subseteq B\times A is also a bijection.

6. The Schröder–Bernstein Theorem

跳转到:6. The Schröder–Bernstein Theorem
  • Theorem 1 (Schröder–Bernstein): if f:A→Bf:A\to B and g:B→Ag:B\to A are both injections, then there is a bijection from AA into BB.

  • Key construction (the transferable idea — "back-and-forth chasing through gg's non-image"):

    • C0={a∈A∣∀b∈B. g(b)≠a}C_0=\{a\in A\mid \forall b\in B.\ g(b)\neq a\} — the elements of AA outside the range of gg.
    • D0={f(a)∣a∈C0}D_0=\{f(a)\mid a\in C_0\}.
    • C1={a∈A∖C0∣∀b∈B∖D0. g(b)≠a}C_1=\{a\in A\setminus C_0 \mid \forall b\in B\setminus D_0.\ g(b)\neq a\}; one shows C1={g(b)∣b∈D0}C_1=\{g(b)\mid b\in D_0\}.
    • D1={f(a)∣a∈C1}D_1=\{f(a)\mid a\in C_1\}, and in general Cn+1={a∈A∖⋃i=0nCi∣∀b∈B∖⋃i=0nDi. g(b)≠a}C_{n+1}=\{a\in A\setminus\bigcup_{i=0}^n C_i \mid \forall b\in B\setminus\bigcup_{i=0}^n D_i.\ g(b)\neq a\}, Dn+1={f(a)∣a∈Cn+1}D_{n+1}=\{f(a)\mid a\in C_{n+1}\}, with Cn+1={g(b)∣b∈Dn}C_{n+1}=\{g(b)\mid b\in D_n\}.
    • Define h(a)={f(a),a∈⋃i=0∞Cib s.t. g(b)=a,a∈A∖⋃i=0∞Cih(a)=\begin{cases} f(a), & a\in\bigcup_{i=0}^{\infty} C_i\\ b \text{ s.t. } g(b)=a, & a\in A\setminus\bigcup_{i=0}^{\infty} C_i\end{cases}
  • Why hh is a bijection:

    • injection (three cases): both in the ⋃Ci\bigcup C_i branch — then f(a1)=f(a2)f(a_1)=f(a_2) so a1=a2a_1=a_2 (ff injective); mixed branch — if a1∈A∖⋃iCia_1\in A\setminus\bigcup_i C_i and a2∈Cna_2\in C_n, then f(a2)∈Dnf(a_2)\in D_n and g(f(a2))∈Cn+1g(f(a_2))\in C_{n+1}, so a1=g(h(a1))=g(h(a2))=g(f(a2))∈Cn+1a_1=g(h(a_1))=g(h(a_2))=g(f(a_2))\in C_{n+1}, a contradiction (so no collision across branches); both in the complement branch — then g(h(a1))=a1g(h(a_1))=a_1 and g(h(a2))=a2g(h(a_2))=a_2 give a1=a2a_1=a_2.
    • surjection: if b∈Dnb\in D_n there is a∈Cna\in C_n with f(a)=bf(a)=b; if b∈B∖⋃iDib\in B\setminus\bigcup_i D_i, set a=g(b)a=g(b), which must lie in A∖⋃iCiA\setminus\bigcup_i C_i (otherwise a∈Cna\in C_n forces b∈Dnb\in D_n, contradiction), and then h(a)=bh(a)=b.

7. Equinumerosity and Cardinal Comparison

跳转到:7. Equinumerosity and Cardinal Comparison
  • Domination: A⩽BA\leqslant B if there exists an injection from AA into BB.
  • Equinumerosity: A≈BA\approx B if there exists a bijection from AA into BB.
  • Theorem 4: [0,1]≈[0,1)[0,1]\approx[0,1). Proof 1: by Schröder–Bernstein. Proof 2: explicit bijection f(x)=x/2f(x)=x/2 if x∈{1,12,14,18,… }x\in\{1,\tfrac12,\tfrac14,\tfrac18,\dots\}, and f(x)=xf(x)=x otherwise (shift the dyadic chain to drop the endpoint 11).
  • Theorem 5: N≈N×N\mathbb{N}\approx\mathbb{N}\times\mathbb{N}.
  • Theorem 6 (≈\approx behaves like an equivalence relation): A≈AA\approx A; if A≈BA\approx B then B≈AB\approx A; if A≈BA\approx B and B≈CB\approx C then A≈CA\approx C.
  • Theorem 7 (products): A×B≈B×AA\times B\approx B\times A; if A1≈A2A_1\approx A_2 and B1≈B2B_1\approx B_2 then A1×B1≈A2×B2A_1\times B_1\approx A_2\times B_2.
    • constructions: F(a,b)=(b,a)F(a,b)=(b,a) is the swap bijection; for the second part, bijections f:A1→A2f:A_1\to A_2, g:B1→B2g:B_1\to B_2 give h(x,y)=(f(x),g(y))h(x,y)=(f(x),g(y)).
  • Corollary 8: N≈Q\mathbb{N}\approx\mathbb{Q} and N×N×N≈N\mathbb{N}\times\mathbb{N}\times\mathbb{N}\approx\mathbb{N}.
    • via N⩽Q⩽Z+×Z≈N×N≈N\mathbb{N}\leqslant\mathbb{Q}\leqslant\mathbb{Z}^+\times\mathbb{Z}\approx\mathbb{N}\times\mathbb{N}\approx\mathbb{N}, and (N×N)×N≈N×N≈N(\mathbb{N}\times\mathbb{N})\times\mathbb{N}\approx\mathbb{N}\times\mathbb{N}\approx\mathbb{N} (Schröder–Bernstein turns the ⩽\leqslant-chain into ≈\approx).

7.3 Equinumerosity of function spaces (N608)

跳转到:7.3 Equinumerosity of function spaces (N608)

Theorem 1 collects the function-space identities (here (A→B)(A\to B) is the set of all functions from AA to BB):

  • if A1≈A2A_1\approx A_2 and B1≈B2B_1\approx B_2, then (A1→B1)≈(A2→B2)(A_1\to B_1)\approx(A_2\to B_2);
  • if A1⩽A2A_1\leqslant A_2 and B1⩽B2B_1\leqslant B_2, then (A1→B1)⩽(A2→B2)(A_1\to B_1)\leqslant(A_2\to B_2) when B2≠∅B_2\neq\varnothing; if B2=∅B_2=\varnothing, this conclusion also holds except in the edge case A1=∅A_1=\varnothing and A2≠∅A_2\neq\varnothing.
  • currying: ((A×B)→C)≈(A→(B→C))((A\times B)\to C)\approx(A\to(B\to C));
  • pairing: (A→B×C)≈(A→B)×(A→C)(A\to B\times C)\approx(A\to B)\times(A\to C);
  • ({0,1}→A)≈A×A(\{0,1\}\to A)\approx A\times A;
  • if A≈BA\approx B, then P(A)≈P(B)\mathcal{P}(A)\approx\mathcal{P}(B);
  • (A→{0,1})≈P(A)(A\to\{0,1\})\approx\mathcal{P}(A).

Proof techniques (the transferable bijection constructions):

  • relabel domain/codomain by H(h)=g∘h∘f−1H(h)=g\circ h\circ f^{-1} (uses f,gf,g bijections).
  • for the ⩽\leqslant version with B2≠∅B_2\neq\varnothing, pick b∈B2b\in B_2 and extend outside f[A1]f[A_1], using injectivity of ff (well-definedness) and gg (injectivity of HH); the B2=∅B_2=\varnothing case must be checked separately as above.
  • currying via H(f)(a)(b)=f(a,b)H(f)(a)(b)=f(a,b); pairing via H(f,g)(a)=(f(a),g(a))H(f,g)(a)=(f(a),g(a)); ({0,1}→A)≈A×A(\{0,1\}\to A)\approx A\times A via H(f)=(f(0),f(1))H(f)=(f(0),f(1)); power-set monotonicity (A≈BA\approx B by a bijection ff ⇒P(A)≈P(B)\Rightarrow \mathcal{P}(A)\approx\mathcal{P}(B)) via H(X)={f(a)∣a∈X}H(X)=\{f(a)\mid a\in X\}; and (A→{0,1})≈P(A)(A\to\{0,1\})\approx\mathcal{P}(A) via the indicator map H(f)={a∈A∣f(a)=1}H(f)=\{a\in A\mid f(a)=1\}.
  • Notation: A2:=A×AA^2:=A\times A, A3:=A×A×AA^3:=A\times A\times A, …; 2A:=(A→{0,1})2^A:=(A\to\{0,1\}) and BA:=(A→B)B^A:=(A\to B).

  • Definition: a set AA is countable if it is equinumerous to N\mathbb{N} (A≈NA\approx\mathbb{N}).
  • Example 10 (countable sets): N\mathbb{N}; Z+\mathbb{Z}^+; Z\mathbb{Z}; {n∈N∣n is even}\{n\in\mathbb{N}\mid n \text{ is even}\}; N×N\mathbb{N}\times\mathbb{N}; N×N×N\mathbb{N}\times\mathbb{N}\times\mathbb{N}; Q\mathbb{Q}.
  • Theorem 11: the set of finite sequences of natural numbers is countable.
  • Corollary 12: each of the following is countable — the set of strings (of finite length); the set of integer arithmetic expressions; the set of polynomials with integer coefficients (整系数多项式); the set of algebraic numbers (代数数,整系数多项式的根).

9. Uncountable Sets and Cantor's Theorem

跳转到:9. Uncountable Sets and Cantor's Theorem
  • Theorem 1 (Cantor's Theorem): for any set XX,  X≉P(X)\ X\not\approx\mathcal{P}(X).
    • Proof by contradiction (Cantor's diagonal argument): suppose θ:X→P(X)\theta:X\to\mathcal{P}(X) is a bijection. Define Y:={x∈X∣x∉θ(x)}∈P(X)Y:=\{x\in X\mid x\notin\theta(x)\}\in\mathcal{P}(X). Let yy be the unique element with θ(y)=Y\theta(y)=Y. Then y∈Y⇒y∉θ(y)=Yy\in Y \Rightarrow y\notin\theta(y)=Y, and y∉Y⇒y∈θ(y)=Yy\notin Y \Rightarrow y\in\theta(y)=Y — contradiction.
  • Theorem 2: (A→{0,1})≈P(A)(A\to\{0,1\})\approx\mathcal{P}(A). Proof: F(f)={a∈A∣f(a)=1}F(f)=\{a\in A\mid f(a)=1\} is a bijection (injective because ff is determined by which points map to 11; surjective because any X⊆AX\subseteq A is hit by its indicator function).
  • Corollary 3: P(N)\mathcal{P}(\mathbb{N}) is uncountable; (N→{0,1})(\mathbb{N}\to\{0,1\}) is uncountable.
  • Theorem 4: the set of infinite sequences of natural numbers is uncountable.
    • Proof: an infinite sequence of naturals is a function N→N\mathbb{N}\to\mathbb{N}, and 2N⩽NN⩽(2N)N≈2N×N≈2N2^{\mathbb{N}}\leqslant\mathbb{N}^{\mathbb{N}}\leqslant(2^{\mathbb{N}})^{\mathbb{N}}\approx 2^{\mathbb{N}\times\mathbb{N}}\approx 2^{\mathbb{N}}, so NN≈2N\mathbb{N}^{\mathbb{N}}\approx 2^{\mathbb{N}} is uncountable.
  • Theorem 5: R≈2N\mathbb{R}\approx 2^{\mathbb{N}}.
  • Corollary 6: (0,1)≈[0,1]≈2N(0,1)\approx[0,1]\approx 2^{\mathbb{N}}.
  • Theorem 7: (R→R)≈22N(\mathbb{R}\to\mathbb{R})\approx 2^{2^{\mathbb{N}}}.
    • Proof: RR≈(2N)2N≈2N×2N\mathbb{R}^{\mathbb{R}}\approx(2^{\mathbb{N}})^{2^{\mathbb{N}}}\approx 2^{\mathbb{N}\times 2^{\mathbb{N}}}, and 22N⩽2N×2N⩽22N×2N≈2(2N)2⩽2(2N)N≈22N×N≈22N2^{2^{\mathbb{N}}}\leqslant 2^{\mathbb{N}\times 2^{\mathbb{N}}}\leqslant 2^{2^{\mathbb{N}}\times 2^{\mathbb{N}}}\approx 2^{(2^{\mathbb{N}})^2}\leqslant 2^{(2^{\mathbb{N}})^{\mathbb{N}}}\approx 2^{2^{\mathbb{N}\times\mathbb{N}}}\approx 2^{2^{\mathbb{N}}}.
  • Theorem 8: the set of continuous functions from R\mathbb{R} into R\mathbb{R} is equinumerous with R\mathbb{R}.

10. Set Theory as a Mathematical Foundation

跳转到:10. Set Theory as a Mathematical Foundation

10.1 Ordered pairs as sets

跳转到:10.1 Ordered pairs as sets
  • Definition 1 (ordered pairs as sets): (x,y)(x,y) can be encoded as {{x},{x,y}}\{\{x\},\{x,y\}\}.
  • The encoding is sound because of:
  • Theorem 2: for any sets x,y,u,vx,y,u,v, if {{x},{x,y}}={{u},{u,v}}\{\{x\},\{x,y\}\}=\{\{u\},\{u,v\}\} then x=ux=u and y=vy=v.

10.2 Natural numbers as sets

跳转到:10.2 Natural numbers as sets
  • Example 3 (natural numbers as sets): each natural number is encoded as the set of all smaller ones.
nnas a set={0,…,n−1}=\{0,\dots,n-1\}
00{}\{\}{}\{\}
11{{}}\{\{\}\}{0}\{0\}
22{{},{{}}}\{\{\},\{\{\}\}\}{0,1}\{0,1\}
33{{},{{}},{{},{{}}}}\{\{\},\{\{\}\},\{\{\},\{\{\}\}\}\}{0,1,2}\{0,1,2\}
  • Definition 4 (inductive set): a set xx is inductive iff ∅∈x\varnothing\in x and ∀y(if y∈x then y∪{y}∈x)\forall y(\text{if } y\in x \text{ then } y\cup\{y\}\in x).
  • Definition 5 (N\mathbb{N}): N\mathbb{N} is the smallest inductive set: (i) N\mathbb{N} is inductive; (ii) for any inductive set xx, N⊆x\mathbb{N}\subseteq x.
  • Theorem 6 (existence of N\mathbb{N}): there exists a set xx that is inductive and is contained in every inductive set.
  • Theorem 7 (uniqueness of N\mathbb{N}): any two sets that are inductive and contained in every inductive set are equal.

10.3 Defining natural-number arithmetic

跳转到:10.3 Defining natural-number arithmetic
  • Definition 8 (addition): the sum of n,m∈Nn,m\in\mathbb{N} is rr iff (n,m,r)∈T(n,m,r)\in T, where T⊆N×N×NT\subseteq\mathbb{N}\times\mathbb{N}\times\mathbb{N} is the least set such that
    • ∀n. ((n,0,n)∈T)\forall n.\ ((n,0,n)\in T) — base case n+0=nn+0=n;
    • ∀n∀m∀r. (if (n,m,r)∈T, then (n, m∪{m}, r∪{r})∈T)\forall n\forall m\forall r.\ (\text{if } (n,m,r)\in T, \text{ then } (n,\, m\cup\{m\},\, r\cup\{r\})\in T) — successor step on the second argument (using m∪{m}m\cup\{m\} as m+1m+1, i.e. n+(m+1)=(n+m)+1n+(m+1)=(n+m)+1).

10.4 Defining transitive closures (as sets)

跳转到:10.4 Defining transitive closures (as sets)
  • Definition 9: for any relation RR on AA (i.e. R⊆A×AR\subseteq A\times A), write (a,b)∈Rn(a,b)\in R^n iff (a,b,n)∈T(a,b,n)\in T, where T⊆A×A×NT\subseteq A\times A\times\mathbb{N} is the least set such that
    • ∀a∀b (if a R b, then (a,b,1)∈T)\forall a\forall b\,(\text{if } a\,R\,b, \text{ then } (a,b,1)\in T);
    • ∀n∀a∀b∀c (if a R b and (b,c,n)∈T, then (a,c,n∪{n})∈T)\forall n\forall a\forall b\forall c\,(\text{if } a\,R\,b \text{ and } (b,c,n)\in T, \text{ then } (a,c,n\cup\{n\})\in T).
  • Definition 10: for any relation RR on AA, R+=⋃n∈Z+RnR^+=\bigcup_{n\in\mathbb{Z}^+}R^n is the set {(a,b)∈A×A∣∃n((a,b,n)∈T)}\{(a,b)\in A\times A\mid \exists n((a,b,n)\in T)\}, obtained by the axiom of separation from the TT above.

10.5 Establishing Z\mathbb{Z}, Q\mathbb{Q} and R\mathbb{R} in set theory

跳转到:10.5 Establishing Z\mathbb{Z}Z, Q\mathbb{Q}Q and R\mathbb{R}R in set theory
  • Z≈(N×{0,1})∖{(0,0)}\mathbb{Z}\approx(\mathbb{N}\times\{0,1\})\setminus\{(0,0)\}, so Z\mathbb{Z} can be defined accordingly.
  • Q≈{(n,m)∈Z×(N∖{0})∣n and m are coprime to each other}\mathbb{Q}\approx\{(n,m)\in\mathbb{Z}\times(\mathbb{N}\setminus\{0\})\mid n \text{ and } m \text{ are coprime to each other}\}, so Q\mathbb{Q} can be defined accordingly.
  • Definition 11 (Dedekind cut): (X,Y)∈P(Q)×P(Q)(X,Y)\in\mathcal{P}(\mathbb{Q})\times\mathcal{P}(\mathbb{Q}) is a Dedekind cut of rationals if X≠∅X\neq\varnothing; Y≠∅Y\neq\varnothing; X∩Y=∅X\cap Y=\varnothing; X∪Y=QX\cup Y=\mathbb{Q}; ∀x∈X. ∀y∈Y. (x<y)\forall x\in X.\ \forall y\in Y.\ (x<y); and YY has no least element, i.e. ∀y∈Y. ∃y′∈Y. (y′<y)\forall y\in Y.\ \exists y'\in Y.\ (y'<y).
  • Theorem 12: if DD is the set of Dedekind cuts of rationals, then D≈RD\approx\mathbb{R}; so R\mathbb{R} can be defined accordingly.
  • Alternative construction of R\mathbb{R} via Cauchy sequences:
  • Definition 13 (Cauchy sequence): l:N→Ql:\mathbb{N}\to\mathbb{Q} is a Cauchy sequence if for any rational ε>0\varepsilon>0 there exists NN such that for any m,n>Nm,n>N, ∣l(n)−l(m)∣<ε|l(n)-l(m)|<\varepsilon.
  • Definition 14: RC={(l1,l2)∣for any rational ε>0 there exists N such that for any n>N, ∣l1(n)−l2(n)∣<ε}R_C=\{(l_1,l_2)\mid \text{for any rational } \varepsilon>0 \text{ there exists } N \text{ such that for any } n>N,\ |l_1(n)-l_2(n)|<\varepsilon\} is a relation between Cauchy sequences of rationals.
  • Theorem 15: RCR_C is an equivalence relation on Cauchy sequences of rationals.
  • Theorem 16: R≈{[l]RC∣l is a Cauchy sequence of rationals}\mathbb{R}\approx\{[l]_{R_C}\mid l \text{ is a Cauchy sequence of rationals}\}.
  • Finally, since C≈R×R\mathbb{C}\approx\mathbb{R}\times\mathbb{R}, C\mathbb{C} can be defined accordingly.

11. Problems of Naive Set Theory and Their Fixing

跳转到:11. Problems of Naive Set Theory and Their Fixing
  • Consider A={a∣a∉a}A=\{a\mid a\notin a\}. Then ∀x(x∈A⇔x∉x)\forall x(x\in A \Leftrightarrow x\notin x), so A∈A⇔A∉AA\in A \Leftrightarrow A\notin A — a contradiction.

11.2 Fixing the problems — primitive constructions of sets

跳转到:11.2 Fixing the problems — primitive constructions of sets
  • Definition 17 (primitive constructions):
    • Separation: for any set AA and property PP, {a∈A∣P(a)}\{a\in A\mid P(a)\} is a set, with ∀x(x∈{a∈A∣P(a)}⇔x∈A and P(x))\forall x(x\in\{a\in A\mid P(a)\} \Leftrightarrow x\in A \text{ and } P(x)).
    • For an arbitrary property PP, {a∣P(a)}\{a\mid P(a)\} is not guaranteed to be a set (this is what blocks Russell's paradox).
    • ∅\varnothing is a set, ∀x(x∉∅)\forall x(x\notin\varnothing).
    • Pairing: for any sets x,yx,y, {x,y}\{x,y\} is a set, ∀z(z∈{x,y}⇔z=x or z=y)\forall z(z\in\{x,y\} \Leftrightarrow z=x \text{ or } z=y).
    • Union: for any set xx, ⋃x\bigcup x is a set, ∀y(y∈⋃x⇔∃z(z∈x and y∈z))\forall y(y\in\bigcup x \Leftrightarrow \exists z(z\in x \text{ and } y\in z)).
    • Power set: for any set xx, P(x)\mathcal{P}(x) is a set, ∀y(y∈P(x)⇔y⊆x)\forall y(y\in\mathcal{P}(x) \Leftrightarrow y\subseteq x).
  • Theorem 18: x∪yx\cup y is a set, since x∪y=⋃{x,y}x\cup y=\bigcup\{x,y\}.
  • Theorem 19: x∩yx\cap y is a set, since x∩y={a∈x∣a∈y}x\cap y=\{a\in x\mid a\in y\}.
  • Theorem 20: {x}\{x\} is a set, since {x}={x,x}\{x\}=\{x,x\}.
  • Corollary 21: 0={}0=\{\}, 1={{}}1=\{\{\}\}, 2={{},{{}}}2=\{\{\},\{\{\}\}\} are all sets; and if xx is a set, x∪{x}x\cup\{x\} is also a set.
  • Theorem 22: x×yx\times y is a set, since x×y={a∈P(P(x∪y))∣∃u∈x ∃v∈y. a={{u},{u,v}}}x\times y=\{a\in\mathcal{P}(\mathcal{P}(x\cup y))\mid \exists u\in x\,\exists v\in y.\ a=\{\{u\},\{u,v\}\}\}.