Exact Lean source
PCTJointGaussianConvolution
formalization/Cloning/PCTJointGaussianConvolution.lean
Source hash: 8e0f6e152b66f447fd6e5f16c45c3ceaf8c090e21f6326374814cf3c8f9f543c
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
theorem
Cloning.PCTJointGaussianConvolution.density_convolution_integrandtheorem Cloning.PCTJointGaussianConvolution.integral_density_convolutiontheorem Cloning.PCTJointGaussianConvolution.integrable_density_convolutiontheorem Cloning.PCTJointGaussianConvolution.integral_productDensity_convolutiontheorem Cloning.PCTJointGaussianConvolution.integral_realProductMeasure_productDensity1import Cloning.PCTJointGaussianReal
2import Mathlib.MeasureTheory.Group.Integral
3
4/-! Exact scalar Gaussian convolution in the precision convention of the
5hybrid field. The formula holds pointwise, before passing to L¹. -/
6noncomputable section
7open MeasureTheory
8open scoped Topology BigOperators
9namespace Cloning.PCTJointGaussianConvolution
10open Cloning.GaussianAffinity Cloning.PCTJointGaussianReal
11set_option backward.isDefEq.respectTransparency false
12set_option maxHeartbeats 1000000
13variable {k : ℕ}
14
15lemma density_convolution_integrand {a b : ℝ} (ha : 0 < a) (hb : 0 < b) (y x : ℝ) :
16 density b x * density a (y - x) =
17 density (a * b / (a + b)) y * density (a + b) (x - a * y / (a + b)) := by
18 have hab : a + b ≠ 0 := (add_pos ha hb).ne'
19 have hc : 0 < a * b / (a + b) := div_pos (mul_pos ha hb) (add_pos ha hb)
20 have hs : Real.sqrt (a * b / (a + b)) * Real.sqrt (a + b) =
21 Real.sqrt a * Real.sqrt b := by
22 rw [← Real.sqrt_mul hc.le, div_mul_cancel₀ _ hab, Real.sqrt_mul ha.le]
23 have hp : (Real.sqrt b / Real.sqrt Real.pi) * (Real.sqrt a / Real.sqrt Real.pi) =
24 (Real.sqrt (a * b / (a + b)) / Real.sqrt Real.pi) *
25 (Real.sqrt (a + b) / Real.sqrt Real.pi) := by
26 rw [div_mul_div_comm, div_mul_div_comm, hs, mul_comm (Real.sqrt b)]
27 have hq : -b * x ^ 2 + -a * (y - x) ^ 2 =
28 -(a * b / (a + b)) * y ^ 2 + -(a + b) * (x - a * y / (a + b)) ^ 2 := by
29 field_simp
30 <;> ring
31 unfold density
32 calc
33 _ = ((Real.sqrt b / Real.sqrt Real.pi) * (Real.sqrt a / Real.sqrt Real.pi)) *
34 Real.exp (-b * x ^ 2 + -a * (y - x) ^ 2) := by rw [Real.exp_add]; ring
35 _ = ((Real.sqrt (a * b / (a + b)) / Real.sqrt Real.pi) *
36 (Real.sqrt (a + b) / Real.sqrt Real.pi)) *
37 Real.exp (-(a * b / (a + b)) * y ^ 2 + -(a + b) * (x - a * y / (a + b)) ^ 2) := by
38 rw [hp, hq]
39 _ = _ := by rw [Real.exp_add]; ring
40
41lemma integral_density_convolution {a b : ℝ} (ha : 0 < a) (hb : 0 < b) (y : ℝ) :
42 (∫ x, density b x * density a (y - x)) = density (a * b / (a + b)) y := by
43 simp_rw [density_convolution_integrand ha hb y]
44 rw [integral_const_mul, integral_sub_right_eq_self, integral_density (add_pos ha hb), mul_one]
45
46lemma integrable_density_convolution {a b : ℝ} (ha : 0 < a) (hb : 0 < b) (y : ℝ) :
47 Integrable (fun x => density b x * density a (y - x)) := by
48 simp_rw [density_convolution_integrand ha hb y]
49 exact ((measurePreserving_sub_right volume (a * y / (a + b))).integrable_comp_of_integrable
50 (integrable_density (add_pos ha hb))).const_mul _
51
52lemma integral_productDensity_convolution (a b : Fin k → ℝ)
53 (ha : ∀ i, 0 < a i) (hb : ∀ i, 0 < b i) (y : Fin k → ℝ) :
54 (∫ x, productDensity b x * productDensity a (y - x)) =
55 productDensity (fun i => a i * b i / (a i + b i)) y := by
56 simp only [productDensity, ← Finset.prod_mul_distrib, Pi.sub_apply]
57 rw [integral_fintype_prod_volume_eq_prod
58 (fun i x => density (b i) x * density (a i) (y i - x))]
59 exact Finset.prod_congr rfl (fun i _ => integral_density_convolution (ha i) (hb i) (y i))
60
61lemma integral_realProductMeasure_productDensity (a b : Fin k → ℝ)
62 (ha : ∀ i, 0 < a i) (hb : ∀ i, 0 < b i) (y : Fin k → ℝ) :
63 (∫ x, productDensity a (y - x) ∂realProductMeasure b) =
64 productDensity (fun i => a i * b i / (a i + b i)) y := by
65 rw [integral_realProductMeasure]
66 exact integral_productDensity_convolution a b ha hb y
67
68end Cloning.PCTJointGaussianConvolution