Multilinear maps #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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 of m
at i
is not relevant, but it has the
advantage of avoiding subtype inclusion issues. This is the definition we use, based on
function.update
that allows to change the value of m
at i
.
Note that the use of function.update
requires a decidable_eq ι
term to appear somewhere in the
statement of multilinear_map.map_add'
and multilinear_map.map_smul'
. Three possible choices
are:
- Requiring
decidable_eq ι
as an argument tomultilinear_map
(as we did originally). - Using
classical.dec_eq ι
in the statement ofmap_add'
andmap_smul'
. - Quantifying over all possible
decidable_eq ι
instances in the statement ofmap_add'
andmap_smul'
.
Option 1 works fine, but puts unecessary constraints on the user (the zero map certainly does not
need decidability). Option 2 looks great at first, but in the common case when ι = fin n
it
introduces non-defeq decidability instance diamonds within the context of proving map_add'
and
map_smul'
, of the form fin.decidable_eq n = classical.dec_eq (fin n)
. Option 3 of course does
something similar, but of the form fin.decidable_eq n = _inst
, which is much easier to clean up
since _inst
is a free variable and so the equality can just be substituted.
- to_fun : (Π (i : ι), M₁ i) → M₂
- map_add' : ∀ [_inst_1_1 : decidable_eq ι] (m : Π (i : ι), M₁ i) (i : ι) (x y : M₁ i), self.to_fun (function.update m i (x + y)) = self.to_fun (function.update m i x) + self.to_fun (function.update m i y)
- map_smul' : ∀ [_inst_1_1 : decidable_eq ι] (m : Π (i : ι), M₁ i) (i : ι) (c : R) (x : M₁ i), self.to_fun (function.update m i (c • x)) = c • self.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
.
Instances for multilinear_map
- multilinear_map.has_sizeof_inst
- multilinear_map.has_coe_to_fun
- multilinear_map.has_add
- multilinear_map.has_zero
- multilinear_map.inhabited
- multilinear_map.has_smul
- multilinear_map.add_comm_monoid
- multilinear_map.distrib_mul_action
- multilinear_map.module
- multilinear_map.no_zero_smul_divisors
- multilinear_map.has_neg
- multilinear_map.has_sub
- multilinear_map.add_comm_group
- alternating_map.multilinear_map.has_coe
- module.finite.multilinear_map
- module.free.multilinear_map
Equations
- multilinear_map.has_coe_to_fun = {coe := multilinear_map.to_fun _inst_9}
Equations
Equations
- multilinear_map.add_comm_monoid = function.injective.add_comm_monoid coe_fn multilinear_map.add_comm_monoid._proof_2 multilinear_map.add_comm_monoid._proof_3 multilinear_map.add_comm_monoid._proof_4 multilinear_map.add_comm_monoid._proof_5
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
.
The evaluation map from ι → M₂
to M₂
is multilinear at a given i
when ι
is subsingleton.
Equations
- multilinear_map.of_subsingleton R M₂ i' = {to_fun := function.eval i', map_add' := _, map_smul' := _}
The constant map is multilinear when ι
is empty.
Equations
- multilinear_map.const_of_is_empty R M₁ m = {to_fun := function.const (Π (i : ι), M₁ i) m, map_add' := _, map_smul' := _}
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
.
Composing a multilinear map twice with a linear map in each argument is the same as composing with their composition.
Composing the zero multilinear map with a linear map in each argument.
Composing a multilinear map with the identity linear map in each argument.
Composing with a family of surjective linear maps is injective.
Composing a multilinear map with a linear equiv on each argument gives the zero map if and only if the multilinear map is the zero map.
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.
Restrict the codomain of a multilinear map to a submodule.
This is the multilinear version of linear_map.cod_restrict
.
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' := _}
The results of applying dom_dom_congr
to two maps are equal if
and only if those maps are.
Composing a multilinear map with a linear map gives again a multilinear map.
The multilinear version of linear_map.subtype_comp_cod_restrict
The multilinear version of linear_map.comp_cod_restrict
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_smul := multilinear_map.has_smul _inst_13, one_smul := _, mul_smul := _}, smul_zero := _, smul_add := _}
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_17, 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 := _}
The dependent version of multilinear_map.dom_dom_congr_linear_equiv
.
Equations
- multilinear_map.dom_dom_congr_linear_equiv' R M₁ M₂ σ = {to_fun := λ (f : multilinear_map R M₁ M₂), {to_fun := ⇑f ∘ ⇑((equiv.Pi_congr_left' M₁ σ).symm), map_add' := _, map_smul' := _}, map_add' := _, map_smul' := _, inv_fun := λ (f : multilinear_map R (λ (i : ι'), M₁ (⇑(σ.symm) i)) M₂), {to_fun := ⇑f ∘ ⇑(equiv.Pi_congr_left' M₁ σ), map_add' := _, map_smul' := _}, left_inv := _, right_inv := _}
The space of constant maps is equivalent to the space of maps that are multilinear with respect to an empty family.
Equations
- multilinear_map.const_linear_equiv_of_is_empty R M₁ M₂ = {to_fun := multilinear_map.const_of_is_empty R M₁ _inst_16, map_add' := _, map_smul' := _, inv_fun := λ (f : multilinear_map R M₁ M₂), ⇑f 0, left_inv := _, right_inv := _}
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
.
Equations
- multilinear_map.mk_pi_algebra R ι A = {to_fun := λ (m : ι → A), finset.univ.prod (λ (i : ι), m i), map_add' := _, map_smul' := _}
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 := add_comm_monoid.nsmul multilinear_map.add_comm_monoid, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg multilinear_map.has_neg, sub := has_sub.sub multilinear_map.has_sub, sub_eq_add_neg := _, zsmul := λ (n : ℤ) (f : multilinear_map R M₁ M₂), {to_fun := λ (m : Π (i : ι), M₁ i), n • ⇑f m, map_add' := _, map_smul' := _}, zsmul_zero' := _, zsmul_succ' := _, zsmul_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_7, map_add' := _, map_smul' := _, inv_fun := multilinear_map.curry_left _inst_7, 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_7, map_add' := _, map_smul' := _, inv_fun := multilinear_map.curry_right _inst_7, 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 ι', map_add' := _, map_smul' := _, inv_fun := multilinear_map.uncurry_sum ι', 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.