Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarCoreChainLabels

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.HaarPathChainPartition7import Nonadditivity.HaarPathCoefficientWords89/-! # Literal unoriented labels of the actual core-chain occurrence sequence1011Every compressed edge occurs in the path, and the two orientations have the12same label. Thus the number of variables in the endpoint sum is exactly the13number of unoriented core edges, rather than the number of traversals.14-/1516noncomputable section17set_option backward.isDefEq.respectTransparency false1819namespace Nonadditivity.HaarPathGraph.Path2021variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2223/-- The literal orientation-free label of a core-chain occurrence. -/24def chainLabel (c : P.CoreChain) : P.unorientedChains :=25  ⟨{c, P.coreChainReverse c}, Finset.mem_image.mpr ⟨c, Finset.mem_univ _, rfl⟩⟩2627@[simp] theorem chainLabel_reverse (c : P.CoreChain) :28    P.chainLabel (P.coreChainReverse c) = P.chainLabel c := by29  apply Subtype.ext30  change {P.coreChainReverse c, P.coreChainReverse (P.coreChainReverse c)} =31    {c, P.coreChainReverse c}32  rw [P.coreChainReverse_involutive]33  exact Finset.pair_comm _ _3435/-- Every orientation of every graph edge is either an original traversal36or the reverse of an original traversal. -/37theorem dart_eq_traversal_or_reverse (q : Dart V d) (hq : q ∈ P.darts) :38    ∃ i : Fin m, q = P.traversal i ∨ q = reverse (P.traversal i) := by39  have he : q.1 ∈ P.edges := (Finset.mem_product.mp hq).140  obtain ⟨i, hi⟩ := List.mem_ofFn.mp (List.mem_toFinset.mp he)41  have hedge : (P.traversal i).1 = q.1 := hi42  refine ⟨i, ?_⟩43  by_cases hb : q.2 = (P.traversal i).244  · exact Or.inl (Prod.ext hedge.symm hb)45  · right46    refine Prod.ext (show q.1 = (reverse (P.traversal i)).1 from hedge.symm) ?_47    change q.2 = !(P.traversal i).248    cases hq2 : q.2 <;> cases ht2 : (P.traversal i).2 <;> simp_all4950/-- Every core chain occurs in one of its two orientations in the actual51maximal-chain decomposition. -/52theorem chain_or_reverse_mem_decomposition (cs : List P.CoreChain)53    (hcs : (cs.map Subtype.val).flatten = P.traversalList) (c : P.CoreChain) :54    c ∈ cs ∨ P.coreChainReverse c ∈ cs := by55  let q := c.val.head (P.toCore_nonempty c.property.1)56  have hqc : q ∈ c.val := List.head_mem _57  have hq : q ∈ P.darts := P.toCore_mem c.property.1 hqc58  obtain ⟨i,hi | hi⟩ := P.dart_eq_traversal_or_reverse q hq59  · have hmem : q ∈ (cs.map Subtype.val).flatten := by60      rw [hcs, hi]61      exact List.mem_ofFn.mpr ⟨i,rfl⟩62    obtain ⟨l,hl,hql⟩ := List.mem_flatten.mp hmem63    obtain ⟨c',hc',rfl⟩ := List.mem_map.mp hl64    have he := P.coreChain_eq_of_common_dart c c' hqc hql65    exact Or.inl (he.symm ▸ hc')66  · have hmem : reverse q ∈ (cs.map Subtype.val).flatten := by67      rw [hcs, hi, reverse_reverse]68      exact List.mem_ofFn.mpr ⟨i,rfl⟩69    obtain ⟨l,hl,hql⟩ := List.mem_flatten.mp hmem70    obtain ⟨c',hc',rfl⟩ := List.mem_map.mp hl71    have hrev : reverse q ∈ (P.coreChainReverse c).val := by72      exact List.mem_map.mpr ⟨q,List.mem_reverse.mpr hqc,rfl⟩73    have he := P.coreChain_eq_of_common_dart (P.coreChainReverse c) c' hrev hql74    exact Or.inr (he.symm ▸ hc')7576/-- The occurrence sequence covers every actual orientation-free core label. -/77theorem chainLabels_cover (cs : List P.CoreChain)78    (hcs : (cs.map Subtype.val).flatten = P.traversalList) :79    ∀ e : P.unorientedChains, ∃ c ∈ cs, P.chainLabel c = e := by80  intro e81  obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property82  have hel : P.chainLabel c = e := Subtype.ext he83  rcases P.chain_or_reverse_mem_decomposition cs hcs c with hc | hc84  · exact ⟨c,hc,hel⟩85  · exact ⟨P.coreChainReverse c,hc,(P.chainLabel_reverse c).trans hel⟩8687/-- There are exactly as many distinct occurrence labels as actual core edges. -/88theorem card_chainLabels (cs : List P.CoreChain)89    (hcs : (cs.map Subtype.val).flatten = P.traversalList) :90    (cs.map P.chainLabel).toFinset.card = P.unorientedChains.card := by91  have he : (cs.map P.chainLabel).toFinset = Finset.univ := by92    apply Finset.eq_univ_of_forall93    intro e94    obtain ⟨c,hc,rfl⟩ := P.chainLabels_cover cs hcs e95    exact List.mem_toFinset.mpr (List.mem_map_of_mem hc)96  rw [he, Finset.card_univ, Fintype.card_coe]9798/-- Pick one of the two literal orientations of each compressed edge. -/99def representative (e : P.unorientedChains) : P.CoreChain :=100  (show e.val.Nonempty from by101    obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property102    rw [←he]103    exact ⟨c,by simp⟩).choose104105theorem representative_mem (e : P.unorientedChains) : P.representative e ∈ e.val :=106by107  unfold representative108  exact Classical.choose_spec _109110theorem label_representative (e : P.unorientedChains) : P.chainLabel (P.representative e) = e := by111  obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property112  apply Subtype.ext113  exact (HaarPathInvolution.pair_eq_of_mem P.coreChainReverse_involutive114    (he ▸ P.representative_mem e)).trans he115116/-- Each actual oriented occurrence is its representative or its reverse. -/117theorem eq_representative_or_reverse (c : P.CoreChain) :118    c = P.representative (P.chainLabel c) ∨119      c = P.coreChainReverse (P.representative (P.chainLabel c)) := by120  have h := P.representative_mem (P.chainLabel c)121  change P.representative (P.chainLabel c) ∈ {c,P.coreChainReverse c} at h122  rcases Finset.mem_insert.mp h with h | h123  · exact Or.inl h.symm124  · have he := Finset.mem_singleton.mp h125    exact Or.inr (by rw [he,P.coreChainReverse_involutive])126127end Nonadditivity.HaarPathGraph.Path