File: Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

full_name: ModuleCat.RestrictScalars.obj'
code: /-- Any `S`-module M is also an `R`-module via a ring homomorphism `f : R ⟶ S` by defining
    `r • m := f r • m` (`Module.compHom`). This is called restriction of scalars. -/
def obj' : ModuleCat R 
goal: ModuleCat R

full_name: ModuleCat.RestrictScalars.map'
code: /-- Given an `S`-linear map `g : M → M'` between `S`-modules, `g` is also `R`-linear between `M` and
`M'` by means of restriction of scalars.
-/
def map' {M M' : ModuleCat.{v} S} (g : M ⟶ M') : obj' f M ⟶ obj' f M' 
goal: ModuleCat.RestrictScalars.obj' f M ⟶ ModuleCat.RestrictScalars.obj' f M'

full_name: ModuleCat.restrictScalars
code: /-- The restriction of scalars operation is functorial. For any `f : R →+* S` a ring homomorphism,
* an `S`-module `M` can be considered as `R`-module by `r • m = f r • m`
* an `S`-linear map is also `R`-linear
-/
def restrictScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    ModuleCat.{v} S ⥤ ModuleCat.{v} R 
goal: ModuleCat S ⥤ ModuleCat R

full_name: ModuleCat.instFaithfulRestrictScalars
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    (restrictScalars.{v} f).Faithful 
goal: (ModuleCat.restrictScalars f).Faithful

full_name: ModuleCat.instPreservesMonomorphismsRestrictScalars
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    (restrictScalars.{v} f).PreservesMonomorphisms 
goal: (ModuleCat.restrictScalars f).PreservesMonomorphisms

full_name: ModuleCat.instModuleCarrierObjRestrictScalars
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] {f : R →+* S}
    {M : ModuleCat.{v} S} : Module R <| (restrictScalars f).obj M 
goal: Module R ↑((ModuleCat.restrictScalars f).obj M)

full_name: ModuleCat.instModuleCarrierObjRestrictScalars_1
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] {f : R →+* S}
    {M : ModuleCat.{v} S} : Module S <| (restrictScalars f).obj M 
goal: Module S ↑((ModuleCat.restrictScalars f).obj M)

full_name: ModuleCat.restrictScalars.map_apply
code: @[simp]
theorem restrictScalars.map_apply {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    {M M' : ModuleCat.{v} S} (g : M ⟶ M') (x) : (restrictScalars f).map g x = g x 
goal: ((ModuleCat.restrictScalars f).map g) x = g x

full_name: ModuleCat.restrictScalars.smul_def
code: @[simp]
theorem restrictScalars.smul_def {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    {M : ModuleCat.{v} S} (r : R) (m : (restrictScalars f).obj M) : r • m = (f r • m : M) 
goal: r • m = f r • m

full_name: ModuleCat.restrictScalars.smul_def'
code: theorem restrictScalars.smul_def' {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    {M : ModuleCat.{v} S} (r : R) (m : M) :
    -- Porting note: clumsy way to coerce
    let m' : (restrictScalars f).obj M := m
    (r • m' : (restrictScalars f).obj M) = (f r • m : M) 
goal: let m' := m;
r • m' = f r • m

full_name: ModuleCat.sMulCommClass_mk
code: instance (priority := 100) sMulCommClass_mk {R : Type u₁} {S : Type u₂} [Ring R] [CommRing S]
    (f : R →+* S) (M : Type v) [I : AddCommGroup M] [Module S M] :
    haveI : SMul R M := (RestrictScalars.obj' f (ModuleCat.mk M)).isModule.toSMul
    SMulCommClass R S M 
goal: SMulCommClass R S M

full_name: ModuleCat.semilinearMapAddEquiv_apply_apply
code: /-- Semilinear maps `M →ₛₗ[f] N` identify to
morphisms `M ⟶ (ModuleCat.restrictScalars f).obj N`. -/
@[simps]
def semilinearMapAddEquiv {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    (M : ModuleCat.{v} R) (N : ModuleCat.{v} S) :
    (M →ₛₗ[f] N) ≃+ (M ⟶ (ModuleCat.restrictScalars f).obj N) 
goal: ((ModuleCat.semilinearMapAddEquiv f M N) g) a = g a

full_name: ModuleCat.semilinearMapAddEquiv
code: /-- Semilinear maps `M →ₛₗ[f] N` identify to
morphisms `M ⟶ (ModuleCat.restrictScalars f).obj N`. -/
@[simps]
def semilinearMapAddEquiv {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    (M : ModuleCat.{v} R) (N : ModuleCat.{v} S) :
    (M →ₛₗ[f] N) ≃+ (M ⟶ (ModuleCat.restrictScalars f).obj N) 
goal: (↑M →ₛₗ[f] ↑N) ≃+ (M ⟶ (ModuleCat.restrictScalars f).obj N)

full_name: ModuleCat.semilinearMapAddEquiv_symm_apply_apply
code: /-- Semilinear maps `M →ₛₗ[f] N` identify to
morphisms `M ⟶ (ModuleCat.restrictScalars f).obj N`. -/
@[simps]
def semilinearMapAddEquiv {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    (M : ModuleCat.{v} R) (N : ModuleCat.{v} S) :
    (M →ₛₗ[f] N) ≃+ (M ⟶ (ModuleCat.restrictScalars f).obj N) 
goal: ((ModuleCat.semilinearMapAddEquiv f M N).symm g) a = g a

full_name: ModuleCat.restrictScalarsId'App
code: /-- For a `R`-module `M`, the restriction of scalars of `M` by the identity morphisms identifies
to `M`. -/
def restrictScalarsId'App (M : ModuleCat R) : (restrictScalars f).obj M ≅ M 
goal: (ModuleCat.restrictScalars f).obj M ≅ M

full_name: ModuleCat.restrictScalarsId'App_hom_apply
code: lemma restrictScalarsId'App_hom_apply (M : ModuleCat R) (x : M) :
    (restrictScalarsId'App f hf M).hom x = x 
goal: (ModuleCat.restrictScalarsId'App f hf M).hom x = x

full_name: ModuleCat.restrictScalarsId'App_inv_apply
code: lemma restrictScalarsId'App_inv_apply (M : ModuleCat R) (x : M) :
    (restrictScalarsId'App f hf M).inv x = x 
goal: (ModuleCat.restrictScalarsId'App f hf M).inv x = x

full_name: ModuleCat.restrictScalarsId'_inv_app
code: /-- The restriction of scalars by a ring morphism that is the identity identify to the
identity functor. -/
@[simps! hom_app inv_app]
def restrictScalarsId' : ModuleCat.restrictScalars.{v} f ≅ 𝟭 _ 
goal: (ModuleCat.restrictScalarsId' f hf).inv.app X = (ModuleCat.restrictScalarsId'App f hf X).inv

full_name: ModuleCat.restrictScalarsId'
code: /-- The restriction of scalars by a ring morphism that is the identity identify to the
identity functor. -/
@[simps! hom_app inv_app]
def restrictScalarsId' : ModuleCat.restrictScalars.{v} f ≅ 𝟭 _ 
goal: ModuleCat.restrictScalars f ≅ 𝟭 (ModuleCat R)

full_name: ModuleCat.restrictScalarsId'_hom_app
code: /-- The restriction of scalars by a ring morphism that is the identity identify to the
identity functor. -/
@[simps! hom_app inv_app]
def restrictScalarsId' : ModuleCat.restrictScalars.{v} f ≅ 𝟭 _ 
goal: (ModuleCat.restrictScalarsId' f hf).hom.app X = (ModuleCat.restrictScalarsId'App f hf X).hom

full_name: ModuleCat.restrictScalarsId'App_hom_naturality
code: @[reassoc]
lemma restrictScalarsId'App_hom_naturality {M N : ModuleCat R} (φ : M ⟶ N) :
    (restrictScalars f).map φ ≫ (restrictScalarsId'App f hf N).hom =
      (restrictScalarsId'App f hf M).hom ≫ φ 
goal: (ModuleCat.restrictScalars f).map φ ≫ (ModuleCat.restrictScalarsId'App f hf N).hom =
  (ModuleCat.restrictScalarsId'App f hf M).hom ≫ φ

full_name: ModuleCat.restrictScalarsId'App_inv_naturality
code: @[reassoc]
lemma restrictScalarsId'App_inv_naturality {M N : ModuleCat R} (φ : M ⟶ N) :
    φ ≫ (restrictScalarsId'App f hf N).inv =
      (restrictScalarsId'App f hf M).inv ≫ (restrictScalars f).map φ 
goal: φ ≫ (ModuleCat.restrictScalarsId'App f hf N).inv =
  (ModuleCat.restrictScalarsId'App f hf M).inv ≫ (ModuleCat.restrictScalars f).map φ

full_name: ModuleCat.restrictScalarsId
code: /-- The restriction of scalars by the identity morphisms identify to the
identity functor. -/
abbrev restrictScalarsId 
goal: ModuleCat.restrictScalars (RingHom.id R) ≅ 𝟭 (ModuleCat R)

full_name: ModuleCat.restrictScalarsComp'App
code: /-- For each `R₃`-module `M`, restriction of scalars of `M` by a composition of ring morphisms
identifies to successively restricting scalars. -/
def restrictScalarsComp'App (M : ModuleCat R₃) :
    (restrictScalars gf).obj M ≅ (restrictScalars f).obj ((restrictScalars g).obj M) 
goal: (ModuleCat.restrictScalars gf).obj M ≅ (ModuleCat.restrictScalars f).obj ((ModuleCat.restrictScalars g).obj M)

full_name: ModuleCat.restrictScalarsComp'App_hom_apply
code: lemma restrictScalarsComp'App_hom_apply (M : ModuleCat R₃) (x : M) :
    (restrictScalarsComp'App f g gf hgf M).hom x = x 
goal: (ModuleCat.restrictScalarsComp'App f g gf hgf M).hom x = x

full_name: ModuleCat.restrictScalarsComp'App_inv_apply
code: lemma restrictScalarsComp'App_inv_apply (M : ModuleCat R₃) (x : M) :
    (restrictScalarsComp'App f g gf hgf M).inv x = x 
goal: (ModuleCat.restrictScalarsComp'App f g gf hgf M).inv x = x

full_name: ModuleCat.restrictScalarsComp'_inv_app
code: /-- The restriction of scalars by a composition of ring morphisms identify to the
composition of the restriction of scalars functors. -/
@[simps! hom_app inv_app]
def restrictScalarsComp' :
    ModuleCat.restrictScalars.{v} gf ≅
      ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f 
goal: (ModuleCat.restrictScalarsComp' f g gf hgf).inv.app X = (ModuleCat.restrictScalarsComp'App f g gf hgf X).inv

full_name: ModuleCat.restrictScalarsComp'
code: /-- The restriction of scalars by a composition of ring morphisms identify to the
composition of the restriction of scalars functors. -/
@[simps! hom_app inv_app]
def restrictScalarsComp' :
    ModuleCat.restrictScalars.{v} gf ≅
      ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f 
goal: ModuleCat.restrictScalars gf ≅ ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f

full_name: ModuleCat.restrictScalarsComp'_hom_app
code: /-- The restriction of scalars by a composition of ring morphisms identify to the
composition of the restriction of scalars functors. -/
@[simps! hom_app inv_app]
def restrictScalarsComp' :
    ModuleCat.restrictScalars.{v} gf ≅
      ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f 
goal: (ModuleCat.restrictScalarsComp' f g gf hgf).hom.app X = (ModuleCat.restrictScalarsComp'App f g gf hgf X).hom

full_name: ModuleCat.restrictScalarsComp'App_hom_naturality
code: @[reassoc]
lemma restrictScalarsComp'App_hom_naturality {M N : ModuleCat R₃} (φ : M ⟶ N) :
    (restrictScalars gf).map φ ≫ (restrictScalarsComp'App f g gf hgf N).hom =
      (restrictScalarsComp'App f g gf hgf M).hom ≫
        (restrictScalars f).map ((restrictScalars g).map φ) 
goal: (ModuleCat.restrictScalars gf).map φ ≫ (ModuleCat.restrictScalarsComp'App f g gf hgf N).hom =
  (ModuleCat.restrictScalarsComp'App f g gf hgf M).hom ≫
    (ModuleCat.restrictScalars f).map ((ModuleCat.restrictScalars g).map φ)

full_name: ModuleCat.restrictScalarsComp'App_inv_naturality
code: @[reassoc]
lemma restrictScalarsComp'App_inv_naturality {M N : ModuleCat R₃} (φ : M ⟶ N) :
    (restrictScalars f).map ((restrictScalars g).map φ) ≫
        (restrictScalarsComp'App f g gf hgf N).inv =
      (restrictScalarsComp'App f g gf hgf M).inv ≫ (restrictScalars gf).map φ 
goal: (ModuleCat.restrictScalars f).map ((ModuleCat.restrictScalars g).map φ) ≫
    (ModuleCat.restrictScalarsComp'App f g gf hgf N).inv =
  (ModuleCat.restrictScalarsComp'App f g gf hgf M).inv ≫ (ModuleCat.restrictScalars gf).map φ

full_name: ModuleCat.restrictScalarsComp
code: /-- The restriction of scalars by a composition of ring morphisms identify to the
composition of the restriction of scalars functors. -/
abbrev restrictScalarsComp 
goal: ModuleCat.restrictScalars (g.comp f) ≅ ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f

full_name: ModuleCat.restrictScalarsEquivalenceOfRingEquiv
code: /-- The equivalence of categories `ModuleCat S ≌ ModuleCat R` induced by `e : R ≃+* S`. -/
def restrictScalarsEquivalenceOfRingEquiv {R S} [Ring R] [Ring S] (e : R ≃+* S) :
    ModuleCat S ≌ ModuleCat R 
goal: ModuleCat S ≌ ModuleCat R

full_name: ModuleCat.restrictScalars_isEquivalence_of_ringEquiv
code: instance restrictScalars_isEquivalence_of_ringEquiv {R S} [Ring R] [Ring S] (e : R ≃+* S) :
    (ModuleCat.restrictScalars e.toRingHom).IsEquivalence 
goal: (ModuleCat.restrictScalars e.toRingHom).IsEquivalence

full_name: ChangeOfRings.«_aux_Mathlib_Algebra_Category_ModuleCat_ChangeOfRings___macroRules_ChangeOfRings_term_⊗ₜ[_,_]__1»
code: scoped[ChangeOfRings]
  notation s "⊗ₜ[" R "," f "]" m => @TensorProduct.tmul R _ _ _ _ _ (Module.compHom _ f) _ s m
goal: Lean.Macro

full_name: ModuleCat.ExtendScalars.obj'
code: /-- Extension of scalars turn an `R`-module into `S`-module by M ↦ S ⨂ M
-/
def obj' : ModuleCat S 
goal: ModuleCat S

full_name: ModuleCat.ExtendScalars.map'
code: /-- Extension of scalars is a functor where an `R`-module `M` is sent to `S ⊗ M` and
`l : M1 ⟶ M2` is sent to `s ⊗ m ↦ s ⊗ l m`
-/
def map' {M1 M2 : ModuleCat.{v} R} (l : M1 ⟶ M2) : obj' f M1 ⟶ obj' f M2 
goal: ModuleCat.ExtendScalars.obj' f M1 ⟶ ModuleCat.ExtendScalars.obj' f M2

full_name: ModuleCat.ExtendScalars.map'_id
code: theorem map'_id {M : ModuleCat.{v} R} : map' f (𝟙 M) = 𝟙 _ 
goal: ModuleCat.ExtendScalars.map' f (𝟙 M) = 𝟙 (ModuleCat.ExtendScalars.obj' f M)

full_name: ModuleCat.ExtendScalars.map'_comp
code: theorem map'_comp {M₁ M₂ M₃ : ModuleCat.{v} R} (l₁₂ : M₁ ⟶ M₂) (l₂₃ : M₂ ⟶ M₃) :
    map' f (l₁₂ ≫ l₂₃) = map' f l₁₂ ≫ map' f l₂₃ 
goal: ModuleCat.ExtendScalars.map' f (l₁₂ ≫ l₂₃) = ModuleCat.ExtendScalars.map' f l₁₂ ≫ ModuleCat.ExtendScalars.map' f l₂₃

full_name: ModuleCat.extendScalars
code: /-- Extension of scalars is a functor where an `R`-module `M` is sent to `S ⊗ M` and
`l : M1 ⟶ M2` is sent to `s ⊗ m ↦ s ⊗ l m`
-/
def extendScalars {R : Type u₁} {S : Type u₂} [CommRing R] [CommRing S] (f : R →+* S) :
    ModuleCat R ⥤ ModuleCat S 
goal: ModuleCat R ⥤ ModuleCat S

full_name: ModuleCat.ExtendScalars.smul_tmul
code: @[simp]
protected theorem smul_tmul {M : ModuleCat.{v} R} (s s' : S) (m : M) :
    s • (s'⊗ₜ[R,f]m : (extendScalars f).obj M) = (s * s')⊗ₜ[R,f]m 
goal: s • s' ⊗ₜ[R] m = (s * s') ⊗ₜ[R] m

full_name: ModuleCat.ExtendScalars.map_tmul
code: @[simp]
theorem map_tmul {M M' : ModuleCat.{v} R} (g : M ⟶ M') (s : S) (m : M) :
    (extendScalars f).map g (s⊗ₜ[R,f]m) = s⊗ₜ[R,f]g m 
goal: ((ModuleCat.extendScalars f).map g) (s ⊗ₜ[R] m) = s ⊗ₜ[R] g m

full_name: ModuleCat.CoextendScalars.hasSMul
code: /-- Given an `R`-module M, consider Hom(S, M) -- the `R`-linear maps between S (as an `R`-module by
 means of restriction of scalars) and M. `S` acts on Hom(S, M) by `s • g = x ↦ g (x • s)`
 -/
instance hasSMul : SMul S <| (restrictScalars f).obj ⟨S⟩ →ₗ[R] M 
goal: SMul S (↑((ModuleCat.restrictScalars f).obj (ModuleCat.mk S)) →ₗ[R] M)

full_name: ModuleCat.CoextendScalars.smul_apply'
code: @[simp]
theorem smul_apply' (s : S) (g : (restrictScalars f).obj ⟨S⟩ →ₗ[R] M) (s' : S) :
    (s • g) s' = g (s' * s : S) 
goal: (s • g) s' = g (s' * s)

full_name: ModuleCat.CoextendScalars.mulAction
code: instance mulAction : MulAction S <| (restrictScalars f).obj ⟨S⟩ →ₗ[R] M 
goal: MulAction S (↑((ModuleCat.restrictScalars f).obj (ModuleCat.mk S)) →ₗ[R] M)

full_name: ModuleCat.CoextendScalars.distribMulAction
code: instance distribMulAction : DistribMulAction S <| (restrictScalars f).obj ⟨S⟩ →ₗ[R] M 
goal: DistribMulAction S (↑((ModuleCat.restrictScalars f).obj (ModuleCat.mk S)) →ₗ[R] M)

full_name: ModuleCat.CoextendScalars.isModule
code: /-- `S` acts on Hom(S, M) by `s • g = x ↦ g (x • s)`, this action defines an `S`-module structure on
Hom(S, M).
 -/
instance isModule : Module S <| (restrictScalars f).obj ⟨S⟩ →ₗ[R] M 
goal: Module S (↑((ModuleCat.restrictScalars f).obj (ModuleCat.mk S)) →ₗ[R] M)

full_name: ModuleCat.CoextendScalars.obj'
code: /-- If `M` is an `R`-module, then the set of `R`-linear maps `S →ₗ[R] M` is an `S`-module with
scalar multiplication defined by `s • l := x ↦ l (x • s)`-/
def obj' : ModuleCat S 
goal: ModuleCat S

full_name: ModuleCat.CoextendScalars.instCoeFunCarrierObj'Forall
code: instance : CoeFun (obj' f M) fun _ => S → M 
goal: CoeFun ↑(ModuleCat.CoextendScalars.obj' f M) fun x => S → ↑M

full_name: ModuleCat.CoextendScalars.map'
code: /-- If `M, M'` are `R`-modules, then any `R`-linear map `g : M ⟶ M'` induces an `S`-linear map
`(S →ₗ[R] M) ⟶ (S →ₗ[R] M')` defined by `h ↦ g ∘ h`-/
@[simps]
def map' {M M' : ModuleCat R} (g : M ⟶ M') : obj' f M ⟶ obj' f M' 
goal: ModuleCat.CoextendScalars.obj' f M ⟶ ModuleCat.CoextendScalars.obj' f M'

full_name: ModuleCat.CoextendScalars.map'_apply
code: /-- If `M, M'` are `R`-modules, then any `R`-linear map `g : M ⟶ M'` induces an `S`-linear map
`(S →ₗ[R] M) ⟶ (S →ₗ[R] M')` defined by `h ↦ g ∘ h`-/
@[simps]
def map' {M M' : ModuleCat R} (g : M ⟶ M') : obj' f M ⟶ obj' f M' 
goal: (ModuleCat.CoextendScalars.map' f g) h = g ∘ₗ h

full_name: ModuleCat.coextendScalars
code: /--
For any rings `R, S` and a ring homomorphism `f : R →+* S`, there is a functor from `R`-module to
`S`-module defined by `M ↦ (S →ₗ[R] M)` where `S` is considered as an `R`-module via restriction of
scalars and `g : M ⟶ M'` is sent to `h ↦ g ∘ h`.
-/
def coextendScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    ModuleCat R ⥤ ModuleCat S 
goal: ModuleCat R ⥤ ModuleCat S

full_name: ModuleCat.CoextendScalars.instCoeFunCarrierObjCoextendScalarsForall
code: instance (M : ModuleCat R) : CoeFun ((coextendScalars f).obj M) fun _ => S → M 
goal: CoeFun ↑((ModuleCat.coextendScalars f).obj M) fun x => S → ↑M

full_name: ModuleCat.CoextendScalars.smul_apply
code: theorem smul_apply (M : ModuleCat R) (g : (coextendScalars f).obj M) (s s' : S) :
    (s • g) s' = g (s' * s) 
goal: (s • g).toFun s' = g.toFun (s' * s)

full_name: ModuleCat.CoextendScalars.map_apply
code: @[simp]
theorem map_apply {M M' : ModuleCat R} (g : M ⟶ M') (x) (s : S) :
    (coextendScalars f).map g x s = g (x s) 
goal: (((ModuleCat.coextendScalars f).map g) x).toFun s = g (x.toFun s)

full_name: ModuleCat.RestrictionCoextensionAdj.HomEquiv.fromRestriction_apply_apply
code: /-- Given `R`-module X and `S`-module Y, any `g : (restrictScalars f).obj Y ⟶ X`
corresponds to `Y ⟶ (coextendScalars f).obj X` by sending `y ↦ (s ↦ g (s • y))`
-/
@[simps apply_apply]
def HomEquiv.fromRestriction {X : ModuleCat R} {Y : ModuleCat S}
    (g : (restrictScalars f).obj Y ⟶ X) : Y ⟶ (coextendScalars f).obj X 
goal: ((ModuleCat.RestrictionCoextensionAdj.HomEquiv.fromRestriction f g) y) s = g (s • y)

full_name: ModuleCat.RestrictionCoextensionAdj.HomEquiv.fromRestriction
code: /-- Given `R`-module X and `S`-module Y, any `g : (restrictScalars f).obj Y ⟶ X`
corresponds to `Y ⟶ (coextendScalars f).obj X` by sending `y ↦ (s ↦ g (s • y))`
-/
@[simps apply_apply]
def HomEquiv.fromRestriction {X : ModuleCat R} {Y : ModuleCat S}
    (g : (restrictScalars f).obj Y ⟶ X) : Y ⟶ (coextendScalars f).obj X 
goal: Y ⟶ (ModuleCat.coextendScalars f).obj X

full_name: ModuleCat.RestrictionCoextensionAdj.HomEquiv.toRestriction_apply
code: /-- Given `R`-module X and `S`-module Y, any `g : Y ⟶ (coextendScalars f).obj X`
corresponds to `(restrictScalars f).obj Y ⟶ X` by `y ↦ g y 1`
-/
@[simps apply]
def HomEquiv.toRestriction {X Y} (g : Y ⟶ (coextendScalars f).obj X) :
    (restrictScalars f).obj Y ⟶ X 
goal: (ModuleCat.RestrictionCoextensionAdj.HomEquiv.toRestriction f g) y = (g y).toFun 1

full_name: ModuleCat.RestrictionCoextensionAdj.HomEquiv.toRestriction
code: /-- Given `R`-module X and `S`-module Y, any `g : Y ⟶ (coextendScalars f).obj X`
corresponds to `(restrictScalars f).obj Y ⟶ X` by `y ↦ g y 1`
-/
@[simps apply]
def HomEquiv.toRestriction {X Y} (g : Y ⟶ (coextendScalars f).obj X) :
    (restrictScalars f).obj Y ⟶ X 
goal: (ModuleCat.restrictScalars f).obj Y ⟶ X

full_name: ModuleCat.RestrictionCoextensionAdj.app'
code: /-- Auxiliary definition for `unit'` -/
def app' (Y : ModuleCat S) : Y →ₗ[S] (restrictScalars f ⋙ coextendScalars f).obj Y 
goal: ↑Y →ₗ[S] ↑((ModuleCat.restrictScalars f ⋙ ModuleCat.coextendScalars f).obj Y)

full_name: ModuleCat.RestrictionCoextensionAdj.unit'
code: /--
The natural transformation from identity functor to the composition of restriction and coextension
of scalars.
-/
-- @[simps] Porting note: not in normal form and not used
protected def unit' : 𝟭 (ModuleCat S) ⟶ restrictScalars f ⋙ coextendScalars f 
goal: 𝟭 (ModuleCat S) ⟶ ModuleCat.restrictScalars f ⋙ ModuleCat.coextendScalars f

full_name: ModuleCat.RestrictionCoextensionAdj.counit'
code: /-- The natural transformation from the composition of coextension and restriction of scalars to
identity functor.
-/
-- @[simps] Porting note: not in normal form and not used
protected def counit' : coextendScalars f ⋙ restrictScalars f ⟶ 𝟭 (ModuleCat R) 
goal: ModuleCat.coextendScalars f ⋙ ModuleCat.restrictScalars f ⟶ 𝟭 (ModuleCat R)

full_name: ModuleCat.restrictCoextendScalarsAdj
code: /-- Restriction of scalars is left adjoint to coextension of scalars. -/
-- @[simps] Porting note: not in normal form and not used
def restrictCoextendScalarsAdj {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    restrictScalars.{max v u₂,u₁,u₂} f ⊣ coextendScalars f 
goal: ModuleCat.restrictScalars f ⊣ ModuleCat.coextendScalars f

full_name: ModuleCat.instIsLeftAdjointRestrictScalars
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    (restrictScalars.{max u₂ w} f).IsLeftAdjoint  
goal: (ModuleCat.restrictScalars f).IsLeftAdjoint

full_name: ModuleCat.instIsRightAdjointCoextendScalars
code: instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
    (coextendScalars.{u₁, u₂, max u₂ w} f).IsRightAdjoint  
goal: (ModuleCat.coextendScalars f).IsRightAdjoint

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.toRestrictScalars
code: /--
Given `R`-module X and `S`-module Y and a map `g : (extendScalars f).obj X ⟶ Y`, i.e. `S`-linear
map `S ⨂ X → Y`, there is a `X ⟶ (restrictScalars f).obj Y`, i.e. `R`-linear map `X ⟶ Y` by
`x ↦ g (1 ⊗ x)`.
-/
@[simps apply]
def HomEquiv.toRestrictScalars {X Y} (g : (extendScalars f).obj X ⟶ Y) :
    X ⟶ (restrictScalars f).obj Y 
goal: X ⟶ (ModuleCat.restrictScalars f).obj Y

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.toRestrictScalars_apply
code: /--
Given `R`-module X and `S`-module Y and a map `g : (extendScalars f).obj X ⟶ Y`, i.e. `S`-linear
map `S ⨂ X → Y`, there is a `X ⟶ (restrictScalars f).obj Y`, i.e. `R`-linear map `X ⟶ Y` by
`x ↦ g (1 ⊗ x)`.
-/
@[simps apply]
def HomEquiv.toRestrictScalars {X Y} (g : (extendScalars f).obj X ⟶ Y) :
    X ⟶ (restrictScalars f).obj Y 
goal: (ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.toRestrictScalars f g) x = g (1 ⊗ₜ[R] x)

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.evalAt_apply
code: /--
The map `S → X →ₗ[R] Y` given by `fun s x => s • (g x)`
-/
@[simps]
def HomEquiv.evalAt {X : ModuleCat R} {Y : ModuleCat S} (s : S)
    (g : X ⟶ (restrictScalars f).obj Y) : have : Module R Y := Module.compHom Y f
    X →ₗ[R] Y 
goal: (ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.evalAt f s g) x = s • g x

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.evalAt
code: /--
The map `S → X →ₗ[R] Y` given by `fun s x => s • (g x)`
-/
@[simps]
def HomEquiv.evalAt {X : ModuleCat R} {Y : ModuleCat S} (s : S)
    (g : X ⟶ (restrictScalars f).obj Y) : have : Module R Y := Module.compHom Y f
    X →ₗ[R] Y 
goal: let_fun this := Module.compHom (↑Y) f;
↑X →ₗ[R] ↑Y

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars_apply
code: /--
Given `R`-module X and `S`-module Y and a map `X ⟶ (restrictScalars f).obj Y`, i.e `R`-linear map
`X ⟶ Y`, there is a map `(extend_scalars f).obj X ⟶ Y`, i.e `S`-linear map `S ⨂ X → Y` by
`s ⊗ x ↦ s • g x`.
-/
@[simps apply]
def HomEquiv.fromExtendScalars {X Y} (g : X ⟶ (restrictScalars f).obj Y) :
    (extendScalars f).obj X ⟶ Y 
goal: (ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars f g) z =
  (TensorProduct.lift
      { toFun := fun s => ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.evalAt f s g, map_add' := ⋯, map_smul' := ⋯ })
    z

full_name: ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars
code: /--
Given `R`-module X and `S`-module Y and a map `X ⟶ (restrictScalars f).obj Y`, i.e `R`-linear map
`X ⟶ Y`, there is a map `(extend_scalars f).obj X ⟶ Y`, i.e `S`-linear map `S ⨂ X → Y` by
`s ⊗ x ↦ s • g x`.
-/
@[simps apply]
def HomEquiv.fromExtendScalars {X Y} (g : X ⟶ (restrictScalars f).obj Y) :
    (extendScalars f).obj X ⟶ Y 
goal: (ModuleCat.extendScalars f).obj X ⟶ Y

full_name: ModuleCat.ExtendRestrictScalarsAdj.homEquiv_symm_apply
code: /-- Given `R`-module X and `S`-module Y, `S`-linear linear maps `(extendScalars f).obj X ⟶ Y`
bijectively correspond to `R`-linear maps `X ⟶ (restrictScalars f).obj Y`.
-/
@[simps symm_apply]
def homEquiv {X Y} :
    ((extendScalars f).obj X ⟶ Y) ≃ (X ⟶ (restrictScalars.{max v u₂,u₁,u₂} f).obj Y) 
goal: (ModuleCat.ExtendRestrictScalarsAdj.homEquiv f).symm g =
  ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars f g

full_name: ModuleCat.ExtendRestrictScalarsAdj.homEquiv
code: /-- Given `R`-module X and `S`-module Y, `S`-linear linear maps `(extendScalars f).obj X ⟶ Y`
bijectively correspond to `R`-linear maps `X ⟶ (restrictScalars f).obj Y`.
-/
@[simps symm_apply]
def homEquiv {X Y} :
    ((extendScalars f).obj X ⟶ Y) ≃ (X ⟶ (restrictScalars.{max v u₂,u₁,u₂} f).obj Y) 
goal: ((ModuleCat.extendScalars f).obj X ⟶ Y) ≃ (X ⟶ (ModuleCat.restrictScalars f).obj Y)

full_name: ModuleCat.ExtendRestrictScalarsAdj.Unit.map
code: /--
For any `R`-module X, there is a natural `R`-linear map from `X` to `X ⨂ S` by sending `x ↦ x ⊗ 1`
-/
-- @[simps] Porting note: not in normal form and not used
def Unit.map {X} : X ⟶ (extendScalars f ⋙ restrictScalars f).obj X 
goal: X ⟶ (ModuleCat.extendScalars f ⋙ ModuleCat.restrictScalars f).obj X

full_name: ModuleCat.ExtendRestrictScalarsAdj.unit
code: /--
The natural transformation from identity functor on `R`-module to the composition of extension and
restriction of scalars.
-/
@[simps]
def unit : 𝟭 (ModuleCat R) ⟶ extendScalars f ⋙ restrictScalars.{max v u₂,u₁,u₂} f 
goal: 𝟭 (ModuleCat R) ⟶ ModuleCat.extendScalars f ⋙ ModuleCat.restrictScalars f

full_name: ModuleCat.ExtendRestrictScalarsAdj.unit_app
code: /--
The natural transformation from identity functor on `R`-module to the composition of extension and
restriction of scalars.
-/
@[simps]
def unit : 𝟭 (ModuleCat R) ⟶ extendScalars f ⋙ restrictScalars.{max v u₂,u₁,u₂} f 
goal: ∀ (x : ModuleCat R), (ModuleCat.ExtendRestrictScalarsAdj.unit f).app x = ModuleCat.ExtendRestrictScalarsAdj.Unit.map f

full_name: ModuleCat.ExtendRestrictScalarsAdj.Counit.map_apply
code: /-- For any `S`-module Y, there is a natural `R`-linear map from `S ⨂ Y` to `Y` by
`s ⊗ y ↦ s • y` -/
@[simps apply]
def Counit.map {Y} : (restrictScalars f ⋙ extendScalars f).obj Y ⟶ Y 
goal: (ModuleCat.ExtendRestrictScalarsAdj.Counit.map f) a =
  (TensorProduct.lift
      { toFun := fun s => { toFun := fun y => s • y, map_add' := ⋯, map_smul' := ⋯ }, map_add' := ⋯, map_smul' := ⋯ })
    a

full_name: ModuleCat.ExtendRestrictScalarsAdj.Counit.map
code: /-- For any `S`-module Y, there is a natural `R`-linear map from `S ⨂ Y` to `Y` by
`s ⊗ y ↦ s • y` -/
@[simps apply]
def Counit.map {Y} : (restrictScalars f ⋙ extendScalars f).obj Y ⟶ Y 
goal: (ModuleCat.restrictScalars f ⋙ ModuleCat.extendScalars f).obj Y ⟶ Y

full_name: ModuleCat.ExtendRestrictScalarsAdj.counit_app
code: /-- The natural transformation from the composition of restriction and extension of scalars to the
identity functor on `S`-module.
-/
@[simps app]
def counit : restrictScalars.{max v u₂,u₁,u₂} f ⋙ extendScalars f ⟶ 𝟭 (ModuleCat S) 
goal: ∀ (x : ModuleCat S),
  (ModuleCat.ExtendRestrictScalarsAdj.counit f).app x = ModuleCat.ExtendRestrictScalarsAdj.Counit.map f

full_name: ModuleCat.ExtendRestrictScalarsAdj.counit
code: /-- The natural transformation from the composition of restriction and extension of scalars to the
identity functor on `S`-module.
-/
@[simps app]
def counit : restrictScalars.{max v u₂,u₁,u₂} f ⋙ extendScalars f ⟶ 𝟭 (ModuleCat S) 
goal: ModuleCat.restrictScalars f ⋙ ModuleCat.extendScalars f ⟶ 𝟭 (ModuleCat S)

full_name: ModuleCat.extendRestrictScalarsAdj
code: /-- Given commutative rings `R, S` and a ring hom `f : R →+* S`, the extension and restriction of
scalars by `f` are adjoint to each other.
-/
-- @[simps] -- Porting note: removed not in normal form and not used
def extendRestrictScalarsAdj {R : Type u₁} {S : Type u₂} [CommRing R] [CommRing S] (f : R →+* S) :
    extendScalars.{u₁,u₂,max v u₂} f ⊣ restrictScalars.{max v u₂,u₁,u₂} f 
goal: ModuleCat.extendScalars f ⊣ ModuleCat.restrictScalars f

full_name: ModuleCat.instIsLeftAdjointExtendScalars
code: instance {R : Type u₁} {S : Type u₂} [CommRing R] [CommRing S] (f : R →+* S) :
    (extendScalars.{u₁, u₂, max u₂ w} f).IsLeftAdjoint 
goal: (ModuleCat.extendScalars f).IsLeftAdjoint

full_name: ModuleCat.instIsRightAdjointRestrictScalars
code: instance {R : Type u₁} {S : Type u₂} [CommRing R] [CommRing S] (f : R →+* S) :
    (restrictScalars.{max u₂ w, u₁, u₂} f).IsRightAdjoint 
goal: (ModuleCat.restrictScalars f).IsRightAdjoint

full_name: ModuleCat.preservesLimitRestrictScalars
code: noncomputable instance preservesLimitRestrictScalars
    {R : Type*} {S : Type*} [Ring R] [Ring S] (f : R →+* S) {J : Type*} [Category J]
    (F : J ⥤ ModuleCat.{v} S) [Small.{v} (F ⋙ forget _).sections] :
    PreservesLimit F (restrictScalars f) 
goal: CategoryTheory.Limits.PreservesLimit F (ModuleCat.restrictScalars f)

full_name: ModuleCat.preservesColimitRestrictScalars
code: instance preservesColimitRestrictScalars {R S : Type*} [Ring R] [Ring S]
    (f : R →+* S) {J : Type*} [Category J] (F : J ⥤ ModuleCat.{v} S)
    [HasColimit (F ⋙ forget₂ _ AddCommGrp)] :
    PreservesColimit F (ModuleCat.restrictScalars.{v} f) 
goal: CategoryTheory.Limits.PreservesColimit F (ModuleCat.restrictScalars f)