Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathMultiplicity

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

Direct imports

Imported by project modules

3 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

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

20 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathProfiles7import Mathlib.Algebra.BigOperators.Group.Finset.Basic89/-! # Literal edge-multiplicity identities for the Haar path expansion1011The list may be the colored edges of an original path or the successive12compressed-edge visits. All cardinal and excess-occurrence estimates are13proved for its actual multiplicities, rather than supplied as hypotheses.14-/15noncomputable section16namespace Nonadditivity.HaarPathMultiplicity17open scoped BigOperators18variable {E : Type*} [DecidableEq E]1920/-- Edges that occur exactly once in the given path. -/21def singletonEdges (l : List E) : Finset E := l.toFinset.filter (fun e => l.count e = 1)2223/-- Occurrences beyond the first two visits of each edge. -/24def excessOccurrences (l : List E) : ℕ := ∑ e ∈ l.toFinset, (l.count e - 2)2526theorem sum_multiplicities (l : List E) :27    ∑ e ∈ l.toFinset, l.count e = l.length := List.sum_toFinset_count_eq_length l2829/-- BC equation (30), stated without truncated subtraction on either side. -/30theorem excess_add_twice_edges (l : List E) :31    excessOccurrences l + 2*l.toFinset.card = l.length + (singletonEdges l).card := by32  have hpoint (e : E) (he : e ∈ l.toFinset) :33      (l.count e - 2) + 2 = l.count e + (if l.count e = 1 then 1 else 0) := by34    have hp : 0 < l.count e := List.count_pos_iff.mpr (List.mem_toFinset.mp he)35    split_ifs <;> omega36  have hs := Finset.sum_congr rfl hpoint37  simpa [excessOccurrences, singletonEdges, Finset.sum_add_distrib,38    Finset.sum_ite, sum_multiplicities, mul_comm] using hs3940/-- The number of distinct edges is at most `(length + singletons)/2`. -/41theorem twice_edges_le_length_add_singletons (l : List E) :42    2*l.toFinset.card ≤ l.length + (singletonEdges l).card := by43  have h := excess_add_twice_edges l44  omega4546/-- Total visits to edges of multiplicity at least four. -/47def highMultiplicityOccurrences (l : List E) : ℕ :=48  ∑ e ∈ l.toFinset, if 4 ≤ l.count e then l.count e else 04950/-- The fourth-and-higher multiplicity cost is controlled by twice the exact51excess. This is the counting step in the BC probabilistic weight estimate. -/52theorem highMultiplicityOccurrences_le_twice_excess (l : List E) :53    highMultiplicityOccurrences l ≤ 2*excessOccurrences l := by54  rw [highMultiplicityOccurrences, excessOccurrences, Finset.mul_sum]55  apply Finset.sum_le_sum56  intro e he57  split_ifs <;> omega5859/-- First/last visits contribute at most two per distinct compressed edge;60all other visits are precisely the excess counted above. -/61theorem length_le_twice_edges_add_excess (l : List E) :62    l.length ≤ 2*l.toFinset.card + excessOccurrences l := by63  have h := excess_add_twice_edges l64  omega6566/-- A second, useful form of BC equation (30). -/67theorem excessOccurrences_eq (l : List E) :68    excessOccurrences l = l.length + (singletonEdges l).card - 2*l.toFinset.card := by69  have h := excess_add_twice_edges l70  omega7172/-- Summing a statistic over distinct edges equals its occurrence sum when73weighted by the actual edge multiplicity. -/74theorem sum_occurrence_weights {M : Type*} [AddCommMonoid M]75    (l : List E) (f : E → M) :76    (l.map f).sum = ∑ e ∈ l.toFinset, l.count e • f e := by77  exact Finset.sum_list_map_count l f7879end Nonadditivity.HaarPathMultiplicity