Offline · exact source
Exact Lean source

PCTCountMeasurementSmoothing

formalization/Cloning/PCTCountMeasurementSmoothing.lean

Source hash: 4da0471c99753e44d9bb160e4349da4c305a4b1dea565f61e4875c2a3360c234

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.PCTCountMeasurementImage
2import Cloning.PCTCountMeasurementTensor
3import Cloning.CountMultinomialMeasurability
4 
5/-! Exact cell smoothing of the physical computational count measurement.
6Quantum fidelity and trace distance transfer to the measured densities. -/
7noncomputable section
8open scoped BigOperators InnerProductSpace ComplexOrder Classical
9open MeasureTheory
10namespace Cloning.PCTCountMeasurement
11open Cloning.PCT TensorLie Cloning.GeneralSymmetricOccupation
12open Cloning.InfiniteTraceClass Cloning.InfiniteFiniteCorner Cloning.Hybrid
13open Cloning.YoungGeneral Cloning.YoungHyperplane Cloning.CountMultinomial
14set_option backward.isDefEq.respectTransparency false
15set_option maxHeartbeats 1000000
16 
17def latticeWordLabel (d N : ℕ) (w : Word N (d+1)) : Lattice d (N : ℤ) :=
18  shapeLattice d N (countShape w)
19 
20def latticeWeight (d N : ℕ) (A : TraceClass (TensorRegister N (Fin (d+1)))) :
21    Lattice d (N : ℤ) → ℝ := fun μ => weightCLM (registerBasis (Word N (d+1))) (latticeWordLabel d N) μ A
22 
23def measuredDensity (d N : ℕ) (A : TraceClass (TensorRegister N (Fin (d+1)))) : rootSpace d → ℝ :=
24  sampleInterpolate d N (flatSpectrum (d+1)) (latticeWeight d N A)
25 
26def densityCLM (d N : ℕ) (x : rootSpace d) : TraceClass (TensorRegister N (Fin (d+1))) →L[ℝ] ℝ :=
27  (Real.sqrt (N : ℝ)^d/Real.sqrt ((d : ℝ)+1)) •
28    weightCLM (registerBasis (Word N (d+1))) (latticeWordLabel d N)
29      (sampleLabel d N (flatSpectrum (d+1)) x)
30 
31theorem measuredDensity_eq_clm (d N : ℕ) (hN : 0<N)
32    (A : TraceClass (TensorRegister N (Fin (d+1)))) (x : rootSpace d) :
33    measuredDensity d N A x=densityCLM d N x A := by
34  rw [measuredDensity, sampleInterpolate_eq_on_cell d N (by exact_mod_cast hN) _ _ _ x
35    (mem_sampleCell_sampleLabel d N (flatSpectrum (d+1)) x)]
36  simp only [latticeWeight, densityCLM, ContinuousLinearMap.smul_apply, smul_eq_mul]
37  norm_cast
38 
39theorem latticeWeight_summable (d N : ℕ) (A : TraceClass (TensorRegister N (Fin (d+1)))) :
40    Summable (latticeWeight d N A) := weightCLM_summable _ _ _
41 
42theorem latticeWeight_nonneg (d N : ℕ) (A : TraceClass (TensorRegister N (Fin (d+1))))
43    (hA : 0≤A.1) (μ : Lattice d (N : ℤ)) : 0≤latticeWeight d N A μ :=
44  weightCLM_nonneg_any _ _ _ hA μ
45 
46theorem measuredDensity_nonneg (d N : ℕ) (hN : 0<N)
47    (A : TraceClass (TensorRegister N (Fin (d+1)))) (hA : 0≤A.1) (x : rootSpace d) :
48    0≤measuredDensity d N A x := by
49  rw [measuredDensity_eq_clm d N hN]
50  change 0≤(Real.sqrt (N : ℝ)^d/Real.sqrt ((d : ℝ)+1))*_
51  exact mul_nonneg (by positivity) (latticeWeight_nonneg d N A hA _)
52 
53theorem integral_measuredDensity (d N : ℕ) (hN : 0<N)
54    (A : TraceClass (TensorRegister N (Fin (d+1)))) :
55    (∫ x, measuredDensity d N A x)=(traceCLM A).re := by
56  rw [measuredDensity, sampleInterpolate_integral d N (by exact_mod_cast hN) _ _
57    (latticeWeight_summable d N A)]
58  simpa only [latticeWeight, HilbertBasis.coe_toOrthonormalBasis] using
59    weightCLM_tsum (registerBasis (Word N (d+1))).toOrthonormalBasis (latticeWordLabel d N) A
60 
61theorem measuredDensity_l1_contraction (d N : ℕ) (hN : 0<N)
62    (A B : TraceClass (TensorRegister N (Fin (d+1)))) (hA : 0≤A.1) (hB : 0≤B.1) :
63    (∫ x, |measuredDensity d N A x-measuredDensity d N B x|)≤‖A-B‖ := by
64  rw [measuredDensity, measuredDensity, sampleInterpolate_l1_isometry d N
65    (by exact_mod_cast hN) _ _ _ (latticeWeight_summable d N A) (latticeWeight_summable d N B)]
66  simpa only [latticeWeight, HilbertBasis.coe_toOrthonormalBasis] using
67    weightCLM_tsum_l1_contraction (registerBasis (Word N (d+1))).toOrthonormalBasis
68      (latticeWordLabel d N) A B hA hB
69 
70theorem rootFidelity_le_measuredDensity_affinity (d N : ℕ) (hN : 0<N)
71    (A B : PositiveTraceClass (TensorRegister N (Fin (d+1)))) :
72    A.rootFidelity B ≤ ∫ x, Real.sqrt (measuredDensity d N A.1 x)*Real.sqrt (measuredDensity d N B.1 x) := by
73  rw [measuredDensity, measuredDensity, sampleInterpolate_affinity d N
74    (by exact_mod_cast hN) _ _ _ (latticeWeight_nonneg d N A.1 A.2)
75    (latticeWeight_nonneg d N B.1 B.2) (latticeWeight_summable d N A.1) (latticeWeight_summable d N B.1)]
76  exact rootFidelity_le_tsum_affinity (latticeWordLabel d N) A B
77 
78theorem measuredDensity_integral {X : Type*} [MeasurableSpace X] (μ : Measure X)
79    (d N : ℕ) (hN : 0<N) (A : X → TraceClass (TensorRegister N (Fin (d+1))))
80    (hA : Integrable A μ) (x : rootSpace d) :
81    measuredDensity d N (∫ z, A z ∂μ) x=∫ z, measuredDensity d N (A z) x ∂μ := by
82  simp_rw [measuredDensity_eq_clm d N hN]
83  exact ((densityCLM d N x).integral_comp_comm hA).symm
84 
85/-- Integrability follows from the summable finite lattice law and the actual
86coordinate change, for every complex trace-class input. -/
87theorem integrable_measuredDensity (d N : ℕ) (hN : 0<N)
88    (A : TraceClass (TensorRegister N (Fin (d+1)))) : Integrable (measuredDensity d N A) := by
89  have hp : Summable (fun z => latticeWeight d N A (latticeCoordinates d N z)) :=
90    (latticeCoordinates d N).summable_iff.mpr (latticeWeight_summable d N A)
91  have hf := YoungRounding.integrable_affineDensity (Real.sqrt (N : ℝ))⁻¹
92    (inv_pos.mpr (Real.sqrt_pos.mpr (by exact_mod_cast hN)))
93    ((coordinates d).symm (sampleAnchor d N (flatSpectrum (d+1))))
94    (YoungRounding.integrable_interpolate hp)
95  have hi : Integrable (interpolate d N (Real.sqrt (N : ℝ))⁻¹
96      (sampleAnchor d N (flatSpectrum (d+1))) (latticeWeight d N A)) (coordinateMeasure d) := by
97    apply ((coordinates_measurePreserving d).integrable_comp_emb
98      (coordinatesContinuous d).toHomeomorph.measurableEmbedding).mp
99    change Integrable (fun x => YoungRounding.affineDensity (Real.sqrt (N : ℝ))⁻¹
100      ((coordinates d).symm (sampleAnchor d N (flatSpectrum (d+1))))
101      (YoungRounding.interpolate (fun z => latticeWeight d N A (latticeCoordinates d N z)))
102      ((coordinates d).symm (coordinates d x)))
103    simpa only [LinearEquiv.symm_apply_apply] using hf
104  unfold measuredDensity sampleInterpolate euclideanInterpolate
105  rw [volume_eq_sqrt_smul_coordinateMeasure]
106  exact (hi.const_mul _).smul_measure ENNReal.ofReal_ne_top
107 
108end Cloning.PCTCountMeasurement