Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathExplorationBlocks

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

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

37 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathTree78/-! # The actual old-tree / fresh-run decomposition of exploration blocks910The endpoints and the switch time are minima of finite sets extracted from11the path itself. No block decomposition is supplied as a hypothesis.12-/1314noncomputable section15namespace Nonadditivity.HaarPathGraph.Path1617variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1819/-- Important traversals at or after `a`, together with the final sentinel. -/20def importantStops (a : ℕ) : Finset ℕ :=21  insert m ((P.importantTimes.filter fun i => a ≤ i.val).image Fin.val)2223def nextImportant (a : ℕ) : ℕ :=24  (P.importantStops a).min' ⟨m,Finset.mem_insert_self _ _⟩2526theorem nextImportant_mem (a : ℕ) : P.nextImportant a∈P.importantStops a :=27  Finset.min'_mem _ _2829theorem nextImportant_bounds (a : ℕ) (ha : a ≤ m) :30    a ≤ P.nextImportant a ∧ P.nextImportant a ≤ m := by31  constructor32  · have h := P.nextImportant_mem a33    rcases Finset.mem_insert.mp h with h | h34    · simpa [h] using ha35    · obtain ⟨i,hi,he⟩ := Finset.mem_image.mp h36      exact he ▸ (Finset.mem_filter.mp hi).237  · exact Finset.min'_le _ _ (Finset.mem_insert_self _ _)3839theorem not_important_before_next (a : ℕ) (i : Fin m)40    (hai : a ≤ i.val) (hi : i.val<P.nextImportant a) : i∉P.importantTimes := by41  intro himp42  have hm : i.val∈P.importantStops a := Finset.mem_insert_of_mem43    (Finset.mem_image.mpr ⟨i,Finset.mem_filter.mpr ⟨himp,hai⟩,rfl⟩)44  have hmin : P.nextImportant a ≤ i.val := Finset.min'_le _ _ hm45  omega4647theorem nextImportant_is_important (a : ℕ) (hb : P.nextImportant a<m) :48    (⟨P.nextImportant a,hb⟩ : Fin m)∈P.importantTimes := by49  have h := P.nextImportant_mem a50  rcases Finset.mem_insert.mp h with h | h51  · omega52  · obtain ⟨i,hi,he⟩ := Finset.mem_image.mp h53    have hei : i=⟨P.nextImportant a,hb⟩ := Fin.ext he54    simpa only [←hei] using (Finset.mem_filter.mp hi).15556/-- Candidate fresh-run starts in `[a,b)`, with `b` for an empty fresh run. -/57def freshStops (a b : ℕ) : Finset ℕ :=58  insert b ((P.firstTimes.filter fun i => a ≤ i.val ∧ i.val<b).image Fin.val)5960def firstFresh (a b : ℕ) : ℕ :=61  (P.freshStops a b).min' ⟨b,Finset.mem_insert_self _ _⟩6263theorem firstFresh_mem (a b : ℕ) : P.firstFresh a b∈P.freshStops a b :=64  Finset.min'_mem _ _6566theorem firstFresh_bounds (a b : ℕ) (hab : a ≤ b) :67    a ≤ P.firstFresh a b ∧ P.firstFresh a b ≤ b := by68  constructor69  · have h := P.firstFresh_mem a b70    rcases Finset.mem_insert.mp h with h | h71    · simpa [h] using hab72    · obtain ⟨i,hi,he⟩ := Finset.mem_image.mp h73      exact he ▸ (Finset.mem_filter.mp hi).2.174  · exact Finset.min'_le _ _ (Finset.mem_insert_self _ _)7576theorem firstFresh_is_firstVisit (a b : ℕ) (hb : b ≤ m)77    (hs : P.firstFresh a b<b) :78    P.FirstVisit ⟨P.firstFresh a b,hs.trans_le hb⟩ := by79  have h := P.firstFresh_mem a b80  rcases Finset.mem_insert.mp h with h | h81  · omega82  · obtain ⟨i,hi,he⟩ := Finset.mem_image.mp h83    have hei : i=⟨P.firstFresh a b,hs.trans_le hb⟩ := Fin.ext he84    simpa only [←hei] using (P.mem_firstTimes i).mp (Finset.mem_filter.mp hi).18586theorem not_firstVisit_before_firstFresh (a b : ℕ) (hab : a ≤ b) (i : Fin m)87    (hai : a ≤ i.val) (hi : i.val<P.firstFresh a b) : ¬P.FirstVisit i := by88  intro hfirst89  have hib : i.val<b := hi.trans_le (P.firstFresh_bounds a b hab).290  have hm : i.val∈P.freshStops a b := Finset.mem_insert_of_mem91    (Finset.mem_image.mpr ⟨i,Finset.mem_filter.mpr92      ⟨(P.mem_firstTimes i).mpr hfirst,hai,hib⟩,rfl⟩)93  have hmin : P.firstFresh a b ≤ i.val := Finset.min'_le _ _ hm94  omega9596/-- Once a first visit occurs, every following step before the next important97traversal is a first visit. -/98theorem firstVisit_propagates (a b : ℕ)99    (hno : ∀ i : Fin m, a ≤ i.val → i.val<b → i∉P.importantTimes)100    (i j : Fin m) (hai : a ≤ i.val) (hi : P.FirstVisit i)101    (hij : i.val ≤ j.val) (hjb : j.val<b) : P.FirstVisit j := by102  have hmain : ∀ k, i.val ≤ k → ∀ hk : k<m, k<b → P.FirstVisit ⟨k,hk⟩ := by103    intro k hik104    induction k, hik using Nat.le_induction with105    | base =>106        intro hk hb107        simpa using hi108    | succ k hik ih =>109        intro hk hb110        let u : Fin m := ⟨k,by omega⟩111        let v : Fin m := ⟨k+1,hk⟩112        have hu : P.FirstVisit u := ih u.isLt (by omega)113        rcases P.firstVisit_next hu (show u.val+1=v.val from rfl) with hv | hv114        · exact hv115        · exact (hno v (by dsimp [v]; omega) hb hv).elim116  exact hmain j.val hij j.isLt hjb117118/-- The exact old-tree/fresh-run split inside an interval with no important119traversal. The switch is the computed minimum `firstFresh`. -/120theorem exploration_interval_split (a b : ℕ) (hab : a ≤ b) (hb : b ≤ m)121    (hno : ∀ i : Fin m, a ≤ i.val → i.val<b → i∉P.importantTimes) :122    (a ≤ P.firstFresh a b ∧ P.firstFresh a b ≤ b) ∧123    (∀ i : Fin m, a ≤ i.val → i.val<P.firstFresh a b →124      ¬P.FirstVisit i ∧ P.edgeAt i∈P.treeEdges) ∧125    (∀ i : Fin m, P.firstFresh a b ≤ i.val → i.val<b → P.FirstVisit i) := by126  have hbounds := P.firstFresh_bounds a b hab127  refine ⟨hbounds,?_,?_⟩128  · intro i hai hi129    refine ⟨P.not_firstVisit_before_firstFresh a b hab i hai hi,?_⟩130    have himp := hno i hai (hi.trans_le hbounds.2)131    simpa only [importantTimes, Finset.mem_filter, Finset.mem_univ, true_and,132      not_not] using himp133  · intro i hsi hib134    have hsb : P.firstFresh a b<b := hsi.trans_lt hib135    let j : Fin m := ⟨P.firstFresh a b,hsb.trans_le hb⟩136    exact P.firstVisit_propagates a b hno j i hbounds.1137      (P.firstFresh_is_firstVisit a b hb hsb) hsi hib138139/-- Actual decomposition after any starting time, in particular immediately140after an important traversal. Both the next endpoint and the switch are141computed from the path. -/142theorem exploration_block_split (a : ℕ) (ha : a ≤ m) :143    let b := P.nextImportant a144    let s := P.firstFresh a b145    (a ≤ s ∧ s ≤ b) ∧146    (∀ i : Fin m, a ≤ i.val → i.val<s → ¬P.FirstVisit i ∧ P.edgeAt i∈P.treeEdges) ∧147    (∀ i : Fin m, s ≤ i.val → i.val<b → P.FirstVisit i) := by148  exact P.exploration_interval_split a (P.nextImportant a)149    (P.nextImportant_bounds a ha).1 (P.nextImportant_bounds a ha).2150    (P.not_important_before_next a)151152/-- A tree edge at the initial step must itself be a discovery edge. -/153theorem firstVisit_zero_of_not_important (hm : 0<m)154    (hzero : (⟨0,hm⟩ : Fin m)∉P.importantTimes) : P.FirstVisit ⟨0,hm⟩ := by155  have ht : P.edgeAt ⟨0,hm⟩∈P.treeEdges := by156    simpa only [importantTimes, Finset.mem_filter, Finset.mem_univ, true_and,157      not_not] using hzero158  obtain ⟨i,hi,he⟩ := Finset.mem_image.mp ht159  have hfirst := (P.mem_firstTimes i).mp hi160  by_cases hi0 : i.val=0161  · have hei : i=⟨0,hm⟩ := Fin.ext hi0162    simpa only [←hei] using hfirst163  · exact (P.firstVisit_edge_not_earlier hfirst (by simp; omega) he.symm).elim164165/-- Every step before the first important traversal discovers a new vertex. -/166theorem initial_prefix_firstVisit (i : Fin m) (hi : i.val<P.nextImportant 0) :167    P.FirstVisit i := by168  have hm : 0<m := Nat.zero_lt_of_lt i.isLt169  have hz : (⟨0,hm⟩ : Fin m)∉P.importantTimes :=170    P.not_important_before_next 0 ⟨0,hm⟩ (by simp) (by simp; omega)171  exact P.firstVisit_propagates 0 (P.nextImportant 0)172    (P.not_important_before_next 0) ⟨0,hm⟩ i (by simp)173    (P.firstVisit_zero_of_not_important hm hz) (by simp) hi174175end Nonadditivity.HaarPathGraph.Path