Documentation

Analysis.Section_3_1

class Chapter3.SetTheory :
Type (max (u + 1) (v + 1))

The axioms of Zermelo-Frankel theory with atoms.

Instances
    @[implicit_reducible]

    Definition 3.1.1 (objects can be elements of sets)

    Equations
    @[implicit_reducible]

    Axiom 3.1 (Sets are objects, coercion).

    Equations

    Axiom 3.1 (Sets are objects, injectivity).

    @[simp]

    Axiom 3.1 (Sets are objects, iff lemma).

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

    Axiom 3.2 (Equality of sets). The @[ext] tag allows the ext tactic to work for sets.

    theorem Chapter3.SetTheory.Set.ext_iff [SetTheory] {X Y : Set} :
    X = Y ↔ ∀ (x : Object), x ∈ X ↔ x ∈ Y
    @[simp]

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

    Empty set has no elements

    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)

    @[simp]

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

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

    Axiom 3.4 (Pairwise union).

    @[simp]
    theorem Chapter3.SetTheory.Set.mem_insert [SetTheory] (a b : Object) (X : Set) :
    a ∈ insert b X ↔ a = b ∨ a ∈ X

    Axiom 3.3(b) (pair). Note: in some applications one may have to cast {a,b} to Set.

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

    Axiom 3.3(b) (pair). Note: in some applications one may have to cast {a,b} to Set.

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

    Remark 3.1.9

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

    Remark 3.1.9

    Remark 3.1.9

    @[simp]

    Remark 3.1.9

    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

      Exercise 3.1.2 (empty set is not a singleton)

      Exercise 3.1.2 (empty set is not a pair)

      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, singletons) / Exercise 3.1.3

      Lemma 3.1.12 (Basic properties of unions, commutativity) / 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, associativity) / Exercise 3.1.3

      @[simp]

      Proposition 3.1.27(c) (Union idempotent).

      @[simp]

      Proposition 3.1.27(a) (Union with empty).

      @[simp]

      Proposition 3.1.27(a) (Empty with union).

      Example 3.1.10

      @[implicit_reducible]

      Definition 3.1.14 (Subset).

      Equations
      @[implicit_reducible]

      Definition 3.1.14 (Strict subset). 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
      theorem Chapter3.SetTheory.Set.subset_congr_left [SetTheory] {A A' B : Set} (hAA' : A = A') (hAB : A ⊆ B) :
      A' ⊆ B

      Remark 3.1.15

      @[simp]

      Examples 3.1.16 (reflexivity)

      @[simp]

      Examples 3.1.16 (the empty set is a subset)

      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, transitivity)

      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, antisymmetry)

      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, strict transitivity)

      @[reducible, inline]

      This defines the subtype A.toSubtype for any A:Set. Note that A.toSubtype gives you a type, similar to how Object or Set are types. A value x' of type A.toSubtype combines some x : Object with a proof that hx : x ∈ A.

      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
        @[implicit_reducible]
        Equations

        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
          @[simp]
          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, membership)

            Axiom 3.6 (axiom of specification, the property holds)

            @[simp]
            theorem Chapter3.SetTheory.Set.specification_axiom'' [SetTheory] {A : Set} (P : A.toSubtype → Prop) (x : Object) :
            x ∈ A.specify P ↔ ∃ (h : x ∈ A), P ⟨x, h⟩

            Axiom 3.6 (axiom of specification, the specified set is a subset)

            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.

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

            Definition 3.1.22 (Intersections)

            @[implicit_reducible]
            Equations
            @[simp]
            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) (Subset absorption).

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

            Proposition 3.1.27(b) (Union absorption).

            @[simp]

            Proposition 3.1.27(c) (Intersection idempotent).

            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) (Intersection distributes over union).

            Proposition 3.1.27(f) (Union distributes over intersection).

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

            Proposition 3.1.27(f) (Partition of a superset).

            Proposition 3.1.27(f) (Disjoint intersection with complement).

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

            Proposition 3.1.27(g) (Complement of a union).

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

            Proposition 3.1.27(g) (Complement of an intersection).

            @[implicit_reducible]

            Not from textbook: sets form a distributive lattice.

            Equations
            • One or more equations did not get rendered due to their size.
            @[implicit_reducible]

            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
              @[simp]
              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
                @[implicit_reducible]
                Equations
                @[implicit_reducible]
                Equations
                @[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
                @[simp]
                theorem Chapter3.SetTheory.Object.natCast_inj [SetTheory] (n m : ℕ) :
                ↑n = ↑m ↔ n = m

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

                Exercise 3.1.7 (a)

                Exercise 3.1.7 (b)

                @[simp]

                Exercise 3.1.7 (c)

                Exercise 3.1.7 (d)

                Exercise 3.1.7 (e)

                @[simp]

                Exercise 3.1.7 (f)

                @[simp]

                Exercise 3.1.8 (a)

                @[simp]

                Exercise 3.1.8 (b)

                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 (a)

                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 (b)

                Exercise 3.1.10. You may find Function.onFun_apply and the fin_cases tactic useful.

                Exercise 3.1.10

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

                Exercise 3.1.11. The challenge is to prove this without using Set.specify, Set.specification_axiom, Set.specification_axiom', or anything built from them (like differences and intersections).

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

                Exercise 3.1.12 (unions)

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

                Exercise 3.1.12 (intersections)

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

                Exercise 3.1.12 (differences: a counterexample)

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

                Exercise 3.1.13

                @[simp]

                Injectivity of the coercion. Note however that we do NOT assert that the coercion is surjective (and indeed Russell's paradox prevents this)

                Compatibility of the membership operation ∈

                Compatibility of the emptyset

                Compatibility of subset

                Compatibility of singleton

                Compatibility of union

                Compatibility of pair

                Compatibility of subtype

                Compatibility of intersection

                Compatibility of set difference

                Compatibility of disjointness