Offline · exact source
Exact Lean source

MatrixLiftedCPTPKraus

formalization/Cloning/MatrixLiftedCPTPKraus.lean

Source hash: bd0e2d5f9fdd0d50368d0c99278c4703c3972e461864c9413966b02f3f263bb5

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 Cloning.MatrixLiftedCPTPAction
2import Cloning.FiniteKrausLift
3 
4/-!
5# Finite Kraus realization without a representation premise
6 
7Every actual finite matrix channel has a normalized Kraus family, obtained
8from the positive square root of its Choi matrix. Consequently the lifted
9sector channel also acts on the actual Hilbert-space trace-class registers.
10-/
11noncomputable section
12open scoped BigOperators Matrix MatrixOrder ComplexOrder Kronecker
13open Matrix Cloning.Channels Cloning.MatrixFidelity
14 
15namespace Cloning.MatrixLiftedCPTP
16 
17set_option backward.isDefEq.respectTransparency false
18set_option maxHeartbeats 800000
19set_option linter.unusedSectionVars false
20 
21variable {α β : Type*} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β]
22 
23theorem amplify_posSemidef {ι : Type*} [Fintype ι]
24    (Φ : MatrixChannel α β) (X : Matrix (ι × α) (ι × α) ℂ) (hX : X.PosSemidef) :
25    (amplify Φ.toFun X).PosSemidef := by
26  let e := Fintype.equivFin ι
27  have h := (Φ.completely_positive (Fintype.card ι) _
28    (hX.submatrix (fun a : Fin (Fintype.card ι) × α => (e.symm a.1, a.2)))).submatrix
29    (fun a : ι × β => (e a.1, a.2))
30  convert h using 1
31  ext a b
32  simp [amplify, Matrix.submatrix]
33 
34/-- The Choi matrix, with input and output indices in that order. -/
35def choi (Φ : MatrixChannel α β) : Matrix (α × β) (α × β) ℂ :=
36  fun a b => Φ.toFun (Matrix.single a.1 b.1 1) a.2 b.2
37 
38theorem choi_posSemidef (Φ : MatrixChannel α β) : (choi Φ).PosSemidef := by
39  let v : α × α → ℂ := fun a => if a.1 = a.2 then 1 else 0
40  have h := amplify_posSemidef Φ _ (Matrix.posSemidef_vecMulVec_self_star v)
41  convert h using 1
42  ext ⟨a, b⟩ ⟨c, d⟩
43  change Φ.toFun (Matrix.single a c 1) b d =
44    Φ.toFun (fun i j => v (a, i) * star (v (c, j))) b d
45  congr 1
46  ext i j
47  by_cases hi : a = i <;> by_cases hj : c = j <;> simp [v, hi, hj]
48 
49/-- A canonical finite rectangular Kraus family from the Choi square root. -/
50def choiKraus (Φ : MatrixChannel α β) (l : α × β) : Matrix β α ℂ :=
51  fun b a => CFC.sqrt (choi Φ) (a, b) l
52 
53theorem choiKraus_coefficient (Φ : MatrixChannel α β) (a c : α) (b d : β) :
54    (∑ l, choiKraus Φ l b a * star (choiKraus Φ l d c)) =
55      Φ.toFun (Matrix.single a c 1) b d := by
56  have h : CFC.sqrt (choi Φ) * (CFC.sqrt (choi Φ)).conjTranspose = choi Φ := by
57    rw [sqrt_conjTranspose, sqrt_mul_self (choi_posSemidef Φ)]
58  exact congrArg (fun M => M (a, b) (c, d)) h
59 
60theorem channel_matrix_expansion (Φ : MatrixChannel α β) (X : Matrix α α ℂ) :
61    Φ.toFun X = ∑ a, ∑ c, X a c • Φ.toFun (Matrix.single a c 1) := by
62  have hX : X = ∑ a, ∑ c, X a c • (Matrix.single a c 1 : Matrix α α ℂ) := by
63    simpa only [Matrix.smul_single, smul_eq_mul, mul_one] using Matrix.matrix_eq_sum_single X
64  change (channelLinearMap Φ) X = _
65  conv_lhs => rw [hX]
66  simp only [map_sum, map_smul, channelLinearMap, LinearMap.coe_mk, AddHom.coe_mk]
67 
68/-- The canonical Kraus formula equals the given channel on every complex input. -/
69theorem choiKraus_apply (Φ : MatrixChannel α β) (X : Matrix α α ℂ) :
70    krausMap (choiKraus Φ) X = Φ.toFun X := by
71  rw [channel_matrix_expansion Φ X]
72  ext b d
73  simp only [krausMap, Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply,
74    Matrix.smul_apply, smul_eq_mul, Finset.sum_mul]
75  conv_rhs => rw [Finset.sum_comm]
76  rw [Finset.sum_comm]
77  apply Finset.sum_congr rfl
78  intro c _
79  rw [Finset.sum_comm]
80  apply Finset.sum_congr rfl
81  intro a _
82  rw [← choiKraus_coefficient Φ a c b d, Finset.mul_sum]
83  apply Finset.sum_congr rfl
84  intro l _
85  ring
86 
87/-- Trace preservation of the original channel proves Kraus normalization;
88the normalization is not a hypothesis on the construction. -/
89theorem choiKraus_complete (Φ : MatrixChannel α β) :
90    (∑ l, (choiKraus Φ l).conjTranspose * choiKraus Φ l) = 1 := by
91  ext a c
92  calc
93    (∑ l, (choiKraus Φ l).conjTranspose * choiKraus Φ l) a c =
94        ∑ b, Φ.toFun (Matrix.single c a 1) b b := by
95      simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply]
96      rw [Finset.sum_comm]
97      apply Finset.sum_congr rfl
98      intro b _
99      rw [← choiKraus_coefficient Φ c a b b]
100      apply Finset.sum_congr rfl
101      intro l _
102      exact mul_comm _ _
103    _ = Matrix.trace (Φ.toFun (Matrix.single c a 1)) := rfl
104    _ = Matrix.trace (Matrix.single c a 1) := Φ.trace_preserving _
105    _ = (1 : Matrix α α ℂ) a c := by
106      simp [Matrix.trace, Matrix.diag, Matrix.single_apply, Matrix.one_apply, ite_and]
107 
108open Cloning.InfiniteTraceClass Cloning.PCT Cloning.PCTPurificationChannel
109 
110/-- Every finite matrix CPTP map becomes a CPTP map of the actual Hilbert
111register trace-class spaces, without supplying any extra representation data. -/
112def registerChannel (Φ : MatrixChannel α β) : QuantumChannel (Register α) (Register β) :=
113  FiniteKrausLift.channel (choiKraus Φ) (choiKraus_complete Φ)
114 
115/-- Exact agreement on every matrix, including nonpositive off-diagonal inputs. -/
116theorem registerChannel_matrix (Φ : MatrixChannel α β) (X : Matrix α α ℂ) :
117    (registerChannel Φ).toLinearMap (registerLiftCLM X) = registerLiftCLM (Φ.toFun X) := by
118  rw [registerChannel, FiniteKrausLift.channel_registerLiftCLM, choiKraus_apply]
119 
120/-- Exact agreement also stated on all physical trace-class inputs. -/
121theorem registerChannel_apply (Φ : MatrixChannel α β) (T : TraceClass (Register α)) :
122    (registerChannel Φ).toLinearMap T = registerLiftCLM
123      (Φ.toFun (InfiniteFiniteCorner.matrixOf (registerBasis α) T.1)) := by
124  have hT : registerLiftCLM (InfiniteFiniteCorner.matrixOf (registerBasis α) T.1) = T := by
125    apply Subtype.ext
126    apply register_operator_ext
127    intro a b
128    rw [registerLiftCLM_coefficient]
129    simp [InfiniteFiniteCorner.matrixOf, registerBasis_apply, register_inner_single]
130  simpa only [hT] using registerChannel_matrix Φ
131    (InfiniteFiniteCorner.matrixOf (registerBasis α) T.1)
132 
133end Cloning.MatrixLiftedCPTP