Documentation

CslibFrontier.Foundations.LinearAlgebra.Tensor.Amplify

Amplification of a shared-left packing #

A shared-left degeneration of n copies of a source S to m targets F i tensors with its dual (the exchange of the right input and the output, which keeps the left leg) and with itself d times, giving a shared-left degeneration of n ^ (2 d) copies of tpow d S ⊗ tpow d (swap23 S) to the shared-left sum, over all pairs of words w w' : Fin d → Fin m, of the targets tprodPi (F ∘ w) ⊗ tprodPi (swap23 ∘ F ∘ w') (IsSLDegen.amplify; Pass, Lemma 3.2, first half). The order multiplies by 2 d.

When the targets are full and middle products full a b and mid a b, the word tensors whose total numbers of full and middle factors are both d are reindexings of the canonical tensor tprod (tpow d (full a b)) (tpow d (mid a b)) (exists_reindex_eq_canonical): a word w with exactly h middle letters paired with a word w' with exactly h middle letters, since the dual of a middle product is a full product. Counting such words (Pass, Claim 3.3): the words with exactly h middle letters, h = 0, …, d, partition the m ^ d words, so some h has at least m ^ d / (d + 1) of them (exists_card_filter_count_ge); squaring gives the m ^ (2 d) / (d + 1) ^ 2 retained pairs, which loses only a factor polynomial in d compared with the Cauchy–Schwarz count of the source.

Main definitions #

Main results #

References #

theorem Cslib.Tensor.IsSLDegen.amplify {K : Type u_1} [CommRing K] {X : Type u_2} {Y : Type u_3} {Z : Type u_4} {X' : Type u_5} {Y' : Type u_6} {Z' : Type u_7} [Fintype X'] [Fintype Y'] [Fintype Z'] [DecidableEq X'] {m n h : ℕ} {f : X → X'} {F : Fin m → Tensor K X Y Z} {S : Tensor K X' Y' Z'} (hF : IsSLDegen f h (slSum F) (slSum fun (x : Fin n) => S)) (d : ℕ) :
IsSLDegen (Prod.map (fun (x : Fin d → X) (i : Fin d) => f (x i)) fun (x : Fin d → X) (i : Fin d) => f (x i)) (2 * d * h) (slSum fun (w : (Fin d → Fin m) × (Fin d → Fin m)) => (Tensor.tprodPi (F ∘ w.1)).tprod (Tensor.tprodPi (Tensor.swap23 ∘ F ∘ w.2))) (slSum fun (x : Fin (n ^ (2 * d))) => (Tensor.tpow d S).tprod (Tensor.tpow d S.swap23))

Amplification (Pass, Lemma 3.2): tensor a shared-left degeneration with its dual and take the d-th tensor power. The targets are indexed by pairs of words.

theorem Cslib.Tensor.exists_card_filter_count_ge (m d : ℕ) (M : Finset (Fin m)) :
∃ h ≤ d, m ^ d ≤ (d + 1) * {w : Fin d → Fin m | {i : Fin d | w i ∈ M}.card = h}.card

Counting words by type (Pass, Claim 3.3, in the form used here): the words Fin d → Fin m with exactly h letters in M, for h = 0, …, d, partition all m ^ d words, so for some h there are at least m ^ d / (d + 1) of them.

def Cslib.Tensor.canonical {K : Type u_1} [CommRing K] (d a b : ℕ) :
Tensor K ((Fin d → Fin (a + b - 1)) × (Fin d → Fin (a + b - 1))) ((Fin d → Fin (a + b - 1)) × (Fin d → Fin (a + b - 1))) ((Fin d → Fin (a + b - 1)) × (Fin d → Fin (a + b - 1)))

The canonical balanced tensor: d full products tensored with d middle products.

def Cslib.Tensor.fullOrMid {K : Type u_1} [CommRing K] (a b : ℕ) {m : ℕ} (M : Finset (Fin m)) (i : Fin m) :
Tensor K (Fin (a + b - 1)) (Fin (a + b - 1)) (Fin (a + b - 1))

The full-or-middle targets of the primal packing, by the set M of middle positions.

theorem Cslib.Tensor.exists_reindex_eq_canonical {K : Type u_1} [CommRing K] (a b : ℕ) {m d h : ℕ} (M : Finset (Fin m)) (w w' : Fin d → Fin m) (hw : {i : Fin d | w i ∈ M}.card = h) (hw' : {i : Fin d | w' i ∈ M}.card = h) :
∃ (e : (Fin d → Fin (a + b - 1)) × (Fin d → Fin (a + b - 1)) ≃ (Fin d → Fin (a + b - 1)) × (Fin d → Fin (a + b - 1))), (tprodPi (fullOrMid a b M ∘ w)).tprod (tprodPi (swap23 ∘ fullOrMid a b M ∘ w')) = reindex e e e (canonical d a b)

Balanced words are canonical (Pass, proof of Lemma 3.2): if w and w' each have exactly h middle letters, the word tensor tprodPi (fullOrMid ∘ w) ⊗ tprodPi (swap23 ∘ fullOrMid ∘ w') has d full and d middle factors, so it is the canonical tensor reindexed along one permutation of the 2 d coordinates, applied to all three legs.