Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.GeneralBell

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

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

29 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.BellOutput7import Nonadditivity.Conversion89/-! # Bell witnesses for arbitrary Kraus channels1011This extends the Bell entropy argument beyond random-unitary complements.12All norms use the Euclidean operator norm, and all states are actual matrices.13-/1415noncomputable section16set_option maxHeartbeats 80000017set_option backward.isDefEq.respectTransparency false1819namespace Nonadditivity.GeneralBell2021open Entropy Channels BellOutput22open scoped BigOperators ComplexOrder Matrix Kronecker Matrix.Norms.L2Operator2324lemma mul_log_lower {p q : ℝ} (hp : 0 ≤ p) (hq : 0 < q) :25    p * Real.log q + p - q ≤ p * Real.log p := by26  by_cases hz : p = 027  · simp only [hz, zero_mul, add_zero, zero_sub]28    exact neg_nonpos.mpr hq.le29  have hp' : 0 < p := lt_of_le_of_ne hp (Ne.symm hz)30  have h := mul_le_mul_of_nonneg_left31    (Real.log_le_sub_one_of_pos (div_pos hq hp')) hp32  rw [Real.log_div hq.ne' hz] at h33  have he : p * (q / p - 1) = q - p := by field_simp34  rw [he] at h35  nlinarith3637/-- A large atom in a distribution on `K²` points forces the required38Bell entropy deficit. The comparison weights need not be normalized. -/39theorem shannon_le_of_large_atom {ι : Type*} [Fintype ι] [DecidableEq ι]40    (p : ι → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1)41    (K : ℕ) (hK : 1 ≤ K) (hd : Fintype.card ι = K ^ 2)42    (j : ι) (hj : 1 / (K : ℝ) ≤ p j) :43    shannon p ≤ 2 * Real.log (K : ℝ) - (Real.log (K : ℝ) - 1) / K := by44  have hk : (0 : ℝ) < K := by exact_mod_cast (by omega : 0 < K)45  have hl : 0 ≤ Real.log (K : ℝ) := Real.log_nonneg (by exact_mod_cast hK)46  let q : ι → ℝ := fun i => if i = j then 1 / K else 1 / (K : ℝ)^247  have hq (i : ι) : 0 < q i := by dsimp [q]; split <;> positivity48  have hb := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => mul_log_lower (hp i) (hq i))49  have hlog (i : ι) : p i * Real.log (q i) =50      -2 * p i * Real.log (K : ℝ) + (if i = j then p i * Real.log (K : ℝ) else 0) := by51    by_cases h : i = j52    · simp [q, h, Real.log_inv]; ring53    · simp [q, h, Real.log_inv, Real.log_pow]; ring54  have hqsplit (i : ι) : q i = 1 / (K : ℝ)^2 +55      (if i = j then 1 / (K : ℝ) - 1 / (K : ℝ)^2 else 0) := by56    dsimp [q]; split <;> ring57  have hql : ∑ i, p i * Real.log (q i) =58      -2 * Real.log (K : ℝ) + p j * Real.log (K : ℝ) := by59    simp_rw [hlog]60    simp [Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, hs]61  have hqs : ∑ i, q i = 1 + 1 / (K : ℝ) - 1 / (K : ℝ)^2 := by62    simp_rw [hqsplit]63    simp only [Finset.sum_add_distrib, Finset.sum_const, Finset.card_univ,64      nsmul_eq_mul, hd, Nat.cast_pow, Finset.sum_ite_eq', Finset.mem_univ, if_true]65    field_simp66    ring67  simp only [Finset.sum_sub_distrib, Finset.sum_add_distrib, hs, hql, hqs] at hb68  have hlarge := mul_le_mul_of_nonneg_right hj hl69  unfold shannon70  have hnn : 0 ≤ 1 / (K : ℝ)^2 := by positivity71  have he : (Real.log (K : ℝ) - 1) / K =72      1 / (K : ℝ) * Real.log (K : ℝ) - 1 / K := by ring73  rw [he]74  linarith7576/-- A positive density matrix has an eigenvalue equal to its operator norm. -/77theorem exists_weight_eq_norm {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]78    (ρ : DensityMatrix ι) : ∃ i, ρ.weights i = ‖ρ.matrix‖ := by79  letI : CStarAlgebra (Matrix ι ι ℂ) := { }80  let f : ι → ℂ := fun i => (ρ.weights i : ℂ)81  have hn : ‖ρ.matrix‖ = ‖f‖ := by82    conv_lhs => rw [ρ.positive.isHermitian.spectral_theorem]83    rw [StarAlgEquiv.norm_map, Matrix.l2_opNorm_diagonal]84    rfl85  obtain ⟨i, _, hi⟩ := Finset.exists_max_image Finset.univ (fun i => ‖f i‖)86    Finset.univ_nonempty87  have hm : ‖f‖ = ‖f i‖ := le_antisymm88    ((pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr (fun j => hi j (Finset.mem_univ _)))89    (norm_le_pi_norm f i)90  refine ⟨i, ?_⟩91  rw [hn, hm]92  simp [f, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (ρ.weights_nonneg i)]9394/-- A Bell-sized overlap already implies a logarithmic entropy deficit. -/95theorem entropy_le_of_overlap {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]96    (ρ σ : DensityMatrix ι) (K : ℕ) (hK : 1 ≤ K)97    (hd : Fintype.card ι = K ^ 2)98    (hoverlap : 1 / (K : ℝ) ≤ (σ.matrix * ρ.matrix).trace.re) :99    ρ.vonNeumann ≤ 2 * Real.log (K : ℝ) - (Real.log (K : ℝ) - 1) / K := by100  obtain ⟨i, hi⟩ := exists_weight_eq_norm ρ101  apply shannon_le_of_large_atom ρ.weights ρ.weights_nonneg ρ.weights_sum K hK hd i102  rw [hi]103  exact hoverlap.trans (AdjointPurity.state_expectation_re_le_opNorm σ ρ.matrix104    ρ.positive.isHermitian)105106section BellOverlap107108variable {ι ο κ : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]109  [Fintype ο] [DecidableEq ο] [Nonempty ο] [Fintype κ]110111omit [DecidableEq ι] [Nonempty ι] [Fintype ο] [DecidableEq ο] [Nonempty ο]112  [Fintype κ] in113lemma pure_overlap (v w : ι → ℂ) :114    (Matrix.vecMulVec v (star v) * Matrix.vecMulVec w (star w)).trace =115      (Complex.normSq (star v ⬝ᵥ w) : ℂ) := by116  rw [Matrix.vecMulVec_mul_vecMulVec, Matrix.trace_vecMulVec, dotProduct_smul]117  have hc : v ⬝ᵥ star w = star (star v ⬝ᵥ w) := by118    simp [dotProduct]119  rw [hc]120  exact Complex.mul_conj _121122omit [Fintype κ] [Nonempty ι] [Fintype ο] [DecidableEq ο] [Nonempty ο] in123lemma tensor_mul_bell (A B : Matrix ο ι ℂ) (a b : ο) :124    ((A ⊗ₖ B.map star) *ᵥ normalizedBellVector) (a,b) =125      (Real.sqrt (1 / (Fintype.card ι : ℝ)) : ℂ) *126        ∑ i, A a i * star (B b i) := by127  simp [Matrix.mulVec, dotProduct, Fintype.sum_prod_type,128    Matrix.map_apply, normalizedBellVector, bellVector, Finset.mul_sum,129    mul_comm, mul_left_comm]130131omit [Fintype κ] [Nonempty ι] [Nonempty ο] in132lemma bell_amplitude (A B : Matrix ο ι ℂ) :133    star (normalizedBellVector (ι := ο)) ⬝ᵥ134      ((A ⊗ₖ B.map star) *ᵥ normalizedBellVector) =135    ((Real.sqrt (1 / (Fintype.card ο : ℝ)) : ℂ) *136      (Real.sqrt (1 / (Fintype.card ι : ℝ)) : ℂ)) *137        ∑ a, ∑ i, A a i * star (B a i) := by138  simp only [dotProduct, Fintype.sum_prod_type, Pi.star_apply, tensor_mul_bell]139  simp [normalizedBellVector, bellVector, Finset.mul_sum, mul_assoc, apply_ite]140141omit [Fintype κ] in142lemma bell_term_overlap (A B : Matrix ο ι ℂ) :143    ((bellState (ι := ο)).matrix *144      ((A ⊗ₖ B.map star) * (bellState (ι := ι)).matrix *145        (A ⊗ₖ B.map star).conjTranspose)).trace.re =146      1 / ((Fintype.card ο : ℝ) * Fintype.card ι) *147        Complex.normSq (∑ a, ∑ i, A a i * star (B a i)) := by148  rw [bellState_matrix, bellState_matrix, conjugation_vecMulVec, pure_overlap,149    Complex.ofReal_re, bell_amplitude, Complex.normSq_mul,150    Complex.normSq_mul]151  simp only [Complex.normSq_ofReal, Real.mul_self_sqrt (by positivity :152    0 ≤ 1 / (Fintype.card ο : ℝ)), Real.mul_self_sqrt (by positivity :153    0 ≤ 1 / (Fintype.card ι : ℝ))]154  ring155156/-- Exact Bell overlap for any rectangular Kraus family. -/157theorem paired_bell_overlap (T : KrausChannel ι ο κ) :158    ((bellState (ι := ο)).matrix *159      ((T.tensor T.conjugate).output (bellState (ι := ι))).matrix).trace.re =160      1 / ((Fintype.card ο : ℝ) * Fintype.card ι) *161        ∑ k, ∑ l, Complex.normSq (∑ a, ∑ i, T.kraus k a i * star (T.kraus l a i)) := by162  simp only [KrausChannel.output_matrix, KrausChannel.map, KrausChannel.tensor,163    KrausChannel.conjugate, Matrix.mul_sum, Matrix.trace_sum,164    Complex.re_sum, Fintype.sum_prod_type]165  simp_rw [bell_term_overlap]166  simp only [Finset.mul_sum]167168def krausMass (T : KrausChannel ι ο κ) (k : κ) : ℝ :=169  ∑ a, ∑ i, Complex.normSq (T.kraus k a i)170171omit [Nonempty ι] [DecidableEq ο] [Nonempty ο] in172theorem krausMass_sum (T : KrausChannel ι ο κ) :173    ∑ k, krausMass T k = Fintype.card ι := by174  have he (k : κ) : ((T.kraus k).conjTranspose * T.kraus k).trace.re = krausMass T k := by175    simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply, Matrix.conjTranspose_apply,176      Complex.re_sum, Complex.star_def]177    simp_rw [← Complex.normSq_eq_conj_mul_self, Complex.ofReal_re]178    rw [Finset.sum_comm]179    rfl180  have h := congrArg (fun M : Matrix ι ι ℂ => M.trace.re) T.complete181  simpa only [Matrix.trace_sum, Complex.re_sum, he, Matrix.trace_one,182    Complex.natCast_re] using h183184omit [Nonempty ι] [DecidableEq ο] [Nonempty ο] in185theorem diagonal_kraus_inner (T : KrausChannel ι ο κ) (k : κ) :186    Complex.normSq (∑ a, ∑ i, T.kraus k a i * star (T.kraus k a i)) =187      krausMass T k ^ 2 := by188  simp only [Complex.star_def, Complex.mul_conj, ← Complex.ofReal_sum,189    Complex.normSq_ofReal, krausMass, pow_two]190191/-- The output Bell overlap is at least input dimension divided by192output dimension times the number of Kraus operators. -/193theorem paired_bell_overlap_lower [DecidableEq κ] [Nonempty κ]194    (T : KrausChannel ι ο κ) :195    (Fintype.card ι : ℝ) / ((Fintype.card ο : ℝ) * Fintype.card κ) ≤196    ((bellState (ι := ο)).matrix *197      ((T.tensor T.conjugate).output (bellState (ι := ι))).matrix).trace.re := by198  have hi : (0 : ℝ) < Fintype.card ι := by exact_mod_cast Fintype.card_pos199  have ho : (0 : ℝ) < Fintype.card ο := by exact_mod_cast Fintype.card_pos200  have hk : (0 : ℝ) < Fintype.card κ := by exact_mod_cast Fintype.card_pos201  have hdiag : ∑ k, krausMass T k ^ 2 ≤202      ∑ k, ∑ l, Complex.normSq (∑ a, ∑ i, T.kraus k a i * star (T.kraus l a i)) := by203    apply Finset.sum_le_sum204    intro k _205    rw [← diagonal_kraus_inner T k]206    exact Finset.single_le_sum (f := fun l =>207      Complex.normSq (∑ a, ∑ i, T.kraus k a i * star (T.kraus l a i)))208      (fun l _ => Complex.normSq_nonneg _) (Finset.mem_univ k)209  have hcs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (krausMass T) (fun _ => (1:ℝ))210  simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, nsmul_eq_mul,211    krausMass_sum] at hcs212  have hmass : (Fintype.card ι : ℝ)^2 / Fintype.card κ ≤ ∑ k, krausMass T k ^ 2 :=213    (div_le_iff₀ hk).mpr (by simpa only [mul_one] using hcs)214  rw [paired_bell_overlap]215  calc216    _ = (1 / ((Fintype.card ο : ℝ) * Fintype.card ι)) *217        ((Fintype.card ι : ℝ)^2 / Fintype.card κ) := by field_simp218    _ ≤ _ := mul_le_mul_of_nonneg_left (hmass.trans hdiag) (by positivity)219220/-- General conjugate-channel Bell entropy bound when the environment is221no larger than the input. This includes normalized Gaussian isometries. -/222theorem paired_bell_entropy_le [DecidableEq κ] [Nonempty κ]223    (T : KrausChannel ι ο κ) (hd : Fintype.card κ ≤ Fintype.card ι) :224    ((T.tensor T.conjugate).output (bellState (ι := ι))).vonNeumann ≤225      2 * Real.log (Fintype.card ο : ℝ) -226        (Real.log (Fintype.card ο : ℝ) - 1) / Fintype.card ο := by227  apply entropy_le_of_overlap _ (bellState (ι := ο)) (Fintype.card ο)228    Fintype.card_pos (by simp [pow_two])229  have hk : (0 : ℝ) < Fintype.card κ := by exact_mod_cast Fintype.card_pos230  have ho : (0 : ℝ) < Fintype.card ο := by exact_mod_cast Fintype.card_pos231  have hdim : (Fintype.card κ : ℝ) ≤ Fintype.card ι := by exact_mod_cast hd232  apply le_trans _ (paired_bell_overlap_lower T)233  apply (div_le_div_iff₀ ho (mul_pos ho hk)).mpr234  nlinarith235236end BellOverlap237238theorem converted_bounds {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]239    [Fintype κ] [DecidableEq κ] [Nonempty κ] {K : ℕ} [NeZero K]240    (T : KrausChannel ι (ZMod K) κ) (hd : Fintype.card κ ≤ Fintype.card ι)241    {t : ℝ} (ht : 0 ≤ t)242    (hcert : ∀ A : Matrix (ZMod K) (ZMod K) ℂ, A.IsHermitian → A.trace = 0 →243      ‖T.adjointMap A‖ ≤ t * AdjointPurity.hsLength A) :244    (Conversion.converted T).holevo ≤ Real.log (1 + (K : ℝ) * t^2) ∧245    (Real.log (K : ℝ) - 1) / K ≤246      ((Conversion.converted T).tensor (Conversion.converted T)).holevo ∧247    (Real.log (K : ℝ) - 1) / K - 2 * Real.log (1 + (K : ℝ) * t^2) ≤248      ((Conversion.converted T).tensor (Conversion.converted T)).holevo -249        2 * (Conversion.converted T).holevo := by250  have h := Conversion.converted_bounds_of_certificate T ht hcert251    (bellState (ι := ι)) (paired_bell_entropy_le T hd)252  simp only [ZMod.card] at h253  rcases h with ⟨h₁,h₂,h₃⟩254  exact ⟨h₁, by linarith, by linarith⟩255256end Nonadditivity.GeneralBell