Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarProfileSingletonWeight

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

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

25 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarProfilePatternBound7import Nonadditivity.NoncommutativeCSSingletons8import Nonadditivity.HaarChainMultiplicity910/-! # Exact two-generator singleton weight in endpoint skeletons -/11noncomputable section12open scoped BigOperators13namespace Nonadditivity.NoncommutativeCS.EndpointSkeleton14variable {I : Type*}1516def singletonLength {m n : ℕ} {a : Fin m → I} {b : Fin n → I}17    (P : EndpointSkeleton I a b) (size : I → ℕ) : ℕ :=18  match P with19  | .done _ => 020  | .first _ P => P.singletonLength size21  | .last _ P => P.singletonLength size22  | .middle _ P => P.singletonLength size23  | .singleton i P => size i + P.singletonLength size2425theorem sqrt_four_nat_pow (k : ℕ) :26    Real.sqrt (((2*2)^k : ℕ) : ℝ) = (2:ℝ)^k := by27  have he : (((2*2)^k : ℕ) : ℝ) = ((2:ℝ)^k)^2 := by28    calc29      _ = ((2:ℝ)^2)^k := by norm_num30      _ = _ := by rw [←pow_mul,←pow_mul,Nat.mul_comm 2 k]31  rw [he,Real.sqrt_sq (by positivity)]3233/-- Each once-used chain costs exactly two to the power of its length. -/34theorem singletonWeight_two {m n : ℕ} {a : Fin m → I} {b : Fin n → I}35    (P : EndpointSkeleton I a b) (size : I → ℕ) :36    P.singletonWeight size 2 = (2:ℝ)^P.singletonLength size := by37  induction P with38  | done => simp [singletonWeight,singletonLength]39  | first i P ih => exact ih40  | last p P ih => exact ih41  | middle v P ih => exact ih42  | singleton i P ih =>43      simp only [singletonWeight,singletonLength,ih,sqrt_four_nat_pow,pow_add,mul_comm]4445theorem singletonLength_eq_map_sum {m n : ℕ} {a : Fin m → I} {b : Fin n → I}46    (P : EndpointSkeleton I a b) (size : I → ℕ) :47    P.singletonLength size=(P.singletonLabels.map size).sum := by48  induction P <;> simp_all [singletonLength,singletonLabels]4950/-- The singleton cost records literal once-occurring labels, independently51of how the valid endpoint skeleton was obtained. -/52theorem singletonLength_eq_sum_count_one [DecidableEq I]53    (P : EndpointSkeleton I (Fin.elim0 : Fin 0 → I) (Fin.elim0 : Fin 0 → I))54    (hP : P.profileLabels.Nodup) (size : I → ℕ) :55    P.singletonLength size = ∑ i ∈ P.word.toFinset.filter (fun i => P.word.count i=1), size i := by56  rw [singletonLength_eq_map_sum,HaarPathMultiplicity.sum_occurrence_weights]57  have hh : (∑ i ∈ P.singletonLabels.toFinset, P.singletonLabels.count i • size i) =58      ∑ i ∈ P.singletonLabels.toFinset, size i := by59    apply Finset.sum_congr rfl60    intro i hi61    rw [List.count_eq_one_of_mem (P.singletonLabels_nodup hP) (List.mem_toFinset.mp hi),one_nsmul]62  rw [hh,P.closed_singletonLabels_toFinset hP]6364/-- The skeleton's singleton exponent is the original path's exact65singleton-edge count. -/66theorem singletonLength_chain_labels {V : Type*} [DecidableEq V] {d t : ℕ}67    (P : HaarPathGraph.Path V d t) (cs : List P.CoreChain)68    (hcs : (cs.map Subtype.val).flatten=P.traversalList)69    (R : EndpointSkeleton P.unorientedChains70      (Fin.elim0 : Fin 0 → P.unorientedChains) (Fin.elim0 : Fin 0 → P.unorientedChains))71    (hR : R.profileLabels.Nodup) (hw : R.word=cs.map P.chainLabel) :72    R.singletonLength (fun e => (P.representative e).val.length) =73      (HaarPathMultiplicity.singletonEdges P.edgeList).card := by74  classical75  have hc : (cs.map P.chainLabel).toFinset=Finset.univ := by76    apply Finset.eq_univ_of_forall77    intro e78    obtain ⟨c,hc,he⟩ := P.chainLabels_cover cs hcs e79    exact List.mem_toFinset.mpr (List.mem_map.mpr ⟨c,hc,he⟩)80  rw [R.singletonLength_eq_sum_count_one hR,hw,hc]81  simpa only [List.count_eq_countP,Bool.beq_eq_decide_eq] using82    (P.singletonEdges_card_eq_chain_lengths cs hcs).symm8384theorem singletonWeight_chain_labels {V : Type*} [DecidableEq V] {t : ℕ}85    (P : HaarPathGraph.Path V 2 t) (cs : List P.CoreChain)86    (hcs : (cs.map Subtype.val).flatten=P.traversalList)87    (R : EndpointSkeleton P.unorientedChains88      (Fin.elim0 : Fin 0 → P.unorientedChains) (Fin.elim0 : Fin 0 → P.unorientedChains))89    (hR : R.profileLabels.Nodup) (hw : R.word=cs.map P.chainLabel) :90    R.singletonWeight (fun e => (P.representative e).val.length) 2 =91      (2:ℝ)^(HaarPathMultiplicity.singletonEdges P.edgeList).card := by92  rw [R.singletonWeight_two,R.singletonLength_chain_labels P cs hcs hR hw]9394/-- The endpoint compiler reads factors in reverse order. Reversing the95occurrence list leaves the exact singleton budget unchanged. -/96theorem singletonWeight_chain_labels_reverse {V : Type*} [DecidableEq V] {t : ℕ}97    (P : HaarPathGraph.Path V 2 t) (cs : List P.CoreChain)98    (hcs : (cs.map Subtype.val).flatten=P.traversalList)99    (R : EndpointSkeleton P.unorientedChains100      (Fin.elim0 : Fin 0 → P.unorientedChains) (Fin.elim0 : Fin 0 → P.unorientedChains))101    (hR : R.profileLabels.Nodup) (hw : R.word=(cs.map P.chainLabel).reverse) :102    R.singletonWeight (fun e => (P.representative e).val.length) 2 =103      (2:ℝ)^(HaarPathMultiplicity.singletonEdges P.edgeList).card := by104  classical105  rw [R.singletonWeight_two]106  congr 1107  have hc : (cs.map P.chainLabel).toFinset=Finset.univ := by108    apply Finset.eq_univ_of_forall109    intro e110    obtain ⟨c,hc,he⟩ := P.chainLabels_cover cs hcs e111    exact List.mem_toFinset.mpr (List.mem_map.mpr ⟨c,hc,he⟩)112  rw [R.singletonLength_eq_sum_count_one hR,hw]113  simp only [List.toFinset_reverse,List.count_reverse,hc]114  simpa only [List.count_eq_countP,Bool.beq_eq_decide_eq] using115    (P.singletonEdges_card_eq_chain_lengths cs hcs).symm116117theorem coefficient_exponent_chain_le {V : Type*} [DecidableEq V] {d t : ℕ}118    (P : HaarPathGraph.Path V d t) :119    6*Fintype.card P.unorientedChains-1 ≤ 9*P.defectTwice+11 := by120  rw [Fintype.card_coe]121  have h := P.twice_card_unorientedChains_le_defect122  omega123124end Nonadditivity.NoncommutativeCS.EndpointSkeleton