Documentation

Analysis.Section_3_4

Analysis I, Section 3.4: Images and inverse images #

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:

Tips from past users #

Users of the companion who have completed the exercises in this section are welcome to send their tips for future users in this section as PRs.

@[reducible, inline]
abbrev Chapter3.SetTheory.Set.image [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (S : Set) :

Definition 3.4.1. Interestingly, the definition does not require S to be a subset of X.

Equations
Instances For
    theorem Chapter3.SetTheory.Set.mem_image [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (S : Set) (y : Object) :
    y image f S ∃ (x : X.toSubtype), x S (f x) = y

    Definition 3.4.1

    theorem Chapter3.SetTheory.Set.image_eq_specify [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (S : Set) :
    image f S = Y.specify fun (y : Y.toSubtype) => ∃ (x : X.toSubtype), x S f x = y

    Alternate definition of image using axiom of specification

    theorem Chapter3.SetTheory.Set.image_eq_image [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (S : Set) :
    {x : Object | x image f S} = Subtype.val '' (f '' {x : X.toSubtype | x S})

    Connection with Mathlib's notion of image. Note the need to utilize the Subtype.val coercion to make everything type consistent.

    @[reducible, inline]

    Example 3.4.2

    Equations
    Instances For
      theorem Chapter3.SetTheory.Set.mem_image_of_eval [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (S : Set) (x : X.toSubtype) :
      x S(f x) image f S
      theorem Chapter3.SetTheory.Set.mem_image_of_eval_counter [SetTheory] :
      ∃ (X : Set) (Y : Set) (f : X.toSubtypeY.toSubtype) (S : Set) (x : X.toSubtype), ¬((f x) image f Sx S)
      @[reducible, inline]

      Definition 3.4.4 (inverse images). Again, it is not required that U be a subset of Y.

      Equations
      Instances For
        @[simp]
        theorem Chapter3.SetTheory.Set.mem_preimage [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (U : Set) (x : X.toSubtype) :
        x preimage f U (f x) U
        theorem Chapter3.SetTheory.Set.mem_preimage' [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (U : Set) (x : Object) :
        x preimage f U ∃ (x' : X.toSubtype), x' = x (f x') U

        A version of mem_preimage that does not require x to be of type X.

        Connection with Mathlib's notion of preimage.

        This coercion has to be a CoeOut rather than a Coe because the input type X → Y contains parameters not present in the output type Output

        Equations
        @[simp]
        theorem Chapter3.SetTheory.Set.coe_of_fun_inj [SetTheory] {X Y : Set} (f g : X.toSubtypeY.toSubtype) :
        f = g f = g
        @[simp]
        theorem Chapter3.SetTheory.Set.powerset_axiom [SetTheory] {X Y : Set} (F : Object) :
        F X ^ Y ∃ (f : Y.toSubtypeX.toSubtype), f = F

        Axiom 3.11 (Power set axiom) -

        @[reducible, inline]

        Example 3.4.9

        Equations
        Instances For
          @[reducible, inline]
          noncomputable abbrev Chapter3.f_3_4_9_b [SetTheory] :
          Equations
          Instances For
            @[reducible, inline]
            noncomputable abbrev Chapter3.f_3_4_9_c [SetTheory] :
            Equations
            Instances For
              @[reducible, inline]
              Equations
              Instances For

                Exercise 3.4.6 (i). One needs to provide a suitable definition of the power set here.

                Equations
                Instances For
                  @[simp]

                  Exercise 3.4.6 (i)

                  theorem Chapter3.SetTheory.Set.exists_powerset [SetTheory] (X : Set) :
                  ∃ (Z : Set), ∀ (x : Object), x Z ∃ (Y : Set), x = set_to_object Y Y X

                  Lemma 3.4.10

                  Axiom 3.12 (Union)

                  Connection with Mathlib union

                  @[reducible, inline]

                  Indexed union

                  Equations
                  Instances For
                    theorem Chapter3.SetTheory.Set.mem_iUnion [SetTheory] {I : Set} (A : I.toSubtypeSet) (x : Object) :
                    x I.iUnion A ∃ (α : I.toSubtype), x A α
                    @[reducible, inline]
                    Equations
                    Instances For
                      theorem Chapter3.SetTheory.Set.iUnion_eq [SetTheory] (I : Set) (A : I.toSubtypeSet) :
                      {x : Object | x I.iUnion A} = ⋃ (α : I.toSubtype), {x : Object | x A α}

                      Connection with Mathlib indexed union

                      @[reducible, inline]
                      noncomputable abbrev Chapter3.SetTheory.Set.nonempty_choose [SetTheory] {I : Set} (hI : I ) :

                      Indexed intersection

                      Equations
                      Instances For
                        @[reducible, inline]
                        Equations
                        Instances For
                          @[reducible, inline]
                          noncomputable abbrev Chapter3.SetTheory.Set.iInter [SetTheory] (I : Set) (hI : I ) (A : I.toSubtypeSet) :
                          Equations
                          Instances For
                            theorem Chapter3.SetTheory.Set.mem_iInter [SetTheory] {I : Set} (hI : I ) (A : I.toSubtypeSet) (x : Object) :
                            x I.iInter hI A ∀ (α : I.toSubtype), x A α
                            theorem Chapter3.SetTheory.Set.preimage_eq_image_of_inv [SetTheory] {X Y V : Set} (f : X.toSubtypeY.toSubtype) (f_inv : Y.toSubtypeX.toSubtype) (hf : Function.LeftInverse f_inv f Function.RightInverse f_inv f) (hV : V Y) :
                            image f_inv V = preimage f V

                            Exercise 3.4.1

                            theorem Chapter3.SetTheory.Set.image_of_inter [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (A B : Set) :
                            image f (A B) image f A image f B

                            Exercise 3.4.3.

                            theorem Chapter3.SetTheory.Set.image_of_diff [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (A B : Set) :
                            image f A \ image f B image f (A \ B)
                            theorem Chapter3.SetTheory.Set.image_of_union [SetTheory] {X Y : Set} (f : X.toSubtypeY.toSubtype) (A B : Set) :
                            image f (A B) = image f A image f B
                            def Chapter3.SetTheory.Set.image_of_inter' [SetTheory] :
                            Decidable (∀ (X Y : Set) (f : X.toSubtypeY.toSubtype) (A B : Set), image f (A B) = image f A image f B)
                            Equations
                            Instances For
                              def Chapter3.SetTheory.Set.image_of_diff' [SetTheory] :
                              Decidable (∀ (X Y : Set) (f : X.toSubtypeY.toSubtype) (A B : Set), image f (A \ B) = image f A \ image f B)
                              Equations
                              Instances For

                                Exercise 3.4.4

                                Exercise 3.4.5

                                Exercise 3.4.5

                                @[simp]

                                Helper lemma for Exercise 3.4.7.

                                theorem Chapter3.SetTheory.Set.mem_union_powerset_replace_iff [SetTheory] {S : Set} {P : S.powerset.toSubtypeObjectProp} {hP : ∀ (x : S.powerset.toSubtype) (y y' : Object), P x y P x y'y = y'} {x : Object} :
                                x union (S.powerset.replace hP) ∃ (S' : S.powerset.toSubtype) (U : Set), P S' (set_to_object U) x U

                                Another helper lemma for Exercise 3.4.7.

                                theorem Chapter3.SetTheory.Set.partial_functions [SetTheory] {X Y : Set} :
                                ∃ (Z : Set), ∀ (F : Object), F Z ∃ (X' : Set) (Y' : Set), X' X Y' Y ∃ (f : X'.toSubtypeY'.toSubtype), F = f

                                Exercise 3.4.7

                                theorem Chapter3.SetTheory.Set.union_pair_exists [SetTheory] (X Y : Set) :
                                ∃ (Z : Set), ∀ (x : Object), x Z x X x Y

                                Exercise 3.4.8. The point of this exercise is to prove it without using the pairwise union operation .

                                theorem Chapter3.SetTheory.Set.iInter'_insensitive [SetTheory] {I : Set} (β β' : I.toSubtype) (A : I.toSubtypeSet) :
                                I.iInter' β A = I.iInter' β' A

                                Exercise 3.4.9

                                theorem Chapter3.SetTheory.Set.union_iUnion [SetTheory] {I J : Set} (A : (I J).toSubtypeSet) :
                                ((I.iUnion fun (α : I.toSubtype) => A α, ) J.iUnion fun (α : J.toSubtype) => A α, ) = (I J).iUnion A

                                Exercise 3.4.10

                                theorem Chapter3.SetTheory.Set.union_of_nonempty [SetTheory] {I J : Set} (hI : I ) (hJ : J ) :
                                I J

                                Exercise 3.4.10

                                theorem Chapter3.SetTheory.Set.inter_iInter [SetTheory] {I J : Set} (hI : I ) (hJ : J ) (A : (I J).toSubtypeSet) :
                                ((I.iInter hI fun (α : I.toSubtype) => A α, ) J.iInter hJ fun (α : J.toSubtype) => A α, ) = (I J).iInter A

                                Exercise 3.4.10

                                theorem Chapter3.SetTheory.Set.compl_iUnion [SetTheory] {X I : Set} (hI : I ) (A : I.toSubtypeSet) :
                                X \ I.iUnion A = I.iInter hI fun (α : I.toSubtype) => X \ A α

                                Exercise 3.4.11

                                theorem Chapter3.SetTheory.Set.compl_iInter [SetTheory] {X I : Set} (hI : I ) (A : I.toSubtypeSet) :
                                X \ I.iInter hI A = I.iUnion fun (α : I.toSubtype) => X \ A α

                                Exercise 3.4.11