Documentation

MIPRE.Foundations.Blocks

Summing over assignments to a block-decomposed index type #

A construction that reads only some coordinates of a uniformly random point needs to know that those coordinates are themselves uniform, and independent of the rest. In the form a sum identity takes, that is: when the index type is a sum, summing a function of the blocks' assignments over all assignments to the whole gives the iterated sum over the blocks --- once per assignment of whatever block the function ignores.

Nothing here is about fields, lines or games. The only reason the file exists is that the padded space of the combining stage (MIPRE/Background/QLD/Padded.lean) is F_q^{4m} with its coordinates split into blocks, and every distributional statement about that splitting reduces to these two.

def MIPRE.sumArrow (α : Type u_5) (β : Type u_6) (F : Type u_7) :
(α ⊕ β → F) ≃ (α → F) × (β → F)

An assignment to a sum index type is a pair of assignments to the summands. Spelled out rather than taken from Equiv.sumArrowEquivProdArrow so that both directions compute by rfl.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem MIPRE.sum_arrow_pair {α : Type u_1} {β : Type u_2} {F : Type u_3} {M : Type u_4} [Fintype α] [DecidableEq α] [Fintype β] [DecidableEq β] [Fintype F] [AddCommMonoid M] (g : (α → F) → (β → F) → M) :
    (∑ u : α ⊕ β → F, g (fun (a : α) => u (Sum.inl a)) fun (b : β) => u (Sum.inr b)) = ∑ wa : α → F, ∑ wb : β → F, g wa wb

    Both blocks of a uniform assignment are uniform and independent.

    theorem MIPRE.sum_arrow_inl {α : Type u_1} {β : Type u_2} {F : Type u_3} {M : Type u_4} [Fintype α] [DecidableEq α] [Fintype β] [DecidableEq β] [Fintype F] [AddCommMonoid M] (g : (α → F) → M) :
    (∑ u : α ⊕ β → F, g fun (a : α) => u (Sum.inl a)) = Fintype.card (β → F) • ∑ wa : α → F, g wa

    The left block of a uniform assignment is uniform, each value counted once per assignment to the right block.

    Rewriting, reordering and scaling nested sums #

    A block decomposition turns one sum into two, and the new sums appear where the old one was. Getting from there to a statement about each block's own law is bookkeeping: rewrite a sum that sits under others, move one sum past its neighbours, and pull a constant multiplier out. These are the three moves, stated at the arities the padded space needs, so that a proof can name the step it is taking instead of rebuilding a Finset.sum_congr tower each time.

    theorem MIPRE.sum_congr1 {A : Type u_5} {M : Type u_11} [Fintype A] [AddCommMonoid M] {f g : A → M} (h : ∀ (a : A), f a = g a) :
    ∑ a : A, f a = ∑ a : A, g a
    theorem MIPRE.sum_congr2 {A : Type u_5} {B : Type u_6} {M : Type u_11} [Fintype A] [Fintype B] [AddCommMonoid M] {f g : A → B → M} (h : ∀ (a : A) (b : B), f a b = g a b) :
    ∑ a : A, ∑ b : B, f a b = ∑ a : A, ∑ b : B, g a b
    theorem MIPRE.sum_congr3 {A : Type u_5} {B : Type u_6} {C : Type u_7} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [AddCommMonoid M] {f g : A → B → C → M} (h : ∀ (a : A) (b : B) (c : C), f a b c = g a b c) :
    ∑ a : A, ∑ b : B, ∑ c : C, f a b c = ∑ a : A, ∑ b : B, ∑ c : C, g a b c
    theorem MIPRE.sum_congr4 {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] {f g : A → B → C → D → M} (h : ∀ (a : A) (b : B) (c : C) (d : D), f a b c d = g a b c d) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, f a b c d = ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, g a b c d
    theorem MIPRE.sum_nsmul1 {A : Type u_5} {M : Type u_11} [Fintype A] [AddCommMonoid M] (n : ℕ) (f : A → M) :
    ∑ a : A, n • f a = n • ∑ a : A, f a
    theorem MIPRE.sum_nsmul2 {A : Type u_5} {B : Type u_6} {M : Type u_11} [Fintype A] [Fintype B] [AddCommMonoid M] (n : ℕ) (f : A → B → M) :
    ∑ a : A, ∑ b : B, n • f a b = n • ∑ a : A, ∑ b : B, f a b
    theorem MIPRE.sum_nsmul3 {A : Type u_5} {B : Type u_6} {C : Type u_7} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [AddCommMonoid M] (n : ℕ) (f : A → B → C → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, n • f a b c = n • ∑ a : A, ∑ b : B, ∑ c : C, f a b c
    theorem MIPRE.sum_nsmul4 {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] (n : ℕ) (f : A → B → C → D → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, n • f a b c d = n • ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, f a b c d
    theorem MIPRE.sum_comm_four_in {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] (f : A → B → C → D → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, f a b c d = ∑ a : A, ∑ c : C, ∑ d : D, ∑ b : B, f a b c d

    Moving the second of four nested sums inwards to last place.

    theorem MIPRE.sum_comm_four_mid {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] (f : A → B → C → D → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, f a b c d = ∑ a : A, ∑ c : C, ∑ b : B, ∑ d : D, f a b c d

    Swapping the second and third of four nested sums.

    theorem MIPRE.sum_comm_six {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {E : Type u_9} {G : Type u_10} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [Fintype E] [Fintype G] [AddCommMonoid M] (f : A → B → C → D → E → G → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, ∑ e : E, ∑ x : G, f a b c d e x = ∑ a : A, ∑ c : C, ∑ d : D, ∑ b : B, ∑ e : E, ∑ x : G, f a b c d e x

    Moving the second of six nested sums inwards past the next two. A block decomposition produces the two sides' data interleaved, and this is what puts each side's data back together.

    theorem MIPRE.sum_comm_six_swap {A : Type u_5} {B : Type u_6} {C : Type u_7} {D : Type u_8} {E : Type u_9} {G : Type u_10} {M : Type u_11} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [Fintype E] [Fintype G] [AddCommMonoid M] (f : A → B → C → D → E → G → M) :
    ∑ a : A, ∑ b : B, ∑ c : C, ∑ d : D, ∑ e : E, ∑ x : G, f a b c d e x = ∑ a : A, ∑ b : B, ∑ c : C, ∑ e : E, ∑ d : D, ∑ x : G, f a b c d e x

    Swapping the fourth and fifth of six nested sums.

    theorem MIPRE.sum_prod_fst {A : Type u_5} {B : Type u_6} {M : Type u_11} [Fintype A] [Fintype B] [AddCommMonoid M] [DecidableEq A] (h : A → M) :
    ∑ p : A × B, h p.1 = Fintype.card B • ∑ a : A, h a

    Only the first component of a pair is read.

    Marginals of a uniform average #

    A uniform average of a quantity that depends on only part of the sample is the uniform average over that part. Stated once, for an arbitrary splitting of the sample space given as an equivalence with a product, it is what relates the Pauli basis test's single content --- which carries both sides' points but one seed and one raw direction --- to a product of two independent line-point laws: each side's own data has the same marginal under both.

    theorem MIPRE.avg_comp_equiv_fst {α : Type u_5} {β : Type u_6} {γ : Type u_7} [Fintype α] [Fintype β] [Fintype γ] [Nonempty α] [Nonempty γ] (e : α ≃ β × γ) (f : β → ℝ) :
    ∑ a : α, (↑(Fintype.card α))⁻¹ * f (e a).1 = ∑ b : β, (↑(Fintype.card β))⁻¹ * f b

    A uniform average of a function of one factor is the uniform average over that factor.