Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.PrescribedTest

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

Direct imports

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

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

48 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.ShiftNorm7import Nonadditivity.FreeBridge8import Mathlib.LinearAlgebra.Matrix.Kronecker910/-! # The prescribed observable and its exact free norm1112The first tensor factor exchanges two distinct basis vectors, and all remaining13factors are scalar identities. Its free polynomial is an actual bilateral shift14plus its inverse. No spectral or norm hypothesis is assumed.15-/1617noncomputable section1819namespace Nonadditivity.PrescribedTest2021open FreeModel22open scoped BigOperators Matrix Kronecker2324variable {K : ℕ}2526def core (i j : Fin K) : Matrix (Fin K) (Fin K) ℂ :=27  Matrix.single i j 1 + Matrix.single j i 12829theorem core_isHermitian (i j : Fin K) : (core i j).IsHermitian := by30  change (core i j).conjTranspose = core i j31  simp [core, Matrix.conjTranspose_add, Matrix.conjTranspose_single, add_comm]3233theorem core_trace (i j : Fin K) (hij : i ≠ j) : (core i j).trace = 0 := by34  simp [core, Matrix.trace_add, hij, hij.symm]3536theorem core_square_trace (i j : Fin K) (hij : i ≠ j) :37    (core i j * core i j).trace = 2 := by38  norm_num [core, add_mul, mul_add, Matrix.single_mul_single_of_ne, hij, hij.symm,39    Matrix.trace_add]4041def branchEquiv (K m : ℕ) : Fin K × Branch K m ≃ Branch K (m + 1) :=42  Fin.consEquiv (fun _ => Fin K)4344def unnormalized (i j : Fin K) (m : ℕ) :45    Matrix (Branch K (m + 1)) (Branch K (m + 1)) ℂ :=46  ((core i j) ⊗ₖ (1 : Matrix (Branch K m) (Branch K m) ℂ)).submatrix47    (branchEquiv K m).symm (branchEquiv K m).symm4849theorem unnormalized_isHermitian (i j : Fin K) (m : ℕ) :50    (unnormalized i j m).IsHermitian := by51  apply Matrix.IsHermitian.submatrix52  change ((core i j) ⊗ₖ (1 : Matrix (Branch K m) (Branch K m) ℂ)).conjTranspose = _53  rw [Matrix.conjTranspose_kronecker, (core_isHermitian i j).eq,54    Matrix.conjTranspose_one]5556theorem unnormalized_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) :57    (unnormalized i j m).trace = 0 := by58  rw [unnormalized, FreeBridge.trace_submatrix_equiv, Matrix.trace_kronecker,59    core_trace i j hij, zero_mul]6061theorem unnormalized_square_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) :62    (unnormalized i j m * unnormalized i j m).trace = 2 * (K : ℂ)^m := by63  rw [unnormalized, Matrix.submatrix_mul_equiv, FreeBridge.trace_submatrix_equiv,64    ← Matrix.mul_kronecker_mul, one_mul, Matrix.trace_kronecker,65    core_square_trace i j hij]66  simp6768def testScale (K m : ℕ) : ℝ := (Real.sqrt (2 * (K : ℝ)^m))⁻¹6970def test (i j : Fin K) (m : ℕ) :71    Matrix (Branch K (m + 1)) (Branch K (m + 1)) ℂ :=72  (testScale K m : ℂ) • unnormalized i j m7374theorem test_isHermitian (i j : Fin K) (m : ℕ) :75    (test i j m).IsHermitian := by76  change ((testScale K m : ℂ) • unnormalized i j m).conjTranspose = _77  rw [Matrix.conjTranspose_smul, (unnormalized_isHermitian i j m).eq]78  simp [test]7980theorem test_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) : (test i j m).trace = 0 := by81  simp [test, Matrix.trace_smul, unnormalized_trace i j hij]8283theorem test_hsLength (i j : Fin K) (hij : i ≠ j) (m : ℕ) :84    AdjointPurity.hsLength (test i j m) = 1 := by85  have hk : 0 < K := i.isLt.trans_le (Nat.le_refl K) |> Nat.zero_lt_of_lt86  have hkr : (0 : ℝ) < K := by exact_mod_cast hk87  have hs : 0 < Real.sqrt (2 * (K : ℝ)^m) := Real.sqrt_pos.mpr (by positivity)88  have hsq := AdjointPurity.hsLength_sq_of_isHermitian (test i j m) (test_isHermitian i j m)89  simp only [test, Matrix.smul_mul, Matrix.mul_smul, Matrix.trace_smul,90    unnormalized_square_trace i j hij m] at hsq91  have hreal : ((testScale K m : ℂ) • ((testScale K m : ℂ) • (2 * (K : ℂ)^m))).re =92      testScale K m ^ 2 * (2 * (K : ℝ)^m) := by93    simp only [smul_eq_mul]94    have hc : (2 * (K : ℂ)^m) = ((2 * (K : ℝ)^m : ℝ) : ℂ) := by push_cast; rfl95    rw [hc, ← Complex.ofReal_mul, ← Complex.ofReal_mul, Complex.ofReal_re]96    ring97  rw [hreal] at hsq98  have hv : testScale K m ^ 2 * (2 * (K : ℝ)^m) = 1 := by99    dsimp [testScale]100    rw [inv_pow, Real.sq_sqrt (by positivity)]101    exact inv_mul_cancel₀ (by positivity)102  have hsq' : AdjointPurity.hsLength (test i j m) ^ 2 = 1 := by103    exact hsq.trans hv104  nlinarith [AdjointPurity.hsLength_nonneg (test i j m)]105106def shiftWord (i j : Fin K) (m : ℕ) : ProductFreeGroup K (m + 1) :=107  Fin.cons ((FreeGroup.of i)⁻¹ * FreeGroup.of j) 1108109theorem shiftWord_inverse (i j : Fin K) (m : ℕ) :110    shiftWord j i m = (shiftWord i j m)⁻¹ := by111  funext k112  cases k using Fin.cases <;> simp [shiftWord]113114theorem shiftWord_powers_injective (i j : Fin K) (hij : i ≠ j) (m : ℕ) :115    Function.Injective (fun k : ℕ => shiftWord i j m ^ k) := by116  let φ := FreeGroup.lift (fun k : Fin K =>117    Multiplicative.ofAdd (if k = j then (1 : ℤ) else 0))118  intro a b hab119  have h := congrArg (fun w : ProductFreeGroup K (m + 1) =>120    Multiplicative.toAdd (φ (w 0))) hab121  simpa [φ, shiftWord, hij] using h122123theorem branch_difference_same_tail (i j : Fin K) (m : ℕ) (a : Branch K m) :124    (branchWord (branchEquiv K m (i, a)))⁻¹ * branchWord (branchEquiv K m (j, a)) =125      shiftWord i j m := by126  funext k127  cases k using Fin.cases <;> simp [branchWord, branchEquiv, shiftWord]128129theorem sum_core_smul {E : Type*} [AddCommGroup E] [Module ℂ E]130    (i j : Fin K) (f : Fin K → Fin K → E) :131    (∑ a, ∑ b, core i j a b • f a b) = f i j + f j i := by132  classical133  simp [core, Matrix.single_apply, add_smul, Finset.sum_add_distrib,134    ite_smul, ite_and]135136theorem unnormalized_polynomial (i j : Fin K) (m : ℕ) :137    (∑ a : Branch K (m + 1), ∑ b : Branch K (m + 1),138      unnormalized i j m a b • leftRegular ((branchWord a)⁻¹ * branchWord b)) =139      (K ^ m : ℂ) • (leftRegular (shiftWord i j m) + leftRegular (shiftWord i j m)⁻¹) := by140  classical141  rw [← (branchEquiv K m).sum_comp]142  simp only [Fintype.sum_prod_type]143  have hinner (a : Fin K) (t : Branch K m) :144      (∑ b : Branch K (m + 1), unnormalized i j m (branchEquiv K m (a, t)) b •145        leftRegular ((branchWord (branchEquiv K m (a, t)))⁻¹ * branchWord b)) =146      ∑ b : Fin K, core i j a b • leftRegular (shiftWord a b m) := by147    rw [← (branchEquiv K m).sum_comp]148    simp only [Fintype.sum_prod_type, unnormalized, Matrix.submatrix_apply,149      Equiv.symm_apply_apply, Matrix.kronecker_apply, Matrix.one_apply]150    simp only [mul_ite, mul_one, mul_zero, ite_smul, zero_smul]151    simp [branch_difference_same_tail]152  simp only [hinner]153  rw [Finset.sum_comm]154  simp only [sum_core_smul, Finset.sum_const, Finset.card_univ, Fintype.card_fun, Fintype.card_fin]155  rw [shiftWord_inverse i j m]156  rw [← Nat.cast_pow, Nat.cast_smul_eq_nsmul]157158theorem gamma_test (i j : Fin K) (m : ℕ) :159    gamma (test i j m) =160      ((1 / (K : ℂ) ^ (m + 1)) * (testScale K m : ℂ) * (K : ℂ)^m) •161        (leftRegular (shiftWord i j m) + leftRegular (shiftWord i j m)⁻¹) := by162  simp only [gamma, test, Matrix.smul_apply, smul_eq_mul, mul_smul,163    ← Finset.smul_sum]164  rw [unnormalized_polynomial, smul_smul, smul_smul]165166/-- The prescribed unit-HS observable has an exact strictly positive free norm. -/167theorem freeNorm_test (i j : Fin K) (hij : i ≠ j) (m : ℕ) :168    freeNorm (test i j m) = 2 * testScale K m / K := by169  classical170  have hk : K ≠ 0 := by omega171  have hkr : (K : ℝ) ≠ 0 := by exact_mod_cast hk172  have hs : 0 ≤ testScale K m := by unfold testScale; positivity173  simp only [freeNorm, gamma_test, norm_smul, norm_mul, norm_div, norm_one,174    norm_pow, Complex.norm_natCast, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs,175    ShiftNorm.norm_shift_add_inverse _ (shiftWord_powers_injective i j hij m)]176  rw [pow_succ]177  field_simp178179theorem freeNorm_test_pos (i j : Fin K) (hij : i ≠ j) (m : ℕ) :180    0 < freeNorm (test i j m) := by181  have hk : 0 < K := by omega182  rw [freeNorm_test i j hij m]183  unfold testScale184  positivity185186/-- An equivalent square-root form of the manuscript's exact lower bound. -/187theorem freeNorm_test_eq_sqrt (i j : Fin K) (hij : i ≠ j) (m : ℕ) :188    freeNorm (test i j m) = Real.sqrt 2 / ((K : ℝ) * Real.sqrt ((K : ℝ)^m)) := by189  have hk : 0 < K := by omega190  have hkr : (0 : ℝ) < K := by exact_mod_cast hk191  have htwo : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num)192  have hs : 0 < Real.sqrt ((K : ℝ)^m) := Real.sqrt_pos.mpr (by positivity)193  rw [freeNorm_test i j hij m, testScale, Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2)]194  field_simp195  nlinarith196197/-- The exact exponent and constant displayed in the manuscript. -/198theorem freeNorm_test_eq_rpow (i j : Fin K) (hij : i ≠ j) (m : ℕ) :199    freeNorm (test i j m) = Real.sqrt 2 * (K : ℝ) ^ (-((m : ℝ) + 2) / 2) := by200  have hk : (0 : ℝ) < K := by exact_mod_cast (show 0 < K by omega)201  rw [freeNorm_test_eq_sqrt i j hij m]202  have hs : Real.sqrt ((K : ℝ)^m) = (K : ℝ)^((m : ℝ) / 2) := by203    rw [Real.sqrt_eq_rpow, ← Real.rpow_natCast, ← Real.rpow_mul hk.le]204    congr 1205    ring206  rw [hs]207  have he : -((m : ℝ) + 2) / 2 = -(1 + (m : ℝ) / 2) := by ring208  rw [he, Real.rpow_neg hk.le, Real.rpow_add hk, Real.rpow_one, div_eq_mul_inv]209210/-- Every block length admits the specific traceless Hermitian unit test211whose free norm supplies the first quantitative error-factor lower bound. -/212theorem exists_prescribed_test {n : ℕ} (hK : 2 ≤ K) (hn : 1 ≤ n) :213    ∃ A : Matrix (Branch K n) (Branch K n) ℂ,214      A.IsHermitian ∧ A.trace = 0 ∧ AdjointPurity.hsLength A = 1 ∧215      freeNorm A = Real.sqrt 2 * (K : ℝ)^(-((n : ℝ) + 1) / 2) := by216  cases n with217  | zero => omega218  | succ m =>219      let i : Fin K := ⟨0, by omega⟩220      let j : Fin K := ⟨1, by omega⟩221      have hij : i ≠ j := by intro h; have := congrArg Fin.val h; simp [i, j] at this222      refine ⟨test i j m, test_isHermitian i j m, test_trace i j hij m,223        test_hsLength i j hij m, ?_⟩224      simpa only [Nat.cast_add, Nat.cast_one, add_assoc, one_add_one_eq_two] using225        freeNorm_test_eq_rpow i j hij m226227end Nonadditivity.PrescribedTest