l3lab/ntp-mathlib huggingface dataset:
theorem adhesive_of_preserves_and_reflects_isomorphism (F : C ⥤ D)
    [Adhesive D] [HasPullbacks C] [HasPushouts C]
    [PreservesLimitsOfShape WalkingCospan F]
    [PreservesColimitsOfShape WalkingSpan F]
    [ReflectsIsomorphisms F] :
    Adhesive C := by
  haveI : ReflectsLimitsOfShape WalkingCospan F :=
    reflectsLimitsOfShapeOfReflectsIsomorphisms
  haveI : ReflectsColimitsOfShape WalkingSpan F :=
    reflectsColimitsOfShapeOfReflectsIsomorphisms
  

Proof state:
J : Type v'
inst✝⁸ : Category.{u', v'} J
C : Type u
inst✝⁷ : Category.{v, u} C
W X Y Z : C
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
D : Type u''
inst✝⁶ : Category.{v'', u''} D
F : C ⥤ D
inst✝⁵ : Adhesive D
inst✝⁴ : HasPullbacks C
inst✝³ : HasPushouts C
inst✝² : PreservesLimitsOfShape WalkingCospan F
inst✝¹ : PreservesColimitsOfShape WalkingSpan F
inst✝ : ReflectsIsomorphisms F
this✝ : ReflectsLimitsOfShape WalkingCospan F
this : ReflectsColimitsOfShape WalkingSpan F
⊢ Adhesive C

Next tactic:
exact adhesive_of_preserves_and_reflects F
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  

Proof state:
J : Type v'
inst✝⁹ : Category.{u', v'} J
C : Type u
inst✝⁸ : Category.{v, u} C
W X Y Z : C
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
D : Type u''
inst✝⁷ : Category.{v'', u''} D
inst✝⁶ : HasPullbacks D
inst✝⁵ : Adhesive C
inst✝⁴ : HasPullbacks C
inst✝³ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝² : Full Gr
inst✝¹ : Faithful Gr
inst✝ : PreservesLimitsOfShape WalkingCospan Gl
⊢ Adhesive D

Next tactic:
have := adj.leftAdjointPreservesColimits
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  

Proof state:
J : Type v'
inst✝⁹ : Category.{u', v'} J
C : Type u
inst✝⁸ : Category.{v, u} C
W X Y Z : C
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
D : Type u''
inst✝⁷ : Category.{v'', u''} D
inst✝⁶ : HasPullbacks D
inst✝⁵ : Adhesive C
inst✝⁴ : HasPullbacks C
inst✝³ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝² : Full Gr
inst✝¹ : Faithful Gr
inst✝ : PreservesLimitsOfShape WalkingCospan Gl
this : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
⊢ Adhesive D

Next tactic:
have := adj.rightAdjointPreservesLimits
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  

Proof state:
J : Type v'
inst✝⁹ : Category.{u', v'} J
C : Type u
inst✝⁸ : Category.{v, u} C
W X Y Z : C
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
D : Type u''
inst✝⁷ : Category.{v'', u''} D
inst✝⁶ : HasPullbacks D
inst✝⁵ : Adhesive C
inst✝⁴ : HasPullbacks C
inst✝³ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝² : Full Gr
inst✝¹ : Faithful Gr
inst✝ : PreservesLimitsOfShape WalkingCospan Gl
this✝ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this : PreservesLimitsOfSize.{?u.115979, ?u.115978, v'', v, u'', u} Gr
⊢ Adhesive D

Next tactic:
apply Adhesive.mk (hasPushout_of_mono_left := H₂)
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  

Proof state:
J : Type v'
inst✝⁹ : Category.{u', v'} J
C : Type u
inst✝⁸ : Category.{v, u} C
W X Y Z : C
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
D : Type u''
inst✝⁷ : Category.{v'', u''} D
inst✝⁶ : HasPullbacks D
inst✝⁵ : Adhesive C
inst✝⁴ : HasPullbacks C
inst✝³ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝² : Full Gr
inst✝¹ : Faithful Gr
inst✝ : PreservesLimitsOfShape WalkingCospan Gl
this✝ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this : PreservesLimitsOfSize.{?u.115979, ?u.115978, v'', v, u'', u} Gr
⊢ ∀ {W X Y Z : D} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z} [inst : Mono f] (H : IsPushout f g h i),
    IsPushout.IsVanKampen H

Next tactic:
intro W X Y Z f g h i _ H
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  

Proof state:
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this : PreservesLimitsOfSize.{?u.115979, ?u.115978, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
⊢ IsPushout.IsVanKampen H

Next tactic:
have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
  

Proof state:
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝¹ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this✝ : PreservesLimitsOfSize.{0, 0, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
this : IsPushout.IsVanKampen (_ : IsPushout (Gr.map f) (Gr.map g) pushout.inl pushout.inr)
⊢ IsPushout.IsVanKampen H

Next tactic:
rw [IsPushout.isVanKampen_iff] at this ⊢
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
  rw [IsPushout.isVanKampen_iff] at this ⊢
  

Proof state:
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝¹ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this✝ : PreservesLimitsOfSize.{0, 0, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
this :
  IsVanKampenColimit (PushoutCocone.mk pushout.inl pushout.inr (_ : Gr.map f ≫ pushout.inl = Gr.map g ≫ pushout.inr))
⊢ IsVanKampenColimit (PushoutCocone.mk h i (_ : f ≫ h = g ≫ i))

Next tactic:
refine (IsVanKampenColimit.precompose_isIso_iff
    (isoWhiskerLeft _ (asIso adj.counit) ≪≫ Functor.rightUnitor _).hom).mp ?_
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
  rw [IsPushout.isVanKampen_iff] at this ⊢
  refine (IsVanKampenColimit.precompose_isIso_iff
    (isoWhiskerLeft _ (asIso adj.counit) ≪≫ Functor.rightUnitor _).hom).mp ?_
  

Proof state:
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝¹ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this✝ : PreservesLimitsOfSize.{0, 0, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
this :
  IsVanKampenColimit (PushoutCocone.mk pushout.inl pushout.inr (_ : Gr.map f ≫ pushout.inl = Gr.map g ≫ pushout.inr))
⊢ IsVanKampenColimit
    ((Cocones.precompose (isoWhiskerLeft (span f g) (asIso adj.counit) ≪≫ Functor.rightUnitor (span f g)).hom).obj
      (PushoutCocone.mk h i (_ : f ≫ h = g ≫ i)))

Next tactic:
refine ((this.precompose_isIso (spanCompIso _ _ _).hom).map_reflective adj).of_iso
    (IsColimit.uniqueUpToIso ?_ ?_)
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
  rw [IsPushout.isVanKampen_iff] at this ⊢
  refine (IsVanKampenColimit.precompose_isIso_iff
    (isoWhiskerLeft _ (asIso adj.counit) ≪≫ Functor.rightUnitor _).hom).mp ?_
  refine ((this.precompose_isIso (spanCompIso _ _ _).hom).map_reflective adj).of_iso
    (IsColimit.uniqueUpToIso ?_ ?_)
  · 

Proof state:
case refine_1
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝¹ : PreservesColimitsOfSize.{?u.115927, ?u.115926, v, v'', u, u''} Gl
this✝ : PreservesLimitsOfSize.{0, 0, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
this :
  IsVanKampenColimit (PushoutCocone.mk pushout.inl pushout.inr (_ : Gr.map f ≫ pushout.inl = Gr.map g ≫ pushout.inr))
⊢ IsColimit
    (Gl.mapCocone
      ((Cocones.precompose (spanCompIso Gr f g).hom).obj
        (PushoutCocone.mk pushout.inl pushout.inr (_ : Gr.map f ≫ pushout.inl = Gr.map g ≫ pushout.inr))))

Next tactic:
exact isColimitOfPreserves Gl ((IsColimit.precomposeHomEquiv _ _).symm $ pushoutIsPushout _ _)
theorem adhesive_of_reflective [HasPullbacks D] [Adhesive C] [HasPullbacks C] [HasPushouts C]
    [H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [Mono f], HasPushout f g]
    {Gl : C ⥤ D} {Gr : D ⥤ C} (adj : Gl ⊣ Gr) [Full Gr] [Faithful Gr]
    [PreservesLimitsOfShape WalkingCospan Gl] :
    Adhesive D := by
  have := adj.leftAdjointPreservesColimits
  have := adj.rightAdjointPreservesLimits
  apply Adhesive.mk (hasPushout_of_mono_left := H₂)
  intro W X Y Z f g h i _ H
  have := Adhesive.van_kampen (IsPushout.of_hasPushout (Gr.map f) (Gr.map g))
  rw [IsPushout.isVanKampen_iff] at this ⊢
  refine (IsVanKampenColimit.precompose_isIso_iff
    (isoWhiskerLeft _ (asIso adj.counit) ≪≫ Functor.rightUnitor _).hom).mp ?_
  refine ((this.precompose_isIso (spanCompIso _ _ _).hom).map_reflective adj).of_iso
    (IsColimit.uniqueUpToIso ?_ ?_)
  · exact isColimitOfPreserves Gl ((IsColimit.precomposeHomEquiv _ _).symm $ pushoutIsPushout _ _)
  · 

Proof state:
case refine_2
J : Type v'
inst✝¹⁰ : Category.{u', v'} J
C : Type u
inst✝⁹ : Category.{v, u} C
W✝ X✝ Y✝ Z✝ : C
f✝ : W✝ ⟶ X✝
g✝ : W✝ ⟶ Y✝
h✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
D : Type u''
inst✝⁸ : Category.{v'', u''} D
inst✝⁷ : HasPullbacks D
inst✝⁶ : Adhesive C
inst✝⁵ : HasPullbacks C
inst✝⁴ : HasPushouts C
H₂ : ∀ {X Y S : D} (f : S ⟶ X) (g : S ⟶ Y) [inst : Mono f], HasPushout f g
Gl : C ⥤ D
Gr : D ⥤ C
adj : Gl ⊣ Gr
inst✝³ : Full Gr
inst✝² : Faithful Gr
inst✝¹ : PreservesLimitsOfShape WalkingCospan Gl
this✝¹ : PreservesColimitsOfSize.{0, 0, v, v'', u, u''} Gl
this✝ : PreservesLimitsOfSize.{0, 0, v'', v, u'', u} Gr
W X Y Z : D
f : W ⟶ X
g : W ⟶ Y
h : X ⟶ Z
i : Y ⟶ Z
inst✝ : Mono f
H : IsPushout f g h i
this :
  IsVanKampenColimit (PushoutCocone.mk pushout.inl pushout.inr (_ : Gr.map f ≫ pushout.inl = Gr.map g ≫ pushout.inr))
⊢ IsColimit
    ((Cocones.precompose (isoWhiskerLeft (span f g) (asIso adj.counit) ≪≫ Functor.rightUnitor (span f g)).hom).obj
      (PushoutCocone.mk h i (_ : f ≫ h = g ≫ i)))

Next tactic:
exact (IsColimit.precomposeHomEquiv _ _).symm H.isColimit
theorem isChain_univ_iff : IsChain r (univ : Set α) ↔ IsTrichotomous α r := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
⊢ IsChain r univ ↔ IsTrichotomous α r

Next tactic:
refine' ⟨fun h => ⟨fun a b => _⟩, fun h => @isChain_of_trichotomous _ _ h univ⟩
theorem isChain_univ_iff : IsChain r (univ : Set α) ↔ IsTrichotomous α r := by
  refine' ⟨fun h => ⟨fun a b => _⟩, fun h => @isChain_of_trichotomous _ _ h univ⟩
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
h : IsChain r univ
a b : α
⊢ r a b ∨ a = b ∨ r b a

Next tactic:
rw [or_left_comm, or_iff_not_imp_left]
theorem isChain_univ_iff : IsChain r (univ : Set α) ↔ IsTrichotomous α r := by
  refine' ⟨fun h => ⟨fun a b => _⟩, fun h => @isChain_of_trichotomous _ _ h univ⟩
  rw [or_left_comm, or_iff_not_imp_left]
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
h : IsChain r univ
a b : α
⊢ ¬a = b → r a b ∨ r b a

Next tactic:
exact h trivial trivial
theorem Monotone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    IsChain (· ≤ ·) (range f) := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
inst✝¹ : LinearOrder α
inst✝ : Preorder β
f : α → β
hf : Monotone f
⊢ IsChain (fun x x_1 => x ≤ x_1) (range f)

Next tactic:
rw [← image_univ]
theorem Monotone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    IsChain (· ≤ ·) (range f) := by
  rw [← image_univ]
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
inst✝¹ : LinearOrder α
inst✝ : Preorder β
f : α → β
hf : Monotone f
⊢ IsChain (fun x x_1 => x ≤ x_1) (f '' univ)

Next tactic:
exact (isChain_of_trichotomous _).image (· ≤ ·) _ _ hf
protected theorem IsChain.directed {f : β → α} {c : Set β} (h : IsChain (f ⁻¹'o r) c) :
    Directed r fun x : { a : β // a ∈ c } => f x :=
  fun ⟨a, ha⟩ ⟨b, hb⟩ =>
    (by_cases fun hab : a = b => by
      

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c✝ c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
inst✝ : IsRefl α r
f : β → α
c : Set β
h : IsChain (f ⁻¹'o r) c
x✝¹ x✝ : { a // a ∈ c }
a : β
ha : a ∈ c
b : β
hb : b ∈ c
hab : a = b
⊢ ∃ z,
    r ((fun x => f ↑x) { val := a, property := ha }) ((fun x => f ↑x) z) ∧
      r ((fun x => f ↑x) { val := b, property := hb }) ((fun x => f ↑x) z)

Next tactic:
simp only [hab, exists_prop, and_self_iff, Subtype.exists]
protected theorem IsChain.directed {f : β → α} {c : Set β} (h : IsChain (f ⁻¹'o r) c) :
    Directed r fun x : { a : β // a ∈ c } => f x :=
  fun ⟨a, ha⟩ ⟨b, hb⟩ =>
    (by_cases fun hab : a = b => by
      simp only [hab, exists_prop, and_self_iff, Subtype.exists]
      

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c✝ c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
inst✝ : IsRefl α r
f : β → α
c : Set β
h : IsChain (f ⁻¹'o r) c
x✝¹ x✝ : { a // a ∈ c }
a : β
ha : a ∈ c
b : β
hb : b ∈ c
hab : a = b
⊢ ∃ a ∈ c, r (f b) (f a)

Next tactic:
exact ⟨b, hb, refl _⟩
theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a ∈ s) (mem2 : b ∈ s)
    (mem3 : c ∈ s) : ∃ (z : _) (_ : z ∈ s), r a z ∧ r b z ∧ r c z := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c✝ c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
inst✝¹ : IsRefl α r
hchain : IsChain r s
inst✝ : IsTrans α r
a b c : α
mem1 : a ∈ s
mem2 : b ∈ s
mem3 : c ∈ s
⊢ ∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z

Next tactic:
rcases directedOn_iff_directed.mpr (IsChain.directed hchain) a mem1 b mem2 with ⟨z, mem4, H1, H2⟩
theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a ∈ s) (mem2 : b ∈ s)
    (mem3 : c ∈ s) : ∃ (z : _) (_ : z ∈ s), r a z ∧ r b z ∧ r c z := by
  rcases directedOn_iff_directed.mpr (IsChain.directed hchain) a mem1 b mem2 with ⟨z, mem4, H1, H2⟩
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
r : α → α → Prop
c✝ c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
inst✝¹ : IsRefl α r
hchain : IsChain r s
inst✝ : IsTrans α r
a b c : α
mem1 : a ∈ s
mem2 : b ∈ s
mem3 : c ∈ s
z : α
mem4 : z ∈ s
H1 : r a z
H2 : r b z
⊢ ∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z

Next tactic:
rcases directedOn_iff_directed.mpr (IsChain.directed hchain) z mem4 c mem3 with
    ⟨z', mem5, H3, H4⟩
theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a ∈ s) (mem2 : b ∈ s)
    (mem3 : c ∈ s) : ∃ (z : _) (_ : z ∈ s), r a z ∧ r b z ∧ r c z := by
  rcases directedOn_iff_directed.mpr (IsChain.directed hchain) a mem1 b mem2 with ⟨z, mem4, H1, H2⟩
  rcases directedOn_iff_directed.mpr (IsChain.directed hchain) z mem4 c mem3 with
    ⟨z', mem5, H3, H4⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
r : α → α → Prop
c✝ c₁ c₂ c₃ s t : Set α
a✝ b✝ x y : α
inst✝¹ : IsRefl α r
hchain : IsChain r s
inst✝ : IsTrans α r
a b c : α
mem1 : a ∈ s
mem2 : b ∈ s
mem3 : c ∈ s
z : α
mem4 : z ∈ s
H1 : r a z
H2 : r b z
z' : α
mem5 : z' ∈ s
H3 : r z z'
H4 : r c z'
⊢ ∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z

Next tactic:
exact ⟨z', mem5, _root_.trans H1 H3, _root_.trans H2 H3, H4⟩
theorem succChain_spec (h : ∃ t, IsChain r s ∧ SuperChain r s t) :
    SuperChain r s (SuccChain r s) := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
h : ∃ t, IsChain r s ∧ SuperChain r s t
⊢ SuperChain r s (SuccChain r s)

Next tactic:
have : IsChain r s ∧ SuperChain r s (choose h) :=
    @choose_spec _ (fun t => IsChain r s ∧ SuperChain r s t) _
theorem succChain_spec (h : ∃ t, IsChain r s ∧ SuperChain r s t) :
    SuperChain r s (SuccChain r s) := by
  have : IsChain r s ∧ SuperChain r s (choose h) :=
    @choose_spec _ (fun t => IsChain r s ∧ SuperChain r s t) _
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
h : ∃ t, IsChain r s ∧ SuperChain r s t
this : IsChain r s ∧ SuperChain r s (choose h)
⊢ SuperChain r s (SuccChain r s)

Next tactic:
simpa [SuccChain, dif_pos, exists_and_left.mp h] using this.2
theorem IsChain.succ (hs : IsChain r s) : IsChain r (SuccChain r s) :=
  if h : ∃ t, IsChain r s ∧ SuperChain r s t then (succChain_spec h).1
  else by
    

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
hs : IsChain r s
h : ¬∃ t, IsChain r s ∧ SuperChain r s t
⊢ IsChain r (SuccChain r s)

Next tactic:
rw [exists_and_left] at h
theorem IsChain.succ (hs : IsChain r s) : IsChain r (SuccChain r s) :=
  if h : ∃ t, IsChain r s ∧ SuperChain r s t then (succChain_spec h).1
  else by
    rw [exists_and_left] at h
    

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
hs : IsChain r s
h : ¬(IsChain r s ∧ ∃ x, SuperChain r s x)
⊢ IsChain r (SuccChain r s)

Next tactic:
simpa [SuccChain, dif_neg, h] using hs
theorem IsChain.superChain_succChain (hs₁ : IsChain r s) (hs₂ : ¬IsMaxChain r s) :
    SuperChain r s (SuccChain r s) := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
hs₁ : IsChain r s
hs₂ : ¬IsMaxChain r s
⊢ SuperChain r s (SuccChain r s)

Next tactic:
simp only [IsMaxChain, not_and, not_forall, exists_prop, exists_and_left] at hs₂
theorem IsChain.superChain_succChain (hs₁ : IsChain r s) (hs₂ : ¬IsMaxChain r s) :
    SuperChain r s (SuccChain r s) := by
  simp only [IsMaxChain, not_and, not_forall, exists_prop, exists_and_left] at hs₂
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
hs₁ : IsChain r s
hs₂ : IsChain r s → ∃ x, IsChain r x ∧ s ⊆ x ∧ ¬s = x
⊢ SuperChain r s (SuccChain r s)

Next tactic:
obtain ⟨t, ht, hst⟩ := hs₂ hs₁
theorem IsChain.superChain_succChain (hs₁ : IsChain r s) (hs₂ : ¬IsMaxChain r s) :
    SuperChain r s (SuccChain r s) := by
  simp only [IsMaxChain, not_and, not_forall, exists_prop, exists_and_left] at hs₂
  obtain ⟨t, ht, hst⟩ := hs₂ hs₁
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t✝ : Set α
a b x y : α
hs₁ : IsChain r s
hs₂ : IsChain r s → ∃ x, IsChain r x ∧ s ⊆ x ∧ ¬s = x
t : Set α
ht : IsChain r t
hst : s ⊆ t ∧ ¬s = t
⊢ SuperChain r s (SuccChain r s)

Next tactic:
exact succChain_spec ⟨t, hs₁, ht, ssubset_iff_subset_ne.2 hst⟩
theorem subset_succChain : s ⊆ SuccChain r s :=
  if h : ∃ t, IsChain r s ∧ SuperChain r s t then (succChain_spec h).2.1
  else by
    

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
h : ¬∃ t, IsChain r s ∧ SuperChain r s t
⊢ s ⊆ SuccChain r s

Next tactic:
rw [exists_and_left] at h
theorem subset_succChain : s ⊆ SuccChain r s :=
  if h : ∃ t, IsChain r s ∧ SuperChain r s t then (succChain_spec h).2.1
  else by
    rw [exists_and_left] at h
    

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
c c₁ c₂ c₃ s t : Set α
a b x y : α
h : ¬(IsChain r s ∧ ∃ x, SuperChain r s x)
⊢ s ⊆ SuccChain r s

Next tactic:
simp [SuccChain, dif_neg, h, Subset.rfl]