cfahlgren1/math / lean /OAI /Analysis /MutuallyUnbiased /Moments /NormalizedPartitions.lean
cfahlgren1's picture
download
raw
3.19 kB
import OAI.Analysis.MutuallyUnbiased.Moments.PartitionExpansion
import OAI.Analysis.MutuallyUnbiased.Moments.SmallPartitions
namespace OAI
noncomputable section
open scoped BigOperators ComplexConjugate
attribute [local instance] Classical.propDecidable
namespace MUB6
/-- Row sampling in an arbitrary number of retained nonzero coordinates. -/
def averagedRowProducts {p n : ℕ} (H : CMatrix) (A : Matrix (Fin p) (Fin n) ℤ) : ℝ :=
average (fun ρ : Fin p ↪ Coord =>
((∏ j, rowFourier H ρ (fun i => A i j)).re +
(∏ j, rowFourier H.transpose ρ (fun i => A i j)).re) / 2)
theorem inverse_six_pow_real (n : ℕ) :
(6 : ℂ)⁻¹ ^ n = (((6 : ℝ)⁻¹ ^ n : ℝ) : ℂ) := by
simp
theorem partition_integrand {p n : ℕ} {P : Type*} [Fintype P]
{H : CMatrix} (hH : IsHadamard H) (A : Matrix (Fin p) (Fin n) ℤ)
(ρ : Fin p ↪ Coord) (F : EqualityPatterns.Family (Fin n) P)
(cover : ∀ f : Fin n → Coord, ∃ s, ∀ i j,
F.label s i = F.label s j ↔ f i = f j) :
((∏ j, rowFourier H ρ (fun i => A i j)).re +
(∏ j, rowFourier H.transpose ρ (fun i => A i j)).re) / 2 =
(6 : ℝ)⁻¹ ^ n * ∑ s, ∑ κ : Fin (F.blocks s) ↪ Coord,
((exponentMonomial H (groupedColumns A (F.label s)) ρ κ).re +
(exponentMonomial H.transpose (groupedColumns A (F.label s)) ρ κ).re) / 2 := by
rw [rowFourier_partition_expand hH A ρ F cover,
rowFourier_partition_expand hH.transpose A ρ F cover, inverse_six_pow_real]
simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul,
sub_zero, Complex.re_sum, div_eq_mul_inv, ← Finset.sum_mul,
Finset.sum_add_distrib]
ring
theorem average_injection_sum {p q : ℕ} (H : CMatrix)
(A : Matrix (Fin p) (Fin q) ℤ) :
average (fun ρ : Fin p ↪ Coord => ∑ κ : Fin q ↪ Coord,
((exponentMonomial H A ρ κ).re +
(exponentMonomial H.transpose A ρ κ).re) / 2) =
(Fintype.card (Fin q ↪ Coord) : ℝ) * injectiveMoment H A := by
have he (ρ : Fin p ↪ Coord) := sum_eq_card_mul_average
(fun κ : Fin q ↪ Coord =>
((exponentMonomial H A ρ κ).re +
(exponentMonomial H.transpose A ρ κ).re) / 2)
simp_rw [he]
rw [average_mul, ← injectiveMoment_iterated H A]
/-- The normalized equality-pattern expansion. For k blocks the coefficient
is `card (Fin k ↪ Fin 6) / 6^n`, exactly `(6)_k / 6^n` in the source. -/
theorem averagedRowProducts_partition {p n : ℕ} {P : Type*} [Fintype P]
{H : CMatrix} (hH : IsHadamard H) (A : Matrix (Fin p) (Fin n) ℤ)
(F : EqualityPatterns.Family (Fin n) P)
(cover : ∀ f : Fin n → Coord, ∃ s, ∀ i j,
F.label s i = F.label s j ↔ f i = f j) :
averagedRowProducts H A =
∑ s, ((Fintype.card (Fin (F.blocks s) ↪ Coord) : ℝ) / 6 ^ n) *
injectiveMoment H (groupedColumns A (F.label s)) := by
unfold averagedRowProducts
simp_rw [partition_integrand hH A _ F cover]
rw [average_mul, average_sum, Finset.mul_sum]
apply Finset.sum_congr rfl
intro s _
rw [average_injection_sum H (groupedColumns A (F.label s))]
simp only [div_eq_mul_inv, inv_pow]
ring
end MUB6
end
end OAI

Xet Storage Details

Size:
3.19 kB
·
Xet hash:
ce16229fe1575f4441123b1bdb326e4016ccc6551657e3886334346479bf0c16

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.