The tensor product of R-algebras #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Let R
be a (semi)ring and A
an R
-algebra.
In this file we:
- Define the
A
-module structure onA ⊗ M
, for anR
-moduleM
. - Define the
R
-algebra structure onA ⊗ B
, for anotherR
-algebraB
. and provide the structure isomorphismsR ⊗[R] A ≃ₐ[R] A
A ⊗[R] R ≃ₐ[R] A
A ⊗[R] B ≃ₐ[R] B ⊗[R] A
((A ⊗[R] B) ⊗[R] C) ≃ₐ[R] (A ⊗[R] (B ⊗[R] C))
Main declaration #
linear_map.base_change A f
is theA
-linear mapA ⊗ f
, for anR
-linear mapf
.
Implementation notes #
The heterobasic definitions below such as:
tensor_product.algebra_tensor_module.curry
tensor_product.algebra_tensor_module.uncurry
tensor_product.algebra_tensor_module.lcurry
tensor_product.algebra_tensor_module.lift
tensor_product.algebra_tensor_module.lift.equiv
tensor_product.algebra_tensor_module.mk
tensor_product.algebra_tensor_module.assoc
are just more general versions of the definitions already in linear_algebra/tensor_product
. We
could thus consider replacing the less general definitions with these ones. If we do this, we
probably should still implement the less general ones as abbreviations to the more general ones with
fewer type arguments.
The A
-module structure on A ⊗[R] M
#
Heterobasic version of tensor_product.curry
:
Given a linear map M ⊗[R] N →[A] P
, compose it with the canonical
bilinear map M →[A] N →[R] M ⊗[R] N
to form a bilinear map M →[A] N →[R] P
.
Equations
- tensor_product.algebra_tensor_module.curry f = {to_fun := ⇑(tensor_product.curry (linear_map.restrict_scalars R f)), map_add' := _, map_smul' := _}
Just as tensor_product.ext
is marked ext
instead of tensor_product.ext'
, this is
a better ext
lemma than tensor_product.algebra_tensor_module.ext
below.
Heterobasic version of tensor_product.lift
:
Constructing a linear map M ⊗[R] N →[A] P
given a bilinear map M →[A] N →[R] P
with the
property that its composition with the canonical bilinear map M →[A] N →[R] M ⊗[R] N
is
the given bilinear map M →[A] N →[R] P
.
Equations
- tensor_product.algebra_tensor_module.lift f = {to_fun := (tensor_product.lift (linear_map.restrict_scalars R f)).to_fun, map_add' := _, map_smul' := _}
Heterobasic version of tensor_product.uncurry
:
Linearly constructing a linear map M ⊗[R] N →[A] P
given a bilinear map M →[A] N →[R] P
with the property that its composition with the canonical bilinear map M →[A] N →[R] M ⊗[R] N
is
the given bilinear map M →[A] N →[R] P
.
Equations
- tensor_product.algebra_tensor_module.uncurry R A M N P = {to_fun := tensor_product.algebra_tensor_module.lift _inst_13, map_add' := _, map_smul' := _}
Heterobasic version of tensor_product.lcurry
:
Given a linear map M ⊗[R] N →[A] P
, compose it with the canonical
bilinear map M →[A] N →[R] M ⊗[R] N
to form a bilinear map M →[A] N →[R] P
.
Equations
- tensor_product.algebra_tensor_module.lcurry R A M N P = {to_fun := tensor_product.algebra_tensor_module.curry _inst_13, map_add' := _, map_smul' := _}
Heterobasic version of tensor_product.lift.equiv
:
A linear equivalence constructing a linear map M ⊗[R] N →[A] P
given a
bilinear map M →[A] N →[R] P
with the property that its composition with the
canonical bilinear map M →[A] N →[R] M ⊗[R] N
is the given bilinear map M →[A] N →[R] P
.
Equations
- tensor_product.algebra_tensor_module.lift.equiv R A M N P = linear_equiv.of_linear (tensor_product.algebra_tensor_module.uncurry R A M N P) (tensor_product.algebra_tensor_module.lcurry R A M N P) _ _
Heterobasic version of tensor_product.mk
:
The canonical bilinear map M →[A] N →[R] M ⊗[R] N
.
Equations
- tensor_product.algebra_tensor_module.mk R A M N = {to_fun := (tensor_product.mk R M N).to_fun, map_add' := _, map_smul' := _}
Heterobasic version of tensor_product.assoc
:
Linear equivalence between (M ⊗[A] N) ⊗[R] P
and M ⊗[A] (N ⊗[R] P)
.
Equations
- tensor_product.algebra_tensor_module.assoc R A M N P = linear_equiv.of_linear (tensor_product.algebra_tensor_module.lift (⇑(tensor_product.uncurry A M P (N →ₗ[R] tensor_product A M (tensor_product R P N))) ((tensor_product.algebra_tensor_module.lcurry R A P N (tensor_product A M (tensor_product R P N))).comp (tensor_product.mk A M (tensor_product R P N))))) (⇑(tensor_product.uncurry A M (tensor_product R P N) (tensor_product R (tensor_product A M P) N)) ((tensor_product.algebra_tensor_module.uncurry R A P N (tensor_product R (tensor_product A M P) N)).comp (tensor_product.curry (tensor_product.algebra_tensor_module.mk R A (tensor_product A M P) N)))) _ _
The base-change of a linear map of R
-modules to a linear map of A
-modules #
base_change A f
for f : M →ₗ[R] N
is the A
-linear map A ⊗[R] M →ₗ[A] A ⊗[R] N
.
Equations
- linear_map.base_change A f = {to_fun := ⇑(linear_map.ltensor A f), map_add' := _, map_smul' := _}
base_change
as a linear map.
Equations
- linear_map.base_change_hom R A M N = {to_fun := linear_map.base_change A _inst_9, map_add' := _, map_smul' := _}
The R
-algebra structure on A ⊗[R] B
#
(Implementation detail)
The multiplication map on A ⊗[R] B
,
for a fixed pure tensor in the first argument,
as an R
-linear map.
Equations
- algebra.tensor_product.mul_aux a₁ b₁ = tensor_product.map (linear_map.mul_left R a₁) (linear_map.mul_left R b₁)
(Implementation detail)
The multiplication map on A ⊗[R] B
,
as an R
-bilinear map.
Equations
- algebra.tensor_product.mul = tensor_product.lift (linear_map.mk₂ R algebra.tensor_product.mul_aux algebra.tensor_product.mul._proof_3 algebra.tensor_product.mul._proof_4 algebra.tensor_product.mul._proof_5 algebra.tensor_product.mul._proof_6)
Equations
- algebra.tensor_product.tensor_product.semiring = {add := has_add.add (add_zero_class.to_has_add (tensor_product R A B)), add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := add_monoid_with_one.nsmul algebra.tensor_product.tensor_product.add_monoid_with_one, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := λ (a b : tensor_product R A B), ⇑(⇑algebra.tensor_product.mul a) b, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := 1, one_mul := _, mul_one := _, nat_cast := add_monoid_with_one.nat_cast algebra.tensor_product.tensor_product.add_monoid_with_one, nat_cast_zero := _, nat_cast_succ := _, npow := monoid_with_zero.npow._default 1 (λ (a b : tensor_product R A B), ⇑(⇑algebra.tensor_product.mul a) b) algebra.tensor_product.one_mul algebra.tensor_product.mul_one, npow_zero' := _, npow_succ' := _}
The ring morphism A →+* A ⊗[R] B
sending a
to a ⊗ₜ 1
.
Equations
- algebra.tensor_product.left_algebra = {to_has_smul := mul_action.to_has_smul distrib_mul_action.to_mul_action, to_ring_hom := {to_fun := (algebra.tensor_product.include_left_ring_hom.comp (algebra_map S A)).to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}, commutes' := _, smul_def' := _}
The tensor product of two R
-algebras is an R
-algebra.
The R
-algebra morphism A →ₐ[R] A ⊗[R] B
sending a
to a ⊗ₜ 1
.
The algebra morphism B →ₐ[R] A ⊗[R] B
sending b
to 1 ⊗ₜ b
.
Equations
- algebra.tensor_product.tensor_product.ring = {add := add_comm_group.add tensor_product.add_comm_group, add_assoc := _, zero := add_comm_group.zero tensor_product.add_comm_group, zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul tensor_product.add_comm_group, nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg tensor_product.add_comm_group, sub := add_comm_group.sub tensor_product.add_comm_group, sub_eq_add_neg := _, zsmul := add_comm_group.zsmul tensor_product.add_comm_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := add_comm_group_with_one.int_cast._default semiring.nat_cast add_comm_group.add algebra.tensor_product.tensor_product.ring._proof_12 add_comm_group.zero algebra.tensor_product.tensor_product.ring._proof_13 algebra.tensor_product.tensor_product.ring._proof_14 add_comm_group.nsmul algebra.tensor_product.tensor_product.ring._proof_15 algebra.tensor_product.tensor_product.ring._proof_16 semiring.one algebra.tensor_product.tensor_product.ring._proof_17 algebra.tensor_product.tensor_product.ring._proof_18 add_comm_group.neg add_comm_group.sub algebra.tensor_product.tensor_product.ring._proof_19 add_comm_group.zsmul algebra.tensor_product.tensor_product.ring._proof_20 algebra.tensor_product.tensor_product.ring._proof_21 algebra.tensor_product.tensor_product.ring._proof_22 algebra.tensor_product.tensor_product.ring._proof_23, nat_cast := semiring.nat_cast algebra.tensor_product.tensor_product.semiring, one := semiring.one algebra.tensor_product.tensor_product.semiring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := semiring.mul algebra.tensor_product.tensor_product.semiring, mul_assoc := _, one_mul := _, mul_one := _, npow := semiring.npow algebra.tensor_product.tensor_product.semiring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
Equations
- algebra.tensor_product.tensor_product.comm_ring = {add := ring.add algebra.tensor_product.tensor_product.ring, add_assoc := _, zero := ring.zero algebra.tensor_product.tensor_product.ring, zero_add := _, add_zero := _, nsmul := ring.nsmul algebra.tensor_product.tensor_product.ring, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg algebra.tensor_product.tensor_product.ring, sub := ring.sub algebra.tensor_product.tensor_product.ring, sub_eq_add_neg := _, zsmul := ring.zsmul algebra.tensor_product.tensor_product.ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := ring.int_cast algebra.tensor_product.tensor_product.ring, nat_cast := ring.nat_cast algebra.tensor_product.tensor_product.ring, one := ring.one algebra.tensor_product.tensor_product.ring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := ring.mul algebra.tensor_product.tensor_product.ring, mul_assoc := _, one_mul := _, mul_one := _, npow := ring.npow algebra.tensor_product.tensor_product.ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
S ⊗[R] T
has a T
-algebra structure. This is not a global instance or else the action of
S
on S ⊗[R] S
would be ambiguous.
We now build the structure maps for the symmetric monoidal category of R
-algebras.
Build an algebra morphism from a linear map out of a tensor product, and evidence of multiplicativity on pure tensors.
Build an algebra equivalence from a linear equivalence out of a tensor product, and evidence of multiplicativity on pure tensors.
Build an algebra equivalence from a linear equivalence out of a triple tensor product, and evidence of multiplicativity on pure tensors.
The base ring is a left identity for the tensor product of algebra, up to algebra isomorphism.
Equations
The base ring is a right identity for the tensor product of algebra, up to algebra isomorphism.
Equations
The tensor product of R-algebras is commutative, up to algebra isomorphism.
Equations
The associator for tensor product of R-algebras, as an algebra isomorphism.
The tensor product of a pair of algebra morphisms.
Construct an isomorphism between tensor products of R-algebras from isomorphisms between the tensor factors.
Equations
- algebra.tensor_product.congr f g = alg_equiv.of_alg_hom (algebra.tensor_product.map ↑f ↑g) (algebra.tensor_product.map ↑(f.symm) ↑(g.symm)) _ _
linear_map.mul'
is an alg_hom on commutative rings.
If S
is commutative, for a pair of morphisms f : A →ₐ[R] S
, g : B →ₐ[R] S
,
We obtain a map A ⊗[R] B →ₐ[R] S
that commutes with f
, g
via a ⊗ b ↦ f(a) * g(b)
.
Equations
If A
, B
are R
-algebras, A'
is an A
-algebra, then the product map of f : A' →ₐ[A] S
and g : B →ₐ[R] S
is an A
-algebra homomorphism.
Equations
- algebra.tensor_product.product_left_alg_hom f g = {to_fun := (algebra.tensor_product.product_map (alg_hom.restrict_scalars R f) g).to_ring_hom.to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _, commutes' := _}
Given a k
-algebra R
and a k
-basis of M,
this is a k
-linear isomorphism
R ⊗[k] M ≃ (ι →₀ R)
(which is in fact R
-linear).
Equations
- algebra.tensor_product.basis_aux R b = (tensor_product.congr (finsupp.linear_equiv.finsupp_unique k R punit).symm b.repr).trans ((finsupp_tensor_finsupp k R k punit ι).trans (finsupp.lcongr (equiv.unique_prod ι punit) (tensor_product.rid k R)))
Given a k
-algebra R
, this is the R
-basis of R ⊗[k] M
induced by a k
-basis of M
.
Equations
- algebra.tensor_product.basis R b = {repr := {to_fun := (algebra.tensor_product.basis_aux R b).to_fun, map_add' := _, map_smul' := _, inv_fun := (algebra.tensor_product.basis_aux R b).inv_fun, left_inv := _, right_inv := _}}
The algebra homomorphism from End M ⊗ End N
to End (M ⊗ N)
sending f ⊗ₜ g
to
the tensor_product.map f g
, the tensor product of the two maps.
Equations
- module.End_tensor_End_alg_hom = algebra.tensor_product.alg_hom_of_linear_map_tensor_product (tensor_product.hom_tensor_hom_map R M N M N) module.End_tensor_End_alg_hom._proof_3 module.End_tensor_End_alg_hom._proof_4
An auxiliary definition, used for constructing the module (A ⊗[R] B) M
in
tensor_product.algebra.module
below.
Equations
- tensor_product.algebra.module_aux = tensor_product.lift {to_fun := λ (a : A), a • (algebra.lsmul R M).to_linear_map, map_add' := _, map_smul' := _}
If M
is a representation of two different R
-algebras A
and B
whose actions commute,
then it is a representation the R
-algebra A ⊗[R] B
.
An important example arises from a semiring S
; allowing S
to act on itself via left and right
multiplication, the roles of R
, A
, B
, M
are played by ℕ
, S
, Sᵐᵒᵖ
, S
. This example
is important because a submodule of S
as a module
over S ⊗[ℕ] Sᵐᵒᵖ
is a two-sided ideal.
NB: This is not an instance because in the case B = A
and M = A ⊗[R] A
we would have a diamond
of smul
actions. Furthermore, this would not be a mere definitional diamond but a true
mathematical diamond in which A ⊗[R] A
had two distinct scalar actions on itself: one from its
multiplication, and one from this would-be instance. Arguably we could live with this but in any
case the real fix is to address the ambiguity in notation, probably along the lines outlined here:
https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.234773.20base.20change/near/240929258
Equations
- tensor_product.algebra.module = {to_distrib_mul_action := {to_mul_action := {to_has_smul := {smul := λ (x : tensor_product R A B) (m : M), ⇑(⇑tensor_product.algebra.module_aux x) m}, one_smul := _, mul_smul := _}, smul_zero := _, smul_add := _}, add_smul := _, zero_smul := _}