Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.ChannelExtensions

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

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

21 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Channels7import Nonadditivity.StateEnsembles89/-!10# Measured input registers1112The control register is measured and discarded. These are concrete Kraus13channels, not postulated transformations of entropy bounds.14-/1516noncomputable section1718namespace Nonadditivity.Channels1920open Entropy21open scoped BigOperators ComplexOrder Matrix2223variable {ι ο κ ζ : Type*}24variable [Fintype ι] [DecidableEq ι] [Fintype ο] [DecidableEq ο]25variable [Fintype κ] [Fintype ζ] [DecidableEq ζ]2627/-- Select a classical block of the input matrix. -/28def selector (z : ζ) : Matrix ι (ζ × ι) ℂ :=29  fun i w => if w = (z, i) then 1 else 03031theorem selector_mul_adjoint (z w : ζ) :32    selector (ι := ι) z * (selector (ι := ι) w).conjTranspose =33      if z = w then 1 else 0 := by34  ext i j35  by_cases h : z = w <;> by_cases hij : i = j <;>36    simp [Matrix.mul_apply, selector, Matrix.conjTranspose_apply,37      Prod.mk.injEq, Matrix.one_apply,38      h, hij, eq_comm]3940theorem selector_complete :41    ∑ z : ζ, (selector (ι := ι) z).conjTranspose * selector z = 1 := by42  ext a b43  rcases a with ⟨z, i⟩44  rcases b with ⟨w, j⟩45  by_cases h : z = w <;> by_cases hij : i = j <;>46    simp [Matrix.sum_apply, Matrix.mul_apply, selector, Matrix.conjTranspose_apply,47      Prod.mk.injEq, Matrix.one_apply, ite_and, h, hij]4849/-- A fixed input control value, with its trace and positivity proved. -/50def labelledState (z : ζ) (ρ : DensityMatrix ι) : DensityMatrix (ζ × ι) where51  matrix := (selector z).conjTranspose * ρ.matrix * selector z52  positive := ρ.positive.conjTranspose_mul_mul_same _53  normalized := by54    rw [Matrix.trace_mul_cycle, selector_mul_adjoint]55    simp [ρ.normalized]5657theorem select_labelledState (z w : ζ) (ρ : DensityMatrix ι) :58    selector z * (labelledState w ρ).matrix * (selector z).conjTranspose =59      if z = w then ρ.matrix else 0 := by60  change selector z * ((selector w).conjTranspose * ρ.matrix * selector w) *61    (selector z).conjTranspose = _62  have hmat : selector z * ((selector w).conjTranspose * ρ.matrix * selector w) *63      (selector z).conjTranspose =64      (selector z * (selector w).conjTranspose) * ρ.matrix *65      (selector w * (selector z).conjTranspose) := by simp only [Matrix.mul_assoc]66  rw [hmat]67  rw [selector_mul_adjoint, selector_mul_adjoint]68  by_cases h : z = w69  · subst w70    simp71  · simp [h, Ne.symm h]7273namespace KrausChannel7475/-- Measure the control, apply its selected channel, and discard the label. -/76def controlled (T : ζ → KrausChannel ι ο κ) : KrausChannel (ζ × ι) ο (ζ × κ) where77  kraus := fun zk => (T zk.1).kraus zk.2 * selector zk.178  complete := by79    simp only [Matrix.conjTranspose_mul, Fintype.sum_prod_type]80    calc81      (∑ z, ∑ k, (selector z).conjTranspose * ((T z).kraus k).conjTranspose *82          ((T z).kraus k * selector z)) =83          ∑ z, (selector z).conjTranspose *84            (∑ k, ((T z).kraus k).conjTranspose * (T z).kraus k) * selector z := by85        simp only [Matrix.mul_sum, Matrix.sum_mul, Matrix.mul_assoc]86      _ = 1 := by simp only [KrausChannel.complete, Matrix.mul_one]; exact selector_complete8788omit [DecidableEq ο] in89theorem controlled_map (T : ζ → KrausChannel ι ο κ)90    (X : Matrix (ζ × ι) (ζ × ι) ℂ) :91    (controlled T).map X = ∑ z, (T z).map (selector z * X * (selector z).conjTranspose) := by92  simp only [map, controlled, Fintype.sum_prod_type, Matrix.conjTranspose_mul,93    Matrix.mul_assoc]9495@[simp] theorem controlled_output_labelled (T : ζ → KrausChannel ι ο κ)96    (z : ζ) (ρ : DensityMatrix ι) :97    (controlled T).output (labelledState z ρ) = (T z).output ρ := by98  apply DensityMatrix.ext99  simp only [output_matrix, controlled_map, select_labelledState]100  simp only [apply_ite, map_zero, Finset.sum_ite_eq', Finset.mem_univ, if_true]101102/-- Conjugate every output of a channel by a fixed unitary. -/103def outputUnitary (T : KrausChannel ι ο κ) (U : unitary (Matrix ο ο ℂ)) :104    KrausChannel ι ο κ where105  kraus := fun k => (U : Matrix ο ο ℂ) * T.kraus k106  complete := by107    have hU : (U : Matrix ο ο ℂ).conjTranspose * (U : Matrix ο ο ℂ) = 1 :=108      Unitary.coe_star_mul_self U109    calc110      (∑ k, ((U : Matrix ο ο ℂ) * T.kraus k).conjTranspose *111          ((U : Matrix ο ο ℂ) * T.kraus k)) =112          ∑ k, (T.kraus k).conjTranspose *113            ((U : Matrix ο ο ℂ).conjTranspose * (U : Matrix ο ο ℂ)) * T.kraus k := by114        simp only [Matrix.conjTranspose_mul, Matrix.mul_assoc]115      _ = 1 := by simp only [hU, Matrix.mul_one, T.complete]116117theorem outputUnitary_map (T : KrausChannel ι ο κ) (U : unitary (Matrix ο ο ℂ))118    (X : Matrix ι ι ℂ) :119    (T.outputUnitary U).map X = (U : Matrix ο ο ℂ) * T.map X *120      (U : Matrix ο ο ℂ).conjTranspose := by121  simp only [map, outputUnitary, Matrix.conjTranspose_mul, Matrix.sum_mul,122    Matrix.mul_sum, Matrix.mul_assoc]123124/-- The actual channel extension associated with a finite family of output unitaries. -/125def covariantExtension (T : KrausChannel ι ο κ)126    (U : ζ → unitary (Matrix ο ο ℂ)) : KrausChannel (ζ × ι) ο (ζ × κ) :=127  controlled (fun z => T.outputUnitary (U z))128129end KrausChannel130131end Nonadditivity.Channels