Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathGraph

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

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

82 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathMultiplicity78/-! # The colored multigraph of a closed reduced path910Edges are stored with the orientation of a positive generator. This is a11concrete representative of `[x,i,y] = [y,i*,x]`, and retains colored loops12and parallel edges. Degrees count both incidences of a loop. The results13prove BC equations (24)--(26) and the core-vertex estimate underlying (29)14for the actual graph extracted from the path.15-/16noncomputable section17namespace Nonadditivity.HaarPathGraph18open scoped BigOperators19open HaarPathProfiles20variable {V : Type*}2122abbrev Edge (V : Type*) (d : ℕ) := V × Fin d × V23abbrev Dart (V : Type*) (d : ℕ) := Edge V d × Bool2425def flipColor {d : ℕ} (c : Color d) : Color d := (c.1, !c.2)2627def edge {d : ℕ} (x : V) (c : Color d) (y : V) : Edge V d :=28  if c.2 then (x,c.1,y) else (y,c.1,x)2930def dart {d : ℕ} (x : V) (c : Color d) (y : V) : Dart V d := (edge x c y,c.2)31def reverse {d : ℕ} (q : Dart V d) : Dart V d := (q.1,!q.2)32def source {d : ℕ} (q : Dart V d) : V := if q.2 then q.1.1 else q.1.2.233def color {d : ℕ} (q : Dart V d) : Color d := (q.1.2.1,q.2)3435@[simp] theorem source_dart {d : ℕ} (x y : V) (c : Color d) :36    source (dart x c y) = x := by cases c with | mk i b => cases b <;> rfl37@[simp] theorem source_reverse_dart {d : ℕ} (x y : V) (c : Color d) :38    source (reverse (dart x c y)) = y := by cases c with | mk i b => cases b <;> rfl39@[simp] theorem color_dart {d : ℕ} (x y : V) (c : Color d) :40    color (dart x c y) = c := by cases c with | mk i b => cases b <;> rfl41@[simp] theorem color_reverse_dart {d : ℕ} (x y : V) (c : Color d) :42    color (reverse (dart x c y)) = flipColor c := by43  cases c with | mk i b => cases b <;> rfl4445/-- A literal closed path whose generator word is reduced. No reduction is46required between the last and first colors, matching BC's path set. -/47structure Path (V : Type*) (d m : ℕ) where48  vertex : Fin (m+1) → V49  colors : Fin m → Color d50  closed : vertex (Fin.last m) = vertex 051  reduced : ∀ i j : Fin m, i.val+1=j.val → colors j ≠ flipColor (colors i)5253namespace Path54variable {d m : ℕ} [DecidableEq V] (P : Path V d m)5556def edgeList : List (Edge V d) := List.ofFn fun i : Fin m =>57  edge (P.vertex i.castSucc) (P.colors i) (P.vertex i.succ)58def edges : Finset (Edge V d) := P.edgeList.toFinset59def vertices : Finset V := Finset.univ.image fun i : Fin m => P.vertex i.castSucc60def darts : Finset (Dart V d) := P.edges ×ˢ Finset.univ61def degree (v : V) : ℕ := (P.darts.filter fun q => source q = v).card6263def traversal (i : Fin m) : Dart V d :=64  dart (P.vertex i.castSucc) (P.colors i) (P.vertex i.succ)6566omit [DecidableEq V] in67@[simp] theorem edgeList_length : P.edgeList.length = m := by simp [edgeList]6869lemma traversal_mem (i : Fin m) : P.traversal i ∈ P.darts := by70  simp only [darts, Finset.mem_product, Finset.mem_univ, and_true]71  apply List.mem_toFinset.mpr72  exact List.mem_ofFn.mpr ⟨i,rfl⟩7374lemma reverse_traversal_mem (i : Fin m) : reverse (P.traversal i) ∈ P.darts := by75  have h := P.traversal_mem i76  simpa only [darts, Finset.mem_product, Finset.mem_univ, and_true, reverse] using h7778lemma start_mem (i : Fin m) : P.vertex i.castSucc ∈ P.vertices :=79  Finset.mem_image.mpr ⟨i, Finset.mem_univ _, rfl⟩8081lemma end_mem (i : Fin m) : P.vertex i.succ ∈ P.vertices := by82  by_cases hi : i.val+1 < m83  · have he : i.succ = (⟨i.val+1,hi⟩ : Fin m).castSucc := Fin.ext rfl84    rw [he]85    exact P.start_mem _86  · have he : i.succ = Fin.last m := Fin.ext (by simp only [Fin.val_succ, Fin.val_last]; omega)87    have hm : 0 < m := by omega88    rw [he, P.closed]89    exact P.start_mem ⟨0,hm⟩9091lemma source_mem {q : Dart V d} (hq : q ∈ P.darts) : source q ∈ P.vertices := by92  obtain ⟨hq, _⟩ := Finset.mem_product.mp hq93  obtain ⟨i,hi⟩ := List.mem_ofFn.mp (List.mem_toFinset.mp hq)94  obtain ⟨e,b⟩ := q95  change edge (P.vertex i.castSucc) (P.colors i) (P.vertex i.succ) = e at hi96  subst e97  obtain ⟨g,c⟩ := P.colors i98  cases b <;> cases c <;> simp only [source, edge, Bool.false_eq_true,99    ite_false, ite_true] <;> first | exact P.start_mem i | exact P.end_mem i100101/-- The handshake identity includes loops with degree two. -/102theorem sum_degrees : ∑ v ∈ P.vertices, P.degree v = 2*P.edges.card := by103  have h := Finset.card_eq_sum_card_fiberwise (s := P.darts) (t := P.vertices)104    (f := source) (fun q hq => P.source_mem hq)105  simpa [degree, darts, Finset.card_product, mul_comm] using h.symm106107/-- Every visited vertex has an outgoing dart. -/108theorem degree_pos {v : V} (hv : v ∈ P.vertices) : 0 < P.degree v := by109  obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hv110  apply Finset.card_pos.mpr111  exact ⟨P.traversal i, Finset.mem_filter.mpr112    ⟨P.traversal_mem i, source_dart _ _ _⟩⟩113114/-- At every vertex other than the base, the reduced-word condition supplies115two distinct incidences. This does not assume cyclic reduction. -/116theorem two_le_degree {v : V} (hv : v ∈ P.vertices) (hne : v ≠ P.vertex 0) :117    2 ≤ P.degree v := by118  obtain ⟨i,_,hi⟩ := Finset.mem_image.mp hv119  have hi0 : 0 < i.val := by120    by_contra h121    have he : i.castSucc = 0 := Fin.ext (by simp only [Fin.val_castSucc, Fin.val_zero]; omega)122    exact hne (by rw [←hi,he])123  let j : Fin m := ⟨i.val-1,by omega⟩124  have hji : j.val+1=i.val := by dsimp [j]; omega125  have hjs : j.succ=i.castSucc := Fin.ext hji126  have hd : P.traversal i ≠ reverse (P.traversal j) := by127    intro he128    have hc := congrArg color he129    simp only [traversal, color_dart, color_reverse_dart] at hc130    exact P.reduced j i hji hc131  have hmem₁ : P.traversal i ∈ P.darts.filter (fun q => source q=v) := by132    apply Finset.mem_filter.mpr133    exact ⟨P.traversal_mem i, (source_dart _ _ _).trans hi⟩134  have hmem₂ : reverse (P.traversal j) ∈ P.darts.filter (fun q => source q=v) := by135    apply Finset.mem_filter.mpr136    refine ⟨P.reverse_traversal_mem j, ?_⟩137    simp only [traversal, source_reverse_dart, hjs, hi]138  have hsub : {P.traversal i, reverse (P.traversal j)} ⊆139      P.darts.filter (fun q => source q=v) := by140    intro q hq141    rcases Finset.mem_insert.mp hq with rfl | hq142    · exact hmem₁143    · rw [Finset.mem_singleton] at hq144      simpa [hq] using hmem₂145  have hc := Finset.card_le_card hsub146  simpa [degree, hd] using hc147148/-- BC equation (25): a nonempty closed reduced path has at least as many149colored edges as vertices, including when its base has degree one. -/150theorem vertices_le_edges : P.vertices.card ≤ P.edges.card := by151  have hpoint (v : V) (hv : v ∈ P.vertices) :152      2 ≤ P.degree v + (if v = P.vertex 0 then 1 else 0) := by153    by_cases h : v=P.vertex 0154    · have hp := P.degree_pos hv155      simp only [if_pos h]156      omega157    · simpa [h] using P.two_le_degree hv h158  have hs := Finset.sum_le_sum hpoint159  have hfilter : (P.vertices.filter fun v => v=P.vertex 0).card ≤ 1 := by160    have hsub : (P.vertices.filter fun v => v=P.vertex 0) ⊆ {P.vertex 0} := by161      intro v hv162      simpa using (Finset.mem_filter.mp hv).2163    simpa using Finset.card_le_card hsub164  simp only [Finset.sum_add_distrib, Finset.sum_const, smul_eq_mul,165    Finset.sum_ite, Nat.mul_one] at hs166  rw [P.sum_degrees] at hs167  omega168169/-- Twice the BC defect is nonnegative without fractions or parity assumptions. -/170theorem twice_vertices_le_length_add_singletons :171    2*P.vertices.card ≤ m + (HaarPathMultiplicity.singletonEdges P.edgeList).card := by172  have he := HaarPathMultiplicity.twice_edges_le_length_add_singletons P.edgeList173  rw [P.edgeList_length] at he174  have hv := P.vertices_le_edges175  change P.vertices.card ≤ P.edgeList.toFinset.card at hv176  omega177178/-- Vertices retained by degree-two suppression: the base and every vertex179whose degree differs from two. -/180def coreVertices : Finset V := P.vertices.filter fun v => v=P.vertex 0 ∨ P.degree v ≠ 2181182/-- The exact degree-count bound used in BC Lemma 5.8, before constructing183the chains between core vertices. -/184theorem coreVertices_add_twice_vertices_le :185    P.coreVertices.card + 2*P.vertices.card ≤ 2*P.edges.card+2 := by186  have hpoint (v : V) (hv : v ∈ P.vertices) :187      2 + (if v ∈ P.coreVertices then 1 else 0) ≤188        P.degree v + (if v=P.vertex 0 then 2 else 0) := by189    have hp := P.degree_pos hv190    by_cases hroot : v=P.vertex 0191    · simp only [if_pos hroot]192      split_ifs <;> omega193    · have htwo := P.two_le_degree hv hroot194      by_cases hc : v ∈ P.coreVertices195      · have hne : P.degree v ≠ 2 := by196          exact (Finset.mem_filter.mp hc).2.resolve_left hroot197        simp only [if_pos hc, if_neg hroot]198        omega199      · simp only [if_neg hc, if_neg hroot]200        omega201  have hs := Finset.sum_le_sum hpoint202  have hcore : (P.vertices.filter fun v => v ∈ P.coreVertices) = P.coreVertices := by203    exact Finset.filter_mem_eq_inter.trans (Finset.inter_eq_right.mpr (Finset.filter_subset _ _))204  have hfilter : (P.vertices.filter fun v => v=P.vertex 0).card ≤ 1 := by205    have hsub : (P.vertices.filter fun v => v=P.vertex 0) ⊆ {P.vertex 0} := by206      intro v hv207      simpa using (Finset.mem_filter.mp hv).2208    simpa using Finset.card_le_card hsub209  simp only [Finset.sum_add_distrib, Finset.sum_const, smul_eq_mul,210    Finset.sum_ite, Nat.mul_one] at hs211  rw [hcore,P.sum_degrees] at hs212  omega213214/-- Twice the defect, an integer even when the path length or the singleton215count is odd. -/216def defectTwice : ℕ := m + (HaarPathMultiplicity.singletonEdges P.edgeList).card -217  2*P.vertices.card218219/-- The Euler-characteristic budget for the number of edges after suppressing220degree-two vertices. This is a numerical budget, not a definition of a221suppressed graph. -/222def coreEdgeBudget : ℕ := P.edges.card + P.coreVertices.card - P.vertices.card223224/-- Twice the core-edge budget is at most `6*χ+4`, precisely the exponent225needed for the profile-count estimate. -/226theorem twice_coreEdgeBudget_le : 2*P.coreEdgeBudget ≤ 3*P.defectTwice+4 := by227  have hv := P.vertices_le_edges228  have hc := P.coreVertices_add_twice_vertices_le229  have he := HaarPathMultiplicity.twice_edges_le_length_add_singletons P.edgeList230  rw [P.edgeList_length] at he231  have hχ := P.twice_vertices_le_length_add_singletons232  change 2*P.edges.card ≤ _ at he233  dsimp [coreEdgeBudget,defectTwice]234  omega235236/-- The actual finite set of word-profile assignments to the core-edge budget237has the claimed BC exponent. Constructing the suppressed chains is a separate238step; this theorem makes no assumption of an unproved profile cardinal bound. -/239theorem card_budgetProfileAssignments_le (hm : 0 < m) (hd : 0 < d) :240    Fintype.card (Fin P.coreEdgeBudget → BoundedProfile (Color d) m) ≤241      (2*d*m^d)^(3*P.defectTwice+4) := by242  rw [Fintype.card_fun, Fintype.card_fin]243  have hc := HaarPathProfiles.card_signedProfile_le d m244  calc245    _ ≤ ((2*d*m^d)^2)^P.coreEdgeBudget := Nat.pow_le_pow_left hc _246    _ = (2*d*m^d)^(2*P.coreEdgeBudget) := (pow_mul _ _ _).symm247    _ ≤ _ := Nat.pow_le_pow_right (by positivity) P.twice_coreEdgeBudget_le248249/-- High-multiplicity occurrences are bounded by four times the BC defect.250This is derived from the actual path graph, including loops and colors. -/251theorem highMultiplicityOccurrences_le_twice_defect :252    HaarPathMultiplicity.highMultiplicityOccurrences P.edgeList ≤ 2*P.defectTwice := by253  have h := HaarPathMultiplicity.highMultiplicityOccurrences_le_twice_excess P.edgeList254  have he := HaarPathMultiplicity.excess_add_twice_edges P.edgeList255  rw [P.edgeList_length] at he256  have hv := P.vertices_le_edges257  have hχ := P.twice_vertices_le_length_add_singletons258  change P.vertices.card ≤ P.edgeList.toFinset.card at hv259  dsimp [defectTwice]260  omega261262end Path263end Nonadditivity.HaarPathGraph