Multilinear maps #
We define multilinear maps as maps from Π(i : ι), M₁ i
to M₂
which are linear in each
coordinate. Here, M₁ i
and M₂
are modules over a ring R
, and ι
is an arbitrary type
(although some statements will require it to be a fintype). This space, denoted by
multilinear_map R M₁ M₂
, inherits a module structure by pointwise addition and multiplication.
Main definitions #
multilinear_map R M₁ M₂
is the space of multilinear maps fromΠ(i : ι), M₁ i
toM₂
.f.map_smul
is the multiplicativity of the multilinear mapf
along each coordinate.f.map_add
is the additivity of the multilinear mapf
along each coordinate.f.map_smul_univ
expresses the multiplicativity off
over all coordinates at the same time, writingf (λi, c i • m i)
as(∏ i, c i) • f m
.f.map_add_univ
expresses the additivity off
over all coordinates at the same time, writingf (m + m')
as the sum over all subsetss
ofι
off (s.piecewise m m')
.f.map_sum
expressesf (Σ_{j₁} g₁ j₁, ..., Σ_{jₙ} gₙ jₙ)
as the sum off (g₁ (r 1), ..., gₙ (r n))
wherer
ranges over all possible functions.
We also register isomorphisms corresponding to currying or uncurrying variables, transforming a
multilinear function f
on n+1
variables into a linear function taking values in multilinear
functions in n
variables, and into a multilinear function in n
variables taking values in linear
functions. These operations are called f.curry_left
and f.curry_right
respectively
(with inverses f.uncurry_left
and f.uncurry_right
). These operations induce linear equivalences
between spaces of multilinear functions in n+1
variables and spaces of linear functions into
multilinear functions in n
variables (resp. multilinear functions in n
variables taking values
in linear functions), called respectively multilinear_curry_left_equiv
and
multilinear_curry_right_equiv
.
Implementation notes #
Expressing that a map is linear along the i
-th coordinate when all other coordinates are fixed
can be done in two (equivalent) different ways:
- fixing a vector
m : Π(j : ι - i), M₁ j.val
, and then choosing separately thei
-th coordinate - fixing a vector
m : Πj, M₁ j
, and then modifying itsi
-th coordinate The second way is more artificial as the value ofm
ati
is not relevant, but it has the advantage of avoiding subtype inclusion issues. This is the definition we use, based onfunction.update
that allows to change the value ofm
ati
.
- to_fun : (Π (i : ι), M₁ i) → M₂
- map_add' : ∀ (m : Π (i : ι), M₁ i) (i : ι) (x y : M₁ i), c.to_fun (function.update m i (x + y)) = c.to_fun (function.update m i x) + c.to_fun (function.update m i y)
- map_smul' : ∀ (m : Π (i : ι), M₁ i) (i : ι) (c_1 : R) (x : M₁ i), c.to_fun (function.update m i (c_1 • x)) = c_1 • c.to_fun (function.update m i x)
Multilinear maps over the ring R
, from Πi, M₁ i
to M₂
where M₁ i
and M₂
are modules
over R
.
Equations
- multilinear_map.has_coe_to_fun = {F := λ (x : multilinear_map R M₁ M₂), (Π (i : ι), M₁ i) → M₂, coe := multilinear_map.to_fun _inst_10}
Equations
Equations
- multilinear_map.add_comm_monoid = {add := has_add.add multilinear_map.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := λ (n : ℕ) (f : multilinear_map R M₁ M₂), {to_fun := λ (m : Π (i : ι), M₁ i), n • ⇑f m, map_add' := _, map_smul' := _}, nsmul_zero' := _, nsmul_succ' := _, add_comm := _}
If f
is a multilinear map, then f.to_linear_map m i
is the linear map obtained by fixing all
coordinates but i
equal to those of m
, and varying the i
-th coordinate.
Equations
- f.to_linear_map m i = {to_fun := λ (x : M₁ i), ⇑f (function.update m i x), map_add' := _, map_smul' := _}
The cartesian product of two multilinear maps, as a multilinear map.
Combine a family of multilinear maps with the same domain and codomains M' i
into a
multilinear map taking values in the space of functions Π i, M' i
.
Given a multilinear map f
on n
variables (parameterized by fin n
) and a subset s
of k
of these variables, one gets a new multilinear map on fin k
by varying these variables, and fixing
the other ones equal to a given value z
. It is denoted by f.restr s hk z
, where hk
is a
proof that the cardinality of s
is k
. The implicit identification between fin k
and s
that
we use is the canonical (increasing) bijection.
In the specific case of multilinear maps on spaces indexed by fin (n+1)
, where one can build
an element of Π(i : fin (n+1)), M i
using cons
, one can express directly the additivity of a
multilinear map along the first variable.
In the specific case of multilinear maps on spaces indexed by fin (n+1)
, where one can build
an element of Π(i : fin (n+1)), M i
using cons
, one can express directly the multiplicativity
of a multilinear map along the first variable.
In the specific case of multilinear maps on spaces indexed by fin (n+1)
, where one can build
an element of Π(i : fin (n+1)), M i
using snoc
, one can express directly the additivity of a
multilinear map along the first variable.
In the specific case of multilinear maps on spaces indexed by fin (n+1)
, where one can build
an element of Π(i : fin (n+1)), M i
using cons
, one can express directly the multiplicativity
of a multilinear map along the first variable.
If g
is a multilinear map and f
is a collection of linear maps,
then g (f₁ m₁, ..., fₙ mₙ)
is again a multilinear map, that we call
g.comp_linear_map f
.
If one adds to a vector m'
another vector m
, but only for coordinates in a finset t
, then
the image under a multilinear map f
is the sum of f (s.piecewise m m')
along all subsets s
of
t
. This is mainly an auxiliary statement to prove the result when t = univ
, given in
map_add_univ
, although it can be useful in its own right as it does not require the index set ι
to be finite.
Additivity of a multilinear map along all coordinates at the same time,
writing f (m + m')
as the sum of f (s.piecewise m m')
over all sets s
.
If f
is multilinear, then f (Σ_{j₁ ∈ A₁} g₁ j₁, ..., Σ_{jₙ ∈ Aₙ} gₙ jₙ)
is the sum of
f (g₁ (r 1), ..., gₙ (r n))
where r
ranges over all functions with r 1 ∈ A₁
, ...,
r n ∈ Aₙ
. This follows from multilinearity by expanding successively with respect to each
coordinate. Here, we give an auxiliary statement tailored for an inductive proof. Use instead
map_sum_finset
.
If f
is multilinear, then f (Σ_{j₁ ∈ A₁} g₁ j₁, ..., Σ_{jₙ ∈ Aₙ} gₙ jₙ)
is the sum of
f (g₁ (r 1), ..., gₙ (r n))
where r
ranges over all functions with r 1 ∈ A₁
, ...,
r n ∈ Aₙ
. This follows from multilinearity by expanding successively with respect to each
coordinate.
If f
is multilinear, then f (Σ_{j₁} g₁ j₁, ..., Σ_{jₙ} gₙ jₙ)
is the sum of
f (g₁ (r 1), ..., gₙ (r n))
where r
ranges over all functions r
. This follows from
multilinearity by expanding successively with respect to each coordinate.
Reinterpret an A
-multilinear map as an R
-multilinear map, if A
is an algebra over R
and their actions on all involved modules agree with the action of R
on A
.
Transfer the arguments to a map along an equivalence between argument indices.
The naming is derived from finsupp.dom_congr
, noting that here the permutation applies to the
domain of the domain.
multilinear_map.dom_dom_congr
as an equivalence.
This is declared separately because it does not work with dot notation.
Equations
- multilinear_map.dom_dom_congr_equiv σ = {to_fun := multilinear_map.dom_dom_congr σ, inv_fun := multilinear_map.dom_dom_congr σ.symm, left_inv := _, right_inv := _, map_add' := _}
Composing a multilinear map with a linear map gives again a multilinear map.
If one multiplies by c i
the coordinates in a finset s
, then the image under a multilinear
map is multiplied by ∏ i in s, c i
. This is mainly an auxiliary statement to prove the result when
s = univ
, given in map_smul_univ
, although it can be useful in its own right as it does not
require the index set ι
to be finite.
Multiplicativity of a multilinear map along all coordinates at the same time,
writing f (λi, c i • m i)
as (∏ i, c i) • f m
.
Equations
- multilinear_map.distrib_mul_action = {to_mul_action := {to_has_scalar := multilinear_map.has_scalar _inst_14, one_smul := _, mul_smul := _}, smul_add := _, smul_zero := _}
The space of multilinear maps over an algebra over R
is a module over R
, for the pointwise
addition and scalar multiplication.
Equations
- multilinear_map.module = {to_distrib_mul_action := multilinear_map.distrib_mul_action _inst_18, add_smul := _, zero_smul := _}
multilinear_map.dom_dom_congr
as a linear_equiv
.
Equations
- multilinear_map.dom_dom_congr_linear_equiv M₂ M₃ R' A σ = {to_fun := (multilinear_map.dom_dom_congr_equiv σ).to_fun, map_add' := _, map_smul' := _, inv_fun := (multilinear_map.dom_dom_congr_equiv σ).inv_fun, left_inv := _, right_inv := _}
Given two multilinear maps (ι₁ → N) → N₁
and (ι₂ → N) → N₂
, this produces the map
(ι₁ ⊕ ι₂ → N) → N₁ ⊗ N₂
by taking the coproduct of the domain and the tensor product
of the codomain.
This can be thought of as combining equiv.sum_arrow_equiv_prod_arrow.symm
with
tensor_product.map
, noting that the two operations can't be separated as the intermediate result
is not a multilinear_map
.
While this can be generalized to work for dependent Π i : ι₁, N'₁ i
instead of ι₁ → N
, doing so
introduces sum.elim N'₁ N'₂
types in the result which are difficult to work with and not defeq
to the simple case defined here. See this zulip thread.
A more bundled version of multilinear_map.dom_coprod
that maps
((ι₁ → N) → N₁) ⊗ ((ι₂ → N) → N₂)
to (ι₁ ⊕ ι₂ → N) → N₁ ⊗ N₂
.
Equations
- multilinear_map.dom_coprod' = tensor_product.lift (linear_map.mk₂ R multilinear_map.dom_coprod multilinear_map.dom_coprod'._proof_7 multilinear_map.dom_coprod'._proof_8 multilinear_map.dom_coprod'._proof_9 multilinear_map.dom_coprod'._proof_10)
When passed an equiv.sum_congr
, multilinear_map.dom_dom_congr
distributes over
multilinear_map.dom_coprod
.
Given an R
-algebra A
, mk_pi_algebra
is the multilinear map on A^ι
associating
to m
the product of all the m i
.
See also multilinear_map.mk_pi_algebra_fin
for a version that works with a non-commutative
algebra A
but requires ι = fin n
.
Given an R
-algebra A
, mk_pi_algebra_fin
is the multilinear map on A^n
associating
to m
the product of all the m i
.
See also multilinear_map.mk_pi_algebra
for a version that assumes [comm_semiring A]
but works
for A^ι
with any finite type ι
.
Equations
- multilinear_map.mk_pi_algebra_fin R n A = {to_fun := λ (m : fin n → A), (list.of_fn m).prod, map_add' := _, map_smul' := _}
Given an R
-multilinear map f
taking values in R
, f.smul_right z
is the map
sending m
to f m • z
.
Equations
- f.smul_right z = (linear_map.id.smul_right z).comp_multilinear_map f
The canonical multilinear map on R^ι
when ι
is finite, associating to m
the product of
all the m i
(multiplied by a fixed reference element z
in the target module). See also
mk_pi_algebra
for a more general version.
Equations
- multilinear_map.mk_pi_ring R ι z = (multilinear_map.mk_pi_algebra R ι R).smul_right z
Equations
- multilinear_map.add_comm_group = {add := has_add.add multilinear_map.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := λ (n : ℕ) (f : multilinear_map R M₁ M₂), {to_fun := λ (m : Π (i : ι), M₁ i), n • ⇑f m, map_add' := _, map_smul' := _}, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg multilinear_map.has_neg, sub := has_sub.sub multilinear_map.has_sub, sub_eq_add_neg := _, gsmul := λ (n : ℤ) (f : multilinear_map R M₁ M₂), {to_fun := λ (m : Π (i : ι), M₁ i), n • ⇑f m, map_add' := _, map_smul' := _}, gsmul_zero' := _, gsmul_succ' := _, gsmul_neg' := _, add_left_neg := _, add_comm := _}
When ι
is finite, multilinear maps on R^ι
with values in M₂
are in bijection with M₂
,
as such a multilinear map is completely determined by its value on the constant vector made of ones.
We register this bijection as a linear equivalence in multilinear_map.pi_ring_equiv
.
Equations
- multilinear_map.pi_ring_equiv = {to_fun := λ (z : M₂), multilinear_map.mk_pi_ring R ι z, map_add' := _, map_smul' := _, inv_fun := λ (f : multilinear_map R (λ (i : ι), R) M₂), ⇑f (λ (i : ι), 1), left_inv := _, right_inv := _}
Currying #
We associate to a multilinear map in n+1
variables (i.e., based on fin n.succ
) two
curried functions, named f.curry_left
(which is a linear map on E 0
taking values
in multilinear maps in n
variables) and f.curry_right
(wich is a multilinear map in n
variables taking values in linear maps on E 0
). In both constructions, the variable that is
singled out is 0
, to take advantage of the operations cons
and tail
on fin n
.
The inverse operations are called uncurry_left
and uncurry_right
.
We also register linear equiv versions of these correspondences, in
multilinear_curry_left_equiv
and multilinear_curry_right_equiv
.
Left currying #
Given a linear map f
from M 0
to multilinear maps on n
variables,
construct the corresponding multilinear map on n+1
variables obtained by concatenating
the variables, given by m ↦ f (m 0) (tail m)
Given a multilinear map f
in n+1
variables, split the first variable to obtain
a linear map into multilinear maps in n
variables, given by x ↦ (m ↦ f (cons x m))
.
The space of multilinear maps on Π(i : fin (n+1)), M i
is canonically isomorphic to
the space of linear maps from M 0
to the space of multilinear maps on
Π(i : fin n), M i.succ
, by separating the first variable. We register this isomorphism as a
linear isomorphism in multilinear_curry_left_equiv R M M₂
.
The direct and inverse maps are given by f.uncurry_left
and f.curry_left
. Use these
unless you need the full framework of linear equivs.
Equations
- multilinear_curry_left_equiv R M M₂ = {to_fun := linear_map.uncurry_left _inst_8, map_add' := _, map_smul' := _, inv_fun := multilinear_map.curry_left _inst_8, left_inv := _, right_inv := _}
Right currying #
Given a multilinear map f
in n
variables to the space of linear maps from M (last n)
to
M₂
, construct the corresponding multilinear map on n+1
variables obtained by concatenating
the variables, given by m ↦ f (init m) (m (last n))
Given a multilinear map f
in n+1
variables, split the last variable to obtain
a multilinear map in n
variables taking values in linear maps from M (last n)
to M₂
, given by
m ↦ (x ↦ f (snoc m x))
.
The space of multilinear maps on Π(i : fin (n+1)), M i
is canonically isomorphic to
the space of linear maps from the space of multilinear maps on Π(i : fin n), M i.cast_succ
to the
space of linear maps on M (last n)
, by separating the last variable. We register this isomorphism
as a linear isomorphism in multilinear_curry_right_equiv R M M₂
.
The direct and inverse maps are given by f.uncurry_right
and f.curry_right
. Use these
unless you need the full framework of linear equivs.
Equations
- multilinear_curry_right_equiv R M M₂ = {to_fun := multilinear_map.uncurry_right _inst_8, map_add' := _, map_smul' := _, inv_fun := multilinear_map.curry_right _inst_8, left_inv := _, right_inv := _}
A multilinear map on Π i : ι ⊕ ι', M'
defines a multilinear map on Π i : ι, M'
taking values in the space of multilinear maps on Π i : ι', M'
.
A multilinear map on Π i : ι, M'
taking values in the space of multilinear maps
on Π i : ι', M'
defines a multilinear map on Π i : ι ⊕ ι', M'
.
Linear equivalence between the space of multilinear maps on Π i : ι ⊕ ι', M'
and the space
of multilinear maps on Π i : ι, M'
taking values in the space of multilinear maps
on Π i : ι', M'
.
Equations
- multilinear_map.curry_sum_equiv R ι M₂ M' ι' = {to_fun := multilinear_map.curry_sum (λ (a b : ι ⊕ ι'), _inst_10 a b), map_add' := _, map_smul' := _, inv_fun := multilinear_map.uncurry_sum (λ (a b : ι ⊕ ι'), _inst_10 a b), left_inv := _, right_inv := _}
If s : finset (fin n)
is a finite set of cardinality k
and its complement has cardinality
l
, then the space of multilinear maps on λ i : fin n, M'
is isomorphic to the space of
multilinear maps on λ i : fin k, M'
taking values in the space of multilinear maps
on λ i : fin l, M'
.
Equations
- multilinear_map.curry_fin_finset R M₂ M' hk hl = (multilinear_map.dom_dom_congr_linear_equiv M' M₂ R R (fin_sum_equiv_of_finset hk hl).symm).trans (multilinear_map.curry_sum_equiv R (fin k) M₂ M' (fin l))
The pushforward of an indexed collection of submodule p i ⊆ M₁ i
by f : M₁ → M₂
.
Note that this is not a submodule - it is not closed under addition.
The map is always nonempty. This lemma is needed to apply sub_mul_action.zero_mem
.
The range of a multilinear map, closed under scalar multiplication.