Exact Lean source
MatrixLiftedCPTP
formalization/Cloning/MatrixLiftedCPTP.lean
Source hash: 13ad66739daef6e0569568eaa616b7a15570e8ae0a50882ad76fcdd80570b4f9
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
definition
Cloning.MatrixLiftedCPTP.inputReductiontheorem Cloning.MatrixLiftedCPTP.inputReduction_addtheorem Cloning.MatrixLiftedCPTP.inputReduction_smultheorem Cloning.MatrixLiftedCPTP.inputReduction_trace_sumtheorem Cloning.MatrixLiftedCPTP.inputReduction_completely_positivedefinition Cloning.MatrixLiftedCPTP.outputBlocktheorem Cloning.MatrixLiftedCPTP.outputBlock_addtheorem Cloning.MatrixLiftedCPTP.outputBlock_smultheorem Cloning.MatrixLiftedCPTP.outputBlock_tracetheorem Cloning.MatrixLiftedCPTP.outputBlock_completely_positivedefinition Cloning.MatrixLiftedCPTP.channelMaptheorem Cloning.MatrixLiftedCPTP.channelMap_addtheorem Cloning.MatrixLiftedCPTP.channelMap_smultheorem Cloning.MatrixLiftedCPTP.channelMap_tracetheorem Cloning.MatrixLiftedCPTP.channelMap_completely_positivedefinition Cloning.MatrixLiftedCPTP.channel1import Cloning.MatrixLiftedChannel
2
3/-!
4# A genuine channel for finite sector transitions
5
6The map is defined on every complex matrix. It measures the sector, discards
7its input multiplicity, applies an arbitrary completely positive sector map,
8samples the output sector, and prepares the normalized output multiplicity.
9Complete positivity is proved at every ancilla dimension directly from that
10of the sector maps; no Kraus representation hypothesis is imposed.
11-/
12
13noncomputable section
14open scoped BigOperators Matrix MatrixOrder ComplexOrder Kronecker
15open Matrix Cloning.Channels Cloning.MatrixFidelity
16
17namespace Cloning.MatrixLiftedCPTP
18
19set_option backward.isDefEq.respectTransparency false
20set_option maxHeartbeats 400000
21set_option linter.unusedSectionVars false
22
23variable {μ ν : Type*} [Fintype μ] [Fintype ν] [DecidableEq μ] [DecidableEq ν]
24variable {α χ : μ → Type*} {β κ : ν → Type*}
25variable [∀ i, Fintype (α i)] [∀ i, Fintype (χ i)]
26variable [∀ j, Fintype (β j)] [∀ j, Fintype (κ j)]
27variable [∀ i, DecidableEq (α i)] [∀ i, DecidableEq (χ i)]
28variable [∀ j, DecidableEq (β j)] [∀ j, DecidableEq (κ j)]
29
30/-- The unnormalized conditional input, after discarding multiplicity. -/
31def inputReduction (i : μ) (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
32 Matrix (α i) (α i) ℂ :=
33 ∑ t : χ i, X.submatrix (fun a => ⟨i, (a, t)⟩) (fun a => ⟨i, (a, t)⟩)
34
35theorem inputReduction_add (i : μ)
36 (X Y : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
37 inputReduction i (X + Y) = inputReduction i X + inputReduction i Y := by
38 ext a b
39 simp [inputReduction, Matrix.sum_apply, Finset.sum_add_distrib]
40
41theorem inputReduction_smul (i : μ) (c : ℂ)
42 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
43 inputReduction i (c • X) = c • inputReduction i X := by
44 ext a b
45 simp [inputReduction, Matrix.sum_apply, Finset.mul_sum]
46
47theorem inputReduction_trace_sum
48 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
49 (∑ i, Matrix.trace (inputReduction i X)) = Matrix.trace X := by
50 simp [inputReduction, Matrix.trace, Matrix.diag, Matrix.sum_apply,
51 Fintype.sum_sigma, Fintype.sum_prod_type]
52
53theorem inputReduction_completely_positive (i : μ) (k : ℕ)
54 (X : Matrix (Fin k × (Σ i, α i × χ i)) (Fin k × (Σ i, α i × χ i)) ℂ)
55 (hX : X.PosSemidef) : (amplify (inputReduction i) X).PosSemidef := by
56 have heq : amplify (inputReduction i) X =
57 ∑ t : χ i, X.submatrix (fun a : Fin k × α i => (a.1, ⟨i, (a.2, t)⟩))
58 (fun a : Fin k × α i => (a.1, ⟨i, (a.2, t)⟩)) := by
59 ext a b
60 simp [amplify, inputReduction, Matrix.sum_apply]
61 rw [heq]
62 exact Matrix.posSemidef_sum _ (fun t _ => hX.submatrix _)
63
64/-- The unnormalized output block, for arbitrary complex inputs. -/
65def outputBlock (Φ : ∀ i j, MatrixChannel (α i) (β j)) (K : μ → ν → ℝ)
66 (j : ν) (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
67 Matrix (β j) (β j) ℂ :=
68 ∑ i, K i j • (Φ i j).toFun (inputReduction i X)
69
70theorem outputBlock_add (Φ : ∀ i j, MatrixChannel (α i) (β j))
71 (K : μ → ν → ℝ) (j : ν)
72 (X Y : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
73 outputBlock Φ K j (X + Y) = outputBlock Φ K j X + outputBlock Φ K j Y := by
74 simp [outputBlock, inputReduction_add, MatrixChannel.map_add, smul_add,
75 Finset.sum_add_distrib]
76
77theorem outputBlock_smul (Φ : ∀ i j, MatrixChannel (α i) (β j))
78 (K : μ → ν → ℝ) (j : ν) (c : ℂ)
79 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
80 outputBlock Φ K j (c • X) = c • outputBlock Φ K j X := by
81 simp [outputBlock, inputReduction_smul, MatrixChannel.map_smul,
82 smul_comm (K _ _) c, Finset.smul_sum]
83
84theorem outputBlock_trace (Φ : ∀ i j, MatrixChannel (α i) (β j))
85 (K : μ → ν → ℝ) (j : ν)
86 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
87 Matrix.trace (outputBlock Φ K j X) =
88 ∑ i, (K i j : ℂ) * Matrix.trace (inputReduction i X) := by
89 simp [outputBlock, Matrix.trace_sum, MatrixChannel.trace_preserving,
90 Complex.real_smul]
91
92theorem outputBlock_completely_positive (Φ : ∀ i j, MatrixChannel (α i) (β j))
93 (K : μ → ν → ℝ) (hK : ∀ i j, 0 ≤ K i j) (j : ν) (k : ℕ)
94 (X : Matrix (Fin k × (Σ i, α i × χ i)) (Fin k × (Σ i, α i × χ i)) ℂ)
95 (hX : X.PosSemidef) : (amplify (outputBlock Φ K j) X).PosSemidef := by
96 have heq : amplify (outputBlock Φ K j) X =
97 ∑ i, K i j • amplify (Φ i j).toFun (amplify (inputReduction i) X) := by
98 ext a b
99 simp [amplify, outputBlock, Matrix.sum_apply]
100 rw [heq]
101 apply Matrix.posSemidef_sum
102 intro i _
103 exact ((Φ i j).completely_positive k _
104 (inputReduction_completely_positive i k X hX)).smul (hK i j)
105
106/-- Measure, discard, transition, and prepare, on the full matrix algebra. -/
107def channelMap (Φ : ∀ i j, MatrixChannel (α i) (β j))
108 (K : μ → ν → ℝ) (τ : ∀ j, State (κ j))
109 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
110 Matrix (Σ j, β j × κ j) (Σ j, β j × κ j) ℂ :=
111 Matrix.blockDiagonal' (fun j => outputBlock Φ K j X ⊗ₖ (τ j).matrix)
112
113theorem channelMap_add (Φ : ∀ i j, MatrixChannel (α i) (β j))
114 (K : μ → ν → ℝ) (τ : ∀ j, State (κ j))
115 (X Y : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
116 channelMap Φ K τ (X + Y) = channelMap Φ K τ X + channelMap Φ K τ Y := by
117 simp only [channelMap, outputBlock_add, Matrix.add_kronecker]
118 exact Matrix.blockDiagonal'_add _ _
119
120theorem channelMap_smul (Φ : ∀ i j, MatrixChannel (α i) (β j))
121 (K : μ → ν → ℝ) (τ : ∀ j, State (κ j)) (c : ℂ)
122 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
123 channelMap Φ K τ (c • X) = c • channelMap Φ K τ X := by
124 simp only [channelMap, outputBlock_smul, Matrix.smul_kronecker]
125 exact Matrix.blockDiagonal'_smul c (fun j => outputBlock Φ K j X ⊗ₖ (τ j).matrix)
126
127theorem channelMap_trace (Φ : ∀ i j, MatrixChannel (α i) (β j))
128 (K : μ → ν → ℝ) (hKsum : ∀ i, ∑ j, K i j = 1) (τ : ∀ j, State (κ j))
129 (X : Matrix (Σ i, α i × χ i) (Σ i, α i × χ i) ℂ) :
130 Matrix.trace (channelMap Φ K τ X) = Matrix.trace X := by
131 simp only [channelMap, Matrix.trace_blockDiagonal', Matrix.trace_kronecker,
132 State.trace_one, mul_one, outputBlock_trace]
133 rw [Finset.sum_comm]
134 simp_rw [← Finset.sum_mul, ← Complex.ofReal_sum, hKsum, Complex.ofReal_one, one_mul]
135 exact inputReduction_trace_sum X
136
137theorem channelMap_completely_positive (Φ : ∀ i j, MatrixChannel (α i) (β j))
138 (K : μ → ν → ℝ) (hK : ∀ i j, 0 ≤ K i j) (τ : ∀ j, State (κ j)) (k : ℕ)
139 (X : Matrix (Fin k × (Σ i, α i × χ i)) (Fin k × (Σ i, α i × χ i)) ℂ)
140 (hX : X.PosSemidef) : (amplify (channelMap Φ K τ) X).PosSemidef := by
141 let B : ∀ j, Matrix (Fin k × (β j × κ j)) (Fin k × (β j × κ j)) ℂ :=
142 fun j => ((amplify (outputBlock Φ K j) X) ⊗ₖ (τ j).matrix).submatrix
143 (fun a => ((a.1, a.2.1), a.2.2)) (fun a => ((a.1, a.2.1), a.2.2))
144 have hB : ∀ j, (B j).PosSemidef := fun j =>
145 ((outputBlock_completely_positive Φ K hK j k X hX).kronecker
146 (τ j).positive).submatrix _
147 have hd := (blockDiagonal'_posSemidef B hB).submatrix
148 (fun a : Fin k × (Σ j, β j × κ j) => ⟨a.2.1, (a.1, a.2.2)⟩)
149 convert hd using 1
150 ext ⟨a, j, b, t⟩ ⟨a', j', b', t'⟩
151 by_cases hj : j = j'
152 · subst j'
153 simp [channelMap, amplify, B, Matrix.kroneckerMap_apply]
154 · simp [channelMap, amplify, B, Matrix.blockDiagonal'_apply_ne, hj]
155
156/-- The sector construction is a genuine CPTP map for arbitrary sector
157channels and stochastic kernel, with no assumptions on its input matrix. -/
158def channel (Φ : ∀ i j, MatrixChannel (α i) (β j))
159 (K : μ → ν → ℝ) (hK : ∀ i j, 0 ≤ K i j)
160 (hKsum : ∀ i, ∑ j, K i j = 1) (τ : ∀ j, State (κ j)) :
161 MatrixChannel (Σ i, α i × χ i) (Σ j, β j × κ j) where
162 toFun := channelMap Φ K τ
163 map_add := channelMap_add Φ K τ
164 map_smul := channelMap_smul Φ K τ
165 trace_preserving := channelMap_trace Φ K hKsum τ
166 completely_positive := channelMap_completely_positive Φ K hK τ
167
168end Cloning.MatrixLiftedCPTP