The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.Algebra.Defs
62 declarations. Mathlib docs · Source
Algebras over commutative semirings
In this file we define associative unital Algebras over commutative (semi)rings.
-
algebra homomorphisms
AlgHomare defined inMathlib/Algebra/Algebra/Hom.lean; -
algebra equivalences
AlgEquivare defined inMathlib/Algebra/Algebra/Equiv.lean; -
Subalgebras are defined inMathlib/Algebra/Algebra/Subalgebra/Basic.lean; -
The category
AlgCat RofR-algebras is defined in the fileMathlib/Algebra/Category/AlgCat/Basic.lean.
See the implementation notes for remarks about non-associative and non-unital algebras.
Main definitions
Algebra R A: the algebra typeclass.algebraMap R A : R →+* A: the canonical map fromRtoA, as aRingHom. This is the preferred spelling of this map, it is also available as:Algebra.linearMap R A : R →ₗ[R] A, aLinearMap.Algebra.ofId R A : R →ₐ[R] A, anAlgHom(defined in a later file).
Implementation notes
Given a commutative (semi)ring R, there are two ways to define an R-algebra structure on a
(possibly noncommutative) (semi)ring A:
- By endowing
Awith a morphism of ringsR →+* AdenotedalgebraMap R Awhich lands in the center ofA. - By requiring
Abe anR-module such that the action associates and commutes with multiplication asr • (a₁ * a₂) = (r • a₁) * a₂ = a₁ * (r • a₂).
We define Algebra R A in a way that subsumes both definitions, by extending SMul R A and
requiring that this scalar action r • x must agree with left multiplication by the image of the
structure morphism algebraMap R A r * x.
As a result, there are two ways to talk about an R-algebra A when A is a semiring:
-
variable [CommSemiring R] [Semiring A] variable [Algebra R A] -
variable [CommSemiring R] [Semiring A] variable [Module R A] [SMulCommClass R A A] [IsScalarTower R A A]
The first approach implies the second via typeclass search; so any lemma stated with the second set of arguments will automatically apply to the first set. Typeclass search does not know that the second approach implies the first, but this can be shown with:
example {R A : Type*} [CommSemiring R] [Semiring A]
[Module R A] [SMulCommClass R A A] [IsScalarTower R A A] : Algebra R A :=
Algebra.ofModule smul_mul_assoc mul_smul_comm
The advantage of the first approach is that algebraMap R A is available, and AlgHom R A B and
Subalgebra R A can be used. For concrete R and A, algebraMap R A is often definitionally
convenient.
The advantage of the second approach is that CommSemiring R, Semiring A, and Module R A can
all be relaxed independently; for instance, this allows us to:
- Replace
Semiring AwithNonUnitalNonAssocSemiring Ain order to describe non-unital and/or non-associative algebras. - Replace
CommSemiring RandModule R AwithCommGroup R'andDistribMulAction R' A, which whenR' = Rˣlets us talk about the "algebra-like" action ofRˣon anR-algebraA.
While AlgHom R A B cannot be used in the second approach, NonUnitalAlgHom R A B still can.
You should always use the first approach when working with associative unital algebras, and mimic
the second approach only when you need to weaken a condition on either R or A.
theorem RingHom.mk.congr_simp E1 #
∀ {α : Type u_5} {β : Type u_6} [inst : NonAssocSemiring α] [inst_1 : NonAssocSemiring β]
(toMonoidHom toMonoidHom_1 : α →* β) (e_toMonoidHom : toMonoidHom = toMonoidHom_1)
(map_zero' : (↑toMonoidHom).toFun 0 = 0)
(map_add' : ∀ (x y : α), (↑toMonoidHom).toFun (x + y) = (↑toMonoidHom).toFun x + (↑toMonoidHom).toFun y),
{ toMonoidHom := toMonoidHom, map_zero' := map_zero', map_add' := map_add' } =
{ toMonoidHom := toMonoidHom_1, map_zero' := ⋯, map_add' := ⋯ }
def Algebra.ctorIdx E1 #
{R : Type u} → {A : Type v} → {inst : CommSemiring R} → {inst_1 : Semiring A} → Algebra R A → ℕ
class Algebra E3 #
(R : Type u) → (A : Type v) → [CommSemiring R] → [Semiring A] → Type (max u v)
An associative unital R-algebra is a semiring A equipped with a map into its center R → A.
See the implementation notes in this file for discussion of the details of this definition.
instance Algebra.toSMul E0 #
{R : Type u} → {A : Type v} → {inst : CommSemiring R} → {inst_1 : Semiring A} → [self : Algebra R A] → SMul R A
ctor Algebra.mk E0 #
{R : Type u} →
{A : Type v} →
[inst : CommSemiring R] →
[inst_1 : Semiring A] →
[toSMul : SMul R A] →
(algebraMap : R →+* A) →
(∀ (r : R) (x : A), algebraMap r * x = x * algebraMap r) →
(∀ (r : R) (x : A), r • x = algebraMap r * x) → Algebra R A
abbrev Algebra.algebraMap E1 #
(R : Type u) → (A : Type v) → {inst : CommSemiring R} → {inst_1 : Semiring A} → [self : Algebra R A] → R →+* A
Embedding R →+* A given by Algebra structure.
theorem Algebra.commutes' E1 #
∀ {R : Type u} {A : Type v} {inst : CommSemiring R} {inst_1 : Semiring A} [self : Algebra R A] (r : R) (x : A),
(algebraMap R A) r * x = x * (algebraMap R A) r
theorem Algebra.smul_def' E1 #
∀ {R : Type u} {A : Type v} {inst : CommSemiring R} {inst_1 : Semiring A} [self : Algebra R A] (r : R) (x : A),
r • x = (algebraMap R A) r * x
theorem Algebra.subsingleton E1 #
∀ (R : Type u) (A : Type v) [inst : CommSemiring R] [inst_1 : Semiring A] [Algebra R A] [Subsingleton R], Subsingleton A
def Algebra.cast E1 #
{R : Type u_1} → {A : Type u_2} → [inst : CommSemiring R] → [inst_1 : Semiring A] → [Algebra R A] → R → A
Coercion from a commutative semiring to an algebra over this semiring.
def algebraMap.coeHTCT E1 #
(R : Type u_1) → (A : Type u_2) → [inst : CommSemiring R] → [inst_1 : Semiring A] → [Algebra R A] → CoeHTCT R A
theorem algebraMap.coe_zero E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A], ↑0 = 0
theorem algebraMap.coe_one E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A], ↑1 = 1
theorem algebraMap.coe_natCast E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (a : ℕ), ↑↑a = ↑a
theorem algebraMap.coe_add E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (a b : R),
↑(a + b) = ↑a + ↑b
theorem algebraMap.coe_mul E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (a b : R),
↑(a * b) = ↑a * ↑b
theorem algebraMap.coe_pow E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (a : R) (n : ℕ),
↑(a ^ n) = ↑a ^ n
theorem algebraMap.coe_neg E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommRing R] [inst_1 : Ring A] [inst_2 : Algebra R A] (x : R), ↑(-x) = -↑x
theorem algebraMap.coe_sub E0 #
∀ {R : Type u_1} {A : Type u_2} [inst : CommRing R] [inst_1 : Ring A] [inst_2 : Algebra R A] (a b : R),
↑(a - b) = ↑a - ↑b
abbrev RingHom.toAlgebra' E1 #
{R : Type u_1} →
{S : Type u_2} →
[inst : CommSemiring R] →
[inst_1 : Semiring S] → (i : R →+* S) → (∀ (c : R) (x : S), i c * x = x * i c) → Algebra R S
Creating an algebra from a morphism to the center of a semiring. See note [reducible non-instances].
Warning: In general this should not be used if S already has a SMul R S
instance, since this creates another SMul R S instance from the supplied RingHom and
this will likely create a diamond.
theorem RingHom.smul_toAlgebra' E1 #
∀ {R : Type u_1} {S : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring S] (i : R →+* S)
(h : ∀ (c : R) (x : S), i c * x = x * i c) (r : R) (s : S),
have x := i.toAlgebra' h;
r • s = i r * s
theorem RingHom.algebraMap_toAlgebra' E1 #
∀ {R : Type u_1} {S : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring S] (i : R →+* S)
(h : ∀ (c : R) (x : S), i c * x = x * i c), algebraMap R S = i
abbrev RingHom.toAlgebra E1 #
{R : Type u_1} → {S : Type u_2} → [inst : CommSemiring R] → [inst_1 : CommSemiring S] → (R →+* S) → Algebra R S
Creating an algebra from a morphism to a commutative semiring. See note [reducible non-instances].
Warning: In general this should not be used if S already has a SMul R S
instance, since this creates another SMul R S instance from the supplied RingHom and
this will likely create a diamond.
theorem RingHom.smul_toAlgebra E1 #
∀ {R : Type u_1} {S : Type u_2} [inst : CommSemiring R] [inst_1 : CommSemiring S] (i : R →+* S) (r : R) (s : S),
have x := i.toAlgebra;
r • s = i r * s
theorem RingHom.algebraMap_toAlgebra E1 #
∀ {R : Type u_1} {S : Type u_2} [inst : CommSemiring R] [inst_1 : CommSemiring S] (i : R →+* S), algebraMap R S = i
abbrev Algebra.ofModule' E1 #
{R : Type u} →
{A : Type w} →
[inst : CommSemiring R] →
[inst_1 : Semiring A] →
[inst_2 : Module R A] →
(∀ (r : R) (x : A), r • 1 * x = r • x) → (∀ (r : R) (x : A), x * r • 1 = r • x) → Algebra R A
Let R be a commutative semiring, let A be a semiring with a Module R structure.
If (r • 1) * x = x * (r • 1) = r • x for all r : R and x : A, then A is an Algebra
over R.
See note [reducible non-instances].
abbrev Algebra.ofModule E1 #
{R : Type u} →
{A : Type w} →
[inst : CommSemiring R] →
[inst_1 : Semiring A] →
[inst_2 : Module R A] →
(∀ (r : R) (x y : A), r • x * y = r • (x * y)) → (∀ (r : R) (x y : A), x * r • y = r • (x * y)) → Algebra R A
Let R be a commutative semiring, let A be a semiring with a Module R structure.
If (r • x) * y = x * (r • y) = r • (x * y) for all r : R and x y : A, then A
is an Algebra over R.
See note [reducible non-instances].
theorem Algebra.algebra_ext E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A] (P Q : Algebra R A),
(∀ (r : R), (algebraMap R A) r = (algebraMap R A) r) → P = Q
To prove two algebra structures on a fixed [CommSemiring R] [Semiring A] agree,
it suffices to check the algebraMaps agree.
theorem Algebra.algebra_ext_iff E0 #
∀ {R : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A] {P Q : Algebra R A},
P = Q ↔ ∀ (r : R), (algebraMap R A) r = (algebraMap R A) r
theorem toAlgebra_algebraMap E1 #
∀ {R : Type u} {S : Type v} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Algebra R S],
(algebraMap R S).toAlgebra = inst_2
An auxiliary lemma used to prove theorems of the form
RingHom.X (algebraMap R S) ↔ Algebra.X R S.
instance Algebra.toModule E0 #
{R : Type u_1} → {A : Type u_2} → {x : CommSemiring R} → {x_1 : Semiring A} → [Algebra R A] → Module R A
theorem Algebra.smul_def E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R) (x : A),
r • x = (algebraMap R A) r * x
theorem Algebra.algebraMap_eq_smul_one E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R),
(algebraMap R A) r = r • 1
theorem Algebra.algebraMap_eq_smul_one' E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A],
⇑(algebraMap R A) = fun r ↦ r • 1
theorem Algebra.commutes E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R) (x : A),
(algebraMap R A) r * x = x * (algebraMap R A) r
mul_comm for Algebras when one element is from the base ring.
theorem Algebra.commute_algebraMap_left E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R) (x : A),
Commute ((algebraMap R A) r) x
theorem Algebra.commute_algebraMap_right E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R) (x : A),
Commute x ((algebraMap R A) r)
theorem Algebra.left_comm E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (x : A) (r : R)
(y : A), x * ((algebraMap R A) r * y) = (algebraMap R A) r * (x * y)
mul_left_comm for Algebras when one element is from the base ring.
theorem Algebra.right_comm E1 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (x : A) (r : R)
(y : A), x * (algebraMap R A) r * y = x * y * (algebraMap R A) r
mul_right_comm for Algebras when one element is from the base ring.
instance IsScalarTower.right E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A], IsScalarTower R A A
This has high priority because it is almost always the right instance when it applies.
theorem RingHom.smulOneHom_eq_algebraMap E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A],
RingHom.smulOneHom = algebraMap R A
theorem Algebra.mul_smul_comm E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (s : R) (x y : A),
x * s • y = s • (x * y)
This is just a special case of the global mul_smul_comm lemma that requires less typeclass
search (and was here first).
theorem Algebra.smul_mul_assoc E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R) (x y : A),
r • x * y = r • (x * y)
This is just a special case of the global smul_mul_assoc lemma that requires less typeclass
search (and was here first).
theorem smul_algebraMap E0 #
∀ {R : Type u} {A : Type w} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] {α : Type u_1}
[inst_3 : Monoid α] [inst_4 : MulDistribMulAction α A] [SMulCommClass α R A] (a : α) (r : R),
a • (algebraMap R A) r = (algebraMap R A) r
abbrev Algebra.compHom E1 #
{R : Type u} →
{S : Type v} →
(A : Type w) →
[inst : CommSemiring R] →
[inst_1 : CommSemiring S] → [inst_2 : Semiring A] → [Algebra R A] → (S →+* R) → Algebra S A
Compose an Algebra with a RingHom, with action f s • m.
This is the algebra version of Module.compHom.
theorem Algebra.compHom_smul_def E0 #
∀ {R : Type u} {S : Type v} (A : Type w) [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Semiring A]
[inst_3 : Algebra R A] (f : S →+* R) (s : S) (x : A), s • x = f s • x
theorem Algebra.compHom_algebraMap_eq E0 #
∀ {R : Type u} {S : Type v} (A : Type w) [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Semiring A]
[inst_3 : Algebra R A] (f : S →+* R), algebraMap S A = (algebraMap R A).comp f
theorem Algebra.compHom_algebraMap_apply E0 #
∀ {R : Type u} {S : Type v} (A : Type w) [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Semiring A]
[inst_3 : Algebra R A] (f : S →+* R) (s : S), (algebraMap S A) s = (algebraMap R A) (f s)
def Algebra.linearMap E1 #
(R : Type u) → (A : Type w) → [inst : CommSemiring R] → [inst_1 : Semiring A] → [inst_2 : Algebra R A] → R →ₗ[R] A
The canonical ring homomorphism algebraMap R A : R →+* A for any R-algebra A,
packaged as an R-linear map.
def RingTheory.LinearMap.termη E1 #
Lean.ParserDescr
The canonical ring homomorphism algebraMap R A : R →+* A for any R-algebra A,
packaged as an R-linear map.
def RingTheory.LinearMap.«termη[_]» E1 #
Lean.ParserDescr
The canonical ring homomorphism algebraMap R A : R →+* A for any R-algebra A,
packaged as an R-linear map.
theorem Algebra.linearMap_apply E0 #
∀ (R : Type u) (A : Type w) [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A] (r : R),
(Algebra.linearMap R A) r = (algebraMap R A) r
theorem Algebra.coe_linearMap E0 #
∀ (R : Type u) (A : Type w) [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Algebra R A],
⇑(Algebra.linearMap R A) = ⇑(algebraMap R A)
instance Algebra.id E0 #
(R : Type u) → [inst : CommSemiring R] → Algebra R R
The identity map inducing an Algebra structure.
theorem Algebra.linearMap_self E0 #
∀ (R : Type u) [inst : CommSemiring R], Algebra.linearMap R R = LinearMap.id
theorem Algebra.algebraMap_self E0 #
∀ {R : Type u} [inst : CommSemiring R], algebraMap R R = RingHom.id R
theorem Algebra.algebraMap_self_apply E0 #
∀ {R : Type u} [inst : CommSemiring R] (x : R), (algebraMap R R) x = x
theorem algebraMap.coe_smul E0 #
∀ {A : Type u_1} {B : Type u_2} (a : A) (b : B) (C : Type u_3) [inst : SMul A B] [inst_1 : CommSemiring B]
[inst_2 : Semiring C] [inst_3 : Algebra B C] [inst_4 : SMul A C] [IsScalarTower A B C], ↑(a • b) = a • ↑b
theorem algebraMap.coe_smul' E0 #
∀ {A : Type u_1} {B : Type u_2} (a : A) (b : B) (C : Type u_3) [inst : SMul A B] [inst_1 : CommSemiring B]
[inst_2 : Semiring C] [inst_3 : Algebra B C] [inst_4 : Monoid A] [inst_5 : MulDistribMulAction A C]
[SMulDistribClass A B C], ↑(a • b) = a • ↑b
theorem algebraMap.smul E1 #
∀ {A : Type u_1} {B : Type u_2} (a : A) (b : B) (C : Type u_3) [inst : SMul A B] [inst_1 : CommSemiring B]
[inst_2 : Semiring C] [inst_3 : Algebra B C] [inst_4 : SMul A C] [IsScalarTower A B C],
(algebraMap B C) (a • b) = a • (algebraMap B C) b
theorem algebraMap.smul' E1 #
∀ {A : Type u_1} {B : Type u_2} (a : A) (b : B) (C : Type u_3) [inst : SMul A B] [inst_1 : CommSemiring B]
[inst_2 : Semiring C] [inst_3 : Algebra B C] [inst_4 : Monoid A] [inst_5 : MulDistribMulAction A C]
[SMulDistribClass A B C], (algebraMap B C) (a • b) = a • (algebraMap B C) b
abbrev IsUnital.toAlgebra E1 #
{R : Type u_1} →
{A : Type u_2} →
[inst : CommSemiring R] →
[inst_1 : NonUnitalSemiring A] →
[inst_2 : Module R A] → [IsScalarTower R A A] → [SMulCommClass R A A] → [inst_5 : IsUnital A] → Algebra R A
A unital non-unital algebra is an algebra.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.