Lean4
/-- The forgetful functor from presheaves of modules over a presheaf of rings `R` to presheaves of
`R(X)`-modules where `X` is an initial object.
The functor is implemented as, on object level `M ↦ (c ↦ M(c))` where the `R(X)`-module structure
on `M(c)` is given by restriction of scalars along the unique morphism `R(c) ⟶ R(X)`; and on
morphism level `(f : M ⟶ N) ↦ (c ↦ f(c))`.
-/
@[simps]
noncomputable def forgetToPresheafModuleCat (X : Cᵒᵖ) (hX : Limits.IsInitial X) :
PresheafOfModules.{v} R ⥤ Cᵒᵖ ⥤ ModuleCat (R.obj X)
where
obj M := forgetToPresheafModuleCatObj X hX M
map f := forgetToPresheafModuleCatMap X hX f