Documentation

CslibFrontier.Foundations.Data.BitString.OddPairs

Averages over the odd pairs of bit strings #

Rigidity arguments for Pauli operators average over the pairs (a, b) of bit strings with a · b = 1, the odd pairs, on which X(a) and Z(b) anticommute. The masked average oddExpect f = E_{a,b} [a · b = 1] f(a, b) (Cslib.BitString.oddExpect) averages f over all pairs with the even pairs set to 0. It is the density (1 - 2⁻ⁿ) / 2 of the odd pairs times the conditional average over them (Cslib.BitString.oddExpect_eq_dens_smul, Cslib.BitString.dens_oddPairs); for n = 0 there are no odd pairs and it is 0. It is monotone and linear on the odd pairs (Cslib.BitString.oddExpect_mono, Cslib.BitString.oddExpect_add, Cslib.BitString.oddExpect_const_mul). Each coordinate marginal is half the uniform average with the zero string masked out (Cslib.BitString.oddExpect_fst, Cslib.BitString.oddExpect_snd).

A nonzero a has a · c = 1 for exactly half of the c, so a bound holding for every such c holds for twice the masked average over c: if g ≤ h(c) whenever a · c = 1, then g ≤ 2 E_c [a · c = 1] h(c) (Cslib.BitString.le_two_mul_expect_ite_of_forall). This turns pointwise estimates through an auxiliary odd string c into averaged ones.

Main definitions #

Main results #

theorem Cslib.BitString.dens_oddFiber {ι : Type u_1} [Fintype ι] [DecidableEq ι] {a : ι → Bool} (ha : a ≠ 0) :
↑{b : ι → Bool | a ⬝ᵥ b = true}.dens = 1 / 2

Exactly half the strings have odd inner product with a fixed nonzero string.

theorem Cslib.BitString.oddFiber_nonempty {ι : Type u_1} [Fintype ι] [DecidableEq ι] {a : ι → Bool} (ha : a ≠ 0) :
{b : ι → Bool | a ⬝ᵥ b = true}.Nonempty

Every nonzero string has a partner with odd inner product.

theorem Cslib.BitString.le_two_mul_expect_ite_of_forall {ι : Type u_1} [Fintype ι] [DecidableEq ι] {a : ι → Bool} (ha : a ≠ 0) {g : ℝ} {h : (ι → Bool) → ℝ} (hg : ∀ (c : ι → Bool), a ⬝ᵥ c = true → g ≤ h c) :
g ≤ 2 * Finset.univ.expect fun (c : ι → Bool) => if a ⬝ᵥ c = true then h c else 0

A nonzero bit string gives a bound holding on its odd partners, which then holds for twice the masked average over all partners.

def Cslib.BitString.oddPairs (ι : Type u_2) [Fintype ι] [DecidableEq ι] :
Finset ((ι → Bool) × (ι → Bool))

The odd pairs (a, b) of bit strings, with a · b = 1.

@[simp]
theorem Cslib.BitString.mem_oddPairs {ι : Type u_1} [Fintype ι] [DecidableEq ι] {p : (ι → Bool) × (ι → Bool)} :
p ∈ oddPairs ι ↔ p.1 ⬝ᵥ p.2 = true

A pair is odd exactly when its bitwise inner product is one.

A nonempty index type has an odd pair: take the same one-hot string twice.

theorem Cslib.BitString.dens_oddPairs {ι : Type u_1} [Fintype ι] [DecidableEq ι] :
↑(oddPairs ι).dens = (1 - (2 ^ Fintype.card ι)⁻¹) / 2

The odd pairs have density (1 - 2⁻ⁿ) / 2 among all pairs of n-bit strings; for n = 0 there are none.

noncomputable def Cslib.BitString.oddExpect {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → (ι → Bool) → ℝ) :

The masked average over the odd pairs: E_{a,b} [a · b = 1] f(a, b).

theorem Cslib.BitString.oddExpect_def {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → (ι → Bool) → ℝ) :
oddExpect f = Finset.univ.expect fun (a : ι → Bool) => Finset.univ.expect fun (b : ι → Bool) => if a ⬝ᵥ b = true then f a b else 0
theorem Cslib.BitString.oddExpect_mono {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f g : (ι → Bool) → (ι → Bool) → ℝ} (h : ∀ (a b : ι → Bool), a ⬝ᵥ b = true → f a b ≤ g a b) :
theorem Cslib.BitString.oddExpect_nonneg {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → Bool) → (ι → Bool) → ℝ} (h : ∀ (a b : ι → Bool), a ⬝ᵥ b = true → 0 ≤ f a b) :
theorem Cslib.BitString.dens_oddPairs_le_half {ι : Type u_1} [Fintype ι] [DecidableEq ι] :
↑(oddPairs ι).dens ≤ 1 / 2

At most half of all pairs have odd inner product.

theorem Cslib.BitString.oddExpect_eq_dens_smul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → (ι → Bool) → ℝ) :
oddExpect f = ↑(oddPairs ι).dens * (oddPairs ι).expect fun (p : (ι → Bool) × (ι → Bool)) => f p.1 p.2

The masked average is the density of the odd pairs times the conditional average over them.

theorem Cslib.BitString.oddExpect_eq_dens_mul_expect {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → (ι → Bool) → ℝ) :
oddExpect f = ↑(oddPairs ι).dens * Finset.univ.expect fun (p : ↥(oddPairs ι)) => f (↑p).1 (↑p).2

The masked average is the density times the uniform average on the subtype of odd pairs.

theorem Cslib.BitString.oddExpect_fst {ι : Type u_1} [Fintype ι] [DecidableEq ι] (g : (ι → Bool) → ℝ) :
(oddExpect fun (a x : ι → Bool) => g a) = 1 / 2 * Finset.univ.expect fun (a : ι → Bool) => if a = 0 then 0 else g a

The first marginal of the masked odd-pair average is half the uniform average with the zero string removed by a mask.

theorem Cslib.BitString.oddExpect_swap {ι : Type u_1} [Fintype ι] [DecidableEq ι] (g : (ι → Bool) → (ι → Bool) → ℝ) :
(oddExpect fun (a b : ι → Bool) => g b a) = oddExpect g

Swapping the two coordinates preserves the masked odd-pair average.

theorem Cslib.BitString.oddExpect_snd {ι : Type u_1} [Fintype ι] [DecidableEq ι] (g : (ι → Bool) → ℝ) :
(oddExpect fun (x b : ι → Bool) => g b) = 1 / 2 * Finset.univ.expect fun (b : ι → Bool) => if b = 0 then 0 else g b

The second marginal has the same distribution as the first.

theorem Cslib.BitString.expect_eq_two_mul_oddExpect_fst_add_zero {ι : Type u_1} [Fintype ι] [DecidableEq ι] (g : (ι → Bool) → ℝ) :
(Finset.univ.expect fun (a : ι → Bool) => g a) = (2 * oddExpect fun (a x : ι → Bool) => g a) + g 0 / ↑(Fintype.card (ι → Bool))

Recover the uniform average from the masked first marginal and the contribution at zero.

theorem Cslib.BitString.oddExpect_add {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f g : (ι → Bool) → (ι → Bool) → ℝ) :
(oddExpect fun (a b : ι → Bool) => f a b + g a b) = oddExpect f + oddExpect g
theorem Cslib.BitString.oddExpect_const_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (r : ℝ) (f : (ι → Bool) → (ι → Bool) → ℝ) :
(oddExpect fun (a b : ι → Bool) => r * f a b) = r * oddExpect f