Lean4
/-- A morphism of monoid objects induces a "restriction" or "comap" functor
between the categories of module objects.
-/
@[simps]
def comap {A B : C} [MonObj A] [MonObj B] (f : A ⟶ B) [IsMonHom f] : Mod_ D B ⥤ Mod_ D A
where
obj
M :=
letI := scalarRestriction f M.X
⟨M.X⟩
map {M N}
g :=
letI := scalarRestriction_hom f M.X N.X g.hom
⟨g.hom⟩
-- Lots more could be said about `comap`, e.g. how it interacts with
-- identities, compositions, and equalities of monoid object morphisms.