Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathDecomposition

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

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

12 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChains78/-! # Actual decomposition into degree-two core chains -/9noncomputable section10namespace Nonadditivity.HaarPathGraph.Path11variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1213def Step (a b : Dart V d) : Prop := source (reverse a)=source b ∧ b ≠ reverse a1415/-- Stop at the first core vertex. The returned suffix begins at a core16vertex whenever it is nonempty. -/17theorem exists_initial_chain (a : Dart V d) (l : List (Dart V d))18    (hmem : ∀ q ∈ a::l, q ∈ P.darts) (hstep : (a::l).IsChain Step)19    (hend : source (reverse ((a::l).getLast (by simp))) ∈ P.coreVertices) :20    ∃ t s, l=t++s ∧ P.ToCore (a::t) ∧21      ∀ b r, s=b::r → source b ∈ P.coreVertices := by22  induction l generalizing a with23  | nil =>24      refine ⟨[],[],rfl,ToCore.last a (hmem a (by simp)) (by simpa using hend),?_⟩25      intro b r he26      cases he27  | cons b l ih =>28      have hpair := (List.isChain_cons_cons.mp hstep).129      have htail := (List.isChain_cons_cons.mp hstep).230      by_cases hc : source (reverse a) ∈ P.coreVertices31      · refine ⟨[],b::l,rfl,ToCore.last a (hmem a (by simp)) hc,?_⟩32        intro c r he33        have hbc : b=c := (List.cons.inj he).134        rw [←hbc,←hpair.1]35        exact hc36      · obtain ⟨t,s,he,ht,hs⟩ := ih b37          (fun q hq => hmem q (List.mem_cons_of_mem a hq))38          htail (by simpa using hend)39        refine ⟨b::t,s,?_,ToCore.cons a b t (hmem a (by simp)) hc hpair.1 hpair.2 ht,hs⟩40        simp [he]4142/-- Any reduced graph walk with endpoints at core vertices is a concatenation43of the actual first-hit chains. No decomposition hypothesis is supplied. -/44theorem exists_chain_decomposition (l : List (Dart V d)) (hne : l ≠ [])45    (hmem : ∀ q ∈ l, q ∈ P.darts) (hstep : l.IsChain Step)46    (hstart : source (l.head hne) ∈ P.coreVertices)47    (hend : source (reverse (l.getLast hne)) ∈ P.coreVertices) :48    ∃ cs : List P.CoreChain, (cs.map Subtype.val).flatten = l := by49  induction hn : l.length using Nat.strong_induction_on generalizing l with50  | h n ih =>51      cases l with52      | nil => exact (hne rfl).elim53      | cons a l =>54          obtain ⟨t,s,he,ht,hs⟩ := P.exists_initial_chain a l hmem hstep hend55          let c : P.CoreChain := ⟨a::t,ht,⟨a,t,rfl,by simpa using hstart⟩⟩56          have hefull : a::l=(a::t)++s := by simp [he]57          by_cases hsn : s=[]58          · refine ⟨[c],?_⟩59            change (a::t)++[]=a::l60            rw [List.append_nil]61            simpa only [hsn,List.append_nil] using hefull.symm62          · have hslen : s.length < n := by63              rw [←hn,hefull,List.length_append,List.length_cons]64              omega65            have hsmem : ∀ q ∈ s, q ∈ P.darts := by66              intro q hq67              apply hmem q68              rw [hefull]69              exact List.mem_append_right _ hq70            have hsstep : s.IsChain Step := by71              rw [hefull] at hstep72              exact hstep.right_of_append73            have hsstart : source (s.head hsn) ∈ P.coreVertices :=74              hs _ _ (List.cons_head_tail hsn).symm75            have hsend : source (reverse (s.getLast hsn)) ∈ P.coreVertices := by76              simpa only [hefull,List.getLast_append_of_ne_nil _ hsn] using hend77            obtain ⟨cs,hcs⟩ := ih s.length hslen s hsn hsmem hsstep hsstart hsend rfl78            refine ⟨c::cs,?_⟩79            change (a::t)++(cs.map Subtype.val).flatten=a::l80            rw [hcs]81            exact hefull.symm8283/-- The literal oriented dart sequence of the original path. -/84def traversalList : List (Dart V d) := List.ofFn P.traversal8586omit [DecidableEq V] in87@[simp] theorem traversalList_length : P.traversalList.length=m := by simp [traversalList]8889omit [DecidableEq V] in90theorem traversalList_step : P.traversalList.IsChain Step := by91  apply List.isChain_iff_getElem.mpr92  intro i hi93  have hi' : i+1<m := by simpa [traversalList] using hi94  simp only [traversalList,List.getElem_ofFn]95  constructor96  · simp only [traversal,source_reverse_dart,source_dart]97    rfl98  · intro h99    have hc := congrArg color h100    simp only [traversal,color_dart,color_reverse_dart] at hc101    exact P.reduced _ _ rfl hc102103/-- The original nonempty reduced path, with no extra graph hypotheses,104admits a successive core-chain occurrence list. -/105theorem exists_traversal_chain_decomposition (hm : 0 < m) :106    ∃ cs : List P.CoreChain, (cs.map Subtype.val).flatten=P.traversalList := by107  have hne : P.traversalList ≠ [] := by108    intro he109    have h := congrArg List.length he110    simp only [traversalList_length,List.length_nil] at h111    omega112  have hroot : P.vertex 0 ∈ P.coreVertices :=113    Finset.mem_filter.mpr ⟨P.start_mem ⟨0,hm⟩,Or.inl rfl⟩114  apply P.exists_chain_decomposition P.traversalList hne115  · intro q hq116    obtain ⟨i,rfl⟩ := List.mem_ofFn.mp hq117    exact P.traversal_mem i118  · exact P.traversalList_step119  · simpa [traversalList,List.head_ofFn,traversal] using hroot120  · have hlast : (⟨m-1,Nat.sub_one_lt (by omega)⟩ : Fin m).succ=Fin.last m := by121      apply Fin.ext122      simp only [Fin.val_succ,Fin.val_last]123      omega124    simpa [traversalList,List.getLast_ofFn,traversal,hlast,P.closed] using hroot125126end Nonadditivity.HaarPathGraph.Path