l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem toPushforwardOfIso_app {X Y : TopCat} (H₁ : X ≅ Y) {ℱ : X.Presheaf C} {𝒢 : Y.Presheaf C}
    (H₂ : H₁.hom _* ℱ ⟶ 𝒢) (U : (Opens X)ᵒᵖ) :
    (toPushforwardOfIso H₁ H₂).app U =
      ℱ.map (eqToHom (by simp [Opens.map, Set.preimage_preimage])) ≫
        H₂.app (op ((Opens.map H₁.inv).obj (unop U))) := by
  delta toPushforwardOfIso
  -- Porting note : originally is a single invocation of `simp`
  simp only [pushforwardObj_obj, Functor.op_obj, Equivalence.toAdjunction, Adjunction.homEquiv_unit,
    Functor.id_obj, Functor.comp_obj, Adjunction.mkOfUnitCounit_unit, unop_op, eqToHom_map]
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y : TopCat
H₁ : X ≅ Y
ℱ : Presheaf C X
𝒢 : Presheaf C Y
H₂ : H₁.hom _* ℱ ⟶ 𝒢
U : (Opens ↑X)ᵒᵖ
⊢ ((presheafEquivOfIso C H₁).unit.app ℱ ≫ (presheafEquivOfIso C H₁).inverse.map H₂).app U =
    eqToHom (_ : ℱ.obj U = ℱ.obj (op ((Opens.map H₁.hom).obj ((Opens.map H₁.inv).obj U.unop)))) ≫
      H₂.app (op ((Opens.map H₁.inv).obj U.unop))

Next tactic:
rw [NatTrans.comp_app, presheafEquivOfIso_inverse_map_app, Equivalence.Equivalence_mk'_unit]
@[simp]
theorem toPushforwardOfIso_app {X Y : TopCat} (H₁ : X ≅ Y) {ℱ : X.Presheaf C} {𝒢 : Y.Presheaf C}
    (H₂ : H₁.hom _* ℱ ⟶ 𝒢) (U : (Opens X)ᵒᵖ) :
    (toPushforwardOfIso H₁ H₂).app U =
      ℱ.map (eqToHom (by simp [Opens.map, Set.preimage_preimage])) ≫
        H₂.app (op ((Opens.map H₁.inv).obj (unop U))) := by
  delta toPushforwardOfIso
  -- Porting note : originally is a single invocation of `simp`
  simp only [pushforwardObj_obj, Functor.op_obj, Equivalence.toAdjunction, Adjunction.homEquiv_unit,
    Functor.id_obj, Functor.comp_obj, Adjunction.mkOfUnitCounit_unit, unop_op, eqToHom_map]
  rw [NatTrans.comp_app, presheafEquivOfIso_inverse_map_app, Equivalence.Equivalence_mk'_unit]
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y : TopCat
H₁ : X ≅ Y
ℱ : Presheaf C X
𝒢 : Presheaf C Y
H₂ : H₁.hom _* ℱ ⟶ 𝒢
U : (Opens ↑X)ᵒᵖ
⊢ ((presheafEquivOfIso C H₁).unitIso.hom.app ℱ).app U ≫ H₂.app (op ((Opens.map H₁.inv).obj U.unop)) =
    eqToHom (_ : ℱ.obj U = ℱ.obj (op ((Opens.map H₁.hom).obj ((Opens.map H₁.inv).obj U.unop)))) ≫
      H₂.app (op ((Opens.map H₁.inv).obj U.unop))

Next tactic:
congr 1
@[simp]
theorem toPushforwardOfIso_app {X Y : TopCat} (H₁ : X ≅ Y) {ℱ : X.Presheaf C} {𝒢 : Y.Presheaf C}
    (H₂ : H₁.hom _* ℱ ⟶ 𝒢) (U : (Opens X)ᵒᵖ) :
    (toPushforwardOfIso H₁ H₂).app U =
      ℱ.map (eqToHom (by simp [Opens.map, Set.preimage_preimage])) ≫
        H₂.app (op ((Opens.map H₁.inv).obj (unop U))) := by
  delta toPushforwardOfIso
  -- Porting note : originally is a single invocation of `simp`
  simp only [pushforwardObj_obj, Functor.op_obj, Equivalence.toAdjunction, Adjunction.homEquiv_unit,
    Functor.id_obj, Functor.comp_obj, Adjunction.mkOfUnitCounit_unit, unop_op, eqToHom_map]
  rw [NatTrans.comp_app, presheafEquivOfIso_inverse_map_app, Equivalence.Equivalence_mk'_unit]
  congr 1
  

Proof state:
case e_a
C : Type u
inst✝ : Category.{v, u} C
X Y : TopCat
H₁ : X ≅ Y
ℱ : Presheaf C X
𝒢 : Presheaf C Y
H₂ : H₁.hom _* ℱ ⟶ 𝒢
U : (Opens ↑X)ᵒᵖ
⊢ ((presheafEquivOfIso C H₁).unitIso.hom.app ℱ).app U =
    eqToHom (_ : ℱ.obj U = ℱ.obj (op ((Opens.map H₁.hom).obj ((Opens.map H₁.inv).obj U.unop))))

Next tactic:
simp only [Equivalence.unit, Equivalence.op, CategoryTheory.Equivalence.symm, Opens.mapMapIso,
    Functor.id_obj, Functor.comp_obj, Iso.symm_hom, NatIso.op_inv, Iso.symm_inv, NatTrans.op_app,
    NatIso.ofComponents_hom_app, eqToIso.hom, eqToHom_op, Equivalence.Equivalence_mk'_unitInv,
    Equivalence.Equivalence_mk'_counitInv, NatIso.op_hom, unop_op, op_unop, eqToIso.inv,
    NatIso.ofComponents_inv_app, eqToHom_unop, ← ℱ.map_comp, eqToHom_trans, eqToHom_map,
    presheafEquivOfIso_unitIso_hom_app_app]
@[simp]
theorem pushforwardToOfIso_app {X Y : TopCat} (H₁ : X ≅ Y) {ℱ : Y.Presheaf C} {𝒢 : X.Presheaf C}
    (H₂ : ℱ ⟶ H₁.hom _* 𝒢) (U : (Opens X)ᵒᵖ) :
    (pushforwardToOfIso H₁ H₂).app U =
      H₂.app (op ((Opens.map H₁.inv).obj (unop U))) ≫
        𝒢.map (eqToHom (by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y : TopCat
H₁ : X ≅ Y
ℱ : Presheaf C Y
𝒢 : Presheaf C X
H₂ : ℱ ⟶ H₁.hom _* 𝒢
U : (Opens ↑X)ᵒᵖ
⊢ (Opens.map H₁.hom).op.obj (op ((Opens.map H₁.inv).obj U.unop)) = U

Next tactic:
simp [Opens.map, Set.preimage_preimage]
@[simp]
theorem pushforwardToOfIso_app {X Y : TopCat} (H₁ : X ≅ Y) {ℱ : Y.Presheaf C} {𝒢 : X.Presheaf C}
    (H₂ : ℱ ⟶ H₁.hom _* 𝒢) (U : (Opens X)ᵒᵖ) :
    (pushforwardToOfIso H₁ H₂).app U =
      H₂.app (op ((Opens.map H₁.inv).obj (unop U))) ≫
        𝒢.map (eqToHom (by simp [Opens.map, Set.preimage_preimage])) := by
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y : TopCat
H₁ : X ≅ Y
ℱ : Presheaf C Y
𝒢 : Presheaf C X
H₂ : ℱ ⟶ H₁.hom _* 𝒢
U : (Opens ↑X)ᵒᵖ
⊢ (pushforwardToOfIso H₁ H₂).app U =
    H₂.app (op ((Opens.map H₁.inv).obj U.unop)) ≫
      𝒢.map
        (eqToHom
          (_ :
            op
                {
                  carrier :=
                    ⇑H₁.hom ⁻¹'
                      ↑(op { carrier := ⇑H₁.inv ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑H₁.inv ⁻¹' ↑U.unop)) }).unop,
                  is_open' :=
                    (_ :
                      IsOpen
                        (⇑H₁.hom ⁻¹'
                          ↑(op
                                { carrier := ⇑H₁.inv ⁻¹' ↑U.unop,
                                  is_open' := (_ : IsOpen (⇑H₁.inv ⁻¹' ↑U.unop)) }).unop)) } =
              U))

Next tactic:
simp [pushforwardToOfIso, Equivalence.toAdjunction, CategoryStruct.comp]
/-- If `x` is in the domain of the induced map of a scheme `A`,
its image under this map is in each set along the corresponding branch. -/
theorem map_mem (x : (inducedMap A).1) (n : ℕ) : (inducedMap A).2 x ∈ A (res x n) := by
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
x : ↑(inducedMap A).fst
n : ℕ
⊢ Sigma.snd (inducedMap A) x ∈ A (res (↑x) n)

Next tactic:
have := x.property.some_mem
/-- If `x` is in the domain of the induced map of a scheme `A`,
its image under this map is in each set along the corresponding branch. -/
theorem map_mem (x : (inducedMap A).1) (n : ℕ) : (inducedMap A).2 x ∈ A (res x n) := by
  have := x.property.some_mem
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
x : ↑(inducedMap A).fst
n : ℕ
this : Set.Nonempty.some (_ : ↑x ∈ (inducedMap A).fst) ∈ ⋂ n, A (res (↑x) n)
⊢ Sigma.snd (inducedMap A) x ∈ A (res (↑x) n)

Next tactic:
rw [mem_iInter] at this
/-- If `x` is in the domain of the induced map of a scheme `A`,
its image under this map is in each set along the corresponding branch. -/
theorem map_mem (x : (inducedMap A).1) (n : ℕ) : (inducedMap A).2 x ∈ A (res x n) := by
  have := x.property.some_mem
  rw [mem_iInter] at this
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
x : ↑(inducedMap A).fst
n : ℕ
this : ∀ (i : ℕ), Set.Nonempty.some (_ : ↑x ∈ (inducedMap A).fst) ∈ A (res (↑x) i)
⊢ Sigma.snd (inducedMap A) x ∈ A (res (↑x) n)

Next tactic:
exact this n
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
⊢ Injective (inducedMap A).snd

Next tactic:
rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  

Proof state:
case mk.mk
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
⊢ { val := x, property := hx } = { val := y, property := hy }

Next tactic:
refine' Subtype.coe_injective (res_injective _)
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  

Proof state:
case mk.mk
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
⊢ res ((fun a => ↑a) { val := x, property := hx }) = res ((fun a => ↑a) { val := y, property := hy })

Next tactic:
dsimp
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  

Proof state:
case mk.mk
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
⊢ res x = res y

Next tactic:
ext n : 1
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  

Proof state:
case mk.mk.h
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
⊢ res x n = res y n

Next tactic:
induction' n with n ih
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · 

Proof state:
case mk.mk.h.zero
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
⊢ res x Nat.zero = res y Nat.zero

Next tactic:
simp
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
⊢ res x (Nat.succ n) = res y (Nat.succ n)

Next tactic:
simp only [res_succ, cons.injEq]
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
⊢ x n = y n ∧ res x n = res y n

Next tactic:
refine' ⟨_, ih⟩
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
hA : CantorScheme.Disjoint A
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
⊢ x n = y n

Next tactic:
contrapose hA
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ ¬CantorScheme.Disjoint A

Next tactic:
simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ ∃ x x_1 x_2, ¬x_1 = x_2 ∧ ¬_root_.Disjoint (A (x_1 :: x)) (A (x_2 :: x))

Next tactic:
refine' ⟨res x n, _, _, hA, _⟩
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ ¬_root_.Disjoint (A (x n :: res x n)) (A (y n :: res x n))

Next tactic:
rw [not_disjoint_iff]
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  rw [not_disjoint_iff]
  

Proof state:
case mk.mk.h.succ
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ ∃ x_1 ∈ A (x n :: res x n), x_1 ∈ A (y n :: res x n)

Next tactic:
refine' ⟨(inducedMap A).2 ⟨x, hx⟩, _, _⟩
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  rw [not_disjoint_iff]
  refine' ⟨(inducedMap A).2 ⟨x, hx⟩, _, _⟩
  · 

Proof state:
case mk.mk.h.succ.refine'_1
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ Sigma.snd (inducedMap A) { val := x, property := hx } ∈ A (x n :: res x n)

Next tactic:
rw [← res_succ]
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  rw [not_disjoint_iff]
  refine' ⟨(inducedMap A).2 ⟨x, hx⟩, _, _⟩
  · rw [← res_succ]
    

Proof state:
case mk.mk.h.succ.refine'_1
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ Sigma.snd (inducedMap A) { val := x, property := hx } ∈ A (res x (Nat.succ n))

Next tactic:
apply map_mem
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  rw [not_disjoint_iff]
  refine' ⟨(inducedMap A).2 ⟨x, hx⟩, _, _⟩
  · rw [← res_succ]
    apply map_mem
  

Proof state:
case mk.mk.h.succ.refine'_2
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ Sigma.snd (inducedMap A) { val := x, property := hx } ∈ A (y n :: res x n)

Next tactic:
rw [hxy, ih, ← res_succ]
/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
  rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy
  refine' Subtype.coe_injective (res_injective _)
  dsimp
  ext n : 1
  induction' n with n ih; · simp
  simp only [res_succ, cons.injEq]
  refine' ⟨_, ih⟩
  contrapose hA
  simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne.def, not_forall, exists_prop]
  refine' ⟨res x n, _, _, hA, _⟩
  rw [not_disjoint_iff]
  refine' ⟨(inducedMap A).2 ⟨x, hx⟩, _, _⟩
  · rw [← res_succ]
    apply map_mem
  rw [hxy, ih, ← res_succ]
  

Proof state:
case mk.mk.h.succ.refine'_2
β : Type u_1
α : Type u_2
A : List β → Set α
x : ℕ → β
hx : x ∈ (inducedMap A).fst
y : ℕ → β
hy : y ∈ (inducedMap A).fst
hxy : Sigma.snd (inducedMap A) { val := x, property := hx } = Sigma.snd (inducedMap A) { val := y, property := hy }
n : ℕ
ih : res x n = res y n
hA : ¬x n = y n
⊢ Sigma.snd (inducedMap A) { val := y, property := hy } ∈ A (res y (Nat.succ n))

Next tactic:
apply map_mem
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
hA : VanishingDiam A
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
⊢ ∃ n, ∀ y ∈ A (res x n), ∀ z ∈ A (res x n), dist y z < ε

Next tactic:
specialize hA x
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  specialize hA x
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
hA : Tendsto (fun n => EMetric.diam (A (res x n))) atTop (𝓝 0)
⊢ ∃ n, ∀ y ∈ A (res x n), ∀ z ∈ A (res x n), dist y z < ε

Next tactic:
rw [ENNReal.tendsto_atTop_zero] at hA
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  specialize hA x
  rw [ENNReal.tendsto_atTop_zero] at hA
  

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
hA : ∀ ε > 0, ∃ N, ∀ n ≥ N, EMetric.diam (A (res x n)) ≤ ε
⊢ ∃ n, ∀ y ∈ A (res x n), ∀ z ∈ A (res x n), dist y z < ε

Next tactic:
cases' hA (ENNReal.ofReal (ε / 2)) (by
    simp only [gt_iff_lt, ENNReal.ofReal_pos]
    linarith) with n hn
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  specialize hA x
  rw [ENNReal.tendsto_atTop_zero] at hA
  cases' hA (ENNReal.ofReal (ε / 2)) (by
    

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
hA : ∀ ε > 0, ∃ N, ∀ n ≥ N, EMetric.diam (A (res x n)) ≤ ε
⊢ ENNReal.ofReal (ε / 2) > 0

Next tactic:
simp only [gt_iff_lt, ENNReal.ofReal_pos]
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  specialize hA x
  rw [ENNReal.tendsto_atTop_zero] at hA
  cases' hA (ENNReal.ofReal (ε / 2)) (by
    simp only [gt_iff_lt, ENNReal.ofReal_pos]
    

Proof state:
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
hA : ∀ ε > 0, ∃ N, ∀ n ≥ N, EMetric.diam (A (res x n)) ≤ ε
⊢ 0 < ε / 2

Next tactic:
linarith
theorem VanishingDiam.dist_lt (hA : VanishingDiam A) (ε : ℝ) (ε_pos : 0 < ε) (x : ℕ → β) :
    ∃ n : ℕ, ∀ (y) (_ : y ∈ A (res x n)) (z) (_ : z ∈ A (res x n)), dist y z < ε := by
  specialize hA x
  rw [ENNReal.tendsto_atTop_zero] at hA
  cases' hA (ENNReal.ofReal (ε / 2)) (by
    simp only [gt_iff_lt, ENNReal.ofReal_pos]
    linarith) with n hn
  

Proof state:
case intro
β : Type u_1
α : Type u_2
A : List β → Set α
inst✝ : PseudoMetricSpace α
ε : ℝ
ε_pos : 0 < ε
x : ℕ → β
hA : ∀ ε > 0, ∃ N, ∀ n ≥ N, EMetric.diam (A (res x n)) ≤ ε
n : ℕ
hn : ∀ n_1 ≥ n, EMetric.diam (A (res x n_1)) ≤ ENNReal.ofReal (ε / 2)
⊢ ∃ n, ∀ y ∈ A (res x n), ∀ z ∈ A (res x n), dist y z < ε

Next tactic:
use n