l3lab/ntp-mathlib huggingface dataset:
theorem pullback_cone_of_left_condition : pullbackConeOfLeftFst f g ≫ f = Y.ofRestrict _ ≫ g := by
  -- Porting note : `ext` did not pick up `NatTrans.ext`
  refine PresheafedSpace.Hom.ext _ _ ?_ <| NatTrans.ext _ _ <| funext fun U => ?_
  · simpa using pullback.condition
  · induction U using Opposite.rec'
    -- Porting note : `NatTrans.comp_app` is not picked up by `dsimp`
    -- Perhaps see : https://github.com/leanprover-community/mathlib4/issues/5026
    rw [NatTrans.comp_app]
    dsimp only [comp_c_app, unop_op, whiskerRight_app, pullbackConeOfLeftFst]
    -- simp only [ofRestrict_c_app, NatTrans.comp_app]
    

Proof state:
case refine_2.h
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
X✝ : Opens ↑↑Z
⊢ (f.c.app (op X✝) ≫
        invApp hf ((Opens.map f.base).obj X✝) ≫
          g.c.app (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj ((Opens.map f.base).obj X✝))) ≫
            Y.presheaf.map
              (eqToHom
                (_ :
                  (Opens.map g.base).op.obj
                      (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj (op ((Opens.map f.base).obj X✝)).unop)) =
                    (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                      ((Opens.map pullback.fst).op.obj (op ((Opens.map f.base).obj X✝)))))) ≫
      (restrict Y (_ : OpenEmbedding ⇑pullback.snd)).presheaf.map
        ((eqToHom
              (_ :
                (Opens.map
                      ({ base := pullback.fst,
                            c :=
                              NatTrans.mk fun U =>
                                invApp hf U.unop ≫
                                  g.c.app (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) ≫
                                    Y.presheaf.map
                                      (eqToHom
                                        (_ :
                                          (Opens.map g.base).op.obj
                                              (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) =
                                            (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                                              ((Opens.map pullback.fst).op.obj U))) } ≫
                          f).base).op =
                  (Opens.map (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd) ≫ g).base).op)).app
          (op X✝)) =
    g.c.app (op X✝) ≫
      (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)).c.app (op ((Opens.map g.base).obj X✝))

Next tactic:
simp only [Quiver.Hom.unop_op, TopCat.Presheaf.pushforwardObj_map, app_invApp_assoc,
      eqToHom_app, eqToHom_unop, Category.assoc, NatTrans.naturality_assoc, Functor.op_map]
theorem pullback_cone_of_left_condition : pullbackConeOfLeftFst f g ≫ f = Y.ofRestrict _ ≫ g := by
  -- Porting note : `ext` did not pick up `NatTrans.ext`
  refine PresheafedSpace.Hom.ext _ _ ?_ <| NatTrans.ext _ _ <| funext fun U => ?_
  · simpa using pullback.condition
  · induction U using Opposite.rec'
    -- Porting note : `NatTrans.comp_app` is not picked up by `dsimp`
    -- Perhaps see : https://github.com/leanprover-community/mathlib4/issues/5026
    rw [NatTrans.comp_app]
    dsimp only [comp_c_app, unop_op, whiskerRight_app, pullbackConeOfLeftFst]
    -- simp only [ofRestrict_c_app, NatTrans.comp_app]
    simp only [Quiver.Hom.unop_op, TopCat.Presheaf.pushforwardObj_map, app_invApp_assoc,
      eqToHom_app, eqToHom_unop, Category.assoc, NatTrans.naturality_assoc, Functor.op_map]
    

Proof state:
case refine_2.h
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
X✝ : Opens ↑↑Z
⊢ g.c.app (op X✝) ≫
      Y.presheaf.map
          ((Opens.map g.base).map (homOfLE (_ : ⇑f.base '' (⇑f.base ⁻¹' X✝.carrier) ⊆ X✝.carrier)).op.unop).op ≫
        Y.presheaf.map
            (eqToHom
              (_ :
                (Opens.map g.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj (op ((Opens.map f.base).obj X✝)).unop)) =
                  (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                    ((Opens.map pullback.fst).op.obj (op ((Opens.map f.base).obj X✝))))) ≫
          (restrict Y (_ : OpenEmbedding ⇑pullback.snd)).presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          ({ base := pullback.fst,
                                c :=
                                  NatTrans.mk fun U =>
                                    invApp hf U.unop ≫
                                      g.c.app (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) ≫
                                        Y.presheaf.map
                                          (eqToHom
                                            (_ :
                                              (Opens.map g.base).op.obj
                                                  (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) =
                                                (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                                                  ((Opens.map pullback.fst).op.obj U))) } ≫
                              f).base).op.obj
                    (op X✝) =
                  (Opens.map (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd) ≫ g).base).op.obj
                    (op X✝))) =
    g.c.app (op X✝) ≫
      (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)).c.app (op ((Opens.map g.base).obj X✝))

Next tactic:
erw [← Y.presheaf.map_comp, ← Y.presheaf.map_comp]
theorem pullback_cone_of_left_condition : pullbackConeOfLeftFst f g ≫ f = Y.ofRestrict _ ≫ g := by
  -- Porting note : `ext` did not pick up `NatTrans.ext`
  refine PresheafedSpace.Hom.ext _ _ ?_ <| NatTrans.ext _ _ <| funext fun U => ?_
  · simpa using pullback.condition
  · induction U using Opposite.rec'
    -- Porting note : `NatTrans.comp_app` is not picked up by `dsimp`
    -- Perhaps see : https://github.com/leanprover-community/mathlib4/issues/5026
    rw [NatTrans.comp_app]
    dsimp only [comp_c_app, unop_op, whiskerRight_app, pullbackConeOfLeftFst]
    -- simp only [ofRestrict_c_app, NatTrans.comp_app]
    simp only [Quiver.Hom.unop_op, TopCat.Presheaf.pushforwardObj_map, app_invApp_assoc,
      eqToHom_app, eqToHom_unop, Category.assoc, NatTrans.naturality_assoc, Functor.op_map]
    erw [← Y.presheaf.map_comp, ← Y.presheaf.map_comp]
    

Proof state:
case refine_2.h
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
X✝ : Opens ↑↑Z
⊢ g.c.app (op X✝) ≫
      Y.presheaf.map
        (((Opens.map g.base).map (homOfLE (_ : ⇑f.base '' (⇑f.base ⁻¹' X✝.carrier) ⊆ X✝.carrier)).op.unop).op ≫
          eqToHom
              (_ :
                (Opens.map g.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj (op ((Opens.map f.base).obj X✝)).unop)) =
                  (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                    ((Opens.map pullback.fst).op.obj (op ((Opens.map f.base).obj X✝)))) ≫
            (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.map
              (eqToHom
                (_ :
                  (Opens.map
                            ({ base := pullback.fst,
                                  c :=
                                    NatTrans.mk fun U =>
                                      invApp hf U.unop ≫
                                        g.c.app (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) ≫
                                          Y.presheaf.map
                                            (eqToHom
                                              (_ :
                                                (Opens.map g.base).op.obj
                                                    (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) =
                                                  (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj
                                                    ((Opens.map pullback.fst).op.obj U))) } ≫
                                f).base).op.obj
                      (op X✝) =
                    (Opens.map (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd) ≫ g).base).op.obj
                      (op X✝)))) =
    g.c.app (op X✝) ≫
      (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)).c.app (op ((Opens.map g.base).obj X✝))

Next tactic:
congr 1
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
⊢ (Opens.map (PullbackCone.snd s).base).op.obj ((IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj U) =
    (Opens.map
            (pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
              (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base))).op.obj
      U

Next tactic:
dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
⊢ op
      {
        carrier :=
          ⇑(PullbackCone.snd s).base ⁻¹'
            ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop,
        is_open' :=
          (_ :
            IsOpen
              (⇑(PullbackCone.snd s).base ⁻¹'
                ↑(op
                      { carrier := ⇑pullback.snd '' ↑U.unop,
                        is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop)) } =
    op
      {
        carrier :=
          ⇑(pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
                (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ⁻¹'
            ↑U.unop,
        is_open' :=
          (_ :
            IsOpen
              (⇑(pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
                    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ⁻¹'
                ↑U.unop)) }

Next tactic:
congr 2
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                

Proof state:
case e_x.e_carrier
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
⊢ ⇑(PullbackCone.snd s).base ⁻¹'
      ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop =
    ⇑(pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
          (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ⁻¹'
      ↑U.unop

Next tactic:
let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                

Proof state:
case e_x.e_carrier
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
⊢ ⇑(PullbackCone.snd s).base ⁻¹'
      ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop =
    ⇑(pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
          (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ⁻¹'
      ↑U.unop

Next tactic:
have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
                

Proof state:
case e_x.e_carrier
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
this :
  limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right = (PullbackCone.snd s).base
⊢ ⇑(PullbackCone.snd s).base ⁻¹'
      ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop =
    ⇑(pullback.lift (PullbackCone.fst s).base (PullbackCone.snd s).base
          (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ⁻¹'
      ↑U.unop

Next tactic:
conv_lhs =>
                  erw [← this]
                  dsimp
                  -- Porting note : need a bit more hand holding here about function composition
                  rw [coe_comp, show ∀ f g, f ∘ g = fun x => f (g x) from fun _ _ => rfl]
                  erw [← Set.preimage_preimage]
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
                conv_lhs =>
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
this :
  limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right = (PullbackCone.snd s).base
| ⇑(PullbackCone.snd s).base ⁻¹'
    ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop

Next tactic:
erw [← this]
                  dsimp
                  -- Porting note : need a bit more hand holding here about function composition
                  rw [coe_comp, show ∀ f g, f ∘ g = fun x => f (g x) from fun _ _ => rfl]
                  erw [← Set.preimage_preimage]
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
                conv_lhs =>
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
this :
  limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right = (PullbackCone.snd s).base
| ⇑(PullbackCone.snd s).base ⁻¹'
    ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop

Next tactic:
erw [← this]
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
                conv_lhs =>
                  erw [← this]
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
this :
  limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right = (PullbackCone.snd s).base
| ⇑(limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right) ⁻¹'
    ↑(op { carrier := ⇑pullback.snd '' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.snd '' ↑U.unop)) }).unop

Next tactic:
dsimp
/-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone.
-/
def pullbackConeOfLeftLift : s.pt ⟶ (pullbackConeOfLeft f g).pt where
  base :=
    pullback.lift s.fst.base s.snd.base
      (congr_arg (fun x => PresheafedSpace.Hom.base x) s.condition)
  c :=
    { app := fun U =>
        s.snd.c.app _ ≫
          s.pt.presheaf.map
            (eqToHom
              (by
                dsimp only [Opens.map, IsOpenMap.functor, Functor.op]
                congr 2
                let s' : PullbackCone f.base g.base := PullbackCone.mk s.fst.base s.snd.base
                  -- Porting note : in mathlib3, this is just an underscore
                  (congr_arg Hom.base s.condition)

                have : _ = s.snd.base := limit.lift_π s' WalkingCospan.right
                conv_lhs =>
                  erw [← this]
                  dsimp
                  -- Porting note : need a bit more hand holding here about function composition
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.125761, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
s : PullbackCone f g
U : (Opens ↑↑(pullbackConeOfLeft f g).pt)ᵒᵖ
s' : PullbackCone f.base g.base :=
  PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
    (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)
this :
  limit.lift (cospan f.base g.base) s' ≫ limit.π (cospan f.base g.base) WalkingCospan.right = (PullbackCone.snd s).base
| ⇑(limit.lift (cospan f.base g.base)
          (PullbackCone.mk (PullbackCone.fst s).base (PullbackCone.snd s).base
            (_ : (PullbackCone.fst s ≫ f).base = (PullbackCone.snd s ≫ g).base)) ≫
        limit.π (cospan f.base g.base) WalkingCospan.right) ⁻¹'
    (⇑pullback.snd '' ↑U.unop)

Next tactic:
rw [coe_comp, show ∀ f g, f ∘ g = fun x => f (g x) from fun _ _ => rfl]