l3lab/ntp-mathlib huggingface dataset:
/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) := by
  fconstructor
  -- Porting note: I don't know what the magic was in Lean3 proof, it just skipped the proof of `eq`
  · delta IsOpenImmersion.openFunctor
    dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
    congr
    have := (𝖣.t_fac k i j).symm
    rw [← IsIso.inv_comp_eq] at this
    replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
    replace this := congr_arg (ContinuousMap.toFun ·) this
    dsimp at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [coe_comp, coe_comp] at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_eq]
    swap
    · refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
      rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
    refine congr_arg (_ '' ·) ?_
    refine congr_fun ?_ _
    refine Set.image_eq_preimage_of_inverse ?_ ?_
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.inv_hom_id, id_base, id_apply]
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.hom_inv_id, id_base, id_apply]
  · rw [← IsIso.eq_inv_comp, IsOpenImmersion.inv_invApp, Category.assoc,
      (D.t' k i j).c.naturality_assoc]
    simp_rw [← Category.assoc]
    erw [← comp_c_app]
    rw [congr_app (D.t_fac k i j), comp_c_app]
    simp_rw [Category.assoc]
    erw [IsOpenImmersion.inv_naturality, IsOpenImmersion.inv_naturality_assoc,
      IsOpenImmersion.app_inv_app'_assoc]
    simp_rw [← (𝖣.V (k, i)).presheaf.map_comp, eqToHom_map (Functor.op _), eqToHom_op,
      eqToHom_trans]
    rintro x ⟨y, -, eq⟩
    replace eq := ConcreteCategory.congr_arg (𝖣.t i k).base eq
    change ((π₂ i, j, k) ≫ D.t i k).base y = (D.t k i ≫ D.t i k).base x at eq
    rw [𝖣.t_inv, id_base, TopCat.id_app] at eq
    

Proof state:
case h.hU.intro.intro
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
x : ↑↑(V D.toGlueData (k, i))
y : (CategoryTheory.forget TopCat).obj ↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
eq : (pullback.snd ≫ t D.toGlueData i k).base y = x
⊢ x ∈ Set.range ⇑pullback.fst.base

Next tactic:
subst eq
/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) := by
  fconstructor
  -- Porting note: I don't know what the magic was in Lean3 proof, it just skipped the proof of `eq`
  · delta IsOpenImmersion.openFunctor
    dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
    congr
    have := (𝖣.t_fac k i j).symm
    rw [← IsIso.inv_comp_eq] at this
    replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
    replace this := congr_arg (ContinuousMap.toFun ·) this
    dsimp at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [coe_comp, coe_comp] at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_eq]
    swap
    · refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
      rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
    refine congr_arg (_ '' ·) ?_
    refine congr_fun ?_ _
    refine Set.image_eq_preimage_of_inverse ?_ ?_
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.inv_hom_id, id_base, id_apply]
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.hom_inv_id, id_base, id_apply]
  · rw [← IsIso.eq_inv_comp, IsOpenImmersion.inv_invApp, Category.assoc,
      (D.t' k i j).c.naturality_assoc]
    simp_rw [← Category.assoc]
    erw [← comp_c_app]
    rw [congr_app (D.t_fac k i j), comp_c_app]
    simp_rw [Category.assoc]
    erw [IsOpenImmersion.inv_naturality, IsOpenImmersion.inv_naturality_assoc,
      IsOpenImmersion.app_inv_app'_assoc]
    simp_rw [← (𝖣.V (k, i)).presheaf.map_comp, eqToHom_map (Functor.op _), eqToHom_op,
      eqToHom_trans]
    rintro x ⟨y, -, eq⟩
    replace eq := ConcreteCategory.congr_arg (𝖣.t i k).base eq
    change ((π₂ i, j, k) ≫ D.t i k).base y = (D.t k i ≫ D.t i k).base x at eq
    rw [𝖣.t_inv, id_base, TopCat.id_app] at eq
    subst eq
    

Proof state:
case h.hU.intro.intro
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
y : (CategoryTheory.forget TopCat).obj ↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
⊢ (pullback.snd ≫ t D.toGlueData i k).base y ∈ Set.range ⇑pullback.fst.base

Next tactic:
use (inv (D.t' k i j)).base y
/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) := by
  fconstructor
  -- Porting note: I don't know what the magic was in Lean3 proof, it just skipped the proof of `eq`
  · delta IsOpenImmersion.openFunctor
    dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
    congr
    have := (𝖣.t_fac k i j).symm
    rw [← IsIso.inv_comp_eq] at this
    replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
    replace this := congr_arg (ContinuousMap.toFun ·) this
    dsimp at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [coe_comp, coe_comp] at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_eq]
    swap
    · refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
      rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
    refine congr_arg (_ '' ·) ?_
    refine congr_fun ?_ _
    refine Set.image_eq_preimage_of_inverse ?_ ?_
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.inv_hom_id, id_base, id_apply]
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.hom_inv_id, id_base, id_apply]
  · rw [← IsIso.eq_inv_comp, IsOpenImmersion.inv_invApp, Category.assoc,
      (D.t' k i j).c.naturality_assoc]
    simp_rw [← Category.assoc]
    erw [← comp_c_app]
    rw [congr_app (D.t_fac k i j), comp_c_app]
    simp_rw [Category.assoc]
    erw [IsOpenImmersion.inv_naturality, IsOpenImmersion.inv_naturality_assoc,
      IsOpenImmersion.app_inv_app'_assoc]
    simp_rw [← (𝖣.V (k, i)).presheaf.map_comp, eqToHom_map (Functor.op _), eqToHom_op,
      eqToHom_trans]
    rintro x ⟨y, -, eq⟩
    replace eq := ConcreteCategory.congr_arg (𝖣.t i k).base eq
    change ((π₂ i, j, k) ≫ D.t i k).base y = (D.t k i ≫ D.t i k).base x at eq
    rw [𝖣.t_inv, id_base, TopCat.id_app] at eq
    subst eq
    use (inv (D.t' k i j)).base y
    

Proof state:
case h
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
y : (CategoryTheory.forget TopCat).obj ↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
⊢ pullback.fst.base ((inv (t' D.toGlueData k i j)).base y) = (pullback.snd ≫ t D.toGlueData i k).base y

Next tactic:
change (inv (D.t' k i j) ≫ π₁ k, i, j).base y = _
/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) := by
  fconstructor
  -- Porting note: I don't know what the magic was in Lean3 proof, it just skipped the proof of `eq`
  · delta IsOpenImmersion.openFunctor
    dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
    congr
    have := (𝖣.t_fac k i j).symm
    rw [← IsIso.inv_comp_eq] at this
    replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
    replace this := congr_arg (ContinuousMap.toFun ·) this
    dsimp at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [coe_comp, coe_comp] at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_eq]
    swap
    · refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
      rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
    refine congr_arg (_ '' ·) ?_
    refine congr_fun ?_ _
    refine Set.image_eq_preimage_of_inverse ?_ ?_
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.inv_hom_id, id_base, id_apply]
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.hom_inv_id, id_base, id_apply]
  · rw [← IsIso.eq_inv_comp, IsOpenImmersion.inv_invApp, Category.assoc,
      (D.t' k i j).c.naturality_assoc]
    simp_rw [← Category.assoc]
    erw [← comp_c_app]
    rw [congr_app (D.t_fac k i j), comp_c_app]
    simp_rw [Category.assoc]
    erw [IsOpenImmersion.inv_naturality, IsOpenImmersion.inv_naturality_assoc,
      IsOpenImmersion.app_inv_app'_assoc]
    simp_rw [← (𝖣.V (k, i)).presheaf.map_comp, eqToHom_map (Functor.op _), eqToHom_op,
      eqToHom_trans]
    rintro x ⟨y, -, eq⟩
    replace eq := ConcreteCategory.congr_arg (𝖣.t i k).base eq
    change ((π₂ i, j, k) ≫ D.t i k).base y = (D.t k i ≫ D.t i k).base x at eq
    rw [𝖣.t_inv, id_base, TopCat.id_app] at eq
    subst eq
    use (inv (D.t' k i j)).base y
    change (inv (D.t' k i j) ≫ π₁ k, i, j).base y = _
    

Proof state:
case h
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
y : (CategoryTheory.forget TopCat).obj ↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
⊢ (inv (t' D.toGlueData k i j) ≫ pullback.fst).base y = (pullback.snd ≫ t D.toGlueData i k).base y

Next tactic:
congr 2
/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) := by
  fconstructor
  -- Porting note: I don't know what the magic was in Lean3 proof, it just skipped the proof of `eq`
  · delta IsOpenImmersion.openFunctor
    dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
    congr
    have := (𝖣.t_fac k i j).symm
    rw [← IsIso.inv_comp_eq] at this
    replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
    replace this := congr_arg (ContinuousMap.toFun ·) this
    dsimp at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [coe_comp, coe_comp] at this
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_eq]
    swap
    · refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
      rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
    refine congr_arg (_ '' ·) ?_
    refine congr_fun ?_ _
    refine Set.image_eq_preimage_of_inverse ?_ ?_
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.inv_hom_id, id_base, id_apply]
    · intro x
      rw [← comp_apply, ← comp_base, IsIso.hom_inv_id, id_base, id_apply]
  · rw [← IsIso.eq_inv_comp, IsOpenImmersion.inv_invApp, Category.assoc,
      (D.t' k i j).c.naturality_assoc]
    simp_rw [← Category.assoc]
    erw [← comp_c_app]
    rw [congr_app (D.t_fac k i j), comp_c_app]
    simp_rw [Category.assoc]
    erw [IsOpenImmersion.inv_naturality, IsOpenImmersion.inv_naturality_assoc,
      IsOpenImmersion.app_inv_app'_assoc]
    simp_rw [← (𝖣.V (k, i)).presheaf.map_comp, eqToHom_map (Functor.op _), eqToHom_op,
      eqToHom_trans]
    rintro x ⟨y, -, eq⟩
    replace eq := ConcreteCategory.congr_arg (𝖣.t i k).base eq
    change ((π₂ i, j, k) ≫ D.t i k).base y = (D.t k i ≫ D.t i k).base x at eq
    rw [𝖣.t_inv, id_base, TopCat.id_app] at eq
    subst eq
    use (inv (D.t' k i j)).base y
    change (inv (D.t' k i j) ≫ π₁ k, i, j).base y = _
    congr 2
    

Proof state:
case h.e_a.e_self
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
y : (CategoryTheory.forget TopCat).obj ↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
⊢ inv (t' D.toGlueData k i j) ≫ pullback.fst = pullback.snd ≫ t D.toGlueData i k

Next tactic:
rw [IsIso.inv_comp_eq, 𝖣.t_fac_assoc, 𝖣.t_inv, Category.comp_id]
/-- The red and the blue arrows in ![this diagram](https://i.imgur.com/q6X1GJ9.png) commute. -/
@[simp, reassoc]
theorem snd_invApp_t_app (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ =
      (D.t' k i j).c.app _ ≫
        (π₁⁻¹ k, j, i) (unop _) ≫
          (D.V (k, i)).presheaf.map (eqToHom (D.snd_invApp_t_app' i j k U).choose.symm) := by
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
⊢ IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.snd) U ≫
      (t D.toGlueData k i).c.app (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U)) =
    (t' D.toGlueData k i j).c.app (op U) ≫
      IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.fst)
          {
              unop :=
                { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                  is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop ≫
        (V D.toGlueData (k, i)).presheaf.map
          (eqToHom
            (_ :
              op
                  ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.fst)).obj
                    {
                        unop :=
                          { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                            is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop) =
                (Opens.map (t D.toGlueData k i).base).op.obj
                  (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U))))

Next tactic:
have e := (D.snd_invApp_t_app' i j k U).choose_spec
/-- The red and the blue arrows in ![this diagram](https://i.imgur.com/q6X1GJ9.png) commute. -/
@[simp, reassoc]
theorem snd_invApp_t_app (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ =
      (D.t' k i j).c.app _ ≫
        (π₁⁻¹ k, j, i) (unop _) ≫
          (D.V (k, i)).presheaf.map (eqToHom (D.snd_invApp_t_app' i j k U).choose.symm) := by
  have e := (D.snd_invApp_t_app' i j k U).choose_spec
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(pullback (f D.toGlueData i j) (f D.toGlueData i k))
e :
  IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.snd) U ≫
      (t D.toGlueData k i).c.app (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U)) ≫
        (V D.toGlueData (k, i)).presheaf.map
          (eqToHom
            (_ :
              (Opens.map (t D.toGlueData k i).base).op.obj
                  (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U)) =
                op
                  ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.fst)).obj
                    {
                        unop :=
                          { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                            is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop))) =
    (t' D.toGlueData k i j).c.app (op U) ≫
      IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.fst)
        {
            unop :=
              { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop
⊢ IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.snd) U ≫
      (t D.toGlueData k i).c.app (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U)) =
    (t' D.toGlueData k i j).c.app (op U) ≫
      IsOpenImmersion.invApp (_ : IsOpenImmersion pullback.fst)
          {
              unop :=
                { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                  is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop ≫
        (V D.toGlueData (k, i)).presheaf.map
          (eqToHom
            (_ :
              op
                  ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.fst)).obj
                    {
                        unop :=
                          { carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop,
                            is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑(op U).unop)) } }.unop) =
                (Opens.map (t D.toGlueData k i).base).op.obj
                  (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion pullback.snd)).obj U))))

Next tactic:
replace e := reassoc_of% e
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ (Opens.map (ι D.toGlueData j).base).obj ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U) =
    (IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData j i))).obj
      ((Opens.map (t D.toGlueData j i).base).obj ((Opens.map (f D.toGlueData i j).base).obj U))

Next tactic:
ext1
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  ext1
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ ↑((Opens.map (ι D.toGlueData j).base).obj ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)) =
    ↑((IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData j i))).obj
        ((Opens.map (t D.toGlueData j i).base).obj ((Opens.map (f D.toGlueData i j).base).obj U)))

Next tactic:
dsimp only [Opens.map_coe, IsOpenMap.functor_obj_coe]
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  ext1
  dsimp only [Opens.map_coe, IsOpenMap.functor_obj_coe]
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ ⇑(ι D.toGlueData j).base ⁻¹' (⇑(ι D.toGlueData i).base '' ↑U) =
    ⇑(f D.toGlueData j i).base '' (⇑(t D.toGlueData j i).base ⁻¹' (⇑(f D.toGlueData i j).base ⁻¹' ↑U))

Next tactic:
rw [← show _ = (𝖣.ι i).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) i, ←
    show _ = (𝖣.ι j).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) j]
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  ext1
  dsimp only [Opens.map_coe, IsOpenMap.functor_obj_coe]
  rw [← show _ = (𝖣.ι i).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) i, ←
    show _ = (𝖣.ι j).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) j]
  -- Porting note : change `rw` to `erw` on `coe_comp`
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ ⇑(ι (mapGlueData D.toGlueData (forget C)) j ≫ (gluedIso D.toGlueData (forget C)).inv) ⁻¹'
      (⇑(ι (mapGlueData D.toGlueData (forget C)) i ≫ (gluedIso D.toGlueData (forget C)).inv) '' ↑U) =
    ⇑(f D.toGlueData j i).base '' (⇑(t D.toGlueData j i).base ⁻¹' (⇑(f D.toGlueData i j).base ⁻¹' ↑U))

Next tactic:
erw [coe_comp, coe_comp, coe_comp]
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  ext1
  dsimp only [Opens.map_coe, IsOpenMap.functor_obj_coe]
  rw [← show _ = (𝖣.ι i).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) i, ←
    show _ = (𝖣.ι j).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) j]
  -- Porting note : change `rw` to `erw` on `coe_comp`
  erw [coe_comp, coe_comp, coe_comp]
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ (⇑(preservesColimitIso (forget C) (MultispanIndex.multispan (diagram D.toGlueData))).inv ∘
          ⇑(HasColimit.isoOfNatIso (diagramIso D.toGlueData (forget C))).inv) ∘
        ⇑(ι (mapGlueData D.toGlueData (forget C)) j) ⁻¹'
      (⇑(gluedIso D.toGlueData (forget C)).inv ∘ ⇑(ι (mapGlueData D.toGlueData (forget C)) i) '' ↑U) =
    ⇑(f D.toGlueData j i).base '' (⇑(t D.toGlueData j i).base ⁻¹' (⇑(f D.toGlueData i j).base ⁻¹' ↑U))

Next tactic:
rw [Set.image_comp, Set.preimage_comp]
theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (D.f_open j i).openFunctor.obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) := by
  ext1
  dsimp only [Opens.map_coe, IsOpenMap.functor_obj_coe]
  rw [← show _ = (𝖣.ι i).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) i, ←
    show _ = (𝖣.ι j).base from 𝖣.ι_gluedIso_inv (PresheafedSpace.forget _) j]
  -- Porting note : change `rw` to `erw` on `coe_comp`
  erw [coe_comp, coe_comp, coe_comp]
  rw [Set.image_comp, Set.preimage_comp]
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ ⇑(ι (mapGlueData D.toGlueData (forget C)) j) ⁻¹'
      (⇑(preservesColimitIso (forget C) (MultispanIndex.multispan (diagram D.toGlueData))).inv ∘
          ⇑(HasColimit.isoOfNatIso (diagramIso D.toGlueData (forget C))).inv ⁻¹'
        (⇑(gluedIso D.toGlueData (forget C)).inv '' (⇑(ι (mapGlueData D.toGlueData (forget C)) i) '' ↑U))) =
    ⇑(f D.toGlueData j i).base '' (⇑(t D.toGlueData j i).base ⁻¹' (⇑(f D.toGlueData i j).base ⁻¹' ↑U))

Next tactic:
erw [Set.preimage_image_eq]