Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathTree

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

Direct imports

Imported by project modules

4 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

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

30 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathExploration7import Mathlib.Combinatorics.SimpleGraph.Acyclic89/-! # The actual discovery tree is acyclic1011The proof constructs every prefix graph by adding the edge to a newly visited12vertex. The result supplies the unique-tree-route step in path encoding.13-/14noncomputable section15namespace Nonadditivity.HaarPathGraph16open scoped BigOperators17variable {V : Type*} {d m : ℕ}1819lemma edge_reverse_color {x y z : V} {c c' : HaarPathProfiles.Color d}20    (hxy : x≠y) (h : edge x c y=edge y c' z) : c'=flipColor c := by21  obtain ⟨g,b⟩ := c22  obtain ⟨g',b'⟩ := c'23  cases b  <;>  cases b'  <;>  simp only [edge, Bool.false_eq_true,24    ite_false, ite_true, Prod.mk.injEq] at h25  all_goals simp only [flipColor, Bool.not_false, Bool.not_true, Prod.mk.injEq]26  all_goals tauto2728namespace Path29variable [DecidableEq V] (P : Path V d m)3031/-- A first visit cannot be immediately followed by an old tree-edge visit.32The next step either discovers another vertex or is important. -/33theorem firstVisit_next {i j : Fin m} (hi : P.FirstVisit i) (hij : i.val+1=j.val) :34    P.FirstVisit j ∨ j∈P.importantTimes := by35  by_cases hj : P.FirstVisit j36  · exact Or.inl hj37  right38  simp only [importantTimes,Finset.mem_filter,Finset.mem_univ,true_and]39  intro htree40  obtain ⟨k,hk,hke⟩ := Finset.mem_image.mp htree41  have hkf := (P.mem_firstTimes k).mp hk42  have hkj : k.val < j.val := by43    by_contra h44    by_cases he : k=j45    · subst k; exact hj hkf46    · have hlt : j.val < k.val := by47        have hne : j.val≠k.val := by intro hv; exact he (Fin.ext hv.symm)48        omega49      exact P.firstVisit_edge_not_earlier hkf hlt hke.symm50  have hji : j.castSucc=i.succ := Fin.ext (by simpa using hij.symm)51  by_cases hki : k=i52  · subst k53    have hn : P.vertex i.castSucc ≠ P.vertex i.succ := hi i.castSucc (by simp)54    have he : edge (P.vertex i.castSucc) (P.colors i) (P.vertex i.succ) =55        edge (P.vertex i.succ) (P.colors j) (P.vertex j.succ) := by56      simpa only [edgeAt,hji] using hke57    exact P.reduced i j hij (edge_reverse_color hn he)58  · have hlt : k.val < i.val := by59      have hn : k.val≠i.val := by intro hv; exact hki (Fin.ext hv)60      omega61    rcases edge_endpoints hke with ⟨hx,hy⟩ | ⟨hx,hy⟩62    · exact hi k.castSucc (by simp; omega) (hx.trans (congrArg P.vertex hji))63    · exact hi k.succ (by simp; omega) (hy.trans (congrArg P.vertex hji))6465/-- The simple graph obtained from discovery edges before time `k`. Tree66edges cannot be loops or parallel edges, so forgetting their colors is safe. -/67def discoveryGraph (k : ℕ) : SimpleGraph V where68  Adj x y := ∃ i : Fin m, P.FirstVisit i ∧ i.val < k ∧69    ((x=P.vertex i.castSucc ∧ y=P.vertex i.succ) ∨70     (x=P.vertex i.succ ∧ y=P.vertex i.castSucc))71  symm := by72    intro x y73    rintro ⟨i,hi,hik,hxy⟩74    exact ⟨i,hi,hik,by tauto⟩75  loopless := by76    constructor77    intro x78    rintro ⟨i,hi,hik,hxx⟩79    have hn := hi i.castSucc (show i.castSucc.val ≤ i.val from le_rfl)80    rcases hxx with ⟨h₁,h₂⟩ | ⟨h₁,h₂⟩81    · exact hn (h₁.symm.trans h₂)82    · exact hn (h₂.symm.trans h₁)8384@[simp] theorem discoveryGraph_zero : P.discoveryGraph 0=⊥ := by85  ext x y86  simp [discoveryGraph]8788/-- A vertex discovered at the next step is isolated in the prefix graph. -/89theorem discoveryGraph_new_isolated {i : Fin m} (hi : P.FirstVisit i) (x : V) :90    ¬ (P.discoveryGraph i.val).Adj (P.vertex i.succ) x := by91  rintro ⟨j,hj,hji,hxy⟩92  rcases hxy with ⟨hs,ht⟩ | ⟨hs,ht⟩93  · exact hi j.castSucc (by simp; omega) hs.symm94  · exact hi j.succ (by simp; omega) hs.symm9596theorem discoveryGraph_new_not_reachable {i : Fin m} (hi : P.FirstVisit i) :97    ¬ (P.discoveryGraph i.val).Reachable (P.vertex i.castSucc) (P.vertex i.succ) := by98  intro hr99  obtain ⟨w⟩ := hr.symm100  have hn := hi i.castSucc (show i.castSucc.val ≤ i.val from le_rfl)101  obtain ⟨x,hx,q,he⟩ := SimpleGraph.Walk.not_nil_iff.mp102    (SimpleGraph.Walk.not_nil_of_ne (p := w) hn.symm)103  exact P.discoveryGraph_new_isolated hi x hx104105/-- One exploration step adds one edge precisely when it discovers a vertex. -/106theorem discoveryGraph_succ_of_first {i : Fin m} (hi : P.FirstVisit i) :107    P.discoveryGraph (i.val+1) = P.discoveryGraph i.val ⊔108      SimpleGraph.fromEdgeSet {s(P.vertex i.castSucc,P.vertex i.succ)} := by109  ext x y110  simp only [SimpleGraph.sup_adj,SimpleGraph.fromEdgeSet_adj,Set.mem_singleton_iff,111    Sym2.eq_iff]112  constructor113  · rintro ⟨j,hj,hji,hxy⟩114    by_cases hlt : j.val < i.val115    · exact Or.inl ⟨j,hj,hlt,hxy⟩116    · have he : j=i := Fin.ext (by omega)117      subst j118      right119      refine ⟨hxy,?_⟩120      have hn := hi i.castSucc (show i.castSucc.val ≤ i.val from le_rfl)121      rcases hxy with ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩122      · exact hn123      · exact hn.symm124  · rintro (⟨j,hj,hji,hxy⟩ | ⟨hxy,hne⟩)125    · exact ⟨j,hj,by omega,hxy⟩126    · exact ⟨i,hi,by omega,hxy⟩127128theorem discoveryGraph_succ_of_not_first {k : ℕ}129    (hk : ∀ i : Fin m, i.val=k → ¬P.FirstVisit i) :130    P.discoveryGraph (k+1)=P.discoveryGraph k := by131  ext x y132  constructor133  · rintro ⟨i,hi,hik,hxy⟩134    exact ⟨i,hi,by have hn : i.val≠k := fun he =>  hk i he hi; omega,hxy⟩135  · rintro ⟨i,hi,hik,hxy⟩136    exact ⟨i,hi,by omega,hxy⟩137138/-- Acyclicity of every actual discovery prefix. -/139theorem discoveryGraph_isAcyclic (k : ℕ) : (P.discoveryGraph k).IsAcyclic := by140  induction k with141  | zero =>  rw [P.discoveryGraph_zero]; exact SimpleGraph.isAcyclic_bot142  | succ k ih => 143      by_cases h : ∃ i : Fin m, i.val=k ∧ P.FirstVisit i144      · obtain ⟨i,hi,hfirst⟩ := h145        subst k146        rw [P.discoveryGraph_succ_of_first hfirst]147        exact SimpleGraph.IsAcyclic.isAcyclic_sup_fromEdgeSet_of_not_reachable148          (P.discoveryGraph_new_not_reachable hfirst) ih149      · rw [P.discoveryGraph_succ_of_not_first (by simpa only [not_exists,not_and] using h)]150        exact ih151152/-- Every non-backtracking walk in the actual discovery tree is the unique153such route between its endpoints. The non-backtracking condition is the154literal inequality of consecutive unoriented tree edges. -/155theorem discovery_tree_route_unique (k : ℕ) {x y : V}156    (a b : (P.discoveryGraph k).Walk x y)157    (ha : a.edges.IsChain (· ≠ ·)) (hb : b.edges.IsChain (· ≠ ·)) : a=b := by158  have ht := P.discoveryGraph_isAcyclic k159  have hap := (ht.isPath_iff_isChain a).mpr ha160  have hbp := (ht.isPath_iff_isChain b).mpr hb161  exact congrArg Subtype.val (ht.path_unique ⟨a,hap⟩ ⟨b,hbp⟩)162163end Path164end Nonadditivity.HaarPathGraph