Offline · exact source
Exact Lean source

Channels

formalization/Cloning/Channels.lean

Source hash: 31d2b1200b7e7a9d4f9c1c9fec78f8e6c55311bd2a5c4adf091d4898fb1db6fa

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Mathlib.LinearAlgebra.Matrix.PosDef
2import Mathlib.LinearAlgebra.Matrix.Trace
3import Mathlib.LinearAlgebra.Matrix.Kronecker
4import Mathlib.Analysis.RCLike.Basic
5import Mathlib.Analysis.Complex.Basic
6import Mathlib.Analysis.Complex.Order
7 
8/-!
9# Concrete finite-dimensional Kraus channels
10 
11Unlike the abstract fidelity interfaces elsewhere, these statements concern
12actual complex matrices. Complete positivity is proved at every finite matrix
13amplification. The remaining Cartan-specific input is the representation
14theoretic construction of the Kraus operators and their normalization.
15-/
16 
17open scoped BigOperators Matrix Kronecker ComplexOrder
18open Matrix
19 
20noncomputable section
21 
22namespace Cloning.Channels
23 
24set_option autoImplicit false
25 
26variable {ι α β : Type*} [Fintype ι] [Fintype α] [Fintype β]
27 
28/-- Schrödinger-picture Kraus formula. -/
29def krausMap (K : ι → Matrix β α ℂ) (X : Matrix α α ℂ) : Matrix β β ℂ :=
30  ∑ i, K i * X * (K i)ᴴ
31 
32theorem krausMap_positive (K : ι → Matrix β α ℂ)
33    {X : Matrix α α ℂ} (hX : X.PosSemidef) : (krausMap K X).PosSemidef := by
34  apply Matrix.posSemidef_sum
35  intro i _
36  exact hX.mul_mul_conjTranspose_same (K i)
37 
38omit [Fintype β] in
39theorem krausMap_add (K : ι → Matrix β α ℂ) (X Y : Matrix α α ℂ) :
40    krausMap K (X + Y) = krausMap K X + krausMap K Y := by
41  simp [krausMap, Matrix.mul_add, Matrix.add_mul, Finset.sum_add_distrib]
42 
43omit [Fintype β] in
44theorem krausMap_smul (K : ι → Matrix β α ℂ) (c : ℂ) (X : Matrix α α ℂ) :
45    krausMap K (c • X) = c • krausMap K X := by
46  simp [krausMap, Matrix.mul_smul, Matrix.smul_mul, Finset.smul_sum]
47 
48/-- The dual identity ∑ K* K = I implies exact trace preservation. -/
49theorem krausMap_trace [DecidableEq α] (K : ι → Matrix β α ℂ)
50    (hK : ∑ i, (K i)ᴴ * K i = 1) (X : Matrix α α ℂ) :
51    Matrix.trace (krausMap K X) = Matrix.trace X := by
52  calc
53    Matrix.trace (krausMap K X) = ∑ i, Matrix.trace ((K i)ᴴ * K i * X) := by
54      simp only [krausMap, Matrix.trace_sum]
55      apply Finset.sum_congr rfl
56      intro i _
57      rw [Matrix.trace_mul_comm, ← Matrix.mul_assoc]
58    _ = Matrix.trace ((∑ i, (K i)ᴴ * K i) * X) := by
59      rw [Matrix.sum_mul, Matrix.trace_sum]
60    _ = Matrix.trace X := by rw [hK, Matrix.one_mul]
61 
62/-- Applying a map to each ancilla matrix block: the actual matrix amplification. -/
63def amplify {κ : Type*} (Φ : Matrix α α ℂ → Matrix β β ℂ)
64    (X : Matrix (κ × α) (κ × α) ℂ) : Matrix (κ × β) (κ × β) ℂ :=
65  fun a b => Φ (fun i j => X (a.1, i) (b.1, j)) a.2 b.2
66 
67omit [Fintype β] in
68theorem amplify_krausMap {κ : Type*} [Fintype κ] [DecidableEq κ]
69    (K : ι → Matrix β α ℂ) (X : Matrix (κ × α) (κ × α) ℂ) :
70    amplify (krausMap K) X =
71      krausMap (fun i => (1 : Matrix κ κ ℂ) ⊗ₖ K i) X := by
72  ext ⟨a, i⟩ ⟨b, j⟩
73  simp [amplify, krausMap, Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply,
74    Fintype.sum_prod_type, Matrix.one_apply, apply_ite]
75 
76/-- Every finite amplification preserves positive semidefinite matrices. -/
77theorem krausMap_completely_positive {κ : Type*} [Fintype κ] [DecidableEq κ]
78    (K : ι → Matrix β α ℂ) {X : Matrix (κ × α) (κ × α) ℂ}
79    (hX : X.PosSemidef) : (amplify (krausMap K) X).PosSemidef := by
80  rw [amplify_krausMap]
81  exact krausMap_positive _ hX
82 
83/-- One transparent finite-dimensional channel structure. -/
84structure MatrixChannel (α β : Type*) [Fintype α] [Fintype β] where
85  toFun : Matrix α α ℂ → Matrix β β ℂ
86  map_add : ∀ X Y, toFun (X + Y) = toFun X + toFun Y
87  map_smul : ∀ (c : ℂ) X, toFun (c • X) = c • toFun X
88  trace_preserving : ∀ X, Matrix.trace (toFun X) = Matrix.trace X
89  completely_positive : ∀ (k : ℕ) (X : Matrix (Fin k × α) (Fin k × α) ℂ),
90    X.PosSemidef → (amplify toFun X).PosSemidef
91 
92/-- A channel constructed from normalized Kraus matrices, with all laws proved. -/
93def ofKraus [DecidableEq α] (K : ι → Matrix β α ℂ)
94    (hK : ∑ i, (K i)ᴴ * K i = 1) : MatrixChannel α β where
95  toFun := krausMap K
96  map_add := krausMap_add K
97  map_smul := krausMap_smul K
98  trace_preserving := krausMap_trace K hK
99  completely_positive := fun _ _ hX => krausMap_completely_positive K hX
100 
101end Cloning.Channels