Lean4
/-- Given any adjunction `L ⊣ R`, there is a comparison functor `CategoryTheory.Monad.comparison R`
sending objects `Y : D` to Eilenberg-Moore algebras for `L ⋙ R` with underlying object `R.obj X`.
We later show that this is full when `R` is full, faithful when `R` is faithful,
and essentially surjective when `R` is reflective.
-/
@[simps]
def comparison (h : L ⊣ R) : D ⥤ h.toMonad.Algebra
where
obj
X :=
{ A := R.obj X
a := R.map (h.counit.app X)
assoc := by
dsimp
rw [← R.map_comp, ← Adjunction.counit_naturality, R.map_comp] }
map
f :=
{ f := R.map f
h := by
dsimp
rw [← R.map_comp, Adjunction.counit_naturality, R.map_comp] }