Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.PolynomialReduction

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

Direct imports

Imported by project modules

3 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

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

99 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.RegularFactorization7import Mathlib.GroupTheory.FreeGroup.Reduce89/-! # Constructed polynomial shortening1011The support at each step is obtained by cutting the actual reduced words. The12coefficient matrices are the positive-Gram factors, evaluated simultaneously13at every finite representation and at the infinite regular representation.14-/1516noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option linter.unusedSectionVars false1920namespace Nonadditivity.PolynomialReduction21open scoped BigOperators Matrix Matrix.Norms.L2Operator Kronecker22open FiniteSetFactorization RegularCoefficientEnergy2324section Support25variable {α : Type} [DecidableEq α]2627def firstHalf (r : ℕ) (w : FreeGroup α) : FreeGroup α :=28  FreeGroup.mk (w.toWord.take r)2930def suffix (r : ℕ) (w : FreeGroup α) : FreeGroup α :=31  FreeGroup.mk (w.toWord.drop r)3233theorem firstHalf_mul_suffix (r : ℕ) (w : FreeGroup α) : firstHalf r w * suffix r w = w := by34  simp only [firstHalf, suffix, FreeGroup.mul_mk, List.take_append_drop, FreeGroup.mk_toWord]3536theorem norm_firstHalf_le (r : ℕ) (w : FreeGroup α) : FreeGroup.norm (firstHalf r w) ≤ r := by37  exact FreeGroup.norm_mk_le.trans (by simp)3839theorem norm_suffix_le (r : ℕ) (w : FreeGroup α) (h : FreeGroup.norm w ≤ 2*r) :40    FreeGroup.norm (suffix r w) ≤ r := by41  have hlen : w.toWord.length ≤ 2*r := h42  exact FreeGroup.norm_mk_le.trans (by simp only [List.length_drop]; omega)4344/-- The actual two halves of each supported word, with the first half inverted. -/45def splitSupport (T : Finset (FreeGroup α)) (r : ℕ) : Finset (FreeGroup α) :=46  insert 1 ((T.image fun w => (firstHalf r w)⁻¹) ∪ T.image (suffix r))4748@[simp] theorem one_mem_splitSupport (T : Finset (FreeGroup α)) (r : ℕ) :49    (1 : FreeGroup α) ∈ splitSupport T r := by simp [splitSupport]5051theorem subset_difference_splitSupport (T : Finset (FreeGroup α)) (r : ℕ) :52    T ⊆ Linearization.differenceSupport (splitSupport T r) := by53  intro w hw54  apply Linearization.mem_differenceSupport.mpr55  refine ⟨(firstHalf r w)⁻¹, ?_, suffix r w, ?_, ?_⟩56  · simp [splitSupport, Finset.mem_image_of_mem _ hw]57  · simp [splitSupport, Finset.mem_image_of_mem _ hw]58  · simpa using firstHalf_mul_suffix r w5960theorem splitSupport_degree (T : Finset (FreeGroup α)) (r : ℕ)61    (hT : ∀ w ∈ T, FreeGroup.norm w ≤ 2*r) :62    ∀ w ∈ splitSupport T r, FreeGroup.norm w ≤ r := by63  intro w hw64  simp only [splitSupport, Finset.mem_insert, Finset.mem_union, Finset.mem_image] at hw65  rcases hw with rfl | (⟨v,hv,rfl⟩ | ⟨v,hv,rfl⟩)66  · simp67  · simpa only [FreeGroup.norm_inv_eq] using norm_firstHalf_le r v68  · exact norm_suffix_le r v (hT v hv)6970theorem splitSupport_card (T : Finset (FreeGroup α)) (r : ℕ) :71    (splitSupport T r).card ≤ 1 + 2*T.card := by72  calc73    (splitSupport T r).card ≤74        (((T.image fun w => (firstHalf r w)⁻¹) ∪ T.image (suffix r))).card + 1 :=75      Finset.card_insert_le _ _76    _ ≤ (T.image fun w => (firstHalf r w)⁻¹).card + (T.image (suffix r)).card + 1 :=77      Nat.add_le_add_right (Finset.card_union_le _ _) 178    _ ≤ T.card + T.card + 1 := Nat.add_le_add_right79      (Nat.add_le_add Finset.card_image_le Finset.card_image_le) 180    _ = 1 + 2*T.card := by omega81end Support8283/-- A literal finite matrix-coefficient polynomial, with its coefficient space. -/84structure Polynomial (G : Type*) where85  Index : Type86  fintype : Fintype Index87  decEq : DecidableEq Index88  nonempty : Nonempty Index89  support : Finset G90  coefficient : G → Matrix Index Index ℂ9192attribute [instance] Polynomial.fintype Polynomial.decEq Polynomial.nonempty9394namespace Polynomial95variable {G : Type} [Group G] [DecidableEq G]9697def finiteEval (P : Polynomial G) {ν : Type*} [Fintype ν] [DecidableEq ν]98    (π : G →* unitary (Matrix ν ν ℂ)) : Matrix (P.Index × ν) (P.Index × ν) ℂ :=99  ∑ w ∈ P.support, P.coefficient w ⊗ₖ (π w : Matrix ν ν ℂ)100101def regularEval (P : Polynomial G) := regularPolynomial P.support P.coefficient102103def normalizedCoefficient (P : Polynomial G) (w : G) : Matrix P.Index P.Index ℂ :=104  if w ∈ P.support then P.coefficient w else 0105106theorem finiteEval_enlarge (P : Polynomial G) {ν : Type*} [Fintype ν] [DecidableEq ν]107    (π : G →* unitary (Matrix ν ν ℂ)) (S : Finset G)108    (hcover : P.support ⊆ Linearization.differenceSupport S) :109    polynomial S P.normalizedCoefficient π = P.finiteEval π := by110  unfold polynomial finiteEval111  symm112  calc113    (∑ w ∈ P.support, P.coefficient w ⊗ₖ (π w : Matrix ν ν ℂ)) =114        ∑ w ∈ P.support, P.normalizedCoefficient w ⊗ₖ (π w : Matrix ν ν ℂ) := by115      apply Finset.sum_congr rfl116      intro w hw117      simp [normalizedCoefficient, hw]118    _ = _ := Finset.sum_subset hcover (by119      intro w hw hnot120      simp [normalizedCoefficient, hnot])121122theorem regularEval_enlarge (P : Polynomial G) (S : Finset G)123    (hcover : P.support ⊆ Linearization.differenceSupport S) :124    regularPolynomial (Linearization.differenceSupport S) P.normalizedCoefficient =125      P.regularEval := by126  unfold regularEval127  rw [RegularFactorization.polynomial_eq, RegularFactorization.polynomial_eq]128  symm129  calc130    (∑ w ∈ P.support, RegularFactorization.term (P.coefficient w) w) =131        ∑ w ∈ P.support, RegularFactorization.term (P.normalizedCoefficient w) w := by132      apply Finset.sum_congr rfl133      intro w hw134      simp [normalizedCoefficient, hw]135    _ = _ := Finset.sum_subset hcover (by136      intro w hw hnot137      simp [normalizedCoefficient, hnot])138139/-- A genuine step of Gram factorization, including the enlarged coefficient space. -/140def step (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S) : Polynomial G where141  Index := Support S × (P.Index ⊕ P.Index)142  fintype := inferInstance143  decEq := inferInstance144  nonempty := ⟨⟨⟨1,hS⟩, Sum.inl (Classical.choice P.nonempty)⟩⟩145  support := S146  coefficient := RegularFactorization.paddedCoefficients S hS147    (dilationCoefficient P.normalizedCoefficient)148149@[simp] theorem step_dimension (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S) :150    Fintype.card (P.step S hS).Index = 2 * S.card * Fintype.card P.Index := by151  simp [step, Nat.mul_add]152  ring153154def correction (P : Polynomial G) (S : Finset G) : ℝ :=155  theta S (dilationCoefficient P.normalizedCoefficient)156157@[simp] theorem step_finiteEval (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S)158    {ν : Type*} [Fintype ν] [DecidableEq ν]159    (π : G →* unitary (Matrix ν ν ℂ)) :160    (P.step S hS).finiteEval π =161      paddedPolynomial S hS (dilationCoefficient P.normalizedCoefficient) π := by162  unfold finiteEval step paddedPolynomial163  rw [← Finset.sum_coe_sort S]164  apply Finset.sum_congr rfl165  intro g hg166  simp [RegularFactorization.paddedCoefficients, g.property]167168@[simp] theorem step_regularEval (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S) :169    (P.step S hS).regularEval =170      RegularFactorization.padded S hS (dilationCoefficient P.normalizedCoefficient) :=171  (RegularFactorization.padded_eq_regularPolynomial S hS _).symm172173theorem step_regular_norm_sq (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S)174    (hcover : P.support ⊆ Linearization.differenceSupport S) :175    ‖(P.step S hS).regularEval‖ ^ 2 = ‖P.regularEval‖ + P.correction S := by176  rw [step_regularEval, RegularFactorization.padded_dilation_norm_sq,177    regularEval_enlarge P S hcover]178  rfl179180theorem step_finite_norm_sq (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S)181    (hcover : P.support ⊆ Linearization.differenceSupport S)182    {ν : Type*} [Fintype ν] [DecidableEq ν] [Nonempty ν]183    (π : G →* unitary (Matrix ν ν ℂ)) :184    ‖(P.step S hS).finiteEval π‖ ^ 2 = ‖P.finiteEval π‖ + P.correction S := by185  rw [step_finiteEval, paddedPolynomial_dilation_norm_sq,186    finiteEval_enlarge P π S hcover]187  rfl188189theorem correction_nonneg (P : Polynomial G) (S : Finset G) : 0 ≤ P.correction S :=190  theta_nonneg S _191192theorem correction_le (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S)193    (hcover : P.support ⊆ Linearization.differenceSupport S) :194    P.correction S ≤ (S.card : ℝ) * ‖P.regularEval‖ := by195  simpa [regularEval_enlarge P S hcover] using196    theta_dilation_le_card_mul_regularNorm S hS P.normalizedCoefficient197198theorem step_error_transfer (P : Polynomial G) (S : Finset G) (hS : (1:G) ∈ S)199    (hcover : P.support ⊆ Linearization.differenceSupport S)200    {ν : Type*} [Fintype ν] [DecidableEq ν] [Nonempty ν]201    (π : G →* unitary (Matrix ν ν ℂ)) (ε : ℝ) (hε : 0 ≤ ε) (hε1 : ε ≤ 1)202    (hQ : ‖(P.step S hS).finiteEval π‖ ≤ (1+ε) * ‖(P.step S hS).regularEval‖) :203    ‖P.finiteEval π‖ ≤ (1+6*(S.card:ℝ)*ε) * ‖P.regularEval‖ := by204  have h := RegularFactorization.finite_regular_error_transfer S hS205    P.normalizedCoefficient π ε hε hε1 (by simpa using hQ)206  simpa [P.finiteEval_enlarge π S hcover, P.regularEval_enlarge S hcover] using h207208section FreeGroup209variable {α : Type} [DecidableEq α]210211def halve (P : Polynomial (FreeGroup α)) (r : ℕ) : Polynomial (FreeGroup α) :=212  P.step (splitSupport P.support r) (one_mem_splitSupport _ _)213214theorem halve_degree (P : Polynomial (FreeGroup α)) (r : ℕ)215    (hP : ∀ w ∈ P.support, FreeGroup.norm w ≤ 2*r) :216    ∀ w ∈ (P.halve r).support, FreeGroup.norm w ≤ r :=217  splitSupport_degree P.support r hP218219/-- Repeat the actual square-root factorization, ending with words of length one. -/220def reduce (P : Polynomial (FreeGroup α)) : ℕ → Polynomial (FreeGroup α)221  | 0 => P222  | n+1 => (P.halve (2^n)).reduce n223224/-- Exact enlargement multiplier of the recursively constructed coefficient space. -/225def dimensionCost (P : Polynomial (FreeGroup α)) : ℕ → ℕ226  | 0 => 1227  | n+1 => 2 * (splitSupport P.support (2^n)).card * (P.halve (2^n)).dimensionCost n228229/-- Actual product of the backward-error factors `6 |S|`. -/230def errorCost (P : Polynomial (FreeGroup α)) : ℕ → ℕ231  | 0 => 1232  | n+1 => 6 * (splitSupport P.support (2^n)).card * (P.halve (2^n)).errorCost n233234theorem dimensionCost_pos (P : Polynomial (FreeGroup α)) (n : ℕ) :235    0 < P.dimensionCost n := by236  induction n generalizing P with237  | zero => simp [dimensionCost]238  | succ n ih =>239    have hB := Finset.card_pos.mpr (show (splitSupport P.support (2^n)).Nonempty from240      ⟨1, one_mem_splitSupport _ _⟩)241    exact Nat.mul_pos (Nat.mul_pos (by omega) hB) (ih _)242243theorem errorCost_eq (P : Polynomial (FreeGroup α)) (n : ℕ) :244    P.errorCost n = 3^n * P.dimensionCost n := by245  induction n generalizing P with246  | zero => simp [errorCost, dimensionCost]247  | succ n ih => simp only [errorCost, dimensionCost, ih, pow_succ]; ring248249theorem errorCost_pos (P : Polynomial (FreeGroup α)) (n : ℕ) : 0 < P.errorCost n := by250  rw [errorCost_eq]251  exact Nat.mul_pos (by positivity) (dimensionCost_pos P n)252253theorem reduce_dimension (P : Polynomial (FreeGroup α)) (n : ℕ) :254    Fintype.card (P.reduce n).Index = Fintype.card P.Index * P.dimensionCost n := by255  induction n generalizing P with256  | zero => simp [reduce, dimensionCost]257  | succ n ih =>258    rw [reduce, ih]259    change Fintype.card (P.step _ _).Index * _ = _260    rw [step_dimension]261    simp only [dimensionCost]262    ring263264theorem reduce_degree (P : Polynomial (FreeGroup α)) (n : ℕ)265    (hP : ∀ w ∈ P.support, FreeGroup.norm w ≤ 2^n) :266    ∀ w ∈ (P.reduce n).support, FreeGroup.norm w ≤ 1 := by267  induction n generalizing P with268  | zero => simpa only [reduce, pow_zero] using hP269  | succ n ih =>270    apply ih (P.halve (2^n))271    apply halve_degree272    simpa only [pow_succ, Nat.mul_comm] using hP273274/-- Every error-transfer hypothesis is discharged by the constructed factors.275Only the comparison for the final linear polynomial is supplied. -/276theorem reduce_error_transfer (P : Polynomial (FreeGroup α)) (n : ℕ)277    {ν : Type*} [Fintype ν] [DecidableEq ν] [Nonempty ν]278    (π : FreeGroup α →* unitary (Matrix ν ν ℂ))279    (ε : ℝ) (hε : 0 ≤ ε) (hε1 : ε ≤ 1)280    (hfinal : ‖(P.reduce n).finiteEval π‖ ≤281      (1+ε/(P.errorCost n:ℝ))*‖(P.reduce n).regularEval‖) :282    ‖P.finiteEval π‖ ≤ (1+ε)*‖P.regularEval‖ := by283  induction n generalizing P ε with284  | zero => simpa only [reduce, errorCost, Nat.cast_one, div_one] using hfinal285  | succ n ih =>286    let B := (splitSupport P.support (2^n)).card287    have hB : 1 ≤ B := Finset.one_le_card.mpr ⟨1, one_mem_splitSupport _ _⟩288    have hBreal : (1:ℝ) ≤ B := by exact_mod_cast hB289    have h6B : (0:ℝ) < 6*(B:ℝ) := by positivity290    have hδ0 : 0 ≤ ε/(6*(B:ℝ)) := div_nonneg hε h6B.le291    have hδ1 : ε/(6*(B:ℝ)) ≤ 1 := by292      apply (div_le_iff₀ h6B).mpr293      nlinarith294    have hnorm := ih (P.halve (2^n)) (ε/(6*(B:ℝ))) hδ0 hδ1 (by295      simpa only [reduce, errorCost, Nat.cast_mul, Nat.cast_ofNat, div_div,296        mul_assoc, B] using hfinal)297    have hstep := P.step_error_transfer (splitSupport P.support (2^n))298      (one_mem_splitSupport _ _) (subset_difference_splitSupport _ _) π299      (ε/(6*(B:ℝ))) hδ0 hδ1 hnorm300    have heq : 6*(B:ℝ)*(ε/(6*(B:ℝ))) = ε := mul_div_cancel₀ ε h6B.ne'301    change ‖P.finiteEval π‖ ≤ (1 + 6*(B:ℝ)*(ε/(6*(B:ℝ)))) * ‖P.regularEval‖ at hstep302    simpa only [heq] using hstep303304/-- Complete deterministic reduction of a degree `2^n` polynomial to a linear one.305The output coefficients, exact dimension cost, and comparison transfer are306constructed, without any assumed family of intermediate polynomials. -/307theorem constructed_linear_reduction (P : Polynomial (FreeGroup α)) (n : ℕ)308    (hP : ∀ w ∈ P.support, FreeGroup.norm w ≤ 2^n) :309    ∃ Q : Polynomial (FreeGroup α),310      (∀ w ∈ Q.support, FreeGroup.norm w ≤ 1) ∧311      Fintype.card Q.Index = Fintype.card P.Index * P.dimensionCost n ∧312      P.errorCost n = 3^n * P.dimensionCost n ∧313      ∀ {ν : Type} [Fintype ν] [DecidableEq ν] [Nonempty ν]314        (π : FreeGroup α →* unitary (Matrix ν ν ℂ)) (ε : ℝ),315        0 ≤ ε → ε ≤ 1 →316        ‖Q.finiteEval π‖ ≤ (1+ε/(P.errorCost n:ℝ))*‖Q.regularEval‖ →317        ‖P.finiteEval π‖ ≤ (1+ε)*‖P.regularEval‖ := by318  refine ⟨P.reduce n, reduce_degree P n hP, reduce_dimension P n,319    errorCost_eq P n, ?_⟩320  intro ν _ _ _ π ε hε hε1 hfinal321  exact reduce_error_transfer P n π ε hε hε1 hfinal322323end FreeGroup324325end Polynomial326end Nonadditivity.PolynomialReduction