Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.NoncommutativeCSMemory

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

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

108 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.NoncommutativeCS7import Mathlib.Data.Fin.Tuple.Basic89/-! # Arbitrary open-memory contractions1011A register is created at one occurrence of a paired index, retained across12arbitrary diagonal factors, and summed out at its other occurrence. Registers13can be removed in any order, so the construction includes crossing partitions.14The norm bound is proved for the literal recursively evaluated finite sums.15-/1617noncomputable section1819namespace Nonadditivity.NoncommutativeCS2021open scoped BigOperators InnerProduct2223variable {𝕜 E J : Type*} [RCLike 𝕜]24variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [CompleteSpace E]25variable [Fintype J]2627abbrev Memory (J E : Type*) [Fintype J] [NormedAddCommGroup E] (n : ℕ) :=28  DirectSum (Fin n → J) E2930/-- Separate any chosen register, not only the most recently created one. -/31def splitRegister {n : ℕ} (p : Fin (n + 1)) :32    Memory J E (n + 1) ≃ₗᵢ[𝕜] DirectSum (Fin n → J) (DirectSum J E) where33  toFun x := WithLp.toLp 2 (fun s => WithLp.toLp 2 (fun j => x (p.insertNth j s)))34  invFun x := WithLp.toLp 2 (fun s => x (p.removeNth s) (s p))35  left_inv := by intro x; ext s; simp36  right_inv := by intro x; ext s j; simp37  map_add' := by intros; rfl38  map_smul' := by intros; rfl39  norm_map' := by40    intro x41    apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp42    simp only [PiLp.norm_sq_eq_of_L2]43    change (∑ s : Fin n → J, ∑ j : J, ‖x (p.insertNth j s)‖ ^ 2) = _44    rw [Finset.sum_comm, ← Fintype.sum_prod_type45      (fun z : J × (Fin n → J) => ‖x (p.insertNth z.1 z.2)‖ ^ 2)]46    exact Fintype.sum_equiv (Fin.insertNthEquiv (fun _ => J) p)47      (fun z => ‖x (p.insertNth z.1 z.2)‖ ^ 2) (fun s => ‖x s‖ ^ 2) (fun _ => rfl)4849omit [CompleteSpace E] in50@[simp] theorem splitRegister_apply {n : ℕ} (p : Fin (n + 1))51    (x : Memory J E (n + 1)) (s : Fin n → J) (j : J) :52    splitRegister (𝕜 := 𝕜) p x s j = x (p.insertNth j s) := rfl5354omit [CompleteSpace E] in55@[simp] theorem splitRegister_symm_apply {n : ℕ} (p : Fin (n + 1))56    (x : DirectSum (Fin n → J) (DirectSum J E)) (s : Fin (n + 1) → J) :57    (splitRegister (𝕜 := 𝕜) p).symm x s = x (p.removeNth s) (s p) := rfl5859def openRegister {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :60    Memory J E n →L[𝕜] Memory J E (n + 1) :=61  (splitRegister (𝕜 := 𝕜) p).symm.toLinearIsometry.toContinuousLinearMap ∘L62    amplify (column A)6364def closeRegister {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :65    Memory J E (n + 1) →L[𝕜] Memory J E n :=66  amplify (row A) ∘L (splitRegister (𝕜 := 𝕜) p).toLinearIsometry.toContinuousLinearMap6768@[simp] theorem openRegister_apply {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E)69    (x : Memory J E n) (s : Fin (n + 1) → J) :70    openRegister p A x s = A (s p) (x (p.removeNth s)) := rfl7172@[simp] theorem closeRegister_apply {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E)73    (x : Memory J E (n + 1)) (s : Fin n → J) :74    closeRegister p A x s = ∑ j, A j (x (p.insertNth j s)) := by75  simp [closeRegister]7677theorem openRegister_norm_le {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :78    ‖openRegister p A‖ ≤ Real.sqrt ‖columnGram A‖ := by79  apply (ContinuousLinearMap.opNorm_comp_le _ _).trans80  calc81    _ ≤ 1 * Real.sqrt ‖columnGram A‖ :=82      mul_le_mul (LinearIsometry.norm_toContinuousLinearMap_le _)83        ((amplify_norm_le _).trans (column_norm_le A)) (norm_nonneg _) (by norm_num)84    _ = _ := one_mul _8586theorem closeRegister_norm_le {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :87    ‖closeRegister p A‖ ≤ Real.sqrt ‖rowGram A‖ := by88  apply (ContinuousLinearMap.opNorm_comp_le _ _).trans89  calc90    _ ≤ Real.sqrt ‖rowGram A‖ * 1 :=91      mul_le_mul ((amplify_norm_le _).trans (row_norm_le A))92        (LinearIsometry.norm_toContinuousLinearMap_le _) (norm_nonneg _) (Real.sqrt_nonneg _)93    _ = _ := mul_one _9495/-- A finite contraction with explicit active registers. Each middle factor96depends only on the registers that are currently open. -/97inductive Contraction (𝕜 E J : Type*) [RCLike 𝕜] [NormedAddCommGroup E]98    [InnerProductSpace 𝕜 E] : ℕ → ℕ → Type _99  | identity (n : ℕ) : Contraction 𝕜 E J n n100  | openReg {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :101      Contraction 𝕜 E J n (n + 1)102  | closeReg {n : ℕ} (p : Fin (n + 1)) (A : J → E →L[𝕜] E) :103      Contraction 𝕜 E J (n + 1) n104  | diagonalReg (n : ℕ) (A : (Fin n → J) → E →L[𝕜] E) :105      Contraction 𝕜 E J n n106  | comp {l m n : ℕ} (Q : Contraction 𝕜 E J m n) (P : Contraction 𝕜 E J l m) :107      Contraction 𝕜 E J l n108109namespace Contraction110111def operator {m n : ℕ} : Contraction 𝕜 E J m n → Memory J E m →L[𝕜] Memory J E n112  | .identity _ => ContinuousLinearMap.id 𝕜 _113  | .openReg p A => openRegister p A114  | .closeReg p A => closeRegister p A115  | .diagonalReg _ A => diagonal A116  | .comp Q P => operator Q ∘L operator P117118/-- Literal sum-of-products semantics; no norm estimate occurs in this definition. -/119def evaluate {m n : ℕ} :120    Contraction 𝕜 E J m n → ((Fin m → J) → E) → (Fin n → J) → E121  | .identity _, x => x122  | .openReg p A, x => fun s => A (s p) (x (p.removeNth s))123  | .closeReg p A, x => fun s => ∑ j, A j (x (p.insertNth j s))124  | .diagonalReg _ A, x => fun s => A s (x s)125  | .comp Q P, x => evaluate Q (evaluate P x)126127def cost {m n : ℕ} : Contraction 𝕜 E J m n → ℝ128  | .identity _ => 1129  | .openReg _ A => Real.sqrt ‖columnGram A‖130  | .closeReg _ A => Real.sqrt ‖rowGram A‖131  | .diagonalReg _ A => ‖A‖132  | .comp Q P => cost Q * cost P133134theorem cost_nonneg {m n : ℕ} (P : Contraction 𝕜 E J m n) : 0 ≤ P.cost := by135  induction P with136  | identity => exact zero_le_one137  | openReg => exact Real.sqrt_nonneg _138  | closeReg => exact Real.sqrt_nonneg _139  | diagonalReg => exact norm_nonneg _140  | comp Q P hQ hP => exact mul_nonneg hQ hP141142@[simp] theorem operator_apply {m n : ℕ} (P : Contraction 𝕜 E J m n)143    (x : Memory J E m) (s : Fin n → J) : P.operator x s = P.evaluate (fun t => x t) s := by144  induction P with145  | identity => rfl146  | openReg => rfl147  | closeReg => exact closeRegister_apply _ _ _ _148  | diagonalReg => rfl149  | comp Q P hQ hP =>150      simp only [operator, ContinuousLinearMap.comp_apply, hQ, hP, evaluate]151152/-- Every finite open-memory contraction obeys its product of row, column,153and diagonal factors. Crossings cost no extra factor. -/154theorem norm_operator_le {m n : ℕ} (P : Contraction 𝕜 E J m n) : ‖P.operator‖ ≤ P.cost := by155  induction P with156  | identity => exact ContinuousLinearMap.norm_id_le157  | openReg => exact openRegister_norm_le _ _158  | closeReg => exact closeRegister_norm_le _ _159  | diagonalReg n A => exact diagonal_norm_le A ‖A‖ (norm_nonneg _) (norm_le_pi_norm A)160  | comp Q P hQ hP =>161      exact (ContinuousLinearMap.opNorm_comp_le _ _).trans162        (mul_le_mul hQ hP (norm_nonneg _) Q.cost_nonneg)163164/-- The same estimate, directly on the recursively evaluated sum of products. -/165theorem evaluate_norm_le {m n : ℕ} (P : Contraction 𝕜 E J m n) (x : Memory J E m) :166    ‖(WithLp.toLp 2 (P.evaluate (fun s => x s)) : Memory J E n)‖ ≤ P.cost * ‖x‖ := by167  have h : (WithLp.toLp 2 (P.evaluate (fun s => x s)) : Memory J E n) = P.operator x := by168    ext s169    exact (P.operator_apply x s).symm170  rw [h]171  exact (P.operator.le_opNorm x).trans172    (mul_le_mul_of_nonneg_right P.norm_operator_le (norm_nonneg _))173174end Contraction175176end Nonadditivity.NoncommutativeCS