Offline · exact source
Exact Lean source

PCTPurityFidelityMixture

formalization/Cloning/PCTPurityFidelityMixture.lean

Source hash: 4bef1b2b9e0545fa3d2ee43c9c54fe10c8345418cc49598cb4de50a9de3e64a9

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.PCTPhysicalState
2import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap
3 
4/-! Exact coefficient-integral formulas for the purity of tensor mixtures.
5These finite identities hold before any limiting estimate. -/
6noncomputable section
7open scoped BigOperators Matrix InnerProductSpace ComplexOrder
8open MeasureTheory
9namespace Cloning.PCTPurity
10open Cloning.PCTPurificationChannel Cloning.PCTPhysicalState
11set_option backward.isDefEq.respectTransparency false
12set_option maxHeartbeats 600000
13variable {X ι : Type*} [MeasurableSpace X] [Fintype ι] [DecidableEq ι]
14 
15def matrixMixture (μ : Measure X) (M : X→Matrix ι ι ℂ) : Matrix ι ι ℂ :=
16  fun i j => ∫ z,M z i j ∂μ
17 
18theorem integrable_trace_mul_left (μ : Measure X) (M : X→Matrix ι ι ℂ)
19    (hM : ∀i j,Integrable (fun z => M z i j) μ) (B : Matrix ι ι ℂ) :
20    Integrable (fun z => Matrix.trace (B*M z)) μ := by
21  simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply]
22  exact integrable_finset_sum _ (fun i _ => integrable_finset_sum _
23    (fun j _ => (hM j i).const_mul (B i j)))
24 
25theorem integrable_trace_mul_right (μ : Measure X) (M : X→Matrix ι ι ℂ)
26    (hM : ∀i j,Integrable (fun z => M z i j) μ) (B : Matrix ι ι ℂ) :
27    Integrable (fun z => Matrix.trace (M z*B)) μ := by
28  simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply]
29  exact integrable_finset_sum _ (fun i _ => integrable_finset_sum _
30    (fun j _ => (hM i j).mul_const (B j i)))
31 
32theorem trace_mul_matrixMixture_left (μ : Measure X) (M : X→Matrix ι ι ℂ)
33    (hM : ∀i j,Integrable (fun z => M z i j) μ) (B : Matrix ι ι ℂ) :
34    Matrix.trace (B*matrixMixture μ M)=∫ z,Matrix.trace (B*M z) ∂μ := by
35  simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,matrixMixture]
36  rw [integral_finset_sum _ (fun i _ => integrable_finset_sum _
37    (fun j _ => (hM j i).const_mul (B i j)))]
38  apply Finset.sum_congr rfl
39  intro i hi
40  rw [integral_finset_sum _ (fun j _ => (hM j i).const_mul (B i j))]
41  simp only [integral_const_mul]
42 
43theorem trace_mul_matrixMixture_right (μ : Measure X) (M : X→Matrix ι ι ℂ)
44    (hM : ∀i j,Integrable (fun z => M z i j) μ) (B : Matrix ι ι ℂ) :
45    Matrix.trace (matrixMixture μ M*B)=∫ z,Matrix.trace (M z*B) ∂μ := by
46  simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,matrixMixture]
47  rw [integral_finset_sum _ (fun i _ => integrable_finset_sum _
48    (fun j _ => (hM i j).mul_const (B j i)))]
49  apply Finset.sum_congr rfl
50  intro i hi
51  rw [integral_finset_sum _ (fun j _ => (hM i j).mul_const (B j i))]
52  simp only [integral_mul_const]
53 
54theorem matrixMixture_purity (μ : Measure X) (M : X→Matrix ι ι ℂ)
55    (hM : ∀i j,Integrable (fun z => M z i j) μ) :
56    Matrix.trace (matrixMixture μ M*matrixMixture μ M)=
57      ∫ z,∫ w,Matrix.trace (M z*M w) ∂μ ∂μ := by
58  rw [trace_mul_matrixMixture_right μ M hM]
59  exact integral_congr_ae (Filter.Eventually.of_forall (fun z => trace_mul_matrixMixture_left μ M hM (M z)))
60 
61theorem matrixMixture_purity_re (μ : Measure X) (M : X→Matrix ι ι ℂ)
62    (hM : ∀i j,Integrable (fun z => M z i j) μ) :
63    (Matrix.trace (matrixMixture μ M*matrixMixture μ M)).re=
64      ∫ z,∫ w,(Matrix.trace (M z*M w)).re ∂μ ∂μ := by
65  have hi : Integrable (fun z => ∫ w,Matrix.trace (M z*M w) ∂μ) μ := by
66    simp_rw [←trace_mul_matrixMixture_left μ M hM]
67    exact integrable_trace_mul_right μ M hM _
68  rw [matrixMixture_purity μ M hM]
69  have hre : (∫ z,∫ w,Matrix.trace (M z*M w) ∂μ ∂μ).re=
70      ∫ z,(∫ w,Matrix.trace (M z*M w) ∂μ).re ∂μ :=
71    (Complex.reCLM.integral_comp_comm hi).symm
72  rw [hre]
73  apply integral_congr_ae
74  filter_upwards [] with z
75  exact (Complex.reCLM.integral_comp_comm (integrable_trace_mul_left μ M hM (M z))).symm
76 
77variable {A : Type*} [Fintype A] [DecidableEq A] [Nonempty A]
78 
79def tensorMixtureMatrix (μ : Measure X) (ρ : X→Matrix A A ℂ) (L : ℕ) :
80    Matrix (Fin L→A) (Fin L→A) ℂ := matrixMixture μ (fun z => tensorPower L (ρ z))
81 
82theorem tensorMixtureMatrix_purity (μ : Measure X) (ρ : X→Matrix A A ℂ) (L : ℕ)
83    (hρ : ∀i j,Integrable (fun z => tensorPower L (ρ z) i j) μ) :
84    Matrix.trace (tensorMixtureMatrix μ ρ L*tensorMixtureMatrix μ ρ L)=
85      ∫ z,∫ w,(Matrix.trace (ρ z*ρ w))^L ∂μ ∂μ := by
86  rw [tensorMixtureMatrix,matrixMixture_purity μ _ hρ]
87  simp only [←tensorPower_mul,trace_tensorPower]
88 
89theorem tensorMixtureMatrix_purity_re (μ : Measure X) (ρ : X→Matrix A A ℂ) (L : ℕ)
90    (hρ : ∀i j,Integrable (fun z => tensorPower L (ρ z) i j) μ)
91    (hreal : ∀z w,(Matrix.trace (ρ z*ρ w)).im=0) :
92    (Matrix.trace (tensorMixtureMatrix μ ρ L*tensorMixtureMatrix μ ρ L)).re=
93      ∫ z,∫ w,((Matrix.trace (ρ z*ρ w)).re)^L ∂μ ∂μ := by
94  rw [tensorMixtureMatrix,matrixMixture_purity_re μ _ hρ]
95  simp only [←tensorPower_mul,trace_tensorPower]
96  apply integral_congr_ae
97  filter_upwards [] with z
98  apply integral_congr_ae
99  filter_upwards [] with w
100  have he : Matrix.trace (ρ z*ρ w)=((Matrix.trace (ρ z*ρ w)).re : ℂ) := by
101    exact Complex.ext rfl (by simpa using hreal z w)
102  rw [he,←Complex.ofReal_pow,Complex.ofReal_re]
103  simp only [Complex.ofReal_re]
104 
105end Cloning.PCTPurity