Offline · exact source
Exact Lean source

PCTCountParameters

formalization/Cloning/PCTCountParameters.lean

Source hash: faddaf70b31f7b4e917d034f71b11c52d5d493ac049e9e5fcd3a0a56f5b02278

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.CountMultinomialLimit
2import Cloning.PCTPhysicalState
3import Cloning.PCTTangentChartFrame
4import Cloning.PCTJointGaussianChart
5 
6/-! Actual computational probabilities of the PCT Gaussian product particles. -/
7noncomputable section
8open scoped BigOperators Topology Classical Matrix ComplexOrder InnerProductSpace
9open Filter MeasureTheory
10namespace Cloning.PCTCount
11open Cloning.PCT Cloning.PCTReducedGaussian Cloning.PCTPhysicalState Cloning.PCTLocalChart
12open Cloning.PCTGaussianCovariance Cloning.PCTJointGaussianLaw Cloning.PCTJointGaussianWhitening
13open Cloning.YoungGeneral Cloning.YoungHyperplane
14set_option backward.isDefEq.respectTransparency false
15set_option maxHeartbeats 1400000
16variable {d s : ℕ}
17 
18def particleProbability
19    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
20    (z : Fin s → ℂ) (L : ℕ) (i : Fin (d+1)) : ℝ :=
21  (reducedDensityMatrix (frameParticle u z L) i i).re
22 
23theorem particleProbability_nonneg
24    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
25    (z : Fin s → ℂ) (L : ℕ) (i : Fin (d+1)) : 0≤particleProbability u z L i :=
26  (Complex.nonneg_iff.mp ((reducedDensityMatrix_posSemidef (frameParticle u z L)).diag_nonneg (i := i))).1
27 
28theorem particleProbability_sum
29    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
30    (z : Fin s → ℂ) (L : ℕ) : ∑ i, particleProbability u z L i=1 := by
31  have hh := congrArg Complex.re (trace_reducedDensityMatrix_complex (frameParticle u z L))
32  simpa only [Matrix.trace, Matrix.diag, Complex.re_sum, frameParticle_norm u.orthonormal z L,
33    one_pow, Complex.one_re] using hh
34 
35def tangentScore
36    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
37    (p : Fin (d+1) → ℝ) (hu : u 0=coefficientVector (schmidtCoefficients p))
38    (z : Fin s → ℂ) : rootSpace d :=
39  ⟨WithLp.toLp 2 (tangentClassical u p z), tangentClassical_sum_zero u p hu z⟩
40 
41theorem particleProbability_exact
42    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
43    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0≤p i)
44    (hu : u 0=coefficientVector (schmidtCoefficients p))
45    (z : Fin s → ℂ) (L : ℕ) (i : Fin (d+1)) :
46    particleProbability u z L i=
47      (p i+sampleScale L*tangentClassical u p z i+
48        sampleScale L^2*(((frameTangentMatrix u z)*(frameTangentMatrix u z)ᴴ) i i).re)/
49        (1+sampleScale L^2*‖coefficientVector (frameTangentMatrix u z)‖^2) := by
50  unfold particleProbability
51  rw [← normalizedTangentVector_eq_frameParticle u p hu z L,
52    normalizedTangent_reduced_exact p hp _ _ (sq_nonneg _) (sampleScale L)]
53  simp only [Matrix.smul_apply, Matrix.add_apply, Matrix.diagonal_apply_eq,
54    partialTraceDifferential_diagonal, Complex.add_re, Complex.smul_re,
55    Complex.ofReal_re, tangentClassical, classicalCoordinate, smul_eq_mul]
56  ring
57 
58theorem particleProbability_tendsto
59    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
60    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0≤p i)
61    (hu : u 0=coefficientVector (schmidtCoefficients p))
62    (z : Fin s → ℂ) (i : Fin (d+1)) :
63    Tendsto (fun L ↦ particleProbability u z L i) atTop (𝓝 (p i)) := by
64  simp_rw [particleProbability_exact u p hp hu z]
65  have hh := (((tendsto_const_nhds (x := p i)).add (sampleScale_tendsto.mul_const (tangentClassical u p z i))).add
66    ((sampleScale_tendsto.pow 2).mul_const (((frameTangentMatrix u z)*(frameTangentMatrix u z)ᴴ) i i).re)).div
67      ((tendsto_const_nhds (x := (1:ℝ))).add ((sampleScale_tendsto.pow 2).mul_const
68        (‖coefficientVector (frameTangentMatrix u z)‖^2))) (by norm_num)
69  simpa using hh
70 
71private theorem scaled_rational_difference (t a p b e v : ℝ)
72    (ht : a*t=1) (hd : 1+t^2*e≠0) :
73    a*((p+t*v+t^2*b)/(1+t^2*e)-p)=(v+t*(b-p*e))/(1+t^2*e) := by
74  calc
75    _ = (a*t)*(v+t*(b-p*e))/(1+t^2*e) := by field_simp; ring
76    _ = _ := by rw [ht, one_mul]
77 
78theorem particleProbability_scaled_tendsto
79    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
80    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0≤p i)
81    (hu : u 0=coefficientVector (schmidtCoefficients p))
82    (z : Fin s → ℂ) (i : Fin (d+1)) :
83    Tendsto (fun L : ℕ ↦ Real.sqrt (L : ℝ)*(particleProbability u z L i-p i)) atTop
84      (𝓝 (tangentClassical u p z i)) := by
85  have hh := ((tendsto_const_nhds (x := tangentClassical u p z i)).add (sampleScale_tendsto.mul_const
86    ((((frameTangentMatrix u z)*(frameTangentMatrix u z)ᴴ) i i).re-
87      p i*‖coefficientVector (frameTangentMatrix u z)‖^2))).div
88    ((tendsto_const_nhds (x := (1:ℝ))).add ((sampleScale_tendsto.pow 2).mul_const
89      (‖coefficientVector (frameTangentMatrix u z)‖^2))) (by norm_num)
90  simp only [zero_mul, zero_pow (by omega : 2≠0), add_zero, div_one] at hh
91  apply hh.congr'
92  filter_upwards [eventually_gt_atTop 0] with L hL
93  rw [particleProbability_exact u p hp hu z]
94  symm
95  apply scaled_rational_difference
96  · rw [sampleScale, mul_inv_cancel₀ (by positivity : Real.sqrt (L : ℝ)≠0)]
97  · positivity
98 
99/-- Conditional on the actual purification Gaussian tangent, count smoothing
100converges in L¹ to the Gaussian translated by its literal diagonal score. -/
101theorem conditional_count_density_l1_tendsto
102    (u : OrthonormalBasis (Fin (s+1)) ℂ (Register (Fin (d+1) × Fin (d+1))))
103    (hu : u 0=coefficientVector (schmidtCoefficients (flatSpectrum (d+1))))
104    (z : Fin s → ℂ) (n : ℕ → ℕ) (hn : Tendsto n atTop atTop) :
105    Tendsto (fun k ↦ ∫ x, |CountMultinomial.density d (n k) (particleProbability u z (n k))
106      (particleProbability_nonneg u z (n k)) (particleProbability_sum u z (n k)) x-
107        CountMultinomial.shiftedGaussian d (tangentScore u (flatSpectrum (d+1)) hu z) x|)
108      atTop (𝓝 0) := by
109  apply CountMultinomial.density_l1_tendsto d n hn
110    (fun k ↦ particleProbability u z (n k)) (fun k ↦ particleProbability_nonneg u z (n k))
111    (fun k ↦ particleProbability_sum u z (n k))
112  · intro i
113    exact (particleProbability_tendsto u (flatSpectrum (d+1))
114      (fun _ ↦ by unfold flatSpectrum; positivity) hu z i).comp hn
115  · intro i
116    exact (particleProbability_scaled_tendsto u (flatSpectrum (d+1))
117      (fun _ ↦ by unfold flatSpectrum; positivity) hu z i).comp hn
118 
119end Cloning.PCTCount