Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarColumnMoments

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

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

59 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarFourthMoments7import Mathlib.Algebra.Polynomial.Roots8import Mathlib.Algebra.Polynomial.Eval.Degree910/-! # Arbitrary moments of a Haar column1112The argument uses exact two-row rotations and coefficient comparison in a13finite polynomial.  It never assumes a Gaussian description of Haar measure.14-/15noncomputable section16set_option backward.isDefEq.respectTransparency false17set_option maxHeartbeats 10000001819namespace Nonadditivity.HaarColumnMoments20open MeasureTheory HaarModel HaarMoments HaarFourthMoments Polynomial21open scoped Matrix Matrix.Norms.L2Operator22variable {N : ℕ}2324def rowRotationMatrix (i k : Fin (N+1)) (a b : ℝ) : Mat N := fun r s =>25  if r = i then (a:ℂ) * (if s = i then 1 else 0) +26    (b:ℂ) * (if s = k then 1 else 0)27  else if r = k then (b:ℂ) * (if s = i then 1 else 0) -28    (a:ℂ) * (if s = k then 1 else 0)29  else if r = s then 1 else 03031lemma rowRotationMatrix_mul (i k : Fin (N+1)) (a b : ℝ) (M : Mat N) (r s) :32    (rowRotationMatrix i k a b * M) r s =33      if r = i then (a:ℂ) * M i s + (b:ℂ) * M k s34      else if r = k then (b:ℂ) * M i s - (a:ℂ) * M k s35      else M r s := by36  by_cases hri : r = i37  · subst r38    simp [Matrix.mul_apply, rowRotationMatrix, add_mul, mul_ite,39      Finset.sum_add_distrib]40  · by_cases hrk : r = k41    · subst r42      simp [Matrix.mul_apply, rowRotationMatrix, hri, sub_mul, mul_ite,43        Finset.sum_sub_distrib]44    · simp [Matrix.mul_apply, rowRotationMatrix, hri, hrk]4546lemma rowRotationMatrix_star (i k : Fin (N+1)) (hik : i ≠ k) (a b : ℝ) :47    star (rowRotationMatrix i k a b) = rowRotationMatrix i k a b := by48  ext r s49  simp only [Matrix.star_eq_conjTranspose, Matrix.conjTranspose_apply]50  by_cases hri : r = i <;> by_cases hrk : r = k <;>51    by_cases hsi : s = i <;> by_cases hsk : s = k <;>52    simp_all [rowRotationMatrix, eq_comm]5354lemma rowRotationMatrix_sq (i k : Fin (N+1)) (hik : i ≠ k)55    (a b : ℝ) (hab : a^2 + b^2 = 1) :56    rowRotationMatrix i k a b * rowRotationMatrix i k a b = 1 := by57  have hab' : (a:ℂ)^2 + (b:ℂ)^2 = 1 := by exact_mod_cast hab58  clear hab'59  ext r s60  rw [rowRotationMatrix_mul]61  by_cases hri : r = i <;> by_cases hrk : r = k <;>62    by_cases hsi : s = i <;> by_cases hsk : s = k <;>63    simp_all [rowRotationMatrix, Matrix.one_apply, eq_comm] <;>64    first | ring1 |65      (have hc : (a:ℂ)^2 + (b:ℂ)^2 = 1 := by exact_mod_cast hab66       linear_combination hc)6768def rotation (i k : Fin (N+1)) (hik : i ≠ k)69    (a b : ℝ) (hab : a^2 + b^2 = 1) : LocalUnitary N :=70  ⟨rowRotationMatrix i k a b, by71    rw [Unitary.mem_iff, rowRotationMatrix_star i k hik]72    exact ⟨rowRotationMatrix_sq i k hik a b hab,73      rowRotationMatrix_sq i k hik a b hab⟩⟩7475@[simp] lemma rotation_mul_entry (i k j : Fin (N+1)) (hik : i ≠ k)76    (a b : ℝ) (hab : a^2 + b^2 = 1) (U : LocalUnitary N) :77    ((rotation i k hik a b hab * U : LocalUnitary N) : Mat N) i j =78      (a:ℂ) * (U : Mat N) i j + (b:ℂ) * (U : Mat N) k j := by79  change (rowRotationMatrix i k a b * (U : Mat N)) i j = _80  simp [rowRotationMatrix_mul]8182def moment (i j : Fin (N+1)) (p : ℕ) : ℝ :=83  ∫ U : LocalUnitary N, ‖(U : Mat N) i j‖^(2*p) ∂haar N8485lemma moment_zero (i j : Fin (N+1)) : moment i j 0 = 1 := by86  simp [moment]8788lemma moment_one (i j : Fin (N+1)) : moment i j 1 = 1 / (N+1:ℝ) := by89  simpa [moment] using integral_entry_norm_sq i j9091lemma moment_rotation (i k j : Fin (N+1)) (hik : i ≠ k)92    (a b : ℝ) (hab : a^2 + b^2 = 1) (p : ℕ) :93    (∫ U : LocalUnitary N,94      ‖(a:ℂ) * (U : Mat N) i j + (b:ℂ) * (U : Mat N) k j‖^(2*p) ∂haar N) =95        moment i j p := by96  simpa [moment] using integral_mul_left_eq_self (μ := haar N)97    (fun U : LocalUnitary N => ‖(U : Mat N) i j‖^(2*p)) (rotation i k hik a b hab)9899lemma moment_add (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) (t : ℝ) :100    (∫ U : LocalUnitary N,101      ‖(U : Mat N) i j + (t:ℂ) * (U : Mat N) k j‖^(2*p) ∂haar N) =102        (1+t^2)^p * moment i j p := by103  let a : ℝ := (Real.sqrt (1+t^2))⁻¹104  have ht : 0 < 1+t^2 := by positivity105  have ha : a^2 * (1+t^2) = 1 := by106    dsimp [a]107    rw [inv_pow, Real.sq_sqrt ht.le, inv_mul_cancel₀ ht.ne']108  have hab : a^2 + (a*t)^2 = 1 := by nlinarith109  have hr := moment_rotation i k j hik a (a*t) hab p110  have he (x y : ℂ) : (a:ℂ)*x + ((a*t:ℝ):ℂ)*y = (a:ℂ)*(x+(t:ℂ)*y) := by111    push_cast112    ring113  simp_rw [he, norm_mul, mul_pow, integral_const_mul] at hr114  have hp : ‖(a:ℂ)‖^(2*p) * (1+t^2)^p = 1 := by115    rw [Complex.norm_real, Real.norm_eq_abs, pow_mul, sq_abs, ← mul_pow, ha, one_pow]116  let Ival : ℝ := ∫ U : LocalUnitary N,117    ‖(U : Mat N) i j + (t:ℂ) * (U : Mat N) k j‖^(2*p) ∂haar N118  change Ival = _119  change ‖(a:ℂ)‖^(2*p) * Ival = _ at hr120  calc121    Ival = (‖(a:ℂ)‖^(2*p) * (1+t^2)^p) * Ival := by rw [hp, one_mul]122    _ = (1+t^2)^p * (‖(a:ℂ)‖^(2*p) * Ival) := by ring123    _ = _ := by rw [hr]124125/-- Integrate a uniformly bounded-degree polynomial coefficient by coefficient. -/126def averagePolynomial (P : LocalUnitary N → ℂ[X]) (d : ℕ) : ℂ[X] :=127  ∑ k ∈ Finset.range d, monomial k (∫ U, (P U).coeff k ∂haar N)128129lemma averagePolynomial_coeff (P : LocalUnitary N → ℂ[X]) (d k : ℕ)130    (hk : k < d) : (averagePolynomial P d).coeff k = ∫ U, (P U).coeff k ∂haar N := by131  simp [averagePolynomial, coeff_monomial, hk]132133lemma averagePolynomial_eval (P : LocalUnitary N → ℂ[X]) (d : ℕ)134    (hdeg : ∀ U, (P U).natDegree < d)135    (hint : ∀ k, Integrable (fun U => (P U).coeff k) (haar N)) (z : ℂ) :136    (averagePolynomial P d).eval z = ∫ U, (P U).eval z ∂haar N := by137  simp only [averagePolynomial, eval_finset_sum, eval_monomial]138  simp_rw [← integral_mul_const]139  rw [← integral_finset_sum _ (fun k _ => (hint k).mul_const _)]140  apply integral_congr_ae141  filter_upwards [] with U142  exact (eval_eq_sum_range' (hdeg U) z).symm143144lemma coeff_mul_two (P Q : ℂ[X]) :145    (P*Q).coeff 2 = P.coeff 0 * Q.coeff 2 + P.coeff 1 * Q.coeff 1 +146      P.coeff 2 * Q.coeff 0 := by147  simp [coeff_mul, Finset.Nat.antidiagonal_succ, Finset.antidiagonal_zero]148  ring149150lemma coeff_linear_pow_zero (x y : ℂ) (p : ℕ) :151    ((C x + X * C y)^p).coeff 0 = x^p := by rw [coeff_zero_eq_eval_zero]; simp152153lemma coeff_linear_pow_one (x y : ℂ) (p : ℕ) :154    ((C x + X * C y)^(p+1)).coeff 1 = (p+1:ℂ)*x^p*y := by155  induction p with156  | zero => simp157  | succ p ih =>158    rw [pow_succ, mul_coeff_one, ih]159    simp [coeff_zero_eq_eval_zero]160    ring161162lemma coeff_linear_pow_two (x y : ℂ) (p : ℕ) :163    ((C x + X * C y)^(p+2)).coeff 2 =164      ((p+2:ℂ)*(p+1:ℂ)/2)*x^p*y^2 := by165  induction p with166  | zero =>167    rw [pow_two, coeff_mul_two]168    simp169    ring170  | succ p ih =>171    rw [show p+1+2 = (p+2)+1 by omega, pow_succ, coeff_mul_two, ih]172    rw [show p+2 = (p+1)+1 by omega, coeff_linear_pow_one]173    simp only [coeff_add, coeff_C, coeff_X_mul, if_true, if_false, zero_add,174      add_zero, one_ne_zero, Nat.cast_add, Nat.cast_one]175    simp176    ring177178179lemma continuous_coeff_pow {P : LocalUnitary N → ℂ[X]}180    (hP : ∀ k, Continuous (fun U => (P U).coeff k)) (p k : ℕ) :181    Continuous (fun U => ((P U)^p).coeff k) := by182  induction p generalizing k with183  | zero => simpa using (continuous_const : Continuous (fun _ : LocalUnitary N => (1:ℂ[X]).coeff k))184  | succ p ih =>185    simp only [pow_succ, coeff_mul]186    exact continuous_finset_sum _ (fun x _ => (ih x.1).mul (hP x.2))187188def entryPolynomial (i k j : Fin (N+1)) (p : ℕ) (U : LocalUnitary N) : ℂ[X] :=189  (C ((U:Mat N) i j) + X*C ((U:Mat N) k j))^p *190  (C (star ((U:Mat N) i j)) + X*C (star ((U:Mat N) k j)))^p191192lemma continuous_entryPolynomial_coeff (i k j : Fin (N+1)) (p r : ℕ) :193    Continuous (fun U : LocalUnitary N => (entryPolynomial i k j p U).coeff r) := by194  have hf (a b : LocalUnitary N → ℂ) (ha : Continuous a) (hb : Continuous b) (q : ℕ) :195      Continuous (fun U => ((C (a U) + X*C (b U))^p).coeff q) := by196    apply continuous_coeff_pow197    intro l198    cases l with199    | zero => simpa [coeff_zero_eq_eval_zero] using ha200    | succ l =>201      cases l with202      | zero => simpa using hb203      | succ l => simpa using (continuous_const : Continuous (fun _ : LocalUnitary N => (0:ℂ)))204  simp only [entryPolynomial, coeff_mul]205  exact continuous_finset_sum _ (fun x _ =>206    (hf _ _ (continuous_entry i j) (continuous_entry k j) x.1).mul207      (hf _ _ (continuous_entry i j).star (continuous_entry k j).star x.2))208209lemma entryPolynomial_degree (i k j : Fin (N+1)) (p : ℕ) (U : LocalUnitary N) :210    (entryPolynomial i k j p U).natDegree < 2*p+1 := by211  have hlin (x y : ℂ) : (C x + X*C y).natDegree ≤ 1 := by212    compute_degree213  have hp (x y : ℂ) : ((C x + X*C y)^p).natDegree ≤ p := by214    exact natDegree_pow_le.trans (by simpa using Nat.mul_le_mul_left p (hlin x y))215  exact (natDegree_mul_le.trans (Nat.add_le_add (hp _ _) (hp _ _))).trans_lt (by omega)216217lemma norm_even_complex (z : ℂ) (p : ℕ) :218    ((‖z‖^(2*p):ℝ):ℂ) = z^p * (star z)^p := by219  rw [pow_mul, ← Complex.normSq_eq_norm_sq, Complex.ofReal_pow,220    Complex.normSq_eq_conj_mul_self, mul_pow, mul_comm]221  rfl222223lemma entryPolynomial_eval_real (i k j : Fin (N+1)) (p : ℕ)224    (U : LocalUnitary N) (t : ℝ) :225    (entryPolynomial i k j p U).eval (t:ℂ) =226      ((‖(U:Mat N) i j + (t:ℂ)*(U:Mat N) k j‖^(2*p):ℝ):ℂ) := by227  rw [norm_even_complex]228  simp only [entryPolynomial, eval_mul, eval_pow, eval_add, eval_C, eval_X,229    star_add, star_mul, Complex.star_def, Complex.conj_ofReal]230  congr 1; ring231232lemma average_entryPolynomial (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :233    averagePolynomial (entryPolynomial i k j p) (2*p+1) =234      C (moment i j p : ℂ) * (1+X^2)^p := by235  apply Polynomial.eq_of_infinite_eval_eq236  have hinf : Set.Infinite (Set.range (Complex.ofReal : ℝ → ℂ)) :=237    Set.infinite_range_of_injective Complex.ofReal_injective238  apply hinf.mono239  rintro _ ⟨t, rfl⟩240  change _ = _241  rw [averagePolynomial_eval _ _ (entryPolynomial_degree i k j p)242    (fun r => (continuous_entryPolynomial_coeff i k j p r).integrable_of_hasCompactSupport243      (HasCompactSupport.of_compactSpace _))]244  simp_rw [entryPolynomial_eval_real]245  rw [integral_complex_ofReal, moment_add i k j hik]246  simp247  ring248249lemma integral_phase_square_left_zero (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :250    (∫ U : LocalUnitary N, ((U:Mat N) i j)^p * ((U:Mat N) k j)^2 *251      (star ((U:Mat N) i j))^(p+2) ∂haar N) = 0 := by252  apply integral_eq_zero_of_mul_left_eq_neg (g := rowPhase k Complex.I (by simp))253  intro U254  simp [hik, mul_pow]255256lemma integral_phase_square_right_zero (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :257    (∫ U : LocalUnitary N, ((U:Mat N) i j)^(p+2) *258      (star ((U:Mat N) i j))^p * (star ((U:Mat N) k j))^2 ∂haar N) = 0 := by259  apply integral_eq_zero_of_mul_left_eq_neg (g := rowPhase k Complex.I (by simp))260  intro U261  simp [hik, mul_pow]262263lemma coeff_one_add_X_sq_pow_zero (p : ℕ) :264    ((1+X^2:ℂ[X])^p).coeff 0 = 1 := by simp [coeff_zero_eq_eval_zero]265266lemma coeff_one_add_X_sq_pow_one (p : ℕ) :267    ((1+X^2:ℂ[X])^p).coeff 1 = 0 := by268  induction p with269  | zero => simp [coeff_one]270  | succ p ih =>271    rw [pow_succ, mul_coeff_one, ih]272    simp [coeff_one, coeff_zero_eq_eval_zero]273274lemma coeff_one_add_X_sq_pow_two (p : ℕ) :275    ((1+X^2:ℂ[X])^p).coeff 2 = (p:ℂ) := by276  induction p with277  | zero => simp [coeff_one]278  | succ p ih =>279    rw [pow_succ, coeff_mul_two, ih, coeff_one_add_X_sq_pow_zero,280      coeff_one_add_X_sq_pow_one]281    simp [coeff_one]282    ring283284def mixed (i k j : Fin (N+1)) (p : ℕ) : ℝ :=285  ∫ U : LocalUnitary N, ‖(U:Mat N) i j‖^(2*p) * ‖(U:Mat N) k j‖^2 ∂haar N286287lemma entryPolynomial_coeff_two (i k j : Fin (N+1)) (p : ℕ) (U : LocalUnitary N) :288    (entryPolynomial i k j (p+2) U).coeff 2 =289      ((p+2:ℂ)*(p+1:ℂ)/2) *290        (((U:Mat N) i j)^p * ((U:Mat N) k j)^2 * (star ((U:Mat N) i j))^(p+2)) +291      ((p+2:ℂ)*(p+1:ℂ)/2) *292        (((U:Mat N) i j)^(p+2) * (star ((U:Mat N) i j))^p * (star ((U:Mat N) k j))^2) +293      (p+2:ℂ)^2 *294        ((‖(U:Mat N) i j‖^(2*(p+1)) * ‖(U:Mat N) k j‖^2 : ℝ):ℂ) := by295  rw [entryPolynomial, coeff_mul_two, coeff_linear_pow_zero,296    coeff_linear_pow_zero, coeff_linear_pow_two, coeff_linear_pow_two]297  rw [show p+2 = (p+1)+1 by omega, coeff_linear_pow_one, coeff_linear_pow_one]298  rw [Complex.ofReal_mul, norm_even_complex]299  have hy := norm_even_complex ((U:Mat N) k j) 1300  norm_num only [Nat.mul_one, pow_one] at hy301  rw [hy]302  push_cast303  ring304305lemma integral_entryPolynomial_coeff_two (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :306    (∫ U : LocalUnitary N, (entryPolynomial i k j (p+2) U).coeff 2 ∂haar N) =307      (p+2:ℂ)^2 * (mixed i k j (p+1) : ℂ) := by308  let c : ℂ := (p+2:ℂ)*(p+1:ℂ)/2309  let f : LocalUnitary N → ℂ := fun U =>310    ((U:Mat N) i j)^p * ((U:Mat N) k j)^2 * (star ((U:Mat N) i j))^(p+2)311  let g : LocalUnitary N → ℂ := fun U =>312    ((U:Mat N) i j)^(p+2) * (star ((U:Mat N) i j))^p * (star ((U:Mat N) k j))^2313  let h : LocalUnitary N → ℝ := fun U =>314    ‖(U:Mat N) i j‖^(2*(p+1)) * ‖(U:Mat N) k j‖^2315  have hf : Continuous f := ((continuous_entry i j).pow p |>.mul316    ((continuous_entry k j).pow 2)).mul ((continuous_entry i j).star.pow (p+2))317  have hg : Continuous g := ((continuous_entry i j).pow (p+2) |>.mul318    ((continuous_entry i j).star.pow p)).mul ((continuous_entry k j).star.pow 2)319  have hh : Continuous (fun U => (h U : ℂ)) := Complex.continuous_ofReal.comp320    (((continuous_entry i j).norm.pow (2*(p+1))).mul ((continuous_entry k j).norm.pow 2))321  have hif : Integrable (fun U => c * f U) (haar N) := (hf.const_mul c).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)322  have hig : Integrable (fun U => c * g U) (haar N) := (hg.const_mul c).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)323  have hih : Integrable (fun U => (p+2:ℂ)^2 * (h U : ℂ)) (haar N) := (hh.const_mul ((p+2:ℂ)^2)).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)324  simp_rw [entryPolynomial_coeff_two]325  have hi1 := integral_add (hif.add hig) hih326  have hi2 := integral_add hif hig327  simp only [Pi.add_apply] at hi1 hi2328  dsimp only [c, f, g, h] at hi1 hi2329  rw [hi1, hi2]330  simp only [integral_const_mul, integral_phase_square_left_zero i k j hik,331    integral_phase_square_right_zero i k j hik, mul_zero, zero_add]332  rw [integral_complex_ofReal]333  rfl334335/-- The degree-two coefficient of rotation invariance determines the mixed moment. -/336theorem moment_eq_succ_mul_mixed (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :337    moment i j (p+2) = (p+2:ℝ) * mixed i k j (p+1) := by338  have he := congrArg (fun P : ℂ[X] => P.coeff 2)339    (average_entryPolynomial i k j hik (p+2))340  dsimp only at he341  rw [averagePolynomial_coeff _ _ _ (by omega), integral_entryPolynomial_coeff_two i k j hik,342    coeff_C_mul, coeff_one_add_X_sq_pow_two] at he343  have hreal : (p+2:ℝ)^2 * mixed i k j (p+1) = moment i j (p+2) * (p+2:ℝ) := by344    exact_mod_cast he345  have hp : (0:ℝ) < p+2 := by positivity346  nlinarith347348lemma mixed_self (i j : Fin (N+1)) (p : ℕ) : mixed i i j p = moment i j (p+1) := by349  unfold mixed moment350  apply integral_congr_ae351  filter_upwards [] with U352  rw [← pow_add]353  congr 1354355lemma mixed_of_ne (i k j : Fin (N+1)) (hik : i ≠ k) (p : ℕ) :356    mixed i k j p = moment i j (p+1) / (p+1:ℝ) := by357  cases p with358  | zero => simp [mixed, moment_one, integral_entry_norm_sq]359  | succ p =>360    have hm := moment_eq_succ_mul_mixed i k j hik p361    push_cast362    apply (eq_div_iff (by positivity : (p+1+1:ℝ) ≠ 0)).mpr363    convert hm.symm using 1; ring364365lemma sum_mixed (i j : Fin (N+1)) (p : ℕ) : ∑ k, mixed i k j p = moment i j p := by366  unfold mixed moment367  have hi := integral_finset_sum Finset.univ (fun k _ => integrable_continuous368    (((continuous_entry i j).norm.pow (2*p)).mul ((continuous_entry k j).norm.pow 2)))369  simp only [Pi.mul_apply] at hi370  rw [← hi]371  simp_rw [← Finset.mul_sum, column_sum_norm_sq, mul_one]372373/-- The all-order Haar moment recurrence, with no asymptotic hypothesis. -/374theorem moment_recurrence (i j : Fin (N+1)) (p : ℕ) :375    (N+p+1:ℝ) * moment i j (p+1) = (p+1:ℝ) * moment i j p := by376  have hm (k : Fin (N+1)) : mixed i k j p =377      (if k=i then moment i j (p+1) - moment i j (p+1)/(p+1:ℝ) else 0) +378        moment i j (p+1)/(p+1:ℝ) := by379    by_cases hki : k=i380    · subst k381      simp [mixed_self]382    · simp [hki, mixed_of_ne i k j (Ne.symm hki)]383  have hs := sum_mixed i j p384  simp_rw [hm] at hs385  simp only [Finset.sum_add_distrib, Finset.sum_ite_eq', Finset.mem_univ, if_true,386    Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul,387    Nat.cast_add, Nat.cast_one] at hs388  have hp : (p+1:ℝ) ≠ 0 := by positivity389  field_simp at hs390  nlinarith391392/-- Every even absolute Haar entry moment is the exact factorial ratio. -/393theorem integral_entry_norm_even (i j : Fin (N+1)) (p : ℕ) :394    (∫ U : LocalUnitary N, ‖(U:Mat N) i j‖^(2*p) ∂haar N) =395      (p.factorial:ℝ) / ((N+1).ascFactorial p : ℝ) := by396  change moment i j p = _397  induction p with398  | zero => simp [moment_zero]399  | succ p ih =>400    have hm := moment_recurrence i j p401    rw [ih] at hm402    rw [Nat.factorial_succ, Nat.ascFactorial_succ]403    push_cast404    have hd : (0:ℝ) < (N+1).ascFactorial p := by exact_mod_cast Nat.ascFactorial_pos N p405    have hp : (0:ℝ) < N+1+p := by positivity406    apply (eq_div_iff (mul_ne_zero hp.ne' hd.ne')).mpr407    field_simp at hm408    nlinarith409410/-- The exact moments obey the Gaussian-size upper bound at every order. -/411theorem integral_entry_norm_even_le (i j : Fin (N+1)) (p : ℕ) :412    (∫ U : LocalUnitary N, ‖(U:Mat N) i j‖^(2*p) ∂haar N) ≤413      (p.factorial:ℝ) / (N+1:ℝ)^p := by414  rw [integral_entry_norm_even]415  apply div_le_div_of_nonneg_left (by positivity) (by positivity)416  exact_mod_cast Nat.pow_succ_le_ascFactorial (N+1) p417418/-- The exact formula persists for each independent sampled block coordinate. -/419theorem integral_sample_entry_norm_even (K n : ℕ) (a : Fin n × Fin K)420    (i j : Fin (N+1)) (p : ℕ) :421    (∫ ω : Sample K n N, ‖(ω a : Mat N) i j‖^(2*p) ∂sampleMeasure K n N) =422      (p.factorial:ℝ) / ((N+1).ascFactorial p : ℝ) := by423  exact (integral_comp_eval (μ := fun _ : Fin n × Fin K => haar N) (i := a)424    ((continuous_entry i j).norm.pow (2*p)).aestronglyMeasurable).trans425      (integral_entry_norm_even i j p)426427end Nonadditivity.HaarColumnMoments428429