Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarFourthMoments

Download original .lean · View on GitHub · Jump to source

Direct imports

Imported by project modules

2 direct reverse imports

Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.

Declarations in this module

43 project constants, including generated, internal and private declarations.

43 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarMoments78/-! # Exact fourth entry moments from Haar invariance910Explicit phase and two-row Hadamard unitaries, together with a four-phase11polarization identity, prove the first higher Haar moments.12-/13noncomputable section14set_option backward.isDefEq.respectTransparency false15namespace Nonadditivity.HaarFourthMoments16open MeasureTheory HaarModel HaarMoments17open scoped Matrix Matrix.Norms.L2Operator18variable {N : ℕ}19abbrev Mat (N : ℕ) := Matrix (Fin (N+1)) (Fin (N+1)) ℂ2021def rowPhase (i : Fin (N+1)) (z : ℂ) (hz : star z * z = 1) : LocalUnitary N :=22  ⟨Matrix.diagonal (fun r => if r = i then z else 1), by23    change (starRingEnd ℂ) z * z = 1 at hz24    rw [Unitary.mem_iff]25    constructor <;>26      simp only [Matrix.star_eq_conjTranspose, Matrix.diagonal_conjTranspose,27        Matrix.diagonal_mul_diagonal] <;>28      ext r s <;> by_cases hrs : r = s29    · subst s; by_cases h : r = i <;> simp [h, hz]30    · simp [hrs]31    · subst s; by_cases h : r = i <;> simp [h, mul_comm z, hz]32    · simp [hrs]⟩3334@[simp] theorem rowPhase_mul_entry (i r s : Fin (N+1)) (z : ℂ)35    (hz : star z * z = 1) (U : LocalUnitary N) :36    ((rowPhase i z hz * U : LocalUnitary N) : Mat N) r s =37      (if r = i then z else 1) * (U : Mat N) r s := by38  change (Matrix.diagonal (fun a : Fin (N+1) => if a = i then z else 1) * (U : Mat N)) r s = _39  simp [Matrix.diagonal_mul]4041def rotationCoefficient : ℂ := (Real.sqrt 2 : ℂ)⁻¹4243lemma rotationCoefficient_star : starRingEnd ℂ rotationCoefficient = rotationCoefficient := by44  simp [rotationCoefficient]4546lemma rotationCoefficient_sq : rotationCoefficient ^ 2 = 1 / 2 := by47  simp [rotationCoefficient, inv_pow, ← Complex.ofReal_pow, Real.sq_sqrt]4849lemma rotationCoefficient_norm_four : ‖rotationCoefficient‖ ^ 4 = (1:ℝ) / 4 := by50  have h := congrArg norm rotationCoefficient_sq51  norm_num [norm_pow, norm_div] at h52  nlinarith [sq_nonneg (‖rotationCoefficient‖ ^ 2)]5354/-- A Hadamard transformation on two rows, and the identity on their complement. -/55def rotationMatrix (i k : Fin (N+1)) : Mat N := fun r s =>56  if r = i then rotationCoefficient * (if s = i then 1 else 0) +57    rotationCoefficient * (if s = k then 1 else 0)58  else if r = k then rotationCoefficient * (if s = i then 1 else 0) -59    rotationCoefficient * (if s = k then 1 else 0)60  else if r = s then 1 else 06162lemma rotationMatrix_mul (i k : Fin (N+1)) (M : Mat N) (r s) :63    (rotationMatrix i k * M) r s =64      if r = i then rotationCoefficient * M i s + rotationCoefficient * M k s65      else if r = k then rotationCoefficient * M i s - rotationCoefficient * M k s66      else M r s := by67  by_cases hri : r = i68  · subst r69    simp [Matrix.mul_apply, rotationMatrix, add_mul, mul_ite,70      Finset.sum_add_distrib]71  · by_cases hrk : r = k72    · subst r73      simp [Matrix.mul_apply, rotationMatrix, hri, sub_mul, mul_ite,74        Finset.sum_sub_distrib]75    · simp [Matrix.mul_apply, rotationMatrix, hri, hrk]7677lemma rotationMatrix_star (i k : Fin (N+1)) (hik : i ≠ k) :78    star (rotationMatrix i k) = rotationMatrix i k := by79  ext r s80  simp only [Matrix.star_eq_conjTranspose, Matrix.conjTranspose_apply]81  by_cases hri : r = i <;> by_cases hrk : r = k <;>82    by_cases hsi : s = i <;> by_cases hsk : s = k <;>83    simp_all [rotationMatrix, rotationCoefficient_star, eq_comm]8485lemma rotationMatrix_sq (i k : Fin (N+1)) (hik : i ≠ k) :86    rotationMatrix i k * rotationMatrix i k = 1 := by87  ext r s88  rw [rotationMatrix_mul i k]89  by_cases hri : r = i <;> by_cases hrk : r = k <;>90    by_cases hsi : s = i <;> by_cases hsk : s = k <;>91    simp_all [rotationMatrix, Matrix.one_apply, eq_comm, ← two_mul,92      ← sq, rotationCoefficient_sq]9394/-- The explicit Hadamard matrix is an actual member of the compact unitary group. -/95def rowRotation (i k : Fin (N+1)) (hik : i ≠ k) : LocalUnitary N :=96  ⟨rotationMatrix i k, by97    rw [Unitary.mem_iff, rotationMatrix_star i k hik]98    exact ⟨rotationMatrix_sq i k hik, rotationMatrix_sq i k hik⟩⟩99100@[simp] lemma rowRotation_mul_entry (i k j : Fin (N+1)) (hik : i ≠ k)101    (U : LocalUnitary N) :102    ((rowRotation i k hik * U : LocalUnitary N) : Mat N) i j =103      rotationCoefficient * ((U : Mat N) i j + (U : Mat N) k j) := by104  change (rotationMatrix i k * (U : Mat N)) i j = _105  simp [rotationMatrix_mul i k, mul_add]106107lemma fourth_polarization (x y : ℂ) :108    ‖x + y‖ ^ 4 + ‖x - y‖ ^ 4 + ‖x + Complex.I * y‖ ^ 4 +109      ‖x - Complex.I * y‖ ^ 4 =110    4 * ‖x‖ ^ 4 + 4 * ‖y‖ ^ 4 + 16 * (‖x‖ ^ 2 * ‖y‖ ^ 2) := by111  have he (z : ℂ) : ‖z‖ ^ 4 = (Complex.normSq z) ^ 2 := by112    rw [Complex.normSq_eq_norm_sq]113    ring114  simp_rw [he, Complex.sq_norm]115  simp only [Complex.normSq_apply, Complex.add_re, Complex.add_im,116    Complex.sub_re, Complex.sub_im, Complex.mul_re, Complex.mul_im,117    Complex.I_re, Complex.I_im]118  ring119120lemma integrable_continuous {f : LocalUnitary N → ℝ} (hf : Continuous f) :121    Integrable f (haar N) :=122  hf.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)123124def fourthMoment (i j : Fin (N+1)) : ℝ := ∫ U : LocalUnitary N, ‖(U : Mat N) i j‖ ^ 4 ∂haar N125126def mixedMoment (i k j : Fin (N+1)) : ℝ := ∫ U : LocalUnitary N,127  ‖(U : Mat N) i j‖ ^ 2 * ‖(U : Mat N) k j‖ ^ 2 ∂haar N128129lemma fourthMoment_row_eq (i k j : Fin (N+1)) : fourthMoment i j = fourthMoment k j := by130  simpa [fourthMoment] using (integral_mul_left_eq_self (μ := haar N)131    (fun U : LocalUnitary N => ‖(U : Mat N) k j‖ ^ 4)132    (rowPermutation (Equiv.swap i k)))133134lemma phase_sum_fourth (i k j : Fin (N+1)) (hik : i ≠ k) (z : ℂ)135    (hz : star z * z = 1) :136    (∫ U : LocalUnitary N, ‖(U : Mat N) i j + z * (U : Mat N) k j‖ ^ 4 ∂haar N) =137    ∫ U : LocalUnitary N, ‖(U : Mat N) i j + (U : Mat N) k j‖ ^ 4 ∂haar N := by138  simpa [hik] using (integral_mul_left_eq_self (μ := haar N)139    (fun U : LocalUnitary N => ‖(U : Mat N) i j + (U : Mat N) k j‖ ^ 4)140    (rowPhase k z hz))141142lemma rotated_fourth (i k j : Fin (N+1)) (hik : i ≠ k) :143    (∫ U : LocalUnitary N, ‖(U : Mat N) i j + (U : Mat N) k j‖ ^ 4 ∂haar N) =144      4 * fourthMoment i j := by145  have h := integral_mul_left_eq_self (μ := haar N)146    (fun U : LocalUnitary N => ‖(U : Mat N) i j‖ ^ 4) (rowRotation i k hik)147  simp only [rowRotation_mul_entry, norm_mul, mul_pow, rotationCoefficient_norm_four,148    integral_const_mul] at h149  unfold fourthMoment150  linarith151152/-- A coordinate fourth moment is twice a distinct-row mixed square moment. -/153lemma fourthMoment_eq_two_mixed (i k j : Fin (N+1)) (hik : i ≠ k) :154    fourthMoment i j = 2 * mixedMoment i k j := by155  have hm := phase_sum_fourth i k j hik (-1) (by simp)156  have hi := phase_sum_fourth i k j hik Complex.I (by simp)157  have hmi := phase_sum_fourth i k j hik (-Complex.I) (by simp)158  simp only [neg_one_mul, ← sub_eq_add_neg] at hm159  simp only [neg_mul, ← sub_eq_add_neg] at hmi160  have hpol := integral_congr_ae (μ := haar N)161    (Filter.Eventually.of_forall fun U : LocalUnitary N => fourth_polarization162      ((U : Mat N) i j) ((U : Mat N) k j))163  have hc₁ := (continuous_entry i j).norm.pow 4164  have hc₂ := (continuous_entry k j).norm.pow 4165  have hp := ((continuous_entry i j).add (continuous_entry k j)).norm.pow 4166  have hm' := ((continuous_entry i j).sub (continuous_entry k j)).norm.pow 4167  have hi' := ((continuous_entry i j).add168    ((continuous_entry k j).const_mul Complex.I)).norm.pow 4169  have hmi' := ((continuous_entry i j).sub170    ((continuous_entry k j).const_mul Complex.I)).norm.pow 4171  have hcross := ((continuous_entry i j).norm.pow 2).mul172    ((continuous_entry k j).norm.pow 2)173  have h₁ := integral_add (integrable_continuous ((hp.add hm').add hi'))174    (integrable_continuous hmi')175  have h₂ := integral_add (integrable_continuous (hp.add hm')) (integrable_continuous hi')176  have h₃ := integral_add (integrable_continuous hp) (integrable_continuous hm')177  have h₄ := integral_add (integrable_continuous ((hc₁.const_mul 4).add (hc₂.const_mul 4)))178    (integrable_continuous (hcross.const_mul 16))179  have h₅ := integral_add (integrable_continuous (hc₁.const_mul 4))180    (integrable_continuous (hc₂.const_mul 4))181  simp only [Pi.add_apply, Pi.mul_apply] at h₁ h₂ h₃ h₄ h₅182  rw [h₁, h₂, h₃, h₄, h₅] at hpol183  simp only [integral_const_mul] at hpol184  rw [hm, hi, hmi, rotated_fourth i k j hik] at hpol185  change 4 * fourthMoment i j + 4 * fourthMoment i j + 4 * fourthMoment i j +186    4 * fourthMoment i j = 4 * fourthMoment i j + 4 * fourthMoment k j +187      16 * mixedMoment i k j at hpol188  rw [← fourthMoment_row_eq i k j] at hpol189  linarith190191lemma column_sum_norm_sq (U : LocalUnitary N) (j : Fin (N+1)) :192    ∑ k, ‖(U : Mat N) k j‖ ^ 2 = 1 := by193  simp_rw [← Complex.normSq_eq_norm_sq]194  apply Complex.ofReal_injective195  push_cast196  simp_rw [Complex.normSq_eq_conj_mul_self,197    mul_comm (starRingEnd ℂ _)]198  simpa using HaarMoments.sum_entry_product U j j199200lemma mixedMoment_self (i j : Fin (N+1)) : mixedMoment i i j = fourthMoment i j := by201  unfold mixedMoment fourthMoment202  apply integral_congr_ae203  filter_upwards [] with U204  ring205206lemma sum_mixedMoment (i j : Fin (N+1)) :207    ∑ k, mixedMoment i k j = 1 / (N+1:ℝ) := by208  unfold mixedMoment209  have hs := integral_finset_sum Finset.univ (fun k _ => integrable_continuous210    (((continuous_entry i j).norm.pow 2).mul ((continuous_entry k j).norm.pow 2)))211  simp only [Pi.mul_apply] at hs212  rw [← hs]213  simp_rw [← Finset.mul_sum, column_sum_norm_sq, mul_one]214  exact integral_entry_norm_sq i j215216/-- Exact fourth absolute moment of every Haar-unitary entry. -/217theorem integral_entry_norm_four (i j : Fin (N+1)) :218    (∫ U : LocalUnitary N, ‖(U : Mat N) i j‖ ^ 4 ∂haar N) =219      2 / ((N+1:ℝ) * (N+2:ℝ)) := by220  have hm (k : Fin (N+1)) : mixedMoment i k j =221      if k = i then fourthMoment i j else fourthMoment i j / 2 := by222    by_cases hki : k = i223    · subst k; simp [mixedMoment_self]224    · rw [if_neg hki]225      have h := fourthMoment_eq_two_mixed i k j (Ne.symm hki)226      linarith227  have h := sum_mixedMoment i j228  simp_rw [hm] at h229  have he (k : Fin (N+1)) :230      (if k = i then fourthMoment i j else fourthMoment i j / 2) =231      (if k = i then fourthMoment i j / 2 else 0) + fourthMoment i j / 2 := by232    split <;> ring233  simp_rw [he] at h234  simp only [Finset.sum_add_distrib, Finset.sum_ite_eq', Finset.mem_univ,235    if_true, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul,236    Nat.cast_add, Nat.cast_one] at h237  have hN₁ : (N+1:ℝ) ≠ 0 := by positivity238  have hN₂ : (N+2:ℝ) ≠ 0 := by positivity239  change fourthMoment i j = _240  apply (eq_div_iff (mul_ne_zero hN₁ hN₂)).mpr241  have h' := (eq_div_iff hN₁).mp h242  nlinarith243244/-- Exact mixed square moment for two distinct rows in the same Haar column. -/245theorem integral_entry_norm_sq_mul_norm_sq (i k j : Fin (N+1)) (hik : i ≠ k) :246    (∫ U : LocalUnitary N, ‖(U : Mat N) i j‖ ^ 2 * ‖(U : Mat N) k j‖ ^ 2 ∂haar N) =247      1 / ((N+1:ℝ) * (N+2:ℝ)) := by248  have h := fourthMoment_eq_two_mixed i k j hik249  have hf : fourthMoment i j = 2 / ((N+1:ℝ) * (N+2:ℝ)) := integral_entry_norm_four i j250  rw [hf] at h251  change mixedMoment i k j = _252  simp only [div_eq_mul_inv, one_mul] at h ⊢253  linarith254255end Nonadditivity.HaarFourthMoments