l3lab/ntp-mathlib huggingface dataset:
theorem FinitaryExtensive.vanKampen [FinitaryExtensive C] {F : Discrete WalkingPair ⥤ C}
    (c : Cocone F) (hc : IsColimit c) : IsVanKampenColimit c := by
  let X := F.obj ⟨WalkingPair.left⟩
  let Y := F.obj ⟨WalkingPair.right⟩
  have : F = pair X Y := by
    apply Functor.hext
    · rintro ⟨⟨⟩⟩ <;> rfl
    · rintro ⟨⟨⟩⟩ ⟨j⟩ ⟨⟨rfl : _ = j⟩⟩ <;> simp
  clear_value X Y
  subst this
  

Proof state:
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
D : Type u''
inst✝¹ : Category.{v'', u''} D
X✝ Y✝ : C
inst✝ : FinitaryExtensive C
Y X : C
c : Cocone (pair X Y)
hc : IsColimit c
⊢ IsVanKampenColimit c

Next tactic:
exact FinitaryExtensive.van_kampen' c hc
instance hasPullbackInr' :
    HasPullback f coprod.inr := by
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
D : Type u''
inst✝² : Category.{v'', u''} D
X✝ Y✝ : C
inst✝¹ : HasBinaryCoproducts C
inst✝ : HasPullbacksOfInclusions C
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ HasPullback f coprod.inr

Next tactic:
have : IsPullback (𝟙 _) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom :=
    IsPullback.of_horiz_isIso ⟨by simp⟩
instance hasPullbackInr' :
    HasPullback f coprod.inr := by
  have : IsPullback (𝟙 _) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom :=
    IsPullback.of_horiz_isIso ⟨by 

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
D : Type u''
inst✝² : Category.{v'', u''} D
X✝ Y✝ : C
inst✝¹ : HasBinaryCoproducts C
inst✝ : HasPullbacksOfInclusions C
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ 𝟙 Z ≫ f = (f ≫ (coprod.braiding X Y).hom) ≫ (coprod.braiding Y X).hom

Next tactic:
simp
instance hasPullbackInr' :
    HasPullback f coprod.inr := by
  have : IsPullback (𝟙 _) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom :=
    IsPullback.of_horiz_isIso ⟨by simp⟩
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
D : Type u''
inst✝² : Category.{v'', u''} D
X✝ Y✝ : C
inst✝¹ : HasBinaryCoproducts C
inst✝ : HasPullbacksOfInclusions C
X Y Z : C
f : Z ⟶ X ⨿ Y
this : IsPullback (𝟙 Z) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom
⊢ HasPullback f coprod.inr

Next tactic:
have := (IsPullback.of_hasPullback (f ≫ (coprod.braiding X Y).hom) coprod.inl).paste_horiz this
instance hasPullbackInr' :
    HasPullback f coprod.inr := by
  have : IsPullback (𝟙 _) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom :=
    IsPullback.of_horiz_isIso ⟨by simp⟩
  have := (IsPullback.of_hasPullback (f ≫ (coprod.braiding X Y).hom) coprod.inl).paste_horiz this
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
D : Type u''
inst✝² : Category.{v'', u''} D
X✝ Y✝ : C
inst✝¹ : HasBinaryCoproducts C
inst✝ : HasPullbacksOfInclusions C
X Y Z : C
f : Z ⟶ X ⨿ Y
this✝ : IsPullback (𝟙 Z) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom
this : IsPullback (pullback.fst ≫ 𝟙 Z) pullback.snd f (coprod.inl ≫ (coprod.braiding Y X).hom)
⊢ HasPullback f coprod.inr

Next tactic:
simp only [coprod.braiding_hom, Category.comp_id, colimit.ι_desc, BinaryCofan.mk_pt,
    BinaryCofan.ι_app_left, BinaryCofan.mk_inl] at this
instance hasPullbackInr' :
    HasPullback f coprod.inr := by
  have : IsPullback (𝟙 _) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom :=
    IsPullback.of_horiz_isIso ⟨by simp⟩
  have := (IsPullback.of_hasPullback (f ≫ (coprod.braiding X Y).hom) coprod.inl).paste_horiz this
  simp only [coprod.braiding_hom, Category.comp_id, colimit.ι_desc, BinaryCofan.mk_pt,
    BinaryCofan.ι_app_left, BinaryCofan.mk_inl] at this
  

Proof state:
J : Type v'
inst✝⁴ : Category.{u', v'} J
C : Type u
inst✝³ : Category.{v, u} C
D : Type u''
inst✝² : Category.{v'', u''} D
X✝ Y✝ : C
inst✝¹ : HasBinaryCoproducts C
inst✝ : HasPullbacksOfInclusions C
X Y Z : C
f : Z ⟶ X ⨿ Y
this✝ : IsPullback (𝟙 Z) (f ≫ (coprod.braiding X Y).hom) f (coprod.braiding Y X).hom
this : IsPullback pullback.fst pullback.snd f coprod.inr
⊢ HasPullback f coprod.inr

Next tactic:
exact ⟨⟨⟨_, this.isLimit⟩⟩⟩
noncomputable
instance preservesPullbackInr' :
    PreservesLimit (cospan f coprod.inr) F := by
  

Proof state:
J : Type v'
inst✝⁵ : Category.{u', v'} J
C : Type u
inst✝⁴ : Category.{v, u} C
D✝ : Type u''
inst✝³ : Category.{v'', u''} D✝
X✝ Y✝ : C
D : Type u_1
inst✝² : Category.{?u.37731, u_1} D
inst✝¹ : HasBinaryCoproducts C
F : C ⥤ D
inst✝ : PreservesPullbacksOfInclusions F
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ PreservesLimit (cospan f coprod.inr) F

Next tactic:
apply preservesLimitOfIsoDiagram (K₁ := cospan (f ≫ (coprod.braiding X Y).hom) coprod.inl)
noncomputable
instance preservesPullbackInr' :
    PreservesLimit (cospan f coprod.inr) F := by
  apply preservesLimitOfIsoDiagram (K₁ := cospan (f ≫ (coprod.braiding X Y).hom) coprod.inl)
  

Proof state:
case h
J : Type v'
inst✝⁵ : Category.{u', v'} J
C : Type u
inst✝⁴ : Category.{v, u} C
D✝ : Type u''
inst✝³ : Category.{v'', u''} D✝
X✝ Y✝ : C
D : Type u_1
inst✝² : Category.{?u.37731, u_1} D
inst✝¹ : HasBinaryCoproducts C
F : C ⥤ D
inst✝ : PreservesPullbacksOfInclusions F
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ cospan (f ≫ (coprod.braiding X Y).hom) coprod.inl ≅ cospan f coprod.inr

Next tactic:
apply cospanExt (Iso.refl _) (Iso.refl _) (coprod.braiding X Y).symm
noncomputable
instance preservesPullbackInr' :
    PreservesLimit (cospan f coprod.inr) F := by
  apply preservesLimitOfIsoDiagram (K₁ := cospan (f ≫ (coprod.braiding X Y).hom) coprod.inl)
  apply cospanExt (Iso.refl _) (Iso.refl _) (coprod.braiding X Y).symm <;> 

Proof state:
case h.wf
J : Type v'
inst✝⁵ : Category.{u', v'} J
C : Type u
inst✝⁴ : Category.{v, u} C
D✝ : Type u''
inst✝³ : Category.{v'', u''} D✝
X✝ Y✝ : C
D : Type u_1
inst✝² : Category.{?u.37731, u_1} D
inst✝¹ : HasBinaryCoproducts C
F : C ⥤ D
inst✝ : PreservesPullbacksOfInclusions F
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ (Iso.refl Z).hom ≫ f = (f ≫ (coprod.braiding X Y).hom) ≫ (coprod.braiding X Y).symm.hom

Next tactic:
simp
noncomputable
instance preservesPullbackInr' :
    PreservesLimit (cospan f coprod.inr) F := by
  apply preservesLimitOfIsoDiagram (K₁ := cospan (f ≫ (coprod.braiding X Y).hom) coprod.inl)
  apply cospanExt (Iso.refl _) (Iso.refl _) (coprod.braiding X Y).symm <;> 

Proof state:
case h.wg
J : Type v'
inst✝⁵ : Category.{u', v'} J
C : Type u
inst✝⁴ : Category.{v, u} C
D✝ : Type u''
inst✝³ : Category.{v'', u''} D✝
X✝ Y✝ : C
D : Type u_1
inst✝² : Category.{?u.37731, u_1} D
inst✝¹ : HasBinaryCoproducts C
F : C ⥤ D
inst✝ : PreservesPullbacksOfInclusions F
X Y Z : C
f : Z ⟶ X ⨿ Y
⊢ (Iso.refl Y).hom ≫ coprod.inr = coprod.inl ≫ (coprod.braiding X Y).symm.hom

Next tactic:
simp
instance (priority := 100) hasStrictInitialObjects_of_finitaryPreExtensive
    [FinitaryPreExtensive C] : HasStrictInitialObjects C :=
  hasStrictInitial_of_isUniversal (FinitaryPreExtensive.universal' _
    ((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
D : Type u''
inst✝¹ : Category.{v'', u''} D
X Y : C
inst✝ : FinitaryPreExtensive C
⊢ IsIso (BinaryCofan.inr (BinaryCofan.mk (𝟙 (⊥_ C)) (𝟙 (⊥_ C))))

Next tactic:
dsimp
instance (priority := 100) hasStrictInitialObjects_of_finitaryPreExtensive
    [FinitaryPreExtensive C] : HasStrictInitialObjects C :=
  hasStrictInitial_of_isUniversal (FinitaryPreExtensive.universal' _
    ((BinaryCofan.isColimit_iff_isIso_inr initialIsInitial _).mpr (by
      dsimp
      

Proof state:
J : Type v'
inst✝³ : Category.{u', v'} J
C : Type u
inst✝² : Category.{v, u} C
D : Type u''
inst✝¹ : Category.{v'', u''} D
X Y : C
inst✝ : FinitaryPreExtensive C
⊢ IsIso (𝟙 (⊥_ C))

Next tactic:
infer_instance
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  

Proof state:
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X Y : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
⊢ FinitaryExtensive C ↔ IsVanKampenColimit c₀

Next tactic:
refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  

Proof state:
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X Y : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H : IsVanKampenColimit c₀
⊢ FinitaryExtensive C

Next tactic:
constructor
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  

Proof state:
case van_kampen'
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X Y : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H : IsVanKampenColimit c₀
⊢ ∀ {X Y : C} (c : BinaryCofan X Y), IsColimit c → IsVanKampenColimit c

Next tactic:
simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  

Proof state:
case van_kampen'
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X Y : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
⊢ ∀ {X Y : C} (c : BinaryCofan X Y),
    IsColimit c →
      ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : c'.pt ⟶ c.pt),
        αX ≫ BinaryCofan.inl c = BinaryCofan.inl c' ≫ f →
          αY ≫ BinaryCofan.inr c = BinaryCofan.inr c' ≫ f →
            (Nonempty (IsColimit c') ↔
              IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧
                IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c))

Next tactic:
intro X Y c hc X' Y' c' αX αY f hX hY
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  

Proof state:
case van_kampen'
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
⊢ Nonempty (IsColimit c') ↔
    IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧ IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)

Next tactic:
obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
  

Proof state:
case van_kampen'.mk.intro
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
d : c.pt ⟶ ((Functor.const (Discrete WalkingPair)).obj c₀.pt).obj { as := WalkingPair.left }
hd : BinaryCofan.inl c ≫ d = IsTerminal.from HT X ≫ BinaryCofan.inl c₀
hd' : BinaryCofan.inr c ≫ d = IsTerminal.from HT Y ≫ BinaryCofan.inr c₀
⊢ Nonempty (IsColimit c') ↔
    IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧ IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)

Next tactic:
rw [H c' (αX ≫ HT.from _) (αY ≫ HT.from _) (f ≫ d) (by rw [← reassoc_of% hX, hd, Category.assoc])
      (by rw [← reassoc_of% hY, hd', Category.assoc])]
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
  rw [H c' (αX ≫ HT.from _) (αY ≫ HT.from _) (f ≫ d) (by 

Proof state:
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
d : c.pt ⟶ ((Functor.const (Discrete WalkingPair)).obj c₀.pt).obj { as := WalkingPair.left }
hd : BinaryCofan.inl c ≫ d = IsTerminal.from HT X ≫ BinaryCofan.inl c₀
hd' : BinaryCofan.inr c ≫ d = IsTerminal.from HT Y ≫ BinaryCofan.inr c₀
⊢ (αX ≫ IsTerminal.from HT X) ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f ≫ d

Next tactic:
rw [← reassoc_of% hX, hd, Category.assoc]
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
  rw [H c' (αX ≫ HT.from _) (αY ≫ HT.from _) (f ≫ d) (by rw [← reassoc_of% hX, hd, Category.assoc])
      (by 

Proof state:
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
d : c.pt ⟶ ((Functor.const (Discrete WalkingPair)).obj c₀.pt).obj { as := WalkingPair.left }
hd : BinaryCofan.inl c ≫ d = IsTerminal.from HT X ≫ BinaryCofan.inl c₀
hd' : BinaryCofan.inr c ≫ d = IsTerminal.from HT Y ≫ BinaryCofan.inr c₀
⊢ (αY ≫ IsTerminal.from HT Y) ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f ≫ d

Next tactic:
rw [← reassoc_of% hY, hd', Category.assoc]
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
  rw [H c' (αX ≫ HT.from _) (αY ≫ HT.from _) (f ≫ d) (by rw [← reassoc_of% hX, hd, Category.assoc])
      (by rw [← reassoc_of% hY, hd', Category.assoc])]
  

Proof state:
case van_kampen'.mk.intro
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
d : c.pt ⟶ ((Functor.const (Discrete WalkingPair)).obj c₀.pt).obj { as := WalkingPair.left }
hd : BinaryCofan.inl c ≫ d = IsTerminal.from HT X ≫ BinaryCofan.inl c₀
hd' : BinaryCofan.inr c ≫ d = IsTerminal.from HT Y ≫ BinaryCofan.inr c₀
⊢ IsPullback (BinaryCofan.inl c') (αX ≫ IsTerminal.from HT X) (f ≫ d) (BinaryCofan.inl c₀) ∧
      IsPullback (BinaryCofan.inr c') (αY ≫ IsTerminal.from HT Y) (f ≫ d) (BinaryCofan.inr c₀) ↔
    IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧ IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)

Next tactic:
obtain ⟨hl, hr⟩ := (H c (HT.from _) (HT.from _) d hd.symm hd'.symm).mp ⟨hc⟩
theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFiniteCoproducts C]
    [HasPullbacksOfInclusions C]
    (T : C) (HT : IsTerminal T) (c₀ : BinaryCofan T T) (hc₀ : IsColimit c₀) :
    FinitaryExtensive C ↔ IsVanKampenColimit c₀ := by
  refine' ⟨fun H => H.van_kampen' c₀ hc₀, fun H => _⟩
  constructor
  simp_rw [BinaryCofan.isVanKampen_iff] at H ⊢
  intro X Y c hc X' Y' c' αX αY f hX hY
  obtain ⟨d, hd, hd'⟩ :=
    Limits.BinaryCofan.IsColimit.desc' hc (HT.from _ ≫ c₀.inl) (HT.from _ ≫ c₀.inr)
  rw [H c' (αX ≫ HT.from _) (αY ≫ HT.from _) (f ≫ d) (by rw [← reassoc_of% hX, hd, Category.assoc])
      (by rw [← reassoc_of% hY, hd', Category.assoc])]
  obtain ⟨hl, hr⟩ := (H c (HT.from _) (HT.from _) d hd.symm hd'.symm).mp ⟨hc⟩
  

Proof state:
case van_kampen'.mk.intro.intro
J : Type v'
inst✝⁵ : Category.{u', v'} J
C✝ : Type u
inst✝⁴ : Category.{v, u} C✝
D : Type u''
inst✝³ : Category.{v'', u''} D
X✝ Y✝ : C✝
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasFiniteCoproducts C
inst✝ : HasPullbacksOfInclusions C
T : C
HT : IsTerminal T
c₀ : BinaryCofan T T
hc₀ : IsColimit c₀
H :
  ∀ {X' Y' : C} (c' : BinaryCofan X' Y') (αX : X' ⟶ T) (αY : Y' ⟶ T) (f : c'.pt ⟶ c₀.pt),
    αX ≫ BinaryCofan.inl c₀ = BinaryCofan.inl c' ≫ f →
      αY ≫ BinaryCofan.inr c₀ = BinaryCofan.inr c' ≫ f →
        (Nonempty (IsColimit c') ↔
          IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c₀) ∧
            IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c₀))
X Y : C
c : BinaryCofan X Y
hc : IsColimit 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
d : c.pt ⟶ ((Functor.const (Discrete WalkingPair)).obj c₀.pt).obj { as := WalkingPair.left }
hd : BinaryCofan.inl c ≫ d = IsTerminal.from HT X ≫ BinaryCofan.inl c₀
hd' : BinaryCofan.inr c ≫ d = IsTerminal.from HT Y ≫ BinaryCofan.inr c₀
hl : IsPullback (BinaryCofan.inl c) (IsTerminal.from HT X) d (BinaryCofan.inl c₀)
hr : IsPullback (BinaryCofan.inr c) (IsTerminal.from HT Y) d (BinaryCofan.inr c₀)
⊢ IsPullback (BinaryCofan.inl c') (αX ≫ IsTerminal.from HT X) (f ≫ d) (BinaryCofan.inl c₀) ∧
      IsPullback (BinaryCofan.inr c') (αY ≫ IsTerminal.from HT Y) (f ≫ d) (BinaryCofan.inr c₀) ↔
    IsPullback (BinaryCofan.inl c') αX f (BinaryCofan.inl c) ∧ IsPullback (BinaryCofan.inr c') αY f (BinaryCofan.inr c)

Next tactic:
rw [hl.paste_vert_iff hX.symm, hr.paste_vert_iff hY.symm]