Lean4
/-- **Beck's monadicity theorem**: if `G` has a left adjoint and creates coequalizers of `G`-split
pairs, then it is monadic.
This is the converse of `createsGSplitCoequalizersOfMonadic`.
-/
def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] : MonadicRightAdjoint G :=
by
have I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) :=
by
rw [hasColimit_iff_of_iso (diagramIsoParallelPair.{v₁} _)]
exact inferInstanceAs <| HasCoequalizer (G.map f) (G.map g)
have : HasCoequalizerOfIsSplitPair G := ⟨fun _ _ => hasColimit_of_created (parallelPair _ _) G⟩
have : PreservesColimitOfIsSplitPair G := ⟨by intros; infer_instance⟩
have : ReflectsColimitOfIsSplitPair G := ⟨by intros; infer_instance⟩
exact monadicOfHasPreservesReflectsGSplitCoequalizers adj