Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarSharpCounting

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

Catalog entries: Corrected important-exploration-time count

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

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

14 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathClassStats7import Mathlib.Algebra.BigOperators.Ring.Finset89/-! # Weighted chronological encoding of genuine path classes1011The time coordinate is stored as the position of an optional mark rather12than counted again in every event. Weighted enumeration preserves the13important-event budget and avoids the exponential padding overhead.14-/1516noncomputable section1718namespace Nonadditivity.HaarPathClasses1920open HaarPathGraph HaarPathProfiles21open scoped BigOperators2223variable {V : Type*} [DecidableEq V] {m : ℕ}2425/-- A chronological sparse code: each actual time carries at most one mark. -/26def sparseExplorationCode (P : Path V 2 m) (hm : 0 < m) :27    Fin m → Option (ExplorationMark m) :=28  fun i => if i ∈ P.importantTimes then some (explorationMark P hm i) else none2930theorem eventList_eq_of_sparseCode_eq {P Q : Path V 2 m} (hm : 0 < m)31    (hcode : sparseExplorationCode P hm = sparseExplorationCode Q hm) :32    explorationEventList P hm = explorationEventList Q hm := by33  have htimes : P.importantTimes = Q.importantTimes := by34    ext i35    have hi := congrFun hcode i36    by_cases hP : i ∈ P.importantTimes <;> by_cases hQ : i ∈ Q.importantTimes <;>37      simp [sparseExplorationCode, hP, hQ] at hi ⊢38  unfold explorationEventList39  rw [← htimes]40  apply List.map_congr_left41  intro i hi42  have hP : i ∈ P.importantTimes := by simpa using hi43  have hQ : i ∈ Q.importantTimes := by simpa only [← htimes] using hP44  have hm := congrFun hcode i45  simp only [sparseExplorationCode, if_pos hP, if_pos hQ, Option.some.injEq] at hm46  exact congrArg (fun x => (i, x)) hm4748def classSparseCode [Fintype V] {δ : ℕ} (hm : 0 < m)49    (C : DefectClass V m δ hm) : Fin m → Option (ExplorationMark m) :=50  sparseExplorationCode (classRepresentative hm C) hm5152theorem classSparseCode_injective [Fintype V] (hm : 0 < m) (δ : ℕ) :53    Function.Injective (@classSparseCode V _ m _ δ hm) := by54  intro C D h55  apply classExplorationCode_injective hm δ56  apply Subtype.ext57  exact eventList_eq_of_sparseCode_eq hm h5859def sparseCodeWeight {A I : Type*} [Fintype I] (z : ℝ) (c : I → Option A) : ℝ :=60  ∏ i, (c i).elim 1 (fun _ => z)6162theorem sparseCodeWeight_nonneg {A I : Type*} [Fintype I] {z : ℝ} (hz : 0 ≤ z)63    (c : I → Option A) : 0 ≤ sparseCodeWeight z c := by64  apply Finset.prod_nonneg65  intro i _66  cases c i with67  | none => norm_num68  | some a => exact hz6970theorem sum_sparseCodeWeight {A I : Type*} [Fintype I] [DecidableEq I] [Fintype A]71    (z : ℝ) :72    (∑ c : I → Option A, sparseCodeWeight z c) =73      (1 + (Fintype.card A : ℝ) * z) ^ Fintype.card I := by74  unfold sparseCodeWeight75  rw [← Fintype.prod_sum (fun (_ : I) (a : Option A) => a.elim 1 (fun _ => z))]76  simp [Fintype.sum_option, add_comm]7778theorem sparseExplorationCode_weight (P : Path V 2 m) (hm : 0 < m) (z : ℝ) :79    sparseCodeWeight z (sparseExplorationCode P hm) = z ^ P.importantTimes.card := by80  have he : sparseCodeWeight z (sparseExplorationCode P hm) =81      ∏ i : Fin m, if i ∈ P.importantTimes then z else 1 := by82    apply Finset.prod_congr rfl83    intro i _84    by_cases hi : i ∈ P.importantTimes <;> simp [sparseExplorationCode, hi]85  rw [he, Fintype.prod_ite_mem]86  simp8788@[simp] theorem card_explorationMark (m : ℕ) :89    Fintype.card (ExplorationMark m) = 64 * m ^ 2 := by90  simp only [ExplorationMark, Color, Fintype.card_prod, Fintype.card_fin,91    Fintype.card_bool]92  ring9394/-- Exact weighted code bound on the actual defect classes. Unlike the95unweighted padded-list estimate, this retains the chronological positions. -/96theorem card_defectClass_weighted_le [Fintype V] (hm : 0 < m) (δ : ℕ)97    {z : ℝ} (hz : 0 ≤ z) (hz1 : z ≤ 1) :98    (Fintype.card (DefectClass V m δ hm) : ℝ) * z ^ (δ + 2) ≤99      (1 + 64 * (m : ℝ) ^ 2 * z) ^ m := by100  classical101  let f := @classSparseCode V _ m _ δ hm102  have hf : Function.Injective f := classSparseCode_injective hm δ103  calc104    _ = ∑ C : DefectClass V m δ hm, z ^ (δ + 2) := by simp105    _ ≤ ∑ C : DefectClass V m δ hm, sparseCodeWeight z (f C) := by106      apply Finset.sum_le_sum107      intro C _108      rw [show f C = sparseExplorationCode (classRepresentative hm C) hm from rfl,109        sparseExplorationCode_weight]110      have hc := (classRepresentative hm C).card_importantTimes_le hm111      rw [classRepresentative_defect] at hc112      exact pow_le_pow_of_le_one hz hz1 hc113    _ = ∑ c ∈ Finset.univ.image f, sparseCodeWeight z c := by114      rw [Finset.sum_image]115      intro C _ D _ h116      exact hf h117    _ ≤ ∑ c : Fin m → Option (ExplorationMark m), sparseCodeWeight z c := by118      exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _)119        (fun c _ _ => sparseCodeWeight_nonneg hz c)120    _ = _ := by simp only [sum_sparseCodeWeight, card_explorationMark,121      Nat.cast_mul, Nat.cast_ofNat, Nat.cast_pow, Fintype.card_fin]122123theorem card_refinedDefectClass_le_coarse_mul [Fintype V] (hm : 0 < m) (δ : ℕ) :124    Fintype.card (RefinedDefectClass V m δ hm) ≤125      Fintype.card (DefectClass V m δ hm) * (4 * m ^ 2) ^ (3 * δ + 4) := by126  classical127  rw [Fintype.card_congr (refinedDefectEquiv hm δ), Fintype.card_sigma]128  calc129    _ ≤ ∑ C : DefectClass V m δ hm, (4 * m ^ 2) ^ (3 * δ + 4) := by130      apply Finset.sum_le_sum131      intro C _132      have h := card_refinedOver_le C.val hm (by decide : 0 < 2)133      have hd := classRepresentative_defect hm C134      change (Quotient.out C.val).defectTwice = δ at hd135      simpa only [hd, show 2 * 2 = 4 from rfl] using h136    _ = _ := by simp137138theorem card_refinedDefectClass_weighted_le [Fintype V] (hm : 0 < m) (δ : ℕ)139    {z : ℝ} (hz : 0 ≤ z) (hz1 : z ≤ 1) :140    (Fintype.card (RefinedDefectClass V m δ hm) : ℝ) * z ^ (δ + 2) ≤141      (1 + 64 * (m : ℝ) ^ 2 * z) ^ m * (4 * (m : ℝ) ^ 2) ^ (3 * δ + 4) := by142  have hc : (Fintype.card (RefinedDefectClass V m δ hm) : ℝ) ≤143      (Fintype.card (DefectClass V m δ hm) : ℝ) * (4 * (m : ℝ) ^ 2) ^ (3 * δ + 4) := by144    exact_mod_cast card_refinedDefectClass_le_coarse_mul (V := V) hm δ145  calc146    _ ≤ ((Fintype.card (DefectClass V m δ hm) : ℝ) *147        (4 * (m : ℝ) ^ 2) ^ (3 * δ + 4)) * z ^ (δ + 2) :=148      mul_le_mul_of_nonneg_right hc (pow_nonneg hz _)149    _ = ((Fintype.card (DefectClass V m δ hm) : ℝ) * z ^ (δ + 2)) *150        (4 * (m : ℝ) ^ 2) ^ (3 * δ + 4) := by ring151    _ ≤ _ := mul_le_mul_of_nonneg_right152      (card_defectClass_weighted_le (V := V) hm δ hz hz1) (by positivity)153154theorem card_refined_subfamily_weighted_le [Fintype V] (hm : 0 < m) (δ : ℕ)155    (s : Finset (RefinedClass V 2 m))156    (hs : ∀ C ∈ s, classDefectTwice hm (refinedToCoarse C) = δ)157    {z : ℝ} (hz : 0 ≤ z) (hz1 : z ≤ 1) :158    (s.card : ℝ) * z ^ (δ + 2) ≤159      (1 + 64 * (m : ℝ) ^ 2 * z) ^ m * (4 * (m : ℝ) ^ 2) ^ (3 * δ + 4) := by160  classical161  let f : s → RefinedDefectClass V m δ hm := fun C => ⟨C.val, hs C.val C.property⟩162  have hf : Function.Injective f := by163    intro C D h164    exact Subtype.ext (congrArg (fun x : RefinedDefectClass V m δ hm => x.val) h)165  have hc := Fintype.card_le_of_injective f hf166  simp only [Fintype.card_coe] at hc167  have hreal : (s.card : ℝ) ≤ Fintype.card (RefinedDefectClass V m δ hm) := by168    exact_mod_cast hc169  exact (mul_le_mul_of_nonneg_right hreal (pow_nonneg hz _)).trans170    (card_refinedDefectClass_weighted_le hm δ hz hz1)171172end Nonadditivity.HaarPathClasses