Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarChainColoringPalettes

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

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

22 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarChainColoring7import Nonadditivity.HaarProfileWordReverse8import Nonadditivity.HaarRepresentativePositions910/-! # Independent unoriented profile palettes1112A choice of one reduced profile word for every unoriented core edge is exactly13a reversal-compatible assignment on all oriented chains. The equivalence has14no compatibility restrictions between distinct unoriented labels.15-/16noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 120000019namespace Nonadditivity.HaarPathGraph.Path20open HaarPathProfiles HaarProfileCoefficient21variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2223abbrev ChainPalette := ∀ e : P.unorientedChains,24  Words d (P.representative e).val.length (P.coreChainProfile (P.representative e)).val2526def paletteWord (σ : P.ChainPalette) (c : P.CoreChain) :27    Words d c.val.length (P.coreChainProfile c).val := by28  classical29  by_cases h : c=P.representative (P.chainLabel c)30  · exact h.symm ▸ σ (P.chainLabel c)31  · have hr : c=P.coreChainReverse (P.representative (P.chainLabel c)) :=32      (P.eq_representative_or_reverse c).resolve_left h33    exact hr.symm ▸ P.reverseProfileWord _ (σ (P.chainLabel c))3435@[simp] theorem paletteWord_representative (σ : P.ChainPalette) (e : P.unorientedChains) :36    P.paletteWord σ (P.representative e)=σ e := by37  simp [paletteWord,P.label_representative]38  apply eq_of_heq39  exact (eqRec_heq (φ := fun c : P.CoreChain =>40    Words d c.val.length (P.coreChainProfile c).val) _ _).trans41      (congr_arg_heq σ (P.label_representative e))4243@[simp] theorem paletteWord_reverse_representative (σ : P.ChainPalette) (e : P.unorientedChains) :44    P.paletteWord σ (P.coreChainReverse (P.representative e))=45      P.reverseProfileWord (P.representative e) (σ e) := by46  simp [paletteWord,P.label_representative,P.coreChainReverse_ne_self]47  apply eq_of_heq48  exact (eqRec_heq (φ := fun c : P.CoreChain =>49    Words d c.val.length (P.coreChainProfile c).val) _ _).trans (congr_arg_heq50    (fun e => P.reverseProfileWord (P.representative e) (σ e))51    ((P.chainLabel_reverse _).trans (P.label_representative e)))5253theorem word_cast_chain {c c' : P.CoreChain} (h : c=c')54    (w : Words d c.val.length (P.coreChainProfile c).val) :55    word (h ▸ w)=word w := by56  cases h57  rfl5859/-- The coefficient uses the chosen representative word or its group inverse,60according to the literal orientation of the occurrence. -/61theorem paletteWord_word (σ : P.ChainPalette) (c : P.CoreChain) :62    word (P.paletteWord σ c) =63      if c=P.representative (P.chainLabel c) then word (σ (P.chainLabel c))64      else (word (σ (P.chainLabel c)))⁻¹ := by65  classical66  unfold paletteWord67  split_ifs68  · exact P.word_cast_chain _ _69  · rw [P.word_cast_chain,P.reverseProfileWord_word]7071theorem paletteWord_reversal (σ : P.ChainPalette) (p : P.ChainPosition) :72    (P.paletteWord σ (P.reversePosition p).1).val (P.reversePosition p).2=73      flipColor ((P.paletteWord σ p.1).val p.2) := by74  have hpos (e : P.unorientedChains) (i : Fin (P.representative e).val.length) :75      (P.paletteWord σ (P.reversePosition ⟨P.representative e,i⟩).1).val76        (P.reversePosition ⟨P.representative e,i⟩).2 =77        flipColor ((P.paletteWord σ (P.representative e)).val i) := by78    change (P.paletteWord σ (P.coreChainReverse (P.representative e))).val79      (Fin.cast (P.coreChainReverse_length _).symm i.rev) = _80    rw [P.paletteWord_reverse_representative,P.paletteWord_representative,P.reverseProfileWord_val]81    apply congrArg flipColor82    apply congrArg (σ e).val83    apply Fin.ext84    simp only [Fin.val_cast,Fin.val_rev]85    rw [P.coreChainReverse_length]86    have hi := i.isLt87    omega88  obtain ⟨⟨e,i,b⟩,rfl⟩ := P.representativePosition_surjective p89  cases b90  · change (P.paletteWord σ (P.reversePosition (P.reversePosition ⟨P.representative e,i⟩)).1).val91      (P.reversePosition (P.reversePosition ⟨P.representative e,i⟩)).2 = _92    rw [P.reversePosition_involutive]93    have hh := congrArg flipColor (hpos e i)94    rw [flipColor_involutive] at hh95    exact hh.symm96  · exact hpos e i9798def paletteColoring (σ : P.ChainPalette) : P.ChainColoring where99  value := P.paletteWord σ100  reversal := P.paletteWord_reversal σ101102namespace ChainColoring103variable {P} (F : P.ChainColoring)104105def palette : P.ChainPalette := fun e => F.value (P.representative e)106107theorem value_reverse (c : P.CoreChain) :108    F.value (P.coreChainReverse c)=P.reverseProfileWord c (F.value c) := by109  apply Subtype.ext110  funext i111  let j : Fin c.val.length := (Fin.cast (P.coreChainReverse_length c) i).rev112  have hj : Fin.cast (P.coreChainReverse_length c).symm j.rev=i := by113    apply Fin.ext114    simp only [j,Fin.val_cast,Fin.val_rev]115    have hi : i.val<c.val.length := lt_of_lt_of_eq i.isLt (P.coreChainReverse_length c)116    omega117  have h := F.reversal ⟨c,j⟩118  change (F.value (P.coreChainReverse c)).val119    (Fin.cast (P.coreChainReverse_length c).symm j.rev)=flipColor ((F.value c).val j) at h120  rw [hj] at h121  rw [P.reverseProfileWord_val,h]122  apply congrArg flipColor123  apply congrArg (F.value c).val124  apply Fin.ext125  simp only [j,Fin.val_rev,Fin.val_cast]126  have hl := P.coreChainReverse_length c127  omega128129@[ext] theorem ext {F G : P.ChainColoring} (h : ∀ c, F.value c=G.value c) : F=G := by130  cases F with131  | mk f hf =>132    cases G with133    | mk g hg =>134      have he : f=g := funext h135      cases he136      rfl137138end ChainColoring139140@[simp] theorem paletteColoring_palette (σ : P.ChainPalette) :141    (P.paletteColoring σ).palette=σ := by142  funext e143  exact P.paletteWord_representative σ e144145@[simp] theorem paletteColoring_of_palette (F : P.ChainColoring) :146    P.paletteColoring F.palette=F := by147  apply ChainColoring.ext148  intro c149  change P.paletteWord F.palette c=F.value c150  obtain ⟨e,hc | hc⟩ : ∃ e : P.unorientedChains,151      c=P.representative e ∨ c=P.coreChainReverse (P.representative e) :=152    ⟨P.chainLabel c,P.eq_representative_or_reverse c⟩153  · subst c154    exact P.paletteWord_representative F.palette e155  · subst c156    rw [P.paletteWord_reverse_representative,F.value_reverse]157    rfl158159/-- Exact factorization into independent actual reduced profile families. -/160def chainPaletteEquiv : P.ChainPalette ≃ P.ChainColoring where161  toFun := P.paletteColoring162  invFun := ChainColoring.palette163  left_inv := P.paletteColoring_palette164  right_inv := P.paletteColoring_of_palette165166end Nonadditivity.HaarPathGraph.Path