Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathMarks

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

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

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

35 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathVertexNames7import Nonadditivity.HaarPathExplorationBlocks8import Nonadditivity.HaarPathCodes910/-! # Actual sparse exploration marks1112The fixed-alphabet marks below are extracted from literal paths using their13first-occurrence vertex names and independent local color normalizers. No14edge of the unknown final graph is used as an encoding symbol.1516This file constructs the code and its size budget. Injectivity of the sparse17code is a separate reconstruction theorem, not assumed here.18-/19noncomputable section20namespace Nonadditivity.HaarPathClasses21open HaarPathGraph HaarPathProfiles22variable {V : Type*} [DecidableEq V] {m : ℕ}2324/-- Two fixed, distinct local incidence labels. -/25def initialColor : Color 2 := (0,false)26def nextColor : Color 2 := (0,true)2728def colorNormalizer (P : Path V 2 m) (hm : 0 < m) : V → Equiv.Perm (Color 2) :=29  Classical.choose (exists_local_color_normalization P hm initialColor nextColor (by decide))3031def normalColor (P : Path V 2 m) (hm : 0 < m) (a : Incidence m) : Color 2 :=32  normalizedIncidenceColor P (colorNormalizer P hm) a3334theorem normalColor_root (P : Path V 2 m) (hm : 0 < m) :35    normalColor P hm (⟨0,hm⟩,true)=initialColor := by36  exact (Classical.choose_spec37    (exists_local_color_normalization P hm initialColor nextColor (by decide))).13839theorem normalColor_incoming (P : Path V 2 m) (hm : 0 < m)40    (i : Fin m) (hi : P.FirstVisit i) : normalColor P hm (i,false)=initialColor := by41  exact (Classical.choose_spec42    (exists_local_color_normalization P hm initialColor nextColor (by decide))).2.1 i hi4344theorem normalColor_after_firstVisit (P : Path V 2 m) (hm : 0 < m)45    (i j : Fin m) (hi : P.FirstVisit i) (hij : i.val+1=j.val) :46    normalColor P hm (j,true)=nextColor := by47  have hv : j.castSucc=i.succ := Fin.ext (by simpa using hij.symm)48  change colorNormalizer P hm (P.vertex j.castSucc) (P.colors j)=nextColor49  rw [hv]50  exact (Classical.choose_spec51    (exists_local_color_normalization P hm initialColor nextColor (by decide))).2.2 i j hi hij5253/-- End of the actual old-tree run following position i. -/54def treeStop (P : Path V 2 m) (i : Fin m) : ℕ :=55  P.firstFresh (i.val+1) (P.nextImportant (i.val+1))5657theorem treeStop_bounds (P : Path V 2 m) (i : Fin m) :58    i.val+1 ≤ treeStop P i ∧ treeStop P i ≤ m := by59  have hb := P.nextImportant_bounds (i.val+1) (by omega)60  have hs := P.firstFresh_bounds (i.val+1) (P.nextImportant (i.val+1)) hb.161  exact ⟨hs.1,hs.2.trans hb.2⟩6263def treeStopIndex (P : Path V 2 m) (i : Fin m) : Fin (m+1) :=64  ⟨treeStop P i,Nat.lt_succ_of_le (treeStop_bounds P i).2⟩6566/-- Target, old-tree endpoint, and independent source/target/next colors. -/67def explorationMark (P : Path V 2 m) (hm : 0 < m) (i : Fin m) : ExplorationMark m :=68  (P.vertexName hm i.succ,69   P.vertexName hm (treeStopIndex P i),70   normalColor P hm (i,true),71   normalColor P hm (i,false),72   if hs : treeStop P i < m then normalColor P hm (⟨treeStop P i,hs⟩,true)73     else initialColor)7475/-- Sorted actual important times with the full fixed-alphabet marks. -/76def explorationEventList (P : Path V 2 m) (hm : 0 < m) : List (ExplorationEvent m) :=77  (P.importantTimes.sort (· ≤ ·)).map fun i => (i,explorationMark P hm i)7879@[simp] theorem explorationEventList_length (P : Path V 2 m) (hm : 0 < m) :80    (explorationEventList P hm).length=P.importantTimes.card := by81  simp [explorationEventList]8283theorem explorationEventList_length_le (P : Path V 2 m) (hm : 0 < m) :84    (explorationEventList P hm).length ≤ P.defectTwice+2 := by85  rw [explorationEventList_length]86  exact P.card_importantTimes_le hm8788def boundedExplorationCode (P : Path V 2 m) (hm : 0 < m) :89    BoundedList (ExplorationEvent m) (P.defectTwice+2) :=90  ⟨explorationEventList P hm,explorationEventList_length_le P hm⟩9192@[simp] theorem explorationEventList_times (P : Path V 2 m) (hm : 0 < m) :93    (explorationEventList P hm).map Prod.fst=P.importantTimes.sort (· ≤ ·) := by94  simp [explorationEventList,List.map_map,Function.comp_def]9596theorem importantTimes_eq_of_eventList_eq {P Q : Path V 2 m} (hm : 0 < m)97    (h : explorationEventList P hm=explorationEventList Q hm) :98    P.importantTimes=Q.importantTimes := by99  have he := congrArg (fun l : List (ExplorationEvent m) => (l.map Prod.fst).toFinset) h100  simpa using he101102theorem explorationMark_eq_of_eventList_eq {P Q : Path V 2 m} (hm : 0 < m)103    (h : explorationEventList P hm=explorationEventList Q hm)104    (i : Fin m) (hi : i∈P.importantTimes) : explorationMark P hm i=explorationMark Q hm i := by105  have hmem : (i,explorationMark P hm i)∈explorationEventList P hm := by106    apply List.mem_map.mpr107    exact ⟨i,by simpa using hi,rfl⟩108  rw [h] at hmem109  obtain ⟨j,hj,he⟩ := List.mem_map.mp hmem110  have hji : j=i := congrArg Prod.fst he111  subst j112  exact (congrArg Prod.snd he).symm113114/-- The actual BC quotient restricted to a fixed integer defect. -/115abbrev DefectClass (V : Type*) [DecidableEq V] [Fintype V] (m δ : ℕ) (hm : 0 < m) :=116  {C : PathClass V 2 m // classDefectTwice hm C=δ}117118def classRepresentative [Fintype V] {δ : ℕ} (hm : 0 < m)119    (C : DefectClass V m δ hm) : Path V 2 m := Quotient.out C.val120121theorem classRepresentative_defect [Fintype V] {δ : ℕ} (hm : 0 < m)122    (C : DefectClass V m δ hm) : (classRepresentative hm C).defectTwice=δ := by123  have h := congrArg (classDefectTwice hm) (Quotient.out_eq C.val)124  exact h.trans C.property125126/-- A concrete bounded sparse code for every actual defect class. Its127injectivity is established by the blockwise reconstruction in HaarPathCounting. -/128def classExplorationCode [Fintype V] {δ : ℕ} (hm : 0 < m)129    (C : DefectClass V m δ hm) : BoundedList (ExplorationEvent m) (δ+2) :=130  ⟨explorationEventList (classRepresentative hm C) hm,by131    have h := explorationEventList_length_le (classRepresentative hm C) hm132    have hd := classRepresentative_defect hm C133    omega⟩134135end Nonadditivity.HaarPathClasses