l3lab/ntp-mathlib huggingface dataset:
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    

Proof state:
C : Type u₁
D : Type u₂
inst✝⁴ : Category.{v₁, u₁} C
inst✝³ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝² : IsRightAdjoint G
inst✝¹ : CreatesColimitOfIsSplitPair G
A B : D
f g : A ⟶ B
inst✝ : Functor.IsSplitPair G f g
⊢ HasColimit (parallelPair f g ⋙ G)

Next tactic:
apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    

Proof state:
C : Type u₁
D : Type u₂
inst✝⁴ : Category.{v₁, u₁} C
inst✝³ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝² : IsRightAdjoint G
inst✝¹ : CreatesColimitOfIsSplitPair G
A B : D
f g : A ⟶ B
inst✝ : Functor.IsSplitPair G f g
⊢ HasColimit
    (parallelPair ((parallelPair f g ⋙ G).map WalkingParallelPairHom.left)
      ((parallelPair f g ⋙ G).map WalkingParallelPairHom.right))

Next tactic:
exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  

Proof state:
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ MonadicRightAdjoint G

Next tactic:
apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · 

Proof state:
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ HasCoequalizerOfIsSplitPair G

Next tactic:
constructor
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasCoequalizer f g

Next tactic:
intros
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝⁴ : Category.{v₁, u₁} C
inst✝³ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝² : IsRightAdjoint G
inst✝¹ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
A✝ B✝ : D
f✝ g✝ : A✝ ⟶ B✝
inst✝ : Functor.IsSplitPair G f✝ g✝
⊢ HasCoequalizer f✝ g✝

Next tactic:
apply hasColimit_of_created (parallelPair _ _) G
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · 

Proof state:
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ PreservesColimitOfIsSplitPair G

Next tactic:
constructor
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · constructor
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ {A B : D} → (f g : A ⟶ B) → [inst : Functor.IsSplitPair G f g] → PreservesColimit (parallelPair f g) G

Next tactic:
intros
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · constructor
    intros
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝⁴ : Category.{v₁, u₁} C
inst✝³ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝² : IsRightAdjoint G
inst✝¹ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
A✝ B✝ : D
f✝ g✝ : A✝ ⟶ B✝
inst✝ : Functor.IsSplitPair G f✝ g✝
⊢ PreservesColimit (parallelPair f✝ g✝) G

Next tactic:
infer_instance
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · constructor
    intros
    infer_instance
  · 

Proof state:
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ ReflectsColimitOfIsSplitPair G

Next tactic:
constructor
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · constructor
    intros
    infer_instance
  · constructor
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝³ : Category.{v₁, u₁} C
inst✝² : Category.{v₁, u₂} D
G : D ⥤ C
inst✝¹ : IsRightAdjoint G
inst✝ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
⊢ {A B : D} → (f g : A ⟶ B) → [inst : Functor.IsSplitPair G f g] → ReflectsColimit (parallelPair f g) G

Next tactic:
intros
/--
Beck's monadicity theorem. If `G` has a right adjoint and creates coequalizers of `G`-split pairs,
then it is monadic.
This is the converse of `createsGSplitOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  let I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by
    apply @hasColimitOfIso _ _ _ _ _ _ ?_ (diagramIsoParallelPair.{v₁} _)
    exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
  apply @monadicOfHasPreservesReflectsGSplitCoequalizers _ _ _ _ _ _ ?_ ?_ ?_
  · constructor
    intros
    apply hasColimit_of_created (parallelPair _ _) G
  · constructor
    intros
    infer_instance
  · constructor
    intros
    

Proof state:
case out
C : Type u₁
D : Type u₂
inst✝⁴ : Category.{v₁, u₁} C
inst✝³ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝² : IsRightAdjoint G
inst✝¹ : CreatesColimitOfIsSplitPair G
I : ∀ {A B : D} (f g : A ⟶ B) [inst : Functor.IsSplitPair G f g], HasColimit (parallelPair f g ⋙ G) :=
  fun {A B} f g [Functor.IsSplitPair G f g] => hasColimitOfIso (diagramIsoParallelPair (parallelPair f g ⋙ G))
A✝ B✝ : D
f✝ g✝ : A✝ ⟶ B✝
inst✝ : Functor.IsSplitPair G f✝ g✝
⊢ ReflectsColimit (parallelPair f✝ g✝) G

Next tactic:
infer_instance
/-- An alternate version of Beck's monadicity theorem. If `G` reflects isomorphisms, preserves
coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic.
-/
def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [ReflectsIsomorphisms G]
    [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : ReflectsIsomorphisms G
inst✝¹ : HasCoequalizerOfIsSplitPair G
inst✝ : PreservesColimitOfIsSplitPair G
⊢ MonadicRightAdjoint G

Next tactic:
apply (config := {allowSynthFailures := true}) @monadicOfHasPreservesReflectsGSplitCoequalizers
/-- An alternate version of Beck's monadicity theorem. If `G` reflects isomorphisms, preserves
coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic.
-/
def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [ReflectsIsomorphisms G]
    [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  apply (config := {allowSynthFailures := true}) @monadicOfHasPreservesReflectsGSplitCoequalizers
  

Proof state:
case inst
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : ReflectsIsomorphisms G
inst✝¹ : HasCoequalizerOfIsSplitPair G
inst✝ : PreservesColimitOfIsSplitPair G
⊢ ReflectsColimitOfIsSplitPair G

Next tactic:
constructor
/-- An alternate version of Beck's monadicity theorem. If `G` reflects isomorphisms, preserves
coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic.
-/
def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [ReflectsIsomorphisms G]
    [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  apply (config := {allowSynthFailures := true}) @monadicOfHasPreservesReflectsGSplitCoequalizers
  constructor
  

Proof state:
case inst.out
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : ReflectsIsomorphisms G
inst✝¹ : HasCoequalizerOfIsSplitPair G
inst✝ : PreservesColimitOfIsSplitPair G
⊢ {A B : D} → (f g : A ⟶ B) → [inst : Functor.IsSplitPair G f g] → ReflectsColimit (parallelPair f g) G

Next tactic:
intro _ _ f g _
/-- An alternate version of Beck's monadicity theorem. If `G` reflects isomorphisms, preserves
coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic.
-/
def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [ReflectsIsomorphisms G]
    [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  apply (config := {allowSynthFailures := true}) @monadicOfHasPreservesReflectsGSplitCoequalizers
  constructor
  intro _ _ f g _
  

Proof state:
case inst.out
C : Type u₁
D : Type u₂
inst✝⁶ : Category.{v₁, u₁} C
inst✝⁵ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝⁴ : IsRightAdjoint G
inst✝³ : ReflectsIsomorphisms G
inst✝² : HasCoequalizerOfIsSplitPair G
inst✝¹ : PreservesColimitOfIsSplitPair G
A✝ B✝ : D
f g : A✝ ⟶ B✝
inst✝ : Functor.IsSplitPair G f g
⊢ ReflectsColimit (parallelPair f g) G

Next tactic:
have := HasCoequalizerOfIsSplitPair.out G f g
/-- An alternate version of Beck's monadicity theorem. If `G` reflects isomorphisms, preserves
coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic.
-/
def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [ReflectsIsomorphisms G]
    [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] :
    MonadicRightAdjoint G := by
  apply (config := {allowSynthFailures := true}) @monadicOfHasPreservesReflectsGSplitCoequalizers
  constructor
  intro _ _ f g _
  have := HasCoequalizerOfIsSplitPair.out G f g
  

Proof state:
case inst.out
C : Type u₁
D : Type u₂
inst✝⁶ : Category.{v₁, u₁} C
inst✝⁵ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝⁴ : IsRightAdjoint G
inst✝³ : ReflectsIsomorphisms G
inst✝² : HasCoequalizerOfIsSplitPair G
inst✝¹ : PreservesColimitOfIsSplitPair G
A✝ B✝ : D
f g : A✝ ⟶ B✝
inst✝ : Functor.IsSplitPair G f g
this : HasCoequalizer f g
⊢ ReflectsColimit (parallelPair f g) G

Next tactic:
apply reflectsColimitOfReflectsIsomorphisms
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
⊢ MonadicRightAdjoint G

Next tactic:
letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
  

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
i : IsRightAdjoint (comparison adj) := { left := leftAdjointComparison, adj := comparisonAdjunction }
⊢ MonadicRightAdjoint G

Next tactic:
constructor
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
  constructor
  

Proof state:
case eqv
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
i : IsRightAdjoint (comparison adj) := { left := leftAdjointComparison, adj := comparisonAdjunction }
⊢ IsEquivalence (comparison adj)

Next tactic:
let _ : ∀ X : (Adjunction.ofRightAdjoint G).toMonad.Algebra,
      IsIso ((Adjunction.ofRightAdjoint
                (comparison (Adjunction.ofRightAdjoint G))).unit.app X) := by
    intro X
    apply
      @isIso_of_reflects_iso _ _ _ _ _ _ _ (Monad.forget (Adjunction.ofRightAdjoint G).toMonad) ?_ _
    · change IsIso (comparisonAdjunction.unit.app X).f
      rw [comparisonAdjunction_unit_f]
      change
        IsIso
          (IsColimit.coconePointUniqueUpToIso (beckCoequalizer X)
              (unitColimitOfPreservesCoequalizer X)).hom
      apply IsIso.of_iso (IsColimit.coconePointUniqueUpToIso _ _)
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
  constructor
  let _ : ∀ X : (Adjunction.ofRightAdjoint G).toMonad.Algebra,
      IsIso ((Adjunction.ofRightAdjoint
                (comparison (Adjunction.ofRightAdjoint G))).unit.app X) := by
    

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
i : IsRightAdjoint (comparison adj) := { left := leftAdjointComparison, adj := comparisonAdjunction }
⊢ ∀ (X : Algebra (toMonad adj)), IsIso ((ofRightAdjoint (comparison adj)).unit.app X)

Next tactic:
intro X
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
  constructor
  let _ : ∀ X : (Adjunction.ofRightAdjoint G).toMonad.Algebra,
      IsIso ((Adjunction.ofRightAdjoint
                (comparison (Adjunction.ofRightAdjoint G))).unit.app X) := by
    intro X
    

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
i : IsRightAdjoint (comparison adj) := { left := leftAdjointComparison, adj := comparisonAdjunction }
X : Algebra (toMonad adj)
⊢ IsIso ((ofRightAdjoint (comparison adj)).unit.app X)

Next tactic:
apply
      @isIso_of_reflects_iso _ _ _ _ _ _ _ (Monad.forget (Adjunction.ofRightAdjoint G).toMonad) ?_ _
/-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves
reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic.
-/
def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G := by
  letI i : IsRightAdjoint (comparison (Adjunction.ofRightAdjoint G)) :=
    ⟨_, comparisonAdjunction⟩
  constructor
  let _ : ∀ X : (Adjunction.ofRightAdjoint G).toMonad.Algebra,
      IsIso ((Adjunction.ofRightAdjoint
                (comparison (Adjunction.ofRightAdjoint G))).unit.app X) := by
    intro X
    apply
      @isIso_of_reflects_iso _ _ _ _ _ _ _ (Monad.forget (Adjunction.ofRightAdjoint G).toMonad) ?_ _
    · 

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₁, u₂} D
G : D ⥤ C
inst✝³ : IsRightAdjoint G
inst✝² : HasReflexiveCoequalizers D
inst✝¹ : ReflectsIsomorphisms G
inst✝ : PreservesColimitOfIsReflexivePair G
i : IsRightAdjoint (comparison adj) := { left := leftAdjointComparison, adj := comparisonAdjunction }
X : Algebra (toMonad adj)
⊢ IsIso ((forget (toMonad adj)).map ((ofRightAdjoint (comparison adj)).unit.app X))

Next tactic:
change IsIso (comparisonAdjunction.unit.app X).f