Documentation

EstimateTools.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:

structure Chapter3.Set :
Instances For
    structure Chapter3.Object :
    Instances For

      Some of the axioms of Zermelo-Frankel theory with atoms

      Instances

        Definition 3.1.1 (objects can be elements of sets)

        Equations
        @[reducible, inline]
        Equations
        Instances For
          theorem Chapter3.Set.coe_eq [SetTheory] {X Y : Set} (h : X.toObject = Y.toObject) :
          X = Y

          Axiom 3.1 (Sets are objects)

          @[simp]

          Axiom 3.1 (Sets are objects)

          @[reducible, inline]
          abbrev Chapter3.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.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.

            theorem Chapter3.Set.eq_empty_iff_forall_notMem [SetTheory] {X : Set} :
            X = ∀ (x : Object), xX

            Empty set is unique

            theorem Chapter3.Set.empty_unique [SetTheory] :
            ∃! X : Set, ∀ (x : Object), xX

            Empty set is unique

            theorem Chapter3.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.Set.mem_union [SetTheory] (x : Object) (X Y : Set) :
            x X Y x X x Y

            Axiom 3.4 (Pairwise union)

            theorem Chapter3.Set.pair_eq [SetTheory] (a b : Object) :
            {a, b} = {a} {b}

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

            theorem Chapter3.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

            theorem Chapter3.Set.singleton_uniq [SetTheory] (a : Object) :
            ∃! X : Set, ∀ (x : Object), x X x = a

            Remark 3.1.8

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

            Remark 3.1.8

            theorem Chapter3.Set.pair_comm [SetTheory] (a b : Object) :
            {a, b} = {b, a}

            Remark 3.1.8

            Remark 3.1.8

            theorem Chapter3.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.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.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

              theorem Chapter3.Set.union_comm [SetTheory] (A B : Set) :
              A B = B A

              Lemma 3.1.12 (Basic properties of unions) / Exercise 3.1.3

              theorem Chapter3.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

              theorem Chapter3.Set.union_self [SetTheory] (A : Set) :
              A A = A

              Proposition 3.1.27(c)

              Proposition 3.1.27(a)

              Proposition 3.1.27(a)

              theorem Chapter3.Set.pair_union_pair [SetTheory] (a b c : Object) :
              {a, b} {b, c} = {a, b, c}

              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.Set.subset_def [SetTheory] (X Y : Set) :
              X Y xX, x Y

              Definition 3.1.14.

              theorem Chapter3.Set.ssubset_def [SetTheory] (X Y : Set) :
              X Y X Y X Y

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

              theorem Chapter3.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

              Examples 3.1.16

              theorem Chapter3.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.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.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
                theorem Chapter3.Set.subtype_property [SetTheory] (A : Set) (x : A.toSubtype) :
                x A

                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.Set.subtype_coe [SetTheory] (A : Set) (x : A.toSubtype) :
                x = x
                theorem Chapter3.Set.coe_inj [SetTheory] (A : Set) (x y : A.toSubtype) :
                x = y x = y
                def Chapter3.Set.subtype_mk [SetTheory] (A : Set) {x : Object} (hx : x A) :

                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.Set.subtype_mk_coe [SetTheory] {A : Set} {x : Object} (hx : x A) :
                  (A.subtype_mk hx) = x
                  @[reducible, inline]
                  abbrev Chapter3.Set.specify [SetTheory] (A : Set) (P : A.toSubtypeProp) :
                  Equations
                  Instances For
                    theorem Chapter3.Set.specification_axiom [SetTheory] {A : Set} {P : A.toSubtypeProp} {x : Object} (h : x A.specify P) :
                    x A

                    Axiom 3.6 (axiom of specification)

                    theorem Chapter3.Set.specification_axiom' [SetTheory] {A : Set} (P : A.toSubtypeProp) (x : A.toSubtype) :
                    x A.specify P P x

                    Axiom 3.6 (axiom of specification)

                    theorem Chapter3.Set.specify_congr [SetTheory] {A A' : Set} (hAA' : A = A') {P : A.toSubtypeProp} {P' : A'.toSubtypeProp} (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.

                    Equations
                    theorem Chapter3.Set.mem_inter [SetTheory] (x : Object) (X Y : Set) :
                    x X Y x X x Y

                    Definition 3.1.22 (Intersections)

                    Equations
                    theorem Chapter3.Set.mem_sdiff [SetTheory] (x : Object) (X Y : Set) :
                    x X \ Y x X xY

                    Definition 3.1.26 (Difference sets)

                    theorem Chapter3.Set.inter_comm [SetTheory] (A B : Set) :
                    A B = B A

                    Proposition 3.1.27(d) / Exercise 3.1.6

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

                    Proposition 3.1.27(b)

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

                    Proposition 3.1.27(b)

                    theorem Chapter3.Set.inter_self [SetTheory] (A : Set) :
                    A A = A

                    Proposition 3.1.27(c)

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

                    Proposition 3.1.27(e)

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

                    Proposition 3.1.27(f)

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

                    Proposition 3.1.27(f)

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

                    Proposition 3.1.27(f)

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

                    Proposition 3.1.27(f)

                    theorem Chapter3.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.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.Set.replace [SetTheory] (A : Set) {P : A.toSubtypeObjectProp} (hP : ∀ (x : A.toSubtype) (y y' : Object), P x y P x y'y = y') :
                    Equations
                    Instances For
                      theorem Chapter3.Set.replacement_axiom [SetTheory] {A : Set} {P : A.toSubtypeObjectProp} (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
                        Equations
                        @[simp]
                        theorem Chapter3.Object.ofnat_eq [SetTheory] {n : } :
                        n = n
                        @[simp]
                        theorem Chapter3.Set.nat_equiv_inj [SetTheory] (n m : ) :
                        n = m n = m
                        theorem Chapter3.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

                        theorem Chapter3.Set.subset_inter_iff [SetTheory] (A B C : Set) :
                        C A B C A C B

                        Exercise 3.1.7

                        Exercise 3.1.7

                        Exercise 3.1.7

                        theorem Chapter3.Set.union_subset_iff [SetTheory] (A B C : Set) :
                        A B C A C B C

                        Exercise 3.1.7

                        theorem Chapter3.Set.inter_union_cancel [SetTheory] (A B : Set) :
                        A (A B) = A

                        Exercise 3.1.8

                        Exercise 3.1.8

                        theorem Chapter3.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.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.Set.specification_from_replacement [SetTheory] {A : Set} {P : A.toSubtypeProp} :
                        ∃ (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.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.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.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.Set.singleton_iff [SetTheory] (A : Set) (hA : A ) :
                        ¬∃ (B : Set), B A ∃ (x : Object), A = {x}

                        Exercise 3.1.13