Tensor product of an indexed family of modules over commutative semirings #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We define the tensor product of an indexed family s : ι → Type*
of modules over commutative
semirings. We denote this space by ⨂[R] i, s i
and define it as free_add_monoid (R × Π i, s i)
quotiented by the appropriate equivalence relation. The treatment follows very closely that of the
binary tensor product in linear_algebra/tensor_product.lean
.
Main definitions #
pi_tensor_product R s
withR
a commutative semiring ands : ι → Type*
is the tensor product of all thes i
's. This is denoted by⨂[R] i, s i
.tprod R f
withf : Π i, s i
is the tensor product of the vectorsf i
over alli : ι
. This is bundled as a multilinear map fromΠ i, s i
to⨂[R] i, s i
.lift_add_hom
constructs anadd_monoid_hom
from(⨂[R] i, s i)
to some spaceF
from a functionφ : (R × Π i, s i) → F
with the appropriate properties.lift φ
withφ : multilinear_map R s E
is the corresponding linear map(⨂[R] i, s i) →ₗ[R] E
. This is bundled as a linear equivalence.pi_tensor_product.reindex e
re-indexes the components of⨂[R] i : ι, M
alonge : ι ≃ ι₂
.pi_tensor_product.tmul_equiv
equivalence between atensor_product
ofpi_tensor_product
s and a singlepi_tensor_product
.
Notations #
⨂[R] i, s i
is defined as localized notation in localetensor_product
⨂ₜ[R] i, f i
withf : Π i, f i
is defined globally as the tensor product of all thef i
's.
Implementation notes #
- We define it via
free_add_monoid (R × Π i, s i)
with theR
representing a "hidden" tensor factor, rather thanfree_add_monoid (Π i, s i)
to ensure that, ifι
is an empty type, the space is isomorphic to the base ringR
. - We have not restricted the index type
ι
to be afintype
, as nothing we do here strictly requires it. However, problems may arise in the case whereι
is infinite; use at your own caution. - Instead of requiring
decidable_eq ι
as an argument topi_tensor_product
itself, we include it as an argument in the constructors of the relation. A decidability isntance still has to come from somewhere due to the use offunction.update
, but this hides it from the downstream user. See the implementation notes formultilinear_map
for an extended discussion of this choice.
TODO #
- Define tensor powers, symmetric subspace, etc.
- API for the various ways
ι
can be split into subsets; connect this with the binary tensor product. - Include connection with holors.
- Port more of the API from the binary tensor product over to this case.
Tags #
multilinear, tensor, tensor product
- of_zero : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (r : R) (f : Π (i : ι), s i) (i : ι), f i = 0 → pi_tensor_product.eqv R s (free_add_monoid.of (r, f)) 0
- of_zero_scalar : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (f : Π (i : ι), s i), pi_tensor_product.eqv R s (free_add_monoid.of (0, f)) 0
- of_add : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (inst : decidable_eq ι) (r : R) (f : Π (i : ι), s i) (i : ι) (m₁ m₂ : s i), pi_tensor_product.eqv R s (free_add_monoid.of (r, function.update f i m₁) + free_add_monoid.of (r, function.update f i m₂)) (free_add_monoid.of (r, function.update f i (m₁ + m₂)))
- of_add_scalar : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (r r' : R) (f : Π (i : ι), s i), pi_tensor_product.eqv R s (free_add_monoid.of (r, f) + free_add_monoid.of (r', f)) (free_add_monoid.of (r + r', f))
- of_smul : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (inst : decidable_eq ι) (r : R) (f : Π (i : ι), s i) (i : ι) (r' : R), pi_tensor_product.eqv R s (free_add_monoid.of (r, function.update f i (r' • f i))) (free_add_monoid.of (r' * r, f))
- add_comm : ∀ {ι : Type u_1} {R : Type u_4} [_inst_1 : comm_semiring R] {s : ι → Type u_7} [_inst_2 : Π (i : ι), add_comm_monoid (s i)] [_inst_3 : Π (i : ι), module R (s i)] (x y : free_add_monoid (R × Π (i : ι), s i)), pi_tensor_product.eqv R s (x + y) (y + x)
The relation on free_add_monoid (R × Π i, s i)
that generates a congruence whose quotient is
the tensor product.
pi_tensor_product R s
with R
a commutative semiring and s : ι → Type*
is the tensor
product of all the s i
's. This is denoted by ⨂[R] i, s i
.
Equations
- pi_tensor_product R s = (add_con_gen (pi_tensor_product.eqv R s)).quotient
Instances for pi_tensor_product
- pi_tensor_product.add_comm_monoid
- pi_tensor_product.inhabited
- pi_tensor_product.has_smul'
- pi_tensor_product.has_smul
- pi_tensor_product.distrib_mul_action'
- pi_tensor_product.smul_comm_class'
- pi_tensor_product.is_scalar_tower'
- pi_tensor_product.module'
- pi_tensor_product.module
- pi_tensor_product.smul_comm_class
- pi_tensor_product.is_scalar_tower
- pi_tensor_product.add_comm_group
- tensor_power.ghas_one
- tensor_power.ghas_mul
- tensor_power.gmonoid
- tensor_power.gsemiring
- tensor_power.galgebra
Equations
- pi_tensor_product.add_comm_monoid s = {add := add_monoid.add (add_con_gen (pi_tensor_product.eqv R s)).add_monoid, add_assoc := _, zero := add_monoid.zero (add_con_gen (pi_tensor_product.eqv R s)).add_monoid, zero_add := _, add_zero := _, nsmul := add_monoid.nsmul (add_con_gen (pi_tensor_product.eqv R s)).add_monoid, nsmul_zero' := _, nsmul_succ' := _, add_comm := _}
Equations
- pi_tensor_product.inhabited s = {default := 0}
tprod_coeff R r f
with r : R
and f : Π i, s i
is the tensor product of the vectors f i
over all i : ι
, multiplied by the coefficient r
. Note that this is meant as an auxiliary
definition for this file alone, and that one should use tprod
defined below for most purposes.
Equations
- pi_tensor_product.tprod_coeff R r f = ⇑((add_con_gen (pi_tensor_product.eqv R (λ (i : ι), s i))).mk') (free_add_monoid.of (r, f))
Construct an add_monoid_hom
from (⨂[R] i, s i)
to some space F
from a function
φ : (R × Π i, s i) → F
with the appropriate properties.
Equations
- pi_tensor_product.lift_add_hom φ C0 C0' C_add C_add_scalar C_smul = (add_con_gen (pi_tensor_product.eqv R s)).lift (⇑free_add_monoid.lift φ) _
Equations
- pi_tensor_product.has_smul' = {smul := λ (r : R₁), ⇑(pi_tensor_product.lift_add_hom (λ (f : R × Π (i : ι), s i), pi_tensor_product.tprod_coeff R (r • f.fst) f.snd) _ _ _ _ _)}
Equations
- pi_tensor_product.distrib_mul_action' = {to_mul_action := {to_has_smul := {smul := has_smul.smul pi_tensor_product.has_smul'}, one_smul := _, mul_smul := _}, smul_zero := _, smul_add := _}
Equations
- pi_tensor_product.module' = {to_distrib_mul_action := {to_mul_action := {to_has_smul := {smul := has_smul.smul pi_tensor_product.has_smul'}, one_smul := _, mul_smul := _}, smul_zero := _, smul_add := _}, add_smul := _, zero_smul := _}
The canonical multilinear_map R s (⨂[R] i, s i)
.
Equations
- pi_tensor_product.tprod R = {to_fun := pi_tensor_product.tprod_coeff R 1, map_add' := _, map_smul' := _}
Auxiliary function to constructing a linear map (⨂[R] i, s i) → E
given a
multilinear map R s E
with the property that its composition with the canonical
multilinear_map R s (⨂[R] i, s i)
is the given multilinear map.
Equations
- pi_tensor_product.lift_aux φ = pi_tensor_product.lift_add_hom (λ (p : R × Π (i : ι), s i), p.fst • ⇑φ p.snd) _ _ _ _ _
Constructing a linear map (⨂[R] i, s i) → E
given a multilinear_map R s E
with the
property that its composition with the canonical multilinear_map R s E
is
the given multilinear map φ
.
Equations
- pi_tensor_product.lift = {to_fun := λ (φ : multilinear_map R s E), {to_fun := (pi_tensor_product.lift_aux φ).to_fun, map_add' := _, map_smul' := _}, map_add' := _, map_smul' := _, inv_fun := λ (φ' : pi_tensor_product R (λ (i : ι), s i) →ₗ[R] E), φ'.comp_multilinear_map (pi_tensor_product.tprod R), left_inv := _, right_inv := _}
Re-index the components of the tensor power by e
.
For simplicity, this is defined only for homogeneously- (rather than dependently-) typed components.
The tensor product over an empty index type ι
is isomorphic to the base ring.
Equations
- pi_tensor_product.is_empty_equiv ι = {to_fun := ⇑(⇑pi_tensor_product.lift (multilinear_map.const_of_is_empty R (λ (i : ι), M) 1)), map_add' := _, map_smul' := _, inv_fun := λ (r : R), r • ⇑(pi_tensor_product.tprod R) is_empty_elim, left_inv := _, right_inv := _}
The tensor product over an single index is isomorphic to the module
Equations
- pi_tensor_product.subsingleton_equiv i₀ = {to_fun := ⇑(⇑pi_tensor_product.lift (multilinear_map.of_subsingleton R M i₀)), map_add' := _, map_smul' := _, inv_fun := λ (m : M), ⇑(pi_tensor_product.tprod R) (λ (v : ι), m), left_inv := _, right_inv := _}
Equivalence between a tensor_product
of pi_tensor_product
s and a single
pi_tensor_product
indexed by a sum
type.
For simplicity, this is defined only for homogeneously- (rather than dependently-) typed components.
Equations
- pi_tensor_product.tmul_equiv R M = linear_equiv.of_linear tmul tmul_symm _ _