Offline · exact source
Exact Lean source

PCTGaussianCovarianceClassical

formalization/Cloning/PCTGaussianCovarianceClassical.lean

Source hash: d0d624989bcdc6b99274f2d64da9cf2fc031771ecdc5cfb29f0001264f551736

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.PCTGaussianCovariance
2 
3/-! The classical marginal of the actual purification tangent Gaussian has
4covariance `2 v (diag p - p pᵀ)`, proved by its characteristic function. -/
5noncomputable section
6open MeasureTheory
7open scoped ComplexOrder InnerProductSpace Topology BigOperators
8namespace Cloning.PCTGaussianCovariance
9open Cloning.PCT Cloning.PCTReducedGaussian Cloning.MultimodeCoherentGaussianMixture
10set_option backward.isDefEq.respectTransparency false
11set_option maxHeartbeats 1000000
12variable {A : Type*} [Fintype A] [DecidableEq A] {s : ℕ}
13 
14lemma coefficientVector_inner (M N : Matrix A A ℂ) :
15    ⟪coefficientVector M, coefficientVector N⟫_ℂ =
16      ∑ a, ∑ b, star (M a b) * N a b := by
17  simp [lp.inner_eq_tsum, tsum_fintype, Fintype.sum_prod_type, coefficientVector,
18    RCLike.inner_apply, mul_comm]
19 
20/-- Classical score coordinate of the literal reduced-state differential. -/
21def classicalCoordinate (p : A → ℝ) (Z : Matrix A A ℂ) (a : A) : ℝ :=
22  2 * Real.sqrt (p a) * (Z a a).re
23 
24lemma classicalCoordinate_sum_zero (p : A → ℝ) (Z : Matrix A A ℂ)
25    (horth : ⟪coefficientVector (schmidtCoefficients p), coefficientVector Z⟫_ℂ = 0) :
26    ∑ a, classicalCoordinate p Z a = 0 := by
27  have h := congrArg Complex.re (partialTraceDifferential_trace_zero p Z horth)
28  simpa [Matrix.trace, Matrix.diag, partialTraceDifferential_diagonal, classicalCoordinate] using h
29 
30/-- The imaginary diagonal test matrix representing a classical Fourier test. -/
31def classicalTest (p t : A → ℝ) : Matrix A A ℂ :=
32  Matrix.diagonal (fun a => -Complex.I * (Real.sqrt (p a) : ℂ) * (t a : ℂ))
33 
34lemma classicalTest_phase (p t : A → ℝ) (Z : Matrix A A ℂ) :
35    ⟪coefficientVector (classicalTest p t), coefficientVector Z⟫_ℂ -
36      ⟪coefficientVector Z, coefficientVector (classicalTest p t)⟫_ℂ =
37        Complex.I * ((∑ a, t a * classicalCoordinate p Z a : ℝ) : ℂ) := by
38  simp only [coefficientVector_inner, classicalTest, Matrix.diagonal_apply]
39  simp only [apply_ite, star_zero, zero_mul, mul_zero, Finset.sum_ite_eq',
40    Finset.mem_univ, if_true]
41  rw [← Finset.sum_sub_distrib, Complex.ofReal_sum, Finset.mul_sum]
42  apply Finset.sum_congr rfl
43  intro a _
44  apply Complex.ext <;> simp [classicalCoordinate, Complex.mul_re, Complex.mul_im] <;> ring
45 
46lemma classicalTest_norm_sq (p t : A → ℝ) (hp : ∀ a, 0 ≤ p a) :
47    ‖coefficientVector (classicalTest p t)‖ ^ 2 = ∑ a, p a * (t a) ^ 2 := by
48  rw [coefficientVector_norm_sq]
49  simp only [classicalTest, Matrix.diagonal_apply, apply_ite, norm_zero, zero_pow (by omega : 2 ≠ 0),
50    ite_pow, Finset.sum_ite_eq', Finset.mem_univ, if_true]
51  apply Finset.sum_congr rfl
52  intro a _
53  simp only [norm_mul, norm_neg, Complex.norm_I, one_mul, Complex.norm_real,
54    Real.norm_eq_abs, mul_pow, sq_abs, Real.sq_sqrt (hp a)]
55  simp
56 
57lemma classicalTest_reference_sq (p t : A → ℝ) (hp : ∀ a, 0 ≤ p a) :
58    ‖⟪coefficientVector (schmidtCoefficients p), coefficientVector (classicalTest p t)⟫_ℂ‖ ^ 2 =
59      (∑ a, p a * t a) ^ 2 := by
60  rw [schmidt_inner_tangent]
61  have he : (∑ a, (Real.sqrt (p a) : ℂ) * classicalTest p t a a) =
62      -Complex.I * ((∑ a, p a * t a : ℝ) : ℂ) := by
63    simp only [classicalTest, Matrix.diagonal_apply_eq, Complex.ofReal_sum, Finset.mul_sum]
64    apply Finset.sum_congr rfl
65    intro a _
66    have hs : (Real.sqrt (p a) : ℂ) ^ 2 = (p a : ℂ) := by
67      exact_mod_cast Real.sq_sqrt (hp a)
68    push_cast
69    linear_combination -Complex.I * (t a : ℂ) * hs
70  rw [he]
71  simp only [norm_mul, norm_neg, Complex.norm_I, one_mul, Complex.norm_real,
72    Real.norm_eq_abs, sq_abs]
73 
74/-- Joint classical characteristic. Its exponent is exactly minus `v` times
75the multinomial quadratic form, hence covariance `2 v Σp`. -/
76theorem classicalCoordinate_characteristic
77    (u : OrthonormalBasis (Fin (s + 1)) ℂ (Register (A × A)))
78    (p : A → ℝ) (hp : ∀ a, 0 ≤ p a)
79    (hu : u 0 = coefficientVector (schmidtCoefficients p))
80    {v : ℝ} (hv : 0 < v) (t : A → ℝ) :
81    (∫ z, Complex.exp (Complex.I * ((∑ a,
82      t a * classicalCoordinate p (frameTangentMatrix u z) a : ℝ) : ℂ))
83      ∂gaussianProductMeasure (fun _ : Fin s => v)) =
84      Complex.exp (-((v * ((∑ a, p a * (t a) ^ 2) - (∑ a, p a * t a) ^ 2) : ℝ) : ℂ)) := by
85  simp_rw [← classicalTest_phase, coefficientVector_frameTangentMatrix]
86  rw [frameTangent_characteristic u hv, hu, classicalTest_norm_sq p t hp,
87    classicalTest_reference_sq p t hp]
88 
89end Cloning.PCTGaussianCovariance