Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathBalance

Download original .lean · View on GitHub · Jump to source

Direct imports

Imported by project modules

2 direct reverse imports

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

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

19 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathExpansion78/-! # Local phase balance forces repeated visits910A vertex visited just once away from the root would force a consecutive11inverse pair of colors. Consequently a nonzero Haar path weight can have12at most half as many vertices as steps.13-/14noncomputable section15set_option backward.isDefEq.respectTransparency false16set_option maxHeartbeats 120000017namespace Nonadditivity.HaarPathGraph.Path18open scoped BigOperators19variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : HaarPathGraph.Path V d m)2021def visitCount (v : V) : ℕ := (Finset.univ.filter (fun i : Fin m => P.vertex i.castSucc=v)).card2223def outgoingCount (c : HaarPathProfiles.Color d) (v : V) : ℕ :=24  (Finset.univ.filter (fun i : Fin m => P.vertex i.castSucc=v ∧ P.colors i=c)).card2526def incomingCount (c : HaarPathProfiles.Color d) (v : V) : ℕ :=27  (Finset.univ.filter (fun i : Fin m => P.vertex i.succ=v ∧ P.colors i=c)).card2829/-- The row/column phase selection rule in the path's own vertex coordinates. -/30def LocallyBalanced : Prop :=31  ∀ c v, P.outgoingCount c v=P.incomingCount (HaarPathGraph.flipColor c) v3233lemma visitCount_pos {v : V} (hv : v ∈ P.vertices) : 0 < P.visitCount v := by34  obtain ⟨i,_,hi⟩ := Finset.mem_image.mp hv35  exact Finset.card_pos.mpr ⟨i,by simp [visitCount,hi]⟩3637lemma sum_visitCount : ∑ v ∈ P.vertices, P.visitCount v=m := by38  have h := Finset.card_eq_sum_card_fiberwise (s := Finset.univ) (t := P.vertices)39    (f := fun i : Fin m => P.vertex i.castSucc) (fun i _ => P.start_mem i)40  simpa [visitCount] using h.symm4142lemma two_le_visitCount_of_balanced (hb : P.LocallyBalanced)43    {v : V} (hv : v ∈ P.vertices) (hne : v ≠ P.vertex 0) : 2 ≤ P.visitCount v := by44  have hpos := P.visitCount_pos hv45  by_contra htwo46  have hone : P.visitCount v=1 := by omega47  obtain ⟨i,hi⟩ := Finset.card_eq_one.mp hone48  have him : i ∈ Finset.univ.filter (fun i : Fin m => P.vertex i.castSucc=v) := by49    rw [hi]50    exact Finset.mem_singleton_self _51  have hiv : P.vertex i.castSucc=v := (Finset.mem_filter.mp him).252  have hi0 : 0 < i.val := by53    by_contra hn54    have he : i.castSucc=0 := Fin.ext (by simp; omega)55    exact hne (hiv.symm.trans (congrArg P.vertex he))56  let j : Fin m := ⟨i.val-1,by omega⟩57  have hji : j.val+1=i.val := by dsimp [j]; omega58  have hjs : j.succ=i.castSucc := Fin.ext hji59  have hjv : P.vertex j.succ=v := hjs ▸ hiv60  have hflip : HaarPathGraph.flipColor (HaarPathGraph.flipColor (P.colors j))=P.colors j := by61    cases hc : P.colors j with | mk a b => cases b <;> rfl62  have hin : 0 < P.incomingCount (P.colors j) v := by63    exact Finset.card_pos.mpr ⟨j,by simp [incomingCount,hjv]⟩64  have hout : 0 < P.outgoingCount (HaarPathGraph.flipColor (P.colors j)) v := by65    rw [hb, hflip]66    exact hin67  obtain ⟨k,hk⟩ := Finset.card_pos.mp hout68  have hkparts := (Finset.mem_filter.mp hk).269  have hki : k=i := by70    have hm : k ∈ Finset.univ.filter (fun i : Fin m => P.vertex i.castSucc=v) := by71      simp [hkparts.1]72    rw [hi] at hm73    exact Finset.mem_singleton.mp hm74  exact P.reduced j i hji (hki ▸ hkparts.2)7576/-- Every non-root vertex requires two visits, while the root requires one. -/77theorem twice_vertices_le_length_add_one_of_balanced (hb : P.LocallyBalanced) :78    2*P.vertices.card ≤ m+1 := by79  have hpoint (v : V) (hv : v ∈ P.vertices) :80      2 ≤ P.visitCount v + (if v=P.vertex 0 then 1 else 0) := by81    by_cases h : v=P.vertex 082    · have hp := P.visitCount_pos hv83      simp only [if_pos h]84      omega85    · simpa [h] using P.two_le_visitCount_of_balanced hb hv h86  have hs := Finset.sum_le_sum hpoint87  have hroot : (P.vertices.filter (fun v => v=P.vertex 0)).card ≤ 1 := by88    apply (Finset.card_le_card (show P.vertices.filter (fun v => v=P.vertex 0) ⊆ {P.vertex 0} from ?_)).trans89    · simp90    · intro v hv91      simpa using (Finset.mem_filter.mp hv).292  simp only [Finset.sum_add_distrib, Finset.sum_const, smul_eq_mul,93    Finset.sum_ite, Nat.mul_one] at hs94  rw [P.sum_visitCount] at hs95  omega9697theorem vertices_le_half_of_balanced (hb : P.LocallyBalanced) (hm : Even m) :98    P.vertices.card ≤ m/2 := by99  have h := P.twice_vertices_le_length_add_one_of_balanced hb100  obtain ⟨k,hk⟩ := hm101  omega102103end Nonadditivity.HaarPathGraph.Path