Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathColorMarks

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

Direct imports

Imported by project modules

1 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

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

19 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathFreshRuns78/-! # Literal finite marks for outgoing color classes910An outgoing color is encoded by its least matching prior incidence, or by a11fresh-color sentinel. Equality of these concrete finite codes reconstructs12the full outgoing-color equality pattern. The honest alphabet has `2m+1`13members; no smaller cardinality is assumed.14-/1516noncomputable section17namespace Nonadditivity.HaarPathClasses18open HaarPathGraph HaarPathProfiles1920variable {V : Type*} [DecidableEq V] {d m : ℕ}2122def incidenceRank (a : Incidence m) : ℕ := 2*a.1.val + if a.2 then 1 else 02324theorem incidenceRank_injective : Function.Injective (@incidenceRank m) := by25  rintro ⟨a,ab⟩ ⟨b,bb⟩ he26  cases ab <;> cases bb <;> simp [incidenceRank] at he27  · have h : a=b := Fin.ext (by omega)28    simp [h]29  · omega30  · omega31  · have h : a=b := Fin.ext (by omega)32    simp [h]3334local instance incidenceOrder : LinearOrder (Incidence m) :=35  LinearOrder.lift' incidenceRank incidenceRank_injective3637/-- Previous incidences at this vertex carrying the new outgoing color. -/38def matchingIncidences (P : Path V d m) (i : Fin m) : Finset (Incidence m) :=39  Finset.univ.filter fun a => a.1.val < i.val ∧40    incidenceVertex P a=P.vertex i.castSucc ∧ incidenceColor P a=P.colors i4142@[simp] theorem mem_matchingIncidences (P : Path V d m) (i : Fin m) (a : Incidence m) :43    a ∈ matchingIncidences P i ↔ a.1.val < i.val ∧44      incidenceVertex P a=P.vertex i.castSucc ∧ incidenceColor P a=P.colors i := by45  simp [matchingIncidences]4647/-- The least previous matching incidence, with `none` for a new color. -/48def outgoingCode (P : Path V d m) (i : Fin m) : Option (Incidence m) :=49  if h : (matchingIncidences P i).Nonempty then50    some ((matchingIncidences P i).min' h) else none5152theorem outgoingCode_some_mem (P : Path V d m) (i : Fin m) (a : Incidence m)53    (h : outgoingCode P i=some a) : a ∈ matchingIncidences P i := by54  unfold outgoingCode at h55  split_ifs at h with hn56  · have he := Option.some.inj h57    rw [←he]58    exact Finset.min'_mem _ _5960theorem outgoingCode_none_iff (P : Path V d m) (i : Fin m) :61    outgoingCode P i=none ↔ matchingIncidences P i=∅ := by62  unfold outgoingCode63  split_ifs with hn64  · simp [hn.ne_empty]65  · simp [Finset.not_nonempty_iff_eq_empty.mp hn]6667theorem outgoingCode_some_le (P : Path V d m) (i : Fin m) (a b : Incidence m)68    (ha : outgoingCode P i=some a) (hb : b∈matchingIncidences P i) :69    incidenceRank a ≤ incidenceRank b := by70  have hn : (matchingIncidences P i).Nonempty := ⟨b,hb⟩71  have he : (matchingIncidences P i).min' hn=a := by72    simpa [outgoingCode, hn] using ha73  rw [←he]74  exact Finset.min'_le _ _ hb7576/-- This is an explicit bound for the actual mark type. -/77theorem outgoingCode_alphabet_card : Fintype.card (Option (Incidence m))=2*m+1 := by78  simp [Nat.mul_comm]7980/-- Equality of finite marks recovers every outgoing-color comparison. -/81theorem outgoingMark_of_code_eq (P Q : Path V d m) (i : Fin m)82    (hp : PrefixSamePattern P Q i.val) (hc : outgoingCode P i=outgoingCode Q i) :83    OutgoingMark P Q i := by84  intro a ha hv85  cases hcode : outgoingCode P i with86  | none =>87      have heP := (outgoingCode_none_iff P i).mp hcode88      have heQ := (outgoingCode_none_iff Q i).mp (hc.symm.trans hcode)89      have hvQ : incidenceVertex Q a=Q.vertex i.castSucc := by90        rw [incidenceVertex_eq]91        apply (hp.1 (incidenceIndex a) i.castSucc92          (incidenceIndex_le_of_before a ha) (by simp)).mp93        simpa only [incidenceVertex_eq] using hv94      apply iff_of_false95      · intro he96        have hmem := (mem_matchingIncidences P i a).mpr ⟨ha,hv,he⟩97        simp [heP] at hmem98      · intro he99        have hmem := (mem_matchingIncidences Q i a).mpr ⟨ha,hvQ,he⟩100        simp [heQ] at hmem101  | some b =>102      have hbP := (mem_matchingIncidences P i b).mp (outgoingCode_some_mem P i b hcode)103      have hbQ := (mem_matchingIncidences Q i b).mp104        (outgoingCode_some_mem Q i b (hc.symm.trans hcode))105      have he := hp.2 a b ha hbP.1 (hv.trans hbP.2.1.symm)106      simpa only [hbP.2.2,hbQ.2.2] using he107108/-- A concrete finite color mark suffices to extend a fresh path prefix. -/109theorem prefixSamePattern_extend_code (P Q : Path V d m) (i : Fin m)110    (hp : PrefixSamePattern P Q i.val) (hP : P.FirstVisit i) (hQ : Q.FirstVisit i)111    (hc : outgoingCode P i=outgoingCode Q i) : PrefixSamePattern P Q (i.val+1) :=112  prefixSamePattern_extend_firstVisit P Q i hp hP hQ (outgoingMark_of_code_eq P Q i hp hc)113114end Nonadditivity.HaarPathClasses