l3lab/ntp-mathlib huggingface dataset:
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        

Proof state:
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
h : IsColimit c'
e : c'.pt ≅ (cofans X' Y').pt := IsColimit.coconePointUniqueUpToIso h (colimits X' Y')
hl : IsPullback (BinaryCofan.inl (cofans X' Y')) αX (e.inv ≫ f) (BinaryCofan.inl c)
hr : IsPullback (BinaryCofan.inr (cofans X' Y')) αY (e.inv ≫ f) (BinaryCofan.inr c)
this : IsIso (𝟙 Y')
⊢ BinaryCofan.inr c' ≫ e.hom = 𝟙 Y' ≫ BinaryCofan.inr (cofans X' Y')

Next tactic:
dsimp
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        dsimp
        

Proof state:
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
h : IsColimit c'
e : c'.pt ≅ (cofans X' Y').pt := IsColimit.coconePointUniqueUpToIso h (colimits X' Y')
hl : IsPullback (BinaryCofan.inl (cofans X' Y')) αX (e.inv ≫ f) (BinaryCofan.inl c)
hr : IsPullback (BinaryCofan.inr (cofans X' Y')) αY (e.inv ≫ f) (BinaryCofan.inr c)
this : IsIso (𝟙 Y')
⊢ BinaryCofan.inr c' ≫ (IsColimit.coconePointUniqueUpToIso h (colimits X' Y')).hom =
    𝟙 Y' ≫ BinaryCofan.inr (cofans X' Y')

Next tactic:
simp
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        dsimp
        simp
      

Proof state:
case mp.intro.intro.right
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
h : IsColimit c'
e : c'.pt ≅ (cofans X' Y').pt := IsColimit.coconePointUniqueUpToIso h (colimits X' Y')
hl : IsPullback (BinaryCofan.inl (cofans X' Y')) αX (e.inv ≫ f) (BinaryCofan.inl c)
hr : IsPullback (BinaryCofan.inr (cofans X' Y')) αY (e.inv ≫ f) (BinaryCofan.inr c)
this✝ : IsIso (𝟙 Y')
this : BinaryCofan.inr c' ≫ e.hom = 𝟙 Y' ≫ BinaryCofan.inr (cofans X' Y')
⊢ IsPullback (BinaryCofan.inr c') (𝟙 Y' ≫ αY) (e.hom ≫ e.inv ≫ f) (BinaryCofan.inr c)

Next tactic:
exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hr
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hr
  · 

Proof state:
case mpr
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
⊢ IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧ IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c) →
    Nonempty (IsColimit c')

Next tactic:
rintro ⟨H₁, H₂⟩
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hr
  · rintro ⟨H₁, H₂⟩
    

Proof state:
case mpr.intro
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
H₁ : IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c)
H₂ : IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)
⊢ Nonempty (IsColimit c')

Next tactic:
refine' ⟨IsColimit.ofIsoColimit _ <| (isoBinaryCofanMk _).symm⟩
theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c := by
  rw [BinaryCofan.isVanKampen_iff]
  introv hX hY
  constructor
  · rintro ⟨h⟩
    let e := h.coconePointUniqueUpToIso (colimits _ _)
    obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [hX]) (by simp [hY])
    constructor
    · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 X') := inferInstance
      have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl
    · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f]
      haveI : IsIso (𝟙 Y') := inferInstance
      have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by
        dsimp
        simp
      exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hr
  · rintro ⟨H₁, H₂⟩
    refine' ⟨IsColimit.ofIsoColimit _ <| (isoBinaryCofanMk _).symm⟩
    

Proof state:
case mpr.intro
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
K : Type u_1
inst✝¹ : Category.{?u.277312, u_1} K
D : Type u_2
inst✝ : Category.{?u.277319, u_2} D
X✝ Y✝ X Y : C
c : BinaryCofan X Y
cofans : (X Y : C) → BinaryCofan X Y
colimits : (X Y : C) → IsColimit (cofans X Y)
cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → PullbackCone f g
limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → IsLimit (cones f g)
h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    αX ≫ BinaryCofan.inl c = BinaryCofan.inl (cofans X' Y') ≫ f →
      αY ≫ BinaryCofan.inr c = BinaryCofan.inr (cofans X' Y') ≫ f →
        IsPullback (BinaryCofan.inl (cofans X' Y')) αX f (BinaryCofan.inl c) ∧
          IsPullback (BinaryCofan.inr (cofans X' Y')) αY f (BinaryCofan.inr c)
h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      IsColimit
        (BinaryCofan.mk (PullbackCone.fst (cones f (BinaryCofan.inl c)))
          (PullbackCone.fst (cones f (BinaryCofan.inr c))))
X' Y' : C
c' : BinaryCofan X' Y'
αX : X' ⟶ X
αY : Y' ⟶ Y
f : c'.pt ⟶ c.pt
hX : αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f
hY : αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f
H₁ : IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c)
H₂ : IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)
⊢ IsColimit (BinaryCofan.mk (BinaryCofan.inl c') (BinaryCofan.inr c'))

Next tactic:
let e₁ : X' ≅ _ := H₁.isLimit.conePointUniqueUpToIso (limits _ _)
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ Mono (BinaryCofan.inr c)

Next tactic:
refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ IsPullback (𝟙 ((pair X Y).obj { as := WalkingPair.right })) (𝟙 ((pair X Y).obj { as := WalkingPair.right }))
    (BinaryCofan.inr c) (BinaryCofan.inr c)

Next tactic:
refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · 

Proof state:
case refine'_1
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ mapPair (initial.to X) (𝟙 Y) ≫ c.ι =
    (BinaryCofan.mk (initial.to Y) (𝟙 Y)).ι ≫ (Functor.const (Discrete WalkingPair)).map (BinaryCofan.inr c)

Next tactic:
ext ⟨⟨⟩⟩
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · ext ⟨⟨⟩⟩ <;> 

Proof state:
case refine'_1.w.h.mk.left
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ (mapPair (initial.to X) (𝟙 Y) ≫ c.ι).app { as := WalkingPair.left } =
    ((BinaryCofan.mk (initial.to Y) (𝟙 Y)).ι ≫ (Functor.const (Discrete WalkingPair)).map (BinaryCofan.inr c)).app
      { as := WalkingPair.left }

Next tactic:
dsimp
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · ext ⟨⟨⟩⟩ <;> 

Proof state:
case refine'_1.w.h.mk.right
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ (mapPair (initial.to X) (𝟙 Y) ≫ c.ι).app { as := WalkingPair.right } =
    ((BinaryCofan.mk (initial.to Y) (𝟙 Y)).ι ≫ (Functor.const (Discrete WalkingPair)).map (BinaryCofan.inr c)).app
      { as := WalkingPair.right }

Next tactic:
dsimp
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · ext ⟨⟨⟩⟩ <;> dsimp; 

Proof state:
case refine'_1.w.h.mk.left
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ initial.to X ≫ BinaryCofan.inl c = initial.to Y ≫ BinaryCofan.inr c

Next tactic:
simp
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · ext ⟨⟨⟩⟩ <;> dsimp; simp
  · 

Proof state:
case refine'_2
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ IsColimit (BinaryCofan.mk (initial.to Y) (𝟙 Y))

Next tactic:
exact ((BinaryCofan.isColimit_iff_isIso_inr initialIsInitial _).mpr (by
      dsimp
      infer_instance)).some
theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr := by
  refine' PullbackCone.mono_of_isLimitMkIdId _ (IsPullback.isLimit _)
  refine' (h (BinaryCofan.mk (initial.to Y) (𝟙 Y)) (mapPair (initial.to X) (𝟙 Y)) c.inr _
      (mapPair_equifibered _)).mp ⟨_⟩ ⟨WalkingPair.right⟩
  · ext ⟨⟨⟩⟩ <;> dsimp; simp
  · exact ((BinaryCofan.isColimit_iff_isIso_inr initialIsInitial _).mpr (by
      

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
K : Type u_1
inst✝² : Category.{?u.290247, u_1} K
D : Type u_2
inst✝¹ : Category.{?u.290254, u_2} D
X✝ Y✝ : C
inst✝ : HasInitial C
X Y : C
c : BinaryCofan X Y
h : IsVanKampenColimit c
⊢ IsIso (BinaryCofan.inr (BinaryCofan.mk (initial.to Y) (𝟙 Y)))

Next tactic:
dsimp