l3lab/ntp-mathlib huggingface dataset:
@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIso_inv_snd_snd :
    (pullbackDiagonalMapIso f i i₁ i₂).inv ≫ pullback.snd ≫ pullback.snd = pullback.snd := by
  delta pullbackDiagonalMapIso
  

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ (Iso.mk (lift (snd ≫ fst) (snd ≫ snd) (_ : (snd ≫ fst) ≫ i₁ = (snd ≫ snd) ≫ i₂))
          (lift (fst ≫ i₁ ≫ fst)
            (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd)
              (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd))
            (_ :
              (fst ≫ i₁ ≫ fst) ≫ diagonal f =
                map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd)
                    (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd) ≫
                  map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (_ : (i₁ ≫ snd) ≫ i = (i₁ ≫ fst) ≫ f)
                    (_ : (i₂ ≫ snd) ≫ i = (i₂ ≫ fst) ≫ f)))).inv ≫
      snd ≫ snd =
    snd

Next tactic:
simp
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.660550, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ (i₁ ≫ snd) ≫ i = (i₁ ≫ fst) ≫ f

Next tactic:
simp [condition]
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by simp [condition])
        (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.660550, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ (i₂ ≫ snd) ≫ i = (i₂ ≫ fst) ≫ f

Next tactic:
simp [condition]
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by simp [condition])
        (by simp [condition])) :=
  IsPullback.of_iso_pullback ⟨by 

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ (fst ≫ i₁ ≫ fst) ≫ diagonal f =
    map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd)
        (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd) ≫
      map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (_ : (i₁ ≫ snd) ≫ i = (i₁ ≫ fst) ≫ f)
        (_ : (i₂ ≫ snd) ≫ i = (i₂ ≫ fst) ≫ f)

Next tactic:
ext
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by simp [condition])
        (by simp [condition])) :=
  IsPullback.of_iso_pullback ⟨by ext <;> 

Proof state:
case h₀
C : Type u_1
inst✝² : Category.{u_2, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ ((fst ≫ i₁ ≫ fst) ≫ diagonal f) ≫ fst =
    (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd)
          (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd) ≫
        map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (_ : (i₁ ≫ snd) ≫ i = (i₁ ≫ fst) ≫ f)
          (_ : (i₂ ≫ snd) ≫ i = (i₂ ≫ fst) ≫ f)) ≫
      fst

Next tactic:
simp [condition_assoc]
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by simp [condition])
        (by simp [condition])) :=
  IsPullback.of_iso_pullback ⟨by ext <;> 

Proof state:
case h₁
C : Type u_1
inst✝² : Category.{u_2, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ ((fst ≫ i₁ ≫ fst) ≫ diagonal f) ≫ snd =
    (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd)
          (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd) ≫
        map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (_ : (i₁ ≫ snd) ≫ i = (i₁ ≫ fst) ≫ f)
          (_ : (i₂ ≫ snd) ≫ i = (i₂ ≫ fst) ≫ f)) ≫
      snd

Next tactic:
simp [condition_assoc]
theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst ≫ i₁ ≫ fst)
      (map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) _ _ _ (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd) (i₂ ≫ snd) f f (i₁ ≫ fst) (i₂ ≫ fst) i (by simp [condition])
        (by simp [condition])) :=
  IsPullback.of_iso_pullback ⟨by ext <;> simp [condition_assoc]⟩
    (pullbackDiagonalMapIso f i i₁ i₂).symm (pullbackDiagonalMapIso_inv_fst f i i₁ i₂)
    (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
X Y Z : C
inst✝¹ : HasPullbacks C
U V₁ V₂ : C
f : X ⟶ Y
i : U ⟶ Y
i₁ : V₁ ⟶ pullback f i
i₂ : V₂ ⟶ pullback f i
inst✝ : HasPullback i₁ i₂
⊢ (pullbackDiagonalMapIso f i i₁ i₂).symm.hom ≫ snd =
    map i₁ i₂ (i₁ ≫ snd) (i₂ ≫ snd) (𝟙 V₁) (𝟙 V₂) snd (_ : i₁ ≫ snd = 𝟙 V₁ ≫ i₁ ≫ snd) (_ : i₂ ≫ snd = 𝟙 V₂ ≫ i₂ ≫ snd)

Next tactic:
aesop_cat
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  

Proof state:
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ pullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) ≅
    pullback f g

Next tactic:
refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · 

Proof state:
case refine'_1
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ pullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i)) ≅
    pullback (diagonal i)
      (map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
        (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
        (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))

Next tactic:
refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · 

Proof state:
case refine'_1.refine'_1
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ f ≫ i = (f ≫ inv fst) ≫ snd

Next tactic:
rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · 

Proof state:
case refine'_1.refine'_2
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ g ≫ i = (g ≫ inv fst) ≫ snd

Next tactic:
rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · 

Proof state:
case refine'_1.refine'_3
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ diagonal i ≫ 𝟙 (diagonalObj i) = 𝟙 T ≫ diagonal i

Next tactic:
rw [Category.comp_id, Category.id_comp]
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · 

Proof state:
case refine'_1.refine'_4
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫ 𝟙 (diagonalObj i) =
    (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
      map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
        (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
        (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i)

Next tactic:
ext
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> 

Proof state:
case refine'_1.refine'_4.h₀
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫ 𝟙 (diagonalObj i)) ≫
      fst =
    ((congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
        map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
          (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
          (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i)) ≫
      fst

Next tactic:
simp
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> 

Proof state:
case refine'_1.refine'_4.h₁
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫ 𝟙 (diagonalObj i)) ≫
      snd =
    ((congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
        map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
          (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
          (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i)) ≫
      snd

Next tactic:
simp
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> simp
    · 

Proof state:
case refine'_1.refine'_5
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ IsIso
    (map (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
      (diagonal i)
      (map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
        (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
        (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i))
      (𝟙 T) (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom (𝟙 (diagonalObj i))
      (_ : diagonal i ≫ 𝟙 (diagonalObj i) = 𝟙 T ≫ diagonal i)
      (_ :
        map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i) ≫ 𝟙 (diagonalObj i) =
          (congrHom (_ : f ≫ i = (f ≫ inv fst) ≫ snd) (_ : g ≫ i = (g ≫ inv fst) ≫ snd)).hom ≫
            map ((f ≫ inv fst) ≫ snd) ((g ≫ inv fst) ≫ snd) i i ((f ≫ inv fst) ≫ fst) ((g ≫ inv fst) ≫ fst) (𝟙 S)
              (_ : ((f ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((f ≫ inv fst) ≫ fst) ≫ i)
              (_ : ((g ≫ inv fst) ≫ snd) ≫ 𝟙 S = ((g ≫ inv fst) ≫ fst) ≫ i)))

Next tactic:
infer_instance
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> simp
    · infer_instance
  · 

Proof state:
case refine'_2
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ pullback (f ≫ inv fst) (g ≫ inv fst) ≅ pullback f g

Next tactic:
refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 _) (𝟙 _) pullback.fst _ _) ?_
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> simp
    · infer_instance
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 _) (𝟙 _) pullback.fst _ _) ?_
    · 

Proof state:
case refine'_2.refine'_1
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (f ≫ inv fst) ≫ fst = 𝟙 X ≫ f

Next tactic:
rw [Category.assoc, IsIso.inv_hom_id, Category.comp_id, Category.id_comp]
/-- This iso witnesses the fact that
given `f : X ⟶ T`, `g : Y ⟶ T`, and `i : T ⟶ S`, the diagram

X ×ₜ Y ⟶ X ×ₛ Y
  |         |
  |         |
  ↓         ↓
  T  ⟶  T ×ₛ T

is a pullback square.
Also see `pullback_map_diagonal_isPullback`.
-/
def pullbackDiagonalMapIdIso :
    pullback (diagonal i)
        (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _)) ≅
      pullback f g := by
  refine' _ ≪≫
    pullbackDiagonalMapIso i (𝟙 _) (f ≫ inv pullback.fst) (g ≫ inv pullback.fst) ≪≫ _
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 T) ((pullback.congrHom _ _).hom) (𝟙 _) _ _) ?_
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [← Category.comp_id pullback.snd, ← condition, Category.assoc, IsIso.inv_hom_id_assoc]
    · rw [Category.comp_id, Category.id_comp]
    · ext <;> simp
    · infer_instance
  · refine' @asIso _ _ _ _ (pullback.map _ _ _ _ (𝟙 _) (𝟙 _) pullback.fst _ _) ?_
    · rw [Category.assoc, IsIso.inv_hom_id, Category.comp_id, Category.id_comp]
    · 

Proof state:
case refine'_2.refine'_2
C : Type u_1
inst✝⁵ : Category.{?u.679708, u_1} C
X Y Z : C
inst✝⁴ : HasPullbacks C
S T : C
f : X ⟶ T
g : Y ⟶ T
i : T ⟶ S
inst✝³ : HasPullback i i
inst✝² : HasPullback f g
inst✝¹ : HasPullback (f ≫ i) (g ≫ i)
inst✝ :
  HasPullback (diagonal i) (map (f ≫ i) (g ≫ i) i i f g (𝟙 S) (_ : (f ≫ i) ≫ 𝟙 S = f ≫ i) (_ : (g ≫ i) ≫ 𝟙 S = g ≫ i))
⊢ (g ≫ inv fst) ≫ fst = 𝟙 Y ≫ g

Next tactic:
rw [Category.assoc, IsIso.inv_hom_id, Category.comp_id, Category.id_comp]