Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.WeightedBellScalar

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

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

41 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.GeneralBell78/-! # Strict Bell entropy margins from arbitrarily small weight perturbations -/910noncomputable section1112namespace Nonadditivity.WeightedBellScalar1314open Entropy BellOutput15open scoped BigOperators1617set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 6000001920section Merged21variable {κ : Type*} [Fintype κ] [DecidableEq κ]2223/-- The diagonal pair probabilities merge because the corresponding Bell24states coincide; off-diagonal branches retain their product probabilities. -/25def weights (p : κ → ℝ) : MergedLabel κ → ℝ26  | none => ∑ i, p i ^ 227  | some z => p z.val.1 * p z.val.22829omit [DecidableEq κ] in30theorem weights_nonneg (p : κ → ℝ) (hp : ∀ i, 0 ≤ p i) (z : MergedLabel κ) :31    0 ≤ weights p z := by32  cases z with33  | none => exact Finset.sum_nonneg (fun i _ => sq_nonneg _)34  | some z => exact mul_nonneg (hp _) (hp _)3536theorem weights_sum (p : κ → ℝ) (hsum : ∑ i, p i = 1) :37    ∑ z, weights p z = 1 := by38  have h := split_pair_sum (fun z : κ × κ => p z.1 * p z.2)39  have ht : (∑ z : κ × κ, p z.1 * p z.2) = 1 := by40    simp only [Fintype.sum_prod_type, ← Finset.mul_sum, hsum, mul_one]41  rw [ht] at h42  simpa only [Fintype.sum_option, weights, pow_two, add_comm] using h.symm4344/-- Gibbs' inequality against the normalized uniform Bell mixture gives45the exact supporting line with slope `-log K` at diagonal mass `1/K`. -/46theorem shannon_le_of_merged_distribution [Nonempty κ] (r : MergedLabel κ → ℝ)47    (hr : ∀ z, 0 ≤ r z) (hsum : ∑ z, r z = 1) :48    shannon r ≤ 2 * Real.log (Fintype.card κ) - r none * Real.log (Fintype.card κ) := by49  have hk : (0 : ℝ) < Fintype.card κ := by positivity50  have hq (z : MergedLabel κ) : 0 < mergedWeights z := by51    cases z <;> dsimp [mergedWeights] <;> positivity52  have hb := Finset.sum_le_sum (fun z (_ : z ∈ Finset.univ) =>53    GeneralBell.mul_log_lower (hr z) (hq z))54  have hcross : (∑ z, r z * Real.log (mergedWeights z)) =55      -2 * Real.log (Fintype.card κ) + r none * Real.log (Fintype.card κ) := by56    have hs := hsum57    rw [Fintype.sum_option] at hs58    have hs' : (∑ i, r (some i)) = 1 - r none := by linarith59    simp only [Fintype.sum_option, mergedWeights, one_div, Real.log_inv,60      Real.log_pow, ← Finset.sum_mul]61    rw [hs']62    ring63  simp only [Finset.sum_sub_distrib, Finset.sum_add_distrib, hsum,64    mergedWeights_sum, hcross] at hb65  unfold shannon66  linarith6768theorem weights_shannon_le [Nonempty κ] (p : κ → ℝ) (hp : ∀ i, 0 ≤ p i)69    (hsum : ∑ i, p i = 1) :70    shannon (weights p) ≤ 2 * Real.log (Fintype.card κ) -71      (∑ i, p i ^ 2) * Real.log (Fintype.card κ) :=72  shannon_le_of_merged_distribution (weights p) (weights_nonneg p hp) (weights_sum p hsum)7374end Merged757677/-- A two-coordinate perturbation, defined for every real parameter so its78continuity is available before imposing positivity. -/79def perturbedWeights {K : ℕ} (hK : 2 ≤ K) (t : ℝ) (i : Fin K) : ℝ :=80  1 / (K : ℝ) + (if i = ⟨0, by omega⟩ then t else 0) -81    (if i = ⟨1, by omega⟩ then t else 0)8283@[simp] theorem perturbedWeights_zero {K : ℕ} (hK : 2 ≤ K) :84    perturbedWeights hK 0 = fun _ => 1 / (K : ℝ) := by85  funext i86  simp [perturbedWeights]8788@[simp] theorem perturbedWeights_zero_index {K : ℕ} (hK : 2 ≤ K) (t : ℝ) :89    perturbedWeights hK t ⟨0, by omega⟩ = 1 / (K : ℝ) + t := by90  simp [perturbedWeights]9192@[simp] theorem perturbedWeights_one_index {K : ℕ} (hK : 2 ≤ K) (t : ℝ) :93    perturbedWeights hK t ⟨1, by omega⟩ = 1 / (K : ℝ) - t := by94  simp [perturbedWeights]9596theorem perturbedWeights_sum {K : ℕ} (hK : 2 ≤ K) (t : ℝ) :97    ∑ i, perturbedWeights hK t i = 1 := by98  have hk : (K : ℝ) ≠ 0 := by exact_mod_cast (by omega : K ≠ 0)99  simp only [perturbedWeights, Finset.sum_sub_distrib, Finset.sum_add_distrib,100    Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul,101    Finset.sum_ite_eq', Finset.mem_univ, if_true]102  field_simp103  ring104105theorem perturbedWeights_positive {K : ℕ} (hK : 2 ≤ K) {t : ℝ}106    (ht : 0 ≤ t) (htK : t < 1 / (K : ℝ)) (i : Fin K) :107    0 < perturbedWeights hK t i := by108  have hu : (0 : ℝ) < 1 / (K : ℝ) := by positivity109  dsimp [perturbedWeights]110  split_ifs <;> linarith111112theorem perturbedWeights_close {K : ℕ} (hK : 2 ≤ K) (t : ℝ) (i : Fin K) :113    |perturbedWeights hK t i - 1 / (K : ℝ)| ≤ |t| := by114  dsimp [perturbedWeights]115  split_ifs <;> ring_nf <;> simp [abs_neg, abs_nonneg]116117theorem continuous_perturbedWeights_apply {K : ℕ} (hK : 2 ≤ K) (i : Fin K) :118    Continuous (fun t : ℝ => perturbedWeights hK t i) := by119  unfold perturbedWeights120  split_ifs <;> fun_prop121122theorem continuous_perturbedWeights {K : ℕ} (hK : 2 ≤ K) :123    Continuous (perturbedWeights hK) :=124  continuous_pi (continuous_perturbedWeights_apply hK)125126theorem perturbedWeights_sum_sq {K : ℕ} (hK : 2 ≤ K) (t : ℝ) :127    ∑ i, perturbedWeights hK t i ^ 2 = 1 / (K : ℝ) + 2 * t ^ 2 := by128  have hk : (K : ℝ) ≠ 0 := by exact_mod_cast (by omega : K ≠ 0)129  have hpoint (i : Fin K) : perturbedWeights hK t i ^ 2 =130      (1 / (K : ℝ)) ^ 2 +131      (if i = ⟨0, by omega⟩ then 2 * (1 / (K : ℝ)) * t + t ^ 2 else 0) +132      (if i = ⟨1, by omega⟩ then -2 * (1 / (K : ℝ)) * t + t ^ 2 else 0) := by133    by_cases h0 : i = ⟨0, by omega⟩134    · simp [perturbedWeights, h0]135      ring136    · by_cases h1 : i = ⟨1, by omega⟩137      · simp [perturbedWeights, h1]138        ring139      · simp [perturbedWeights, h0, h1]140  simp_rw [hpoint]141  simp only [Finset.sum_add_distrib, Finset.sum_const, Finset.card_univ,142    Fintype.card_fin, nsmul_eq_mul, Finset.sum_ite_eq', Finset.mem_univ, if_true]143  field_simp144  ring145146/-- The exact strict reserve in Bell entropy is quadratic in the small147weight perturbation. -/148theorem perturbedWeights_shannon_le {K : ℕ} (hK : 2 ≤ K) {t : ℝ}149    (ht : 0 ≤ t) (htK : t < 1 / (K : ℝ)) :150    shannon (weights (perturbedWeights hK t)) ≤151      2 * Real.log (K : ℝ) - Real.log (K : ℝ) / K -152        2 * t ^ 2 * Real.log (K : ℝ) := by153  letI : NeZero K := ⟨by omega⟩154  have h := weights_shannon_le (perturbedWeights hK t)155    (fun i => (perturbedWeights_positive hK ht htK i).le) (perturbedWeights_sum hK t)156  rw [perturbedWeights_sum_sq] at h157  simp only [Fintype.card_fin] at h158  convert h using 1159  ring160161theorem perturbation_margin_pos {K : ℕ} (hK : 2 ≤ K) {t : ℝ} (ht : 0 < t) :162    0 < 2 * t ^ 2 * Real.log (K : ℝ) := by163  have hlog : 0 < Real.log (K : ℝ) := Real.log_pos (by exact_mod_cast (by omega : 1 < K))164  exact mul_pos (mul_pos (by norm_num) (sq_pos_of_pos ht)) hlog165166/-- Positive admissible perturbations exist within every prescribed167neighborhood of the uniform weights. -/168theorem exists_perturbation_parameter {K : ℕ} (hK : 2 ≤ K) {ε : ℝ} (hε : 0 < ε) :169    ∃ t : ℝ, 0 < t ∧ t < 1 / (K : ℝ) ∧ t < ε := by170  have hu : (0 : ℝ) < 1 / (K : ℝ) := by positivity171  refine ⟨min (ε / 2) ((1 / (K : ℝ)) / 2),172    lt_min (half_pos hε) (half_pos hu), ?_, ?_⟩173  · exact (min_le_right _ _).trans_lt (half_lt_self hu)174  · exact (min_le_left _ _).trans_lt (half_lt_self hε)175176end Nonadditivity.WeightedBellScalar