Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathFreshRuns

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

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

33 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathClasses78/-! # Fresh exploration runs carry no internal color marks910When a path discovers a fresh vertex, only the outgoing color at the old11vertex needs a mark. At every later step of a consecutive discovery run,12the only previous incidence is the incoming edge; reduction forces the new13outgoing color to be distinct. Thus all subsequent equality patterns are14determined without additional marks.15-/1617noncomputable section18namespace Nonadditivity.HaarPathClasses19open HaarPathGraph HaarPathProfiles2021variable {V : Type*} [DecidableEq V] {d m : ℕ}2223/-- The exact vertex and local-color equality patterns of a path prefix. -/24def PrefixSamePattern (P Q : Path V d m) (k : ℕ) : Prop :=25  (∀ i j : Fin (m+1), i.val ≤ k → j.val ≤ k →26    (P.vertex i=P.vertex j ↔ Q.vertex i=Q.vertex j)) ∧27  ∀ a b : Incidence m, a.1.val < k → b.1.val < k →28    incidenceVertex P a=incidenceVertex P b →29    (incidenceColor P a=incidenceColor P b ↔ incidenceColor Q a=incidenceColor Q b)3031omit [DecidableEq V] in32theorem prefixSamePattern_mono {P Q : Path V d m} {j k : ℕ}33    (h : PrefixSamePattern P Q k) (hjk : j ≤ k) : PrefixSamePattern P Q j := by34  exact ⟨fun a b ha hb => h.1 a b (ha.trans hjk) (hb.trans hjk),35    fun a b ha hb => h.2 a b (ha.trans_le hjk) (hb.trans_le hjk)⟩3637omit [DecidableEq V] in38theorem prefixSamePattern_full {P Q : Path V d m}39    (h : PrefixSamePattern P Q m) : SamePattern P Q := by40  exact ⟨fun i j => h.1 i j (by omega) (by omega),41    fun a b => h.2 a b a.1.isLt b.1.isLt⟩4243theorem incidenceIndex_le_of_before (a : Incidence m) {k : ℕ}44    (ha : a.1.val < k) : (incidenceIndex a).val ≤ k := by45  obtain ⟨a,b⟩ := a46  change a.val < k at ha47  cases b <;> simp only [incidenceIndex, Bool.false_eq_true, if_false, if_true,48    Fin.val_succ, Fin.val_castSucc] <;> omega4950/-- The sole new color information at a first visit is its outgoing color's51equality pattern with old incidences at the starting vertex. -/52def OutgoingMark (P Q : Path V d m) (i : Fin m) : Prop :=53  ∀ a : Incidence m, a.1.val < i.val →54    incidenceVertex P a=P.vertex i.castSucc →55    (incidenceColor P a=P.colors i ↔ incidenceColor Q a=Q.colors i)5657/-- Extend the full observable pattern by one fresh-vertex step. The proof58uses the literal two incidences of the new edge. -/59theorem prefixSamePattern_extend_firstVisit (P Q : Path V d m) (i : Fin m)60    (hp : PrefixSamePattern P Q i.val) (hP : P.FirstVisit i) (hQ : Q.FirstVisit i)61    (hmark : OutgoingMark P Q i) : PrefixSamePattern P Q (i.val+1) := by62  constructor63  · intro a b ha hb64    by_cases hai : a.val ≤ i.val65    · by_cases hbi : b.val ≤ i.val66      · exact hp.1 a b hai hbi67      · have he : b=i.succ := Fin.ext (by simp; omega)68        subst b69        exact iff_of_false (hP a hai) (hQ a hai)70    · have he : a=i.succ := Fin.ext (by simp; omega)71      subst a72      by_cases hbi : b.val ≤ i.val73      · exact iff_of_false (Ne.symm (hP b hbi)) (Ne.symm (hQ b hbi))74      · have he : b=i.succ := Fin.ext (by simp; omega)75        subst b76        simp77  · have holdnew (a : Incidence m) (ha : a.1.val < i.val) (b : Bool)78        (hab : incidenceVertex P a=incidenceVertex P (i,b)) :79        (incidenceColor P a=incidenceColor P (i,b) ↔80          incidenceColor Q a=incidenceColor Q (i,b)) := by81      cases b with82      | false =>83          exact (hP (incidenceIndex a) (incidenceIndex_le_of_before a ha)84            (by simpa only [incidenceVertex_eq, incidenceIndex, if_false] using hab)).elim85      | true => exact hmark a ha hab86    have hnewnew (a b : Bool)87        (hab : incidenceVertex P (i,a)=incidenceVertex P (i,b)) :88        (incidenceColor P (i,a)=incidenceColor P (i,b) ↔89          incidenceColor Q (i,a)=incidenceColor Q (i,b)) := by90      have hn := hP i.castSucc (show i.castSucc.val ≤ i.val from le_rfl)91      cases a <;> cases b92      · simp93      · exact (hn hab.symm).elim94      · exact (hn hab).elim95      · simp96    rintro ⟨a,ab⟩ ⟨b,bb⟩ ha hb hab97    by_cases hai : a.val < i.val98    · by_cases hbi : b.val < i.val99      · exact hp.2 (a,ab) (b,bb) hai hbi hab100      · have he : b=i := Fin.ext (by change b.val < i.val+1 at hb; omega)101        subst b102        exact holdnew (a,ab) hai bb hab103    · have he : a=i := Fin.ext (by change a.val < i.val+1 at ha; omega)104      subst a105      by_cases hbi : b.val < i.val106      · simpa only [eq_comm] using holdnew (b,bb) hbi ab hab.symm107      · have he : b=i := Fin.ext (by change b.val < i.val+1 at hb; omega)108        subst b109        exact hnewnew ab bb hab110111/-- Immediately after a first visit, the previous incoming incidence is the112only old incidence at the current vertex. -/113theorem incidence_at_fresh_vertex_unique (P : Path V d m) (i j : Fin m)114    (hij : i.val+1=j.val) (hi : P.FirstVisit i)115    (a : Incidence m) (ha : a.1.val < j.val)116    (hv : incidenceVertex P a=P.vertex j.castSucc) : a=(i,false) := by117  have hji : j.castSucc=i.succ := Fin.ext (by simp; omega)118  rw [hji] at hv119  obtain ⟨a,b⟩ := a120  change a.val < j.val at ha121  cases b with122  | true =>123      exact (hi a.castSucc (by change a.val ≤ i.val; omega) hv).elim124  | false =>125      have hai : a.val=i.val := by126        by_contra hn127        have hlt : a.val < i.val := by omega128        exact hi a.succ (by simp; omega) hv129      exact congrArg (fun k : Fin m => (k,false)) (Fin.ext hai)130131/-- No color mark is needed after a fresh visit: reducedness fixes the only132possible comparison with the previous incoming incidence. -/133theorem outgoingMark_after_firstVisit (P Q : Path V d m) (i j : Fin m)134    (hij : i.val+1=j.val) (hi : P.FirstVisit i) : OutgoingMark P Q j := by135  intro a ha hv136  have he := incidence_at_fresh_vertex_unique P i j hij hi a ha hv137  subst a138  exact iff_of_false (Ne.symm (P.reduced i j hij)) (Ne.symm (Q.reduced i j hij))139140theorem prefixSamePattern_extend_after_firstVisit (P Q : Path V d m) (i j : Fin m)141    (hij : i.val+1=j.val) (hp : PrefixSamePattern P Q j.val)142    (hi : P.FirstVisit i) (hP : P.FirstVisit j) (hQ : Q.FirstVisit j) :143    PrefixSamePattern P Q (j.val+1) :=144  prefixSamePattern_extend_firstVisit P Q j hp hP hQ145    (outgoingMark_after_firstVisit P Q i j hij hi)146147/-- An entire consecutive fresh run is determined by its first-step pattern.148The induction adds no further outgoing-color marks. -/149theorem prefixSamePattern_fresh_run (P Q : Path V d m) (s t : ℕ)150    (hst : s < t) (htm : t ≤ m) (hp : PrefixSamePattern P Q (s+1))151    (hfresh : ∀ i : Fin m, s ≤ i.val → i.val < t → P.FirstVisit i ∧ Q.FirstVisit i) :152    PrefixSamePattern P Q t := by153  have hmain : ∀ k, s+1 ≤ k → k ≤ t → PrefixSamePattern P Q k := by154    intro k hsk155    induction k, hsk using Nat.le_induction with156    | base => exact fun _ => hp157    | succ k hsk ih =>158        intro hkt159        let i : Fin m := ⟨k-1,by omega⟩160        let j : Fin m := ⟨k,by omega⟩161        have hij : i.val+1=j.val := by dsimp [i,j]; omega162        have hi := (hfresh i (by dsimp [i]; omega) (by dsimp [i]; omega)).1163        have hj := hfresh j (by dsimp [j]; omega) (by dsimp [j]; omega)164        exact prefixSamePattern_extend_after_firstVisit P Q i j hij165          (ih (by omega)) hi hj.1 hj.2166  exact hmain t (by omega) le_rfl167168end Nonadditivity.HaarPathClasses