Documentation

Analysis.Section_3_1

Analysis I, Section 3.1 #

In this section we set up a version of Zermelo-Frankel set theory (with atoms) that tries to be as faithful as possible to the original text of Analysis I, Section 3.1. All numbering refers to the original text.

I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.

Main constructions and results of this section:

The other axioms of Zermelo-Frankel set theory are discussed in later sections.

Some technical notes:

Some of the axioms of Zermelo-Frankel theory with atoms

Instances

    Definition 3.1.1 (objects can be elements of sets)

    Equations

    Axiom 3.1 (Sets are objects)

    Equations
    @[reducible, inline]
    Equations
    Instances For

      Axiom 3.1 (Sets are objects)

      @[simp]

      Axiom 3.1 (Sets are objects)

      @[reducible, inline]
      abbrev Chapter3.SetTheory.Set.ext [SetTheory] {X Y : Set} (h : ∀ (x : Object), x ∈ X ↔ x ∈ Y) :
      X = Y

      Axiom 3.2 (Equality of sets)

      Equations
      • ⋯ = ⋯
      Instances For
        theorem Chapter3.SetTheory.Set.ext_iff [SetTheory] (X Y : Set) :
        X = Y ↔ ∀ (x : Object), x ∈ X ↔ x ∈ Y

        Axiom 3.2 (Equality of sets)

        Axiom 3.3 (empty set). Note: one may have to explicitly cast ∅ to Set due to Mathlib's existing set theory notation.

        Empty set is unique

        Empty set is unique

        theorem Chapter3.SetTheory.Set.nonempty_def [SetTheory] {X : Set} (h : X ≠ ∅) :
        ∃ (x : Object), x ∈ X

        Lemma 3.1.5 (Single choice)

        Axiom 3.3(a) (singleton). Note one may have to explicitly cast {a} to Set due to Mathlib's existing set theory notation.

        theorem Chapter3.SetTheory.Set.mem_union [SetTheory] (x : Object) (X Y : Set) :
        x ∈ X ∪ Y ↔ x ∈ X ∨ x ∈ Y

        Axiom 3.4 (Pairwise union)

        Axiom 3.3(b) (pair). Note that one often has to cast {a,b} to Set

        theorem Chapter3.SetTheory.Set.mem_pair [SetTheory] (x a b : Object) :
        x ∈ {a, b} ↔ x = a ∨ x = b

        Axiom 3.3(b) (pair). Note that one often has to cast {a,b} to Set

        Remark 3.1.8

        theorem Chapter3.SetTheory.Set.pair_uniq [SetTheory] (a b : Object) :
        ∃! X : Set, ∀ (x : Object), x ∈ X ↔ x = a ∨ x = b

        Remark 3.1.8

        Remark 3.1.8

        theorem Chapter3.SetTheory.Set.pair_eq_pair [SetTheory] {a b c d : Object} (h : {a, b} = {c, d}) :
        a = c ∧ b = d ∨ a = d ∧ b = c

        Exercise 3.1.1

        @[reducible, inline]
        Equations
        Instances For
          theorem Chapter3.SetTheory.Set.union_congr_left [SetTheory] (A A' B : Set) (h : A = A') :
          A ∪ B = A' ∪ B

          Remark 3.1.11. (These results can be proven either by a direct rewrite, or by using extensionality.)

          theorem Chapter3.SetTheory.Set.union_congr_right [SetTheory] (A B B' : Set) (h : B = B') :
          A ∪ B = A ∪ B'

          Remark 3.1.11. (These results can be proven either by a direct rewrite, or by using extensionality.)

          Lemma 3.1.12 (Basic properties of unions) / Exercise 3.1.3

          Lemma 3.1.12 (Basic properties of unions) / Exercise 3.1.3

          theorem Chapter3.SetTheory.Set.union_assoc [SetTheory] (A B C : Set) :
          A ∪ B ∪ C = A ∪ (B ∪ C)

          Lemma 3.1.12 (Basic properties of unions) / Exercise 3.1.3

          Proposition 3.1.27(c)

          Proposition 3.1.27(a)

          Proposition 3.1.27(a)

          Example 3.1.10

          Definition 3.1.14.

          Equations

          Definition 3.1.14. Note that the strict subset operation in Mathlib is denoted ⊂ rather than ⊊.

          Equations
          theorem Chapter3.SetTheory.Set.subset_def [SetTheory] (X Y : Set) :
          X ⊆ Y ↔ ∀ x ∈ X, x ∈ Y

          Definition 3.1.14.

          Definition 3.1.14. Note that the strict subset operation in Mathlib is denoted ⊂ rather than ⊊.

          theorem Chapter3.SetTheory.Set.subset_congr_left [SetTheory] {A A' B : Set} (hAA' : A = A') (hAB : A ⊆ B) :
          A' ⊆ B

          Remark 3.1.15

          Examples 3.1.16

          theorem Chapter3.SetTheory.Set.subset_trans [SetTheory] (A B C : Set) (hAB : A ⊆ B) (hBC : B ⊆ C) :
          A ⊆ C

          Proposition 3.1.17 (Partial ordering by set inclusion)

          theorem Chapter3.SetTheory.Set.subset_antisymm [SetTheory] (A B : Set) (hAB : A ⊆ B) (hBA : B ⊆ A) :
          A = B

          Proposition 3.1.17 (Partial ordering by set inclusion)

          theorem Chapter3.SetTheory.Set.ssubset_trans [SetTheory] (A B C : Set) (hAB : A ⊂ B) (hBC : B ⊂ C) :
          A ⊂ C

          Proposition 3.1.17 (Partial ordering by set inclusion)

          @[reducible, inline]

          This defines the subtype A.toSubtype for any A:Set. To produce an element x' of this subtype, use ⟨ x, hx ⟩, where x:Object and hx:x ∈ A. The object x associated to a subtype element x' is recovered as x.val, and the property hx that x belongs to A is recovered as x.property

          Equations
          Instances For

            Elements of a set (implicitly coerced to a subtype) are also elements of the set (with respect to the membership operation of the set theory).

            theorem Chapter3.SetTheory.Set.coe_inj [SetTheory] (A : Set) (x y : A.toSubtype) :
            ↑x = ↑y ↔ x = y

            If one has a proof hx of x ∈ A, then A.subtype_mk hx will then make the element of A (viewed as a subtype) corresponding to x.

            Equations
            Instances For
              theorem Chapter3.SetTheory.Set.subtype_mk_coe [SetTheory] {A : Set} {x : Object} (hx : x ∈ A) :
              ↑(A.subtype_mk hx) = x
              @[reducible, inline]
              Equations
              Instances For
                theorem Chapter3.SetTheory.Set.specification_axiom [SetTheory] {A : Set} {P : A.toSubtype → Prop} {x : Object} (h : x ∈ A.specify P) :
                x ∈ A

                Axiom 3.6 (axiom of specification)

                Axiom 3.6 (axiom of specification)

                theorem Chapter3.SetTheory.Set.specify_congr [SetTheory] {A A' : Set} (hAA' : A = A') {P : A.toSubtype → Prop} {P' : A'.toSubtype → Prop} (hPP' : ∀ (x : Object) (h : x ∈ A) (h' : x ∈ A'), P ⟨x, h⟩ ↔ P' ⟨x, h'⟩) :
                A.specify P = A'.specify P'

                This exercise may require some understanding of how subtypes are implemented in Lean.

                theorem Chapter3.SetTheory.Set.mem_inter [SetTheory] (x : Object) (X Y : Set) :
                x ∈ X ∩ Y ↔ x ∈ X ∧ x ∈ Y

                Definition 3.1.22 (Intersections)

                Equations
                theorem Chapter3.SetTheory.Set.mem_sdiff [SetTheory] (x : Object) (X Y : Set) :
                x ∈ X \ Y ↔ x ∈ X ∧ x ∉ Y

                Definition 3.1.26 (Difference sets)

                Proposition 3.1.27(d) / Exercise 3.1.6

                theorem Chapter3.SetTheory.Set.subset_union [SetTheory] {A X : Set} (hAX : A ⊆ X) :
                A ∪ X = X

                Proposition 3.1.27(b)

                theorem Chapter3.SetTheory.Set.union_subset [SetTheory] {A X : Set} (hAX : A ⊆ X) :
                X ∪ A = X

                Proposition 3.1.27(b)

                Proposition 3.1.27(c)

                theorem Chapter3.SetTheory.Set.inter_assoc [SetTheory] (A B C : Set) :
                A ∩ B ∩ C = A ∩ (B ∩ C)

                Proposition 3.1.27(e)

                Proposition 3.1.27(f)

                Proposition 3.1.27(f)

                theorem Chapter3.SetTheory.Set.union_compl [SetTheory] {A X : Set} (hAX : A ⊆ X) :
                A ∪ X \ A = X

                Proposition 3.1.27(f)

                theorem Chapter3.SetTheory.Set.inter_compl [SetTheory] {A X : Set} (hAX : A ⊆ X) :
                A ∩ (X \ A) = ∅

                Proposition 3.1.27(f)

                theorem Chapter3.SetTheory.Set.compl_union [SetTheory] {A B X : Set} (hAX : A ⊆ X) (hBX : B ⊆ X) :
                X \ (A ∪ B) = X \ A ∩ (X \ B)

                Proposition 3.1.27(g)

                theorem Chapter3.SetTheory.Set.compl_inter [SetTheory] {A B X : Set} (hAX : A ⊆ X) (hBX : B ⊆ X) :
                X \ (A ∩ B) = X \ A ∪ X \ B

                Proposition 3.1.27(g)

                Not from textbook: sets form a distributive lattice.

                Equations
                • One or more equations did not get rendered due to their size.

                Sets have a minimal element.

                Equations

                Definition of disjointness (using the previous instances)

                @[reducible, inline]
                abbrev Chapter3.SetTheory.Set.replace [SetTheory] (A : Set) {P : A.toSubtype → Object → Prop} (hP : ∀ (x : A.toSubtype) (y y' : Object), P x y ∧ P x y' → y = y') :
                Equations
                Instances For
                  theorem Chapter3.SetTheory.Set.replacement_axiom [SetTheory] {A : Set} {P : A.toSubtype → Object → Prop} (hP : ∀ (x : A.toSubtype) (y y' : Object), P x y ∧ P x y' → y = y') (y : Object) :
                  y ∈ A.replace hP ↔ ∃ (x : A.toSubtype), P x y

                  Axiom 3.7 (Axiom of replacement)

                  @[reducible, inline]
                  Equations
                  Instances For
                    @[simp]
                    theorem Chapter3.SetTheory.Object.ofnat_eq [SetTheory] {n : ℕ} :
                    ↑↑n = ↑n
                    @[simp]
                    theorem Chapter3.SetTheory.Set.nat_equiv_inj [SetTheory] (n m : ℕ) :
                    ↑n = ↑m ↔ n = m
                    theorem Chapter3.SetTheory.Set.subset_tfae [SetTheory] (A B C : Set) :
                    [A ⊆ B, A ∪ B = B, A ∩ B = A].TFAE

                    Exercise 3.1.5. One can use the tfae_have and tfae_finish tactics here.

                    Exercise 3.1.7

                    Exercise 3.1.7

                    Exercise 3.1.7

                    Exercise 3.1.7

                    Exercise 3.1.8

                    Exercise 3.1.8

                    theorem Chapter3.SetTheory.Set.partition_left [SetTheory] {A B X : Set} (h_union : A ∪ B = X) (h_inter : A ∩ B = ∅) :
                    A = X \ B

                    Exercise 3.1.9

                    theorem Chapter3.SetTheory.Set.partition_right [SetTheory] {A B X : Set} (h_union : A ∪ B = X) (h_inter : A ∩ B = ∅) :
                    B = X \ A

                    Exercise 3.1.9

                    theorem Chapter3.Set.union_eq_partition [SetTheory] (A B : Set) :
                    A ∪ B = A \ B ∪ A ∩ B ∪ B \ A

                    Exercise 3.1.10

                    theorem Chapter3.SetTheory.Set.specification_from_replacement [SetTheory] {A : Set} {P : A.toSubtype → Prop} :
                    ∃ (B : Set), A ⊆ B ∧ ∀ (x : A.toSubtype), ↑x ∈ B ↔ P x

                    Exercise 3.1.11. The challenge is to prove this without using Set.specify, Set.specification_axiom, or Set.specification_axiom'.

                    theorem Chapter3.SetTheory.Set.subset_union_subset [SetTheory] {A B A' B' : Set} (hA'A : A' ⊆ A) (hB'B : B' ⊆ B) :
                    A ∪ A' ⊆ A ∪ B

                    Exercise 3.1.12.

                    theorem Chapter3.SetTheory.Set.subset_inter_subset [SetTheory] {A B A' B' : Set} (hA'A : A' ⊆ A) (hB'B : B' ⊆ B) :
                    A ∩ A' ⊆ A ∩ B

                    Exercise 3.1.12.

                    theorem Chapter3.SetTheory.Set.subset_diff_subset_counter [SetTheory] :
                    ∃ (A : Set) (B : Set) (A' : Set) (B' : Set), A' ⊆ A ∧ B' ⊆ B ∧ ¬A \ A' ⊆ B ∩ B'

                    Exercise 3.1.12.

                    theorem Chapter3.SetTheory.Set.singleton_iff [SetTheory] (A : Set) (hA : A ≠ ∅) :
                    ¬∃ (B : Set), B ⊂ A ↔ ∃ (x : Object), A = {x}

                    Exercise 3.1.13