Offline · exact source
Exact Lean source

HybridScorePolytope

formalization/Cloning/HybridScorePolytope.lean

Source hash: b9eac07a47b02f4c46c28a4dd9523cd8970939a381956bb8b753e7c7a23833fe

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.PCTJointGaussianChart
2import Cloning.HybridFlatBox
3 
4/-! The literal trace-zero score box, transported through the constructed
5whitening chart. Its product with the oscillator box is a compact convex body
6with zero in its interior, so real-radius flat-prior theorems apply to the
7manuscript's score window as well as rectangular whitening windows. -/
8noncomputable section
9open scoped Topology BigOperators
10open Filter MeasureTheory
11namespace Cloning.PCTJointGaussianWhitening
12open Cloning.Hybrid Cloning.PCTJointGaussianLaw
13set_option autoImplicit false
14set_option backward.isDefEq.respectTransparency false
15set_option maxHeartbeats 1000000
16variable {A : Type*} [Fintype A] [LinearOrder A] {k : ℕ}
17 
18theorem oscillatorBox_convex (s : ℕ) :
19    Convex ℝ (Cloning.MultimodeCoherent.phaseSpaceUnitBox s) := by
20  intro x hx y hy a c ha hc hac
21  have hbound {u v : ℝ} (hu : |u|≤1) (hv : |v|≤1) : |a*u+c*v|≤1 := by
22    calc
23      |a*u+c*v|≤|a*u|+|c*v| := abs_add_le _ _
24      _ = a*|u|+c*|v| := by rw [abs_mul,abs_mul,abs_of_nonneg ha,abs_of_nonneg hc]
25      _ ≤ 1 := by nlinarith
26  intro j
27  exact ⟨by simpa using hbound (hx j).1 (hy j).1,
28    by simpa using hbound (hx j).2 (hy j).2⟩
29 
30theorem oscillatorBox_zero_interior (s : ℕ) :
31    (0 : Fin s→ℂ) ∈ interior (Cloning.MultimodeCoherent.phaseSpaceUnitBox s) := by
32  apply mem_interior_iff_mem_nhds.mpr
33  apply mem_of_superset (Metric.ball_mem_nhds (0 : Fin s→ℂ) (by norm_num : (0:ℝ)<1))
34  intro z hz j
35  have hn : ‖z‖<1 := by simpa only [Metric.mem_ball,dist_zero_right] using hz
36  exact ⟨(Complex.abs_re_le_norm _).trans ((norm_le_pi_norm z j).trans hn.le),
37    (Complex.abs_im_le_norm _).trans ((norm_le_pi_norm z j).trans hn.le)⟩
38 
39def scoreUnitBody (p : A→ℝ) (hp : ∀a,0<p a)
40    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
41    (hb : b 0 = sqrtSpectrum p) (s : ℕ) : Set (PhaseSpace k s) :=
42  ((whiteningContinuousEquiv p hp b hb) '' Metric.closedBall (0 : scoreHyperplane A) 1) ×ˢ
43    Cloning.MultimodeCoherent.phaseSpaceUnitBox s
44 
45theorem mem_scoreUnitBody (p : A→ℝ) (hp : ∀a,0<p a)
46    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
47    (hb : b 0 = sqrtSpectrum p) (s : ℕ) (ξ : PhaseSpace k s) :
48    ξ∈scoreUnitBody p hp b hb s ↔
49      (∀a,|unwhiten p b ξ.1 a|≤1) ∧ (∀j,|(ξ.2 j).re|≤1 ∧ |(ξ.2 j).im|≤1) := by
50  have he : ξ.1∈(whiteningContinuousEquiv p hp b hb) ''
51      Metric.closedBall (0 : scoreHyperplane A) 1 ↔ ∀a,|unwhiten p b ξ.1 a|≤1 := by
52    let e := whiteningContinuousEquiv p hp b hb
53    change ξ.1 ∈ e.toEquiv '' Metric.closedBall (0 : scoreHyperplane A) 1 ↔ _
54    rw [e.toEquiv.image_eq_preimage_symm]
55    change dist (e.symm ξ.1) 0 ≤ 1 ↔ _
56    rw [dist_zero_right]
57    change ‖unwhiten p b ξ.1‖ ≤ 1 ↔ _
58    rw [pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ)≤1)]
59    simp only [Real.norm_eq_abs]
60  exact and_congr_left (fun _ => he)
61 
62theorem scoreUnitBody_compact (p : A→ℝ) (hp : ∀a,0<p a)
63    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
64    (hb : b 0 = sqrtSpectrum p) (s : ℕ) : IsCompact (scoreUnitBody p hp b hb s) :=
65  ((isCompact_closedBall (0 : scoreHyperplane A) 1).image
66    (whiteningContinuousEquiv p hp b hb).continuous).prod
67    (Cloning.MultimodeCoherent.phaseSpaceUnitBox_compact s)
68 
69theorem scoreUnitBody_convex (p : A→ℝ) (hp : ∀a,0<p a)
70    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
71    (hb : b 0 = sqrtSpectrum p) (s : ℕ) : Convex ℝ (scoreUnitBody p hp b hb s) :=
72  ((convex_closedBall (0 : scoreHyperplane A) 1).linear_image
73    (whiteningContinuousEquiv p hp b hb).toLinearMap).prod (oscillatorBox_convex s)
74 
75theorem scoreUnitBody_zero_interior (p : A→ℝ) (hp : ∀a,0<p a)
76    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
77    (hb : b 0 = sqrtSpectrum p) (s : ℕ) :
78    (0 : PhaseSpace k s) ∈ interior (scoreUnitBody p hp b hb s) := by
79  rw [scoreUnitBody,interior_prod_eq]
80  refine ⟨?_,oscillatorBox_zero_interior s⟩
81  apply (whiteningContinuousEquiv p hp b hb).isOpenMap.image_interior_subset
82  refine ⟨0,Metric.ball_subset_interior_closedBall (Metric.mem_ball_self (by norm_num)),?_⟩
83  exact map_zero _
84 
85theorem unwhiten_smul (p : A→ℝ) (hp : ∀a,0<p a)
86    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
87    (hb : b 0 = sqrtSpectrum p) (c : ℝ) (x : Fin k→ℝ) :
88    unwhiten p b (c • x) = c • unwhiten p b x := by
89  exact congrArg Subtype.val ((whiteningContinuousEquiv p hp b hb).symm.map_smul c x)
90 
91/-- Exact scaling identifies the nonrectangular whitened body with the
92literal score-hyperplane and oscillator-coordinate box at radius L. -/
93theorem smul_scoreWindow_iff (p : A→ℝ) (hp : ∀a,0<p a)
94    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
95    (hb : b 0 = sqrtSpectrum p) (s : ℕ) {L : ℝ} (hL : 0<L) (ξ : PhaseSpace k s) :
96    ((∀a,|unwhiten p b (L • ξ).1 a|≤L) ∧
97      (∀j,|((L • ξ).2 j).re|≤L ∧ |((L • ξ).2 j).im|≤L)) ↔
98      ξ∈scoreUnitBody p hp b hb s := by
99  have he (t : ℝ) : |L*t|≤L ↔ |t|≤1 := by
100    rw [abs_mul,abs_of_pos hL]
101    simpa only [mul_one] using
102      (mul_le_mul_iff_right₀ hL : L*|t|≤L*1 ↔ |t|≤1)
103  rw [mem_scoreUnitBody]
104  simp only [Prod.smul_fst,Prod.smul_snd,unwhiten_smul p hp b hb,
105    Pi.smul_apply,Complex.smul_re,Complex.smul_im,smul_eq_mul,he]
106 
107theorem scoreWindow_eq_dilate (p : A→ℝ) (hp : ∀a,0<p a)
108    (b : OrthonormalBasis (Fin (k+1)) ℝ (EuclideanSpace ℝ A))
109    (hb : b 0 = sqrtSpectrum p) (s : ℕ) {L : ℝ} (hL : 0<L) :
110    {ξ : PhaseSpace k s | (∀a,|unwhiten p b ξ.1 a|≤L) ∧
111      (∀j,|(ξ.2 j).re|≤L ∧ |(ξ.2 j).im|≤L)} =
112      (fun ξ => L • ξ) '' scoreUnitBody p hp b hb s := by
113  ext ξ
114  constructor
115  · intro hξ
116    have he : L • (L⁻¹ • ξ)=ξ := smul_inv_smul₀ hL.ne' ξ
117    refine ⟨L⁻¹ • ξ,?_,he⟩
118    apply (smul_scoreWindow_iff p hp b hb s hL (L⁻¹ • ξ)).mp
119    simpa only [he] using hξ
120  · rintro ⟨z,hz,rfl⟩
121    exact (smul_scoreWindow_iff p hp b hb s hL z).mpr hz
122 
123end Cloning.PCTJointGaussianWhitening