Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathChainPartition

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

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

14 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChainCount78/-! # Core chains partition the oriented incidences they visit -/9noncomputable section10namespace Nonadditivity.HaarPathGraph.Path11variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1213lemma toCore_drop {l : List (Dart V d)} (h : P.ToCore l) (n : ℕ) (hn : n<l.length) :14    P.ToCore (l.drop n) := by15  induction h generalizing n with16  | last a ha hc =>17      have hn0 : n=0 := by simpa using hn18      subst n19      exact ToCore.last a ha hc20  | cons a b l ha hc hj hr ht ih =>21      cases n with22      | zero => exact ToCore.cons a b l ha hc hj hr ht23      | succ n => simpa using ih n (by simpa using hn)2425lemma internalChain_take {l : List (Dart V d)} (h : P.InternalChain l)26    (n : ℕ) (hn : 0<n) : P.InternalChain (l.take n) := by27  induction h generalizing n with28  | single a ha =>29      cases n with30      | zero => omega31      | succ n => simpa using InternalChain.single a ha32  | cons a b l ha hc hj hr ht ih =>33      cases n with34      | zero => omega35      | succ n =>36          cases n with37          | zero => exact InternalChain.single a ha38          | succ n =>39              simpa using InternalChain.cons a b (l.take n) ha hc hj hr (ih (n+1) (by omega))4041lemma toCore_mem {l : List (Dart V d)} (h : P.ToCore l) {q : Dart V d} (hq : q ∈ l) :42    q ∈ P.darts := by43  induction h with44  | last a ha hc => simpa using (List.mem_singleton.mp hq) ▸ ha45  | cons a b l ha hc hj hr ht ih =>46      rcases List.mem_cons.mp hq with rfl | hq47      · exact ha48      · exact ih hq4950/-- A terminated deterministic chain never revisits the same oriented dart. -/51theorem toCore_nodup {l : List (Dart V d)} (h : P.ToCore l) : l.Nodup := by52  induction h with53  | last a ha hc => simp54  | cons a b l ha hc hj hr ht ih =>55      apply List.nodup_cons.mpr56      refine ⟨?_,ih⟩57      intro hmem58      obtain ⟨p,s,he⟩ := List.mem_iff_append.mp hmem59      have hs : P.ToCore (a::s) := by60        have hd := P.toCore_drop ht p.length (by rw [he]; simp)61        simpa [he] using hd62      have heq := P.toCore_unique (ToCore.cons a b l ha hc hj hr ht) hs rfl63      have hlen := congrArg List.length heq64      rw [he] at hlen65      simp only [List.length_cons,List.length_append] at hlen66      omega6768/-- The suffix beginning at any occurrence of a dart is its unique route to69the next core vertex. -/70lemma suffix_toCore (c : P.CoreChain) (p : List (Dart V d)) (q : Dart V d)71    (s : List (Dart V d)) (he : c.val=p++q::s) : P.ToCore (q::s) := by72  have hd := P.toCore_drop c.property.1 p.length (by rw [he]; simp)73  simpa [he] using hd7475/-- Reversing the prefix through a dart reaches the preceding core vertex. -/76lemma reversed_prefix_toCore (c : P.CoreChain) (p : List (Dart V d)) (q : Dart V d)77    (s : List (Dart V d)) (he : c.val=p++q::s) :78    P.ToCore ((p++[q]).reverse.map reverse) := by79  have hi : P.InternalChain (p++[q]) := by80    have ht := P.internalChain_take c.property.1.internalChain (p.length+1) (by omega)81    simpa [he,List.take_add] using ht82  have hr := P.internalChain_reverse hi83  apply P.internalChain_toCore hr84  have hc : source (c.val.head (P.toCore_nonempty c.property.1)) ∈ P.coreVertices := by85    obtain ⟨a,t,hat,hc⟩ := c.property.286    simpa [hat] using hc87  cases p with88  | nil => simpa [he] using hc89  | cons a p => simpa [he,List.getLast_map,List.getLast_reverse] using hc9091/-- Sharing an oriented incidence identifies the entire maximal core chain.92The forward and backward continuations are both forced. -/93theorem coreChain_eq_of_common_dart (c c' : P.CoreChain) {q : Dart V d}94    (hq : q ∈ c.val) (hq' : q ∈ c'.val) : c=c' := by95  obtain ⟨p,s,he⟩ := List.mem_iff_append.mp hq96  obtain ⟨p',s',he'⟩ := List.mem_iff_append.mp hq'97  have hs : s=s' := (List.cons.inj98    (P.toCore_unique (P.suffix_toCore c p q s he) (P.suffix_toCore c' p' q s' he') rfl)).299  have hb := P.toCore_unique (P.reversed_prefix_toCore c p q s he)100    (P.reversed_prefix_toCore c' p' q s' he') (by simp)101  have hp : p=p' := by102    have hh := congrArg (fun l : List (Dart V d) => l.reverse.map reverse) hb103    simp only [List.map_reverse,List.reverse_reverse,List.map_map,Function.comp_def,104      reverse_reverse,List.map_id_fun'] at hh105    exact List.append_cancel_right hh106  apply Subtype.ext107  simp [he,he',hp,hs]108109/-- A chain cannot traverse an edge in both orientations. -/110theorem coreChain_not_both_orientations (c : P.CoreChain) {q : Dart V d} (hq : q ∈ c.val) :111    reverse q ∉ c.val := by112  intro hrev113  have hmem : q ∈ (P.coreChainReverse c).val := by114    change q ∈ c.val.reverse.map reverse115    exact List.mem_map.mpr ⟨reverse q,List.mem_reverse.mpr hrev,reverse_reverse q⟩116  exact P.coreChainReverse_ne_self c (P.coreChain_eq_of_common_dart c (P.coreChainReverse c) hq hmem).symm117118end Nonadditivity.HaarPathGraph.Path