The areas / V07. Linear algebra
Mathlib.Algebra.Module.Defs
25 declarations. Mathlib docs · Source
Modules over a ring
In this file we define
Module R M: an additive commutative monoidMis aModuleover aSemiring Rif forr : Randx : Mtheir "scalar multiplication"r • x : Mis defined, and the operation•satisfies some natural associativity and distributivity axioms similar to those on a ring.
Implementation notes
In typical mathematical usage, our definition of Module corresponds to "semimodule", and the
word "module" is reserved for Module R M where R is a Ring and M an AddCommGroup.
If R is a Field and M an AddCommGroup, M would be called an R-vector space.
Since those assumptions can be made by changing the typeclasses applied to R and M,
without changing the axioms in Module, mathlib calls everything a Module.
In older versions of mathlib3, we had separate abbreviations for semimodules and vector spaces.
This caused inference issues in some cases, while not providing any real advantages, so we decided
to use a canonical Module typeclass throughout.
Tags
semimodule, module, vector space
def Module.ctorIdx E1 #
{R : Type u} → {M : Type v} → {inst : Semiring R} → {inst_1 : AddCommMonoid M} → Module R M → ℕ
class Module E3 #
(R : Type u) → (M : Type v) → [Semiring R] → [AddCommMonoid M] → Type (max u v)
A module is a generalization of vector spaces to a scalar semiring.
It consists of a scalar semiring R and an additive monoid of "vectors" M,
connected by a "scalar multiplication" operation r • x : M
(where r : R and x : M) with some natural associativity and
distributivity axioms similar to those on a ring.
theorem Module.ext E1 #
∀ {R : Type u} {M : Type v} {inst : Semiring R} {inst_1 : AddCommMonoid M} {x y : Module R M},
SMul.smul = SMul.smul → x = y
theorem Module.ext_iff E0 #
∀ {R : Type u} {M : Type v} {inst : Semiring R} {inst_1 : AddCommMonoid M} {x y : Module R M},
x = y ↔ SMul.smul = SMul.smul
ctor Module.mk E0 #
{R : Type u} →
{M : Type v} →
[inst : Semiring R] →
[inst_1 : AddCommMonoid M] →
[toDistribMulAction : DistribMulAction R M] →
(∀ (r s : R) (x : M), (r + s) • x = r • x + s • x) → (∀ (x : M), 0 • x = 0) → Module R M
instance Module.toDistribMulAction E0 #
{R : Type u} →
{M : Type v} → {inst : Semiring R} → {inst_1 : AddCommMonoid M} → [self : Module R M] → DistribMulAction R M
theorem Module.add_smul E1 #
∀ {R : Type u} {M : Type v} {inst : Semiring R} {inst_1 : AddCommMonoid M} [self : Module R M] (r s : R) (x : M),
(r + s) • x = r • x + s • x
Scalar multiplication distributes over addition from the right.
theorem Module.zero_smul E1 #
∀ {R : Type u} {M : Type v} {inst : Semiring R} {inst_1 : AddCommMonoid M} [self : Module R M] (x : M), 0 • x = 0
Scalar multiplication by zero gives zero.
instance Module.toMulActionWithZero E0 #
{R : Type u_4} → {M : Type u_5} → {x : Semiring R} → {x_1 : AddCommMonoid M} → [Module R M] → MulActionWithZero R M
A module over a semiring automatically inherits a MulActionWithZero structure.
theorem add_smul E1 #
∀ {R : Type u_1} {M : Type u_2} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M] (r s : R) (x : M),
(r + s) • x = r • x + s • x
theorem Convex.combo_self E1 #
∀ {R : Type u_1} {M : Type u_2} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M] {a b : R},
a + b = 1 → ∀ (x : M), a • x + b • x = x
theorem two_smul E1 #
∀ (R : Type u_1) {M : Type u_2} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M] (x : M),
2 • x = x + x
abbrev Function.Injective.module E1 #
(R : Type u_1) →
{M : Type u_2} →
{M₂ : Type u_3} →
[inst : Semiring R] →
[inst_1 : AddCommMonoid M] →
[inst_2 : Module R M] →
[inst_3 : AddCommMonoid M₂] →
[inst_4 : SMul R M₂] →
(f : M₂ →+ M) → Function.Injective ⇑f → (∀ (c : R) (x : M₂), f (c • x) = c • f x) → Module R M₂
Pullback a Module structure along an injective additive monoid homomorphism.
See note [reducible non-instances].
abbrev Function.Surjective.module E1 #
(R : Type u_1) →
{M : Type u_2} →
{M₂ : Type u_3} →
[inst : Semiring R] →
[inst_1 : AddCommMonoid M] →
[inst_2 : Module R M] →
[inst_3 : AddCommMonoid M₂] →
[inst_4 : SMul R M₂] →
(f : M →+ M₂) → Function.Surjective ⇑f → (∀ (c : R) (x : M), f (c • x) = c • f x) → Module R M₂
Pushforward a Module structure along a surjective additive monoid homomorphism.
See note [reducible non-instances].
theorem smul_add_one_sub_smul E0 #
∀ {M : Type u_2} [inst : AddCommMonoid M] {R : Type u_4} [inst_1 : Ring R] [inst_2 : Module R M] {r : R} {m : M},
r • m + (1 - r) • m = m
theorem Convex.combo_eq_smul_sub_add E1 #
∀ {R : Type u_1} {M : Type u_2} [inst : Semiring R] [inst_1 : AddCommGroup M] [inst_2 : Module R M] {x y : M} {a b : R},
a + b = 1 → a • x + b • y = b • (y - x) + x
theorem Module.ext' E1 #
∀ {R : Type u_4} [inst : Semiring R] {M : Type u_5} [inst_1 : AddCommMonoid M] (P Q : Module R M),
(∀ (r : R) (m : M), r • m = r • m) → P = Q
A variant of Module.ext that's convenient for term-mode.
theorem neg_smul E0 #
∀ {R : Type u_1} {M : Type u_2} [inst : Ring R] [inst_1 : AddCommGroup M] [inst_2 : Module R M] (r : R) (x : M),
-r • x = -(r • x)
theorem neg_smul_neg E1 #
∀ {R : Type u_1} {M : Type u_2} [inst : Ring R] [inst_1 : AddCommGroup M] [inst_2 : Module R M] (r : R) (x : M),
-r • -x = r • x
theorem neg_one_smul E1 #
∀ (R : Type u_1) {M : Type u_2} [inst : Ring R] [inst_1 : AddCommGroup M] [inst_2 : Module R M] (x : M), -1 • x = -x
theorem sub_smul E1 #
∀ {R : Type u_1} {M : Type u_2} [inst : Ring R] [inst_1 : AddCommGroup M] [inst_2 : Module R M] (r s : R) (y : M),
(r - s) • y = r • y - s • y
theorem Module.subsingleton E1 #
∀ (R : Type u_4) (M : Type u_5) [inst : MonoidWithZero R] [Subsingleton R] [inst_2 : Zero M] [MulActionWithZero R M],
Subsingleton M
A module over a Subsingleton semiring is a Subsingleton. We cannot register this
as an instance because Lean has no way to guess R.
theorem Module.nontrivial E1 #
∀ (R : Type u_4) (M : Type u_5) [inst : MonoidWithZero R] [Nontrivial M] [inst_2 : Zero M] [MulActionWithZero R M],
Nontrivial R
A semiring is Nontrivial provided that there exists a nontrivial module over this semiring.
instance Semiring.toModule E0 #
{R : Type u_1} → [inst : Semiring R] → Module R R
instance instDistribSMul E0 #
{R : Type u_1} → [inst : NonUnitalNonAssocSemiring R] → DistribSMul R R