Module docstring
{"# Module structure and endomorphisms
In this file, we define Module.toAddMonoidEnd, which is (•) as a monoid homomorphism.
We use this to prove some results on scalar multiplication by integers.
"}
{"# Module structure and endomorphisms
In this file, we define Module.toAddMonoidEnd, which is (•) as a monoid homomorphism.
We use this to prove some results on scalar multiplication by integers.
"}
AddMonoid.End.natCast_def
theorem
(n : ℕ) : (↑n : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℕ M n
theorem AddMonoid.End.natCast_def (n : ℕ) :
(↑n : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℕ M n :=
rfl
Module.toAddMonoidEnd
definition
: R →+* AddMonoid.End M
/-- `(•)` as an `AddMonoidHom`.
This is a stronger version of `DistribMulAction.toAddMonoidEnd` -/
@[simps! apply_apply]
def Module.toAddMonoidEnd : R →+* AddMonoid.End M :=
{ DistribMulAction.toAddMonoidEnd R M with
map_zero' := AddMonoidHom.ext fun r => by simp
map_add' x y :=
AddMonoidHom.ext fun r => by simp [(AddMonoidHom.add_apply), add_smul] }
smulAddHom
definition
: R →+ M →+ M
/-- A convenience alias for `Module.toAddMonoidEnd` as an `AddMonoidHom`, usually to allow the
use of `AddMonoidHom.flip`. -/
def smulAddHom : R →+ M →+ M :=
(Module.toAddMonoidEnd R M).toAddMonoidHom
smulAddHom_apply
theorem
: smulAddHom R M r x = r • x
@[simp]
theorem smulAddHom_apply : smulAddHom R M r x = r • x :=
rfl
IsAddUnit.smul_left
theorem
[Monoid S] [DistribMulAction S M] (hx : IsAddUnit x) (s : S) : IsAddUnit (s • x)
lemma IsAddUnit.smul_left [Monoid S] [DistribMulAction S M] (hx : IsAddUnit x) (s : S) :
IsAddUnit (s • x) :=
hx.map (DistribMulAction.toAddMonoidHom M s)
IsAddUnit.smul_right
theorem
(hr : IsAddUnit r) : IsAddUnit (r • x)
lemma IsAddUnit.smul_right (hr : IsAddUnit r) : IsAddUnit (r • x) :=
hr.map (AddMonoidHom.flip (smulAddHom R M) x)
AddMonoid.End.intCast_def
theorem
(z : ℤ) : (↑z : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℤ M z
theorem AddMonoid.End.intCast_def (z : ℤ) :
(↑z : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℤ M z :=
rfl
Int.cast_smul_eq_zsmul
theorem
(n : ℤ) (b : M) : (n : R) • b = n • b
/-- `zsmul` is equal to any other module structure via a cast. -/
@[norm_cast]
lemma Int.cast_smul_eq_zsmul (n : ℤ) (b : M) : (n : R) • b = n • b :=
have : ((smulAddHom R M).flip b).comp (Int.castAddHom R) = (smulAddHom ℤ M).flip b := by
apply AddMonoidHom.ext_int
simp
DFunLike.congr_fun this n
int_smul_eq_zsmul
theorem
(h : Module ℤ M) (n : ℤ) (x : M) : @SMul.smul ℤ M h.toSMul n x = n • x
/-- Convert back any exotic `ℤ`-smul to the canonical instance. This should not be needed since in
mathlib all `AddCommGroup`s should normally have exactly one `ℤ`-module structure by design. -/
theorem int_smul_eq_zsmul (h : Module ℤ M) (n : ℤ) (x : M) : @SMul.smul ℤ M h.toSMul n x = n • x :=
Int.cast_smul_eq_zsmul ..
AddCommGroup.uniqueIntModule
definition
: Unique (Module ℤ M)
/-- All `ℤ`-module structures are equal. Not an instance since in mathlib all `AddCommGroup`
should normally have exactly one `ℤ`-module structure by design. -/
def AddCommGroup.uniqueIntModule : Unique (Module ℤ M) where
default := by infer_instance
uniq P := (Module.ext' P _) fun n => by convert int_smul_eq_zsmul P n
map_intCast_smul
theorem
[AddCommGroup M] [AddCommGroup M₂] {F : Type*} [FunLike F M M₂] [AddMonoidHomClass F M M₂] (f : F) (R S : Type*)
[Ring R] [Ring S] [Module R M] [Module S M₂] (x : ℤ) (a : M) : f ((x : R) • a) = (x : S) • f a
theorem map_intCast_smul [AddCommGroup M] [AddCommGroup M₂] {F : Type*} [FunLike F M M₂]
[AddMonoidHomClass F M M₂] (f : F) (R S : Type*) [Ring R] [Ring S] [Module R M] [Module S M₂]
(x : ℤ) (a : M) :
f ((x : R) • a) = (x : S) • f a := by simp only [Int.cast_smul_eq_zsmul, map_zsmul]
AddCommGroup.intIsScalarTower
instance
{R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M] : IsScalarTower ℤ R M
instance AddCommGroup.intIsScalarTower {R : Type u} {M : Type v} [Ring R] [AddCommGroup M]
[Module R M] : IsScalarTower ℤ R M where
smul_assoc n x y := ((smulAddHom R M).flip y).map_zsmul x n