Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarChainColoring

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.HaarCoreChainReverseAddress7import Nonadditivity.HaarPathProfileReverse8import Nonadditivity.HaarCoreChainWords9import Nonadditivity.HaarPathInternalColors1011/-! # Reconstructing graph colors from compatible reduced chain words -/1213noncomputable section14set_option backward.isDefEq.respectTransparency false15set_option maxHeartbeats 12000001617namespace Nonadditivity.HaarPathGraph.Path1819open HaarPathProfiles HaarProfileCoefficient20variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2122/-- A compatible assignment of actual reduced profile words to all orientations.23Only opposite orientations are related; the unoriented edges remain independent. -/24structure ChainColoring where25  value (c : P.CoreChain) : Words d c.val.length (P.coreChainProfile c).val26  reversal (p : P.ChainPosition) :27    (value (P.reversePosition p).1).val (P.reversePosition p).2 =28      flipColor ((value p.1).val p.2)2930namespace ChainColoring31variable {P} (F : P.ChainColoring)3233def color (q : P.darts) : Color d := P.recolor (fun c => (F.value c).val) q3435@[simp] theorem color_position (c : P.CoreChain) (i : Fin c.val.length) :36    F.color (P.positionDart ⟨c,i⟩) = (F.value c).val i := P.recolor_position _ c i3738/-- Opposite graph incidences receive opposite signed colors. -/39theorem color_reverse (q : P.darts) :40    F.color ⟨reverse q.val,P.reverse_mem q.property⟩ = flipColor (F.color q) := by41  obtain ⟨p,rfl⟩ := P.positionDart_surjective q42  have he : (⟨reverse (P.positionDart p).val,P.reverse_mem (P.positionDart p).property⟩ : P.darts) =43      P.positionDart (P.reversePosition p) := (P.positionDart_reversePosition p).symm44  rw [he,color_position,color_position]45  exact F.reversal p464748/-- Every noninitial position of a stopped chain has non-core source. -/49theorem source_not_core_of_pos (c : P.CoreChain) (i : Fin c.val.length)50    (hi : 0 < i.val) : source c.val[i] ∉ P.coreVertices := by51  apply P.toCore_tail_source_not_core c.property.152  have ht : i.val-1 < c.val.tail.length := by simp only [List.length_tail]; omega53  have hm := List.get_mem c.val.tail (⟨i.val-1,ht⟩ : Fin c.val.tail.length)54  simpa only [List.get_eq_getElem,List.getElem_tail,Nat.sub_add_cancel hi] using hm5556/-- The initial source of a complete chain belongs to the core. -/57theorem source_core_of_zero (c : P.CoreChain) (i : Fin c.val.length)58    (hi : i.val=0) : source c.val[i] ∈ P.coreVertices := by59  obtain ⟨a,l,he,ha⟩ := c.property.260  change source c.val[i.val] ∈ P.coreVertices61  simpa only [he,hi,List.getElem_cons_zero] using ha6263/-- Endpoint profiles fix all outgoing signed colors at core vertices. -/64theorem color_eq_of_source_core (q : P.darts) (hq : source q.val∈P.coreVertices) :65    F.color q=HaarPathGraph.color q.val := by66  obtain ⟨⟨c,i⟩,rfl⟩ := P.positionDart_surjective q67  have hi : i.val=0 := by68    by_contra h69    exact source_not_core_of_pos (P := P) c i (Nat.pos_of_ne_zero h) hq70  rw [F.color_position]71  have hh := (F.value c).property.2.172  have hn : 0 < c.val.length := by omega73  have hf : (List.ofFn (F.value c).val).head?=some ((F.value c).val ⟨0,hn⟩) := by74    rw [List.head?_eq_some_head (by simpa using Nat.ne_of_gt hn),List.head_ofFn]75  rw [hf] at hh76  have hi' : i=⟨0,hn⟩ := Fin.ext hi77  rw [Option.some.injEq] at hh78  rw [hi',hh,P.coreChainProfile_first]79  simp only [positionDart,List.get_eq_getElem,List.head_eq_getElem]8081/-- Adjacent letters in an assigned reduced profile cannot cancel. -/82theorem value_step (c : P.CoreChain) (i : ℕ) (hi : i + 1 < c.val.length) :83    (F.value c).val ⟨i+1,hi⟩ ≠ flipColor ((F.value c).val ⟨i,by omega⟩) := by84  intro he85  have hr := List.isChain_iff_getElem.mp (F.value c).property.1 i86    (by simpa only [List.length_ofFn] using hi)87  simp only [List.getElem_ofFn] at hr88  rw [he] at hr89  have hb := hr rfl90  cases h : ((F.value c).val ⟨i,by omega⟩).2 <;> simp [flipColor,h] at hb9192/-- Recoloring preserves injectivity among the two outgoing darts of every93internal vertex, because their colors are adjacent reduced letters. -/94theorem color_injective_internal {q r : P.darts}95    (hq : source q.val∉P.coreVertices) (hs : source q.val=source r.val)96    (hc : F.color q=F.color r) : q=r := by97  by_contra hne98  obtain ⟨⟨c,i⟩,hqi⟩ := P.positionDart_surjective q99  have hi : 0 < i.val := by100    by_contra h101    have hi0 : i.val=0 := by omega102    exact hq (hqi ▸ source_core_of_zero (P := P) c i hi0)103  let j : Fin c.val.length := ⟨i.val-1,by omega⟩104  have hji : j.val+1=i.val := by dsimp [j]; omega105  have ht := P.toCore_step c.property.1 j.val (by omega)106  have he : c.val[j.val+1]=q.val := by107    simpa only [hji] using congrArg Subtype.val hqi108  rw [he] at ht109  let a := P.positionDart ⟨c,j⟩110  have hra : r.val=reverse a.val := by111    apply P.next_dart_unique q.property r.property (P.reverse_mem a.property) hq hs ht.1.symm112    · exact fun h => hne (Subtype.ext h.symm)113    · exact ht.2.symm114  have hr : r=⟨reverse a.val,P.reverse_mem a.property⟩ := Subtype.ext hra115  rw [hr,F.color_reverse,←hqi,F.color_position,F.color_position] at hc116  have hstep := F.value_step c j.val (by omega)117  have hi' : (⟨j.val+1,by omega⟩ : Fin c.val.length)=i := Fin.ext hji118  rw [hi'] at hstep119  exact hstep hc120121/-- The assigned profile words preserve the actual local color equality122kernel, which is the defining color constraint of the coarse path class. -/123theorem color_kernel (q r : P.darts) (hs : source q.val=source r.val) :124    F.color q=F.color r ↔ HaarPathGraph.color q.val=HaarPathGraph.color r.val := by125  by_cases hq : source q.val∈P.coreVertices126  · rw [F.color_eq_of_source_core q hq,F.color_eq_of_source_core r (hs ▸ hq)]127  · constructor128    · intro hc129      exact congrArg (fun q : P.darts => HaarPathGraph.color q.val) (F.color_injective_internal hq hs hc)130    · intro hc131      have he := P.internal_color_injective q.property r.property hq hs hc132      exact congrArg F.color (Subtype.ext he)133134end ChainColoring135end Nonadditivity.HaarPathGraph.Path