l3lab/ntp-mathlib huggingface dataset:
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · 

Proof state:
case h₀
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ (lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
        lift
          (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
            (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
          (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
            (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
          (_ :
            lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                  (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                fst =
              lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                  (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                fst)) ≫
      fst =
    𝟙 (pullback fst fst) ≫ fst

Next tactic:
apply pullback.hom_ext
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · 

Proof state:
case h₀.h₀
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ ((lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
          lift
            (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
              (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
            (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
              (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
            (_ :
              lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                    (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                  fst =
                lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                    (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                  fst)) ≫
        fst) ≫
      fst =
    (𝟙 (pullback fst fst) ≫ fst) ≫ fst

Next tactic:
apply pullback.hom_ext
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · 

Proof state:
case h₀.h₀.h₀
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ (((lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
            lift
              (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
              (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
              (_ :
                lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                      (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                    fst =
                  lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                      (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                    fst)) ≫
          fst) ≫
        fst) ≫
      fst =
    ((𝟙 (pullback fst fst) ≫ fst) ≫ fst) ≫ fst

Next tactic:
simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
          

Proof state:
case h₀.h₀.h₀
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ fst ≫ snd ≫ i₁ = fst ≫ fst ≫ fst

Next tactic:
rw [condition]
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
          rw [condition]
        · 

Proof state:
case h₀.h₀.h₁
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ (((lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
            lift
              (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
              (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
              (_ :
                lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                      (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                    fst =
                  lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                      (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                    fst)) ≫
          fst) ≫
        fst) ≫
      snd =
    ((𝟙 (pullback fst fst) ≫ fst) ≫ fst) ≫ snd

Next tactic:
simp [Category.assoc, lift_snd]
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
          rw [condition]
        · simp [Category.assoc, lift_snd]
          

Proof state:
case h₀.h₀.h₁
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ snd ≫ snd ≫ i₂ = fst ≫ fst ≫ snd

Next tactic:
rw [condition_assoc, condition]
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
          rw [condition]
        · simp [Category.assoc, lift_snd]
          rw [condition_assoc, condition]
      · 

Proof state:
case h₀.h₁
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ ((lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
          lift
            (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
              (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
            (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
              (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
            (_ :
              lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                    (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                  fst =
                lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                    (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                  fst)) ≫
        fst) ≫
      snd =
    (𝟙 (pullback fst fst) ≫ fst) ≫ snd

Next tactic:
simp only [Category.assoc, lift_fst_assoc, lift_snd, lift_fst, Category.id_comp]
/-- Given the following diagram with `S ⟶ S'` a monomorphism,

    X ⟶ X'
      ↘      ↘
        S ⟶ S'
      ↗      ↗
    Y ⟶ Y'

This iso witnesses the fact that

      X ×[S] Y ⟶ (X' ×[S'] Y') ×[Y'] Y
          |                  |
          |                  |
          ↓                  ↓
(X' ×[S'] Y') ×[X'] X ⟶ X' ×[S'] Y'

is a pullback square. The diagonal map of this square is `pullback.map`.
Also see `pullback_lift_map_is_pullback`.
-/
@[simps]
def pullbackFstFstIso {X Y S X' Y' S' : C} (f : X ⟶ S) (g : Y ⟶ S) (f' : X' ⟶ S') (g' : Y' ⟶ S')
    (i₁ : X ⟶ X') (i₂ : Y ⟶ Y') (i₃ : S ⟶ S') (e₁ : f ≫ i₃ = i₁ ≫ f') (e₂ : g ≫ i₃ = i₂ ≫ g')
    [Mono i₃] :
    pullback (pullback.fst : pullback (pullback.fst : pullback f' g' ⟶ _) i₁ ⟶ _)
        (pullback.fst : pullback (pullback.snd : pullback f' g' ⟶ _) i₂ ⟶ _) ≅
      pullback f g
    where
  hom :=
    pullback.lift (pullback.fst ≫ pullback.snd) (pullback.snd ≫ pullback.snd)
      (by
        rw [← cancel_mono i₃, Category.assoc, Category.assoc, Category.assoc, Category.assoc, e₁,
          e₂, ← pullback.condition_assoc, pullback.condition_assoc, pullback.condition,
          pullback.condition_assoc])
  inv :=
    pullback.lift
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.fst (pullback.lift_fst _ _ _))
      (pullback.lift (pullback.map _ _ _ _ _ _ _ e₁ e₂) pullback.snd (pullback.lift_snd _ _ _))
      (by rw [pullback.lift_fst, pullback.lift_fst])
  hom_inv_id := by
    -- We could use `ext` here to immediately descend to the leaf goals,
    -- but it only obscures the structure.
    apply pullback.hom_ext
    · apply pullback.hom_ext
      · apply pullback.hom_ext
        · simp only [Category.assoc, lift_fst, lift_fst_assoc, Category.id_comp]
          rw [condition]
        · simp [Category.assoc, lift_snd]
          rw [condition_assoc, condition]
      · simp only [Category.assoc, lift_fst_assoc, lift_snd, lift_fst, Category.id_comp]
    · 

Proof state:
case h₁
C : Type u_1
inst✝² : Category.{?u.887108, u_1} C
X✝ Y✝ Z : C
inst✝¹ : HasPullbacks C
X Y S X' Y' S' : C
f : X ⟶ S
g : Y ⟶ S
f' : X' ⟶ S'
g' : Y' ⟶ S'
i₁ : X ⟶ X'
i₂ : Y ⟶ Y'
i₃ : S ⟶ S'
e₁ : f ≫ i₃ = i₁ ≫ f'
e₂ : g ≫ i₃ = i₂ ≫ g'
inst✝ : Mono i₃
⊢ (lift (fst ≫ snd) (snd ≫ snd) (_ : (fst ≫ snd) ≫ f = (snd ≫ snd) ≫ g) ≫
        lift
          (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
            (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁))
          (lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
            (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂))
          (_ :
            lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) fst
                  (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ fst = fst ≫ i₁) ≫
                fst =
              lift (map f g f' g' i₁ i₂ i₃ e₁ e₂) snd
                  (_ : lift (fst ≫ i₁) (snd ≫ i₂) (_ : (fst ≫ i₁) ≫ f' = (snd ≫ i₂) ≫ g') ≫ snd = snd ≫ i₂) ≫
                fst)) ≫
      snd =
    𝟙 (pullback fst fst) ≫ snd

Next tactic:
apply pullback.hom_ext