Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.ComplexRealTrace

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

Direct imports

  • Mathlib.Analysis.CStarAlgebra.Matrix dependency
  • Mathlib.LinearAlgebra.Complex.Module dependency
  • Mathlib.LinearAlgebra.FiniteDimensional.Lemmas dependency
  • Mathlib.Analysis.InnerProductSpace.Trace dependency

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

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

2 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Mathlib.Analysis.CStarAlgebra.Matrix7import Mathlib.LinearAlgebra.Complex.Module8import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas9import Mathlib.Analysis.InnerProductSpace.Trace1011namespace Nonadditivity.ComplexRealTrace1213noncomputable section14set_option backward.isDefEq.respectTransparency false15open scoped BigOperators Matrix Matrix.Norms.L2Operator1617set_option maxHeartbeats 8000001819variable {ι : Type*} [Fintype ι] [DecidableEq ι]2021/-- Restricting a complex matrix operator to real scalars doubles the real22part of its complex trace. -/23theorem trace_restrict (A : Matrix ι ι ℂ) :24    ((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) A).restrictScalars ℝ).toLinearMap.trace ℝ25      (EuclideanSpace ℂ ι) = 2 * A.trace.re := by26  let b := (EuclideanSpace.basisFun ι ℂ).toBasis27  let c := Complex.basisOneI.smulTower' b28  rw [LinearMap.trace_eq_matrix_trace ℝ c]29  simp only [Matrix.trace, Matrix.diag_apply, Fintype.sum_prod_type,30    LinearMap.toMatrix_apply, c, Module.Basis.smulTower'_repr,31    Module.Basis.smulTower'_apply]32  simp only [Fin.sum_univ_two, Complex.coe_basisOneI, Matrix.cons_val_zero, Matrix.cons_val_one,33    ContinuousLinearMap.coe_restrictScalars,34    LinearMap.restrictScalars_apply, ContinuousLinearMap.coe_coe, map_smul, Finsupp.smul_apply, smul_eq_mul]35  have hb (i : ι) : b.repr (Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) A (b i)) i = A i i := by36    simp [b, EuclideanSpace.basisFun_apply,37      EuclideanSpace.basisFun_repr, Matrix.mulVec, dotProduct]38  simp only [hb, Complex.coe_basisOneI_repr, Matrix.cons_val_zero, Matrix.cons_val_one, Complex.mul_re, Complex.mul_im,39    Complex.I_re, Complex.I_im, zero_mul, one_mul, zero_add]40  simp only [Finset.sum_add_distrib, Complex.re_sum]41  ring4243/-- The same identity for the square, used by Gaussian quadratic variance bounds. -/44theorem trace_square_restrict (A : Matrix ι ι ℂ) :45    ((((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ)) A).restrictScalars ℝ).toLinearMap *46      (((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ)) A).restrictScalars ℝ).toLinearMap).trace ℝ47        (EuclideanSpace ℂ ι) = 2 * (A * A).trace.re := by48  have heq :49      (((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ)) A).restrictScalars ℝ).toLinearMap *50        (((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ)) A).restrictScalars ℝ).toLinearMap =51      (((Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ)) (A * A)).restrictScalars ℝ).toLinearMap := by52    rw [map_mul]53    rfl54  rw [heq, trace_restrict]5556end57end Nonadditivity.ComplexRealTrace