l3lab/ntp-mathlib huggingface dataset:
/-- The red and the blue arrows in ![this diagram](https://i.imgur.com/0GiBUh6.png) commute. -/
@[simp, reassoc]
theorem f_invApp_f_app (i j k : D.J) (U : Opens (D.V (i, j)).carrier) :
    (D.f_open i j).invApp U ≫ (D.f i k).c.app _ =
      (π₁ i, j, k).c.app (op U) ≫
        (π₂⁻¹ i, j, k) (unop _) ≫
          (D.V _).presheaf.map
            (eqToHom
              (by
                delta IsOpenImmersion.openFunctor
                dsimp only [Functor.op, IsOpenMap.functor, Opens.map, unop_op]
                congr
                apply pullback_base)) := by
  have := PresheafedSpace.congr_app (@pullback.condition _ _ _ _ _ (D.f i j) (D.f i k) _)
  dsimp only [comp_c_app] at this
  rw [← cancel_epi (inv ((D.f_open i j).invApp U)), IsIso.inv_hom_id_assoc,
    IsOpenImmersion.inv_invApp]
  simp_rw [Category.assoc]
  erw [(π₁ i, j, k).c.naturality_assoc, reassoc_of% this, ← Functor.map_comp_assoc,
    IsOpenImmersion.inv_naturality_assoc, IsOpenImmersion.app_invApp_assoc, ←
    (D.V (i, k)).presheaf.map_comp, ← (D.V (i, k)).presheaf.map_comp]
  -- Porting note : need to provide an explicit argument, otherwise Lean does not know which
  -- category we are talking about
  convert (Category.comp_id ((f D.toGlueData i k).c.app _)).symm
  erw [(D.V (i, k)).presheaf.map_id]
  

Proof state:
case h.e'_3.h.h.e'_7
C : Type u
inst✝ : Category.{v, u} C
D : GlueData C
i j k : D.J
U : Opens ↑↑(V D.toGlueData (i, j))
this :
  ∀ (U : (Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i))ᵒᵖ),
    (f D.toGlueData i j).c.app U ≫ pullback.fst.c.app (op ((Opens.map (f D.toGlueData i j).base).obj U.unop)) =
      ((f D.toGlueData i k).c.app U ≫ pullback.snd.c.app (op ((Opens.map (f D.toGlueData i k).base).obj U.unop))) ≫
        (pullback (f D.toGlueData i j) (f D.toGlueData i k)).presheaf.map
          (eqToHom
            (_ :
              (Opens.map (pullback.snd ≫ f D.toGlueData i k).base).op.obj U =
                (Opens.map (pullback.fst ≫ f D.toGlueData i j).base).op.obj U))
⊢ 𝟙
      ((V D.toGlueData (i, k)).presheaf.obj
        (op
          ((Opens.map (f D.toGlueData i k).base).obj
            (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData i j))).obj U)).unop))) =
    𝟙
      (((f D.toGlueData i k).base _* (V D.toGlueData (i, k)).presheaf).obj
        (op ((IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData i j))).obj U)))

Next tactic:
rfl
/-- 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
  

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))
⊢ ∃ (eq :
    (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)),
    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 eq) =
      (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

Next tactic:
fconstructor
/-- 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`
  · 

Proof state:
case w
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))
⊢ (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)

Next tactic:
delta IsOpenImmersion.openFunctor
/-- 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
    

Proof state:
case w
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))
⊢ (Opens.map (t D.toGlueData k i).base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd.base)).obj U)) =
    op
      ((IsOpenMap.functor (_ : IsOpenMap ⇑pullback.fst.base)).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)

Next tactic:
dsimp only [Functor.op, Opens.map, IsOpenMap.functor, unop_op, Opens.coe_mk]
/-- 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]
    

Proof state:
case w
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))
⊢ op
      { carrier := ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U),
        is_open' :=
          (_ :
            IsOpen
              (⇑(t D.toGlueData k i).base ⁻¹'
                ↑{ carrier := ⇑pullback.snd.base '' ↑U, is_open' := (_ : IsOpen (⇑pullback.snd.base '' ↑U)) })) } =
    op
      { carrier := ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U),
        is_open' :=
          (_ :
            IsOpen
              (⇑pullback.fst.base ''
                ↑{ carrier := ⇑(t' D.toGlueData k i j).base ⁻¹' ↑U,
                    is_open' := (_ : IsOpen (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)) })) }

Next tactic:
congr
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
have := (𝖣.t_fac k i j).symm
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this : pullback.fst ≫ t D.toGlueData k i = t' D.toGlueData k i j ≫ pullback.snd
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
rw [← IsIso.inv_comp_eq] at this
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this : inv (t' D.toGlueData k i j) ≫ pullback.fst ≫ t D.toGlueData k i = pullback.snd
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
replace this := (congr_arg ((PresheafedSpace.Hom.base ·)) this).symm
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this : pullback.snd.base = (inv (t' D.toGlueData k i j) ≫ pullback.fst ≫ t D.toGlueData k i).base
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
replace this := congr_arg (ContinuousMap.toFun ·) this
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this :
  (fun x => x.toFun) pullback.snd.base =
    (fun x => x.toFun) (inv (t' D.toGlueData k i j) ≫ pullback.fst ≫ t D.toGlueData k i).base
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
dsimp at this
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this : ⇑pullback.snd.base = ⇑((inv (t' D.toGlueData k i j)).base ≫ pullback.fst.base ≫ (t D.toGlueData k i).base)
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
erw [coe_comp, coe_comp] at this
/-- 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
    

Proof state:
case w.e_x.e_carrier
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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
⊢ ⇑(t D.toGlueData k i).base ⁻¹' (⇑pullback.snd.base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
erw [this, Set.image_comp, Set.image_comp, Set.preimage_image_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]
    

Proof state:
case w.e_x.e_carrier
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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
⊢ ⇑pullback.fst.base '' (⇑(inv (t' D.toGlueData k i j)).base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)
case w.e_x.e_carrier.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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
⊢ Function.Injective ⇑(t D.toGlueData k i).base

Next tactic:
swap
/-- 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
    · 

Proof state:
case w.e_x.e_carrier.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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
⊢ Function.Injective ⇑(t D.toGlueData k i).base

Next tactic:
refine Function.HasLeftInverse.injective ⟨(D.t i k).base, fun x => ?_⟩
/-- 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 => ?_⟩
      

Proof state:
case w.e_x.e_carrier.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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
x : ↑↑(V D.toGlueData (k, i))
⊢ (t D.toGlueData i k).base ((t D.toGlueData k i).base x) = x

Next tactic:
rw [← comp_apply, ← comp_base, D.t_inv, id_base, id_apply]
/-- 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]
    

Proof state:
case w.e_x.e_carrier
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))
this : ⇑pullback.snd.base = (⇑(t D.toGlueData k i).base ∘ ⇑pullback.fst.base) ∘ ⇑(inv (t' D.toGlueData k i j)).base
⊢ ⇑pullback.fst.base '' (⇑(inv (t' D.toGlueData k i j)).base '' ↑U) =
    ⇑pullback.fst.base '' (⇑(t' D.toGlueData k i j).base ⁻¹' ↑U)

Next tactic:
refine congr_arg (_ '' ·) ?_