Stat.CLT.Berry­Esseen

The Berry–Esseen theorem with explicit constant one.

Prawitz­High­Rational­Certificate 10 core · 1 supporting · 1 submodule The kernel square table is shared across parameter cells. Prawitz­Low­Rational­Certificate 45 core · 0 supporting · 5 submodules This arithmetic leaf certifies every parameter cell, including the switch between the two discrepancy branches.
Prawitz­Kernel 3 core · 0 supporting These explicit functions separate the analytic prerequisites of sharp CDF smoothing from probability laws.

Prawitz's compact spectral smoothing filter

These explicit functions separate the analytic prerequisites of sharp CDF smoothing from probability laws. Frequencies are in radians. The singular value at zero is assigned zero; all later integrals are Lebesgue integrals, so this endpoint convention has no effect on their value.

Reference: Tyurin, arXiv:0912.0726, Prawitz's smoothing inequality and its displayed filter.

def prawitzSineWeight reviewed
Causalean.Stat.CLT.BerryEsseen

The cotangent weight at frequency t is (1 − t)·cot(πt) + 1/π, with the cotangent written as cos(πt)/sin(πt). It is the sine-part weight of Prawitz's approximation to the sign function and is used on 0 < t < 1; at points where sin(πt) vanishes the quotient is assigned zero.

Definition (Lean source)
t :
ℝ
prawitzSineWeight t :
ℝ
(1 - t) * cos (pi * t) / sin (pi * t) + 1 / pi
Causalean.Stat.CLT.BerryEsseen.prawitzSineWeight · Causalean/Stat/CLT/BerryEsseen/PrawitzKernel.lean:23
def prawitzKernel reviewed
Causalean.Stat.CLT.BerryEsseen

Prawitz's complex spectral filter at frequency t is zero when t = 0 or |t| > 1, and otherwise has real part the triangular weight (1 − |t|)/2 and imaginary part ((1 − |t|)·cot(πt) + sign(t)/π)/2, with cot(πt) written as cos(πt)/sin(πt). At t = ±1, where the sine vanishes, the quotient is assigned zero, so the value there is ±i/(2π).

Definition (Lean source)
t :
ℝ
prawitzKernel t :
ℂ
if t
= 0 ∨ 1 < |t| then 0 else ((1 - |t|) / 2 : ℝ)
+ (((1 - |t|) * cos (pi * t) / sin (pi * t) + sign t / pi) / 2 : ℝ) * I
Causalean.Stat.CLT.BerryEsseen.prawitzKernel · Causalean/Stat/CLT/BerryEsseen/PrawitzKernel.lean:30
def prawitzSignApprox reviewed
Causalean.Stat.CLT.BerryEsseen

Prawitz's band-limited approximation to the sign function at a point y is 2·∫ over t in [0, 1] of w(t)·sin(ty), where w(t) = (1 − t)·cot(πt) + 1/π is the cotangent weight. Frequencies are in radians and confined to the unit band.

Definition (Lean source)
y :
ℝ
prawitzSignApprox y :
ℝ
2 * ∫ t in (0 : ℝ)..1, prawitzSineWeight t * sin (t * y)
Causalean.Stat.CLT.BerryEsseen.prawitzSignApprox · Causalean/Stat/CLT/BerryEsseen/PrawitzKernel.lean:41
Prawitz­Envelopes 3 core · 0 supporting These explicit analytic functions separate numerical budget proofs from probabilistic characteristic-function bounds.

Deterministic envelopes for Prawitz smoothing

These explicit analytic functions separate numerical budget proofs from probabilistic characteristic-function bounds. They contain no convergence or coverage premises. The original envelope definitions are preserved exactly.

def prawitzMomentEnvelope reviewed
Causalean.Stat.CLT.BerryEsseen

The cubic moment envelope at ratio ρ and frequency t is min(1, exp(−t²/2 + ρ|t|³/5)): a cubically damped Gaussian factor truncated at one, the universal modulus bound for a probability characteristic function.

Definition (Lean source)
ρ t :
ℝ
prawitzMomentEnvelope ρ t :
ℝ
min 1 (exp (-(t ^ 2 / 2) + ρ * |t| ^ 3 / 5))
Causalean.Stat.CLT.BerryEsseen.prawitzMomentEnvelope · Causalean/Stat/CLT/BerryEsseen/PrawitzEnvelopes.lean:19
def prawitzDiscrepancyEnvelope reviewed
Causalean.Stat.CLT.BerryEsseen

The Fourier discrepancy envelope at ratio ρ and frequency t is the smaller of two quantities: the Taylor product bound (ρ|t|³/6 + ρ²t⁴/8)·exp(−t²/4 + ρ|t|³/10), and the modulus sum, namely the cubic moment envelope min(1, exp(−t²/2 + ρ|t|³/5)) plus the Gaussian modulus exp(−t²/2).

Definition (Lean source)
ρ t :
ℝ
prawitzDiscrepancyEnvelope ρ t :
ℝ
min ((ρ * |t| ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10)) (prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2)))
Causalean.Stat.CLT.BerryEsseen.prawitzDiscrepancyEnvelope · Causalean/Stat/CLT/BerryEsseen/PrawitzEnvelopes.lean:25
def prawitzBerryEsseenEnvelope reviewed
Causalean.Stat.CLT.BerryEsseen

The deterministic Prawitz smoothing envelope at ratio ρ, inner cutoff U0 and outer cutoff U is the sum of four explicit terms, with K the Prawitz filter: (2/U)·∫ over [0, U0] of |K(t/U)| times the discrepancy envelope at (ρ, t); (2/U)·∫ over [U0, U] of |K(t/U)| times the cubic moment envelope at (ρ, t); 2·∫ over [0, U0] of |K(t/U)/U − i/(2πt)|·exp(−t²/2); and (1/π)·∫ over t > U0 of exp(−t²/2)/t. It is a function of three real numbers only; no probability law enters. The expression is the intended envelope for 0 < U0 ≤ U; outside that range (for instance U = 0, where it divides by zero) it is only a formal value.

Definition (Lean source)
ρ U0 U :
ℝ
prawitzBerryEsseenEnvelope ρ U0 U :
ℝ
(2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t)
+ (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t)
+ 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2)))
+ (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t)
Causalean.Stat.CLT.BerryEsseen.prawitzBerryEsseenEnvelope · Causalean/Stat/CLT/BerryEsseen/PrawitzEnvelopes.lean:35
Smoothing­Kernel 2 core · 3 supporting The fourth power of the sinc function gives a nonnegative density whose Fourier transform is supported on a bounded interval. ★ sinc4Kernel_fourier_eq_zero

A compact-frequency probability smoothing kernel

The fourth power of the sinc function gives a nonnegative density whose Fourier transform is supported on a bounded interval. These analytic facts are the first layer of the quantitative CDF smoothing argument.

def sinc4Kernel reviewed
Causalean.Stat.CLT.BerryEsseen

The fourth-power sinc kernel at bandwidth T and point x is (3T/(8π))·sinc(Tx/4)⁴. At positive bandwidth it is a probability density whose Fourier transform vanishes outside [−T, T].

Definition (Lean source)
T x :
ℝ
sinc4Kernel T x :
ℝ
(3 * T / (8 * pi)) * (sinc (T * x / 4)) ^ 4
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel · Causalean/Stat/CLT/BerryEsseen/SmoothingKernel.lean:22
theorem sinc4Kernel_fourier_eq_zero reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive bandwidth T, the Fourier transform of the fourth-power sinc kernel vanishes at every frequency t with |t| ≥ T, that is, outside its bandwidth interval.

Formal statement
T t :
ℝ
hT :
0 < T
ht :
T ≤ |t|
∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (sinc4Kernel T x : ℂ) = 0
Proof (Lean source)
theorem sinc4Kernel_fourier_eq_zero (T t : ℝ) (hT : 0 < T) (ht : T ≤ |t|) : ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (sinc4Kernel T x : ℂ) = 0 := by /- Apply `sincFourth_fourier_triangleConvolution` and `sincTriangle_convolution_outside`. Scale x ↦ T*x/4; the triangle convolution is zero also at the support endpoints |t| = T. Under this change of variables the unscaled Fourier frequency is `4*t/T`, so `4 ≤ |4*t/T|` follows from `T ≤ |t|`. Move the real prefactor through the complex integral before invoking the unscaled identity. -/ have hfreq : 4 ≤ |4 * t / T| := by rw [abs_div, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 4), abs_of_pos hT] apply (le_div_iff₀ hT).2 nlinarith have hbase : (∫ y : ℝ, exp ((((4 * t / T) * y : ℝ) : ℂ) * I) * ((sinc y ^ 4 : ℝ) : ℂ)) = 0 := by rw [sincFourth_fourier_triangleConvolution, sincTriangle_convolution_outside _ hfreq] simp let g : ℝ → ℂ := fun y => exp ((((4 * t / T) * y : ℝ) : ℂ) * I) * ((sinc y ^ 4 : ℝ) : ℂ) have hchange : (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc (T * x / 4) ^ 4 : ℝ) : ℂ)) = 0 := by calc _ = ∫ x : ℝ, g ((T / 4) * x) := by apply integral_congr_ae filter_upwards with x dsimp [g] have hw : (4 * t / T) * ((T / 4) * x) = t * x := by field_simp rw [hw] congr 1 congr 1 ring_nf _ = |(T / 4)⁻¹| • ∫ y : ℝ, g y := Measure.integral_comp_mul_left g (T / 4) _ = 0 := by have hg : (∫ y : ℝ, g y) = 0 := hbase simp [hg] calc _ = ((3 * T / (8 * pi) : ℝ) : ℂ) * ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc (T * x / 4) ^ 4 : ℝ) : ℂ) := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards with x unfold sinc4Kernel push_cast ring _ = 0 := by rw [hchange, mul_zero]
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_fourier_eq_zero · Causalean/Stat/CLT/BerryEsseen/SmoothingKernel.lean:128 · uses sinc4Kernel
3 supporting declarations (lemmas, instances)
  • sinc4Kernel_nonneg theorem — The fourth-power sinc kernel is nonnegative at every real argument when its bandwidth is positive.
    T :
    ℝ
    hT :
    0 < T
    x :
    ℝ
    0 ≤ sinc4Kernel T x
    Proof (Lean source)
    theorem sinc4Kernel_nonneg (T : ℝ) (hT : 0 < T) (x : ℝ) : 0 ≤ sinc4Kernel T x := by unfold sinc4Kernel positivity
    Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_nonneg · Causalean/Stat/CLT/BerryEsseen/SmoothingKernel.lean:28
  • sinc4Kernel_integrable theorem — The fourth-power sinc kernel is integrable on the real line at every positive bandwidth.
    T :
    ℝ
    hT :
    0 < T
    Proof (Lean source)
    theorem sinc4Kernel_integrable (T : ℝ) (hT : 0 < T) : Integrable (sinc4Kernel T) volume := by have hsinc : Integrable (fun x : ℝ => sinc x ^ 4) := by apply (integrable_inv_one_add_sq.const_mul (4 : ℝ)).mono · fun_prop · filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ sinc x ^ 4)] rw [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 4 * (1 + x ^ 2)⁻¹)] rw [inv_eq_one_div, mul_one_div] apply (le_div_iff₀ (by positivity : 0 < 1 + x ^ 2)).2 by_cases hx : |x| ≤ 1 · have ha2 : |x| * |x| ≤ 1 * 1 := mul_self_le_mul_self (abs_nonneg x) hx have hx2 : x ^ 2 ≤ 1 := by simpa [sq_abs, pow_two] using ha2 have hs := Real.abs_sinc_le_one x have hsl := neg_abs_le (sinc x) have hsr := le_abs_self (sinc x) have hs2 : sinc x ^ 2 ≤ 1 := by nlinarith have hs4 : sinc x ^ 4 ≤ 1 := by nlinarith [mul_self_le_mul_self (sq_nonneg (sinc x)) hs2] nlinarith · have hxabs : 1 < |x| := lt_of_not_ge hx have hx0 : x ≠ 0 := by intro h subst x norm_num at hxabs rw [Real.sinc_of_ne_zero hx0, div_pow, div_mul_eq_mul_div] apply (div_le_iff₀ (by positivity : 0 < x ^ 4)).2 have habs2 : (1 : ℝ) ^ 2 < |x| ^ 2 := (sq_lt_sq₀ (by positivity) (abs_nonneg x)).2 hxabs have hx2 : 1 < x ^ 2 := by simpa [sq_abs] using habs2 have hs := Real.abs_sin_le_one x have hsl := neg_abs_le (sin x) have hsr := le_abs_self (sin x) have hs2 : sin x ^ 2 ≤ 1 := by nlinarith have hs4 : sin x ^ 4 ≤ 1 := by nlinarith [mul_self_le_mul_self (sq_nonneg (sin x)) hs2] calc sin x ^ 4 * (1 + x ^ 2) ≤ 1 * (1 + x ^ 2) := mul_le_mul_of_nonneg_right hs4 (by positivity) _ ≤ 2 * x ^ 2 := by nlinarith _ ≤ 4 * x ^ 4 := by nlinarith [sq_nonneg (x ^ 2 - 1)] have hscaled : Integrable (fun x : ℝ => sinc (T * x / 4) ^ 4) := by convert hsinc.comp_mul_left' (by positivity : T / 4 ≠ 0) using 1 ext x congr 1 ring_nf exact hscaled.const_mul (3 * T / (8 * pi))
    Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_integrable · Causalean/Stat/CLT/BerryEsseen/SmoothingKernel.lean:35
  • sinc4Kernel_integral_eq_one theorem — The integral of the fourth-power sinc kernel is one at every positive bandwidth, so it defines a probability density.
    T :
    ℝ
    hT :
    0 < T
    ∫ x : ℝ, sinc4Kernel T x = 1
    Proof (Lean source)
    theorem sinc4Kernel_integral_eq_one (T : ℝ) (hT : 0 < T) : ∫ x : ℝ, sinc4Kernel T x = 1 := by /- Set `t = 0` in `sincFourth_fourier_triangleConvolution`, use `sincTriangle_square_integral` to obtain ∫ sinc(x)^4 dx = 2π/3, then scale x ↦ T*x/4 via `Measure.integral_comp_mul_left`. Since `T > 0`, the Jacobian is `4/T`; the prefactor 3T/(8π) makes the integral one. At zero frequency, rewrite `|0-u|` as `|u|` and the convolution integrand as the square of the triangle. -/ have hfourier := sincFourth_fourier_triangleConvolution 0 have hzero : (∫ x : ℝ, sinc x ^ 4) = 2 * pi / 3 := by have htri : (∫ u : ℝ, (pi * max (1 - |u| / 2) 0) * (pi * max (1 - |(0 : ℝ) - u| / 2) 0)) = 4 * pi ^ 2 / 3 := by convert sincTriangle_square_integral using 1 congr 1 ext u simp only [zero_sub, abs_neg] ring rw [htri] at hfourier simp only [zero_mul, Complex.ofReal_zero, zero_mul, Complex.exp_zero, one_mul, integral_complex_ofReal] at hfourier have hpi : pi ≠ 0 := Real.pi_ne_zero apply Complex.ofReal_injective convert hfourier using 1 <;> push_cast <;> field_simp <;> ring have hscale : (∫ x : ℝ, sinc (T * x / 4) ^ 4) = (4 / T) * (∫ x : ℝ, sinc x ^ 4) := by have h := Measure.integral_comp_mul_left (fun x : ℝ => sinc x ^ 4) (T / 4) convert h using 1 · congr 1; ext x; ring_nf · simp only [smul_eq_mul, abs_inv, abs_of_pos (by positivity : 0 < T / 4)] field_simp unfold sinc4Kernel rw [integral_const_mul, hscale, hzero] have hpi : pi ≠ 0 := Real.pi_ne_zero field_simp ring
    Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_integral_eq_one · Causalean/Stat/CLT/BerryEsseen/SmoothingKernel.lean:87
Prawitz­Compact­Rational­Data 11 core · 0 supporting The parameter grid has ninety cells of width 1/1000 on [1/100,1/10] and one hundred eighty cells of width 1/200 on [1/10,1].

Exact rational grid data for compact Prawitz budgets

The parameter grid has ninety cells of width 1/1000 on [1/100,1/10] and one hundred eighty cells of width 1/200 on [1/10,1]. Low frequency cells have width 1/200, and high cells have width 1/1000 in the kernel variable. All tables are explicit integers. Their entries and finite sums are obligations in the three separate certificate modules, not assumptions.

Sixteen-term reciprocal Taylor bounds replace negative exponentials. Each cell bound is rounded UP to one hundred millionth before summation; this keeps denominators small without relying on approximate arithmetic. The singular low cell [0,1/200] uses its proved polynomial integral bound. The high sum includes every cell from its lower integer index through 999; the analytic comparison at the assigned kernel endpoint is only a.e.

def prawitzCompactLeft reviewed
Causalean.Stat.CLT.BerryEsseen

The left endpoint of the j-th parameter cell is (10 + j)/1000 for j < 90 and (20 + (j − 90))/200 for j ≥ 90: the cells have width one thousandth from 1/100 up to 1/10 and width one two hundredth from 1/10 onward.

Definition (Lean source)
j :
ℕ
prawitzCompactLeft j :
ℚ
if j < 90 then (10 + (j : ℚ)) / 1000 else (20 + ((j - 90 : ℕ) : ℚ)) / 200
Causalean.Stat.CLT.BerryEsseen.prawitzCompactLeft · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:26
def prawitzCompactRight reviewed
Causalean.Stat.CLT.BerryEsseen

The right endpoint of the j-th parameter cell is the left endpoint of cell j + 1, so consecutive cells have no gaps.

Definition (Lean source)
j :
ℕ
prawitzCompactRight j :
ℚ
Causalean.Stat.CLT.BerryEsseen.prawitzCompactRight · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:33
def prawitzLowCutoffIndex reviewed
Causalean.Stat.CLT.BerryEsseen

The low-frequency cutoff index of the j-th parameter cell is an integer read from an explicit 270-entry table, with values between 300 and 859; divided by two hundred it is the cell's upper low-frequency grid endpoint. For j outside the 270-cell grid the value is the default 300.

Definition (Lean source)
j :
ℕ
prawitzLowCutoffIndex j :
ℕ
#[ 859, 850, 842, 834, 827, 820, 814, 808, 802, 797, 792, 787, 782, 777, 773, 769, 765, 761, 757, 753, 750, 746, 743, 739, 736, 733, 730, 727, 724, 721, 718, 715, 713, 710, 707, 705, 702, 700, 698, 695, 693, 691, 688, 686, 684, 682, 680, 678, 675, 673, 671, 669, 668, 666, 664, 662, 660, 658, 656, 655, 653, 651, 649, 648, 646, 644, 643, 641, 639, 638, 636, 635, 633, 632, 630, 629, 627, 626, 624, 623, 621, 620, 618, 617, 616, 614, 613, 611, 610, 609, 607, 601, 595, 589, 583, 577, 572, 567, 561, 556, 551, 547, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 461, 458, 455, 452, 449, 446, 442, 439, 436, 433, 430, 427, 425, 422, 419, 416, 413, 410, 408, 405, 402, 399, 397, 394, 391, 389, 386, 383, 381, 378, 376, 373, 371, 368, 365, 363, 360, 358, 355, 353, 351, 348, 346, 343, 341, 338, 336, 334, 331, 329, 326, 324, 322, 319, 317, 314, 312, 310, 307, 305, 303, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300 ].getD j 300
Causalean.Stat.CLT.BerryEsseen.prawitzLowCutoffIndex · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:37
def prawitzHighCutoffIndex reviewed
Causalean.Stat.CLT.BerryEsseen

The high-frequency cutoff index of the j-th parameter cell is an integer read from an explicit 270-entry table, with values between 16 and 620; divided by one thousand it is the lower endpoint, in the rescaled kernel variable, of the cell's high-frequency range. For j outside the 270-cell grid the value is the default 1.

Definition (Lean source)
j :
ℕ
prawitzHighCutoffIndex j :
ℕ
#[ 16, 18, 19, 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 38, 40, 41, 42, 44, 45, 46, 48, 49, 50, 52, 53, 54, 56, 57, 58, 59, 61, 62, 63, 64, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 124, 128, 133, 138, 143, 147, 152, 156, 161, 165, 169, 173, 177, 182, 186, 189, 193, 197, 201, 205, 208, 212, 215, 219, 222, 226, 229, 232, 236, 239, 242, 245, 248, 251, 254, 257, 260, 263, 266, 268, 271, 274, 276, 279, 281, 284, 286, 288, 291, 293, 295, 298, 300, 302, 304, 306, 308, 310, 312, 314, 315, 317, 319, 321, 322, 324, 325, 327, 328, 330, 331, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 346, 347, 348, 348, 349, 350, 350, 351, 351, 352, 355, 358, 361, 364, 367, 370, 374, 377, 380, 383, 386, 389, 392, 395, 399, 402, 405, 408, 411, 414, 417, 420, 424, 427, 430, 433, 436, 439, 442, 445, 449, 452, 455, 458, 461, 464, 467, 470, 474, 477, 480, 483, 486, 489, 492, 495, 499, 502, 505, 508, 511, 514, 517, 520, 524, 527, 530, 533, 536, 539, 542, 545, 549, 552, 555, 558, 561, 564, 567, 570, 574, 577, 580, 583, 586, 589, 592, 595, 599, 602, 605, 608, 611, 614, 617, 620 ].getD j 1
Causalean.Stat.CLT.BerryEsseen.prawitzHighCutoffIndex · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:68
def prawitzKernelMagnitudeIndex reviewed
Causalean.Stat.CLT.BerryEsseen

The integer kernel magnitude entry of the i-th frequency cell is read from an explicit 1000-entry table; divided by one million it serves as the upper bound for the Prawitz filter magnitude on the cell [i/1000, (i + 1)/1000] of the kernel variable, a bound certified separately. The entry at index zero and the default for i ≥ 1000 are zero and bound nothing: the high certificate starts at a positive index.

Definition (Lean source)
i :
ℕ
prawitzKernelMagnitudeIndex i :
ℕ
#[ 0, 159156123, 79578712, 53053078, 39790387, 31832872, 26527944, 22738779, 19896965, 17686718, 15918567, 14471940, 13266455, 12246464, 11372218, 10614567, 9951650, 9366748, 8846858, 8381715, 7963107, 7584386, 7240111, 6925791, 6637680, 6372634, 6127989, 5901481, 5691164, 5495365, 5312630, 5141696, 4981456, 4830938, 4689283, 4555733, 4429610, 4310314, 4197305, 4090098, 3988260, 3891396, 3799152, 3711205, 3627262, 3547056, 3470343, 3396900, 3326522, 3259022, 3194227, 3131978, 3072128, 3014541, 2959090, 2905661, 2854143, 2804437, 2756448, 2710090, 2665280, 2621943, 2580007, 2539405, 2500075, 2461958, 2424998, 2389144, 2354348, 2320562, 2287743, 2255852, 2224848, 2194696, 2165360, 2136809, 2109011, 2081936, 2055557, 2029848, 2004782, 1980337, 1956490, 1933218, 1910502, 1888321, 1866657, 1845492, 1824810, 1804592, 1784825, 1765494, 1746583, 1728079, 1709970, 1692243, 1674885, 1657886, 1641235, 1624920, 1608932, 1593260, 1577897, 1562832, 1548057, 1533563, 1519343, 1505389, 1491694, 1478250, 1465050, 1452088, 1439358, 1426853, 1414567, 1402495, 1390630, 1378969, 1367505, 1356233, 1345149, 1334248, 1323525, 1312976, 1302597, 1292384, 1282332, 1272439, 1262699, 1253110, 1243668, 1234370, 1225212, 1216192, 1207305, 1198550, 1189922, 1181420, 1173041, 1164782, 1156640, 1148612, 1140697, 1132893, 1125195, 1117604, 1110115, 1102728, 1095440, 1088249, 1081152, 1074150, 1067238, 1060416, 1053682, 1047034, 1040470, 1033989, 1027589, 1021268, 1015026, 1008861, 1002770, 996754, 990809, 984936, 979133, 973398, 967731, 962130, 956593, 951121, 945711, 940362, 935074, 929846, 924675, 919562, 914506, 909505, 904558, 899666, 894825, 890037, 885299, 880612, 875974, 871385, 866843, 862348, 857899, 853496, 849138, 844823, 840552, 836324, 832137, 827992, 823888, 819823, 815798, 811812, 807865, 803955, 800082, 796246, 792446, 788681, 784951, 781256, 777595, 773967, 770373, 766811, 763281, 759782, 756315, 752878, 749472, 746096, 742749, 739431, 736142, 732881, 729648, 726442, 723264, 720112, 716987, 713887, 710814, 707766, 704742, 701744, 698770, 695819, 692893, 689990, 687110, 684253, 681419, 678606, 675816, 673048, 670300, 667574, 664869, 662184, 659520, 656876, 654252, 651647, 649062, 646496, 643949, 641420, 638910, 636418, 633945, 631489, 629050, 626629, 624225, 621839, 619468, 617115, 614778, 612457, 610152, 607863, 605589, 603332, 601089, 598861, 596649, 594451, 592268, 590099, 587944, 585804, 583678, 581565, 579466, 577381, 575309, 573250, 571204, 569172, 567152, 565144, 563150, 561167, 559197, 557239, 555293, 553359, 551436, 549526, 547626, 545739, 543862, 541996, 540142, 538298, 536466, 534644, 532832, 531031, 529241, 527460, 525690, 523930, 522180, 520440, 518709, 516988, 515277, 513575, 511883, 510200, 508526, 506861, 505205, 503558, 501920, 500291, 498670, 497058, 495454, 493859, 492272, 490694, 489123, 487561, 486007, 484461, 482922, 481392, 479869, 478354, 476846, 475346, 473853, 472368, 470890, 469419, 467956, 466499, 465050, 463607, 462172, 460743, 459321, 457906, 456498, 455096, 453701, 452312, 450929, 449553, 448184, 446820, 445463, 444112, 442767, 441428, 440095, 438768, 437446, 436131, 434822, 433518, 432220, 430927, 429640, 428359, 427083, 425812, 424547, 423287, 422033, 420784, 419540, 418301, 417067, 415838, 414615, 413396, 412182, 410974, 409770, 408571, 407376, 406187, 405002, 403821, 402646, 401475, 400308, 399146, 397989, 396836, 395687, 394543, 393403, 392267, 391136, 390008, 388885, 387767, 386652, 385541, 384434, 383332, 382233, 381138, 380047, 378960, 377877, 376798, 375723, 374651, 373583, 372518, 371458, 370401, 369347, 368298, 367251, 366209, 365169, 364133, 363101, 362072, 361046, 360024, 359005, 357990, 356977, 355968, 354962, 353959, 352960, 351963, 350970, 349980, 348993, 348009, 347028, 346049, 345074, 344102, 343133, 342166, 341203, 340242, 339284, 338329, 337377, 336427, 335481, 334537, 333595, 332656, 331720, 330787, 329856, 328928, 328002, 327079, 326158, 325240, 324324, 323411, 322500, 321592, 320686, 319782, 318881, 317982, 317085, 316191, 315299, 314409, 313521, 312636, 311753, 310872, 309993, 309116, 308242, 307369, 306499, 305630, 304764, 303900, 303038, 302177, 301319, 300463, 317889, 317012, 316135, 315260, 314386, 313514, 312642, 311772, 310903, 310036, 309169, 308304, 307440, 306578, 305717, 304857, 303998, 303140, 302284, 301429, 300575, 299723, 298871, 298021, 297172, 296325, 295479, 294634, 293790, 292947, 292106, 291266, 290427, 289589, 288753, 287917, 287083, 286251, 285419, 284589, 283760, 282932, 282105, 281280, 280456, 279633, 278811, 277990, 277171, 276353, 275536, 274720, 273906, 273093, 272280, 271470, 270660, 269851, 269044, 268238, 267433, 266630, 265827, 265026, 264226, 263427, 262629, 261832, 261037, 260243, 259450, 258658, 257867, 257078, 256290, 255503, 254717, 253932, 253148, 252366, 251585, 250805, 250026, 249248, 248471, 247696, 246922, 246149, 245377, 244606, 243836, 243068, 242300, 241534, 240769, 240005, 239242, 238481, 237720, 236961, 236203, 235446, 234690, 233935, 233181, 232429, 231677, 230927, 230178, 229430, 228683, 227937, 227192, 226449, 225706, 224965, 224225, 223485, 222747, 222010, 221275, 220540, 219806, 219074, 218342, 217612, 216883, 216155, 215428, 214702, 213977, 213253, 212530, 211809, 211088, 210369, 209650, 208933, 208217, 207501, 206787, 206074, 205362, 204651, 203941, 203233, 202525, 201818, 201113, 200408, 199704, 199002, 198300, 197600, 196901, 196202, 195505, 194809, 194114, 193419, 192726, 192034, 191343, 190653, 189964, 189276, 188589, 187903, 187218, 186534, 185851, 185169, 184488, 183808, 183129, 182451, 181774, 181098, 180423, 179749, 179076, 178404, 177733, 177063, 176394, 175726, 175059, 174393, 173728, 173064, 172401, 171738, 171077, 170417, 169757, 169099, 168441, 167785, 167129, 166475, 165821, 165169, 164517, 163866, 163216, 162567, 161919, 161272, 160626, 159981, 159336, 158693, 158050, 157409, 156768, 156128, 155490, 154852, 154215, 153579, 152943, 152309, 151676, 151043, 150411, 149781, 149151, 148522, 147894, 147267, 146640, 146015, 145390, 144766, 144144, 143522, 142900, 142280, 141661, 141042, 140424, 139808, 139191, 138576, 137962, 137348, 136736, 136124, 135513, 134903, 134293, 133685, 133077, 132470, 131864, 131259, 130654, 130051, 129448, 128846, 128245, 127644, 127045, 126446, 125848, 125250, 124654, 124058, 123463, 122869, 122276, 121683, 121091, 120500, 119910, 119320, 118731, 118143, 117556, 116969, 116384, 115798, 115214, 114631, 114048, 113466, 112884, 112303, 111723, 111144, 110566, 109988, 109411, 108834, 108259, 107684, 107109, 106536, 105963, 105391, 104819, 104248, 103678, 103109, 102540, 101972, 101404, 100838, 100272, 99706, 99141, 98577, 98014, 97451, 96889, 96327, 95766, 95206, 94646, 94087, 93529, 92971, 92414, 91857, 91302, 90746, 90192, 89638, 89084, 88531, 87979, 87427, 86876, 86326, 85776, 85226, 84678, 84130, 83582, 83035, 82488, 81943, 81397, 80852, 80308, 79765, 79221, 78679, 78137, 77595, 77054, 76514, 75974, 75435, 74896, 74357, 73819, 73282, 72745, 72209, 71673, 71138, 70603, 70069, 69535, 69002, 68469, 67936, 67404, 66873, 66342, 65811, 65281, 64752, 64223, 63694, 63166, 62638, 62111, 61584, 61057, 60531, 60005, 59480, 58955, 58431, 57907, 57384, 56861, 56338, 55815, 55294, 54772, 54251, 53730, 53210, 52690, 52170, 51651, 51132, 50614, 50095, 49578, 49060, 48543, 48026, 47510, 46994, 46478, 45963, 45448, 44933, 44419, 43905, 43391, 42878, 42365, 41852, 41339, 40827, 40315, 39803, 39292, 38781, 38270, 37760, 37250, 36740, 36230, 35721, 35211, 34703, 34194, 33686, 33177, 32669, 32162, 31654, 31147, 30640, 30133, 29627, 29121, 28615, 28109, 27603, 27097, 26592, 26087, 25582, 25077, 24573, 24069, 23564, 23060, 22557, 22053, 21549, 21046, 20543, 20040, 19537, 19034, 18532, 18029, 17527, 17025, 16523, 16021, 15519, 15017, 14516, 14014, 13513, 13011, 12510, 12009, 11508, 11007, 10506, 10005, 9505, 9004, 8504, 8003, 7503, 7002, 6502, 6002, 5501, 5001, 4501, 4001, 3501, 3001, 2501, 2001, 1501, 1001, 501 ].getD i 0
Causalean.Stat.CLT.BerryEsseen.prawitzKernelMagnitudeIndex · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:100
def prawitzRationalKernelSq reviewed
Causalean.Stat.CLT.BerryEsseen

The rational squared kernel bound on the i-th grid cell, with a = i/1000, b = (i + 1)/1000 and the decimal bounds p = 3.14159 and q = 3.14160 for π, is (1 − a)²/4 + (((1 − a)·(1 − (pa)²/2 + (qb)⁴/24)/(pa·(1 − (qb)²/6)) + 1/p)/2)² for i < 500 (the lower half-band) and the reflected polynomial (1 − a)²/4 + q²(1 − a)⁴/16 for i ≥ 500. At i = 0 the denominator pa vanishes and the quotient is assigned zero.

Definition (Lean source)
i :
ℕ
prawitzRationalKernelSq i :
ℚ
a :
(i : ℚ) / 1000
b :
((i + 1 : ℕ) : ℚ) / 1000
p :
(314159 / 100000 : ℚ)
q :
(314160 / 100000 : ℚ)
if i < 500 then (1 - a) ^ 2 / 4
+ (((1 - a) * (1 - (p * a) ^ 2 / 2 + (q * b) ^ 4 / 24) / (p * a * (1 - (q * b) ^ 2 / 6)) + 1 / p) / 2) ^ 2 else (1 - a) ^ 2 / 4
+ q ^ 2 * (1 - a) ^ 4 / 16
Causalean.Stat.CLT.BerryEsseen.prawitzRationalKernelSq · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:194
def prawitzRationalLowInitial reviewed
Causalean.Stat.CLT.BerryEsseen

The rational bound for the initial low-frequency interval [0, 1/200] on the j-th parameter cell is (1/p + 5sa/12)·(1/6 + sa/8)·a³/3, with a = 1/200, s the cell's right endpoint and p = 3.14159. This interval contains the filter's removable singularity at zero.

Definition (Lean source)
j :
ℕ
prawitzRationalLowInitial j :
ℚ
a :
(1 / 200 : ℚ)
(1 / (314159 / 100000 : ℚ) + 5 * s * a / 12) * (1 / 6 + s * a / 8) * a ^ 3 / 3
Causalean.Stat.CLT.BerryEsseen.prawitzRationalLowInitial · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:212
def prawitzRationalLowCell reviewed
Causalean.Stat.CLT.BerryEsseen

The rational normalized low-frequency cell bound for the j-th parameter cell and the i-th frequency cell is (1/200)·(1/(pa) + 5s/12) times the smaller of the Taylor branch (b³/6 + sb⁴/8)/T(e/2) and the modulus-sum branch (1/T(e) + 1/T(a²/2))/r. Here r and s are the parameter cell's left and right endpoints, a = i/200, b = (i + 1)/200, p = 3.14159, e is the smaller of a²/2 − sa³/5 and b²/2 − sb³/5, and T is the sixteen-term Taylor polynomial of the exponential. It is meant for positive i; at i = 0 the quotient 1/(pa) is assigned zero.

Definition (Lean source)
j i :
ℕ
prawitzRationalLowCell j i :
ℚ
a :
(i : ℚ) / 200
b :
((i + 1 : ℕ) : ℚ) / 200
e :
min (a ^ 2 / 2 - s * a ^ 3 / 5) (b ^ 2 / 2 - s * b ^ 3 / 5)
(1 / 200 : ℚ) * (1 / ((314159 / 100000 : ℚ) * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) / prawitzTaylor16 (e / 2)) ((1 / prawitzTaylor16 e + 1 / prawitzTaylor16 (a ^ 2 / 2)) / r)
Causalean.Stat.CLT.BerryEsseen.prawitzRationalLowCell · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:223
def prawitzRationalLowSum reviewed
Causalean.Stat.CLT.BerryEsseen

The complete normalized rational low-frequency sum for the j-th parameter cell is the initial-interval bound rounded up to a multiple of one hundred millionth, plus the sum over frequency indices i from 1 up to but not including the cell's low cutoff index of the low cell bounds, each rounded up in the same way.

Definition (Lean source)
j :
ℕ
prawitzRationalLowSum j :
ℚ
Causalean.Stat.CLT.BerryEsseen.prawitzRationalLowSum · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:241
def prawitzRationalHighCell reviewed
Causalean.Stat.CLT.BerryEsseen

The rational raw high-frequency cell bound for the j-th parameter cell and the i-th kernel frequency cell is (12/(5r))·(1/1000)·(M/1000000)/T(e). Here r and s are the parameter cell's left and right endpoints, a = i/1000, b = (i + 1)/1000, M is the integer kernel magnitude entry at i, e is the smaller of 72a²/25 − 1728a³/625 and 72b²/25 − 1728b³/625 divided by s², and T is the sixteen-term Taylor polynomial of the exponential. The cell length is rescaled by the bandwidth 12/(5r) at the lower parameter, and the cubic damping is taken at the upper parameter.

Definition (Lean source)
j i :
ℕ
prawitzRationalHighCell j i :
ℚ
a :
(i : ℚ) / 1000
b :
((i + 1 : ℕ) : ℚ) / 1000
e :
min (72 * a ^ 2 / 25 - 1728 * a ^ 3 / 625) (72 * b ^ 2 / 25 - 1728 * b ^ 3 / 625) / s ^ 2
(12 / (5 * r)) * (1 / 1000 : ℚ) * ((prawitzKernelMagnitudeIndex i : ℚ) / 1000000) / prawitzTaylor16 e
Causalean.Stat.CLT.BerryEsseen.prawitzRationalHighCell · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:250
def prawitzRationalHighSum reviewed
Causalean.Stat.CLT.BerryEsseen

The complete raw rational high-frequency sum for the j-th parameter cell is the sum, over kernel frequency indices i from the cell's high cutoff index through 999, of the high cell bounds, each rounded up to a multiple of one hundred millionth.

Definition (Lean source)
j :
ℕ
prawitzRationalHighSum j :
ℚ
Causalean.Stat.CLT.BerryEsseen.prawitzRationalHighSum · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRationalData.lean:269
Esseen­Signed­Kernel 2 core · 0 supporting This reflected and shifted kernel is the explicit witness used in the unit-bandwidth one-sided Esseen comparison. ★ esseenSignedSinc4Kernel_integrable_continuous

The signed sinc-fourth comparison kernel

This reflected and shifted kernel is the explicit witness used in the unit-bandwidth one-sided Esseen comparison. Its elementary regularity is separated from its Fourier support and comparison properties.

def esseenSignedSinc4Kernel reviewed
Causalean.Stat.CLT.BerryEsseen

At a real argument y, the signed comparison kernel is -y/8 times the unit sinc-fourth density evaluated at -y-4.

Definition (Lean source)
y :
ℝ
esseenSignedSinc4Kernel y :
ℝ
(-y) / 8 * sinc4Kernel 1 (-y - 4)
Causalean.Stat.CLT.BerryEsseen.esseenSignedSinc4Kernel · Causalean/Stat/CLT/BerryEsseen/EsseenSignedKernel.lean:18
theorem esseenSignedSinc4Kernel_integrable_continuous reviewed
Causalean.Stat.CLT.BerryEsseen

The signed sinc-fourth comparison kernel (the reflected, shifted, linearly weighted sinc-fourth kernel) is integrable and continuous on the real line.

Formal statement
Proof (Lean source)
theorem esseenSignedSinc4Kernel_integrable_continuous : Integrable esseenSignedSinc4Kernel volume ∧ Continuous esseenSignedSinc4Kernel := by have hweighted : Integrable (fun x : ℝ => (x + 4) * sinc4Kernel 1 x) volume := by have h := sinc4Kernel_unit_first_moment.1.add ((sinc4Kernel_integrable 1 (by norm_num)).const_mul 4) apply h.congr filter_upwards with x simp only [Pi.add_apply, add_mul] have hshift : Integrable (fun x : ℝ => x * sinc4Kernel 1 (x - 4)) volume := by convert hweighted.comp_add_left (-4) using 1 ext x congr 1 <;> ring constructor · convert (hshift.comp_neg.const_mul (1 / 8 : ℝ)) using 1 ext x simp only [esseenSignedSinc4Kernel] ring · unfold esseenSignedSinc4Kernel sinc4Kernel fun_prop
Causalean.Stat.CLT.BerryEsseen.esseenSignedSinc4Kernel_integrable_continuous · Causalean/Stat/CLT/BerryEsseen/EsseenSignedKernel.lean:23 · uses esseenSignedSinc4Kernel
CDFDifference­Fourier­Kernel 2 core · 0 supporting The signed half-line indicators below have support between their endpoints. ★ orientedFourierKernel_integrable

An integrable oriented interval kernel

The signed half-line indicators below have support between their endpoints. Finite first moments make the resulting Fourier kernel integrable over two independent observations and Lebesgue measure. This is the domination needed for the CDF Fourier Fubini interchange.

def orientedFourierKernel reviewed
Causalean.Stat.CLT.BerryEsseen

The signed Fourier kernel of the interval oriented from a to b is the Fourier exponential times 1_{a ≤ x} - 1_{b ≤ x}. The choice of weak inequality makes averaging over laws with atoms recover their Iic CDFs.

Definition (Lean source)
t a b x :
ℝ
orientedFourierKernel t a b x :
ℂ
exp (((t * x : ℝ) : ℂ) * I) * (((if a ≤ x then 1 else 0 : ℝ) - (if b ≤ x then 1 else 0 : ℝ)) : ℂ)
Causalean.Stat.CLT.BerryEsseen.orientedFourierKernel · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierKernel.lean:18
theorem orientedFourierKernel_integrable reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws with finite first moments, the oriented interval Fourier kernel is integrable jointly in its two endpoints, drawn independently from the two laws, and the Lebesgue variable.

Formal statement
hμ :
Integrable (fun a : ℝ => a) μ
hν :
Integrable (fun b : ℝ => b) ν
t :
ℝ
Integrable (fun p : ℝ × (ℝ × ℝ) => orientedFourierKernel t p.1 p.2.1 p.2.2) (μ.prod (ν.prod volume))
Proof (Lean source)
theorem orientedFourierKernel_integrable (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun a : ℝ => a) μ) (hν : Integrable (fun b : ℝ => b) ν) (t : ℝ) : Integrable (fun p : ℝ × (ℝ × ℝ) => orientedFourierKernel t p.1 p.2.1 p.2.2) (μ.prod (ν.prod volume)) := by have hpair : Integrable (fun p : ℝ × ℝ => |p.2 - p.1|) (μ.prod ν) := by have hh := ((hν.comp_snd μ).sub (hμ.comp_fst ν)).abs simpa only [Pi.sub_apply] using hh have hgroup : Integrable (fun p : (ℝ × ℝ) × ℝ => orientedFourierKernel t p.1.1 p.1.2 p.2) ((μ.prod ν).prod volume) := by apply (integrable_prod_iff (measurable_orientedFourierKernel t).aestronglyMeasurable).mpr constructor · filter_upwards [] with p exact orientedFourierKernel_integrable_fiber t p.1 p.2 · simpa only [integral_norm_orientedFourierKernel] using hpair apply ((measurePreserving_prodAssoc μ ν (volume : Measure ℝ)).integrable_comp_emb MeasurableEquiv.prodAssoc.measurableEmbedding).mp simpa [Function.comp_def, MeasurableEquiv.prodAssoc] using hgroup
Causalean.Stat.CLT.BerryEsseen.orientedFourierKernel_integrable · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierKernel.lean:82 · uses orientedFourierKernel
Prawitz­Rational­Arithmetic 4 core · 5 supporting Finite Taylor polynomials, outward rounding, and existing bounds for pi turn the analytic cell enclosures into exact rational checks. ★ prawitz_rational_pi_bounds

Rational arithmetic for compact Prawitz certificates

Finite Taylor polynomials, outward rounding, and existing bounds for pi turn the analytic cell enclosures into exact rational checks. No floating point evaluation is used by these definitions or their comparison lemmas. The Taylor degree and rounding scale are fixed for the compact certificates.

def prawitzTaylor16 reviewed
Causalean.Stat.CLT.BerryEsseen

The sixteen-term Taylor polynomial at a rational argument is an exactly computable rational approximation to the exponential.

Definition (Lean source)
x :
ℚ
prawitzTaylor16 x :
ℚ
∑ m ∈ range 16, x ^ m / (m.factorial : ℚ)
Causalean.Stat.CLT.BerryEsseen.prawitzTaylor16 · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:20
def prawitzExpUpper8 reviewed
Causalean.Stat.CLT.BerryEsseen

The rational upper enclosure of the exponential at a rational argument x is the eighth power of the sixteen-term Taylor polynomial at x/8 plus the remainder term (x/8)¹⁶·17/(16!·16). It bounds exp(x) from above only for 0 ≤ x ≤ 8.

Definition (Lean source)
x :
ℚ
prawitzExpUpper8 x :
ℚ
(prawitzTaylor16 (x / 8) + (x / 8) ^ 16 * 17 / ((factorial 16 : ℚ) * 16)) ^ 8
Causalean.Stat.CLT.BerryEsseen.prawitzExpUpper8 · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:25
def prawitzRoundUp reviewed
Causalean.Stat.CLT.BerryEsseen

Outward rounding of a rational value is the smallest integer multiple of one hundred millionth that is at least that value, so it preserves an upper bound.

Definition (Lean source)
x :
ℚ
prawitzRoundUp x :
ℚ
(⌈100000000 * x⌉ : ℤ) / (100000000 : ℚ)
Causalean.Stat.CLT.BerryEsseen.prawitzRoundUp · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:33
theorem prawitz_rational_pi_bounds reviewed
Causalean.Stat.CLT.BerryEsseen

The rational endpoints 314159/100000 and 314160/100000 used by the compact certificates enclose π. Both inequalities follow from Mathlib's proved decimal bounds.

Formal statement
conclusion 1
(314159 / 100000 : ℝ) ≤ pi
conclusion 2
pi ≤ 314160 / 100000
Proof (Lean source)
theorem prawitz_rational_pi_bounds : (314159 / 100000 : ℝ) ≤ pi ∧ pi ≤ 314160 / 100000 := by constructor · linarith [Real.pi_gt_d6] · linarith [Real.pi_lt_d4]
Causalean.Stat.CLT.BerryEsseen.prawitz_rational_pi_bounds · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:92
5 supporting declarations (lemmas, instances)
  • prawitz_le_roundUp theorem — A rational input is no larger than its outward rounding.
    x :
    ℚ
    Proof (Lean source)
    theorem prawitz_le_roundUp (x : ℚ) : x ≤ prawitzRoundUp x := by have h := Int.le_ceil (100000000 * x) unfold prawitzRoundUp exact (le_div_iff₀ (by norm_num : (0 : ℚ) < 100000000)).2 (by simpa only [mul_comm] using h)
    Causalean.Stat.CLT.BerryEsseen.prawitz_le_roundUp · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:39
  • prawitzTaylor16_cast theorem — Casting the rational Taylor polynomial gives the real Taylor polynomial with exactly the same terms.
    x :
    ℚ
    (prawitzTaylor16 x : ℝ) = ∑ m ∈ range 16, (x : ℝ) ^ m / (m.factorial : ℝ)
    Proof (Lean source)
    theorem prawitzTaylor16_cast (x : ℚ) : (prawitzTaylor16 x : ℝ) = ∑ m ∈ range 16, (x : ℝ) ^ m / (m.factorial : ℝ) := by simp [prawitzTaylor16]
    Causalean.Stat.CLT.BerryEsseen.prawitzTaylor16_cast · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:46
  • prawitz_taylor16_pos_le_exp theorem — At a nonnegative real argument, the sixteen-term Taylor polynomial is positive and no larger than the exponential.
    x :
    ℝ
    hx :
    0 ≤ x
    conclusion 1
    0 < (∑ m ∈ range 16, x ^ m / (m.factorial : ℝ))
    conclusion 2
    (∑ m ∈ range 16, x ^ m / (m.factorial : ℝ)) ≤ exp x
    Proof (Lean source)
    theorem prawitz_taylor16_pos_le_exp (x : ℝ) (hx : 0 ≤ x) : 0 < (∑ m ∈ range 16, x ^ m / (m.factorial : ℝ)) ∧ (∑ m ∈ range 16, x ^ m / (m.factorial : ℝ)) ≤ exp x := by have hone : (1 : ℝ) ≤ ∑ m ∈ range 16, x ^ m / (m.factorial : ℝ) := by simpa using (single_le_sum (f := fun m : ℕ => x ^ m / (m.factorial : ℝ)) (fun m _ => by positivity) (show 0 ∈ range 16 by decide)) exact ⟨lt_of_lt_of_le (by norm_num) hone, Real.sum_le_exp_of_nonneg hx 16⟩
    Causalean.Stat.CLT.BerryEsseen.prawitz_taylor16_pos_le_exp · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:53
  • prawitz_exp_neg_le_reciprocal_taylor16 theorem — At a nonnegative rational argument, the reciprocal Taylor polynomial encloses the negative exponential.
    x :
    ℚ
    hx :
    0 ≤ x
    exp (-(x : ℝ)) ≤ (1 / prawitzTaylor16 x : ℚ)
    Proof (Lean source)
    theorem prawitz_exp_neg_le_reciprocal_taylor16 (x : ℚ) (hx : 0 ≤ x) : exp (-(x : ℝ)) ≤ (1 / prawitzTaylor16 x : ℚ) := by have hx' : (0 : ℝ) ≤ x := by exact_mod_cast hx have h := prawitz_taylor16_pos_le_exp (x : ℝ) hx' rw [Real.exp_neg] push_cast rw [prawitzTaylor16_cast] simpa only [one_div] using one_div_le_one_div_of_le h.1 h.2
    Causalean.Stat.CLT.BerryEsseen.prawitz_exp_neg_le_reciprocal_taylor16 · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:65
  • prawitz_exp_le_upper8 theorem — On the nonnegative interval through eight, the rational eighth-power Taylor remainder encloses the exponential.
    x :
    ℚ
    hx :
    0 ≤ x
    hx8 :
    x ≤ 8
    exp (x : ℝ) ≤ (prawitzExpUpper8 x : ℝ)
    Proof (Lean source)
    theorem prawitz_exp_le_upper8 (x : ℚ) (hx : 0 ≤ x) (hx8 : x ≤ 8) : exp (x : ℝ) ≤ (prawitzExpUpper8 x : ℝ) := by have hx' : (0 : ℝ) ≤ x := by exact_mod_cast hx have hx8' : (x : ℝ) ≤ 8 := by exact_mod_cast hx8 have h := Real.exp_bound' (x := (x : ℝ) / 8) (by positivity) (by linarith) (n := 16) (by norm_num) have hp := pow_le_pow_left₀ (Real.exp_nonneg _) h 8 rw [← Real.exp_nat_mul] at hp norm_num only [Nat.cast_ofNat] at hp have heq : 8 * ((x : ℝ) / 8) = x := by ring rw [heq] at hp norm_num [prawitzExpUpper8, prawitzTaylor16_cast] at hp ⊢ exact hp
    Causalean.Stat.CLT.BerryEsseen.prawitz_exp_le_upper8 · Causalean/Stat/CLT/BerryEsseen/PrawitzRationalArithmetic.lean:76
Sinc­Box­Fourier 2 core · 1 supporting The interval density whose Fourier transform is sinc is the first step in computing the squared-sinc transform by convolution and Fourier inversion. ★ sincBox_fourier

Fourier transform of a compact interval density

The interval density whose Fourier transform is sinc is the first step in computing the squared-sinc transform by convolution and Fourier inversion.

def sincBox reviewed
Causalean.Stat.CLT.BerryEsseen

The interval density at a real point: the complex number π when the point lies in the half-open interval (−1/(2π), 1/(2π)], and zero otherwise. It integrates to one, and its Fourier transform is the real sinc function.

Definition (Lean source)
t :
ℝ
sincBox t :
ℂ
(Ioc (-(2 * Real.pi)⁻¹) ((2 * Real.pi)⁻¹)).indicator (fun _ => (Real.pi : ℂ)) t
Causalean.Stat.CLT.BerryEsseen.sincBox · Causalean/Stat/CLT/BerryEsseen/SincBoxFourier.lean:17
theorem sincBox_fourier reviewed
Causalean.Stat.CLT.BerryEsseen

At every real frequency x, the Fourier transform of the compact interval density equal to π on (−1/(2π), 1/(2π)] is the real sinc function sin(x)/x, viewed as a complex number.

Formal statement
x :
ℝ
fourier sincBox x = (Real.sinc x : ℂ)
Proof (Lean source)
theorem sincBox_fourier (x : ℝ) : fourier sincBox x = (Real.sinc x : ℂ) := by rw [Real.fourier_real_eq_integral_exp_smul] unfold sincBox let a : ℝ := (2 * Real.pi)⁻¹ have ha : 0 < a := by dsimp [a] positivity have hind : (fun v : ℝ => exp (↑(-2 * Real.pi * v * x) * I) • (Ioc (-a) a).indicator (fun _ => (Real.pi : ℂ)) v) = (Ioc (-a) a).indicator (fun v => exp (↑(-2 * Real.pi * v * x) * I) • (Real.pi : ℂ)) := by funext v by_cases hv : v ∈ Ioc (-a) a <;> simp [indicator, hv] change (∫ v : ℝ, exp (↑(-2 * Real.pi * v * x) * I) • (Ioc (-a) a).indicator (fun _ => (Real.pi : ℂ)) v) = _ rw [hind, integral_indicator measurableSet_Ioc] rw [← intervalIntegral.integral_of_le (neg_le_self ha.le)] by_cases hx : x = 0 · subst x simp [a] field_simp [Real.pi_ne_zero] <;> ring · simp_rw [smul_eq_mul] rw [intervalIntegral.integral_mul_const] have hexp : (fun t : ℝ => exp (↑(-2 * Real.pi * t * x) * I)) = (fun t : ℝ => exp ((↑(-2 * Real.pi * x) * I) * t)) := by funext t congr 1 push_cast ring rw [hexp, integral_exp_mul_complex] · rw [Real.sinc_of_ne_zero hx] dsimp [a] push_cast have h₁ : -2 * (Real.pi : ℂ) * x * I * (2 * (Real.pi : ℂ))⁻¹ = -(x : ℂ) * I := by field_simp [Real.pi_ne_zero] have h₂ : -2 * (Real.pi : ℂ) * x * I * -(2 * (Real.pi : ℂ))⁻¹ = (x : ℂ) * I := by field_simp [Real.pi_ne_zero] rw [h₁, h₂] simp only [Complex.exp_mul_I, Complex.cos_neg, Complex.sin_neg] field_simp [Real.pi_ne_zero, hx] ring · norm_num [Real.pi_ne_zero, hx]
Causalean.Stat.CLT.BerryEsseen.sincBox_fourier · Causalean/Stat/CLT/BerryEsseen/SincBoxFourier.lean:32 · uses sincBox
1 supporting declaration (lemmas, instances)
Berry­Esseen­Core 1 core · 0 supporting This module isolates the probability-theoretic Berry–Esseen step from the cross-fitting model. ★ iid_real_berry_esseen

Quantitative scalar normal approximation for an iid real law

This module isolates the probability-theoretic Berry–Esseen step from the cross-fitting model. The law is on the real line and the sample has its finite product distribution. The third absolute moment is explicitly integrable; its numerical upper bound alone would not imply integrability in Lean.

theorem iid_real_berry_esseen reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered real law with positive variance σ2 and integrable third absolute moment at most M3, and any positive number n of independent draws, the CDF of the sum divided by √n·√σ2 differs from the standard Gaussian CDF at every threshold x by at most M3/((√σ2)³·√n): the scalar Berry–Esseen bound with universal constant one.

Formal statement
σ2 M3 :
ℝ
hσ2 :
0 < σ2
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = σ2
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
0 < n
x :
ℝ
|((Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / (sqrt (n : ℝ) * sqrt σ2) ≤ x}).toReal
- ((gaussianReal 0 1) (Iic x)).toReal|
≤ M3 / ((sqrt σ2) ^ 3 * sqrt (n : ℝ))
Proof (Lean source)
theorem iid_real_berry_esseen (μ : Measure ℝ) [IsProbabilityMeasure μ] (σ2 M3 : ℝ) (hσ2 : 0 < σ2) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = σ2) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 0 < n) (x : ℝ) : |((Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / (sqrt (n : ℝ) * sqrt σ2) ≤ x}).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ M3 / ((sqrt σ2) ^ 3 * sqrt (n : ℝ)) := by by_cases hn2 : 2 ≤ n · haveI : IsProbabilityMeasure (μ.map (fun y : ℝ => y / sqrt σ2)) := Measure.isProbabilityMeasure_map (by fun_prop) obtain ⟨hi1, hm, hi2, hv, hi3, h3⟩ := standardized_law_moments μ σ2 M3 hσ2 hmean_int hmean hvar_int hvar hthird_int hthird rw [standardized_iid_sum_event μ σ2 hσ2 n x] have h := iid_unit_variance_berry_esseen (μ.map (fun y : ℝ => y / sqrt σ2)) (M3 / (sqrt σ2) ^ 3) hi1 hm hi2 hv hi3 h3 n hn2 x simpa only [div_div] using h · have hn1 : n = 1 := by omega subst n norm_num only [Nat.cast_one] have hlower := variance_third_absolute_moment_lower_bound μ σ2 M3 hσ2 hmean_int hmean hvar_int hvar hthird_int hthird have hrhs : 1 ≤ M3 / ((sqrt σ2) ^ 3 * sqrt (1 : ℝ)) := by simp only [Real.sqrt_one, mul_one] exact (le_div_iff₀ (pow_pos (Real.sqrt_pos.2 hσ2) 3)).2 (by simpa using hlower) have hprob (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : (ρ (Iic x)).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top ρ _) (measure_mono (Set.subset_univ (Iic x))) simpa using h have hevent : ((Measure.pi (fun _ : Fin 1 => μ)) {v : Fin 1 → ℝ | (∑ i : Fin 1, v i) / (sqrt (1 : ℝ) * sqrt σ2) ≤ x}).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top (Measure.pi (fun _ : Fin 1 => μ)) _) (measure_mono (Set.subset_univ {v : Fin 1 → ℝ | (∑ i : Fin 1, v i) / (sqrt (1 : ℝ) * sqrt σ2) ≤ x})) simpa using h apply le_trans _ hrhs rw [abs_le] constructor <;> linarith [hprob (gaussianReal 0 1), ENNReal.toReal_nonneg (a := (gaussianReal 0 1) (Iic x)), ENNReal.toReal_nonneg (a := (Measure.pi (fun _ : Fin 1 => μ)) {v : Fin 1 → ℝ | (∑ i : Fin 1, v i) / (sqrt (1 : ℝ) * sqrt σ2) ≤ x})]
Causalean.Stat.CLT.BerryEsseen.iid_real_berry_esseen · Causalean/Stat/CLT/BerryEsseen/BerryEsseenCore.lean:26
Berry­Esseen­Fourier­Integral 1 core · 0 supporting The pointwise iid product estimate is integrated over its valid frequency window. ★ iid_unit_variance_charFun_interval_integral_bound

Integrated local characteristic-function estimate

The pointwise iid product estimate is integrated over its valid frequency window. This quantitative analytic step is independent of CDF smoothing.

theorem iid_unit_variance_charFun_interval_integral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance real law with integrable third absolute moment at most M3, where M3 is at least one, and a sample size n of at least two, the integral over the local window |t| ≤ √n/M3 of the distance between the characteristic function of the standardized iid sum and the standard Gaussian characteristic function, divided by |t|, is at most 9·M3/√n.

Formal statement
M3 :
ℝ
hM3 :
1 ≤ M3
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
2 ≤ n
(∫ t in (-(sqrt (n : ℝ) / M3))..(sqrt (n : ℝ) / M3), ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ / |t|)
≤ 9 * M3 / sqrt (n : ℝ)
Proof (Lean source)
theorem iid_unit_variance_charFun_interval_integral_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 2 ≤ n) : (∫ t in (-(sqrt (n : ℝ) / M3))..(sqrt (n : ℝ) / M3), ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ / |t|) ≤ 9 * M3 / sqrt (n : ℝ) := by let s : ℝ := sqrt (n : ℝ) let a : ℝ := s / M3 let c : ℝ := 7 * M3 / (24 * s) have hs : 0 < s := by dsimp [s]; positivity have hM : 0 < M3 := by linarith have ha : 0 ≤ a := by dsimp [a]; positivity have hc : 0 ≤ c := by dsimp [c]; positivity have hlocal (t : ℝ) (ht : |t| ≤ a) : ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t| ≤ c * t ^ 2 * exp (-(t ^ 2 / 6)) := by have h := iid_unit_variance_charFun_local_product_bound μ M3 hM3 hmean_int hmean hvar_int hvar hthird_int hthird n hn t (by simpa [a, s] using ht) by_cases ht0 : t = 0 · subst t simp · apply (div_le_iff₀ (abs_pos.mpr ht0)).2 calc ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ ≤ c * |t| ^ 3 * exp (-(t ^ 2 / 6)) := by simpa [c, s] using h _ = (c * t ^ 2 * exp (-(t ^ 2 / 6))) * |t| := by rw [show |t| ^ 3 = |t| * t ^ 2 by rw [← sq_abs]; ring] ring have henv (t : ℝ) : t ^ 2 * exp (-(t ^ 2 / 6)) ≤ 5 * exp (-(t ^ 2 / 12)) := by let y : ℝ := t ^ 2 / 12 have hle : y ≤ exp (y - 1) := by linarith [Real.add_one_le_exp (y - 1)] have hkey : y * exp (-y) ≤ exp (-1) := by calc _ ≤ exp (y - 1) * exp (-y) := mul_le_mul_of_nonneg_right hle (Real.exp_pos (-y)).le _ = exp (-1) := by rw [← Real.exp_add]; congr 1; ring have hexp : exp (-1) ≤ (5 / 12 : ℝ) := by have h := Real.exp_one_gt_d9 have he : exp (-1) * exp 1 = 1 := by rw [← Real.exp_add] norm_num nlinarith [Real.exp_pos (-1), Real.exp_pos 1] have hyy : y * exp (-y) ≤ 5 / 12 := hkey.trans hexp have heq : exp (-(t ^ 2 / 6)) = exp (-y) * exp (-y) := by rw [← Real.exp_add] congr 1 dsimp [y] ring rw [heq] have ht : t ^ 2 = 12 * y := by dsimp [y]; ring rw [ht] have hsimp : -(12 * y / 12) = -y := by ring rw [hsimp] have hm := mul_le_mul_of_nonneg_right hyy (Real.exp_pos (-y)).le nlinarith have hgauss : Integrable (fun t : ℝ => exp (-(t ^ 2 / 12))) volume := by convert integrable_exp_neg_mul_sq (b := (1 / 12 : ℝ)) (by norm_num) using 1 ext t congr 1 ring have hg : Integrable (fun t : ℝ => (c * 5) * exp (-(t ^ 2 / 12))) volume := hgauss.const_mul _ have hbound (t : ℝ) (ht : |t| ≤ a) : ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t| ≤ (c * 5) * exp (-(t ^ 2 / 12)) := by calc _ ≤ c * t ^ 2 * exp (-(t ^ 2 / 6)) := hlocal t ht _ ≤ c * (5 * exp (-(t ^ 2 / 12))) := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (henv t) hc _ = _ := by ring have hnorm : ‖∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|‖ ≤ ∫ t in (-a)..a, (c * 5) * exp (-(t ^ 2 / 12)) := by apply intervalIntegral.norm_integral_le_of_norm_le (by linarith : -a ≤ a) · exact Filter.Eventually.of_forall (fun t ht => by rw [Real.norm_eq_abs, abs_of_nonneg (div_nonneg (norm_nonneg _) (abs_nonneg _))] apply hbound t have hta : -a ≤ t := le_of_lt ht.1 exact abs_le.mpr ⟨by linarith, ht.2⟩) · exact hg.intervalIntegrable have hfull : (∫ t in (-a)..a, (c * 5) * exp (-(t ^ 2 / 12))) ≤ (c * 5) * sqrt (12 * pi) := by rw [intervalIntegral.integral_of_le (by linarith : -a ≤ a)] calc _ ≤ ∫ t : ℝ, (c * 5) * exp (-(t ^ 2 / 12)) := setIntegral_le_integral hg (Filter.Eventually.of_forall (fun t => by positivity)) _ = (c * 5) * sqrt (12 * pi) := by rw [integral_const_mul] have hi : (∫ t : ℝ, exp (-(t ^ 2 / 12))) = sqrt (12 * pi) := by convert integral_gaussian (1 / 12 : ℝ) using 1 · congr 1; ext t; congr 1; ring · congr 1; ring rw [hi] have hsqrt : sqrt (12 * pi) ≤ (617 / 100 : ℝ) := by have hp := Real.pi_lt_d4 have hsq := Real.sq_sqrt (by positivity : 0 ≤ 12 * pi) nlinarith [Real.sqrt_nonneg (12 * pi)] have hnum : (c * 5) * sqrt (12 * pi) ≤ 9 * M3 / s := by have h := mul_le_mul_of_nonneg_left hsqrt (by positivity : 0 ≤ c * 5) dsimp [c] at * apply (le_div_iff₀ hs).2 have hsne : s ≠ 0 := ne_of_gt hs field_simp at * nlinarith have hmain : (∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|) ≤ ‖∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|‖ := by rw [Real.norm_eq_abs] exact le_abs_self _ calc _ ≤ ‖∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|‖ := hmain _ ≤ ∫ t in (-a)..a, (c * 5) * exp (-(t ^ 2 / 12)) := hnorm _ ≤ (c * 5) * sqrt (12 * pi) := hfull _ ≤ 9 * M3 / s := hnum _ = _ := rfl
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_interval_integral_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenFourierIntegral.lean:19
Berry­Esseen­Gaussian 1 core · 0 supporting The characteristic function exp(−t²/2) of the standard normal law differs from its second-order Taylor polynomial 1 − t²/2 by at most t⁴/8, for every real t. ★ gaussian_charFun_quadratic_remainder

Quadratic approximation of the Gaussian characteristic function

The characteristic function exp(−t²/2) of the standard normal law differs from its second-order Taylor polynomial 1 − t²/2 by at most t⁴/8, for every real t. This is the Gaussian half of the local characteristic-function comparison in the Berry–Esseen proof: near the origin, both the characteristic function of a standardized law and that of the normal law are compared with the same quadratic.

Main results

* gaussian_charFun_quadratic_remainder — the bound |exp(−t²/2) − (1 − t²/2)| ≤ t⁴/8, deduced from |exp(−u) − (1 − u)| ≤ u²/2 for u ≥ 0.

theorem gaussian_charFun_quadratic_remainder reviewed
Causalean.Stat.CLT.BerryEsseen

The standard Gaussian characteristic function differs from its quadratic Taylor polynomial 1 − t²/2 by at most t⁴/8 at every real frequency t.

Formal statement
t :
ℝ
‖charFun (gaussianReal 0 1) t - ((1 : ℂ) - (t : ℂ) ^ 2 / 2)‖ ≤ |t| ^ 4 / 8
Proof (Lean source)
theorem gaussian_charFun_quadratic_remainder (t : ℝ) : ‖charFun (gaussianReal 0 1) t - ((1 : ℂ) - (t : ℂ) ^ 2 / 2)‖ ≤ |t| ^ 4 / 8 := by have hrem (u : ℝ) (hu : 0 ≤ u) : |exp (-u) - (1 - u)| ≤ u ^ 2 / 2 := by have hlow : 0 ≤ exp (-u) - (1 - u) := by linarith [Real.one_sub_le_exp_neg u] have hpoly : 0 ≤ 1 - u + u ^ 2 / 2 := by nlinarith [sq_nonneg (u - 1)] have hmul : 1 ≤ (1 - u + u ^ 2 / 2) * (1 + u + u ^ 2 / 2) := by nlinarith [sq_nonneg (u ^ 2)] have hquad := Real.quadratic_le_exp_of_nonneg hu have hprod : 1 ≤ (1 - u + u ^ 2 / 2) * exp u := le_trans hmul (mul_le_mul_of_nonneg_left hquad hpoly) have hupr : exp (-u) ≤ 1 - u + u ^ 2 / 2 := by rw [Real.exp_neg] simpa only [one_div] using (div_le_iff₀ (Real.exp_pos u)).2 hprod rw [abs_of_nonneg hlow] linarith have heq : charFun (gaussianReal 0 1) t - ((1 : ℂ) - (t : ℂ) ^ 2 / 2) = ((exp (-(t ^ 2 / 2)) - (1 - t ^ 2 / 2) : ℝ) : ℂ) := by simp [charFun_gaussianReal] rw [heq, Complex.norm_real] have h := hrem (t ^ 2 / 2) (by positivity) calc |exp (-(t ^ 2 / 2)) - (1 - t ^ 2 / 2)| ≤ (t ^ 2 / 2) ^ 2 / 2 := h _ = |t| ^ 4 / 8 := by rw [← abs_pow, abs_of_nonneg (by positivity : 0 ≤ t ^ 4)] ring
Causalean.Stat.CLT.BerryEsseen.gaussian_charFun_quadratic_remainder · Causalean/Stat/CLT/BerryEsseen/BerryEsseenGaussian.lean:24
Berry­Esseen­IIDEnvelopes 1 core · 1 supporting These analytic estimates connect the proved one-observation moment bounds to the deterministic smoothing budget. ★ iid_unit_variance_charFun_prawitz_discrepancy_bound

Iid powers under the explicit Prawitz moment envelopes

These analytic estimates connect the proved one-observation moment bounds to the deterministic smoothing budget. They import neither a CDF smoothing comparison nor any numerical allocation. Both estimates retain sample sizes at least two; the moment lower bound is explicit and can later be discharged by unit_second_moment_third_absolute_moment_ge_one.

theorem iid_unit_variance_charFun_prawitz_discrepancy_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance probability law with integrable third absolute moment at most a bound M3 no smaller than one, a sample size n of at least two, and a frequency t in the full outer Prawitz band |t| ≤ 12√n/(5·M3), the distance between the characteristic function of the standardized iid sum and the standard Gaussian characteristic function is at most Prawitz's discrepancy envelope at ratio M3/√n.

Formal statement
M3 :
ℝ
hM3 :
1 ≤ M3
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
2 ≤ n
t :
ℝ
ht :
|t| ≤ 12 / (5 * (M3 / sqrt (n : ℝ)))
‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖
≤ prawitzDiscrepancyEnvelope (M3 / sqrt (n : ℝ)) t
Proof (Lean source)
theorem iid_unit_variance_charFun_prawitz_discrepancy_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 2 ≤ n) (t : ℝ) (ht : |t| ≤ 12 / (5 * (M3 / sqrt (n : ℝ)))) : ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ ≤ prawitzDiscrepancyEnvelope (M3 / sqrt (n : ℝ)) t := by /- Derive BOTH minimum branches. The modulus-sum branch follows from the preceding moment bound, norm_sub_le, and the exact Gaussian norm. For the Taylor branch let a=phi_mu(u), b=phi_G(u), rho=M3/sqrt(n). One-step Taylor and Gaussian remainders give n*norm(a-b) <= rho*|t|³/6 + rho²*t⁴/8 (M3>=1). The one-step squared-modulus proof also gives norm(a),norm(b) <= exp((-t²/2+rho*|t|³/5)/n). Difference-of-powers then supplies exp(((n-1)/n)*(-t²/2+rho*|t|³/5)). The exponent is NONPOSITIVE because rho*|t|<=12/5<5/2; (n-1)/n>=1/2 therefore yields exp(-t²/4+rho*|t|³/10), exactly the original envelope. Do not substitute the narrower local-product theorem, restrict n, or change the coefficients. The power inequality is also in Mathlib; verify availability before duplicating the existing private induction. No integrability or distributional approximation is a new hypothesis. -/ let s : ℝ := sqrt (n : ℝ) let u : ℝ := t / s let ρ : ℝ := M3 / s let a : ℂ := charFun μ u let b : ℂ := charFun (gaussianReal 0 1) u let e : ℝ := -(u ^ 2 / 2) + M3 * |u| ^ 3 / 5 let r : ℝ := Real.exp e have hnreal : (2 : ℝ) ≤ n := by exact_mod_cast hn have hnpos : (0 : ℝ) < n := by linarith have hspos : 0 < s := by dsimp [s]; positivity have hsne : s ≠ 0 := ne_of_gt hspos have hs2 : s ^ 2 = (n : ℝ) := Real.sq_sqrt (by positivity) have hMpos : 0 < M3 := by linarith have hρpos : 0 < ρ := div_pos hMpos hspos have habsu : |u| = |t| / s := by simp [u, abs_div, abs_of_pos hspos] have hescale : (n : ℝ) * e = -(t ^ 2 / 2) + ρ * |t| ^ 3 / 5 := by dsimp [e, ρ] rw [habsu] dsimp [u] rw [div_pow, div_pow, ← hs2] field_simp have har : ‖a‖ ≤ r := norm_le_exp_cubic_of_sq_bound _ M3 u hM3 (unit_variance_charFun_norm_sq_cubic_bound μ M3 hmean_int hmean hvar_int hvar hthird_int hthird u) have hgauss (v : ℝ) : charFun (gaussianReal 0 1) v = exp ((-(v ^ 2 / 2) : ℝ) : ℂ) := by rw [charFun_gaussianReal] congr 1 push_cast ring have hgnorm (v : ℝ) : ‖charFun (gaussianReal 0 1) v‖ = Real.exp (-(v ^ 2 / 2)) := by rw [hgauss, Complex.norm_exp] simp norm_cast have hbr : ‖b‖ ≤ r := by rw [show ‖b‖ = Real.exp (-(u ^ 2 / 2)) from hgnorm u] apply Real.exp_le_exp.mpr dsimp [e] have hc : 0 ≤ M3 * |u| ^ 3 / 5 := by positivity linarith have hbscale : b ^ n = charFun (gaussianReal 0 1) t := by have hscale : (n : ℝ) * (u ^ 2 / 2) = t ^ 2 / 2 := by dsimp [u] rw [div_pow, ← hs2] field_simp dsimp [b] rw [hgauss, hgauss, ← Complex.exp_nat_mul] congr 1 norm_cast linarith [hscale] have hsum : ‖a ^ n - charFun (gaussianReal 0 1) t‖ ≤ prawitzMomentEnvelope ρ t + Real.exp (-(t ^ 2 / 2)) := by calc _ ≤ ‖a ^ n‖ + ‖charFun (gaussianReal 0 1) t‖ := norm_sub_le _ _ _ ≤ _ := by rw [hgnorm] exact add_le_add (iid_unit_variance_charFun_prawitz_moment_bound μ M3 hM3 hmean_int hmean hvar_int hvar hthird_int hthird n hn t) le_rfl have hgap : ‖a - b‖ ≤ M3 * |u| ^ 3 / 6 + |u| ^ 4 / 8 := by let q : ℂ := 1 - (u : ℂ) ^ 2 / 2 have haerr : ‖a - q‖ ≤ M3 * |u| ^ 3 / 6 := by simpa [a, q] using centered_charFun_quadratic_remainder μ 1 M3 hmean_int hmean hvar_int hvar hthird_int hthird u have hberr : ‖b - q‖ ≤ |u| ^ 4 / 8 := gaussian_charFun_quadratic_remainder u calc _ ≤ ‖a - q‖ + ‖q - b‖ := norm_sub_le_norm_sub_add_norm_sub a q b _ ≤ _ := by rw [norm_sub_rev q b]; exact add_le_add haerr hberr have hscaled : (n : ℝ) * ‖a - b‖ ≤ ρ * |t| ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8 := by calc _ ≤ (n : ℝ) * (M3 * |u| ^ 3 / 6 + |u| ^ 4 / 8) := mul_le_mul_of_nonneg_left hgap hnpos.le _ = ρ * |t| ^ 3 / 6 + t ^ 4 / (8 * s ^ 2) := by rw [habsu, div_pow, div_pow] dsimp [ρ] have ht4 : |t| ^ 4 = t ^ 4 := by rw [← abs_pow, abs_of_nonneg (by positivity : 0 ≤ t ^ 4)] rw [← hs2, ht4] field_simp _ ≤ _ := by have hMsq : 1 ≤ M3 ^ 2 := by nlinarith have h := mul_le_mul_of_nonneg_right hMsq (show 0 ≤ t ^ 4 / (8 * s ^ 2) by positivity) have heq : ρ ^ 2 * t ^ 4 / 8 = M3 ^ 2 * (t ^ 4 / (8 * s ^ 2)) := by dsimp [ρ] field_simp rw [heq] linarith have hband : ρ * |t| ≤ 12 / 5 := by have h := (le_div_iff₀ (show 0 < 5 * ρ by positivity)).mp ht change |t| * (5 * ρ) ≤ 12 at h linarith have hE : -(t ^ 2 / 2) + ρ * |t| ^ 3 / 5 ≤ 0 := by have h := mul_le_mul_of_nonneg_right hband (sq_nonneg t) have hid : |t| ^ 3 = |t| * t ^ 2 := by rw [pow_succ, sq_abs]; ring rw [hid] nlinarith have he : e ≤ 0 := by nlinarith [hescale] have hrpow : r ^ (n - 1) ≤ Real.exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10) := by dsimp [r] rw [← Real.exp_nat_mul] apply Real.exp_le_exp.mpr have hnsubreal : ((n - 1 : ℕ) : ℝ) = (n : ℝ) - 1 := by rw [Nat.cast_sub (by omega)] simp rw [hnsubreal] have hhalf : (n : ℝ) / 2 ≤ (n : ℝ) - 1 := by linarith have h := mul_le_mul_of_nonpos_right hhalf he nlinarith [hescale] rw [prawitzDiscrepancyEnvelope] apply le_min · rw [← hbscale] change ‖a ^ n - b ^ n‖ ≤ _ calc _ ≤ (n : ℝ) * ‖a - b‖ * r ^ (n - 1) := norm_pow_sub_pow_le_radius a b r (Real.exp_nonneg _) har hbr n _ ≤ (ρ * |t| ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * r ^ (n - 1) := mul_le_mul_of_nonneg_right hscaled (by positivity) _ ≤ _ := mul_le_mul_of_nonneg_left hrpow (by positivity) · exact hsum
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_prawitz_discrepancy_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenIIDEnvelopes.lean:112 · uses prawitzDiscrepancyEnvelope
1 supporting declaration (lemmas, instances)
  • iid_unit_variance_charFun_prawitz_moment_bound theorem — For a centered unit-variance probability law with third absolute moment at most a bound no smaller than one, the standardized iid characteristic-function power at every frequency and sample size at least two is bounded by the explicit cubic moment envelope.
    M3 :
    ℝ
    hM3 :
    1 ≤ M3
    hmean_int :
    Integrable (fun x : ℝ => x) μ
    hmean :
    ∫ x : ℝ, x ∂μ = 0
    hvar_int :
    Integrable (fun x : ℝ => x ^ 2) μ
    hvar :
    ∫ x : ℝ, x ^ 2 ∂μ = 1
    hthird_int :
    Integrable (fun x : ℝ => |x| ^ 3) μ
    hthird :
    ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
    n :
    ℕ
    hn :
    2 ≤ n
    t :
    ℝ
    ‖(charFun μ (t / sqrt (n : ℝ))) ^ n‖
    ≤ prawitzMomentEnvelope (M3 / sqrt (n : ℝ)) t
    Proof (Lean source)
    theorem iid_unit_variance_charFun_prawitz_moment_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 2 ≤ n) (t : ℝ) : ‖(charFun μ (t / sqrt (n : ℝ))) ^ n‖ ≤ prawitzMomentEnvelope (M3 / sqrt (n : ℝ)) t := by /- Put u=t/sqrt(n). The proved squared modulus is bounded by 1-u²+(M3+1)|u|³/5 <= exp(-u²+(M3+1)|u|³/5). Taking square roots and raising to n gives exp(-t²/2+ (M3+1)|t|³/(10*sqrt(n))). Since M3>=1 this is at most exp(-t²/2+rho|t|³/5). Independently norm_charFun_le_one and norm_pow bound the power by one. No frequency restriction is needed. Use Real.add_one_le_exp, Real.exp_nat_mul, and sqrt(n)^2=n. The nonnegative squared modulus justifies taking the square root even when the intermediate polynomial was not separately proved positive. -/ have hnreal : (2 : ℝ) ≤ n := by exact_mod_cast hn have hspos : 0 < sqrt (n : ℝ) := by positivity have hsne := ne_of_gt hspos have hs2 : sqrt (n : ℝ) ^ 2 = n := Real.sq_sqrt (by positivity) have ha := norm_le_exp_cubic_of_sq_bound _ M3 _ hM3 (unit_variance_charFun_norm_sq_cubic_bound μ M3 hmean_int hmean hvar_int hvar hthird_int hthird (t / sqrt (n : ℝ))) rw [prawitzMomentEnvelope, norm_pow] apply le_min · simpa using pow_le_pow_left₀ (norm_nonneg _) (norm_charFun_le_one (μ := μ) (t / sqrt (n : ℝ))) n · calc ‖charFun μ (t / sqrt (n : ℝ))‖ ^ n ≤ (exp ( -((t / sqrt (n : ℝ)) ^ 2 / 2) + M3 * |t / sqrt (n : ℝ)| ^ 3 / 5)) ^ n := pow_le_pow_left₀ (norm_nonneg _) ha n _ = exp (-(t ^ 2 / 2) + (M3 / sqrt (n : ℝ)) * |t| ^ 3 / 5) := by rw [← Real.exp_nat_mul] congr 1 generalize hs : sqrt (n : ℝ) = s at * rw [abs_div, abs_of_pos hspos, div_pow, div_pow, ← hs2] field_simp
    Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_prawitz_moment_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenIIDEnvelopes.lean:62
Berry­Esseen­Local­Product 1 core · 0 supporting The Taylor estimates for one centered draw and for a Gaussian become a frequency-dependent estimate for their powers. ★ iid_unit_variance_charFun_local_product_bound

Local product estimate for a standardized iid characteristic function

The Taylor estimates for one centered draw and for a Gaussian become a frequency-dependent estimate for their powers. The frequency cutoff is the natural third-moment scale used by a scalar Berry–Esseen proof.

theorem iid_unit_variance_charFun_local_product_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance real law with integrable third absolute moment at most M3, where M3 is at least one, a sample size n of at least two, and a frequency with |t| ≤ √n/M3, the characteristic function of the standardized iid sum differs from the standard Gaussian characteristic function by at most (7·M3/(24√n))·|t|³·exp(−t²/6), an explicit cubic error with Gaussian decay.

Formal statement
M3 :
ℝ
hM3 :
1 ≤ M3
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
2 ≤ n
t :
ℝ
ht :
|t| ≤ sqrt (n : ℝ) / M3
‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖
≤ (7 * M3 / (24 * sqrt (n : ℝ))) * |t| ^ 3 * exp (-(t ^ 2 / 6))
Proof (Lean source)
theorem iid_unit_variance_charFun_local_product_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 2 ≤ n) (t : ℝ) (ht : |t| ≤ sqrt (n : ℝ) / M3) : ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ ≤ (7 * M3 / (24 * sqrt (n : ℝ))) * |t| ^ 3 * exp (-(t ^ 2 / 6)) := by let s : ℝ := sqrt (n : ℝ) let u : ℝ := t / s let a : ℂ := charFun μ u let b : ℂ := charFun (gaussianReal 0 1) u let q : ℂ := 1 - (u : ℂ) ^ 2 / 2 let r : ℝ := exp (-(u ^ 2 / 3)) have hnreal : (2 : ℝ) ≤ n := by exact_mod_cast hn have hspos : 0 < s := by dsimp [s]; positivity have hs2 : s ^ 2 = (n : ℝ) := Real.sq_sqrt (by positivity) have hMpos : 0 < M3 := by linarith have huabs : |u| ≤ 1 / M3 := by dsimp [u] rw [abs_div, abs_of_pos hspos] exact (div_le_div_iff₀ hspos hMpos).2 ((le_div_iff₀ hMpos).1 (by simpa [s] using ht)) have hu1 : |u| ≤ 1 := (huabs.trans (div_le_one hMpos |>.2 hM3)) have hu2 : u ^ 2 ≤ 1 := by nlinarith [sq_nonneg u, abs_nonneg u, sq_abs u] have hMabs : M3 * |u| ≤ 1 := by calc M3 * |u| ≤ M3 * (1 / M3) := mul_le_mul_of_nonneg_left huabs (le_of_lt hMpos) _ = 1 := by field_simp have hnonneg : 0 ≤ (1 : ℝ) - u ^ 2 / 2 := by linarith have hq : ‖q‖ = 1 - u ^ 2 / 2 := by have hqeq : q = ((1 - u ^ 2 / 2 : ℝ) : ℂ) := by push_cast rfl simp only [hqeq, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hnonneg] have haerr : ‖a - q‖ ≤ M3 * |u| ^ 3 / 6 := by simpa [a, q] using centered_charFun_quadratic_remainder μ 1 M3 hmean_int hmean hvar_int hvar hthird_int hthird u have hberr : ‖b - q‖ ≤ |u| ^ 4 / 8 := by simpa [b, q] using gaussian_charFun_quadratic_remainder u have hberr' : ‖b - q‖ ≤ M3 * |u| ^ 3 / 8 := by calc ‖b - q‖ ≤ |u| ^ 4 / 8 := hberr _ ≤ M3 * |u| ^ 3 / 8 := by have h : |u| ^ 4 ≤ M3 * |u| ^ 3 := by calc |u| ^ 4 = |u| ^ 3 * |u| := by ring _ ≤ |u| ^ 3 * 1 := mul_le_mul_of_nonneg_left hu1 (by positivity) _ ≤ |u| ^ 3 * M3 := mul_le_mul_of_nonneg_left hM3 (by positivity) _ = M3 * |u| ^ 3 := by ring nlinarith have hgap : ‖a - b‖ ≤ 7 * M3 * |u| ^ 3 / 24 := by have htri : ‖a - b‖ ≤ ‖a - q‖ + ‖b - q‖ := by calc ‖a - b‖ = ‖(a - q) + (q - b)‖ := by congr 1; ring _ ≤ ‖a - q‖ + ‖q - b‖ := norm_add_le _ _ _ = ‖a - q‖ + ‖b - q‖ := congrArg _ (norm_sub_rev q b) linarith have har : ‖a‖ ≤ r := by have htri : ‖a‖ ≤ ‖a - q‖ + ‖q‖ := by simpa only [sub_add_cancel] using (norm_add_le (a - q) q) have hlocal : ‖a‖ ≤ 1 - u ^ 2 / 3 := by rw [hq] at htri have hm : M3 * |u| ^ 3 ≤ u ^ 2 := by have h := mul_le_mul_of_nonneg_right hMabs (sq_nonneg u) nlinarith [h, sq_abs u, abs_nonneg u] linarith have hexp : 1 - u ^ 2 / 3 ≤ r := by dsimp [r] have := Real.add_one_le_exp (-(u ^ 2 / 3)) linarith exact hlocal.trans hexp have hbform : b = exp ((-(u ^ 2 / 2) : ℝ) : ℂ) := by dsimp [b] rw [charFun_gaussianReal] congr 1 push_cast ring have hbr : ‖b‖ ≤ r := by have hbval : ‖b‖ = exp (-(u ^ 2 / 2)) := by rw [hbform, Complex.norm_exp] simp norm_cast rw [hbval] exact Real.exp_le_exp.mpr (by nlinarith [sq_nonneg u]) have hrpos : 0 ≤ r := le_of_lt (Real.exp_pos _) have hpow := norm_pow_sub_pow_le_of_bound a b r hrpos har hbr (n - 1) have hnsub : n - 1 + 1 = n := Nat.sub_add_cancel (by omega) rw [hnsub] at hpow have hbscale : b ^ n = charFun (gaussianReal 0 1) t := by have htform : charFun (gaussianReal 0 1) t = exp ((-(t ^ 2 / 2) : ℝ) : ℂ) := by rw [charFun_gaussianReal] congr 1 push_cast ring have hscale : (n : ℝ) * (u ^ 2 / 2) = t ^ 2 / 2 := by dsimp [u] rw [div_pow, hs2] field_simp rw [hbform, htform, ← Complex.exp_nat_mul] congr 1 norm_cast linarith [hscale] have hrpow : r ^ (n - 1) ≤ exp (-(t ^ 2 / 6)) := by rw [← Real.exp_nat_mul] apply Real.exp_le_exp.mpr have hnsubreal : (n - 1 : ℕ) = (n : ℝ) - 1 := by rw [Nat.cast_sub (by omega)] simp rw [hnsubreal] have hscale : (n : ℝ) * u ^ 2 = t ^ 2 := by dsimp [u] rw [div_pow, hs2] field_simp have hhalf : (n : ℝ) / 2 ≤ (n : ℝ) - 1 := by linarith nlinarith [sq_nonneg u, hscale] rw [← hbscale] change ‖a ^ n - b ^ n‖ ≤ _ calc ‖a ^ n - b ^ n‖ ≤ (n : ℝ) * ‖a - b‖ * r ^ (n - 1) := by simpa using hpow _ ≤ (n : ℝ) * (7 * M3 * |u| ^ 3 / 24) * r ^ (n - 1) := by gcongr _ ≤ (n : ℝ) * (7 * M3 * |u| ^ 3 / 24) * exp (-(t ^ 2 / 6)) := by gcongr _ = (7 * M3 / (24 * s)) * |t| ^ 3 * exp (-(t ^ 2 / 6)) := by have hsne : s ≠ 0 := ne_of_gt hspos simp only [u, abs_div, abs_of_pos hspos] rw [div_pow] rw [← hs2] field_simp
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_local_product_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenLocalProduct.lean:43
Berry­Esseen­Moment­Lower­Bound 1 core · 1 supporting The third absolute moment of a unit-second-moment probability law is at least one. ★ variance_third_absolute_moment_lower_bound

Third absolute moments and the Berry–Esseen endpoint

The third absolute moment of a unit-second-moment probability law is at least one. Scaling gives the corresponding lower bound at arbitrary positive variance, which closes the one-observation case without a normal approximation. This module imports no quantitative central limit or smoothing theorem.

theorem variance_third_absolute_moment_lower_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered scalar probability law with positive variance σ2 and integrable third absolute moment at most M3, M3 is at least the cube of the standard deviation √σ2.

Formal statement
σ2 M3 :
ℝ
hσ2 :
0 < σ2
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = σ2
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
(sqrt σ2) ^ 3 ≤ M3
Proof (Lean source)
theorem variance_third_absolute_moment_lower_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (σ2 M3 : ℝ) (hσ2 : 0 < σ2) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = σ2) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) : (sqrt σ2) ^ 3 ≤ M3 := by haveI : IsProbabilityMeasure (μ.map (fun x : ℝ => x / sqrt σ2)) := Measure.isProbabilityMeasure_map (by fun_prop) obtain ⟨_, _, hi2, h2, hi3, h3⟩ := standardized_law_moments μ σ2 M3 hσ2 hmean_int hmean hvar_int hvar hthird_int hthird have h := (unit_second_moment_third_absolute_moment_ge_one (μ.map (fun x : ℝ => x / sqrt σ2)) hi2 h2 hi3).trans h3 simpa only [one_mul] using (le_div_iff₀ (pow_pos (Real.sqrt_pos.2 hσ2) 3)).1 h
Causalean.Stat.CLT.BerryEsseen.variance_third_absolute_moment_lower_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenMomentLowerBound.lean:44
1 supporting declaration (lemmas, instances)
  • unit_second_moment_third_absolute_moment_ge_one theorem — A real probability law with second moment one and integrable third absolute moment has third absolute moment at least one.
    hsecond_int :
    Integrable (fun x : ℝ => x ^ 2) μ
    hsecond :
    ∫ x : ℝ, x ^ 2 ∂μ = 1
    hthird_int :
    Integrable (fun x : ℝ => |x| ^ 3) μ
    1 ≤ ∫ x : ℝ, |x| ^ 3 ∂μ
    Proof (Lean source)
    theorem unit_second_moment_third_absolute_moment_ge_one (μ : Measure ℝ) [IsProbabilityMeasure μ] (hsecond_int : Integrable (fun x : ℝ => x ^ 2) μ) (hsecond : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) : 1 ≤ ∫ x : ℝ, |x| ^ 3 ∂μ := by /- No general Holder infrastructure is needed here. For r=|x|≥0, (r-1)^2*(2*r+1)≥0 gives (3/2)*x^2-1/2≤|x|^3. Integrate this pointwise inequality using integral_mono, integral_sub, integral_const_mul, and the probability-law normalization. -/ have hpoint (x : ℝ) : (3 / 2 : ℝ) * x ^ 2 - 1 / 2 ≤ |x| ^ 3 := by have hnonneg : 0 ≤ (|x| - 1) ^ 2 * (2 * |x| + 1) := mul_nonneg (sq_nonneg _) (by positivity) have hsquare : |x| ^ 2 = x ^ 2 := sq_abs x nlinarith have hscaled_int := hsecond_int.const_mul (3 / 2 : ℝ) have hconst_int : Integrable (fun _ : ℝ => (1 / 2 : ℝ)) μ := integrable_const _ have hbound := integral_mono (hscaled_int.sub hconst_int) hthird_int hpoint change (∫ x : ℝ, (3 / 2 : ℝ) * x ^ 2 - 1 / 2 ∂μ) ≤ ∫ x : ℝ, |x| ^ 3 ∂μ at hbound rw [integral_sub hscaled_int hconst_int, integral_const_mul, hsecond] at hbound norm_num at hbound exact hbound
    Causalean.Stat.CLT.BerryEsseen.unit_second_moment_third_absolute_moment_ge_one · Causalean/Stat/CLT/BerryEsseen/BerryEsseenMomentLowerBound.lean:18
Berry­Esseen­Prawitz­Budget 1 core · 0 supporting The unchanged explicit smoothing envelope is bounded by four focused sufficient estimates. ★ prawitz_berry_esseen_budget

A numerical budget for the sharper Berry–Esseen route

The unchanged explicit smoothing envelope is bounded by four focused sufficient estimates. The three integral allocations are 1/4, 3/20, and 3/5 of the ratio, summing to one. Each estimate is proved in its own imported module; this module only combines them.

theorem prawitz_berry_esseen_budget reviewed
Causalean.Stat.CLT.BerryEsseen

For a third-moment ratio ρ strictly between zero and one, with inner cutoff U0 = max(3/2, √(4 log(1/ρ))) and outer cutoff U = 12/(5ρ), the inner cutoff is at most the outer cutoff and the full deterministic Prawitz smoothing envelope at these cutoffs is at most ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
U0 ≤ U
Proof (Lean source)
theorem prawitz_berry_esseen_budget (ρ : ℝ) (hρ : 0 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) U0 ≤ U ∧ prawitzBerryEsseenEnvelope ρ U0 U ≤ ρ := by refine ⟨(prawitz_budget_cutoffs ρ hρ hρ1).2, ?_⟩ have hlo := prawitz_budget_low ρ hρ hρ1 have hhi := prawitz_budget_high ρ hρ hρ1 have hg := prawitz_budget_gaussian ρ hρ hρ1 dsimp only at hlo hhi hg ⊢ unfold prawitzBerryEsseenEnvelope linarith
Causalean.Stat.CLT.BerryEsseen.prawitz_berry_esseen_budget · Causalean/Stat/CLT/BerryEsseen/BerryEsseenPrawitzBudget.lean:21 · uses prawitzBerryEsseenEnvelope
Berry­Esseen­Refined­Fourier­Integral 1 core · 0 supporting The refined characteristic-function product estimate is integrated on its half-size frequency window with a useful numerical constant. ★ iid_unit_variance_charFun_refined_interval_integral_bound

Integrated refined local iid Fourier estimate

The refined characteristic-function product estimate is integrated on its half-size frequency window with a useful numerical constant.

theorem iid_unit_variance_charFun_refined_interval_integral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance real law with integrable third absolute moment at most M3, where M3 is at least one, and a sample size n of at least four, the integral over the refined window |t| ≤ √n/(2·M3) of the distance between the characteristic function of the standardized iid sum and the standard Gaussian characteristic function, divided by |t|, is at most 2·M3/√n.

Formal statement
M3 :
ℝ
hM3 :
1 ≤ M3
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
4 ≤ n
(∫ t in (-(sqrt (n : ℝ) / (2 * M3))).. (sqrt (n : ℝ) / (2 * M3)), ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ / |t|)
≤ 2 * M3 / sqrt (n : ℝ)
Proof (Lean source)
theorem iid_unit_variance_charFun_refined_interval_integral_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 4 ≤ n) : (∫ t in (-(sqrt (n : ℝ) / (2 * M3))).. (sqrt (n : ℝ) / (2 * M3)), ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ / |t|) ≤ 2 * M3 / sqrt (n : ℝ) := by /- Apply iid_unit_variance_charFun_refined_local_product_bound pointwise; after division by |t|, integrate (M3/(4√n)) t² exp(-t²/4) over the entire real line. Its exact value is √π M3/√n, which is ≤ 2 M3/√n. Handle t=0 separately and use a proved Gaussian-moment integral. -/ let s : ℝ := sqrt (n : ℝ) let a : ℝ := s / (2 * M3) let c : ℝ := M3 / (4 * s) let g : ℝ → ℝ := fun t => t ^ 2 * exp (-(t ^ 2 / 4)) have hs : 0 < s := by dsimp [s]; positivity have hM : 0 < M3 := by linarith have ha : 0 ≤ a := by dsimp [a]; positivity have hc : 0 ≤ c := by dsimp [c]; positivity have hg : Integrable g volume := by convert integrable_rpow_mul_exp_neg_mul_sq (b := (1 / 4 : ℝ)) (by norm_num) (s := (2 : ℝ)) (by norm_num) using 1 ext t simp only [g] rw [show -(t ^ 2 / 4) = -(1 / 4 : ℝ) * t ^ 2 by ring] rw [Real.rpow_two] have hlocal (t : ℝ) (ht : |t| ≤ a) : ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t| ≤ c * g t := by have h := iid_unit_variance_charFun_refined_local_product_bound μ M3 hM3 hmean_int hmean hvar_int hvar hthird_int hthird n hn t (by simpa [a, s] using ht) by_cases ht0 : t = 0 · subst t simp [g] · apply (div_le_iff₀ (abs_pos.mpr ht0)).2 calc ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ ≤ c * |t| ^ 3 * exp (-(t ^ 2 / 4)) := by simpa [c, s] using h _ = (c * g t) * |t| := by rw [show |t| ^ 3 = |t| * t ^ 2 by rw [← sq_abs]; ring] dsimp [g] ring have hnorm : ‖∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|‖ ≤ ∫ t in (-a)..a, c * g t := by apply intervalIntegral.norm_integral_le_of_norm_le (by linarith : -a ≤ a) · exact Filter.Eventually.of_forall (fun t ht => by rw [Real.norm_eq_abs, abs_of_nonneg (div_nonneg (norm_nonneg _) (abs_nonneg _))] apply hlocal t have hta : -a ≤ t := le_of_lt ht.1 exact abs_le.mpr ⟨by linarith, ht.2⟩) · exact (hg.const_mul c).intervalIntegrable have hhalf : (∫ t in Ioi (0 : ℝ), g t) = 2 * sqrt pi := by have h := integral_rpow_mul_exp_neg_mul_rpow (p := (2 : ℝ)) (q := (2 : ℝ)) (b := (1 / 4 : ℝ)) (by norm_num) (by norm_num) (by norm_num) convert h using 1 · refine setIntegral_congr_fun measurableSet_Ioi (fun t ht => ?_) simp only [g] rw [show -(t ^ 2 / 4) = -(1 / 4 : ℝ) * t ^ 2 by ring] rw [Real.rpow_two] · norm_num [Real.Gamma_add_one, Real.Gamma_one_half_eq] rw [show (3 : ℝ) / 2 = (1 / 2 : ℝ) + 1 by ring, Real.Gamma_add_one (by norm_num), Real.Gamma_one_half_eq] ring have hfull : (∫ t : ℝ, g t) = 4 * sqrt pi := by have heven (t : ℝ) : g (-t) = g t := by simp [g] have hneg : (∫ t in Iic (0 : ℝ), g t) = ∫ t in Ioi (0 : ℝ), g t := by simpa only [neg_zero, heven] using (integral_comp_neg_Ioi 0 g).symm rw [← integral_add_compl (s := Ioi 0) (by simp) hg, Set.compl_Ioi, hneg] rw [hhalf] ring have hwindow : (∫ t in (-a)..a, c * g t) ≤ c * (4 * sqrt pi) := by rw [intervalIntegral.integral_of_le (by linarith : -a ≤ a)] calc _ ≤ ∫ t : ℝ, c * g t := setIntegral_le_integral (hg.const_mul c) (Filter.Eventually.of_forall (fun t => by dsimp [g]; positivity)) _ = c * (4 * sqrt pi) := by rw [integral_const_mul, hfull] have hpi : sqrt pi ≤ 2 := by have hsq := Real.sq_sqrt Real.pi_nonneg nlinarith [Real.sqrt_nonneg pi, Real.pi_lt_four] have hnum : c * (4 * sqrt pi) ≤ 2 * M3 / s := by have h := mul_le_mul_of_nonneg_left hpi (by positivity : 0 ≤ 4 * c) dsimp [c] at * apply (le_div_iff₀ hs).2 field_simp at * nlinarith calc (∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|) ≤ ‖∫ t in (-a)..a, ‖(charFun μ (t / s)) ^ n - charFun (gaussianReal 0 1) t‖ / |t|‖ := by rw [Real.norm_eq_abs] exact le_abs_self _ _ ≤ ∫ t in (-a)..a, c * g t := hnorm _ ≤ c * (4 * sqrt pi) := hwindow _ ≤ 2 * M3 / s := hnum _ = _ := rfl
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_refined_interval_integral_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenRefinedFourierIntegral.lean:19
Berry­Esseen­Refined­Local­Product 1 core · 0 supporting On a smaller frequency window the third-moment Taylor error allows a stronger Gaussian damping factor. ★ iid_unit_variance_charFun_refined_local_product_bound

Refined local characteristic-function product estimate

On a smaller frequency window the third-moment Taylor error allows a stronger Gaussian damping factor. This analytic estimate is separate from the CDF inversion and finite-sample normal approximation steps.

theorem iid_unit_variance_charFun_refined_local_product_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance real law with integrable third absolute moment at most M3, where M3 is at least one, a sample size n of at least four, and a frequency in the half-size window |t| ≤ √n/(2·M3), the characteristic function of the standardized iid sum differs from the standard Gaussian characteristic function by at most (M3/(4√n))·|t|³·exp(−t²/4).

Formal statement
M3 :
ℝ
hM3 :
1 ≤ M3
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
4 ≤ n
t :
ℝ
ht :
|t| ≤ sqrt (n : ℝ) / (2 * M3)
‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖
≤ (M3 / (4 * sqrt (n : ℝ))) * |t| ^ 3 * exp (-(t ^ 2 / 4))
Proof (Lean source)
theorem iid_unit_variance_charFun_refined_local_product_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hM3 : 1 ≤ M3) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 4 ≤ n) (t : ℝ) (ht : |t| ≤ sqrt (n : ℝ) / (2 * M3)) : ‖(charFun μ (t / sqrt (n : ℝ))) ^ n - charFun (gaussianReal 0 1) t‖ ≤ (M3 / (4 * sqrt (n : ℝ))) * |t| ^ 3 * exp (-(t ^ 2 / 4)) := by /- Put u=t/√n and q=1-u²/2. Taylor gives ‖φμ(u)-q‖ ≤ M3|u|³/6 and ‖φG(u)-q‖ ≤ |u|⁴/8. Since M3|u|≤1/2, their sum is at most (11/48) M3|u|³ ≤ M3|u|³/4. Also ‖φμ(u)‖ ≤ 1-(5/12)u² ≤ exp(-(5/12)u²), and the Gaussian factor obeys the same bound. Apply the difference-of-powers estimate from BerryEsseenLocalProduct and use (n-1)/n ≥ 3/4 to obtain exp(-t²/4). No CDF approximation is assumed here. -/ let s : ℝ := sqrt (n : ℝ) let u : ℝ := t / s let a : ℂ := charFun μ u let b : ℂ := charFun (gaussianReal 0 1) u let q : ℂ := 1 - (u : ℂ) ^ 2 / 2 let r : ℝ := exp (-(5 * u ^ 2 / 12)) have hnreal : (4 : ℝ) ≤ n := by exact_mod_cast hn have hspos : 0 < s := by dsimp [s]; positivity have hs2 : s ^ 2 = (n : ℝ) := Real.sq_sqrt (by positivity) have hMpos : 0 < M3 := by linarith have huabs : |u| ≤ 1 / (2 * M3) := by dsimp [u] rw [abs_div, abs_of_pos hspos] exact (div_le_div_iff₀ hspos (by positivity : 0 < 2 * M3)).2 ((le_div_iff₀ (by positivity : 0 < 2 * M3)).1 (by simpa [s] using ht)) have hu1 : |u| ≤ 1 := by have h : 1 / (2 * M3) ≤ 1 := (div_le_one (by positivity)).2 (by linarith) exact huabs.trans h have hu2 : u ^ 2 ≤ 1 := by nlinarith [sq_nonneg u, abs_nonneg u, sq_abs u] have hMabs : M3 * |u| ≤ 1 / 2 := by calc M3 * |u| ≤ M3 * (1 / (2 * M3)) := mul_le_mul_of_nonneg_left huabs (le_of_lt hMpos) _ = 1 / 2 := by field_simp have hnonneg : 0 ≤ (1 : ℝ) - u ^ 2 / 2 := by linarith have hq : ‖q‖ = 1 - u ^ 2 / 2 := by have hqeq : q = ((1 - u ^ 2 / 2 : ℝ) : ℂ) := by push_cast rfl simp only [hqeq, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hnonneg] have haerr : ‖a - q‖ ≤ M3 * |u| ^ 3 / 6 := by simpa [a, q] using centered_charFun_quadratic_remainder μ 1 M3 hmean_int hmean hvar_int hvar hthird_int hthird u have hberr : ‖b - q‖ ≤ |u| ^ 4 / 8 := by simpa [b, q] using gaussian_charFun_quadratic_remainder u have hberr' : ‖b - q‖ ≤ M3 * |u| ^ 3 / 16 := by have h : |u| ^ 4 ≤ M3 * |u| ^ 3 / 2 := by have hhalf : |u| ≤ M3 / 2 := by have h' : 1 / (2 * M3) ≤ M3 / 2 := by apply (div_le_div_iff₀ (by positivity) (by positivity)).2 nlinarith [sq_nonneg (M3 - 1)] exact huabs.trans h' have := mul_le_mul_of_nonneg_left hhalf (by positivity : 0 ≤ |u| ^ 3) nlinarith linarith have hgap : ‖a - b‖ ≤ M3 * |u| ^ 3 / 4 := by have htri : ‖a - b‖ ≤ ‖a - q‖ + ‖b - q‖ := by calc ‖a - b‖ = ‖(a - q) + (q - b)‖ := by congr 1; ring _ ≤ ‖a - q‖ + ‖q - b‖ := norm_add_le _ _ _ = ‖a - q‖ + ‖b - q‖ := congrArg _ (norm_sub_rev q b) have hpos : 0 ≤ M3 * |u| ^ 3 := by positivity linarith have har : ‖a‖ ≤ r := by have htri : ‖a‖ ≤ ‖a - q‖ + ‖q‖ := by simpa only [sub_add_cancel] using (norm_add_le (a - q) q) have hlocal : ‖a‖ ≤ 1 - 5 * u ^ 2 / 12 := by rw [hq] at htri have hm : M3 * |u| ^ 3 ≤ u ^ 2 / 2 := by have h := mul_le_mul_of_nonneg_right hMabs (sq_nonneg u) nlinarith [h, sq_abs u, abs_nonneg u] linarith have hexp : 1 - 5 * u ^ 2 / 12 ≤ r := by dsimp [r] have := Real.add_one_le_exp (-(5 * u ^ 2 / 12)) linarith exact hlocal.trans hexp have hbform : b = exp ((-(u ^ 2 / 2) : ℝ) : ℂ) := by dsimp [b] rw [charFun_gaussianReal] congr 1 push_cast ring have hbr : ‖b‖ ≤ r := by have hbval : ‖b‖ = exp (-(u ^ 2 / 2)) := by rw [hbform, Complex.norm_exp] simp norm_cast rw [hbval] exact Real.exp_le_exp.mpr (by nlinarith [sq_nonneg u]) have hrpos : 0 ≤ r := le_of_lt (Real.exp_pos _) have hpow_aux : ∀ k : ℕ, ‖a ^ (k + 1) - b ^ (k + 1)‖ ≤ (k + 1 : ℕ) * ‖a - b‖ * r ^ k := by intro k induction k with | zero => simp | succ k ih => have hid : a ^ (k + 1 + 1) - b ^ (k + 1 + 1) = (a ^ (k + 1) - b ^ (k + 1)) * a + b ^ (k + 1) * (a - b) := by ring rw [hid] have h₁ : ‖(a ^ (k + 1) - b ^ (k + 1)) * a‖ ≤ ((k + 1 : ℕ) * ‖a - b‖ * r ^ k) * r := by rw [norm_mul] exact mul_le_mul ih har (norm_nonneg _) (by positivity) have h₂ : ‖b ^ (k + 1) * (a - b)‖ ≤ r ^ (k + 1) * ‖a - b‖ := by rw [norm_mul, norm_pow] exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) hbr _) (norm_nonneg _) calc ‖(a ^ (k + 1) - b ^ (k + 1)) * a + b ^ (k + 1) * (a - b)‖ ≤ ‖(a ^ (k + 1) - b ^ (k + 1)) * a‖ + ‖b ^ (k + 1) * (a - b)‖ := norm_add_le _ _ _ ≤ ((k + 1 : ℕ) * ‖a - b‖ * r ^ k) * r + r ^ (k + 1) * ‖a - b‖ := add_le_add h₁ h₂ _ = (↑(k + 1 + 1) : ℝ) * ‖a - b‖ * r ^ (k + 1) := by rw [pow_succ] push_cast ring have hpow := hpow_aux (n - 1) have hnsub : n - 1 + 1 = n := Nat.sub_add_cancel (by omega) rw [hnsub] at hpow have hbscale : b ^ n = charFun (gaussianReal 0 1) t := by have htform : charFun (gaussianReal 0 1) t = exp ((-(t ^ 2 / 2) : ℝ) : ℂ) := by rw [charFun_gaussianReal] congr 1 push_cast ring have hscale : (n : ℝ) * (u ^ 2 / 2) = t ^ 2 / 2 := by dsimp [u] rw [div_pow, hs2] field_simp rw [hbform, htform, ← Complex.exp_nat_mul] congr 1 norm_cast linarith [hscale] have hrpow : r ^ (n - 1) ≤ exp (-(t ^ 2 / 4)) := by rw [← Real.exp_nat_mul] apply Real.exp_le_exp.mpr have hnsubreal : (n - 1 : ℕ) = (n : ℝ) - 1 := by rw [Nat.cast_sub (by omega)] simp rw [hnsubreal] have hscale : (n : ℝ) * u ^ 2 = t ^ 2 := by dsimp [u] rw [div_pow, hs2] field_simp have hthreequarter : 3 * (n : ℝ) / 4 ≤ (n : ℝ) - 1 := by linarith nlinarith [sq_nonneg u, hscale] rw [← hbscale] change ‖a ^ n - b ^ n‖ ≤ _ calc ‖a ^ n - b ^ n‖ ≤ (n : ℝ) * ‖a - b‖ * r ^ (n - 1) := by simpa using hpow _ ≤ (n : ℝ) * (M3 * |u| ^ 3 / 4) * r ^ (n - 1) := by gcongr _ ≤ (n : ℝ) * (M3 * |u| ^ 3 / 4) * exp (-(t ^ 2 / 4)) := by gcongr _ = (M3 / (4 * s)) * |t| ^ 3 * exp (-(t ^ 2 / 4)) := by have hsne : s ≠ 0 := ne_of_gt hspos simp only [u, abs_div, abs_of_pos hspos] rw [div_pow] rw [← hs2] field_simp
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_charFun_refined_local_product_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenRefinedLocalProduct.lean:17
Berry­Esseen­Sinc4­Baseline 1 core · 0 supporting The already-proved Fourier and CDF sandwich estimates yield an explicit normal smoothing bound. ★ normal_cdf_smoothing_sinc4_baseline

Baseline normal smoothing via the fourth-power sinc kernel

The already-proved Fourier and CDF sandwich estimates yield an explicit normal smoothing bound. Its Gaussian error constant records exactly what this kernel proves; a sharper inversion step is needed for Esseen's constant.

theorem normal_cdf_smoothing_sinc4_baseline reviewed
Causalean.Stat.CLT.BerryEsseen

For a scalar probability law with finite first moment and a positive bandwidth T, its CDF at every threshold x differs from the standard Gaussian CDF by at most 1/π times the integral over [−T, T] of the characteristic-function discrepancy divided by |t|, plus 24/(T√(2π)).

Formal statement
hfirst :
Integrable (fun y : ℝ => y) μ
T :
ℝ
hT :
0 < T
x :
ℝ
|(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal|
≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|)
+ 24 / (T * sqrt (2 * pi))
Proof (Lean source)
theorem normal_cdf_smoothing_sinc4_baseline (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (T : ℝ) (hT : 0 < T) (x : ℝ) : |(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) + 24 / (T * sqrt (2 * pi)) := by have hg : Integrable (fun y : ℝ => y) (gaussianReal 0 1) := memLp_one_iff_integrable.mp (ProbabilityTheory.memLp_id_gaussianReal (μ := 0) (v := 1) 1) let L : ℝ := 1 / sqrt (2 * pi) let B : ℝ := (1 / (2 * pi)) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) have hL : 0 ≤ L := by dsimp [L]; positivity have hB : 0 ≤ B := by have h := sinc4_smoothed_cdf_fourier_bound μ (gaussianReal 0 1) hfirst hg T hT 0 exact (abs_nonneg _).trans h have hν : ∀ a b : ℝ, a ≤ b → ((gaussianReal 0 1) (Ioc a b)).toReal ≤ L * (b - a) := by intro a b hab simpa [L, div_eq_mul_inv, mul_comm] using standardGaussian_interval_mass_le a b hab have hsmooth : ∀ z : ℝ, |∫ y : ℝ, ((μ (Iic (z - y))).toReal - ((gaussianReal 0 1) (Iic (z - y))).toReal) * sinc4Kernel T y| ≤ B := by intro z exact sinc4_smoothed_cdf_fourier_bound μ (gaussianReal 0 1) hfirst hg T hT z have hsand := sinc4_cdf_sandwich μ (gaussianReal 0 1) T L B hT hL hν hsmooth x calc _ ≤ 2 * B + 24 * L / T := hsand _ = (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) + 24 / (T * sqrt (2 * pi)) := by dsimp [B, L] have hpi : pi ≠ 0 := ne_of_gt Real.pi_pos have hsqrt : sqrt (2 * pi) ≠ 0 := by positivity field_simp
Causalean.Stat.CLT.BerryEsseen.normal_cdf_smoothing_sinc4_baseline · Causalean/Stat/CLT/BerryEsseen/BerryEsseenSinc4Baseline.lean:19
Berry­Esseen­Smoothing 1 core · 1 supporting This module states the Fourier-to-CDF estimate needed by a quantitative scalar central limit theorem. ★ normal_cdf_smoothing

Gaussian smoothing bound for distribution functions

This module states the Fourier-to-CDF estimate needed by a quantitative scalar central limit theorem. It is independent of the cross-fitting model and of the iid characteristic-function estimates.

theorem normal_cdf_smoothing reviewed
Causalean.Stat.CLT.BerryEsseen

For a real probability law with finite first moment and a positive bandwidth T, its CDF at every threshold x differs from the standard Gaussian CDF by at most 1/π times the integral over [−T, T] of the characteristic-function discrepancy divided by |t|, plus the smoothing error 24/(πT√(2π)). The constant 24/π is the usual Esseen smoothing constant.

Formal statement
hfirst :
Integrable (fun y : ℝ => y) μ
T :
ℝ
hT :
0 < T
x :
ℝ
|(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal|
≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|)
+ 24 / (pi * T * sqrt (2 * pi))
Proof (Lean source)
theorem normal_cdf_smoothing (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (T : ℝ) (hT : 0 < T) (x : ℝ) : |(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) + 24 / (pi * T * sqrt (2 * pi)) := by have hg : Integrable (fun y : ℝ => y) (gaussianReal 0 1) := memLp_one_iff_integrable.mp (ProbabilityTheory.memLp_id_gaussianReal (μ := 0) (v := 1) 1) have hL : 0 ≤ (1 / sqrt (2 * pi) : ℝ) := by positivity have hν : ∀ a b : ℝ, a ≤ b → ((gaussianReal 0 1) (Ioc a b)).toReal ≤ (1 / sqrt (2 * pi)) * (b - a) := by intro a b hab simpa [div_eq_mul_inv, mul_comm] using standardGaussian_interval_mass_le a b hab have h := cdf_esseen_inversion_lipschitz μ (gaussianReal 0 1) hfirst hg (1 / sqrt (2 * pi)) hL hν T hT x convert h using 1 field_simp
Causalean.Stat.CLT.BerryEsseen.normal_cdf_smoothing · Causalean/Stat/CLT/BerryEsseen/BerryEsseenSmoothing.lean:90
1 supporting declaration (lemmas, instances)
  • charFun_normal_quotient_intervalIntegrable theorem — With a finite first moment, the characteristic-function difference from the standard Gaussian divided by frequency is locally integrable, including across frequency zero.
    hfirst :
    Integrable (fun y : ℝ => y) μ
    T :
    ℝ
    IntervalIntegrable (fun t : ℝ => ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) volume (-T) T
    Proof (Lean source)
    theorem charFun_normal_quotient_intervalIntegrable (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (T : ℝ) : IntervalIntegrable (fun t : ℝ => ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) volume (-T) T := by have hchar (ν : Measure ℝ) [IsProbabilityMeasure ν] (hν : Integrable (fun y : ℝ => y) ν) (t : ℝ) : ‖charFun ν t - 1‖ ≤ |t| * ∫ y, |y| ∂ν := by have he : Integrable (fun y : ℝ => exp ((t * y : ℝ) * I)) ν := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with y simpa [mul_comm] using (Complex.norm_exp_I_mul_ofReal (t * y)).le have hEq : charFun ν t - 1 = ∫ y, (exp ((t * y : ℝ) * I) - 1) ∂ν := by rw [charFun_apply_real] simp only [← Complex.ofReal_mul] rw [integral_sub he (integrable_const 1)] simp rw [hEq] calc ‖∫ y, (exp ((t * y : ℝ) * I) - 1) ∂ν‖ ≤ ∫ y, |t| * |y| ∂ν := by apply norm_integral_le_of_norm_le (hν.norm.const_mul |t|) filter_upwards [] with y have hp := Real.norm_exp_I_mul_ofReal_sub_one_le (x := t * y) simpa [Real.norm_eq_abs, abs_mul, mul_comm] using hp _ = |t| * ∫ y, |y| ∂ν := by rw [integral_const_mul] have hg : Integrable (fun y : ℝ => y) (gaussianReal 0 1) := by exact memLp_one_iff_integrable.mp (ProbabilityTheory.memLp_id_gaussianReal (μ := 0) (v := 1) 1) have hbound : ∀ t : ℝ, t ≠ 0 → ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t| ≤ (∫ y, |y| ∂μ) + (∫ y, |y| ∂(gaussianReal 0 1)) := by intro t ht have htpos : 0 < |t| := abs_pos.mpr ht have hμ := hchar μ hfirst t have hγ := hchar (gaussianReal 0 1) hg t have htri : ‖charFun μ t - charFun (gaussianReal 0 1) t‖ ≤ ‖charFun μ t - 1‖ + ‖charFun (gaussianReal 0 1) t - 1‖ := by convert norm_sub_le (charFun μ t - 1) (charFun (gaussianReal 0 1) t - 1) using 1 ring_nf apply (div_le_iff₀ htpos).2 nlinarith have hmeas : Measurable (fun t : ℝ => ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) := by fun_prop apply (intervalIntegrable_iff).2 apply IntegrableOn.of_bound (by rw [Real.volume_uIoc]; exact ENNReal.ofReal_lt_top) hmeas.aestronglyMeasurable ((∫ y, |y| ∂μ) + (∫ y, |y| ∂(gaussianReal 0 1))) filter_upwards [] with t by_cases ht : t = 0 · subst t simp only [charFun_zero, probReal_univ, Complex.ofReal_one, sub_self, norm_zero, abs_zero, div_zero] exact add_nonneg (integral_nonneg (fun y => abs_nonneg y)) (integral_nonneg (fun y => abs_nonneg y)) · simpa [Real.norm_eq_abs, abs_of_nonneg (div_nonneg (norm_nonneg _) (abs_nonneg t))] using hbound t ht
    Causalean.Stat.CLT.BerryEsseen.charFun_normal_quotient_intervalIntegrable · Causalean/Stat/CLT/BerryEsseen/BerryEsseenSmoothing.lean:24
Berry­Esseen­Standardize 1 core · 1 supporting These identities separate variance normalization from the quantitative unit-variance normal approximation. ★ standardized_iid_sum_event

Scaling a scalar iid law to unit variance

These identities separate variance normalization from the quantitative unit-variance normal approximation. They apply to any positive variance.

theorem standardized_iid_sum_event reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive scale σ2, the n-fold iid product of a law gives the event "sum divided by √n·√σ2 is at most x" the same probability as the n-fold iid product of the law rescaled by 1/√σ2 gives the event "sum divided by √n is at most x": standardizing each coordinate before summing is the same as standardizing the sum afterward.

Formal statement
σ2 :
ℝ
hσ2 :
0 < σ2
n :
ℕ
x :
ℝ
(Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / (sqrt (n : ℝ) * sqrt σ2) ≤ x}
= (Measure.pi (fun _ : Fin n => μ.map (fun y : ℝ => y / sqrt σ2))) {v : Fin n → ℝ | (∑ i : Fin n, v i) / sqrt (n : ℝ) ≤ x}
Proof (Lean source)
theorem standardized_iid_sum_event (μ : Measure ℝ) [IsProbabilityMeasure μ] (σ2 : ℝ) (hσ2 : 0 < σ2) (n : ℕ) (x : ℝ) : (Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / (Real.sqrt (n : ℝ) * Real.sqrt σ2) ≤ x} = (Measure.pi (fun _ : Fin n => μ.map (fun y : ℝ => y / Real.sqrt σ2))) {v : Fin n → ℝ | (∑ i : Fin n, v i) / Real.sqrt (n : ℝ) ≤ x} := by have hr : 0 < Real.sqrt σ2 := Real.sqrt_pos.2 hσ2 let f : ℝ → ℝ := fun y => y / Real.sqrt σ2 have hf : Measurable f := by fun_prop have : ∀ _ : Fin n, SigmaFinite (μ.map f) := by intro i infer_instance have hmap : (Measure.pi (fun _ : Fin n => μ)).map (fun v i => f (v i)) = Measure.pi (fun _ : Fin n => μ.map f) := Measure.pi_map_pi (fun _ => hf.aemeasurable) have hset : (fun v : Fin n → ℝ => fun i => f (v i)) ⁻¹' {v : Fin n → ℝ | (∑ i : Fin n, v i) / Real.sqrt (n : ℝ) ≤ x} = {v : Fin n → ℝ | (∑ i : Fin n, v i) / (Real.sqrt (n : ℝ) * Real.sqrt σ2) ≤ x} := by ext v simp only [Set.mem_preimage, Set.mem_ofPred_eq, f, ← Finset.sum_div] -- This identity also covers n = 0, when √n = 0. rw [div_div, mul_comm (Real.sqrt σ2)] rw [← hmap, Measure.map_apply (by fun_prop) (measurableSet_le (by fun_prop) measurable_const), hset]
Causalean.Stat.CLT.BerryEsseen.standardized_iid_sum_event · Causalean/Stat/CLT/BerryEsseen/BerryEsseenStandardize.lean:64
1 supporting declaration (lemmas, instances)
  • standardized_law_moments theorem — Dividing a centered scalar law by its positive standard deviation gives an integrable law of mean zero and variance one; its third absolute moment is divided by the cube of that standard deviation.
    σ2 M3 :
    ℝ
    hσ2 :
    0 < σ2
    hmean_int :
    Integrable (fun x : ℝ => x) μ
    hmean :
    ∫ x : ℝ, x ∂μ = 0
    hvar_int :
    Integrable (fun x : ℝ => x ^ 2) μ
    hvar :
    ∫ x : ℝ, x ^ 2 ∂μ = σ2
    hthird_int :
    Integrable (fun x : ℝ => |x| ^ 3) μ
    hthird :
    ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
    ν :
    μ.map (fun x : ℝ => x / sqrt σ2)
    Integrable (fun x : ℝ => x) ν
    ∫ x : ℝ, x ∂ν = 0
    Integrable (fun x : ℝ => x ^ 2) ν
    ∫ x : ℝ, x ^ 2 ∂ν = 1
    Integrable (fun x : ℝ => |x| ^ 3) ν
    ∫ x : ℝ, |x| ^ 3 ∂ν ≤ M3 / (sqrt σ2) ^ 3
    Proof (Lean source)
    theorem standardized_law_moments (μ : Measure ℝ) [IsProbabilityMeasure μ] (σ2 M3 : ℝ) (hσ2 : 0 < σ2) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = σ2) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) : let ν := μ.map (fun x : ℝ => x / sqrt σ2) Integrable (fun x : ℝ => x) ν ∧ (∫ x : ℝ, x ∂ν = 0) ∧ Integrable (fun x : ℝ => x ^ 2) ν ∧ (∫ x : ℝ, x ^ 2 ∂ν = 1) ∧ Integrable (fun x : ℝ => |x| ^ 3) ν ∧ (∫ x : ℝ, |x| ^ 3 ∂ν ≤ M3 / (sqrt σ2) ^ 3) := by have hr : 0 < sqrt σ2 := Real.sqrt_pos.2 hσ2 have h2 : ∀ y : ℝ, (y / sqrt σ2) ^ 2 = y ^ 2 / (sqrt σ2) ^ 2 := fun y => div_pow y (sqrt σ2) 2 have h3 : ∀ y : ℝ, |y / sqrt σ2| ^ 3 = |y| ^ 3 / (sqrt σ2) ^ 3 := by intro y rw [abs_div, abs_of_pos hr, div_pow] change Integrable (fun x : ℝ => x) (μ.map (fun y => y / sqrt σ2)) ∧ (∫ x : ℝ, x ∂μ.map (fun y => y / sqrt σ2)) = 0 ∧ Integrable (fun x : ℝ => x ^ 2) (μ.map (fun y => y / sqrt σ2)) ∧ (∫ x : ℝ, x ^ 2 ∂μ.map (fun y => y / sqrt σ2)) = 1 ∧ Integrable (fun x : ℝ => |x| ^ 3) (μ.map (fun y => y / sqrt σ2)) ∧ (∫ x : ℝ, |x| ^ 3 ∂μ.map (fun y => y / sqrt σ2)) ≤ M3 / (sqrt σ2) ^ 3 refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · exact (integrable_map_measure (by fun_prop) (by fun_prop)).2 (by simpa [Function.comp_def] using hmean_int.div_const (sqrt σ2)) · rw [integral_map (by fun_prop) (by fun_prop), integral_div, hmean, zero_div] · exact (integrable_map_measure (by fun_prop) (by fun_prop)).2 (by simpa only [Function.comp_def, h2] using hvar_int.div_const ((sqrt σ2) ^ 2)) · rw [integral_map (by fun_prop) (by fun_prop)] simp_rw [h2] rw [integral_div, hvar, Real.sq_sqrt (le_of_lt hσ2), div_self (ne_of_gt hσ2)] · exact (integrable_map_measure (by fun_prop) (by fun_prop)).2 (by simpa only [Function.comp_def, h3] using hthird_int.div_const ((sqrt σ2) ^ 3)) · rw [integral_map (by fun_prop) (by fun_prop)] simp_rw [h3] rw [integral_div] exact (div_le_div_iff_of_pos_right (pow_pos hr 3)).2 hthird
    Causalean.Stat.CLT.BerryEsseen.standardized_law_moments · Causalean/Stat/CLT/BerryEsseen/BerryEsseenStandardize.lean:16
Berry­Esseen­Taylor 1 core · 1 supporting This module isolates the local analytic estimate needed for a quantitative scalar central limit theorem. ★ centered_charFun_quadratic_remainder

The third-order characteristic-function estimate

This module isolates the local analytic estimate needed for a quantitative scalar central limit theorem. The bound is for an arbitrary real frequency and does not assume a limiting normal approximation.

theorem centered_charFun_quadratic_remainder reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered real probability law with integrable second moment σ2 and integrable third absolute moment at most M3, the characteristic function at every real frequency t lies within M3·|t|³/6 of the variance quadratic 1 − σ2·t²/2.

Formal statement
σ2 M3 :
ℝ
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = σ2
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
t :
ℝ
‖charFun μ t - ((1 : ℂ) - (σ2 : ℂ) * (t : ℂ) ^ 2 / 2)‖ ≤ M3 * |t| ^ 3 / 6
Proof (Lean source)
theorem centered_charFun_quadratic_remainder (μ : Measure ℝ) [IsProbabilityMeasure μ] (σ2 M3 : ℝ) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = σ2) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (t : ℝ) : ‖charFun μ t - ((1 : ℂ) - (σ2 : ℂ) * (t : ℂ) ^ 2 / 2)‖ ≤ M3 * |t| ^ 3 / 6 := by let E : ℝ → ℂ := fun x => exp (((t * x : ℝ) : ℂ) * Complex.I) let A : ℝ → ℂ := fun x => ((t * x : ℝ) : ℂ) * Complex.I let B : ℝ → ℂ := fun x => (A x) ^ 2 / 2 let G : ℝ → ℝ := fun x => |t * x| ^ 3 / 6 have hE : Integrable E μ := by apply Integrable.of_bound (C := 1) · exact (by fun_prop : Continuous E).aestronglyMeasurable · filter_upwards [] with x simpa [E, Complex.ofReal_mul] using (Complex.norm_exp_ofReal_mul_I (t * x)).le have hA : Integrable A μ := by have h := (hmean_int.ofReal : Integrable (fun x : ℝ => (x : ℂ)) μ) convert (h.const_mul ((t : ℂ) * Complex.I)) using 1 <;> funext x <;> simp [A] <;> ring have hB : Integrable B μ := by have h := (hvar_int.ofReal : Integrable (fun x : ℝ => ((x ^ 2 : ℝ) : ℂ)) μ) convert (h.const_mul (-(t : ℂ) ^ 2 / 2)) using 1 <;> funext x <;> simp only [B, A, Complex.ofReal_mul, mul_pow, Complex.I_sq] <;> push_cast <;> ring_nf <;> rfl have hG : Integrable G μ := by convert hthird_int.const_mul (|t| ^ 3 / 6) using 1 <;> funext x <;> simp [G, abs_mul, mul_pow] <;> ring have hP : Integrable (fun x => (1 : ℂ) + A x + B x) μ := ((integrable_const (1 : ℂ)).add hA).add hB have hAform : A = fun x : ℝ => ((t : ℂ) * Complex.I) * (x : ℂ) := by funext x simp [A, Complex.ofReal_mul] ring have hBform : B = fun x : ℝ => (-(t : ℂ) ^ 2 / 2) * ((x ^ 2 : ℝ) : ℂ) := by funext x simp only [B, A, Complex.ofReal_mul, mul_pow, Complex.I_sq] push_cast ring have hAint : (∫ x : ℝ, A x ∂μ) = 0 := by rw [hAform, integral_const_mul, integral_complex_ofReal, hmean] simp have hBint : (∫ x : ℝ, B x ∂μ) = -(t : ℂ) ^ 2 / 2 * (σ2 : ℂ) := by rw [hBform, integral_const_mul, integral_complex_ofReal, hvar] have hPval : (∫ x : ℝ, (1 : ℂ) + A x + B x ∂μ) = 1 - (σ2 : ℂ) * (t : ℂ) ^ 2 / 2 := by calc (∫ x : ℝ, (1 : ℂ) + A x + B x ∂μ) = (∫ x : ℝ, (1 : ℂ) + A x ∂μ) + ∫ x : ℝ, B x ∂μ := integral_add ((integrable_const (1 : ℂ)).add hA) hB _ = (∫ _x : ℝ, (1 : ℂ) ∂μ) + (∫ x : ℝ, A x ∂μ) + ∫ x : ℝ, B x ∂μ := by rw [integral_add (integrable_const (1 : ℂ)) hA] _ = 1 - (σ2 : ℂ) * (t : ℂ) ^ 2 / 2 := by rw [integral_const, hAint, hBint] simp ring have hEq : charFun μ t = ∫ x : ℝ, E x ∂μ := by rw [charFun_apply_real] congr 1 funext x simp [E, Complex.ofReal_mul] calc ‖charFun μ t - ((1 : ℂ) - (σ2 : ℂ) * (t : ℂ) ^ 2 / 2)‖ = ‖∫ x : ℝ, (E x - ((1 : ℂ) + A x + B x)) ∂μ‖ := by rw [hEq, ← hPval, integral_sub hE hP] _ ≤ ∫ x : ℝ, G x ∂μ := by apply norm_integral_le_of_norm_le hG filter_upwards [] with x simpa [E, A, B, G, Complex.ofReal_mul] using exp_imag_quadratic_remainder (t * x) _ ≤ M3 * |t| ^ 3 / 6 := by have hGform : G = fun x : ℝ => (|t| ^ 3 / 6) * |x| ^ 3 := by funext x simp [G, abs_mul, mul_pow] ring rw [hGform, integral_const_mul] calc |t| ^ 3 / 6 * ∫ x : ℝ, |x| ^ 3 ∂μ ≤ |t| ^ 3 / 6 * M3 := mul_le_mul_of_nonneg_left hthird (by positivity) _ = M3 * |t| ^ 3 / 6 := by ring
Causalean.Stat.CLT.BerryEsseen.centered_charFun_quadratic_remainder · Causalean/Stat/CLT/BerryEsseen/BerryEsseenTaylor.lean:93
1 supporting declaration (lemmas, instances)
  • exp_imag_quadratic_remainder theorem — For a real argument, the complex exponential on the imaginary axis differs from its quadratic Taylor polynomial by at most one sixth of the cubed absolute argument.
    u :
    ℝ
    ‖Complex.exp ((u : ℂ) * I) - (1 + (u : ℂ) * I + ((u : ℂ) * I) ^ 2 / 2)‖
    ≤ |u| ^ 3 / 6
    Proof (Lean source)
    theorem exp_imag_quadratic_remainder (u : ℝ) : ‖Complex.exp ((u : ℂ) * I) - (1 + (u : ℂ) * I + ((u : ℂ) * I) ^ 2 / 2)‖ ≤ |u| ^ 3 / 6 := by let f : ℝ → ℂ := fun t => exp ((t : ℂ) * I) have hc : ContDiff ℝ ⊤ (fun t : ℝ => (t : ℂ)) := by convert (Complex.ofRealCLM.contDiff : ContDiff ℝ ⊤ (Complex.ofRealCLM : ℝ → ℂ)) using 1 funext t rfl have hf : ContDiff ℝ ⊤ f := by have hm : ContDiff ℝ ⊤ (fun t : ℝ => (t : ℂ) * I) := hc.mul contDiff_const exact Complex.contDiff_exp.comp hm have hd (t : ℝ) : HasDerivAt f (I * f t) t := by dsimp [f] convert ((Complex.hasDerivAt_exp ((t : ℂ) * I)).comp (t : ℂ) (hasDerivAt_mul_const I)).comp_ofReal using 1 · funext s simp [mul_comm] · ring have hn (n : ℕ) (t : ℝ) : iteratedDeriv n f t = I ^ n * f t := by induction n with | zero => simp [iteratedDeriv_zero] | succ n ih => rw [iteratedDeriv_succ'] have hfun : deriv f = fun x => I * f x := funext fun x => (hd x).deriv rw [hfun] rw [iteratedDeriv_const_mul I (hf.contDiffAt.of_le (by simp))] rw [ih] ring by_cases hu : u = 0 · subst u norm_num [f] have hs : UniqueDiffOn ℝ (uIcc 0 u) := uniqueDiffOn_uIcc (Ne.symm hu) have hi (n : ℕ) (t : ℝ) (ht : t ∈ uIcc 0 u) : iteratedDerivWithin n f (uIcc 0 u) t = I ^ n * f t := by rw [iteratedDerivWithin_eq_iteratedDeriv hs (hf.contDiffAt.of_le (by simp)) ht, hn] have hz : (0 : ℝ) ∈ uIcc 0 u := Set.left_mem_uIcc have htaylor : taylorWithinEval f 2 (uIcc 0 u) 0 u = 1 + (u : ℂ) * I + ((u : ℂ) * I) ^ 2 / 2 := by have hzero (n : ℕ) : iteratedDerivWithin n f (uIcc 0 u) 0 = I ^ n := by rw [hi n 0 hz] simp [f] rw [taylor_within_apply] simp [Finset.sum_range_succ, hzero] rw [mul_pow, Complex.I_sq] ring have hrem := taylor_integral_remainder (f := f) (x := u) (x₀ := 0) (n := 2) (hf.contDiffOn.of_le (by simp)) rw [htaylor] at hrem have hpoint (t : ℝ) (ht : t ∈ uIcc 0 u) : ‖((u - t) ^ 2 / (2 : ℝ)) • iteratedDerivWithin 3 f (uIcc 0 u) t‖ ≤ (u - t) ^ 2 / 2 := by rw [hi 3 t ht, norm_smul, norm_mul, norm_pow, Complex.norm_I] simp [f, Complex.norm_exp_ofReal_mul_I] calc ‖Complex.exp ((u : ℂ) * I) - (1 + (u : ℂ) * I + ((u : ℂ) * I) ^ 2 / 2)‖ = ‖∫ t : ℝ in 0..u, ((u - t) ^ 2 / (2 : ℝ)) • iteratedDerivWithin 3 f (uIcc 0 u) t‖ := by simpa [f] using congrArg norm hrem _ ≤ |∫ t : ℝ in 0..u, (u - t) ^ 2 / 2| := by apply intervalIntegral.norm_integral_le_abs_of_norm_le · filter_upwards [ae_restrict_mem measurableSet_uIoc] with t ht exact hpoint t (Set.uIoc_subset_uIcc ht) · exact (by fun_prop : Continuous (fun t : ℝ => (u - t) ^ 2 / 2)).intervalIntegrable 0 u _ = |u| ^ 3 / 6 := by have h := intervalIntegral.integral_comp_sub_left (fun x : ℝ => x ^ 2 / 2) u (a := 0) (b := u) simp only [sub_self, sub_zero] at h rw [h, intervalIntegral.integral_div, integral_pow] norm_num [abs_div, abs_pow] ring
    Causalean.Stat.CLT.BerryEsseen.exp_imag_quadratic_remainder · Causalean/Stat/CLT/BerryEsseen/BerryEsseenTaylor.lean:17
Berry­Esseen­Unit 1 core · 0 supporting The constant-one scalar probability bound is isolated at unit variance, leaving rescaling and the one-observation endpoint to the general theorem. ★ iid_unit_variance_berry_esseen

Unit-variance iid Berry–Esseen inequality

The constant-one scalar probability bound is isolated at unit variance, leaving rescaling and the one-observation endpoint to the general theorem. The standardized sum's pushforward law transfers the iid Fourier envelopes to the Prawitz smoothing inequality and its deterministic budget.

theorem iid_unit_variance_berry_esseen reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance scalar law with integrable third absolute moment at most M3 and any sample size n of at least two, the CDF of the iid sum divided by √n differs from the standard Gaussian CDF at every threshold x by at most M3/√n.

Formal statement
M3 :
ℝ
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
n :
ℕ
hn :
2 ≤ n
x :
ℝ
|((Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / sqrt (n : ℝ) ≤ x}).toReal
- ((gaussianReal 0 1) (Iic x)).toReal|
≤ M3 / sqrt (n : ℝ)
Proof (Lean source)
theorem iid_unit_variance_berry_esseen (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (n : ℕ) (hn : 2 ≤ n) (x : ℝ) : |((Measure.pi (fun _ : Fin n => μ)) {v : Fin n → ℝ | (∑ i : Fin n, v i) / sqrt (n : ℝ) ≤ x}).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ M3 / sqrt (n : ℝ) := by classical have hM3 : 1 ≤ M3 := (unit_second_moment_third_absolute_moment_ge_one μ hvar_int hvar hthird_int).trans hthird have hnreal : (2 : ℝ) ≤ n := by exact_mod_cast hn have hspos : 0 < sqrt (n : ℝ) := by positivity let ρ : ℝ := M3 / sqrt (n : ℝ) have hρ : 0 < ρ := div_pos (by linarith) hspos let Q : Measure (Fin n → ℝ) := Measure.pi (fun _ => μ) let S : (Fin n → ℝ) → ℝ := fun v => (∑ i, v i) / sqrt (n : ℝ) have hS : Measurable S := by dsimp [S]; fun_prop let ν : Measure ℝ := Q.map S have : IsProbabilityMeasure ν := Measure.isProbabilityMeasure_map hS.aemeasurable have hCDF : ν (Iic x) = Q {v | S v ≤ x} := Measure.map_apply hS measurableSet_Iic change |(Q {v | S v ≤ x}).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ ρ rw [← hCDF] by_cases hρ1 : 1 ≤ ρ · have hν1 : (ν (Iic x)).toReal ≤ 1 := by simpa using ENNReal.toReal_mono (measure_ne_top ν univ) (measure_mono (Set.subset_univ (Iic x))) have hG1 : ((gaussianReal 0 1) (Iic x)).toReal ≤ 1 := by simpa using ENNReal.toReal_mono (measure_ne_top (gaussianReal 0 1) univ) (measure_mono (Set.subset_univ (Iic x))) exact (abs_le.mpr ⟨by linarith [ENNReal.toReal_nonneg (a := ν (Iic x))], by linarith [ENNReal.toReal_nonneg (a := (gaussianReal 0 1) (Iic x))]⟩).trans hρ1 have hfirst : Integrable (fun y : ℝ => y) ν := by apply (integrable_map_measure measurable_id.aestronglyMeasurable hS.aemeasurable).2 exact (integrable_finsetSum univ (fun i _ => integrable_comp_eval (μ := fun _ : Fin n => μ) (i := i) hmean_int)).div_const _ have hchar (t : ℝ) : charFun ν t = (charFun μ (t / sqrt (n : ℝ))) ^ n := by rw [charFun_apply_real, integral_map hS.aemeasurable (by fun_prop)] rw [← iid_sum_charFun_product μ n (t / sqrt (n : ℝ))] congr 1 funext v dsimp [S] congr 1 push_cast ring let U0 : ℝ := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U : ℝ := 12 / (5 * ρ) obtain ⟨hcut, hbudget⟩ := prawitz_berry_esseen_budget ρ hρ (lt_of_not_ge hρ1) have hU0 : 0 < U0 := lt_of_lt_of_le (by norm_num : (0 : ℝ) < 3 / 2) (le_max_left _ _) have hU : 0 < U := hU0.trans_le hcut obtain ⟨hlo_int, hhi_int, _, _⟩ := prawitz_four_terms_integrable ν hfirst U0 U hU0 hcut have hlo_env := prawitz_low_compact_intervalIntegrable ρ U U0 hρ.le hU hU0.le hcut have hhi_env := prawitz_high_compact_intervalIntegrable ρ U U0 U hU hU0 hcut le_rfl have hlo := intervalIntegral.integral_mono_on hU0.le hlo_int hlo_env (fun t ht => by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) rw [hchar] exact iid_unit_variance_charFun_prawitz_discrepancy_bound μ M3 hM3 hmean_int hmean hvar_int hvar hthird_int hthird n hn t (by rw [abs_of_nonneg ht.1]; exact ht.2.trans hcut)) have hhi := intervalIntegral.integral_mono_on hcut hhi_int hhi_env (fun t ht => by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) rw [hchar] exact iid_unit_variance_charFun_prawitz_moment_bound μ M3 hM3 hmean_int hmean hvar_int hvar hthird_int hthird n hn t) have hcoef : 0 ≤ 2 / U := by positivity have hsmooth := normal_cdf_prawitz_smoothing ν hfirst U0 U hU0 hcut x apply le_trans _ hbudget change |(ν (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ prawitzBerryEsseenEnvelope ρ U0 U unfold prawitzBerryEsseenEnvelope exact hsmooth.trans (by linarith only [mul_le_mul_of_nonneg_left hlo hcoef, mul_le_mul_of_nonneg_left hhi hcoef])
Causalean.Stat.CLT.BerryEsseen.iid_unit_variance_berry_esseen · Causalean/Stat/CLT/BerryEsseen/BerryEsseenUnit.lean:27
Berry­Esseen­Wide­Char­Fun 1 core · 0 supporting Prawitz's cubic modulus estimate is isolated for one centered unit-variance law. ★ unit_variance_charFun_norm_sq_cubic_bound

Wide-window scalar characteristic-function damping

Prawitz's cubic modulus estimate is isolated for one centered unit-variance law. Unlike a Taylor triangle bound on a small frequency window, it gives useful damping up to frequencies of order the inverse third moment.

Reference: Tyurin, arXiv:0912.0726, Lemma 1 (pervoe) and the displayed definition of b(t,γ). The optimal cosine-remainder coefficient is below 0.1, so replacing it by 1/10 yields the conservative polynomial below.

theorem unit_variance_charFun_norm_sq_cubic_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered unit-variance law with integrable third absolute moment at most M3, the squared modulus of the characteristic function at every real frequency t is at most 1 − t² + (M3 + 1)·|t|³/5.

Formal statement
M3 :
ℝ
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
hthird :
∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3
t :
ℝ
‖charFun μ t‖ ^ 2 ≤ 1 - t ^ 2 + (M3 + 1) * |t| ^ 3 / 5
Proof (Lean source)
theorem unit_variance_charFun_norm_sq_cubic_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (M3 : ℝ) (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) (hthird : ∫ x : ℝ, |x| ^ 3 ∂μ ≤ M3) (t : ℝ) : ‖charFun μ t‖ ^ 2 ≤ 1 - t ^ 2 + (M3 + 1) * |t| ^ 3 / 5 := by -- The product law turns the squared modulus into a cosine expectation. have hexp : Integrable (fun p : ℝ × ℝ => exp ((t * (p.1 - p.2) : ℝ) * I)) (μ.prod μ) := by refine (integrable_const (1 : ℝ)).mono' (by fun_prop) (Filter.Eventually.of_forall ?_) intro p simp only [Complex.norm_exp_ofReal_mul_I, le_refl] have hproduct : (∫ p : ℝ × ℝ, exp ((t * (p.1 - p.2) : ℝ) * I) ∂μ.prod μ) = charFun μ t * starRingEnd ℂ (charFun μ t) := by rw [← charFun_neg, charFun_apply_real, charFun_apply_real, ← integral_prod_mul] apply integral_congr_ae filter_upwards [] with p rw [← Complex.exp_add] congr 1 push_cast ring have hcos : (∫ p : ℝ × ℝ, cos (t * (p.1 - p.2)) ∂μ.prod μ) = ‖charFun μ t‖ ^ 2 := by have h := integral_re hexp rw [hproduct, RCLike.mul_conj, ← RCLike.ofReal_pow, RCLike.ofReal_re] at h simpa only [RCLike.re_to_complex, Complex.exp_ofReal_mul_I_re] using h -- Centering cancels the mixed term, so the difference has second moment two. have h₂₁ := hvar_int.comp_fst μ have h₂₂ := hvar_int.comp_snd μ have hmix := hmean_int.mul_prod hmean_int have hsum : Integrable (fun p : ℝ × ℝ => p.1 ^ 2 + p.2 ^ 2) (μ.prod μ) := h₂₁.add h₂₂ have hsq : Integrable (fun p : ℝ × ℝ => (p.1 - p.2) ^ 2) (μ.prod μ) := by convert hsum.sub (hmix.const_mul 2) using 1 ext p dsimp ring have hsecond : (∫ p : ℝ × ℝ, (p.1 - p.2) ^ 2 ∂μ.prod μ) = 2 := by have heq : (fun p : ℝ × ℝ => (p.1 - p.2) ^ 2) = (fun p => (p.1 ^ 2 + p.2 ^ 2) - 2 * (p.1 * p.2)) := by funext p ring rw [heq, integral_sub hsum (hmix.const_mul 2), integral_add h₂₁ h₂₂, integral_const_mul, integral_prod_mul (fun x : ℝ => x) (fun y : ℝ => y), integral_fun_fst (fun x : ℝ => x ^ 2), integral_fun_snd (fun x : ℝ => x ^ 2)] norm_num [hmean, hvar] obtain ⟨hcube, hcube_bound⟩ := symmetrized_unit_third_moment_le μ hmean_int hmean hvar_int hvar hthird_int have hcos_int : Integrable (fun p : ℝ × ℝ => cos (t * (p.1 - p.2))) (μ.prod μ) := by refine (integrable_const (1 : ℝ)).mono' (by fun_prop) (Filter.Eventually.of_forall ?_) intro p simpa only [Real.norm_eq_abs] using Real.abs_cos_le_one (t * (p.1 - p.2)) have hmajor_int : Integrable (fun p : ℝ × ℝ => 1 - (t ^ 2 / 2) * (p.1 - p.2) ^ 2 + (|t| ^ 3 / 10) * |p.1 - p.2| ^ 3) (μ.prod μ) := ((integrable_const (1 : ℝ)).sub (hsq.const_mul (t ^ 2 / 2))).add (hcube.const_mul (|t| ^ 3 / 10)) have hbound := integral_mono hcos_int hmajor_int (fun p => show cos (t * (p.1 - p.2)) ≤ 1 - (t ^ 2 / 2) * (p.1 - p.2) ^ 2 + (|t| ^ 3 / 10) * |p.1 - p.2| ^ 3 from by have h := cos_le_quadratic_add_cubic (t * (p.1 - p.2)) simp only [mul_pow, abs_mul] at h convert h using 1 ring) have hquadratic : Integrable (fun p : ℝ × ℝ => 1 - (t ^ 2 / 2) * (p.1 - p.2) ^ 2) (μ.prod μ) := (integrable_const (1 : ℝ)).sub (hsq.const_mul (t ^ 2 / 2)) rw [hcos, integral_add hquadratic (hcube.const_mul (|t| ^ 3 / 10)), integral_sub (integrable_const (1 : ℝ)) (hsq.const_mul (t ^ 2 / 2)), integral_const_mul, integral_const_mul, hsecond] at hbound have hthird_bound : (∫ p : ℝ × ℝ, |p.1 - p.2| ^ 3 ∂μ.prod μ) ≤ 2 * (M3 + 1) := by linarith have hscaled := mul_le_mul_of_nonneg_left hthird_bound (show 0 ≤ |t| ^ 3 / 10 by positivity) simp only [integral_const, probReal_univ, one_smul] at hbound nlinarith only [hbound, hscaled]
Causalean.Stat.CLT.BerryEsseen.unit_variance_charFun_norm_sq_cubic_bound · Causalean/Stat/CLT/BerryEsseen/BerryEsseenWideCharFun.lean:24
CDFDifference­Fourier 1 core · 0 supporting The Fourier transform of the difference of two CDFs is identified with the difference of their characteristic functions away from frequency zero. ★ cdf_difference_fourier_identity

Fourier transform of a difference of distribution functions

The Fourier transform of the difference of two CDFs is identified with the difference of their characteristic functions away from frequency zero. Finite first moments supply the integrability needed for the identity.

theorem cdf_difference_fourier_identity reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws μ and ν with finite first moments and a nonzero frequency t, t times the Fourier integral of the difference of their CDFs equals i times the difference of their characteristic functions at t; that is, the Fourier integral is (i/t)(φ_μ(t) − φ_ν(t)), written so as to avoid division at zero.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
t :
ℝ
ht :
t ≠ 0
(t : ℂ) * (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ))
= I * (charFun μ t - charFun ν t)
Proof (Lean source)
theorem cdf_difference_fourier_identity (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (t : ℝ) (ht : t ≠ 0) : (t : ℂ) * (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) = I * (charFun μ t - charFun ν t) := by have hExp (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : Integrable (fun x : ℝ => exp (((t * x : ℝ) : ℂ) * I)) ρ := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with x simpa only [Complex.ofReal_mul] using le_of_eq (Complex.norm_exp_ofReal_mul_I (t * x)) rw [cdf_difference_fourier_fubini μ ν hμ hν t] rw [← integral_const_mul] simp_rw [← integral_const_mul, fourier_oriented_interval_identity _ _ t ht] simp_rw [integral_const_mul] have hinner (a : ℝ) : (∫ b : ℝ, exp (((t * a : ℝ) : ℂ) * I) - exp (((t * b : ℝ) : ℂ) * I) ∂ν) = exp (((t * a : ℝ) : ℂ) * I) - charFun ν t := by rw [integral_sub (integrable_const (μ := ν) _) (hExp ν), integral_const] simp [charFun_apply_real] simp_rw [hinner] rw [integral_sub (hExp μ) (integrable_const (μ := μ) _), integral_const] simp [charFun_apply_real]
Causalean.Stat.CLT.BerryEsseen.cdf_difference_fourier_identity · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourier.lean:19
CDFDifference­Fourier­Endpoint 1 core · 0 supporting This module evaluates the oriented interval kernel after averaging its two endpoints over independent probability laws. ★ orientedFourierKernel_endpoint_integral

Endpoint average of the oriented Fourier kernel

This module evaluates the oriented interval kernel after averaging its two endpoints over independent probability laws. It is one input to Fubini.

theorem orientedFourierKernel_endpoint_integral reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws μ and ν on the real line, averaging the oriented Fourier kernel at frequency t and point x over independent draws a from μ and b from ν gives the Fourier exponential exp(itx) times the difference of the two CDFs at x. The weak endpoint inequalities preserve this identity at atoms.

Formal statement
(∫ a : ℝ, ∫ b : ℝ, orientedFourierKernel t a b x ∂ν ∂μ)
= exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)
Proof (Lean source)
theorem orientedFourierKernel_endpoint_integral (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t x : ℝ) : (∫ a : ℝ, ∫ b : ℝ, orientedFourierKernel t a b x ∂ν ∂μ) = exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ) := by /- Expand the kernel and integrate the two bounded indicator functions. For each probability law, the integral of `if a ≤ x then 1 else 0` equals the real measure of `Iic x`. -/ let E : ℂ := exp (((t * x : ℝ) : ℂ) * I) let I : ℝ → ℂ := fun y => if y ≤ x then 1 else 0 have hIint (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : Integrable I ρ := by have h : Integrable ((Iic x).indicator (fun _ : ℝ => (1 : ℂ))) ρ := (integrable_const (μ := ρ) (1 : ℂ)).indicator measurableSet_Iic have heq : I = (Iic x).indicator (fun _ : ℝ => (1 : ℂ)) := by funext y simp [I, Set.indicator_apply, Set.mem_Iic] rw [heq] exact h have hIeval (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : ∫ y, I y ∂ρ = ((ρ (Iic x)).toReal : ℂ) := by rw [show (∫ y, I y ∂ρ) = ∫ y, ((if y ≤ x then 1 else 0 : ℝ) : ℂ) ∂ρ from by congr 1; funext y; split_ifs <;> simp [I, *]] rw [integral_complex_ofReal] have h := integral_indicator_one (μ := ρ) (s := Iic x) measurableSet_Iic simpa [Set.indicator_apply, Set.mem_Iic, measureReal_def] using congrArg (fun z : ℝ => (z : ℂ)) h have hker (a b : ℝ) : orientedFourierKernel t a b x = E * (I a - I b) := by by_cases ha : a ≤ x <;> by_cases hb : b ≤ x <;> simp [orientedFourierKernel, E, I, ha, hb] have hinner (a : ℝ) : (∫ b, orientedFourierKernel t a b x ∂ν) = E * (I a - ((ν (Iic x)).toReal : ℂ)) := by simp_rw [hker] rw [integral_const_mul, integral_sub (integrable_const (μ := ν) (I a)) (hIint ν), integral_const, hIeval ν] simp simp_rw [hinner] rw [integral_const_mul, integral_sub (hIint μ) (integrable_const (μ := μ) (((ν (Iic x)).toReal : ℂ))), hIeval μ, integral_const] simp [E]
Causalean.Stat.CLT.BerryEsseen.orientedFourierKernel_endpoint_integral · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierEndpoint.lean:16 · uses orientedFourierKernel
CDFDifference­Fourier­Fubini 1 core · 1 supporting An oriented interval between two observations has signed indicator equal to the difference of their lower-half-line indicators. ★ cdf_difference_fourier_fubini

A Fubini bridge for Fourier transforms of CDF differences

An oriented interval between two observations has signed indicator equal to the difference of their lower-half-line indicators. Integrating this identity against two probability laws is the measure-theoretic step in the Fourier identity for their CDF difference.

theorem cdf_difference_fourier_fubini reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws μ and ν with finite first moments, the Fourier integral at frequency t of the difference of their CDFs equals the average, over independent draws a from μ and b from ν, of the oriented integral of the Fourier exponential from a to b.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
t :
ℝ
(∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ))
= ∫ a : ℝ, ∫ b : ℝ, (∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I)) ∂ν ∂μ
Proof (Lean source)
theorem cdf_difference_fourier_fubini (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (t : ℝ) : (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) = ∫ a : ℝ, ∫ b : ℝ, (∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I)) ∂ν ∂μ := by have htriple := orientedFourierKernel_integrable μ ν hμ hν t have hpair : Integrable (fun p : (ℝ × ℝ) × ℝ => orientedFourierKernel t p.1.1 p.1.2 p.2) ((μ.prod ν).prod volume) := by have h := ((measurePreserving_prodAssoc μ ν (volume : Measure ℝ)).integrable_comp_emb MeasurableEquiv.prodAssoc.measurableEmbedding).mpr htriple simpa [Function.comp_def, MeasurableEquiv.prodAssoc] using h have hswap : Integrable (fun p : ℝ × (ℝ × ℝ) => orientedFourierKernel t p.2.1 p.2.2 p.1) (volume.prod (μ.prod ν)) := by simpa [Function.comp_def, swap] using hpair.swap have hfiber : ∀ᵐ x ∂(volume : Measure ℝ), Integrable (fun p : ℝ × ℝ => orientedFourierKernel t p.1 p.2 x) (μ.prod ν) := (integrable_prod_iff hswap.aestronglyMeasurable).mp hswap |>.1 calc (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) = ∫ x : ℝ, ∫ a : ℝ, ∫ b : ℝ, orientedFourierKernel t a b x ∂ν ∂μ := by simp_rw [orientedFourierKernel_endpoint_integral μ ν t] _ = ∫ x : ℝ, ∫ p : ℝ × ℝ, orientedFourierKernel t p.1 p.2 x ∂(μ.prod ν) := by apply integral_congr_ae filter_upwards [hfiber] with x hx exact (integral_prod _ hx).symm _ = ∫ p : ℝ × (ℝ × ℝ), orientedFourierKernel t p.2.1 p.2.2 p.1 ∂(volume.prod (μ.prod ν)) := (integral_prod _ hswap).symm _ = ∫ p : ℝ × ℝ, ∫ x : ℝ, orientedFourierKernel t p.1 p.2 x ∂(volume : Measure ℝ) ∂(μ.prod ν) := integral_prod_symm _ hswap _ = ∫ a : ℝ, ∫ b : ℝ, ∫ x : ℝ, orientedFourierKernel t a b x ∂(volume : Measure ℝ) ∂ν ∂μ := by exact integral_prod _ hpair.integral_prod_left _ = ∫ a : ℝ, ∫ b : ℝ, (∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I)) ∂ν ∂μ := by simp_rw [orientedFourierKernel_interval_integral]
Causalean.Stat.CLT.BerryEsseen.cdf_difference_fourier_fubini · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierFubini.lean:46
1 supporting declaration (lemmas, instances)
  • fourier_oriented_interval_identity theorem — For a nonzero frequency, the oriented integral of the complex exponential between two real points equals the difference of their endpoint exponentials divided by the frequency, with the Fourier sign convention used here.
    a b t :
    ℝ
    ht :
    t ≠ 0
    (t : ℂ) * (∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I))
    = I * (exp (((t * a : ℝ) : ℂ) * I) - exp (((t * b : ℝ) : ℂ) * I))
    Proof (Lean source)
    theorem fourier_oriented_interval_identity (a b t : ℝ) (ht : t ≠ 0) : (t : ℂ) * (∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I)) = I * (exp (((t * a : ℝ) : ℂ) * I) - exp (((t * b : ℝ) : ℂ) * I)) := by have hc : (t : ℂ) * I ≠ 0 := mul_ne_zero (by exact_mod_cast ht) Complex.I_ne_zero have he : (fun x : ℝ => exp (((t * x : ℝ) : ℂ) * I)) = (fun x : ℝ => exp (((t : ℂ) * I) * x)) := by funext x congr 1 push_cast ring rw [he, integral_exp_mul_complex hc] push_cast have htC : (t : ℂ) ≠ 0 := by exact_mod_cast ht field_simp [htC] rw [Complex.I_sq] ring
    Causalean.Stat.CLT.BerryEsseen.fourier_oriented_interval_identity · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierFubini.lean:22
CDFDifference­Fourier­Interval 1 core · 0 supporting This module evaluates the oriented interval kernel in its Lebesgue variable. ★ orientedFourierKernel_interval_integral

Lebesgue integral of the oriented Fourier kernel

This module evaluates the oriented interval kernel in its Lebesgue variable. It is the other input to the CDF Fourier Fubini interchange.

theorem orientedFourierKernel_interval_integral reviewed
Causalean.Stat.CLT.BerryEsseen

Integrating the oriented Fourier kernel over the real line gives the oriented interval integral of the Fourier exponential exp(itx) from a to b.

Formal statement
t a b :
ℝ
(∫ x : ℝ, orientedFourierKernel t a b x)
= ∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I)
Proof (Lean source)
theorem orientedFourierKernel_interval_integral (t a b : ℝ) : (∫ x : ℝ, orientedFourierKernel t a b x) = ∫ x in a..b, exp (((t * x : ℝ) : ℂ) * I) := by let f : ℝ → ℂ := fun x => exp (((t * x : ℝ) : ℂ) * I) rcases le_total a b with hab | hba · have hkernel : orientedFourierKernel t a b = (Ico a b).indicator f := by funext x by_cases hax : a ≤ x <;> by_cases hbx : b ≤ x all_goals simp [orientedFourierKernel, f, Set.indicator_apply, Set.mem_Ico, hax, hbx] exact hax (hab.trans hbx) rw [hkernel, integral_indicator measurableSet_Ico] rw [intervalIntegral.integral_of_le hab, integral_Ico_eq_integral_Ioc] · have hkernel : orientedFourierKernel t a b = -(Ico b a).indicator f := by funext x by_cases hax : a ≤ x <;> by_cases hbx : b ≤ x all_goals simp [orientedFourierKernel, f, Set.indicator_apply, Set.mem_Ico, hax, hbx] exact hbx (hba.trans hax) rw [hkernel] simp only [Pi.neg_apply, integral_neg, integral_indicator measurableSet_Ico] rw [intervalIntegral.integral_of_ge hba, integral_Ico_eq_integral_Ioc]
Causalean.Stat.CLT.BerryEsseen.orientedFourierKernel_interval_integral · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierInterval.lean:16 · uses orientedFourierKernel
CDFDifference­Fourier­Quotient 1 core · 0 supporting The nonzero-frequency CDF Fourier identity becomes an equality of truncated real magnitude integrals. ★ cdf_difference_fourier_magnitude_integral

Weighted Fourier magnitude of a CDF difference

The nonzero-frequency CDF Fourier identity becomes an equality of truncated real magnitude integrals. Frequency zero is a null singleton for Lebesgue measure, so no atomlessness of either probability law is required.

theorem cdf_difference_fourier_magnitude_integral reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws with finite first moments, the integral over [−T, T] of the magnitude of the Fourier transform of their CDF difference equals the integral over [−T, T] of their characteristic-function discrepancy divided by |t|.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
T :
ℝ
(∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (((μ (Iic y)).toReal - (ν (Iic y)).toReal : ℝ) : ℂ)‖)
= ∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|
Proof (Lean source)
theorem cdf_difference_fourier_magnitude_integral (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (T : ℝ) : (∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (((μ (Iic y)).toReal - (ν (Iic y)).toReal : ℝ) : ℂ)‖) = ∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t| := by /- Take norms in cdf_difference_fourier_identity for t≠0. norm_mul, Complex.norm_real, Real.norm_eq_abs, and Complex.norm_I give |t|*‖Fourier H t‖=‖charFun μ t-charFun ν t‖. Divide by |t|, then use intervalIntegral.integral_congr_ae and the nullity of {0}. This is a congruence of integrals, not an inequality, and introduces no new probabilistic assumptions. -/ apply intervalIntegral.integral_congr_ae filter_upwards [volume.ae_ne (0 : ℝ)] with t ht intro _ have hnorm := congrArg norm (cdf_difference_fourier_identity μ ν hμ hν t ht) simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_I, one_mul] at hnorm apply (eq_div_iff (abs_ne_zero.mpr ht)).2 simpa only [mul_comm] using hnorm
Causalean.Stat.CLT.BerryEsseen.cdf_difference_fourier_magnitude_integral · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierQuotient.lean:17
CDFDifference­Fourier­Shift 1 core · 0 supporting Reflection around a fixed point converts the spatial integral arising from convolution into the ordinary Fourier transform of a CDF difference. ★ cdf_difference_fourier_shift

Translation of a CDF difference Fourier integral

Reflection around a fixed point converts the spatial integral arising from convolution into the ordinary Fourier transform of a CDF difference.

theorem cdf_difference_fourier_shift reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws with finite first moments, the integral of exp(−ity) times their CDF difference evaluated at z − y equals the phase exp(−itz) times the Fourier integral at frequency t of their CDF difference: reflecting the argument about z extracts that phase.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
t z :
ℝ
(∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal : ℝ) : ℂ))
= exp (((-(t * z) : ℝ) : ℂ) * I) * ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)
Proof (Lean source)
theorem cdf_difference_fourier_shift (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (t z : ℝ) : (∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal : ℝ) : ℂ)) = exp (((-(t * z) : ℝ) : ℂ) * I) * ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ) := by /- The CDF difference is integrable by `integrable_cdf_difference_of_first_moments`; the exponential has norm one. Apply the volume-preserving reflection `y ↦ z - y`, then `exp_add` and `integral_const_mul`. -/ have hD := integrable_cdf_difference_of_first_moments μ ν hμ hν have hDℂ : Integrable (fun x : ℝ => (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) volume := hD.ofReal have hF : Integrable (fun x : ℝ => exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) volume := by apply hDℂ.bdd_mul (c := 1) · fun_prop · filter_upwards [] with x simpa only [← Complex.ofReal_mul] using (le_of_eq (Complex.norm_exp_ofReal_mul_I (t * x))) have hphase (x : ℝ) : exp (((-(t * (z - x)) : ℝ) : ℂ) * I) = exp (((-(t * z) : ℝ) : ℂ) * I) * exp (((t * x : ℝ) : ℂ) * I) := by rw [← Complex.exp_add] congr 1 push_cast ring have hG : Integrable (fun x : ℝ => exp (((-(t * (z - x)) : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) volume := by convert hF.const_mul (exp (((-(t * z) : ℝ) : ℂ) * I)) using 1 ext x rw [hphase x] ring have hmp := Measure.measurePreserving_sub_left (volume : Measure ℝ) z have hGmap : AEStronglyMeasurable (fun x : ℝ => exp (((-(t * (z - x)) : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) (Measure.map (fun y : ℝ => z - y) volume) := by rw [hmp.map_eq] exact hG.aestronglyMeasurable have hshift := (integral_map hmp.measurable.aemeasurable hGmap).symm rw [hmp.map_eq] at hshift calc _ = ∫ x : ℝ, exp (((-(t * (z - x)) : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ) := by convert hshift using 1 · congr 1 ext y simp _ = _ := by simp_rw [hphase, mul_assoc] rw [integral_const_mul]
Causalean.Stat.CLT.BerryEsseen.cdf_difference_fourier_shift · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceFourierShift.lean:17
CDFDifference­Integrable 1 core · 0 supporting Finite first moments control the positive and negative CDF tails of two probability laws. ★ integrable_cdf_difference_of_first_moments

Integrability of a difference of distribution functions

Finite first moments control the positive and negative CDF tails of two probability laws. Their CDF difference is therefore Lebesgue integrable.

theorem integrable_cdf_difference_of_first_moments reviewed
Causalean.Stat.CLT.BerryEsseen

For two real probability laws with finite first moments, the difference of their cumulative distribution functions is Lebesgue integrable.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
Integrable (fun x : ℝ => (μ (Iic x)).toReal - (ν (Iic x)).toReal) volume
Proof (Lean source)
theorem integrable_cdf_difference_of_first_moments (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) : Integrable (fun x : ℝ => (μ (Iic x)).toReal - (ν (Iic x)).toReal) volume := by let T (ρ : Measure ℝ) (t : ℝ) : ENNReal := ρ {y : ℝ | t ≤ |y|} have hTmeas (ρ : Measure ℝ) : Measurable (T ρ) := by apply Antitone.measurable intro a b hab exact measure_mono (by intro y hy; exact le_trans hab hy) have hTfin (ρ : Measure ℝ) (hρ : Integrable (fun y : ℝ => y) ρ) : ∫⁻ t in Ioi (0 : ℝ), T ρ t < ⊤ := by have h := lintegral_eq_lintegral_meas_le ρ (f := fun y : ℝ => |y|) (Filter.Eventually.of_forall (fun y => abs_nonneg y)) (measurable_id.abs.aemeasurable) rw [← h] exact hρ.abs.lintegral_lt_top have hTint (ρ : Measure ℝ) (hρ : Integrable (fun y : ℝ => y) ρ) : IntegrableOn (fun t => (T ρ t).toReal) (Ioi 0) := by exact integrable_toReal_of_lintegral_ne_top (hTmeas ρ).aemeasurable (hTfin ρ hρ).ne have hleft (ρ : Measure ℝ) [IsProbabilityMeasure ρ] (hρ : Integrable (fun y : ℝ => y) ρ) : IntegrableOn (fun x => (ρ (Iic x)).toReal) (Iic 0) := by have hdom : IntegrableOn (fun x => (T ρ (-x)).toReal) (Iic 0) := by have hh : IntegrableOn (fun x => (T ρ (-x)).toReal) (Iio 0) := by have h0 : IntegrableOn (fun t => (T ρ t).toReal) (Ioi (-(0 : ℝ))) := by simpa only [neg_zero] using hTint ρ hρ exact h0.comp_neg_Iio exact (integrableOn_Iic_iff_integrableOn_Iio (f := fun x : ℝ => (T ρ (-x)).toReal) (μ := volume) (b := 0)).mpr hh apply hdom.mono' · have hm : Measurable (fun x : ℝ => ρ (Iic x)) := (show Monotone (fun x : ℝ => ρ (Iic x)) from fun _ _ h => measure_mono (Set.Iic_subset_Iic.mpr h)).measurable exact hm.ennreal_toReal.aestronglyMeasurable · filter_upwards [ae_restrict_mem measurableSet_Iic] with x hx have hsub : Iic x ⊆ {y : ℝ | -x ≤ |y|} := by intro y hy exact le_trans (neg_le_neg hy) (neg_le_abs y) have hb := measureReal_mono (μ := ρ) hsub rw [measureReal_def, measureReal_def] at hb simpa only [Real.norm_eq_abs, abs_of_nonneg (ENNReal.toReal_nonneg)] using hb have hright (ρ : Measure ℝ) [IsProbabilityMeasure ρ] (hρ : Integrable (fun y : ℝ => y) ρ) : IntegrableOn (fun x => (ρ (Ioi x)).toReal) (Ioi 0) := by apply (hTint ρ hρ).mono' · have hm : Measurable (fun x : ℝ => ρ (Ioi x)) := (show Antitone (fun x : ℝ => ρ (Ioi x)) from fun _ _ h => measure_mono (Set.Ioi_subset_Ioi h)).measurable exact hm.ennreal_toReal.aestronglyMeasurable · apply Filter.Eventually.of_forall intro x have hsub : Ioi x ⊆ {y : ℝ | x ≤ |y|} := by intro y hy exact le_trans (le_of_lt hy) (le_abs_self y) have hb := measureReal_mono (μ := ρ) hsub rw [measureReal_def, measureReal_def] at hb simpa only [Real.norm_eq_abs, abs_of_nonneg (ENNReal.toReal_nonneg)] using hb have hneg := (hleft μ hμ).sub (hleft ν hν) have hpos := (hright ν hν).sub (hright μ hμ) apply integrableOn_univ.mp rw [← Set.Iic_union_Ioi (a := (0 : ℝ))] apply IntegrableOn.union · exact hneg · apply hpos.congr_fun _ measurableSet_Ioi intro x hx have hμc := probReal_compl_eq_one_sub (μ := μ) (s := Iic x) measurableSet_Iic have hνc := probReal_compl_eq_one_sub (μ := ν) (s := Iic x) measurableSet_Iic change (ν (Ioi x)).toReal - (μ (Ioi x)).toReal = (μ (Iic x)).toReal - (ν (Iic x)).toReal simp only [Set.compl_Iic, Measure.real] at hμc hνc linarith
Causalean.Stat.CLT.BerryEsseen.integrable_cdf_difference_of_first_moments · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceIntegrable.lean:17
CDFDifference­Modulus 1 core · 0 supporting An interval-mass bound on a reference law controls how far the difference of two cumulative distribution functions can fall as its argument increases. ★ cdf_difference_one_sided_modulus

One-sided modulus of a difference of distribution functions

An interval-mass bound on a reference law controls how far the difference of two cumulative distribution functions can fall as its argument increases. This is the pointwise order estimate used before integrating a smoothing kernel.

theorem cdf_difference_one_sided_modulus reviewed
Causalean.Stat.CLT.BerryEsseen

If ν assigns every interval at most L times its length, then for any points a ≤ b the CDF difference Fμ − Fν at a is at most its value at b plus L·(b − a).

Formal statement
L :
ℝ
hν :
∀ a b : ℝ
if
a ≤ b
then
(ν (Ioc a b)).toReal ≤ L * (b - a)
a b :
ℝ
hab :
a ≤ b
(μ (Iic a)).toReal - (ν (Iic a)).toReal
≤ (μ (Iic b)).toReal - (ν (Iic b)).toReal + L * (b - a)
Proof (Lean source)
theorem cdf_difference_one_sided_modulus (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (L : ℝ) (hν : ∀ a b : ℝ, a ≤ b → (ν (Ioc a b)).toReal ≤ L * (b - a)) (a b : ℝ) (hab : a ≤ b) : (μ (Iic a)).toReal - (ν (Iic a)).toReal ≤ (μ (Iic b)).toReal - (ν (Iic b)).toReal + L * (b - a) := by /- Use `Iic b = Iic a ∪ Ioc a b` and monotonicity of μ. The same disjoint union identifies the ν-CDF increment with its interval mass; convert the finite ENNReal measures to real numbers. -/ have hμmono : (μ (Iic a)).toReal ≤ (μ (Iic b)).toReal := ENNReal.toReal_mono (measure_ne_top μ _) (measure_mono (Set.Iic_subset_Iic.mpr hab)) have hνadd : (ν (Iic b)).toReal = (ν (Iic a)).toReal + (ν (Ioc a b)).toReal := by rw [← Set.Iic_union_Ioc_eq_Iic hab, measure_union (Set.Iic_disjoint_Ioc le_rfl) measurableSet_Ioc, ENNReal.toReal_add (measure_ne_top ν _) (measure_ne_top ν _)] have hbound := hν a b hab linarith
Causalean.Stat.CLT.BerryEsseen.cdf_difference_one_sided_modulus · Causalean/Stat/CLT/BerryEsseen/CDFDifferenceModulus.lean:17
CDFGeneral­Sandwich 1 core · 0 supporting This comparison isolates the concentration needed from a smoothing kernel. ★ cdf_general_kernel_sandwich

CDF smoothing with an abstract probability kernel

This comparison isolates the concentration needed from a smoothing kernel. It permits a sharper band-limited kernel in the Gaussian smoothing theorem.

theorem cdf_general_kernel_sandwich reviewed
Causalean.Stat.CLT.BerryEsseen

Let K be an integrable nonnegative probability density that puts mass at most q outside the open interval (−a, a), where a ≥ 0 and q < 1/2. If the reference law ν assigns every interval at most L times its length, for a nonnegative constant L and the CDF difference of μ and ν, convolved with K, is bounded in absolute value at every point by a constant B, then the unsmoothed CDF difference is bounded in absolute value by (B + 2aL)/(1 − 2q) at every point.

Formal statement
K :
ℝ → ℝ
a q L B :
ℝ
ha :
0 ≤ a
hq :
q < 1 / 2
hL :
0 ≤ L
hK :
hKnonneg :
∀ y, 0 ≤ K y
hKmass :
∫ y, K y = 1
hKtail :
∫ y in {y : ℝ | a ≤ |y|}, K y ≤ q
hν :
∀ u v : ℝ
if
u ≤ v
then
(ν (Ioc u v)).toReal ≤ L * (v - u)
hsmooth :
∀ z : ℝ,
|∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * K y| ≤ B
x :
ℝ
|(μ (Iic x)).toReal - (ν (Iic x)).toReal| ≤ (B + 2 * a * L) / (1 - 2 * q)
Proof (Lean source)
theorem cdf_general_kernel_sandwich (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (K : ℝ → ℝ) (a q L B : ℝ) (ha : 0 ≤ a) (hq : q < 1 / 2) (hL : 0 ≤ L) (hK : Integrable K) (hKnonneg : ∀ y, 0 ≤ K y) (hKmass : ∫ y, K y = 1) (hKtail : ∫ y in {y : ℝ | a ≤ |y|}, K y ≤ q) (hν : ∀ u v : ℝ, u ≤ v → (ν (Ioc u v)).toReal ≤ L * (v - u)) (hsmooth : ∀ z : ℝ, |∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * K y| ≤ B) (x : ℝ) : |(μ (Iic x)).toReal - (ν (Iic x)).toReal| ≤ (B + 2 * a * L) / (1 - 2 * q) := by let H : ℝ → ℝ := fun z => (μ (Iic z)).toReal - (ν (Iic z)).toReal let s : Set ℝ := {y | a ≤ |y|} let D : ℝ := sSup (Set.range fun z : ℝ => |H z|) have hs : MeasurableSet s := measurableSet_le measurable_const measurable_abs have ht : ∫ y in s, K y ≤ q := hKtail have hCDF (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : Measurable (fun z : ℝ => (ρ (Iic z)).toReal) := by have hm := (ProbabilityTheory.monotone_cdf ρ).measurable convert hm using 1 ext z exact (ProbabilityTheory.cdf_eq_real ρ z).symm have hHm : Measurable H := (hCDF μ).sub (hCDF ν) have hHone (z : ℝ) : |H z| ≤ 1 := by have hμ0 : 0 ≤ (μ (Iic z)).toReal := ENNReal.toReal_nonneg have hν0 : 0 ≤ (ν (Iic z)).toReal := ENNReal.toReal_nonneg have hμ1 : (μ (Iic z)).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top μ _) (measure_mono (Set.subset_univ (Iic z))) simpa using h have hν1 : (ν (Iic z)).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top ν _) (measure_mono (Set.subset_univ (Iic z))) simpa using h dsimp [H] rw [abs_le] constructor <;> linarith have hbdd : BddAbove (Set.range fun z : ℝ => |H z|) := by refine ⟨1, ?_⟩ rintro _ ⟨z, rfl⟩ exact hHone z have hD : 0 ≤ D := by have h := le_csSup hbdd (Set.mem_range_self x) exact le_trans (abs_nonneg _) h have hDb (z : ℝ) : |H z| ≤ D := le_csSup hbdd (Set.mem_range_self z) have hD1 : D ≤ 1 := csSup_le (Set.range_nonempty _) (by rintro _ ⟨z, rfl⟩; exact hHone z) have hHint (z : ℝ) : Integrable (fun y => H (z - y) * K y) := by have hm : AEStronglyMeasurable (fun y => H (z - y)) volume := (hHm.comp (measurable_const.sub measurable_id)).aestronglyMeasurable have hb : ∀ᵐ y : ℝ ∂volume, ‖H (z - y)‖ ≤ (1 : ℝ) := by filter_upwards with y simpa only [Real.norm_eq_abs] using hHone (z - y) have heq : (fun y => H (z - y) * K y) = (fun y => K y * H (z - y)) := by funext y ring rw [heq] exact hK.mul_bdd hm hb have hNint (z : ℝ) : Integrable (fun y => (-H (z - y)) * K y) := by have heq : (fun y => (-H (z - y)) * K y) = -(fun y => H (z - y) * K y) := by funext y simp only [Pi.neg_apply, neg_mul] rw [heq] exact (hHint z).neg have hc : 0 ≤ 2 * a * L := by positivity have hpos (z : ℝ) : H z ≤ B + 2 * a * L + 2 * q * D := by have hp (y : ℝ) (hy : y ∉ s) : H z ≤ H ((z + a) - y) + 2 * a * L := by have hy' : |y| < a := lt_of_not_ge hy have hzy : z ≤ (z + a) - y := by linarith [le_abs_self y] have hd : ((z + a) - y) - z ≤ 2 * a := by linarith [neg_abs_le y] have hm := cdf_difference_one_sided_modulus μ ν L hν z ((z + a) - y) hzy have hmul := mul_le_mul_of_nonneg_left hd hL dsimp [H] linarith have h := kernel_sandwich_step K H s hs hK hHint hKnonneg hKmass q ht D (2 * a * L) hD hc hDb z (z + a) hp have hb := (le_abs_self (∫ y, H ((z + a) - y) * K y)).trans (hsmooth (z + a)) dsimp [H] at hb linarith have hneg (z : ℝ) : -H z ≤ B + 2 * a * L + 2 * q * D := by have hp (y : ℝ) (hy : y ∉ s) : -H z ≤ -H ((z - a) - y) + 2 * a * L := by have hy' : |y| < a := lt_of_not_ge hy have hzy : (z - a) - y ≤ z := by linarith [neg_abs_le y] have hd : z - ((z - a) - y) ≤ 2 * a := by linarith [le_abs_self y] have hm := cdf_difference_one_sided_modulus μ ν L hν ((z - a) - y) z hzy have hmul := mul_le_mul_of_nonneg_left hd hL dsimp [H] linarith have hnb (w : ℝ) : |(-H w)| ≤ D := by simpa using hDb w have h := kernel_sandwich_step K (fun w => -H w) s hs hK hNint hKnonneg hKmass q ht D (2 * a * L) hD hc hnb z (z - a) hp have hni : (∫ y, (-H ((z - a) - y)) * K y) = -(∫ y, H ((z - a) - y) * K y) := by rw [← integral_neg] congr 1 ext y ring rw [hni] at h have hb := (neg_le_abs (∫ y, H ((z - a) - y) * K y)).trans (hsmooth (z - a)) dsimp [H] at hb linarith have hDtwo : D ≤ B + 2 * a * L + 2 * q * D := by apply csSup_le (Set.range_nonempty _) rintro _ ⟨z, rfl⟩ exact abs_le.mpr ⟨by linarith [hneg z], by linarith [hpos z]⟩ have hx := hDb x have hden : 0 < 1 - 2 * q := by linarith have hnum : D * (1 - 2 * q) ≤ B + 2 * a * L := by nlinarith [hDtwo] have hfinal : D ≤ (B + 2 * a * L) / (1 - 2 * q) := (le_div_iff₀ hden).2 hnum exact hx.trans hfinal
Causalean.Stat.CLT.BerryEsseen.cdf_general_kernel_sandwich · Causalean/Stat/CLT/BerryEsseen/CDFGeneralSandwich.lean:17
CDFReflection 1 core · 2 supporting Reflection preserves first moments and characteristic-function discrepancies. ★ reflected_reference_interval_and_cdf

Reflection of scalar CDF comparisons

Reflection preserves first moments and characteristic-function discrepancies. For a reference law with bounded interval mass, its absence of atoms supplies the endpoint correction needed to turn an upper CDF bound into a lower bound. These facts do not depend on an Esseen or Berry–Esseen theorem.

theorem reflected_reference_interval_and_cdf reviewed
Causalean.Stat.CLT.BerryEsseen

If a probability reference law ν assigns every interval at most L times its length, then its reflection y ↦ −y satisfies the same interval bound, and the lower CDF discrepancy Fν(x) − Fμ(x) is at most the upper discrepancy of the reflected laws at −x, even when μ has an atom at x.

Formal statement
L :
ℝ
hν :
∀ a b : ℝ
if
a ≤ b
then
(ν (Ioc a b)).toReal ≤ L * (b - a)
conclusion 1
a b :
ℝ
a ≤ b
((ν.map (fun y : ℝ => -y)) (Ioc a b)).toReal ≤ L * (b - a)
conclusion 2
x :
ℝ
(ν (Iic x)).toReal - (μ (Iic x)).toReal
≤ ((μ.map (fun y : ℝ => -y)) (Iic (-x))).toReal
- ((ν.map (fun y : ℝ => -y)) (Iic (-x))).toReal
Proof (Lean source)
theorem reflected_reference_interval_and_cdf (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (L : ℝ) (hν : ∀ a b : ℝ, a ≤ b → (ν (Ioc a b)).toReal ≤ L * (b - a)) : (∀ a b : ℝ, a ≤ b → ((ν.map (fun y : ℝ => -y)) (Ioc a b)).toReal ≤ L * (b - a)) ∧ (∀ x : ℝ, (ν (Iic x)).toReal - (μ (Iic x)).toReal ≤ ((μ.map (fun y : ℝ => -y)) (Iic (-x))).toReal - ((ν.map (fun y : ℝ => -y)) (Iic (-x))).toReal) := by /- First show ν {z} = 0 by bounding it with ν(Ioc (z-d) z) for every d>0, then sending d to zero (or use continuous CDF/no-atoms infrastructure). Reflection takes Ioc a b to Ico (-b) (-a); ν's zero endpoint masses identify Ico and Ioc. Reflection takes Iic (-x) to Ici x, whose probability is 1-ν(Iio x). For ν, Iio and Iic agree; for μ, monotonicity gives μ(Iio x)≤μ(Iic x), in the required direction. Do not assume μ has no atoms. -/ have hsingleton (z : ℝ) : ν {z} = 0 := by have hz : (ν {z}).toReal = 0 := by apply le_antisymm _ ENNReal.toReal_nonneg by_contra! hpos obtain ⟨d, hd, hsmall⟩ := exists_pos_mul_lt hpos L have hsub : ({z} : Set ℝ) ⊆ Ioc (z - d) z := by intro y hy rcases Set.mem_singleton_iff.mp hy with rfl exact ⟨by linarith, le_rfl⟩ have hmono := ENNReal.toReal_mono (measure_ne_top ν _) (measure_mono hsub) have hbound := hν (z - d) z (by linarith) have hlength : z - (z - d) = d := by ring rw [hlength] at hbound exact (not_lt_of_ge (hmono.trans hbound)) hsmall exact ((ENNReal.toReal_eq_zero_iff _).mp hz).resolve_right (measure_ne_top ν _) constructor · intro a b hab have hpre : (fun y : ℝ => -y) ⁻¹' Ioc a b = Ico (-b) (-a) := by ext y exact Set.neg_mem_Ioc_iff rw [Measure.map_apply (by fun_prop) measurableSet_Ioc, hpre, measure_congr (Ico_ae_eq_Ioc' (hsingleton (-b)) (hsingleton (-a)))] have hbound := hν (-b) (-a) (neg_le_neg hab) convert hbound using 1 ring · intro x have hpre : (fun y : ℝ => -y) ⁻¹' Iic (-x) = Ici x := by ext y simp only [Set.mem_preimage, Set.mem_Iic, Set.mem_Ici, neg_le_neg_iff] have htail (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : (ρ (Ici x)).toReal = 1 - (ρ (Iio x)).toReal := by simpa only [Measure.real, Set.compl_Iio] using (probReal_compl_eq_one_sub (μ := ρ) (s := Iio x) measurableSet_Iio) rw [Measure.map_apply (by fun_prop) measurableSet_Iic, Measure.map_apply (by fun_prop) measurableSet_Iic, hpre, htail μ, htail ν, measure_congr (Iio_ae_eq_Iic' (hsingleton x))] have hmono := ENNReal.toReal_mono (measure_ne_top μ (Iic x)) (measure_mono (Set.Iio_subset_Iic_self (a := x))) linarith
Causalean.Stat.CLT.BerryEsseen.reflected_reference_interval_and_cdf · Causalean/Stat/CLT/BerryEsseen/CDFReflection.lean:39
2 supporting declarations (lemmas, instances)
CDFSandwich 1 core · 2 supporting This module isolates the order-theoretic part of the Esseen smoothing argument. ★ standardGaussian_interval_mass_le

A distribution-function sandwich for sinc smoothing

This module isolates the order-theoretic part of the Esseen smoothing argument. A probability kernel with a controlled tail compares an original CDF difference with its smoothed version against a Lipschitz reference CDF.

theorem standardGaussian_interval_mass_le reviewed
Causalean.Stat.CLT.BerryEsseen

For real endpoints a ≤ b, the standard Gaussian gives the interval (a, b] probability at most (b − a)/√(2π), the interval length times the maximum of the Gaussian density.

Formal statement
a b :
ℝ
hab :
a ≤ b
((gaussianReal 0 1) (Ioc a b)).toReal ≤ (b - a) / sqrt (2 * pi)
Proof (Lean source)
theorem standardGaussian_interval_mass_le (a b : ℝ) (hab : a ≤ b) : ((gaussianReal 0 1) (Ioc a b)).toReal ≤ (b - a) / sqrt (2 * pi) := by rw [ProbabilityTheory.gaussianReal_apply_eq_integral 0 (v := 1) one_ne_zero] have hnonneg : 0 ≤ ∫ x in Ioc a b, gaussianPDFReal 0 1 x := integral_nonneg (fun x => gaussianPDFReal_nonneg 0 1 x) rw [ENNReal.toReal_ofReal hnonneg] rw [← intervalIntegral.integral_of_le hab] have hbound : ∀ x : ℝ, gaussianPDFReal 0 1 x ≤ (sqrt (2 * pi))⁻¹ := by intro x rw [gaussianPDFReal] have hexp : exp (-(x - 0) ^ 2 / (2 * (1 : ℝ))) ≤ 1 := Real.exp_le_one_iff.mpr (by nlinarith [sq_nonneg x]) have hs : 0 ≤ (sqrt (2 * pi))⁻¹ := by positivity simpa [mul_comm, mul_left_comm, mul_assoc] using (mul_le_mul_of_nonneg_left hexp hs) have hi : IntervalIntegrable (gaussianPDFReal 0 1) volume a b := (integrable_gaussianPDFReal 0 1).intervalIntegrable have hc : IntervalIntegrable (fun _ : ℝ => (sqrt (2 * pi))⁻¹) volume a b := intervalIntegrable_const calc ∫ x in a..b, gaussianPDFReal 0 1 x ≤ ∫ x in a..b, (sqrt (2 * pi))⁻¹ := intervalIntegral.integral_mono_on hab hi hc (fun x _ => hbound x) _ = (b - a) / sqrt (2 * pi) := by rw [intervalIntegral.integral_const] ring
Causalean.Stat.CLT.BerryEsseen.standardGaussian_interval_mass_le · Causalean/Stat/CLT/BerryEsseen/CDFSandwich.lean:216
2 supporting declarations (lemmas, instances)
  • kernel_sandwich_step theorem — A probability kernel transfers a one-sided comparison outside a tail set to an integral comparison, with tail loss controlled by the uniform bound.
    K G :
    ℝ → ℝ
    s :
    Set ℝ
    hs :
    hK :
    hG :
    ∀ z, Integrable (fun y => G (z - y) * K y)
    hkn :
    ∀ y, 0 ≤ K y
    hki :
    ∫ y, K y = 1
    q :
    ℝ
    ht :
    ∫ y in s, K y ≤ q
    D c :
    ℝ
    hD :
    0 ≤ D
    hc :
    0 ≤ c
    hGb :
    ∀ y, |G y| ≤ D
    x z :
    ℝ
    hp :
    ∀ y ∉ s, G x ≤ G (z - y) + c
    G x ≤ (∫ y, G (z - y) * K y) + c + 2 * q * D
    Proof (Lean source)
    theorem kernel_sandwich_step (K G : ℝ → ℝ) (s : Set ℝ) (hs : MeasurableSet s) (hK : Integrable K) (hG : ∀ z, Integrable (fun y => G (z - y) * K y)) (hkn : ∀ y, 0 ≤ K y) (hki : ∫ y, K y = 1) (q : ℝ) (ht : ∫ y in s, K y ≤ q) (D c : ℝ) (hD : 0 ≤ D) (hc : 0 ≤ c) (hGb : ∀ y, |G y| ≤ D) (x z : ℝ) (hp : ∀ y ∉ s, G x ≤ G (z - y) + c) : G x ≤ (∫ y, G (z - y) * K y) + c + 2 * q * D := by have hi : Integrable (s.indicator (fun y => 2 * D * K y)) := (hK.const_mul (2 * D)).integrableOn.integrable_indicator hs have hpt (y : ℝ) : G x * K y ≤ (G (z - y) + c) * K y + s.indicator (fun y => 2 * D * K y) y := by by_cases hy : y ∈ s · rw [Set.indicator_of_mem hy] have h1 := le_abs_self (G x) have h2 := neg_abs_le (G (z - y)) have h3 := hGb x have h4 := hGb (z - y) nlinarith [hkn y] · rw [Set.indicator_of_notMem hy] nlinarith [hp y hy, hkn y] have hl : Integrable (fun y => G x * K y) := hK.const_mul _ have hmidint : Integrable (fun y => (G (z - y) + c) * K y) := by have heq : (fun y => (G (z - y) + c) * K y) = (fun y => G (z - y) * K y) + (fun y => c * K y) := by funext y simp only [Pi.add_apply, add_mul] rw [heq] exact (hG z).add (hK.const_mul c) have hr := hmidint.add hi have hm := integral_mono hl hr hpt have htail : (∫ y, s.indicator (fun y => 2 * D * K y) y) ≤ 2 * q * D := by rw [integral_indicator hs, integral_const_mul] nlinarith [mul_le_mul_of_nonneg_left ht (by positivity : 0 ≤ 2 * D)] have hmiddle : (∫ y, (G (z - y) + c) * K y) = (∫ y, G (z - y) * K y) + c := by calc _ = ∫ y, G (z - y) * K y + c * K y := by congr 1 ext y ring _ = (∫ y, G (z - y) * K y) + ∫ y, c * K y := integral_add (hG z) (hK.const_mul c) _ = _ := by rw [integral_const_mul, hki, mul_one] have hsplit : (∫ y, (G (z - y) + c) * K y + s.indicator (fun y => 2 * D * K y) y) = (∫ y, (G (z - y) + c) * K y) + ∫ y, s.indicator (fun y => 2 * D * K y) y := integral_add hmidint hi have hm' : (∫ y, G x * K y) ≤ (∫ y, (G (z - y) + c) * K y) + ∫ y, s.indicator (fun y => 2 * D * K y) y := by simpa only [Pi.add_apply, hsplit] using hm rw [integral_const_mul, hki, mul_one, hmiddle] at hm' linarith
    Causalean.Stat.CLT.BerryEsseen.kernel_sandwich_step · Causalean/Stat/CLT/BerryEsseen/CDFSandwich.lean:20
  • sinc4_cdf_sandwich theorem — If the reference law assigns every interval at most its length times L, and the sinc-smoothed CDF discrepancy is everywhere at most B, then the unsmoothed CDF discrepancy is at most 2 B + 24 L / T.
    T L B :
    ℝ
    hT :
    0 < T
    hL :
    0 ≤ L
    hν :
    ∀ a b : ℝ
    if
    a ≤ b
    then
    (ν (Ioc a b)).toReal ≤ L * (b - a)
    hsmooth :
    ∀ z : ℝ,
    |∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y|
    ≤ B
    x :
    ℝ
    |(μ (Iic x)).toReal - (ν (Iic x)).toReal| ≤ 2 * B + 24 * L / T
    Proof (Lean source)
    theorem sinc4_cdf_sandwich (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (T L B : ℝ) (hT : 0 < T) (hL : 0 ≤ L) (hν : ∀ a b : ℝ, a ≤ b → (ν (Ioc a b)).toReal ≤ L * (b - a)) (hsmooth : ∀ z : ℝ, |∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y| ≤ B) (x : ℝ) : |(μ (Iic x)).toReal - (ν (Iic x)).toReal| ≤ 2 * B + 24 * L / T := by let H : ℝ → ℝ := fun z => (μ (Iic z)).toReal - (ν (Iic z)).toReal let K : ℝ → ℝ := sinc4Kernel T let a : ℝ := 6 / T let s : Set ℝ := {y | a ≤ |y|} let D : ℝ := sSup (Set.range fun z : ℝ => |H z|) have ha : 0 ≤ a := by dsimp [a]; positivity have hs : MeasurableSet s := measurableSet_le measurable_const measurable_abs have hK : Integrable K := sinc4Kernel_integrable T hT have hkn : ∀ y, 0 ≤ K y := sinc4Kernel_nonneg T hT have hki : ∫ y, K y = 1 := sinc4Kernel_integral_eq_one T hT have ht : ∫ y in s, K y ≤ (1 / 4 : ℝ) := sinc4Kernel_tail_le_quarter T hT have hCDF (ρ : Measure ℝ) [IsProbabilityMeasure ρ] : Measurable (fun z : ℝ => (ρ (Iic z)).toReal) := by have hm := (ProbabilityTheory.monotone_cdf ρ).measurable convert hm using 1 ext z exact (ProbabilityTheory.cdf_eq_real ρ z).symm have hHm : Measurable H := (hCDF μ).sub (hCDF ν) have hHone (z : ℝ) : |H z| ≤ 1 := by have hμ0 : 0 ≤ (μ (Iic z)).toReal := ENNReal.toReal_nonneg have hν0 : 0 ≤ (ν (Iic z)).toReal := ENNReal.toReal_nonneg have hμ1 : (μ (Iic z)).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top μ _) (measure_mono (Set.subset_univ (Iic z))) simpa using h have hν1 : (ν (Iic z)).toReal ≤ 1 := by have h := ENNReal.toReal_mono (measure_ne_top ν _) (measure_mono (Set.subset_univ (Iic z))) simpa using h dsimp [H] rw [abs_le] constructor <;> linarith have hbdd : BddAbove (Set.range fun z : ℝ => |H z|) := by refine ⟨1, ?_⟩ rintro _ ⟨z, rfl⟩ exact hHone z have hD : 0 ≤ D := by have h := le_csSup hbdd (Set.mem_range_self x) exact le_trans (abs_nonneg _) h have hDb (z : ℝ) : |H z| ≤ D := le_csSup hbdd (Set.mem_range_self z) have hD1 : D ≤ 1 := csSup_le (Set.range_nonempty _) (by rintro _ ⟨z, rfl⟩; exact hHone z) have hHint (z : ℝ) : Integrable (fun y => H (z - y) * K y) := by have hm : AEStronglyMeasurable (fun y => H (z - y)) volume := (hHm.comp (measurable_const.sub measurable_id)).aestronglyMeasurable have hb : ∀ᵐ y : ℝ ∂volume, ‖H (z - y)‖ ≤ (1 : ℝ) := by filter_upwards with y simpa only [Real.norm_eq_abs] using hHone (z - y) have heq : (fun y => H (z - y) * K y) = (fun y => K y * H (z - y)) := by funext y ring rw [heq] exact hK.mul_bdd hm hb have hNint (z : ℝ) : Integrable (fun y => (-H (z - y)) * K y) := by have heq : (fun y => (-H (z - y)) * K y) = -(fun y => H (z - y) * K y) := by funext y simp only [Pi.neg_apply, neg_mul] rw [heq] exact (hHint z).neg have hc : 0 ≤ 2 * a * L := by positivity have hpos (z : ℝ) : H z ≤ B + 2 * a * L + D / 2 := by have hp (y : ℝ) (hy : y ∉ s) : H z ≤ H ((z + a) - y) + 2 * a * L := by have hy' : |y| < a := lt_of_not_ge hy have hzy : z ≤ (z + a) - y := by linarith [le_abs_self y] have hd : ((z + a) - y) - z ≤ 2 * a := by linarith [neg_abs_le y] have hm := cdf_difference_one_sided_modulus μ ν L hν z ((z + a) - y) hzy have hmul := mul_le_mul_of_nonneg_left hd hL dsimp [H] linarith have h := kernel_sandwich_step K H s hs hK hHint hkn hki (1 / 4) ht D (2 * a * L) hD hc hDb z (z + a) hp have hb := (le_abs_self (∫ y, H ((z + a) - y) * K y)).trans (hsmooth (z + a)) dsimp [H, K] at hb linarith have hneg (z : ℝ) : -H z ≤ B + 2 * a * L + D / 2 := by have hp (y : ℝ) (hy : y ∉ s) : -H z ≤ -H ((z - a) - y) + 2 * a * L := by have hy' : |y| < a := lt_of_not_ge hy have hzy : (z - a) - y ≤ z := by linarith [neg_abs_le y] have hd : z - ((z - a) - y) ≤ 2 * a := by linarith [le_abs_self y] have hm := cdf_difference_one_sided_modulus μ ν L hν ((z - a) - y) z hzy have hmul := mul_le_mul_of_nonneg_left hd hL dsimp [H] linarith have hnb (w : ℝ) : |(-H w)| ≤ D := by simpa using hDb w have h := kernel_sandwich_step K (fun w => -H w) s hs hK hNint hkn hki (1 / 4) ht D (2 * a * L) hD hc hnb z (z - a) hp have hni : (∫ y, (-H ((z - a) - y)) * K y) = -(∫ y, H ((z - a) - y) * K y) := by rw [← integral_neg] congr 1 ext y ring rw [hni] at h have hb := (neg_le_abs (∫ y, H ((z - a) - y) * K y)).trans (hsmooth (z - a)) dsimp [H, K] at hb linarith have hDtwo : D ≤ B + 2 * a * L + D / 2 := by apply csSup_le (Set.range_nonempty _) rintro _ ⟨z, rfl⟩ exact abs_le.mpr ⟨by linarith [hneg z], by linarith [hpos z]⟩ have hx := hDb x have hfinal : D ≤ 2 * B + 4 * a * L := by linarith dsimp [H] at hx have hconst : 4 * a * L = 24 * L / T := by dsimp [a] field_simp ring rw [← hconst] exact hx.trans hfinal
    Causalean.Stat.CLT.BerryEsseen.sinc4_cdf_sandwich · Causalean/Stat/CLT/BerryEsseen/CDFSandwich.lean:78
Cosine­Cubic 1 core · 1 supporting This deterministic leaf isolates the analytic ingredient of the wide characteristic-function estimate and a reusable quartic Taylor enclosure. ★ cos_le_quadratic_add_cubic

Global cubic and quartic cosine remainder bounds

This deterministic leaf isolates the analytic ingredient of the wide characteristic-function estimate and a reusable quartic Taylor enclosure. The cubic coefficient is conservatively rounded up from Tyurin's extremal cosine-remainder constant, approximately 0.099162 (Tyurin, arXiv:0912.0726, the constant defined before Theorem 5).

theorem cos_le_quadratic_add_cubic reviewed
Causalean.Stat.CLT.BerryEsseen

The cosine of any real argument is bounded above by its quadratic Taylor polynomial 1 − u²/2 plus one tenth of the absolute cube |u|³.

Formal statement
u :
ℝ
cos u ≤ 1 - u ^ 2 / 2 + |u| ^ 3 / 10
Proof (Lean source)
theorem cos_le_quadratic_add_cubic (u : ℝ) : cos u ≤ 1 - u ^ 2 / 2 + |u| ^ 3 / 10 := by /- Reduce to u≥0 using cosine evenness. For u≥5, cos u≤1 suffices. On the remaining compact interval, certify the polynomial Taylor bounds with alternating remainder signs, subdividing with rational endpoints as needed. A sixth/eighth-order truncation alone need not reach coefficient 1/10 near u=4. Bounds must be proved in Lean, not sampled numerically. This task is only deterministic cosine analysis; it contains no moment, product-measure, smoothing, or CLT obligation. -/ have integrate (f : ℝ → ℝ) (hf : Differentiable ℝ f) (h0 : f 0 = 0) (hd : ∀ x, 0 ≤ x → 0 ≤ deriv f x) (x : ℝ) (hx : 0 ≤ x) : 0 ≤ f x := by have hm : MonotoneOn f (Ici 0) := monotoneOn_of_deriv_nonneg (convex_Ici 0) hf.continuous.continuousOn hf.differentiableOn (fun y hy => hd y (le_of_lt (by simpa using hy))) simpa [h0] using hm (by simp) hx hx -- Integrating nonnegative derivative differences proves each remainder sign. have h3 (x : ℝ) (hx : 0 ≤ x) := Real.sin_ge_sub_cube hx have h4 (x : ℝ) (_hx : 0 ≤ x) : cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 / 24 := cos_le_quadratic_add_quartic x have h5 (x : ℝ) (hx : 0 ≤ x) : sin x ≤ x - x ^ 3 / 6 + x ^ 5 / 120 := by have hd (x : ℝ) : deriv (fun x : ℝ => (x - x ^ 3 / 6 + x ^ 5 / 120) - (sin x)) x = (1 - x ^ 2 / 2 + x ^ 4 / 24) - (cos x) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (x - x ^ 3 / 6 + x ^ 5 / 120) - (sin x)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h4 y hy)) x hx linarith only [h] have h6 (x : ℝ) (hx : 0 ≤ x) : 1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 ≤ cos x := by have hd (x : ℝ) : deriv (fun x : ℝ => (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720)) x = (x - x ^ 3 / 6 + x ^ 5 / 120) - (sin x) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h5 y hy)) x hx linarith only [h] have h7 (x : ℝ) (hx : 0 ≤ x) : x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 ≤ sin x := by have hd (x : ℝ) : deriv (fun x : ℝ => (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040)) x = (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h6 y hy)) x hx linarith only [h] have h8 (x : ℝ) (hx : 0 ≤ x) : cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 := by have hd (x : ℝ) : deriv (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320) - (cos x)) x = (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320) - (cos x)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h7 y hy)) x hx linarith only [h] have h9 (x : ℝ) (hx : 0 ≤ x) : sin x ≤ x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880 := by have hd (x : ℝ) : deriv (fun x : ℝ => (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880) - (sin x)) x = (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320) - (cos x) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880) - (sin x)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h8 y hy)) x hx linarith only [h] have h10 (x : ℝ) (hx : 0 ≤ x) : 1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800 ≤ cos x := by have hd (x : ℝ) : deriv (fun x : ℝ => (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800)) x = (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880) - (sin x) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h9 y hy)) x hx linarith only [h] have h11 (x : ℝ) (hx : 0 ≤ x) : x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880 - x ^ 11 / 39916800 ≤ sin x := by have hd (x : ℝ) : deriv (fun x : ℝ => (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880 - x ^ 11 / 39916800)) x = (cos x) - (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880 - x ^ 11 / 39916800)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h10 y hy)) x hx linarith only [h] have h12 (x : ℝ) (hx : 0 ≤ x) : cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800 + x ^ 12 / 479001600 := by have hd (x : ℝ) : deriv (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800 + x ^ 12 / 479001600) - (cos x)) x = (sin x) - (x - x ^ 3 / 6 + x ^ 5 / 120 - x ^ 7 / 5040 + x ^ 9 / 362880 - x ^ 11 / 39916800) := by simp (disch := fun_prop) ring have h := integrate (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 - x ^ 10 / 3628800 + x ^ 12 / 479001600) - (cos x)) (by fun_prop) (by norm_num) (by intro y hy rw [hd] exact sub_nonneg.mpr (h11 y hy)) x hx linarith only [h] -- Exact Bernstein certificates on three rational intervals. have hpoly (x : ℝ) (hx : 0 ≤ x) (hx5 : x ≤ 5) : 0 ≤ (1 / 10 - x / 24 + x ^ 3 / 720 - x ^ 5 / 40320 + x ^ 7 / 3628800 - x ^ 9 / 479001600 : ℝ) := by by_cases hx3 : x ≤ 3 · have hr : 0 ≤ 3 - x := by linarith rw [show (1 / 10 - x / 24 + x ^ 3 / 720 - x ^ 5 / 40320 + x ^ 7 / 3628800 - x ^ 9 / 479001600 : ℝ) = (1 / 196830 : ℝ) * (3 - x) ^ 9 + (31 / 787320 : ℝ) * x * (3 - x) ^ 8 + (13 / 98415 : ℝ) * x ^ 2 * (3 - x) ^ 7 + (79 / 314928 : ℝ) * x ^ 3 * (3 - x) ^ 6 + (233 / 787320 : ℝ) * x ^ 4 * (3 - x) ^ 5 + (19741 / 88179840 : ℝ) * x ^ 5 * (3 - x) ^ 4 + (2381 / 22044960 : ℝ) * x ^ 6 * (3 - x) ^ 3 + (28087 / 881798400 : ℝ) * x ^ 7 * (3 - x) ^ 2 + (2287 / 440899200 : ℝ) * x ^ 8 * (3 - x) + (1981 / 5542732800 : ℝ) * x ^ 9 from by ring] positivity · have hx3 : 0 ≤ x - 3 := by linarith by_cases hx4 : x ≤ 4 · have hr : 0 ≤ 4 - x := by linarith rw [show (1 / 10 - x / 24 + x ^ 3 / 720 - x ^ 5 / 40320 + x ^ 7 / 3628800 - x ^ 9 / 479001600 : ℝ) = (1981 / 281600 : ℝ) * (4 - x) ^ 9 + (74489 / 1478400 : ℝ) * (x - 3) * (4 - x) ^ 8 + (231919 / 1478400 : ℝ) * (x - 3) ^ 2 * (4 - x) ^ 7 + (308311 / 1108800 : ℝ) * (x - 3) ^ 3 * (4 - x) ^ 6 + (76147 / 246400 : ℝ) * (x - 3) ^ 4 * (4 - x) ^ 5 + (124337 / 554400 : ℝ) * (x - 3) ^ 5 * (4 - x) ^ 4 + (89813 / 831600 : ℝ) * (x - 3) ^ 6 * (4 - x) ^ 3 + (21611 / 623700 : ℝ) * (x - 3) ^ 7 * (4 - x) ^ 2 + (8999 / 1247400 : ℝ) * (x - 3) ^ 8 * (4 - x) + (53 / 66825 : ℝ) * (x - 3) ^ 9 from by ring] positivity · have hx4 : 0 ≤ x - 4 := by linarith have hr : 0 ≤ 5 - x := by linarith rw [show (1 / 10 - x / 24 + x ^ 3 / 720 - x ^ 5 / 40320 + x ^ 7 / 3628800 - x ^ 9 / 479001600 : ℝ) = (53 / 66825 : ℝ) * (5 - x) ^ 9 + (8809 / 1247400 : ℝ) * (x - 4) * (5 - x) ^ 8 + (20851 / 623700 : ℝ) * (x - 4) ^ 2 * (5 - x) ^ 7 + (50933 / 498960 : ℝ) * (x - 4) ^ 3 * (5 - x) ^ 6 + (29339 / 142560 : ℝ) * (x - 4) ^ 4 * (5 - x) ^ 5 + (1091809 / 3991680 : ℝ) * (x - 4) ^ 5 * (5 - x) ^ 4 + (471799 / 1995840 : ℝ) * (x - 4) ^ 6 * (5 - x) ^ 3 + (1019911 / 7983360 : ℝ) * (x - 4) ^ 7 * (5 - x) ^ 2 + (313139 / 7983360 : ℝ) * (x - 4) ^ 8 * (5 - x) + (71501 / 13685760 : ℝ) * (x - 4) ^ 9 from by ring] positivity have hnonneg (x : ℝ) (hx : 0 ≤ x) : cos x ≤ 1 - x ^ 2 / 2 + x ^ 3 / 10 := by by_cases hx5 : x ≤ 5 · have hp := mul_nonneg (pow_nonneg hx 3) (hpoly x hx hx5) have hc := h12 x hx nlinarith only [hp, hc] · have hp := mul_nonneg (sq_nonneg x) (show 0 ≤ x - 5 by linarith) have hc := Real.cos_le_one x nlinarith only [hp, hc] simpa only [Real.cos_abs, sq_abs] using hnonneg |u| (abs_nonneg u)
Causalean.Stat.CLT.BerryEsseen.cos_le_quadratic_add_cubic · Causalean/Stat/CLT/BerryEsseen/CosineCubic.lean:40
1 supporting declaration (lemmas, instances)
  • cos_le_quadratic_add_quartic theorem — The cosine of any real argument is bounded above by its quartic Taylor polynomial.
    u :
    ℝ
    cos u ≤ 1 - u ^ 2 / 2 + u ^ 4 / 24
    Proof (Lean source)
    theorem cos_le_quadratic_add_quartic (u : ℝ) : cos u ≤ 1 - u ^ 2 / 2 + u ^ 4 / 24 := by have hd (x : ℝ) : deriv (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24) - cos x) x = sin x - (x - x ^ 3 / 6) := by simp (disch := fun_prop) ring have hm : MonotoneOn (fun x : ℝ => (1 - x ^ 2 / 2 + x ^ 4 / 24) - cos x) (Ici 0) := by apply monotoneOn_of_deriv_nonneg (convex_Ici 0) (by fun_prop) (by fun_prop) intro x hx rw [hd] exact sub_nonneg.mpr (Real.sin_ge_sub_cube (le_of_lt (by simpa using hx))) have h := hm (by simp) (abs_nonneg u) (abs_nonneg u) norm_num [Real.cos_abs, pow_abs, abs_of_nonneg (show 0 ≤ u ^ 2 by positivity), abs_of_nonneg (show 0 ≤ u ^ 4 by positivity)] at h linarith only [h]
    Causalean.Stat.CLT.BerryEsseen.cos_le_quadratic_add_quartic · Causalean/Stat/CLT/BerryEsseen/CosineCubic.lean:17
Csc­Squared­Series 1 core · 0 supporting This real boundary identity is the squared-cosecant companion of Mathlib's cotangent expansion. ★ csc_squared_reciprocal_series

Reciprocal-square partial fractions on the real line

This real boundary identity is the squared-cosecant companion of Mathlib's cotangent expansion. It is independent of Abel integration and probability.

Both reciprocal-square terms belong to each summand of the symmetric series.

theorem csc_squared_reciprocal_series reviewed
Causalean.Stat.CLT.BerryEsseen

At a real argument x away from the integer zeros of sin(πx), the symmetric shifted reciprocal-square series Σ_{n≥1} (1/(x−n)² + 1/(x+n)²) is summable, and (sin(πx)/π)² times its sum plus the central term 1/x² equals one.

Formal statement
x :
ℝ
hsin :
sin (pi * x) ≠ 0
conclusion 1
Summable (fun n : ℕ => 1 / (x - ((n : ℝ) + 1)) ^ 2 + 1 / (x + ((n : ℝ) + 1)) ^ 2)
conclusion 2
(sin (pi * x) / pi) ^ 2 * (1 / x ^ 2 + (∑' n : ℕ, (1 / (x - ((n : ℝ) + 1)) ^ 2 + 1 / (x + ((n : ℝ) + 1)) ^ 2)))
= 1
Proof (Lean source)
theorem csc_squared_reciprocal_series (x : ℝ) (hsin : sin (Real.pi * x) ≠ 0) : Summable (fun n : ℕ => 1 / (x - ((n : ℝ) + 1)) ^ 2 + 1 / (x + ((n : ℝ) + 1)) ^ 2) ∧ (sin (Real.pi * x) / Real.pi) ^ 2 * (1 / x ^ 2 + (∑' n : ℕ, (1 / (x - ((n : ℝ) + 1)) ^ 2 + 1 / (x + ((n : ℝ) + 1)) ^ 2))) = 1 := by have hx : (x : ℂ) ∈ integerComplement := by rintro ⟨m, hm⟩ have hmx : (m : ℝ) = x := by simpa using congrArg re hm apply hsin rw [← hmx, mul_comm] exact Real.sin_int_mul_pi m have hcont : ContinuousOn (fun z : ℂ => ∑' m : ℤ, 1 / (z + (m : ℂ)) ^ 2) integerComplement := by apply shifted_reciprocal_sq_summableLocallyUniformlyOn.hasSumLocallyUniformlyOn.continuousOn apply Filter.Eventually.frequently apply Filter.Eventually.of_forall intro s apply continuousOn_finsetSum intro m _ exact continuousOn_const.div ((continuous_id.add continuous_const).continuousOn.pow 2) (fun z hz => pow_ne_zero 2 (Complex.integerComplement_add_ne_zero hz m)) have hboundary : (sin ((Real.pi : ℂ) * x) / (Real.pi : ℂ)) ^ 2 * (∑' m : ℤ, 1 / ((x : ℂ) + (m : ℂ)) ^ 2) = 1 := by let F : ℂ → ℂ := fun z => (sin ((Real.pi : ℂ) * z) / (Real.pi : ℂ)) ^ 2 * (∑' m : ℤ, 1 / (z + (m : ℂ)) ^ 2) have hF : ContinuousAt F (x : ℂ) := by apply ContinuousAt.mul · fun_prop · exact hcont.continuousAt (Complex.isOpen_compl_range_intCast.mem_nhds hx) have hz : Tendsto (fun t : ℝ => (x : ℂ) + (t : ℂ) * I) (𝓝[Ioi (0 : ℝ)] 0) (𝓝 (x : ℂ)) := by have hc : ContinuousAt (fun t : ℝ => (x : ℂ) + (t : ℂ) * I) 0 := by fun_prop simpa using hc.tendsto.mono_left nhdsWithin_le_nhds have heq : (fun t : ℝ => F ((x : ℂ) + (t : ℂ) * I)) =ᶠ[𝓝[Ioi (0 : ℝ)] 0] (fun _ => (1 : ℂ)) := by filter_upwards [self_mem_nhdsWithin] with t ht apply csc_squared_integer_series_upperHalfPlane simpa using ht exact tendsto_nhds_unique (hF.tendsto.comp hz) (Filter.Tendsto.congr' heq.symm tendsto_const_nhds) have hcomplex := shifted_reciprocal_sq_summableLocallyUniformlyOn.summable hx have hreal : Summable (fun m : ℤ => 1 / (x + (m : ℝ)) ^ 2) := by apply Complex.summable_ofReal.mp simpa only [Complex.ofReal_div, Complex.ofReal_one, Complex.ofReal_pow, Complex.ofReal_add, Complex.ofReal_intCast] using hcomplex have hidentity : (sin (Real.pi * x) / Real.pi) ^ 2 * (∑' m : ℤ, 1 / (x + (m : ℝ)) ^ 2) = 1 := by apply Complex.ofReal_injective simpa only [Complex.ofReal_mul, Complex.ofReal_pow, Complex.ofReal_div, Complex.ofReal_sin, Complex.ofReal_tsum, Complex.ofReal_one, Complex.ofReal_add, Complex.ofReal_intCast] using hboundary have hpos : Summable (fun n : ℕ => 1 / (x + (n : ℝ)) ^ 2) := by simpa [Function.comp_def] using hreal.comp_injective (Nat.cast_injective : Injective (fun n : ℕ => (n : ℤ))) have hneg : Summable (fun n : ℕ => 1 / (x - ((n : ℝ) + 1)) ^ 2) := by simpa [Function.comp_def, sub_eq_add_neg] using hreal.comp_injective (show Injective Int.negSucc from @Int.negSucc.inj) have hposTail : Summable (fun n : ℕ => 1 / (x + ((n : ℝ) + 1)) ^ 2) := by simpa using (summable_nat_add_iff 1).mpr hpos refine ⟨hneg.add hposTail, ?_⟩ have hsplit : (∑' m : ℤ, 1 / (x + (m : ℝ)) ^ 2) = 1 / x ^ 2 + ∑' n : ℕ, (1 / (x - ((n : ℝ) + 1)) ^ 2 + 1 / (x + ((n : ℝ) + 1)) ^ 2) := by rw [tsum_of_nat_of_neg_add_one (by simpa using hpos) (by simpa [sub_eq_add_neg] using hneg)] simp only [Int.cast_natCast, Int.cast_neg, Int.cast_add, Int.cast_one] rw [hpos.tsum_eq_zero_add, (hneg.tsum_add hposTail)] simp only [Nat.cast_zero, add_zero, Nat.cast_add, Nat.cast_one] simp only [sub_eq_add_neg] ring rw [← hsplit] exact hidentity
Causalean.Stat.CLT.BerryEsseen.csc_squared_reciprocal_series · Causalean/Stat/CLT/BerryEsseen/CscSquaredSeries.lean:20
Csc­Squared­Upper­Half­Plane 1 core · 0 supporting This derivative calculation specializes Mathlib's cotangent partial-fraction theorem to order one. ★ csc_squared_integer_series_upperHalfPlane

Squared-cosecant partial fractions above the real axis

This derivative calculation specializes Mathlib's cotangent partial-fraction theorem to order one. It is separate from continuity of the reciprocal series at the real boundary. Together with ShiftedReciprocalSquareRegularity, it provides the real symmetric squared-cosecant identity without a new axiom.

theorem csc_squared_integer_series_upperHalfPlane reviewed
Causalean.Stat.CLT.BerryEsseen

At a complex argument z above the real axis, the integer reciprocal-square series Σ_{m∈ℤ} 1/(z+m)² multiplied by the squared sine factor (sin(πz)/π)² equals one.

Formal statement
z :
ℂ
hz :
0 < z.im
(sin ((Real.pi : ℂ) * z) / (Real.pi : ℂ)) ^ 2 * (∑' m : ℤ, 1 / (z + (m : ℂ)) ^ 2)
= 1
Proof (Lean source)
theorem csc_squared_integer_series_upperHalfPlane (z : ℂ) (hz : 0 < z.im) : (sin ((Real.pi : ℂ) * z) / (Real.pi : ℂ)) ^ 2 * (∑' m : ℤ, 1 / (z + (m : ℂ)) ^ 2) = 1 := by /- Lowest independent algebraic leaf. Specialize iteratedDerivWithin_cot_pi_mul_eq_mul_tsum_div_pow to k=1. Compute the derivative of π*cos(πz)/sin(πz) using quotient differentiation and Complex.sin_sq_add_cos_sq. Use openness of the upper half-plane to identify the within derivative. Its sine is nonzero because z is not a real integer. This helper must not use CscSquaredSeries or any real-boundary identity. The full real result is downstream, so this restriction does not replace or narrow that API. -/ have hs : sin ((Real.pi : ℂ) * z) ≠ 0 := sin_pi_mul_ne_zero (UpperHalfPlane.coe_mem_integerComplement ⟨z, hz⟩) have hp : (Real.pi : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero have hd := (((Complex.hasDerivAt_cos ((Real.pi : ℂ) * z)).comp z ((hasDerivAt_id z).const_mul (Real.pi : ℂ))).div ((Complex.hasDerivAt_sin ((Real.pi : ℂ) * z)).comp z ((hasDerivAt_id z).const_mul (Real.pi : ℂ))) hs).const_mul (Real.pi : ℂ) have hseries := iteratedDerivWithin_cot_pi_mul_eq_mul_tsum_div_pow (k := 1) (by decide) (z := z) hz rw [iteratedDerivWithin_one, derivWithin_of_isOpen UpperHalfPlane.isOpen_upperHalfPlaneSet hz] at hseries simp only [pow_one, Nat.factorial_one, Nat.cast_one, mul_one, Nat.reduceAdd] at hseries simp only [Function.comp_apply, Pi.div_apply, mul_one] at hd simp_rw [Complex.cot_eq_cos_div_sin] at hseries rw [hd.deriv] at hseries have htrig := Complex.sin_sq_add_cos_sq ((Real.pi : ℂ) * z) field_simp [hs, hp] at hseries ⊢ linear_combination hseries + (Real.pi : ℂ) ^ 2 * htrig
Causalean.Stat.CLT.BerryEsseen.csc_squared_integer_series_upperHalfPlane · Causalean/Stat/CLT/BerryEsseen/CscSquaredUpperHalfPlane.lean:16
Esseen­Analytic­One­Sided 1 core · 0 supporting This separates the band-limited comparison with constant 24/π for an integrable real function from the measure-specific CDF and characteristic-function identities. ★ integrable_one_sided_esseen_fourier_bound

Analytic one-sided Esseen inequality

This separates the band-limited comparison with constant 24/π for an integrable real function from the measure-specific CDF and characteristic-function identities.

theorem integrable_one_sided_esseen_fourier_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable real function H whose downward increments are bounded by a nonnegative constant L times the distance and a positive bandwidth T, the value of H at every point is at most 1/π times the integral over [−T, T] of the magnitude of its Fourier transform, plus the one-sided Esseen smoothing error 24L/(πT).

Formal statement
H :
ℝ → ℝ
L :
ℝ
hL :
0 ≤ L
hdown :
∀ a b : ℝ
if
a ≤ b
then
H a ≤ H b + L * (b - a)
T :
ℝ
hT :
0 < T
x :
ℝ
H x
≤ (1 / pi) * (∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖)
+ 24 * L / (pi * T)
Proof (Lean source)
theorem integrable_one_sided_esseen_fourier_bound (H : ℝ → ℝ) (hH : Integrable H volume) (L : ℝ) (hL : 0 ≤ L) (hdown : ∀ a b : ℝ, a ≤ b → H a ≤ H b + L * (b - a)) (T : ℝ) (hT : 0 < T) (x : ℝ) : H x ≤ (1 / pi) * (∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖) + 24 * L / (pi * T) := by refine le_of_forall_pos_le_add fun ε hε => ?_ obtain ⟨K, hKi, hKc, hKhat, hsupp, hnorm, _, hpoint⟩ := exists_esseen_one_sided_spectral_comparator H hH L hL hdown T hT x ε hε have hbound := bandlimited_convolution_fourier_bound H K hH hKi hKc hKhat T hT hsupp hnorm x have hcoeff : 2 * (1 / (2 * pi)) = 1 / pi := by field_simp [Real.pi_ne_zero] calc H x ≤ 2 * |∫ y : ℝ, H (x - y) * K y| + 24 * L / (pi * T) + ε := hpoint _ ≤ 2 * ((1 / (2 * pi)) * (∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖)) + 24 * L / (pi * T) + ε := by gcongr _ = (1 / pi) * (∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖) + 24 * L / (pi * T) + ε := by rw [← mul_assoc, hcoeff]
Causalean.Stat.CLT.BerryEsseen.integrable_one_sided_esseen_fourier_bound · Causalean/Stat/CLT/BerryEsseen/EsseenAnalyticOneSided.lean:17
Esseen­Convolution­Dilation 1 core · 0 supporting This elementary integral identity transfers a normalized, translated unit-bandwidth convolution to the original function and bandwidth. ★ spectral_convolution_dilation

Spatial change of variables for spectral comparison

This elementary integral identity transfers a normalized, translated unit-bandwidth convolution to the original function and bandwidth.

theorem spectral_convolution_dilation reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive amplitude a and a positive dilation T, if the translated, amplitude-normalized product u ↦ H(x − u/T)/a · K(u) is integrable, then the dilated convolution integrand y ↦ H(x − y)·T·K(Ty) is integrable and its integral is a times the integral of the normalized product.

Formal statement
H K :
ℝ → ℝ
x a T :
ℝ
ha :
0 < a
hT :
0 < T
hprod :
Integrable (fun u : ℝ => H (x - u / T) / a * K u) volume
conclusion 1
Integrable (fun y : ℝ => H (x - y) * (T * K (T * y))) volume
conclusion 2
(∫ y : ℝ, H (x - y) * (T * K (T * y))) = a * ∫ u : ℝ, H (x - u / T) / a * K u
Proof (Lean source)
theorem spectral_convolution_dilation (H K : ℝ → ℝ) (x a T : ℝ) (ha : 0 < a) (hT : 0 < T) (hprod : Integrable (fun u : ℝ => H (x - u / T) / a * K u) volume) : Integrable (fun y : ℝ => H (x - y) * (T * K (T * y))) volume ∧ (∫ y : ℝ, H (x - y) * (T * K (T * y))) = a * ∫ u : ℝ, H (x - u / T) / a * K u := by /- Put g(u)=H(x-u/T)/a*K(u). The target integrand is (a*T)*g(T*y). Use hprod.comp_mul_left' for integrability; integral_const_mul and Measure.integral_comp_mul_left give the identity. Cancel (T*y)/T and (a*T)*|T⁻¹| using ha and hT. -/ let g : ℝ → ℝ := fun u => H (x - u / T) / a * K u have heq : (fun y : ℝ => H (x - y) * (T * K (T * y))) = fun y => (a * T) * g (T * y) := by funext y dsimp only [g] rw [mul_div_cancel_left₀ y hT.ne'] field_simp rw [heq] refine ⟨(hprod.comp_mul_left' hT.ne').const_mul (a * T), ?_⟩ rw [integral_const_mul, Measure.integral_comp_mul_left, abs_of_pos (inv_pos.mpr hT)] simp only [smul_eq_mul] rw [← mul_assoc, mul_assoc a T T⁻¹, mul_inv_cancel₀ hT.ne', mul_one]
Causalean.Stat.CLT.BerryEsseen.spectral_convolution_dilation · Causalean/Stat/CLT/BerryEsseen/EsseenConvolutionDilation.lean:16
Esseen­Convolution­Transfer 1 core · 0 supporting This is the Fourier inversion and Fubini step of one-sided Esseen smoothing. ★ bandlimited_convolution_fourier_bound

Fourier bound for a band-limited convolution

This is the Fourier inversion and Fubini step of one-sided Esseen smoothing. The kernel is supplied separately, so the one-sided comparison can be studied without repeating the frequency-domain argument.

theorem bandlimited_convolution_fourier_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable real function H and a continuous integrable kernel K whose Fourier transform is integrable, vanishes outside (−T, T) for a positive bandwidth T, and has magnitude at most one, the convolution of H with K at x is bounded in absolute value by 1/(2π) times the integral over [−T, T] of the magnitude of the Fourier transform of H.

Formal statement
H K :
ℝ → ℝ
hKcont :
hKhat :
Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume
T :
ℝ
hT :
0 < T
hsupp :
∀ t : ℝ
if
T ≤ |t|
then
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
hnorm :
∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
x :
ℝ
|∫ y : ℝ, H (x - y) * K y|
≤ (1 / (2 * pi)) * ∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖
Proof (Lean source)
theorem bandlimited_convolution_fourier_bound (H K : ℝ → ℝ) (hH : Integrable H volume) (hK : Integrable K volume) (hKcont : Continuous K) (hKhat : Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume) (T : ℝ) (hT : 0 < T) (hsupp : ∀ t : ℝ, T ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) (hnorm : ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) (x : ℝ) : |∫ y : ℝ, H (x - y) * K y| ≤ (1 / (2 * Real.pi)) * ∫ t in (-T)..T, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (H y : ℂ)‖ := by /- Invert K using hKcont and hKhat. Apply Fubini to H(x-y) times the inverse Fourier integral. The inner H-integral is a phase of H's Fourier transform, whose norm is unchanged. Restrict frequencies using hsupp and bound the remaining kernel transform by hnorm. -/ let f : ℝ → ℂ := fun y => (K y : ℂ) let F : ℝ → ℂ := fun t => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * f y have hf : Integrable f := hK.ofReal have hfc : Continuous f := by fun_prop have hzero (t : ℝ) (ht : T ≤ |t|) : F t = 0 := hsupp t ht have hFfourier (w : ℝ) : fourier f w = F ((-2 * Real.pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with y simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hFourierInt : Integrable (fourier f) := by rw [funext hFfourier] exact hKhat.comp_mul_left' (by positivity : (-2 * Real.pi : ℝ) ≠ 0) have hinv (y : ℝ) : (K y : ℂ) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * F t := by have hgy : support (fun t : ℝ => exp (((-(t * y) : ℝ) : ℂ) * I) * F t) ⊆ Ioc (-T) T := by intro t ht simp only [Function.mem_support, Set.mem_Ioc] at * constructor · by_contra hn exact ht (by rw [hzero t (by rw [abs_of_nonpos (by linarith)]; linarith)]; simp) · by_contra hn exact ht (by rw [hzero t (by rw [abs_of_nonneg (by linarith)]; linarith)]; simp) have hchange : (∫ w : ℝ, (exp (((-((-2 * Real.pi) * w * y) : ℝ) : ℂ) * I) * F ((-2 * Real.pi) * w))) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * F t := by let gy : ℝ → ℂ := fun t => exp (((-(t * y) : ℝ) : ℂ) * I) * F t change (∫ w : ℝ, gy ((-2 * Real.pi) * w)) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, gy t rw [Measure.integral_comp_mul_left] have hcoeff : |((-2 * Real.pi : ℝ)⁻¹)| = 1 / (2 * Real.pi) := by rw [abs_inv, abs_mul, abs_neg, abs_of_pos Real.pi_pos] norm_num rw [hcoeff, Complex.real_smul] calc (K y : ℂ) = FourierTransform.fourierInv (fourier f) y := (hf.fourierInv_fourier_eq hFourierInt hfc.continuousAt).symm _ = ∫ w : ℝ, exp (((-((-2 * Real.pi) * w * y) : ℝ) : ℂ) * I) * F ((-2 * Real.pi) * w) := by rw [Real.fourierInv_eq'] simp_rw [hFfourier] apply integral_congr_ae filter_upwards with w simp only [smul_eq_mul, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * F t := hchange _ = _ := by rw [← intervalIntegral.integral_eq_integral_of_support_subset hgy] let D : ℝ → ℝ := fun y => H (x - y) let Q : ℝ → ℝ → ℂ := fun t y => F t * (exp (((-(t * y) : ℝ) : ℂ) * I) * (D y : ℂ)) have hD : Integrable D volume := hH.comp_sub_left x have hDℂ : Integrable (fun y : ℝ => (D y : ℂ)) volume := hD.ofReal have hFcont : Continuous F := by have hc : Continuous (fourier f) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hf have heq : F = fun t : ℝ => fourier f (t / (-2 * Real.pi)) := by funext t rw [hFfourier] congr 1 field_simp rw [heq] fun_prop have hFbound (t : ℝ) : ‖F t‖ ≤ 1 := hnorm t have : IsFiniteMeasure (volume.restrict (Set.uIoc (-T) T)) := by rw [Set.uIoc_of_le (by linarith : -T ≤ T)] infer_instance have hmajor : Integrable (fun p : ℝ × ℝ => ‖(D p.2 : ℂ)‖) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := hDℂ.norm.comp_snd _ have hQ : Integrable (uncurry Q) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := by apply Integrable.mono' hmajor · have hc : Continuous (fun p : ℝ × ℝ => F p.1 * exp (((-(p.1 * p.2) : ℝ) : ℂ) * I)) := by fun_prop have hd : AEStronglyMeasurable (fun p : ℝ × ℝ => (D p.2 : ℂ)) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := (hDℂ.comp_snd _).aestronglyMeasurable convert hc.aestronglyMeasurable.mul hd using 1 ext p simp only [Q, uncurry, Pi.mul_apply] ring · filter_upwards with p dsimp [Q, uncurry] rw [norm_mul, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hFbound p.1) have hswap := intervalIntegral_integral_swap (a := -T) (b := T) hQ have hrepr : ((∫ y : ℝ, D y * K y : ℝ) : ℂ) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, F t * (∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (D y : ℂ)) := by calc ((∫ y : ℝ, D y * K y : ℝ) : ℂ) = ∫ y : ℝ, (D y : ℂ) * (K y : ℂ) := by calc ((∫ y : ℝ, D y * K y : ℝ) : ℂ) = ∫ y : ℝ, ((D y * K y : ℝ) : ℂ) := (integral_complex_ofReal).symm _ = _ := by congr 1 ext y push_cast rfl _ = ∫ y : ℝ, (D y : ℂ) * (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * F t) := by apply integral_congr_ae filter_upwards with y rw [hinv y] _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ y : ℝ, ∫ t in (-T)..T, Q t y := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards with y calc (D y : ℂ) * (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * F t) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ((D y : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * F t) := by ring _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, Q t y := by congr 1 rw [← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_congr intro t _ dsimp [Q] ring _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, ∫ y : ℝ, Q t y := by rw [hswap] _ = _ := by congr 1 apply intervalIntegral.integral_congr intro t _ dsimp [Q] rw [← integral_const_mul] have hshift (t : ℝ) : (∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (D y : ℂ)) = exp (((-(t * x) : ℝ) : ℂ) * I) * ∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (H u : ℂ) := by have hHℂ : Integrable (fun u : ℝ => (H u : ℂ)) volume := hH.ofReal have hG : Integrable (fun u : ℝ => exp (((t * u : ℝ) : ℂ) * I) * (H u : ℂ)) volume := by apply hHℂ.bdd_mul (c := 1) · fun_prop · filter_upwards [] with u simpa only [← Complex.ofReal_mul] using (le_of_eq (Complex.norm_exp_ofReal_mul_I (t * u))) have hphase (u : ℝ) : exp (((-(t * (x - u)) : ℝ) : ℂ) * I) = exp (((-(t * x) : ℝ) : ℂ) * I) * exp (((t * u : ℝ) : ℂ) * I) := by rw [← Complex.exp_add] congr 1 push_cast ring have hGshift : Integrable (fun u : ℝ => exp (((-(t * (x - u)) : ℝ) : ℂ) * I) * (H u : ℂ)) volume := by convert hG.const_mul (exp (((-(t * x) : ℝ) : ℂ) * I)) using 1 ext u rw [hphase u] ring have hmp := Measure.measurePreserving_sub_left (volume : Measure ℝ) x have hGmap : AEStronglyMeasurable (fun u : ℝ => exp (((-(t * (x - u)) : ℝ) : ℂ) * I) * (H u : ℂ)) (Measure.map (fun y : ℝ => x - y) volume) := by rw [hmp.map_eq] exact hGshift.aestronglyMeasurable have hswapH := (integral_map hmp.measurable.aemeasurable hGmap).symm rw [hmp.map_eq] at hswapH calc _ = ∫ u : ℝ, exp (((-(t * (x - u)) : ℝ) : ℂ) * I) * (H u : ℂ) := by convert hswapH using 1 congr 1 ext y simp [D] _ = _ := by simp_rw [hphase, mul_assoc] rw [integral_const_mul] let h : ℝ → ℂ := fun u => (H u : ℂ) have hh : Integrable h := hH.ofReal have hHfourier (w : ℝ) : fourier h w = ∫ u : ℝ, exp ((((-2 * Real.pi * w) * u : ℝ) : ℂ) * I) * h u := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with u simp only [smul_eq_mul, h, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hHhatcont : Continuous (fun t : ℝ => ∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (H u : ℂ)) := by have hc : Continuous (fourier h) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hh have heq : (fun t : ℝ => -- … truncated; follow the source link for the rest …
Causalean.Stat.CLT.BerryEsseen.bandlimited_convolution_fourier_bound · Causalean/Stat/CLT/BerryEsseen/EsseenConvolutionTransfer.lean:18
Esseen­Inversion 1 core · 0 supporting This module isolates the analytic CDF smoothing inequality from Gaussian moments and iid sampling. ★ cdf_esseen_inversion_lipschitz

Scalar Esseen inversion inequality

This module isolates the analytic CDF smoothing inequality from Gaussian moments and iid sampling. The reference law has a globally Lipschitz CDF.

theorem cdf_esseen_inversion_lipschitz reviewed
Causalean.Stat.CLT.BerryEsseen

When two scalar probability laws μ and ν have finite first moments, the reference law ν assigns every interval at most L times its length, for a nonnegative constant L, and the bandwidth T is positive, their CDF discrepancy at every point is at most 1/π times the integral over [−T, T] of the characteristic-function discrepancy divided by |t|, plus the Esseen smoothing error 24L/(πT).

Formal statement
hμfirst :
Integrable (fun y : ℝ => y) μ
hνfirst :
Integrable (fun y : ℝ => y) ν
L :
ℝ
hL :
0 ≤ L
hν :
∀ a b : ℝ
if
a ≤ b
then
(ν (Ioc a b)).toReal ≤ L * (b - a)
T :
ℝ
hT :
0 < T
x :
ℝ
|(μ (Iic x)).toReal - (ν (Iic x)).toReal|
≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|)
+ 24 * L / (pi * T)
Proof (Lean source)
theorem cdf_esseen_inversion_lipschitz (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμfirst : Integrable (fun y : ℝ => y) μ) (hνfirst : Integrable (fun y : ℝ => y) ν) (L : ℝ) (hL : 0 ≤ L) (hν : ∀ a b : ℝ, a ≤ b → (ν (Ioc a b)).toReal ≤ L * (b - a)) (T : ℝ) (hT : 0 < T) (x : ℝ) : |(μ (Iic x)).toReal - (ν (Iic x)).toReal| ≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|) + 24 * L / (pi * T) := by haveI : IsProbabilityMeasure (μ.map (fun y : ℝ => -y)) := Measure.isProbabilityMeasure_map (by fun_prop) haveI : IsProbabilityMeasure (ν.map (fun y : ℝ => -y)) := Measure.isProbabilityMeasure_map (by fun_prop) have hpos := cdf_esseen_inversion_one_sided μ ν hμfirst hνfirst L hL hν T hT x obtain ⟨hνref, hlower⟩ := reflected_reference_interval_and_cdf μ ν L hν have hneg := cdf_esseen_inversion_one_sided (μ.map (fun y : ℝ => -y)) (ν.map (fun y : ℝ => -y)) (reflected_first_moment_integrable μ hμfirst) (reflected_first_moment_integrable ν hνfirst) L hL hνref T hT (-x) simp_rw [reflected_charFun_discrepancy] at hneg rw [abs_le] constructor · have h := (hlower x).trans hneg linarith · exact hpos
Causalean.Stat.CLT.BerryEsseen.cdf_esseen_inversion_lipschitz · Causalean/Stat/CLT/BerryEsseen/EsseenInversion.lean:18
Esseen­Kernel­Dilation 1 core · 1 supporting The change of variables taking a unit-bandwidth kernel to bandwidth T is isolated here. ★ spectral_kernel_dilation_properties

Dilation of one-sided spectral kernels

The change of variables taking a unit-bandwidth kernel to bandwidth T is isolated here. These lemmas concern arbitrary kernels and do not assume a CDF bound or a normal approximation.

theorem spectral_kernel_dilation_properties reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable continuous kernel K whose Fourier transform vanishes outside (−1, 1) and has magnitude at most one, and a positive dilation T, the dilated kernel y ↦ T·K(Ty) is integrable and continuous, has an integrable Fourier transform that vanishes outside (−T, T), and keeps Fourier magnitude at most one.

Formal statement
K :
ℝ → ℝ
hKcont :
hsupp :
∀ t : ℝ
if
1 ≤ |t|
then
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
hnorm :
∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
T :
ℝ
hT :
0 < T
conclusion 1
Integrable (fun y : ℝ => T * K (T * y)) volume
conclusion 2
Continuous (fun y : ℝ => T * K (T * y))
conclusion 3
Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) volume
conclusion 4
t :
ℝ
T ≤ |t|
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) = 0
conclusion 5
t :
ℝ
‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)‖ ≤ 1
Proof (Lean source)
theorem spectral_kernel_dilation_properties (K : ℝ → ℝ) (hK : Integrable K volume) (hKcont : Continuous K) (hsupp : ∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) (hnorm : ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) (T : ℝ) (hT : 0 < T) : Integrable (fun y : ℝ => T * K (T * y)) volume ∧ Continuous (fun y : ℝ => T * K (T * y)) ∧ Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) volume ∧ (∀ t : ℝ, T ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) = 0) ∧ (∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)‖ ≤ 1) := by /- Use spectral_kernel_dilation_fourier for all Fourier clauses. integrable_unit_supported_kernel_fourier supplies the original transform's integrability; Integrable.comp_div gives its frequency dilation. Physical integrability uses hK.comp_mul_left' and const_mul. Support follows from |t/T| = |t|/T and the positive-bandwidth inequality. -/ refine ⟨(hK.comp_mul_left' hT.ne').const_mul T, ?_, ?_, ?_, ?_⟩ · fun_prop · simp_rw [spectral_kernel_dilation_fourier K T hT] exact (integrable_unit_supported_kernel_fourier K hK hsupp hnorm).comp_div hT.ne' · intro t ht rw [spectral_kernel_dilation_fourier K T hT] apply hsupp rw [abs_div, abs_of_pos hT] exact (le_div_iff₀ hT).2 (by simpa using ht) · intro t rw [spectral_kernel_dilation_fourier K T hT] exact hnorm (t / T)
Causalean.Stat.CLT.BerryEsseen.spectral_kernel_dilation_properties · Causalean/Stat/CLT/BerryEsseen/EsseenKernelDilation.lean:47
1 supporting declaration (lemmas, instances)
  • spectral_kernel_dilation_fourier theorem — Dilating a real kernel by a positive bandwidth and multiplying by that bandwidth divides the frequency in its Fourier integral by the bandwidth.
    K :
    ℝ → ℝ
    T :
    ℝ
    hT :
    0 < T
    t :
    ℝ
    (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ))
    = ∫ u : ℝ, exp ((((t / T) * u : ℝ) : ℂ) * I) * (K u : ℂ)
    Proof (Lean source)
    theorem spectral_kernel_dilation_fourier (K : ℝ → ℝ) (T : ℝ) (hT : 0 < T) (t : ℝ) : (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) = ∫ u : ℝ, exp ((((t / T) * u : ℝ) : ℂ) * I) * (K u : ℂ) := by /- Rewrite the integrand as T times f(T*y), where f(u) = exp(i*(t/T)*u)*K(u). Apply Measure.integral_comp_mul_left and integral_const_mul; positivity cancels T*|T⁻¹|. This substitution identity is valid even for a nonintegrable K because both Bochner integrals then obey the same change-of-variables theorem. -/ let f : ℝ → ℂ := fun u => exp ((((t / T) * u : ℝ) : ℂ) * I) * (K u : ℂ) have hscale (y : ℝ) : (t / T) * (T * y) = t * y := by field_simp have heq : (fun y : ℝ => exp (((t * y : ℝ) : ℂ) * I) * ((T * K (T * y) : ℝ) : ℂ)) = fun y => (T : ℂ) * f (T * y) := by funext y dsimp only [f] rw [hscale] simp only [Complex.ofReal_mul] ring rw [heq, integral_const_mul, Measure.integral_comp_mul_left] rw [abs_of_pos (inv_pos.mpr hT)] simp only [Complex.real_smul, ← mul_assoc, ← Complex.ofReal_mul, mul_inv_cancel₀ hT.ne', Complex.ofReal_one, one_mul] rfl
    Causalean.Stat.CLT.BerryEsseen.spectral_kernel_dilation_fourier · Causalean/Stat/CLT/BerryEsseen/EsseenKernelDilation.lean:17
Esseen­One­Sided 1 core · 0 supporting This isolates the upper CDF comparison in the Esseen inversion step with constant 24/π. ★ cdf_esseen_inversion_one_sided

One-sided scalar Esseen comparison

This isolates the upper CDF comparison in the Esseen inversion step with constant 24/π. The lower comparison can be obtained by reflecting both laws; the reference interval-mass condition is preserved by reflection.

theorem cdf_esseen_inversion_one_sided reviewed
Causalean.Stat.CLT.BerryEsseen

When two scalar probability laws μ and ν have finite first moments, the reference law ν assigns every interval at most L times its length, for a nonnegative constant L, and the bandwidth T is positive, the CDF of μ exceeds the CDF of ν at every point by at most 1/π times the integral over [−T, T] of the characteristic-function discrepancy divided by |t|, plus the Esseen smoothing error 24L/(πT).

Formal statement
hμfirst :
Integrable (fun y : ℝ => y) μ
hνfirst :
Integrable (fun y : ℝ => y) ν
L :
ℝ
hL :
0 ≤ L
hν :
∀ a b : ℝ
if
a ≤ b
then
(ν (Ioc a b)).toReal ≤ L * (b - a)
T :
ℝ
hT :
0 < T
x :
ℝ
(μ (Iic x)).toReal - (ν (Iic x)).toReal
≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|)
+ 24 * L / (pi * T)
Proof (Lean source)
theorem cdf_esseen_inversion_one_sided (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμfirst : Integrable (fun y : ℝ => y) μ) (hνfirst : Integrable (fun y : ℝ => y) ν) (L : ℝ) (hL : 0 ≤ L) (hν : ∀ a b : ℝ, a ≤ b → (ν (Ioc a b)).toReal ≤ L * (b - a)) (T : ℝ) (hT : 0 < T) (x : ℝ) : (μ (Iic x)).toReal - (ν (Iic x)).toReal ≤ (1 / pi) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|) + 24 * L / (pi * T) := by have hH := integrable_cdf_difference_of_first_moments μ ν hμfirst hνfirst have hdown := cdf_difference_one_sided_modulus μ ν L hν have hbound := integrable_one_sided_esseen_fourier_bound (fun y : ℝ => (μ (Iic y)).toReal - (ν (Iic y)).toReal) hH L hL hdown T hT x rw [cdf_difference_fourier_magnitude_integral μ ν hμfirst hνfirst T] at hbound exact hbound
Causalean.Stat.CLT.BerryEsseen.cdf_esseen_inversion_one_sided · Causalean/Stat/CLT/BerryEsseen/EsseenOneSided.lean:20
Esseen­Signed­Kernel­Comparison 1 core · 0 supporting The one-sided increment condition is integrated against a positive linearly weighted sinc-fourth density. ★ esseenSignedSinc4Kernel_comparison

Spatial comparison for the signed sinc-fourth kernel

The one-sided increment condition is integrated against a positive linearly weighted sinc-fourth density. The first two exact moments fix the numerical comparison error at seven.

theorem esseenSignedSinc4Kernel_comparison reviewed
Causalean.Stat.CLT.BerryEsseen

If H has downward increments at most the distance between its arguments and the product of the reflected function H(−y) with the signed sinc-fourth comparison kernel is integrable, then the value of H at zero is at most twice the absolute value of that convolution integral plus seven.

Formal statement
H :
ℝ → ℝ
hdown :
∀ a b : ℝ
if
a ≤ b
then
H a ≤ H b + (b - a)
hprod :
Integrable (fun y : ℝ => H (-y) * esseenSignedSinc4Kernel y) volume
H 0 ≤ 2 * |∫ y : ℝ, H (-y) * esseenSignedSinc4Kernel y| + 7
Proof (Lean source)
theorem esseenSignedSinc4Kernel_comparison (H : ℝ → ℝ) (hdown : ∀ a b : ℝ, a ≤ b → H a ≤ H b + (b - a)) (hprod : Integrable (fun y : ℝ => H (-y) * esseenSignedSinc4Kernel y) volume) : H 0 ≤ 2 * |∫ y : ℝ, H (-y) * esseenSignedSinc4Kernel y| + 7 := by /- The increment condition gives `H 0 * x ≤ H x * x + x²` for every real x. Multiply by `sinc4Kernel 1 (x-4) / 8 ≥ 0` and integrate. Translation of the zeroth, first, and second moments gives respectively 1, 4, and 28. Reflection turns the resulting integral into the stated convolution; `a ≤ |a|` finishes. -/ let q : ℝ → ℝ := sinc4Kernel 1 have hq : Integrable q volume := sinc4Kernel_integrable 1 (by norm_num) have hq0 : (∫ x : ℝ, q x) = 1 := sinc4Kernel_integral_eq_one 1 (by norm_num) have hq1 := sinc4Kernel_unit_first_moment have hq2 := sinc4Kernel_unit_second_moment have hlinear : Integrable (fun x : ℝ => (x + 4) * q x) volume := by apply (hq1.1.add (hq.const_mul 4)).congr filter_upwards with x dsimp [q] ring have hlinear_val : (∫ x : ℝ, (x + 4) * q x) = 4 := by have hp (x : ℝ) : (x + 4) * q x = x * q x + 4 * q x := by ring simp_rw [hp] rw [integral_add hq1.1 (hq.const_mul 4), integral_const_mul, hq1.2, hq0] ring have hquad : Integrable (fun x : ℝ => (x + 4) ^ 2 * q x) volume := by apply ((hq2.1.add (hq1.1.const_mul 8)).add (hq.const_mul 16)).congr filter_upwards with x dsimp [q] ring have hquad_val : (∫ x : ℝ, (x + 4) ^ 2 * q x) = 28 := by have hp (x : ℝ) : (x + 4) ^ 2 * q x = x ^ 2 * q x + 8 * (x * q x) + 16 * q x := by ring simp_rw [hp] change (∫ x : ℝ, (x ^ 2 * q x + 8 * (x * q x)) + 16 * q x) = 28 have ha := integral_add (hq2.1.add (hq1.1.const_mul 8)) (hq.const_mul 16) have hb := integral_add hq2.1 (hq1.1.const_mul 8) simp only [Pi.add_apply] at ha hb rw [ha, hb, integral_const_mul, integral_const_mul, hq2.2, hq1.2, hq0] norm_num have hshift1 : Integrable (fun x : ℝ => x * q (x - 4)) volume := by convert hlinear.comp_add_left (-4) using 1 ext x; congr 1 <;> ring have hshift2 : Integrable (fun x : ℝ => x ^ 2 * q (x - 4)) volume := by convert hquad.comp_add_left (-4) using 1 ext x; congr 1 <;> ring have hshift1_val : (∫ x : ℝ, x * q (x - 4)) = 4 := by have ht := integral_add_right_eq_self (μ := volume) (fun x : ℝ => (x + 4) * q x) (-4) convert ht.trans hlinear_val using 1 congr 1; ext x; congr 1 <;> ring have hshift2_val : (∫ x : ℝ, x ^ 2 * q (x - 4)) = 28 := by have ht := integral_add_right_eq_self (μ := volume) (fun x : ℝ => (x + 4) ^ 2 * q x) (-4) convert ht.trans hquad_val using 1 congr 1; ext x; congr 1 <;> ring have hweighted : Integrable (fun x : ℝ => H x * x * q (x - 4)) volume := by have ht := hprod.comp_neg.const_mul 8 convert ht using 1 ext x simp only [esseenSignedSinc4Kernel, neg_neg] ring have hreflect : (∫ x : ℝ, H x * x * q (x - 4)) = 8 * ∫ y : ℝ, H (-y) * esseenSignedSinc4Kernel y := by have ht := integral_neg_eq_self (fun x : ℝ => H x * x * q (x - 4)) volume calc _ = ∫ y : ℝ, H (-y) * (-y) * q (-y - 4) := by convert ht.symm using 1 _ = _ := by rw [← integral_const_mul] congr 1 ext y simp only [esseenSignedSinc4Kernel] ring have hpoint (x : ℝ) : H 0 * x ≤ H x * x + x ^ 2 := by rcases le_total 0 x with hx | hx · have hh := hdown 0 x hx nlinarith [mul_nonneg (sub_nonneg.mpr hx) (sub_nonneg.mpr (show H x + x ≥ H 0 by simpa using hh))] · have hh := hdown x 0 hx nlinarith [mul_nonneg (neg_nonneg.mpr hx) (show 0 ≤ H 0 - H x - x by linarith)] have hleft : Integrable (fun x : ℝ => H 0 * (x * q (x - 4))) volume := hshift1.const_mul (H 0) have hright : Integrable (fun x : ℝ => H x * x * q (x - 4) + x ^ 2 * q (x - 4)) volume := hweighted.add hshift2 have hint : (∫ x : ℝ, H 0 * (x * q (x - 4))) ≤ ∫ x : ℝ, H x * x * q (x - 4) + x ^ 2 * q (x - 4) := by apply integral_mono hleft hright intro x have hnonneg : 0 ≤ q (x - 4) := sinc4Kernel_nonneg 1 (by norm_num) _ nlinarith [mul_nonneg (sub_nonneg.mpr (hpoint x)) hnonneg] rw [integral_const_mul, hshift1_val, integral_add hweighted hshift2, hshift2_val, hreflect] at hint have habs : (∫ y : ℝ, H (-y) * esseenSignedSinc4Kernel y) ≤ |∫ y : ℝ, H (-y) * esseenSignedSinc4Kernel y| := le_abs_self _ nlinarith
Causalean.Stat.CLT.BerryEsseen.esseenSignedSinc4Kernel_comparison · Causalean/Stat/CLT/BerryEsseen/EsseenSignedKernelComparison.lean:18 · uses esseenSignedSinc4Kernel
Esseen­Signed­Kernel­Fourier 1 core · 0 supporting The frequency support of this weighted kernel comes from differentiation of the compactly supported transform of the unweighted sinc-fourth density. ★ esseenSignedSinc4Kernel_fourier_eq_zero

Fourier properties of the signed sinc-fourth kernel

The frequency support of this weighted kernel comes from differentiation of the compactly supported transform of the unweighted sinc-fourth density.

theorem esseenSignedSinc4Kernel_fourier_eq_zero reviewed
Causalean.Stat.CLT.BerryEsseen

The Fourier integral of the signed sinc-fourth comparison kernel vanishes at every frequency t with |t| at least one.

Formal statement
t :
ℝ
ht :
1 ≤ |t|
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ))
= 0
Proof (Lean source)
theorem esseenSignedSinc4Kernel_fourier_eq_zero (t : ℝ) (ht : 1 ≤ |t|) : (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ)) = 0 := by /- First prove the weighted unshifted transform vanishes at |t|>1: `Real.deriv_fourier` identifies it with the derivative of `sinc4Kernel_fourier_eq_zero` on an exterior neighborhood. Shift by four and reflect. At |t|=1 use continuity of the weighted transform, supplied by integrability from `esseenSignedSinc4Kernel_integrable_continuous`. -/ let f : ℝ → ℂ := fun x => (sinc4Kernel 1 x : ℂ) let g : ℝ → ℂ := fun x => ((x + 4) * sinc4Kernel 1 x : ℂ) have hf : Integrable f := (sinc4Kernel_integrable 1 (by norm_num)).ofReal have hxf : Integrable (fun x : ℝ => x • f x) := by convert sinc4Kernel_unit_first_moment.1.ofReal using 1 ext x simp [f, Complex.real_smul] have hF (w : ℝ) (hw : 1 < |(-2 * Real.pi) * w|) : fourier f w = 0 := by rw [Real.fourier_eq'] convert sinc4Kernel_fourier_eq_zero 1 ((-2 * Real.pi) * w) (by norm_num) (le_of_lt hw) using 1 apply integral_congr_ae filter_upwards with x simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hderiv (w : ℝ) (hw : 1 < |(-2 * Real.pi) * w|) : deriv (fourier f) w = 0 := by have hopen : IsOpen {v : ℝ | 1 < |(-2 * Real.pi) * v|} := by exact isOpen_lt continuous_const ((continuous_const.mul continuous_id).abs) have heq : fourier f =ᶠ[nhds w] (fun _ => (0 : ℂ)) := by filter_upwards [hopen.mem_nhds hw] with v hv exact hF v hv rw [heq.deriv_eq] simp have hxF (w : ℝ) (hw : 1 < |(-2 * Real.pi) * w|) : fourier (fun x : ℝ => x • f x) w = 0 := by have hd := congrFun (Real.deriv_fourier hf hxf) w rw [hderiv w hw] at hd have heq : (fun x : ℝ => (-2 * Real.pi * I * x) • f x) = (-2 * Real.pi * I) • (fun x : ℝ => x • f x) := by ext x simp [Pi.smul_apply, mul_assoc] rw [heq] at hd have hscalar : fourier ((-2 * Real.pi * I) • (fun x : ℝ => x • f x)) w = (-2 * Real.pi * I) • fourier (fun x : ℝ => x • f x) w := by simp only [Real.fourier_real_eq_integral_exp_smul, Pi.smul_apply, smul_eq_mul] rw [← integral_const_mul] congr 1 ext x ring rw [hscalar] at hd have hc : (-2 * Real.pi * I) ≠ 0 := by exact mul_ne_zero (mul_ne_zero (by norm_num) (by exact_mod_cast Real.pi_ne_zero)) Complex.I_ne_zero exact (smul_eq_zero.mp hd.symm).resolve_left hc have hgF (w : ℝ) (hw : 1 < |(-2 * Real.pi) * w|) : fourier g w = 0 := by have heq : g = (fun x : ℝ => x • f x) + (4 : ℂ) • f := by funext x simp [g, f, Pi.add_apply, Pi.smul_apply, Complex.real_smul] ring have hsum : fourier ((fun x : ℝ => x • f x) + (4 : ℂ) • f) w = fourier (fun x : ℝ => x • f x) w + (4 : ℂ) * fourier f w := by simp only [Real.fourier_real_eq_integral_exp_smul, Pi.add_apply, Pi.smul_apply, smul_eq_mul] rw [← integral_const_mul] have hi : Integrable (fun x : ℝ => exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I) * (x • f x)) := by have he : Continuous (fun x : ℝ => exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I)) := by fun_prop have hb : ∀ᶠ x : ℝ in ae volume, ‖Complex.exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I)‖ ≤ 1 := Filter.Eventually.of_forall (fun x => by rw [Complex.norm_exp_ofReal_mul_I]) convert hxf.mul_bdd he.aestronglyMeasurable hb using 1 ext x exact mul_comm _ _ have hj : Integrable (fun x : ℝ => exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I) * f x) := by have he : Continuous (fun x : ℝ => exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I)) := by fun_prop have hb : ∀ᶠ x : ℝ in ae volume, ‖Complex.exp (((-2 * Real.pi * x * w : ℝ) : ℂ) * I)‖ ≤ 1 := Filter.Eventually.of_forall (fun x => by rw [Complex.norm_exp_ofReal_mul_I]) convert hf.mul_bdd he.aestronglyMeasurable hb using 1 ext x exact mul_comm _ _ rw [← integral_add hi (hj.const_mul 4)] congr 1 ext x ring rw [heq, hsum, hxF w hw, hF w hw] simp let H : ℝ → ℂ := fun s => ∫ y : ℝ, exp (((s * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ) have hstrict (s : ℝ) (hs : 1 < |s|) : H s = 0 := by let w : ℝ := s / (2 * Real.pi) have hpi : (2 * Real.pi : ℝ) ≠ 0 := by positivity have hw : 1 < |(-2 * Real.pi) * w| := by have heq : (-2 * Real.pi) * w = -s := by dsimp [w] field_simp rw [heq, abs_neg] exact hs have hzero := hgF w hw have hp : (∫ x : ℝ, exp (((-(s * x) : ℝ) : ℂ) * I) * g x) = 0 := by rw [Real.fourier_real_eq_integral_exp_smul] at hzero convert hzero using 1 apply integral_congr_ae filter_upwards with x simp only [smul_eq_mul] congr 2 have hr : -2 * Real.pi * x * w = -(s * x) := by dsimp [w] field_simp exact congrArg (fun r : ℝ => (r : ℂ) * I) hr.symm let q : ℝ → ℂ := fun x => exp (((s * (-x - 4) : ℝ) : ℂ) * I) * ((1 / 8 : ℂ) * g x) have hq : (∫ x : ℝ, q x) = 0 := by have hc (x : ℝ) : q x = ((1 / 8 : ℂ) * exp (((-(4 * s) : ℝ) : ℂ) * I)) * (exp (((-(s * x) : ℝ) : ℂ) * I) * g x) := by dsimp [q] have he : (((s * (-x - 4) : ℝ) : ℂ) * I) = (((-(4 * s) : ℝ) : ℂ) * I) + (((-(s * x) : ℝ) : ℂ) * I) := by push_cast ring rw [he, Complex.exp_add] ring simp_rw [hc, integral_const_mul, hp, mul_zero] have hchange : H s = ∫ x : ℝ, q x := by letI : (volume : Measure ℝ).IsAddRightInvariant := MeasureTheory.IsAddLeftInvariant.isAddRightInvariant have heq (y : ℝ) : exp (((s * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ) = q (-y - 4) := by dsimp [q, g, esseenSignedSinc4Kernel] have hy : -(-y - 4) - 4 = y := by ring rw [hy] push_cast ring calc H s = ∫ y : ℝ, q (-y - 4) := by apply integral_congr_ae filter_upwards with y exact heq y _ = ∫ y : ℝ, q (-y) := by have hshift := integral_add_right_eq_self (μ := (volume : Measure ℝ)) (fun y : ℝ => q (-y)) 4 convert hshift using 1 congr 1 ext y congr 1 ring _ = ∫ y : ℝ, q y := integral_neg_eq_self q volume exact hchange.trans hq have hHcont : Continuous H := by have hfK : Integrable (fun y : ℝ => (esseenSignedSinc4Kernel y : ℂ)) := esseenSignedSinc4Kernel_integrable_continuous.1.ofReal have hfourier (w : ℝ) : fourier (fun y : ℝ => (esseenSignedSinc4Kernel y : ℂ)) w = H ((-2 * Real.pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with y simp only [smul_eq_mul, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hc : Continuous (fourier (fun y : ℝ => (esseenSignedSinc4Kernel y : ℂ))) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hfK have heq : H = fun s : ℝ => fourier (fun y : ℝ => (esseenSignedSinc4Kernel y : ℂ)) (s / (-2 * Real.pi)) := by funext s rw [hfourier] congr 1 field_simp rw [heq] fun_prop have hright : EqOn H (fun _ => (0 : ℂ)) (Ici 1) := by have h : EqOn H (fun _ => (0 : ℂ)) (Ioi 1) := by intro s hs exact hstrict s (by rw [abs_of_pos (by change 1 < s at hs; linarith)]; exact hs) simpa only [closure_Ioi] using h.closure hHcont continuous_const have hleft : EqOn H (fun _ => (0 : ℂ)) (Iic (-1)) := by have h : EqOn H (fun _ => (0 : ℂ)) (Iio (-1)) := by intro s hs exact hstrict s (by change s < -1 at hs; rw [abs_of_neg (by linarith)]; linarith) simpa only [closure_Iio] using h.closure hHcont continuous_const change H t = 0 rcases le_total 0 t with hnonneg | hnonpos · exact hright (by simpa [abs_of_nonneg hnonneg] using ht) · exact hleft (by change t ≤ -1; rw [abs_of_nonpos hnonpos] at ht; linarith)
Causalean.Stat.CLT.BerryEsseen.esseenSignedSinc4Kernel_fourier_eq_zero · Causalean/Stat/CLT/BerryEsseen/EsseenSignedKernelFourier.lean:19 · uses esseenSignedSinc4Kernel
Esseen­Signed­Kernel­Fourier­Norm 1 core · 0 supporting The signed comparison kernel k(y) = −(y/8)·q(−y − 4), where q is the unit sinc-fourth probability density, has Fourier transform bounded by one in absolute value at every real frequency. ★ esseenSignedSinc4Kernel_fourier_norm_le_one

Fourier norm bound for the signed sinc-fourth kernel

The signed comparison kernel k(y) = −(y/8)·q(−y − 4), where q is the unit sinc-fourth probability density, has Fourier transform bounded by one in absolute value at every real frequency. The proof bounds the transform by the L¹ norm of k, uses |y|/8 ≤ (y² + 16)/64, and evaluates the resulting integral from the moments of q (mass one, first moment zero, second moment twelve), which gives an L¹ norm of at most 44/64. The bound is used in the one-sided Esseen comparison of distribution functions.

Main results

  • esseenSignedSinc4Kernel_fourier_norm_le_one — |∫ exp(i t y) k(y) dy| ≤ 1 for all real t.
theorem esseenSignedSinc4Kernel_fourier_norm_le_one reviewed
Causalean.Stat.CLT.BerryEsseen

The Fourier integral of the signed sinc-fourth comparison kernel has magnitude at most one at every real frequency.

Formal statement
t :
ℝ
‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ)‖
≤ 1
Proof (Lean source)
theorem esseenSignedSinc4Kernel_fourier_norm_le_one (t : ℝ) : ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ)‖ ≤ 1 := by /- Bound by the L¹ norm. With x = -y, use |x|/8 ≤ (x² + 16)/64 and the shifted moments: the kernel has mass 1, first moment 4, and second moment 28, giving L¹ norm ≤ 44/64 < 1. -/ let q : ℝ → ℝ := sinc4Kernel 1 have hq : Integrable q volume := sinc4Kernel_integrable 1 (by norm_num) have hq0 : (∫ x : ℝ, q x) = 1 := sinc4Kernel_integral_eq_one 1 (by norm_num) have hq1 := sinc4Kernel_unit_first_moment have hq2 := sinc4Kernel_unit_second_moment have hpoly : Integrable (fun x : ℝ => (x + 4) ^ 2 * q x) volume := by have hi := (hq2.1.add (hq1.1.const_mul 8)).add (hq.const_mul 16) apply hi.congr filter_upwards with x dsimp [q] ring have hpoly_val : (∫ x : ℝ, (x + 4) ^ 2 * q x) = 28 := by have hp (x : ℝ) : (x + 4) ^ 2 * q x = x ^ 2 * q x + 8 * (x * q x) + 16 * q x := by ring simp_rw [hp] have ha := integral_add (hq2.1.add (hq1.1.const_mul 8)) (hq.const_mul 16) have hb := integral_add hq2.1 (hq1.1.const_mul 8) simp only [Pi.add_apply] at ha hb rw [ha, hb, integral_const_mul, integral_const_mul] rw [hq2.2, hq1.2, hq0] norm_num have hshift : (∫ y : ℝ, y ^ 2 * q (-y - 4)) = 28 := by have hn := integral_neg_eq_self (fun x : ℝ => x ^ 2 * q (x - 4)) volume have ha := integral_add_right_eq_self (μ := volume) (fun x : ℝ => (x + 4) ^ 2 * q x) (-4) have hn' : (∫ y : ℝ, y ^ 2 * q (-y - 4)) = ∫ x : ℝ, x ^ 2 * q (x - 4) := by simpa only [even_two, Even.neg_pow] using hn have ha' : (∫ x : ℝ, x ^ 2 * q (x - 4)) = ∫ x : ℝ, (x + 4) ^ 2 * q x := by simpa [sub_eq_add_neg, add_assoc] using ha rw [hn', ha', hpoly_val] have hshift_int : Integrable (fun y : ℝ => y ^ 2 * q (-y - 4)) volume := by have ha := hpoly.comp_add_left (-4) have hn := ha.comp_neg convert hn using 1 ext y ring_nf have hqshift : Integrable (fun y : ℝ => q (-y - 4)) volume := by convert (hq.comp_add_left (-4)).comp_neg using 1 ext y ring_nf have hqshift_val : (∫ y : ℝ, q (-y - 4)) = 1 := by rw [show (∫ y : ℝ, q (-y - 4)) = (∫ x : ℝ, q (x - 4)) from by simpa only [neg_sub] using (integral_neg_eq_self (fun x : ℝ => q (x - 4)) volume), show (∫ x : ℝ, q (x - 4)) = (∫ x : ℝ, q x) from by simpa [sub_eq_add_neg] using (integral_add_right_eq_self q (-4)), hq0] have hbound (y : ℝ) : |esseenSignedSinc4Kernel y| ≤ (y ^ 2 + 16) / 64 * q (-y - 4) := by have hqnonneg : 0 ≤ q (-y - 4) := sinc4Kernel_nonneg 1 (by norm_num) _ have hsq : 8 * |y| ≤ y ^ 2 + 16 := by nlinarith [sq_nonneg (|y| - 4), sq_abs y] unfold esseenSignedSinc4Kernel rw [abs_mul, abs_div, abs_neg, abs_of_nonneg hqnonneg] norm_num at * nlinarith have hmajor : Integrable (fun y : ℝ => (y ^ 2 + 16) / 64 * q (-y - 4)) volume := by have hi := (hshift_int.add (hqshift.const_mul 16)).const_mul (1 / 64 : ℝ) convert hi using 1 ext y dsimp ring have hK : Integrable esseenSignedSinc4Kernel volume := esseenSignedSinc4Kernel_integrable_continuous.1 have hKbound : (∫ y : ℝ, |esseenSignedSinc4Kernel y|) ≤ 1 := by calc _ ≤ ∫ y : ℝ, (y ^ 2 + 16) / 64 * q (-y - 4) := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun y => abs_nonneg _)) hmajor (Filter.Eventually.of_forall hbound) _ = (28 + 16) / 64 := by have hp (y : ℝ) : (y ^ 2 + 16) / 64 * q (-y - 4) = (1 / 64 : ℝ) * (y ^ 2 * q (-y - 4) + 16 * q (-y - 4)) := by ring simp_rw [hp] rw [integral_const_mul, integral_add hshift_int (hqshift.const_mul 16), integral_const_mul, hshift, hqshift_val] ring _ ≤ 1 := by norm_num calc _ ≤ ∫ y : ℝ, ‖Complex.exp (((t * y : ℝ) : ℂ) * I) * (esseenSignedSinc4Kernel y : ℂ)‖ := norm_integral_le_integral_norm _ _ = ∫ y : ℝ, |esseenSignedSinc4Kernel y| := by congr 1 ext y rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, Complex.norm_real, Real.norm_eq_abs] _ ≤ 1 := hKbound
Causalean.Stat.CLT.BerryEsseen.esseenSignedSinc4Kernel_fourier_norm_le_one · Causalean/Stat/CLT/BerryEsseen/EsseenSignedKernelFourierNorm.lean:25 · uses esseenSignedSinc4Kernel
Esseen­Sinc4­First­Moment 1 core · 0 supporting The unit-bandwidth sinc-fourth kernel is even. ★ sinc4Kernel_unit_first_moment

First moment of the unit-bandwidth sinc-fourth density

The unit-bandwidth sinc-fourth kernel is even. Its absolute first moment is finite, and its signed first moment vanishes. These facts are used to shift the kernel in the one-sided Esseen comparison.

theorem sinc4Kernel_unit_first_moment reviewed
Causalean.Stat.CLT.BerryEsseen

The first-moment density x·K(x) of the unit-bandwidth sinc-fourth kernel K is integrable, and its integral is zero.

Formal statement
conclusion 1
Integrable (fun x : ℝ => x * sinc4Kernel 1 x) volume
conclusion 2
(∫ x : ℝ, x * sinc4Kernel 1 x) = 0
Proof (Lean source)
theorem sinc4Kernel_unit_first_moment : Integrable (fun x : ℝ => x * sinc4Kernel 1 x) volume ∧ (∫ x : ℝ, x * sinc4Kernel 1 x) = 0 := by have hs : Integrable (fun x : ℝ => sinc (x / 4) ^ 2) volume := by convert sincSquared_integrable.comp_mul_left' (by norm_num : (1 / 4 : ℝ) ≠ 0) using 1 ext x congr 1 ring_nf have hb (x : ℝ) : |x * sinc (x / 4) ^ 2| ≤ 4 := by have hxs : x * sinc (x / 4) = 4 * sin (x / 4) := by by_cases hx : x = 0 · subst x; simp · rw [Real.sinc_of_ne_zero (by exact div_ne_zero hx (by norm_num))] field_simp have hsin : |x * sinc (x / 4)| ≤ 4 := by rw [hxs, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 4)] nlinarith [Real.abs_sin_le_one (x / 4)] calc |x * sinc (x / 4) ^ 2| = |x * sinc (x / 4)| * |sinc (x / 4)| := by rw [← abs_mul] congr 1 ring _ ≤ 4 * 1 := by calc _ ≤ 4 * |sinc (x / 4)| := mul_le_mul_of_nonneg_right hsin (abs_nonneg _) _ ≤ 4 * 1 := mul_le_mul_of_nonneg_left (Real.abs_sinc_le_one _) (by norm_num) _ = 4 := by ring have hp : Integrable (fun x : ℝ => (x * sinc (x / 4) ^ 2) * sinc (x / 4) ^ 2) volume := by refine Integrable.bdd_mul (c := 4) hs (by fun_prop) ?_ filter_upwards with x simpa only [Real.norm_eq_abs] using hb x have hi : Integrable (fun x : ℝ => x * sinc4Kernel 1 x) volume := by convert hp.const_mul (3 / (8 * pi)) using 1 ext x simp only [sinc4Kernel, one_mul] ring refine ⟨hi, ?_⟩ have heven (x : ℝ) : sinc4Kernel 1 (-x) = sinc4Kernel 1 x := by simp only [sinc4Kernel, one_mul, neg_div, Real.sinc_neg] have href := integral_neg_eq_self (fun x : ℝ => x * sinc4Kernel 1 x) volume have hneg : (∫ x : ℝ, (-x) * sinc4Kernel 1 (-x)) = -(∫ x : ℝ, x * sinc4Kernel 1 x) := by simp only [heven, neg_mul, integral_neg] rw [hneg] at href linarith
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_unit_first_moment · Causalean/Stat/CLT/BerryEsseen/EsseenSinc4FirstMoment.lean:19 · uses sinc4Kernel
Esseen­Sinc4­Second­Moment 1 core · 0 supporting The exact second moment of this compact-frequency density controls the spatial error of a signed, shifted kernel used in Esseen's comparison. ★ sinc4Kernel_unit_second_moment

Second moment of the unit-bandwidth sinc-fourth density

The exact second moment of this compact-frequency density controls the spatial error of a signed, shifted kernel used in Esseen's comparison.

theorem sinc4Kernel_unit_second_moment reviewed
Causalean.Stat.CLT.BerryEsseen

The second-moment density x²·K(x) of the unit-bandwidth sinc-fourth kernel K is integrable, and its integral equals twelve.

Formal statement
conclusion 1
Integrable (fun x : ℝ => x ^ 2 * sinc4Kernel 1 x) volume
conclusion 2
(∫ x : ℝ, x ^ 2 * sinc4Kernel 1 x) = 12
Proof (Lean source)
theorem sinc4Kernel_unit_second_moment : Integrable (fun x : ℝ => x ^ 2 * sinc4Kernel 1 x) volume ∧ (∫ x : ℝ, x ^ 2 * sinc4Kernel 1 x) = 12 := by have hsinc (a : ℝ) (ha : a ≠ 0) : Integrable (fun x : ℝ => sinc (a * x) ^ 2) volume := sincSquared_integrable.comp_mul_left' ha have hsq : (∫ x : ℝ, sinc x ^ 2) = pi := by have h := sincSquared_fourier_triangle 0 simp only [zero_mul, Complex.ofReal_zero, Complex.exp_zero, one_mul, abs_zero, zero_div, sub_zero, max_eq_left (by norm_num : (0 : ℝ) ≤ 1), mul_one, integral_complex_ofReal] at h exact Complex.ofReal_injective h have hscale (a : ℝ) (ha : 0 < a) : (∫ x : ℝ, sinc (a * x) ^ 2) = pi / a := by have h := Measure.integral_comp_mul_left (fun x : ℝ => sinc x ^ 2) a rw [hsq] at h calc _ = a⁻¹ * pi := by simpa [smul_eq_mul, abs_of_pos ha] using h _ = _ := by ring have hpoint (u : ℝ) : u ^ 2 * sinc u ^ 4 = sinc u ^ 2 - sinc (2 * u) ^ 2 := by by_cases hu : u = 0 · subst u; norm_num · have h2u : 2 * u ≠ 0 := mul_ne_zero (by norm_num) hu rw [Real.sinc_of_ne_zero hu, Real.sinc_of_ne_zero h2u, Real.sin_two_mul] have htrig := Real.sin_sq_add_cos_sq u field_simp nlinarith [sq_nonneg (sin u), sq_nonneg (cos u)] have hpoint' (x : ℝ) : x ^ 2 * sinc4Kernel 1 x = (3 / (8 * pi)) * (16 * (sinc (x / 4) ^ 2 - sinc (x / 2) ^ 2)) := by calc _ = (3 / (8 * pi)) * 16 * ((x / 4) ^ 2 * sinc (x / 4) ^ 4) := by simp only [sinc4Kernel, one_mul] ring _ = _ := by rw [hpoint] have hx : 2 * (x / 4) = x / 2 := by ring rw [hx] ring have hi : Integrable (fun x : ℝ => x ^ 2 * sinc4Kernel 1 x) volume := by have h1 : Integrable (fun x : ℝ => sinc (x / 4) ^ 2) volume := by convert hsinc (1 / 4) (by norm_num) using 1 ext x; congr 1; ring have h2 : Integrable (fun x : ℝ => sinc (x / 2) ^ 2) volume := by convert hsinc (1 / 2) (by norm_num) using 1 ext x; congr 1; ring convert ((h1.sub h2).const_mul 16).const_mul (3 / (8 * pi)) using 1 ext x; exact hpoint' x refine ⟨hi, ?_⟩ simp_rw [hpoint'] rw [integral_const_mul, integral_const_mul, integral_sub] · have h4 : (∫ x : ℝ, sinc (x / 4) ^ 2) = 4 * pi := by convert hscale (1 / 4) (by norm_num) using 1 · congr 1; ext x; congr 1; ring · ring have h2 : (∫ x : ℝ, sinc (x / 2) ^ 2) = 2 * pi := by convert hscale (1 / 2) (by norm_num) using 1 · congr 1; ext x; congr 1; ring · ring rw [h4, h2] field_simp [Real.pi_ne_zero] ring · convert hsinc (1 / 4) (by norm_num) using 1 ext x; congr 1; ring · convert hsinc (1 / 2) (by norm_num) using 1 ext x; congr 1; ring
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_unit_second_moment · Causalean/Stat/CLT/BerryEsseen/EsseenSinc4SecondMoment.lean:16 · uses sinc4Kernel
Esseen­Spectral­Comparison 1 core · 0 supporting This module isolates the kernel construction in Esseen's one-sided smoothing argument. ★ exists_esseen_one_sided_spectral_comparator

One-sided spectral comparison with constant 24/π

This module isolates the kernel construction in Esseen's one-sided smoothing argument. The Fourier estimate for a supplied kernel is proved separately in EsseenConvolutionTransfer.

theorem exists_esseen_one_sided_spectral_comparator reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable real function H whose downward increments are bounded by a nonnegative constant L times the distance, a positive bandwidth T, any point x, and a positive tolerance ε, there is a continuous integrable kernel K with integrable Fourier transform that vanishes outside (−T, T) and has magnitude at most one, whose convolution with H at x is integrable and satisfies H(x) ≤ 2·|convolution at x| + 24L/(πT) + ε.

Formal statement
H :
ℝ → ℝ
L :
ℝ
hL :
0 ≤ L
hdown :
∀ a b : ℝ
if
a ≤ b
then
H a ≤ H b + L * (b - a)
T :
ℝ
hT :
0 < T
x :
ℝ
ε :
ℝ
hε :
0 < ε
∃ K : ℝ → ℝ,
Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume
conclusion 1
t :
ℝ
T ≤ |t|
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
conclusion 2
t :
ℝ
‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
conclusion 3
Integrable (fun y : ℝ => H (x - y) * K y) volume
conclusion 4
H x ≤ 2 * |∫ y : ℝ, H (x - y) * K y| + 24 * L / (pi * T) + ε
Proof (Lean source)
theorem exists_esseen_one_sided_spectral_comparator (H : ℝ → ℝ) (hH : Integrable H volume) (L : ℝ) (hL : 0 ≤ L) (hdown : ∀ a b : ℝ, a ≤ b → H a ≤ H b + L * (b - a)) (T : ℝ) (hT : 0 < T) (x : ℝ) (ε : ℝ) (hε : 0 < ε) : ∃ K : ℝ → ℝ, Integrable K volume ∧ Continuous K ∧ Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume ∧ (∀ t : ℝ, T ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) ∧ (∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) ∧ Integrable (fun y : ℝ => H (x - y) * K y) volume ∧ H x ≤ 2 * |∫ y : ℝ, H (x - y) * K y| + 24 * L / (pi * T) + ε := by /- Reduce to `exists_esseen_unit_spectral_comparator` by translation and bandwidth scaling. Take a = L/T + ε*π/48 > 0 and G(u)=H(x+u/T)/a. Its downward slope is L/(a*T) ≤ 1. Apply the unit comparator with tolerance ε/(2*a). Dilate the witness using spectral_kernel_dilation_properties and transfer its convolution with spectral_convolution_dilation. The total error is a*(24/π + ε/(2*a)) = 24*L/(π*T) + ε. This covers L=0 without an impossible division by L. -/ let a : ℝ := L / T + ε * pi / 48 have ha : 0 < a := by dsimp [a] positivity have hLa : L ≤ a * T := by dsimp [a] have : 0 ≤ ε * pi / 48 * T := by positivity rw [add_mul, div_mul_cancel₀ L hT.ne'] linarith let G : ℝ → ℝ := fun u => H (x + u / T) / a have hG : Integrable G volume := ((hH.comp_add_left x).comp_div hT.ne').div_const a have hGdown : ∀ u v : ℝ, u ≤ v → G u ≤ G v + (v - u) := by intro u v huv have huv' : x + u / T ≤ x + v / T := by exact add_le_add_right ((div_le_div_iff_of_pos_right hT).2 huv) x have hd := hdown (x + u / T) (x + v / T) huv' have hs : L * ((x + v / T) - (x + u / T)) ≤ a * (v - u) := by have hm := mul_le_mul_of_nonneg_right hLa (sub_nonneg.mpr huv) apply (le_of_mul_le_mul_right ?_ hT) convert hm using 1 <;> field_simp ring dsimp [G] apply (div_le_iff₀ ha).2 rw [add_mul, div_mul_cancel₀ _ ha.ne'] linarith obtain ⟨K, hKi, hKc, _, hsupp, hnorm, hprod, hpoint⟩ := exists_esseen_unit_spectral_comparator G hG hGdown (ε / (2 * a)) (by positivity) have hprod' : Integrable (fun u : ℝ => H (x - u / T) / a * K u) volume := by simpa only [G, neg_div, sub_eq_add_neg] using hprod obtain ⟨hdi, hdc, hdf, hds, hdn⟩ := spectral_kernel_dilation_properties K hKi hKc hsupp hnorm T hT obtain ⟨hdprod, hdint⟩ := spectral_convolution_dilation H K x a T ha hT hprod' refine ⟨fun y => T * K (T * y), hdi, hdc, hdf, hds, hdn, hdprod, ?_⟩ have hpoint' : H x / a ≤ 2 * |∫ u : ℝ, H (x - u / T) / a * K u| + 24 / pi + ε / (2 * a) := by simpa only [G, zero_div, add_zero, neg_div, sub_eq_add_neg] using hpoint have hscaled := (mul_le_mul_of_nonneg_left hpoint' ha.le) rw [mul_div_cancel₀ _ ha.ne'] at hscaled have herr : a * (24 / pi + ε / (2 * a)) = 24 * L / (pi * T) + ε := by dsimp [a] field_simp ring rw [hdint, abs_mul, abs_of_pos ha] nlinarith [herr]
Causalean.Stat.CLT.BerryEsseen.exists_esseen_one_sided_spectral_comparator · Causalean/Stat/CLT/BerryEsseen/EsseenSpectralComparison.lean:19
Esseen­Unit­Raw­Witness 1 core · 0 supporting This isolates the genuine one-sided approximation step. ★ exists_esseen_unit_raw_spectral_witness

Sharp unit-bandwidth spectral witness

This isolates the genuine one-sided approximation step. Kernel regularity consequences of spectral support are supplied by EsseenUnitRegularity.

theorem exists_esseen_unit_raw_spectral_witness reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable real function H whose downward increments are at most the distance between its arguments and any positive tolerance ε, there is a continuous integrable kernel K whose Fourier transform vanishes outside (−1, 1) and has magnitude at most one, such that H(0) is at most twice the absolute value of the integral of H(−y)·K(y) plus 24/π + ε.

Formal statement
H :
ℝ → ℝ
hdown :
∀ a b : ℝ
if
a ≤ b
then
H a ≤ H b + (b - a)
ε :
ℝ
hε :
0 < ε
∃ K : ℝ → ℝ,
conclusion 1
t :
ℝ
1 ≤ |t|
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
conclusion 2
t :
ℝ
‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
conclusion 3
H 0 ≤ 2 * |∫ y : ℝ, H (-y) * K y| + 24 / pi + ε
Proof (Lean source)
theorem exists_esseen_unit_raw_spectral_witness (H : ℝ → ℝ) (hH : Integrable H volume) (hdown : ∀ a b : ℝ, a ≤ b → H a ≤ H b + (b - a)) (ε : ℝ) (hε : 0 < ε) : ∃ K : ℝ → ℝ, Integrable K volume ∧ Continuous K ∧ (∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) ∧ (∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) ∧ H 0 ≤ 2 * |∫ y : ℝ, H (-y) * K y| + 24 / pi + ε := by let K := esseenSignedSinc4Kernel obtain ⟨hKint, hKcont⟩ := esseenSignedSinc4Kernel_integrable_continuous have hsupp : ∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0 := fun t ht => esseenSignedSinc4Kernel_fourier_eq_zero t ht have hnorm : ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1 := esseenSignedSinc4Kernel_fourier_norm_le_one have hprod : Integrable (fun y : ℝ => H (-y) * K y) volume := integrable_reflected_mul_unit_supported_kernel H K hH hKint hKcont hsupp hnorm have hcomp := esseenSignedSinc4Kernel_comparison H hdown hprod have hpi : (7 : ℝ) ≤ 24 / pi := by apply (le_div_iff₀ Real.pi_pos).2 nlinarith [Real.pi_lt_d2] refine ⟨K, hKint, hKcont, hsupp, hnorm, ?_⟩ linarith
Causalean.Stat.CLT.BerryEsseen.exists_esseen_unit_raw_spectral_witness · Causalean/Stat/CLT/BerryEsseen/EsseenUnitRawWitness.lean:22
Esseen­Unit­Regularity 1 core · 1 supporting For an integrable real kernel whose Fourier transform vanishes outside the unit interval and has magnitude at most one, the Fourier transform is integrable (integrable_unit_supported_kernel_fourier) and the product of th ★ integrable_reflected_mul_unit_supported_kernel

Regularity consequences of a unit-bandlimited kernel

For an integrable real kernel whose Fourier transform vanishes outside the unit interval and has magnitude at most one, the Fourier transform is integrable (integrable_unit_supported_kernel_fourier) and the product of the kernel with a reflected factor is integrable (integrable_reflected_mul_unit_supported_kernel). These are the two integrability facts used by the one-sided spectral comparison.

theorem integrable_reflected_mul_unit_supported_kernel reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable function H and an integrable continuous kernel K whose Fourier transform vanishes outside (−1, 1) and has magnitude at most one, the product y ↦ H(−y)·K(y) is integrable.

Formal statement
H K :
ℝ → ℝ
hKcont :
hsupp :
∀ t : ℝ
if
1 ≤ |t|
then
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
hnorm :
∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
Integrable (fun y : ℝ => H (-y) * K y) volume
Proof (Lean source)
theorem integrable_reflected_mul_unit_supported_kernel (H K : ℝ → ℝ) (hH : Integrable H volume) (hK : Integrable K volume) (hKcont : Continuous K) (hsupp : ∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) (hnorm : ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) : Integrable (fun y : ℝ => H (-y) * K y) volume := by let f : ℝ → ℂ := fun y => (K y : ℂ) let F : ℝ → ℂ := fun t => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * f y have hf : Integrable f := hK.ofReal have hfc : Continuous f := by fun_prop have hFfourier (w : ℝ) : FourierTransform.fourier f w = F ((-2 * Real.pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with y simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hFint : Integrable F := integrable_unit_supported_kernel_fourier K hK hsupp hnorm have hFourierInt : Integrable (FourierTransform.fourier f) := by rw [funext hFfourier] exact hFint.comp_mul_left' (by positivity : (-2 * Real.pi : ℝ) ≠ 0) have hbound (y : ℝ) : ‖K y‖ ≤ ∫ w : ℝ, ‖FourierTransform.fourier f w‖ := by have hinv : (K y : ℂ) = FourierTransform.fourierInv (FourierTransform.fourier f) y := (hf.fourierInv_fourier_eq hFourierInt hfc.continuousAt).symm rw [← Complex.norm_real (K y), hinv, Real.fourierInv_eq'] simp only [smul_eq_mul, RCLike.inner_apply', starRingEnd_apply, star_trivial] calc ‖∫ w : ℝ, exp (((2 * Real.pi * (w * y) : ℝ) : ℂ) * I) * FourierTransform.fourier f w‖ ≤ ∫ w : ℝ, ‖Complex.exp (((2 * Real.pi * (w * y) : ℝ) : ℂ) * I) * FourierTransform.fourier f w‖ := norm_integral_le_integral_norm _ _ = _ := by congr 1 ext w rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] have hHneg : Integrable (fun y : ℝ => H (-y)) volume := hH.comp_neg exact hHneg.mul_bdd hKcont.aestronglyMeasurable (Filter.Eventually.of_forall hbound)
Causalean.Stat.CLT.BerryEsseen.integrable_reflected_mul_unit_supported_kernel · Causalean/Stat/CLT/BerryEsseen/EsseenUnitRegularity.lean:77
1 supporting declaration (lemmas, instances)
  • integrable_unit_supported_kernel_fourier theorem — The Fourier transform of an integrable real kernel is integrable when it vanishes outside the unit interval and has magnitude at most one.
    K :
    ℝ → ℝ
    hsupp :
    ∀ t : ℝ
    if
    1 ≤ |t|
    then
    (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
    hnorm :
    ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
    Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume
    Proof (Lean source)
    theorem integrable_unit_supported_kernel_fourier (K : ℝ → ℝ) (hK : Integrable K volume) (hsupp : ∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) (hnorm : ∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) : Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume := by let f : ℝ → ℂ := fun y => (K y : ℂ) let F : ℝ → ℂ := fun t => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * f y have hf : Integrable f := hK.ofReal have hFfourier (w : ℝ) : fourier f w = F ((-2 * pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with y simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hFcont : Continuous F := by have hc : Continuous (fourier f) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hf have heq : F = fun t : ℝ => fourier f (t / (-2 * pi)) := by funext t rw [hFfourier] congr 1 field_simp rw [heq] fun_prop have hsupport : support F ⊆ Icc (-1 : ℝ) 1 := by intro t ht by_contra hn have ht' : 1 ≤ |t| := by simp only [Set.mem_Icc, not_and_or, not_le] at hn rcases hn with hn | hn · rw [abs_of_nonpos (by linarith)] linarith · rw [abs_of_nonneg (by linarith)] linarith exact ht (hsupp t ht') have hmajor : Integrable ((Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => (1 : ℝ))) volume := (continuous_const.integrableOn_Icc).integrable_indicator measurableSet_Icc apply Integrable.mono' hmajor hFcont.aestronglyMeasurable filter_upwards with t by_cases ht : t ∈ Icc (-1 : ℝ) 1 · rw [Set.indicator_of_mem ht] exact hnorm t · rw [Set.indicator_of_notMem ht] have hzero : F t = 0 := by by_contra hn exact ht (hsupport hn) simp [hzero]
    Causalean.Stat.CLT.BerryEsseen.integrable_unit_supported_kernel_fourier · Causalean/Stat/CLT/BerryEsseen/EsseenUnitRegularity.lean:20
Esseen­Unit­Spectral­Comparison 1 core · 0 supporting This module isolates the sharp analytic kernel construction at bandwidth one, unit downward slope, and the origin. ★ exists_esseen_unit_spectral_comparator

Unit-bandwidth one-sided spectral comparison

This module isolates the sharp analytic kernel construction at bandwidth one, unit downward slope, and the origin. Translation and rescaling belong to the general spectral comparison module.

theorem exists_esseen_unit_spectral_comparator reviewed
Causalean.Stat.CLT.BerryEsseen

For an integrable real function H whose downward increments are at most the distance between its arguments and any positive tolerance ε, there is a continuous integrable kernel K with integrable Fourier transform that vanishes outside (−1, 1) and has magnitude at most one, such that y ↦ H(−y)·K(y) is integrable and H(0) is at most twice the absolute value of its integral plus 24/π + ε.

Formal statement
H :
ℝ → ℝ
hdown :
∀ a b : ℝ
if
a ≤ b
then
H a ≤ H b + (b - a)
ε :
ℝ
hε :
0 < ε
∃ K : ℝ → ℝ,
Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume
conclusion 1
t :
ℝ
1 ≤ |t|
(∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0
conclusion 2
t :
ℝ
‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1
conclusion 3
Integrable (fun y : ℝ => H (-y) * K y) volume
conclusion 4
H 0 ≤ 2 * |∫ y : ℝ, H (-y) * K y| + 24 / pi + ε
Proof (Lean source)
theorem exists_esseen_unit_spectral_comparator (H : ℝ → ℝ) (hH : Integrable H volume) (hdown : ∀ a b : ℝ, a ≤ b → H a ≤ H b + (b - a)) (ε : ℝ) (hε : 0 < ε) : ∃ K : ℝ → ℝ, Integrable K volume ∧ Continuous K ∧ Integrable (fun t : ℝ => ∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) volume ∧ (∀ t : ℝ, 1 ≤ |t| → (∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)) = 0) ∧ (∀ t : ℝ, ‖∫ y : ℝ, exp (((t * y : ℝ) : ℂ) * I) * (K y : ℂ)‖ ≤ 1) ∧ Integrable (fun y : ℝ => H (-y) * K y) volume ∧ H 0 ≤ 2 * |∫ y : ℝ, H (-y) * K y| + 24 / pi + ε := by obtain ⟨K, hKi, hKc, hsupp, hnorm, hpoint⟩ := exists_esseen_unit_raw_spectral_witness H hH hdown ε hε exact ⟨K, hKi, hKc, integrable_unit_supported_kernel_fourier K hKi hsupp hnorm, hsupp, hnorm, integrable_reflected_mul_unit_supported_kernel H K hH hKi hKc hsupp hnorm, hpoint⟩
Causalean.Stat.CLT.BerryEsseen.exists_esseen_unit_spectral_comparator · Causalean/Stat/CLT/BerryEsseen/EsseenUnitSpectralComparison.lean:17
Gaussian­Sine­Inversion 1 core · 1 supporting This Gaussian-only identity is independent of Prawitz filters and probability comparison inequalities. ★ gaussian_cdf_sine_inversion

Sine inversion of the standard Gaussian distribution function

This Gaussian-only identity is independent of Prawitz filters and probability comparison inequalities. The frequency integrand has a removable singularity at zero, with its Lebesgue endpoint value assigned by real division.

theorem gaussian_cdf_sine_inversion reviewed
Causalean.Stat.CLT.BerryEsseen

At every real threshold x, the standard Gaussian probability of the half-line (−∞, x] equals one half plus 1/π times the integral over t > 0 of exp(−t²/2)·sin(tx)/t.

Formal statement
x :
ℝ
((gaussianReal 0 1) (Iic x)).toReal
= 1 / 2
+ (1 / pi) * (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t)
Proof (Lean source)
theorem gaussian_cdf_sine_inversion (x : ℝ) : ((gaussianReal 0 1) (Iic x)).toReal = 1 / 2 + (1 / pi) * (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t) := by -- Take the real part of the Gaussian characteristic function, whose -- Mathlib proof evaluates the Gaussian Fourier integral. have hg : Integrable (fun t : ℝ => exp (-(t ^ 2 / 2))) := by simpa only [div_eq_mul_inv, one_mul, neg_mul, mul_neg, mul_comm] using (integrable_exp_neg_mul_sq (by norm_num : (0 : ℝ) < 1 / 2)) have hp := integrable_gaussianPDFReal 0 1 have hs : sqrt (2 * pi) ≠ 0 := ne_of_gt (by positivity) have hpdf (t : ℝ) : gaussianPDFReal 0 1 t = (sqrt (2 * pi))⁻¹ * exp (-(t ^ 2 / 2)) := by simp [gaussianPDFReal, neg_div] have hchar (y : ℝ) : ∫ t : ℝ, gaussianPDFReal 0 1 t * cos (t * y) = exp (-(y ^ 2 / 2)) := by have hi : Integrable (fun t : ℝ => exp (((t * y : ℝ) : ℂ) * I)) (gaussianReal 0 1) := by apply (integrable_const (1 : ℝ)).mono' (by fun_prop) exact Filter.Eventually.of_forall (fun t => by simp only [Complex.norm_exp_ofReal_mul_I, le_refl]) have h := congrArg re (charFun_gaussianReal (μ := 0) (v := 1) y) rw [charFun_apply_real] at h simp_rw [← Complex.ofReal_mul, mul_comm y] at h have hre := integral_re hi simp only [RCLike.re_to_complex] at hre rw [← hre] at h simp only [Complex.exp_ofReal_mul_I_re] at h rw [integral_gaussianReal_eq_integral_smul (by norm_num : (1 : ℝ≥0) ≠ 0)] at h simpa only [smul_eq_mul, Complex.ofReal_zero, mul_zero, zero_mul, zero_sub, NNReal.coe_one, Complex.ofReal_one, one_mul, ← Complex.ofReal_pow, ← Complex.ofReal_ofNat 2, ← Complex.ofReal_div, ← Complex.ofReal_neg, Complex.exp_ofReal_re] using h have hfull (y : ℝ) : ∫ t : ℝ, exp (-(t ^ 2 / 2)) * cos (t * y) = sqrt (2 * pi) * exp (-(y ^ 2 / 2)) := by have h := hchar y simp_rw [hpdf, mul_assoc] at h rw [integral_const_mul] at h calc _ = sqrt (2 * pi) * ((sqrt (2 * pi))⁻¹ * ∫ t : ℝ, exp (-(t ^ 2 / 2)) * cos (t * y)) := by rw [← mul_assoc, mul_inv_cancel₀ hs, one_mul] _ = _ := by rw [h] have hcos (y : ℝ) : ∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * cos (t * y) = pi * gaussianPDFReal 0 1 y := by have he (t : ℝ) : exp (-(|t| ^ 2 / 2)) * cos (|t| * y) = exp (-(t ^ 2 / 2)) * cos (t * y) := by by_cases ht : 0 ≤ t · rw [abs_of_nonneg ht] · simp [abs_of_neg (lt_of_not_ge ht), neg_mul, Real.cos_neg] have hhalf := integral_comp_abs (f := fun t : ℝ => exp (-(t ^ 2 / 2)) * cos (t * y)) simp_rw [he] at hhalf rw [hfull] at hhalf rw [hpdf] have hsq := Real.sq_sqrt (show 0 ≤ 2 * pi by positivity) have hc : sqrt (2 * pi) / 2 = pi * (sqrt (2 * pi))⁻¹ := by apply (eq_div_iff hs).mpr nlinarith calc _ = (sqrt (2 * pi) / 2) * exp (-(y ^ 2 / 2)) := by linarith [hhalf] _ = _ := by rw [hc]; ring -- Reflection and total mass one fix the integration constant at zero. have hzero : ∫ t in Iic (0 : ℝ), gaussianPDFReal 0 1 t = 1 / 2 := by have he (t : ℝ) : gaussianPDFReal 0 1 (-t) = gaussianPDFReal 0 1 t := by simp [hpdf] have href := integral_comp_neg_Ioi 0 (gaussianPDFReal 0 1) simp only [neg_zero, he] at href have hsum := intervalIntegral.integral_Iic_add_Ioi (b := 0) hp.integrableOn hp.integrableOn rw [integral_gaussianPDFReal_eq_one 0 (by norm_num : (1 : ℝ≥0) ≠ 0)] at hsum linarith -- Gaussian domination permits Fubini on the oriented spatial interval. have hprod : Integrable (uncurry (fun y t : ℝ => exp (-(t ^ 2 / 2)) * cos (t * y))) ((volume.restrict (Set.uIoc 0 x)).prod (volume.restrict (Ioi 0))) := by have hu : IntegrableOn (fun _ : ℝ => (1 : ℝ)) (Set.uIoc 0 x) := intervalIntegrable_iff.mp intervalIntegrable_const have hmajor := hu.mul_prod (hg.integrableOn (s := Ioi 0)) apply hmajor.mono' (by fun_prop) apply Filter.Eventually.of_forall intro p change ‖Real.exp (-(p.2 ^ 2 / 2)) * cos (p.2 * p.1)‖ ≤ 1 * exp (-(p.2 ^ 2 / 2)) rw [norm_mul, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), Real.norm_eq_abs, one_mul] exact mul_le_of_le_one_right (Real.exp_nonneg _) (Real.abs_cos_le_one _) have hswap := intervalIntegral_integral_swap hprod have hinner (t : ℝ) (ht : t ∈ Ioi (0 : ℝ)) : (∫ y in (0 : ℝ)..x, exp (-(t ^ 2 / 2)) * cos (t * y)) = exp (-(t ^ 2 / 2)) * sin (t * x) / t := by rw [intervalIntegral.integral_const_mul, intervalIntegral.integral_comp_mul_left cos (ne_of_gt ht), integral_cos] simp only [mul_zero, Real.sin_zero, sub_zero, smul_eq_mul] ring have hsine : (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t) = pi * ∫ y in (0 : ℝ)..x, gaussianPDFReal 0 1 y := by calc _ = ∫ t in Ioi (0 : ℝ), (∫ y in (0 : ℝ)..x, exp (-(t ^ 2 / 2)) * cos (t * y)) := by apply setIntegral_congr_fun measurableSet_Ioi intro t ht exact (hinner t ht).symm _ = ∫ y in (0 : ℝ)..x, (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * cos (t * y)) := hswap.symm _ = ∫ y in (0 : ℝ)..x, pi * gaussianPDFReal 0 1 y := by congr 1 funext y exact hcos y _ = _ := intervalIntegral.integral_const_mul _ _ rw [gaussianReal_apply_eq_integral 0 (by norm_num : (1 : ℝ≥0) ≠ 0), ENNReal.toReal_ofReal (setIntegral_nonneg measurableSet_Iic (fun t _ => gaussianPDFReal_nonneg 0 1 t)), hsine] have hdiff := intervalIntegral.integral_Iic_sub_Iic (a := 0) (b := x) hp.integrableOn hp.integrableOn rw [hzero] at hdiff rw [← hdiff] field_simp ring
Causalean.Stat.CLT.BerryEsseen.gaussian_cdf_sine_inversion · Causalean/Stat/CLT/BerryEsseen/GaussianSineInversion.lean:46
1 supporting declaration (lemmas, instances)
  • gaussian_sine_quotient_integrable theorem — At any real threshold, the Gaussian sine quotient is integrable on the positive frequency half-line.
    x :
    ℝ
    IntegrableOn (fun t : ℝ => exp (-(t ^ 2 / 2)) * sin (t * x) / t) (Ioi 0)
    Proof (Lean source)
    theorem gaussian_sine_quotient_integrable (x : ℝ) : IntegrableOn (fun t : ℝ => exp (-(t ^ 2 / 2)) * sin (t * x) / t) (Ioi 0) := by have hg : Integrable (fun t : ℝ => exp (-(t ^ 2 / 2))) := by simpa only [div_eq_mul_inv, one_mul, neg_mul, mul_neg, mul_comm] using (integrable_exp_neg_mul_sq (by norm_num : (0 : ℝ) < 1 / 2)) have hm : Measurable (fun t : ℝ => exp (-(t ^ 2 / 2)) * sin (t * x) / t) := by fun_prop apply (hg.integrableOn.const_mul |x|).mono' hm.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have ht0 : 0 < t := ht have hs : |sin (t * x)| / t ≤ |x| := by apply (div_le_iff₀ ht0).mpr simpa only [abs_mul, abs_of_pos ht0, mul_comm] using (Real.abs_sin_le_abs (x := t * x)) rw [Real.norm_eq_abs, abs_div, abs_mul, abs_of_pos (Real.exp_pos _), abs_of_pos ht0] calc _ = exp (-(t ^ 2 / 2)) * (|sin (t * x)| / t) := by ring _ ≤ exp (-(t ^ 2 / 2)) * |x| := mul_le_mul_of_nonneg_left hs (Real.exp_nonneg _) _ = _ := by ring
    Causalean.Stat.CLT.BerryEsseen.gaussian_sine_quotient_integrable · Causalean/Stat/CLT/BerryEsseen/GaussianSineInversion.lean:21
Gaussian­Weighted­Tail 1 core · 0 supporting This real probability-independent tail estimate integrates the reciprocal and constant weights appearing in a scaled spectral-kernel bound. ★ gaussian_reciprocal_linear_tail_bound

Weighted Gaussian upper tails

This real probability-independent tail estimate integrates the reciprocal and constant weights appearing in a scaled spectral-kernel bound. It isolates the improper-integral calculation from Prawitz's parameter-dependent cutoffs.

theorem gaussian_reciprocal_linear_tail_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive lower endpoint a and damping rate b and a nonnegative constant weight c, the integral over t > a of (1/(πt) + c)·exp(−bt²) is at most (1/(2πba²) + c/(2ba))·exp(−ba²).

Formal statement
a b c :
ℝ
ha :
0 < a
hb :
0 < b
hc :
0 ≤ c
(∫ t in Ioi a, (1 / (pi * t) + c) * exp (-(b * t ^ 2)))
≤ (1 / (2 * pi * b * a ^ 2) + c / (2 * b * a)) * exp (-(b * a ^ 2))
Proof (Lean source)
theorem gaussian_reciprocal_linear_tail_bound (a b c : ℝ) (ha : 0 < a) (hb : 0 < b) (hc : 0 ≤ c) : (∫ t in Ioi a, (1 / (pi * t) + c) * exp (-(b * t ^ 2))) ≤ (1 / (2 * pi * b * a ^ 2) + c / (2 * b * a)) * exp (-(b * a ^ 2)) := by /- Bound the reciprocal and constant parts separately by the standard Gaussian tail supersolutions e^(-bt²)/(2πbt²) and c*e^(-bt²)/(2bt). Their negative derivatives dominate the integrands for t>0. Show the supersolutions tend to zero and apply integral comparison/Fundamental Theorem of Calculus on Ioi a. Alternatively bound 1/t by t/a² and 1 by t/a, then integrate t*e^(-bt²) exactly. This second proof needs only the derivative of -e^(-bt²)/(2b), plus Gaussian integrability away from zero. No Prawitz module is imported; this leaf must stay independently usable. For the small-ratio middle-frequency budget use b=2/5, c=5ρ/12, a=U0. On t≤1/(2ρ), the cubic damping is at most e^(-2t²/5). U0²≥4log(1/ρ) gives e^(-2U0²/5)≤ρ*sqrt ρ, and U0≥3/2; for ρ≤1/100 the resulting allocation is less than ρ/20. This connection belongs to the later high-budget assembly, not to this generic theorem. -/ let K : ℝ := 1 / (pi * a ^ 2) + c / a have hK : 0 ≤ K := by dsimp [K]; positivity have hderiv : ∀ t : ℝ, HasDerivAt (fun x : ℝ => -(2 * b)⁻¹ * exp (-b * x ^ 2)) (t * exp (-b * t ^ 2)) t := by intro t convert ((hasDerivAt_pow 2 t).const_mul (-b)).exp.const_mul (-(2 * b)⁻¹) using 1 all_goals first | rfl | (field_simp; ring) have hlim : Tendsto (fun x : ℝ => -(2 * b)⁻¹ * exp (-b * x ^ 2)) atTop (nhds 0) := by simpa using (Real.tendsto_exp_atBot.comp ((Filter.tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0)).const_mul_atTop_of_neg (neg_lt_zero.mpr hb))).const_mul (-(2 * b)⁻¹) have hgi : IntegrableOn (fun t : ℝ => t * exp (-b * t ^ 2)) (Ioi a) := (integrable_mul_exp_neg_mul_sq hb).integrableOn have hval := integral_Ioi_of_hasDerivAt_of_tendsto' (fun t _ => hderiv t) hgi hlim have hmajor : ∀ t ∈ Ioi a, (1 / (pi * t) + c) * exp (-(b * t ^ 2)) ≤ K * (t * exp (-b * t ^ 2)) := by intro t ht have htpos : 0 < t := lt_trans ha ht have hrec : 1 / (pi * t) ≤ t / (pi * a ^ 2) := by apply (div_le_div_iff₀ (by positivity) (by positivity)).2 have hs : a ^ 2 ≤ t ^ 2 := by nlinarith [show a < t from ht] have hm := mul_le_mul_of_nonneg_left hs Real.pi_pos.le nlinarith [hm] have hc' : c ≤ (c / a) * t := by have hat : 1 ≤ t / a := (le_div_iff₀ ha).2 (by simpa using (le_of_lt ht : a ≤ t)) have := mul_le_mul_of_nonneg_left hat hc simpa only [mul_one, div_mul_eq_mul_div, mul_div_assoc] using this have hw : 1 / (pi * t) + c ≤ K * t := by dsimp [K] calc _ ≤ t / (pi * a ^ 2) + (c / a) * t := add_le_add hrec hc' _ = _ := by ring have hm := mul_le_mul_of_nonneg_right hw (Real.exp_nonneg (-(b * t ^ 2))) simpa only [neg_mul, mul_assoc] using hm have hmi : IntegrableOn (fun t : ℝ => K * (t * exp (-b * t ^ 2))) (Ioi a) := hgi.const_mul K have hcont : ContinuousOn (fun t : ℝ => (1 / (pi * t) + c) * exp (-(b * t ^ 2))) (Ioi a) := by apply ContinuousOn.mul · apply ContinuousOn.add · exact continuousOn_const.div (continuous_const.mul continuous_id).continuousOn (fun t ht => ne_of_gt (mul_pos Real.pi_pos (lt_trans ha ht))) · exact continuousOn_const · fun_prop have hfi : IntegrableOn (fun t : ℝ => (1 / (pi * t) + c) * exp (-(b * t ^ 2))) (Ioi a) := by refine hmi.mono' (hcont.aestronglyMeasurable measurableSet_Ioi) ?_ filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (by have htpos : 0 < t := lt_trans ha ht positivity)] exact hmajor t ht have hi := setIntegral_mono_on hfi hmi measurableSet_Ioi hmajor rw [integral_const_mul, hval] at hi refine hi.trans_eq ?_ dsimp [K] simp only [zero_sub, neg_mul, neg_neg] field_simp
Causalean.Stat.CLT.BerryEsseen.gaussian_reciprocal_linear_tail_bound · Causalean/Stat/CLT/BerryEsseen/GaussianWeightedTail.lean:18
IIDChar­Fun­Product 1 core · 0 supporting This module isolates the finite-product identity used by the scalar Berry–Esseen argument. ★ iid_sum_charFun_product

Characteristic function of an iid finite sum

This module isolates the finite-product identity used by the scalar Berry–Esseen argument. No moment bound or asymptotic assertion is needed.

theorem iid_sum_charFun_product reviewed
Causalean.Stat.CLT.BerryEsseen

Under the n-fold product of a real probability law, the characteristic function of the coordinate sum at frequency t is the n-th power of the one-coordinate characteristic function at t.

Formal statement
n :
ℕ
t :
ℝ
(∫ v : Fin n → ℝ, exp (((t * (∑ i : Fin n, v i) : ℝ) : ℂ) * I) ∂(Measure.pi (fun _ : Fin n => μ)))
= (charFun μ t) ^ n
Proof (Lean source)
theorem iid_sum_charFun_product (μ : Measure ℝ) [IsProbabilityMeasure μ] (n : ℕ) (t : ℝ) : (∫ v : Fin n → ℝ, exp (((t * (∑ i : Fin n, v i) : ℝ) : ℂ) * I) ∂(Measure.pi (fun _ : Fin n => μ))) = (charFun μ t) ^ n := by /- Identify the integral with the characteristic function of the sum law, then apply the finite-product identity, including the empty product. -/ have hsum : Measurable (fun v : Fin n → ℝ => ∑ i, v i) := by fun_prop have hchar : (∫ v : Fin n → ℝ, exp (((t * (∑ i : Fin n, v i) : ℝ) : ℂ) * I) ∂(Measure.pi (fun _ : Fin n => μ))) = charFun ((Measure.pi (fun _ : Fin n => μ)).map (fun v => ∑ i, v i)) t := by rw [charFun_apply_real, integral_map hsum.aemeasurable (by fun_prop)] congr 1 funext v congr 1 push_cast ring rw [hchar] simpa using congrFun (ProbabilityTheory.charFun_map_sum_pi_eq_prod (fun _ : Fin n => μ)) t
Causalean.Stat.CLT.BerryEsseen.iid_sum_charFun_product · Causalean/Stat/CLT/BerryEsseen/IIDCharFunProduct.lean:17
Prawitz­Abel­Limit 1 core · 0 supporting A nonsingular rational sine kernel converges to cotangent inside the unit interval. ★ prawitz_abel_weighted_integral_tendsto

Abel convergence of the weighted cotangent integral

A nonsingular rational sine kernel converges to cotangent inside the unit interval. Its multiplier relative to cotangent lies between zero and one, which supplies an integrable majorant after multiplication by the sine wave.

theorem prawitz_abel_weighted_integral_tendsto reviewed
Causalean.Stat.CLT.BerryEsseen

For any real spatial frequency x, as the damping ratio r increases to one, the triangularly weighted integrals over [0, 1] of the rational Abel kernel 2r·sin(2πt)/(1 − 2r·cos(2πt) + r²) against sin(2πxt) converge to the weighted integral of the cotangent cot(πt) against sin(2πxt).

Formal statement
x :
ℝ
Tendsto (fun r : ℝ => ∫ t in (0 : ℝ)..1, (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) (nhdsWithin 1 (Iio 1)) (𝓝 (∫ t in (0 : ℝ)..1, (1 - t) * cos (pi * t) / sin (pi * t) * sin (2 * pi * x * t)))
Proof (Lean source)
theorem prawitz_abel_weighted_integral_tendsto (x : ℝ) : Tendsto (fun r : ℝ => ∫ t in (0 : ℝ)..1, (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) (nhdsWithin 1 (Iio 1)) (𝓝 (∫ t in (0 : ℝ)..1, (1 - t) * cos (pi * t) / sin (pi * t) * sin (2 * pi * x * t))) := by /- For 0<r<1 and 0<t<1, rewrite the rational factor as cot(πt) times 4*r*sin(πt)^2 / ((1-r)^2+4*r*sin(πt)^2). This multiplier is in [0,1] and tends to one. The absolute weighted cotangent sine integrand is an integrable majorant: subtract sin(2πxt)/π from the integrand in prawitz_sine_intervalIntegrable (2πx). Endpoint values are irrelevant a.e. Use dominated convergence for the restricted interval measure and eventual 0<r<1; do not presume the undamped cotangent itself is integrable. -/ let f : ℝ → ℝ := fun t => (1 - t) * cos (pi * t) / sin (pi * t) * sin (2 * pi * x * t) have hf : IntervalIntegrable f volume 0 1 := by have h := (prawitz_sine_intervalIntegrable (2 * pi * x)).sub (show IntervalIntegrable (fun t : ℝ => sin (t * (2 * pi * x)) / pi) volume 0 1 from (show Continuous (fun t : ℝ => sin (t * (2 * pi * x)) / pi) by fun_prop).intervalIntegrable 0 1) convert h using 1 funext t dsimp [f, prawitzSineWeight] rw [show t * (2 * pi * x) = 2 * pi * x * t by ring] ring have hden (r t : ℝ) : 1 - 2 * r * cos (2 * pi * t) + r ^ 2 = (1 - r) ^ 2 + 4 * r * sin (pi * t) ^ 2 := by rw [show 2 * pi * t = 2 * (pi * t) by ring, Real.cos_two_mul_eq_one_sub] ring have hpos (r t : ℝ) (hr : 0 < r) (hr1 : r < 1) : 0 < 1 - 2 * r * cos (2 * pi * t) + r ^ 2 := by rw [hden] exact add_pos_of_pos_of_nonneg (sq_pos_of_ne_zero (by linarith)) (by positivity) have he : ∀ᶠ r : ℝ in nhdsWithin 1 (Iio 1), 0 < r ∧ r < 1 := by filter_upwards [eventually_nhdsWithin_of_eventually_nhds (eventually_gt_nhds (show (0 : ℝ) < 1 by norm_num)), self_mem_nhdsWithin] with r hr hr1 exact ⟨hr, hr1⟩ have hid (r t : ℝ) (hr : 0 < r) (hr1 : r < 1) (hs : sin (pi * t) ≠ 0) : (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t) = f t * (4 * r * sin (pi * t) ^ 2 / ((1 - r) ^ 2 + 4 * r * sin (pi * t) ^ 2)) := by rw [hden, show 2 * pi * t = 2 * (pi * t) by ring, Real.sin_two_mul] dsimp [f] field_simp ring apply intervalIntegral.tendsto_integral_filter_of_dominated_convergence (fun t => ‖f t‖) · exact Filter.Eventually.of_forall fun r => (show Measurable (fun t : ℝ => (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) by fun_prop).aestronglyMeasurable · filter_upwards [he] with r hr filter_upwards [Measure.ae_ne volume (1 : ℝ)] with t ht htmem rw [Set.uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at htmem have hs : sin (pi * t) ≠ 0 := (Real.sin_pos_of_pos_of_lt_pi (by nlinarith [Real.pi_pos, htmem.1]) (by nlinarith [Real.pi_pos, htmem.2.lt_of_ne ht])).ne' rw [hid r t hr.1 hr.2 hs, norm_mul] have hd : 0 < (1 - r) ^ 2 + 4 * r * sin (pi * t) ^ 2 := by rw [← hden]; exact hpos r t hr.1 hr.2 have hk : 0 ≤ 4 * r * sin (pi * t) ^ 2 / ((1 - r) ^ 2 + 4 * r * sin (pi * t) ^ 2) := div_nonneg (by have := hr.1; positivity) hd.le simp only [Real.norm_eq_abs, abs_of_nonneg hk] exact mul_le_of_le_one_right (abs_nonneg _) ((div_le_one hd).2 (by nlinarith)) · exact hf.norm · filter_upwards [Measure.ae_ne volume (1 : ℝ)] with t ht htmem rw [Set.uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at htmem have hs : sin (pi * t) ≠ 0 := (Real.sin_pos_of_pos_of_lt_pi (by nlinarith [Real.pi_pos, htmem.1]) (by nlinarith [Real.pi_pos, htmem.2.lt_of_ne ht])).ne' have hd : 1 - 2 * (1 : ℝ) * cos (2 * pi * t) + 1 ^ 2 ≠ 0 := by rw [hden]; simpa using mul_ne_zero (by norm_num : (4 : ℝ) ≠ 0) (pow_ne_zero 2 hs) have hc : ContinuousAt (fun r : ℝ => (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) 1 := by fun_prop (disch := exact hd) convert hc.tendsto.mono_left nhdsWithin_le_nhds using 1 congr 1 rw [hden, show 2 * pi * t = 2 * (pi * t) by ring, Real.sin_two_mul] norm_num only [sub_self, zero_pow, zero_add, mul_one] field_simp [hs] ring
Causalean.Stat.CLT.BerryEsseen.prawitz_abel_weighted_integral_tendsto · Causalean/Stat/CLT/BerryEsseen/PrawitzAbelLimit.lean:18
Prawitz­Abel­Series 1 core · 0 supporting Inside the open unit disk the geometric sine series is uniformly absolutely convergent. ★ prawitz_abel_weighted_integral_series

Termwise integration of a damped cotangent sine series

Inside the open unit disk the geometric sine series is uniformly absolutely convergent. This leaf handles that exchange separately from the boundary limit and separately from evaluation of its elementary Fourier coefficients.

theorem prawitz_abel_weighted_integral_series reviewed
Causalean.Stat.CLT.BerryEsseen

For a damping ratio r strictly between zero and one and any real frequency x, the damped triangularly weighted sine coefficients r^(n+1)·∫₀¹ (1 − t)·sin(2π(n+1)t)·sin(2πxt) dt are summable, and twice their sum equals the weighted integral of the rational Abel kernel 2r·sin(2πt)/(1 − 2r·cos(2πt) + r²) against sin(2πxt).

Formal statement
x r :
ℝ
hr :
0 < r
hr1 :
r < 1
conclusion 1
Summable (fun n : ℕ => r ^ (n + 1) * (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t)))
conclusion 2
(∫ t in (0 : ℝ)..1, (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t))
= 2 * (∑' n : ℕ, r ^ (n + 1) * (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t)))
Proof (Lean source)
theorem prawitz_abel_weighted_integral_series (x r : ℝ) (hr : 0 < r) (hr1 : r < 1) : Summable (fun n : ℕ => r ^ (n + 1) * (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t))) ∧ (∫ t in (0 : ℝ)..1, (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) = 2 * (∑' n : ℕ, r ^ (n + 1) * (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t))) := by /- Take the imaginary part of the complex geometric sum with ratio r*exp(2πit) to evaluate 2*Σ r^(n+1) sin(2π(n+1)t). Denominator positivity follows from (1-r)^2+2r(1-cos(2πt))>0. Integrate termwise on [0,1]: each weighted summand has norm at most r^(n+1), whose sum is finite. Use existing integral_tsum/DCT infrastructure. No boundary limit, reciprocal partial fraction identity, or Prawitz sign comparison may be assumed here. -/ have hgeom (a : ℝ) : HasSum (fun n : ℕ => r ^ (n + 1) * sin (((n : ℝ) + 1) * a)) (r * sin a / (1 - 2 * r * cos a + r ^ 2)) := by let q : ℂ := (r : ℂ) * exp ((a : ℂ) * I) have hq : ‖q‖ < 1 := by simpa [q, norm_mul, Complex.norm_exp_ofReal_mul_I, Real.norm_eq_abs, abs_of_pos hr] using hr1 have hp (n : ℕ) : q ^ (n + 1) = (r ^ (n + 1) : ℝ) * exp ((((n : ℝ) + 1) * a : ℝ) * I) := by dsimp [q] rw [mul_pow, ← Complex.exp_nat_mul] push_cast congr 1 simp only [mul_assoc] have h := Complex.hasSum_im ((hasSum_geometric_of_norm_lt_one hq).mul_left q) have hd : 0 < 1 - 2 * r * cos a + r ^ 2 := by have hc := Real.cos_le_one a have hrr : 0 < (1 - r) ^ 2 := sq_pos_of_ne_zero (by linarith) nlinarith have hnorm : Complex.normSq (1 - q) = 1 - 2 * r * cos a + r ^ 2 := by simp only [Complex.normSq_apply, Complex.sub_re, Complex.one_re, Complex.sub_im, Complex.one_im, q, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.exp_ofReal_mul_I_re, Complex.exp_ofReal_mul_I_im, zero_mul, add_zero, sub_zero] nlinarith [Real.sin_sq_add_cos_sq a] have hv : (q * (1 - q)⁻¹).im = r * sin a / (1 - 2 * r * cos a + r ^ 2) := by rw [← div_eq_mul_inv, Complex.div_im, hnorm] simp only [q, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.exp_ofReal_mul_I_re, Complex.exp_ofReal_mul_I_im, Complex.sub_re, Complex.one_re, Complex.sub_im, Complex.one_im, zero_mul, add_zero, sub_zero] field_simp ring rw [hv] at h convert! h using 1 funext n rw [← pow_succ', hp] rw [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero, Complex.exp_ofReal_mul_I_im] let F : ℕ → ℝ → ℝ := fun n t => r ^ (n + 1) * ((1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t)) let g : ℝ → ℝ := fun t => (1 - t) * (r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t) have hs : Summable (fun n : ℕ => r ^ (n + 1)) := (summable_geometric_of_lt_one hr.le hr1).comp_injective (fun _ _ h => Nat.add_right_cancel h) have hsum (t : ℝ) : HasSum (fun n => F n t) (g t) := by have h := (hgeom (2 * pi * t)).mul_left ((1 - t) * sin (2 * pi * x * t)) convert! h using 1 · funext n dsimp [F] rw [show 2 * pi * ((n : ℝ) + 1) * t = ((n : ℝ) + 1) * (2 * pi * t) by ring] ring · dsimp [g]; ring have hbound (n : ℕ) (t : ℝ) (ht : t ∈ Ioc (0 : ℝ) 1) : ‖F n t‖ ≤ r ^ (n + 1) := by change ‖r ^ (n + 1) * ((1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t))‖ ≤ r ^ (n + 1) simp only [norm_mul, Real.norm_eq_abs, abs_of_nonneg (pow_nonneg hr.le _)] have hw : |1 - t| ≤ 1 := by rw [abs_of_nonneg (by linarith [ht.2])]; linarith [ht.1] have hw' : |1 - t| * |sin (2 * pi * ((n : ℝ) + 1) * t)| * |sin (2 * pi * x * t)| ≤ 1 := by calc _ ≤ 1 * 1 * 1 := mul_le_mul (mul_le_mul hw (Real.abs_sin_le_one _) (abs_nonneg _) (by norm_num)) (Real.abs_sin_le_one _) (abs_nonneg _) (by norm_num) _ = 1 := by norm_num exact mul_le_of_le_one_right (pow_nonneg hr.le _) hw' have hi : HasSum (fun n => ∫ t in Ioc (0 : ℝ) 1, F n t) (∫ t in Ioc (0 : ℝ) 1, g t) := by apply hasSum_integral_of_dominated_convergence (fun n _ => r ^ (n + 1)) · intro n exact (show Continuous (F n) by dsimp [F]; fun_prop).aestronglyMeasurable · intro n filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht exact hbound n t ht · exact Filter.Eventually.of_forall fun _ => hs · exact integrableOn_const (by simp) · exact Filter.Eventually.of_forall hsum have hi' : HasSum (fun n : ℕ => r ^ (n + 1) * (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t))) (∫ t in (0 : ℝ)..1, g t) := by simpa only [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), F, integral_const_mul] using hi refine ⟨hi'.summable, ?_⟩ rw [hi'.tsum_eq, ← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_congr intro t ht dsimp [g] ring
Causalean.Stat.CLT.BerryEsseen.prawitz_abel_weighted_integral_series · Causalean/Stat/CLT/BerryEsseen/PrawitzAbelSeries.lean:21
Prawitz­Budget­Cutoffs 1 core · 0 supporting One independent sufficient estimate in the deterministic Prawitz budget. ★ prawitz_budget_cutoffs

PrawitzBudgetCutoffs

One independent sufficient estimate in the deterministic Prawitz budget. The full budget retains its original cutoffs and constant; the three integral allocations add to one and introduce no probability hypotheses.

theorem prawitz_budget_cutoffs reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ strictly between zero and one, the inner cutoff U0 = max(3/2, √(4 log(1/ρ))) is positive and no larger than the outer cutoff U = 12/(5ρ).

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
0 < U0
U0 ≤ U
Proof (Lean source)
theorem prawitz_budget_cutoffs (ρ : ℝ) (hρ : 0 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) 0 < U0 ∧ U0 ≤ U := by /- Use log(1/ρ)≤1/ρ-1, square the positive outer cutoff, and apply sqrt_le_iff. This is elementary cutoff geometry, independent of all envelope integrals. The hypothesis ρ<1 gives positivity of log(1/ρ). -/ dsimp only have hU : 0 < 12 / (5 * ρ) := by positivity refine ⟨lt_of_lt_of_le (by norm_num : (0 : ℝ) < 3 / 2) (le_max_left _ _), max_le ?_ ?_⟩ · apply (le_div_iff₀ (by positivity : 0 < 5 * ρ)).2 nlinarith · apply (Real.sqrt_le_left hU.le).2 have hlog := Real.log_le_sub_one_of_pos (by positivity : 0 < 1 / ρ) have hinv : 0 ≤ 1 / ρ := by positivity have hinv1 : 1 ≤ 1 / ρ := (le_div_iff₀ hρ).2 (by linarith) have hsquare : (12 / (5 * ρ)) ^ 2 = (144 / 25 : ℝ) * (1 / ρ) ^ 2 := by field_simp ring rw [hsquare] nlinarith [sq_nonneg (1 / ρ - 1)]
Causalean.Stat.CLT.BerryEsseen.prawitz_budget_cutoffs · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetCutoffs.lean:18
Prawitz­Budget­Gaussian 1 core · 0 supporting One independent sufficient estimate in the deterministic Prawitz budget. ★ prawitz_budget_gaussian

PrawitzBudgetGaussian

One independent sufficient estimate in the deterministic Prawitz budget. The full budget retains its original cutoffs and constant; the three integral allocations add to one and introduce no probability hypotheses.

theorem prawitz_budget_gaussian reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ strictly between zero and one, with cutoffs U0 = max(3/2, √(4 log(1/ρ))) and U = 12/(5ρ) and K the Prawitz filter, the Gaussian principal correction 2·∫ over [0, U0] of |K(t/U)/U − i/(2πt)|·exp(−t²/2), plus the omitted Gaussian tail (1/π)·∫ over t > U0 of exp(−t²/2)/t, is at most three fifths of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2)))
+ (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t)
≤ 3 * ρ / 5
Proof (Lean source)
theorem prawitz_budget_gaussian (ρ : ℝ) (hρ : 0 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) + (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t) ≤ 3 * ρ / 5 := by /- Separate the principal-correction integral and Gaussian tail. The closed kernel lemma gives correction≤1/(2U) a.e.; integrate the Gaussian to get ≤sqrt(π/2)/U, which is <(8/15)ρ. It is enough to show the remaining tail≤ρ/15. For U0=max(3/2,sqrt(4log(1/ρ))), bound ∫_U0^∞ exp(-t²/2)/t by exp(-U0²/2)/U0², splitting at ρ=exp(-9/16); if this coarse estimate is insufficient near that point, sharpen the tail via integration by parts or a rational exponential bound. All integrability claims must be proved, not inferred from total integrals. -/ dsimp only let a := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) have ha : (3 / 2 : ℝ) ≤ a := le_max_left _ _ have hapos : 0 < a := by linarith have hU : 0 < U := by dsimp [U]; positivity have hprincipal := gaussian_correction_integral_le U a hU hapos.le have hsqrt : sqrt (pi / (1 / 2)) ≤ 64 / 25 := by apply (Real.sqrt_le_left (by norm_num : (0 : ℝ) ≤ 64 / 25)).mpr linarith [Real.pi_lt_d2] have hprincipal' : 2 * (∫ t in (0 : ℝ)..a, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) ≤ (8 / 15 : ℝ) * ρ := by calc _ ≤ sqrt (pi / (1 / 2)) / (2 * U) := hprincipal _ ≤ (64 / 25 : ℝ) / (2 * U) := div_le_div_of_nonneg_right hsqrt (by positivity) _ = _ := by dsimp [U]; field_simp; ring have hlogpos : 0 ≤ 4 * log (1 / ρ) := by have hinv : 1 ≤ 1 / ρ := (le_div_iff₀ hρ).mpr (by linarith) exact mul_nonneg (by norm_num) (Real.log_nonneg hinv) have hcut : 4 * log (1 / ρ) ≤ a ^ 2 := by have hroot := le_max_right (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) have hsq := Real.sq_sqrt hlogpos have hn := Real.sqrt_nonneg (4 * log (1 / ρ)) dsimp [a] nlinarith have hlog : log ρ = -log (1 / ρ) := by rw [one_div, Real.log_inv, neg_neg] have hexp : exp (-(a ^ 2 / 2)) ≤ ρ * exp (-(a ^ 2 / 4)) := by rw [← Real.exp_log hρ, ← Real.exp_add] apply Real.exp_le_exp.mpr rw [hlog] linarith have hsmall : exp (-(a ^ 2 / 4)) ≤ 3 / 5 := by have hseries := Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 9 / 16) 3 norm_num [Finset.sum_range_succ] at hseries have hlower : (5 / 3 : ℝ) ≤ exp (9 / 16) := by linarith have hneg : exp (-(9 / 16 : ℝ)) ≤ 3 / 5 := by rw [Real.exp_neg] rw [← one_div] exact (div_le_iff₀ (Real.exp_pos _)).mpr (by linarith) exact (Real.exp_le_exp.mpr (by nlinarith)).trans hneg have htail := (gaussian_tail_le a (by linarith)).2 have hden : 0 < a ^ 2 + 1 := by positivity have htail' : (1 / pi) * (∫ t in Ioi a, exp (-(t ^ 2 / 2)) / t) ≤ ρ / 15 := by have hnum : exp (-(a ^ 2 / 2)) ≤ ρ * (3 / 5) := hexp.trans (mul_le_mul_of_nonneg_left hsmall hρ.le) calc _ ≤ (1 / pi) * (exp (-(a ^ 2 / 2)) / (a ^ 2 + 1)) := mul_le_mul_of_nonneg_left htail (by positivity) _ ≤ (1 / pi) * ((ρ * (3 / 5)) / (a ^ 2 + 1)) := mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hnum hden.le) (by positivity) _ ≤ ρ / 15 := by rw [one_div_mul_eq_div, div_div, mul_comm (a ^ 2 + 1) pi] apply (div_le_iff₀ (mul_pos Real.pi_pos hden)).mpr have hsq : (13 / 4 : ℝ) ≤ a ^ 2 + 1 := by nlinarith have hp : (9 : ℝ) ≤ pi * (a ^ 2 + 1) := by nlinarith [Real.pi_gt_three] nlinarith change _ + (1 / pi) * (∫ t in Ioi a, exp (-(t ^ 2 / 2)) / t) ≤ _ change 2 * (∫ t in (0 : ℝ)..a, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) + _ ≤ _ linarith
Causalean.Stat.CLT.BerryEsseen.prawitz_budget_gaussian · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetGaussian.lean:183 · uses prawitzKernel
Prawitz­Budget­High 1 core · 0 supporting One independent sufficient estimate in the deterministic Prawitz budget. ★ prawitz_budget_high

PrawitzBudgetHigh

One independent sufficient estimate in the deterministic Prawitz budget. The full budget retains its original cutoffs and constant; the three integral allocations add to one and introduce no probability hypotheses.

theorem prawitz_budget_high reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ strictly between zero and one, with cutoffs U0 = max(3/2, √(4 log(1/ρ))) and U = 12/(5ρ), the high-frequency contribution (2/U)·∫ over [U0, U] of the Prawitz filter magnitude at t/U times the characteristic-function moment envelope is at most three twentieths of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20
Proof (Lean source)
theorem prawitz_budget_high (ρ : ℝ) (hρ : 0 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20 := by by_cases hsmall : ρ ≤ 1 / 100 · exact prawitz_budget_high_small ρ hρ hsmall · exact prawitz_budget_high_compact ρ (lt_of_not_ge hsmall) hρ1
Prawitz­Budget­High­Compact 1 core · 0 supporting This independent deterministic certificate keeps the cubic damping and the actual kernel above ratio one hundredth. ★ prawitz_budget_high_compact

High-frequency Prawitz allocation on the complementary ratio interval

This independent deterministic certificate keeps the cubic damping and the actual kernel above ratio one hundredth. Combining it with the small-ratio assembly proves the unchanged full high-frequency allocation.

theorem prawitz_budget_high_compact reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ above one hundredth and below one, with cutoffs U0 = max(3/2, √(4 log(1/ρ))) and U = 12/(5ρ), the high-frequency Prawitz contribution (2/U)·∫ over [U0, U] of the Prawitz filter magnitude at t/U times the moment envelope is at most three twentieths of ρ.

Formal statement
ρ :
ℝ
hlarge :
1 / 100 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20
Proof (Lean source)
theorem prawitz_budget_high_compact (ρ : ℝ) (hlarge : 1 / 100 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20 := by /- Round 9 ground truth: all real adapters and finite arithmetic certificates are CLOSED. Assemble the actual moving-band integral. Locate rho with prawitz_compact_parameter_cell_exists and set r=left(j), s=right(j), I=highCutoffIndex(j), A=I/1000, U=12/(5*rho). The cutoff certificate gives 0<r<s<=1 and 1<=I<1000; the real cutoff adapter gives U*A<=U0. prawitz_budget_cutoffs supplies U0<=U. The high interval-integrability helper applies on [U*A,U]. Extend the original integral down to U*A using nonnegativity. Telescope using intervalIntegral.sum_integral_adjacent_intervals_Ico with endpoints a(i)=U*((i:Real)/1000) and indices Ico I 1000. For each i use prawitz_high_rescaled_lower_cell_integral_bound if i<500 and prawitz_high_rescaled_upper_cell_integral_bound otherwise. The half-band is exactly the i=500 grid endpoint. Compose prawitz_high_real_kernel_square_enclosure with the CLOSED prawitz_kernel_rational_square_certificate, cast to Real, and use Real.sqrt_le_iff or Real.sqrt_le_sqrt to enclose sqrt(Q) by kernelMagnitudeIndex(i)/1000000 (nonnegative by its Nat type). Compose min_le_right with prawitz_high_real_exponential_enclosure. Since b-a=1/1000, the product casts exactly to prawitzRationalHighCell. Apply Int.le_ceil to outward-round every cell, cast and sum, then use prawitz_high_rational_sum_certificate j (raw integral <=9/50). Multiply by 2/U=5*rho/6 to obtain 3*rho/20. Retain cubic damping and the original assigned outer kernel value: the upper-cell proof already excludes t=U only almost everywhere. Do not modify tables, constants, cutoffs, or hypotheses; do not import either full budget or BerryEsseenUnit. This file is independent of the low assembly. New private proof helpers may live here. -/ classical dsimp only let U := 12 / (5 * ρ) let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) have hρ : 0 < ρ := by linarith have hU : 0 < U := by dsimp [U]; positivity obtain ⟨j, hrρ, hρs⟩ := prawitz_compact_parameter_cell_exists ρ hlarge.le hρ1.le let r : ℝ := prawitzCompactLeft j.val let s : ℝ := prawitzCompactRight j.val let I := prawitzHighCutoffIndex j.val let a (i : ℕ) : ℝ := (i : ℝ) / 1000 let f (t : ℝ) := ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t have hc := prawitz_compact_cutoff_rational_certificate j have hr : 0 < r := by exact Rat.cast_pos.mpr hc.1 have hI : 1 ≤ I := hc.2.2.2.2.2.1 have hIlt : I < 1000 := hc.2.2.2.2.2.2.1 have ha_pos (i : ℕ) (hi : 1 ≤ i) : 0 < a i := by dsimp [a] exact div_pos (by exact_mod_cast hi) (by norm_num) have ha_mono (i : ℕ) : a i ≤ a (i + 1) := by dsimp [a]; push_cast; linarith have ha_one (i : ℕ) (hi : i < 1000) : a (i + 1) ≤ 1 := by have hn : (i : ℝ) + 1 ≤ 1000 := by exact_mod_cast (by omega : i + 1 ≤ 1000) dsimp [a]; push_cast; linarith have hstart : U * a I ≤ U0 := (prawitz_compact_real_cutoff_enclosures j ρ hrρ hρs).2.2 have hend : U0 ≤ U := (prawitz_budget_cutoffs ρ hρ hρ1).2 have hi_full := prawitz_high_compact_intervalIntegrable ρ U (U * a I) U hU (mul_pos hU (ha_pos I hI)) (hstart.trans hend) le_rfl have hi_cell (i : ℕ) (hi : i ∈ Ico I 1000) : IntervalIntegrable f volume (U * a i) (U * a (i + 1)) := by obtain ⟨hil, hiu⟩ := Finset.mem_Ico.mp hi exact prawitz_high_compact_intervalIntegrable ρ U _ _ hU (mul_pos hU (ha_pos i (hI.trans hil))) (mul_le_mul_of_nonneg_left (ha_mono i) hU.le) (by simpa using mul_le_mul_of_nonneg_left (ha_one i hiu) hU.le) have cell_bound (i : ℕ) (hi : i ∈ Ico I 1000) : (∫ t in (U * a i)..(U * a (i + 1)), f t) ≤ (prawitzRationalHighCell j.val i : ℝ) := by obtain ⟨hil, hiu⟩ := Finset.mem_Ico.mp hi have hi' : i ∈ Ico 1 1000 := Finset.mem_Ico.mpr ⟨hI.trans hil, hiu⟩ let Q := if i < 500 then (1 - a i) ^ 2 / 4 + (((1 - a i) * (1 - (pi * a i) ^ 2 / 2 + (pi * a (i + 1)) ^ 4 / 24) / (pi * a i * (1 - (pi * a (i + 1)) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 else (1 - a i) ^ 2 / 4 + pi ^ 2 * (1 - a i) ^ 4 / 16 let E := max ((-72 * a i ^ 2 / 25 + 1728 * a i ^ 3 / 625) / s ^ 2) ((-72 * a (i + 1) ^ 2 / 25 + 1728 * a (i + 1) ^ 3 / 625) / s ^ 2) have hmag : 0 ≤ (prawitzKernelMagnitudeIndex i : ℝ) / 1000000 := div_nonneg (Nat.cast_nonneg _) (by norm_num) have hk : sqrt Q ≤ (prawitzKernelMagnitudeIndex i : ℝ) / 1000000 := by apply (Real.sqrt_le_left hmag).2 have hsquare : (prawitzRationalKernelSq i : ℝ) ≤ ((prawitzKernelMagnitudeIndex i : ℝ) / 1000000) ^ 2 := by have hh := Rat.cast_le (K := ℝ) |>.mpr (prawitz_kernel_rational_square_certificate i hi') simpa only [Rat.cast_pow, Rat.cast_div, Rat.cast_natCast, Rat.cast_ofNat] using hh exact (prawitz_high_real_kernel_square_enclosure i hi').trans hsquare let e : ℚ := min (72 * ((i : ℚ) / 1000) ^ 2 / 25 - 1728 * ((i : ℚ) / 1000) ^ 3 / 625) (72 * (((i + 1 : ℕ) : ℚ) / 1000) ^ 2 / 25 - 1728 * (((i + 1 : ℕ) : ℚ) / 1000) ^ 3 / 625) / (prawitzCompactRight j.val) ^ 2 have he : min 1 (exp E) ≤ ((1 / prawitzTaylor16 e : ℚ) : ℝ) := (min_le_right _ _).trans (prawitz_high_real_exponential_enclosure j i hi') have hraw : (∫ t in (U * a i)..(U * a (i + 1)), f t) ≤ (12 / (5 * r)) * (a (i + 1) - a i) * sqrt Q * min 1 (exp E) := by by_cases hhalf : i < 500 · have hb : a (i + 1) ≤ 1 / 2 := by have hn : (i : ℝ) + 1 ≤ 500 := by exact_mod_cast (by omega : i + 1 ≤ 500) dsimp [a]; push_cast; linarith simpa only [Q, if_pos hhalf] using prawitz_high_rescaled_lower_cell_integral_bound ρ r s (a i) (a (i + 1)) hr hrρ hρs (ha_pos i (hI.trans hil)) (ha_mono i) hb · have ha : 1 / 2 ≤ a i := by have hn : (500 : ℝ) ≤ i := by exact_mod_cast (by omega : 500 ≤ i) dsimp [a]; linarith simpa only [Q, if_neg hhalf] using prawitz_high_rescaled_upper_cell_integral_bound ρ r s (a i) (a (i + 1)) hr hrρ hρs ha (ha_mono i) (ha_one i hiu) have hwidth : a (i + 1) - a i = 1 / 1000 := by dsimp [a]; push_cast; ring calc _ ≤ _ := hraw _ ≤ (12 / (5 * r)) * (a (i + 1) - a i) * ((prawitzKernelMagnitudeIndex i : ℝ) / 1000000) * ((1 / prawitzTaylor16 e : ℚ) : ℝ) := by have hcoeff : 0 ≤ (12 / (5 * r)) * (a (i + 1) - a i) := by rw [hwidth] positivity apply mul_le_mul _ he (le_min (by norm_num) (Real.exp_pos E).le) (mul_nonneg hcoeff hmag) exact mul_le_mul_of_nonneg_left hk hcoeff _ = _ := by rw [hwidth] change (12 / (5 * r)) * (1 / 1000) * ((prawitzKernelMagnitudeIndex i : ℝ) / 1000000) * ((1 / prawitzTaylor16 e : ℚ) : ℝ) = (((12 / (5 * prawitzCompactLeft j.val)) * (1 / 1000) * ((prawitzKernelMagnitudeIndex i : ℚ) / 1000000) / prawitzTaylor16 e : ℚ) : ℝ) simp only [Rat.cast_div, Rat.cast_mul, Rat.cast_natCast, Rat.cast_ofNat, Rat.cast_one] dsimp only [r] ring have hround (i : ℕ) : (prawitzRationalHighCell j.val i : ℝ) ≤ (prawitzRoundUp (prawitzRationalHighCell j.val i) : ℝ) := by exact Rat.cast_le.mpr (prawitz_le_roundUp _) have hraw_total : (∫ t in U0..U, f t) ≤ 9 / 50 := by calc _ ≤ ∫ t in (U * a I)..U, f t := by apply intervalIntegral.integral_mono_interval hstart hend le_rfl _ hi_full exact Filter.Eventually.of_forall (fun t => mul_nonneg (norm_nonneg _) (by unfold prawitzMomentEnvelope; positivity)) _ = ∑ i ∈ Ico I 1000, ∫ t in (U * a i)..(U * a (i + 1)), f t := by simpa only [a, Nat.cast_ofNat, div_self (by norm_num : (1000 : ℝ) ≠ 0), mul_one] using (intervalIntegral.sum_integral_adjacent_intervals_Ico (a := fun i => U * a i) hIlt.le (fun i hi => hi_cell i (Finset.mem_Ico.mpr hi))).symm _ ≤ ∑ i ∈ Ico I 1000, (prawitzRoundUp (prawitzRationalHighCell j.val i) : ℝ) := Finset.sum_le_sum (fun i hi => (cell_bound i hi).trans (hround i)) _ = (prawitzRationalHighSum j.val : ℝ) := by simp [prawitzRationalHighSum, I] _ ≤ 9 / 50 := by have hh := Rat.cast_le (K := ℝ) |>.mpr (prawitz_high_rational_sum_certificate j) simpa only [Rat.cast_div, Rat.cast_ofNat] using hh have hfactor : 2 / U = 5 * ρ / 6 := by dsimp [U]; field_simp; ring change (2 / U) * (∫ t in U0..U, f t) ≤ 3 * ρ / 20 rw [hfactor] calc _ ≤ (5 * ρ / 6) * (9 / 50) := mul_le_mul_of_nonneg_left hraw_total (by positivity) _ = _ := by ring
Causalean.Stat.CLT.BerryEsseen.prawitz_budget_high_compact · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetHighCompact.lean:24 · uses prawitzKernel , prawitzMomentEnvelope
Prawitz­Budget­High­Small 1 core · 0 supporting This assembly lemma splits at the reciprocal-ratio cutoff and applies the two independently proved weighted Gaussian tails. ★ prawitz_budget_high_small

High-frequency Prawitz allocation at small moment ratios

This assembly lemma splits at the reciprocal-ratio cutoff and applies the two independently proved weighted Gaussian tails. The complementary ratio interval and the unchanged full high-frequency budget are separate modules.

theorem prawitz_budget_high_small reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive moment ratio ρ at most one hundredth, with the logarithmic inner cutoff U0 = max(3/2, √(4 log(1/ρ))) and the reciprocal outer cutoff U = 12/(5ρ), the high-frequency Prawitz contribution (2/U)·∫ over [U0, U] of the Prawitz filter magnitude at t/U times the moment envelope is at most three twentieths of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hsmall :
ρ ≤ 1 / 100
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20
Proof (Lean source)
theorem prawitz_budget_high_small (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ ≤ 1 / 100) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20 := by /- All imported analytic leaves are closed. Prove U0<=A<=U for A=1/(2*rho), using the same log bound as the low small case. On the middle interval rho*t<=1/2 implies damping <=exp(-2*t^2/5). On the far interval t<=U implies damping <=exp(-t^2/50). The scaled kernel bound in both cases is 1/(pi*t)+5*rho/12. Integrability here follows from measurability and continuous majorants away from zero. Split the interval integral at A. Bound the middle integral by gaussian_reciprocal_linear_tail_bound at a=U0, b=2/5, c=5*rho/12, using nonnegative integral restriction. Since U0^2>=4*log(1/rho), its exponential is <=rho*sqrt(rho) (weaken the exponent -8log(1/rho)/5 to -3log(1/rho)/2). Combine U0>=3/2, sqrt(rho)<=1/10, pi>3 to obtain a middle allocation <=rho/20. The independently proved far bound is <=rho/20. These bounds leave slack inside the required 3*rho/20 allocation. Prove every tail/interval integrability premise before comparison. This module must not import either full or complementary high budget theorem. -/ dsimp only let a := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let A := 1 / (2 * ρ) let U := 12 / (5 * ρ) let f := fun t => (2 / U) * (‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) have ha0 : (3 / 2 : ℝ) ≤ a := le_max_left _ _ have ha : 0 < a := by linarith have hAp : 0 < A := by dsimp [A]; positivity have hUp : 0 < U := by dsimp [U]; positivity have hi100 : (100 : ℝ) ≤ 1 / ρ := (le_div_iff₀ hρ).2 (by linarith) have hlog : 0 ≤ log (1 / ρ) := Real.log_nonneg (by linarith) have haA : a ≤ A := by apply max_le · dsimp [A] apply (le_div_iff₀ (by positivity : 0 < 2 * ρ)).2 linarith · apply (Real.sqrt_le_left hAp.le).2 have hl := Real.log_le_sub_one_of_pos (by positivity : 0 < 1 / ρ) have he : A ^ 2 = (1 / ρ) ^ 2 / 4 := by dsimp [A]; field_simp; norm_num rw [he] have hq := mul_nonneg (show 0 ≤ 1 / ρ by positivity) (show 0 ≤ 1 / ρ - 100 by linarith) nlinarith have hAU : A ≤ U := by dsimp [A, U] apply (div_le_div_iff₀ (by positivity) (by positivity)).2 nlinarith have hasq : 4 * log (1 / ρ) ≤ a ^ 2 := by have hs : sqrt (4 * log (1 / ρ)) ≤ a := le_max_right _ _ have hsq := pow_le_pow_left₀ (Real.sqrt_nonneg _) hs 2 rw [Real.sq_sqrt (by positivity)] at hsq exact hsq have hdmid : ∀ t ∈ Icc a A, -(t ^ 2 / 2) + ρ * t ^ 3 / 5 ≤ -((2 / 5 : ℝ) * t ^ 2) := by intro t ht have hrt : ρ * t ≤ 1 / 2 := by have hh := (le_div_iff₀ (by positivity : 0 < 2 * ρ)).1 ht.2 nlinarith have hh := mul_le_mul_of_nonneg_right hrt (sq_nonneg t) nlinarith have hdfar : ∀ t ∈ Icc A U, -(t ^ 2 / 2) + ρ * t ^ 3 / 5 ≤ -((1 / 50 : ℝ) * t ^ 2) := by intro t ht have hrt : ρ * t ≤ 12 / 5 := by have hh := (le_div_iff₀ (by positivity : 0 < 5 * ρ)).1 ht.2 nlinarith have hh := mul_le_mul_of_nonneg_right hrt (sq_nonneg t) nlinarith obtain ⟨hfmid, hmid⟩ := scaled_integral_comparison ρ U a A (2 / 5) hρ rfl ha haA hAU (by norm_num) hdmid obtain ⟨hffar, hfar⟩ := scaled_integral_comparison ρ U A U (1 / 50) hρ rfl hAp hAU le_rfl (by norm_num) hdfar have hgi := weighted_tail_integrable a (2 / 5) (5 * ρ / 12) ha (by norm_num) (by positivity) have hrestrict : (∫ t in a..A, (1 / (pi * t) + 5 * ρ / 12) * exp (-((2 / 5 : ℝ) * t ^ 2))) ≤ (∫ t in Ioi a, (1 / (pi * t) + 5 * ρ / 12) * exp (-((2 / 5 : ℝ) * t ^ 2))) := by rw [intervalIntegral.integral_of_le haA] refine setIntegral_mono_set hgi ?_ (Filter.Eventually.of_forall ?_) · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have htpos : 0 < t := ha.trans ht positivity · intro t ht exact ht.1 have htail := gaussian_reciprocal_linear_tail_bound a (2 / 5) (5 * ρ / 12) ha (by norm_num) (by positivity) have hexp : exp (-((2 / 5 : ℝ) * a ^ 2)) ≤ ρ * sqrt ρ := by have hle : -((2 / 5 : ℝ) * a ^ 2) ≤ log ρ + log ρ / 2 := by have hl : log (1 / ρ) = -log ρ := by rw [one_div, Real.log_inv] rw [hl] at hasq hlog nlinarith calc _ ≤ exp (log ρ + log ρ / 2) := Real.exp_le_exp.mpr hle _ = ρ * sqrt ρ := by rw [Real.exp_add, Real.exp_half, Real.exp_log hρ] have hcoef : 1 / (2 * pi * (2 / 5) * a ^ 2) + (5 * ρ / 12) / (2 * (2 / 5) * a) ≤ 1 / 2 := by have hrec : 1 / (2 * pi * (2 / 5) * a ^ 2) ≤ (1 / 4 : ℝ) := by apply (div_le_iff₀ (by positivity)).2 have hsq : (9 / 4 : ℝ) ≤ a ^ 2 := by nlinarith have hh := mul_le_mul_of_nonneg_right Real.pi_gt_three.le (sq_nonneg a) nlinarith have hc : (5 * ρ / 12) / (2 * (2 / 5) * a) ≤ (1 / 4 : ℝ) := by apply (div_le_iff₀ (by positivity)).2 nlinarith linarith have hsqrt : sqrt ρ ≤ (1 / 10 : ℝ) := (Real.sqrt_le_left (by norm_num)).2 (by nlinarith) have hmidalloc : (∫ t in a..A, f t) ≤ ρ / 20 := by have hh := hmid.trans (hrestrict.trans htail) have hcpos : 0 ≤ 1 / (2 * pi * (2 / 5) * a ^ 2) + (5 * ρ / 12) / (2 * (2 / 5) * a) := by positivity have hp := mul_le_mul hcoef hexp (Real.exp_nonneg _) (by norm_num : (0 : ℝ) ≤ 1 / 2) have hs := mul_le_mul_of_nonneg_left hsqrt hρ.le change (∫ t in a..A, f t) ≤ _ at hh nlinarith have hfaralloc : (∫ t in A..U, f t) ≤ ρ / 20 := by have hh := prawitz_far_gaussian_tail_budget ρ hρ hsmall have he : ∀ t : ℝ, exp (-((1 / 50 : ℝ) * t ^ 2)) = exp (-(t ^ 2 / 50)) := by intro t congr 1 ring simp_rw [he] at hfar exact hfar.trans hh have hsplit := intervalIntegral.integral_add_adjacent_intervals hfmid hffar change (∫ t in a..A, f t) + (∫ t in A..U, f t) = (∫ t in a..U, f t) at hsplit change (2 / U) * (∫ t in a..U, ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ 3 * ρ / 20 rw [← intervalIntegral.integral_const_mul] change (∫ t in a..U, f t) ≤ _ rw [← hsplit] linarith
Causalean.Stat.CLT.BerryEsseen.prawitz_budget_high_small · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetHighSmall.lean:125 · uses prawitzKernel , prawitzMomentEnvelope
Prawitz­Budget­Low 1 core · 0 supporting One independent sufficient estimate in the deterministic Prawitz budget. ★ prawitz_budget_low

PrawitzBudgetLow

One independent sufficient estimate in the deterministic Prawitz budget. The full budget retains its original cutoffs and constant; the three integral allocations add to one and introduce no probability hypotheses.

theorem prawitz_budget_low reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ strictly between zero and one, with cutoffs U0 = max(3/2, √(4 log(1/ρ))) and U = 12/(5ρ), the low-frequency Fourier discrepancy contribution (2/U)·∫ over [0, U0] of the Prawitz filter magnitude at t/U times the discrepancy envelope is at most one quarter of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t)
≤ ρ / 4
Proof (Lean source)
theorem prawitz_budget_low (ρ : ℝ) (hρ : 0 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) ≤ ρ / 4 := by by_cases hsmall : ρ ≤ 1 / 100 · exact prawitz_budget_low_small ρ hρ hsmall · exact prawitz_budget_low_compact ρ (lt_of_not_ge hsmall) hρ1
Prawitz­Budget­Low­Compact 1 core · 3 supporting This independent deterministic certificate retains the actual minimum discrepancy envelope and kernel on ratios above one hundredth. ★ prawitz_budget_low_compact

Low-frequency Prawitz allocation on the complementary ratio interval

This independent deterministic certificate retains the actual minimum discrepancy envelope and kernel on ratios above one hundredth. Together with the small-ratio assembly it proves the unchanged full low-frequency budget.

theorem prawitz_budget_low_compact reviewed
Causalean.Stat.CLT.BerryEsseen

For a moment ratio ρ above one hundredth and below one, with cutoffs U0 = max(3/2, √(4 log(1/ρ))) and U = 12/(5ρ), the low-frequency Prawitz contribution (2/U)·∫ over [0, U0] of the Prawitz filter magnitude at t/U times the minimum discrepancy envelope is at most one quarter of ρ.

Formal statement
ρ :
ℝ
hlarge :
1 / 100 < ρ
hρ1 :
ρ < 1
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t)
≤ ρ / 4
Proof (Lean source)
theorem prawitz_budget_low_compact (ρ : ℝ) (hlarge : 1 / 100 < ρ) (hρ1 : ρ < 1) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) ≤ ρ / 4 := by /- Round 9 ground truth: every analytic and rational prerequisite below is proved. This is now an integral assembly, not a new numerical search. Locate rho with prawitz_compact_parameter_cell_exists and write r=left(j), s=right(j), K=lowCutoffIndex(j), B=K/200, U=12/(5*rho). The cutoff certificate gives 0<r<s<=1 and 300<=K<=859. The real cutoff adapter gives U0<=B<=U. Use the low interval-integrability helper on [0,B]; nonnegativity of the discrepancy envelope justifies extending the integral from U0 to B (integral_mono_interval or adjacent integrals). Split [0,B] into [0,1/200] and the cells indexed by Ico 1 K, using intervalIntegral.sum_integral_adjacent_intervals_Ico with endpoints a(i)=(i:Real)/200. Integrability for each cell follows by restricting the proved integrability on [0,B]. The initial integral bound and prawitz_low_real_initial_enclosure compare the normalized (5/6)*integral to prawitzRationalLowInitial. For positive cells use prawitz_low_compact_endpoint_cell_integral_bound, then the CLOSED prawitz_low_real_cell_enclosure; the older independent-endpoint cell bound above is too loose for the unchanged table. Keep the maximum endpoint cubic exponent and the minimum discrepancy branch. Enclose each rational entry by prawitzRoundUp via Int.le_ceil, cast the sum, and apply prawitz_low_rational_sum_certificate j (<=1/4). Finally 2/U=5*rho/6 converts the normalized integral bound to rho/4. Do not modify tables, cutoffs, constants, rates, or hypotheses; do not import either full budget or BerryEsseenUnit. This file is independent of the high compact assembly. New private proof helpers may live here. -/ dsimp only have hρ : 0 < ρ := by linarith obtain ⟨j, hrρ, hρs⟩ := prawitz_compact_parameter_cell_exists ρ hlarge.le hρ1.le rcases prawitz_compact_cutoff_rational_certificate j with ⟨hrQ, hrsQ, hsQ, hK, _, _, _, _, _, _⟩ let r : ℝ := prawitzCompactLeft j.val let s : ℝ := prawitzCompactRight j.val let K := prawitzLowCutoffIndex j.val let a : ℕ → ℝ := fun i => (i : ℝ) / 200 let U := 12 / (5 * ρ) let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let f : ℝ → ℝ := fun t => ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t have hr : 0 < r := by dsimp only [r] exact_mod_cast hrQ have hs : s ≤ 1 := by dsimp only [s] exact_mod_cast hsQ have hK1 : 1 ≤ K := by dsimp [K]; omega have hU : 0 < U := by dsimp [U]; positivity have hU00 : 0 ≤ U0 := by dsimp [U0] exact le_trans (by norm_num) (le_max_left _ _) obtain ⟨hU0B, hBU, _⟩ := prawitz_compact_real_cutoff_enclosures j ρ hrρ hρs change U0 ≤ a K at hU0B change a K ≤ U at hBU have ha0 (i : ℕ) : 0 ≤ a i := by dsimp [a]; positivity have hamono {i k : ℕ} (hik : i ≤ k) : a i ≤ a k := by dsimp [a] exact div_le_div_of_nonneg_right (by exact_mod_cast hik) (by norm_num) have hiB : IntervalIntegrable f volume 0 (a K) := prawitz_low_compact_intervalIntegrable ρ U (a K) hρ.le hU (ha0 K) hBU have higrid (i : ℕ) (hi : i ≤ K) : IntervalIntegrable f volume 0 (a i) := prawitz_low_compact_intervalIntegrable ρ U (a i) hρ.le hU (ha0 i) ((hamono hi).trans hBU) have hf0 (t : ℝ) : 0 ≤ f t := by dsimp [f] apply mul_nonneg (norm_nonneg _) unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity have hext : (∫ t in (0 : ℝ)..U0, f t) ≤ ∫ t in (0 : ℝ)..a K, f t := intervalIntegral.integral_mono_interval le_rfl hU00 hU0B (Filter.Eventually.of_forall hf0) hiB have hinitial : (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..a 1, f t) ≤ (prawitzRoundUp (prawitzRationalLowInitial j.val) : ℝ) := by have haU : (1 / 200 : ℝ) ≤ U := by simpa only [a, Nat.cast_one] using (hamono hK1).trans hBU have hsa : s * (1 / 200 : ℝ) ≤ 5 / 2 := by nlinarith [hs] simpa only [a, Nat.cast_one, f, U] using (prawitz_low_compact_initial_integral_bound ρ s (1 / 200) hρ hρs (by norm_num) haU hsa).trans ((prawitz_low_real_initial_enclosure j).trans (Rat.cast_le.mpr (prawitz_le_roundUp _))) have hcells (i : ℕ) (hi : i ∈ Ico 1 K) : (5 / 6 : ℝ) * (∫ t in a i..a (i + 1), f t) ≤ (prawitzRoundUp (prawitzRationalLowCell j.val i) : ℝ) := by have hi1 := (Finset.mem_Ico.mp hi).1 have hiK : i + 1 ≤ K := by have := (Finset.mem_Ico.mp hi).2; omega have hai : 0 < a i := by dsimp [a]; positivity exact (prawitz_low_compact_endpoint_cell_integral_bound ρ r s (a i) (a (i + 1)) hr hrρ hρs hai (hamono (by omega)) ((hamono hiK).trans hBU)).trans ((prawitz_low_real_cell_enclosure j i hi).trans (Rat.cast_le.mpr (prawitz_le_roundUp _))) have htel : (∑ i ∈ Ico 1 K, ∫ t in a i..a (i + 1), f t) = ∫ t in a 1..a K, f t := by apply intervalIntegral.sum_integral_adjacent_intervals_Ico hK1 intro i hi have hiK : i + 1 ≤ K := by have := hi.2; omega exact (higrid i (by omega)).symm.trans (higrid (i + 1) hiK) have hsplit : (∫ t in (0 : ℝ)..a K, f t) = (∫ t in (0 : ℝ)..a 1, f t) + ∑ i ∈ Ico 1 K, ∫ t in a i..a (i + 1), f t := by rw [htel] exact (intervalIntegral.integral_add_adjacent_intervals (higrid 1 hK1) ((higrid 1 hK1).symm.trans hiB)).symm have hnormalized : (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..a K, f t) ≤ 1 / 4 := by calc _ = (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..a 1, f t) + ∑ i ∈ Ico 1 K, (5 / 6 : ℝ) * (∫ t in a i..a (i + 1), f t) := by rw [hsplit, mul_add, Finset.mul_sum] _ ≤ (prawitzRoundUp (prawitzRationalLowInitial j.val) : ℝ) + ∑ i ∈ Ico 1 K, (prawitzRoundUp (prawitzRationalLowCell j.val i) : ℝ) := add_le_add hinitial (Finset.sum_le_sum hcells) _ = (prawitzRationalLowSum j.val : ℝ) := by simp only [prawitzRationalLowSum, Rat.cast_add, Rat.cast_sum, K] _ ≤ 1 / 4 := by simpa only [Rat.cast_div, Rat.cast_ofNat, Rat.cast_one] using (show (prawitzRationalLowSum j.val : ℝ) ≤ ((1 / 4 : ℚ) : ℝ) from Rat.cast_le.mpr (prawitz_low_rational_sum_certificate j)) have hnormalized0 : (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..U0, f t) ≤ 1 / 4 := (mul_le_mul_of_nonneg_left hext (by norm_num)).trans hnormalized change (2 / U) * (∫ t in (0 : ℝ)..U0, f t) ≤ ρ / 4 have hscale : 2 / U = ρ * (5 / 6) := by dsimp [U]; field_simp; ring rw [hscale, mul_assoc] calc _ ≤ ρ * (1 / 4) := mul_le_mul_of_nonneg_left hnormalized0 hρ.le _ = ρ / 4 := by ring
3 supporting declarations (lemmas, instances)
  • prawitz_low_compact_cell_bound theorem — On a positive parameter cell and a positive frequency cell inside the original kernel band, the normalized low-frequency integrand is bounded by the better of the Taylor and modulus-sum cell bounds.
    ρ r s t a b :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 < a
    hat :
    a ≤ t
    htb :
    t ≤ b
    htU :
    t ≤ 12 / (5 * ρ)
    (5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t
    ≤ (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10)) ((min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r)
    Proof (Lean source)
    theorem prawitz_low_compact_cell_bound (ρ r s t a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hat : a ≤ t) (htb : t ≤ b) (htU : t ≤ 12 / (5 * ρ)) : (5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t ≤ (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10)) ((min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r) := by have hρ : 0 < ρ := hr.trans_le hrρ have hs : 0 < s := hρ.trans_le hρs have ht : 0 < t := ha.trans_le hat have hb : 0 < b := ht.trans_le htb have hU : 0 < 12 / (5 * ρ) := by positivity have hfreq : 0 < t / (12 / (5 * ρ)) := div_pos ht hU have hfreq1 : t / (12 / (5 * ρ)) ≤ 1 := (div_le_one hU).2 htU have hk := prawitzKernel_norm_le (t / (12 / (5 * ρ))) (by simpa only [abs_of_pos hfreq] using hfreq) (by simpa only [abs_of_pos hfreq] using hfreq1) rw [abs_of_pos hfreq] at hk have hk' : (5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * ρ ≤ 1 / (pi * a) + 5 * s / 12 := by calc _ ≤ (5 / 6 : ℝ) * (1 / (2 * pi * (t / (12 / (5 * ρ)))) + 1 / 2) * ρ := by gcongr _ = 1 / (pi * t) + 5 * ρ / 12 := by field_simp; norm_num _ ≤ _ := by gcongr let T := (b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10) let S := (min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r have hT : (t ^ 3 / 6 + ρ * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) ≤ T := by dsimp [T] gcongr have hM : prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2)) ≤ min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2)) := by unfold prawitzMomentEnvelope rw [abs_of_pos ht] gcongr have hd : prawitzDiscrepancyEnvelope ρ t / ρ ≤ min T S := by apply le_min · apply (div_le_iff₀ hρ).2 calc _ ≤ (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) := by unfold prawitzDiscrepancyEnvelope rw [abs_of_pos ht] exact min_le_left _ _ _ = ((t ^ 3 / 6 + ρ * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10)) * ρ := by ring _ ≤ T * ρ := mul_le_mul_of_nonneg_right hT hρ.le · calc _ ≤ (prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2))) / ρ := div_le_div_of_nonneg_right (min_le_right _ _) hρ.le _ ≤ S := by dsimp [S]; gcongr have hd0 : 0 ≤ prawitzDiscrepancyEnvelope ρ t / ρ := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity calc _ = ((5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * ρ) * (prawitzDiscrepancyEnvelope ρ t / ρ) := by field_simp _ ≤ (1 / (pi * a) + 5 * s / 12) * min T S := mul_le_mul hk' hd hd0 (by positivity)
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_compact_cell_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetLowCompact.lean:24
  • prawitz_low_compact_initial_integral_bound theorem — On an initial frequency interval inside the kernel band and a positive parameter cell with nonpositive Taylor exponent, the normalized integral has a polynomial bound at its singular endpoint.
    ρ s a :
    ℝ
    hρ :
    0 < ρ
    hρs :
    ρ ≤ s
    ha :
    0 ≤ a
    haU :
    a ≤ 12 / (5 * ρ)
    hsa :
    s * a ≤ 5 / 2
    (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..a, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t)
    ≤ (1 / pi + 5 * s * a / 12) * (1 / 6 + s * a / 8) * a ^ 3 / 3
    Proof (Lean source)
    theorem prawitz_low_compact_initial_integral_bound (ρ s a : ℝ) (hρ : 0 < ρ) (hρs : ρ ≤ s) (ha : 0 ≤ a) (haU : a ≤ 12 / (5 * ρ)) (hsa : s * a ≤ 5 / 2) : (5 / 6 : ℝ) * (∫ t in (0 : ℝ)..a, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t) ≤ (1 / pi + 5 * s * a / 12) * (1 / 6 + s * a / 8) * a ^ 3 / 3 := by have hs : 0 ≤ s := hρ.le.trans hρs have hU : 0 < 12 / (5 * ρ) := by positivity let C : ℝ := (1 / pi + 5 * s * a / 12) * (1 / 6 + s * a / 8) have hi := prawitz_low_compact_intervalIntegrable ρ (12 / (5 * ρ)) a hρ.le hU ha haU have hpoly : IntervalIntegrable (fun t : ℝ => C * t ^ 2) volume 0 a := (by fun_prop : Continuous (fun t : ℝ => C * t ^ 2)).intervalIntegrable 0 a rw [← intervalIntegral.integral_const_mul] calc _ ≤ ∫ t in (0 : ℝ)..a, C * t ^ 2 := by apply intervalIntegral.integral_mono_on_of_le_Ioo ha (hi.const_mul _) hpoly intro t ht have ht0 : 0 < t := ht.1 have hta : t ≤ a := ht.2.le have htU : t ≤ 12 / (5 * ρ) := hta.trans haU have hf : 0 < t / (12 / (5 * ρ)) := div_pos ht0 hU have hf1 : t / (12 / (5 * ρ)) ≤ 1 := (div_le_one hU).2 htU have hk := prawitzKernel_norm_le (t / (12 / (5 * ρ))) (by simpa only [abs_of_pos hf] using hf) (by simpa only [abs_of_pos hf] using hf1) rw [abs_of_pos hf] at hk have hρt : ρ * t ≤ 5 / 2 := (mul_le_mul hρs hta ht0.le hs).trans hsa have he : exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) ≤ 1 := by apply Real.exp_le_one_iff.mpr have hp := mul_nonneg (sq_nonneg t) (sub_nonneg.mpr hρt) nlinarith have hd0 : 0 ≤ prawitzDiscrepancyEnvelope ρ t := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity have hd : prawitzDiscrepancyEnvelope ρ t ≤ ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8 := by calc _ ≤ (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) := by simpa only [prawitzDiscrepancyEnvelope, abs_of_pos ht0] using min_le_left ((ρ * |t| ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10)) (prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2))) _ ≤ _ := mul_le_of_le_one_right (by positivity) he calc _ ≤ (5 / 6 : ℝ) * (1 / (2 * pi * (t / (12 / (5 * ρ)))) + 1 / 2) * (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) := by simpa only [mul_assoc] using mul_le_mul (mul_le_mul_of_nonneg_left hk (by norm_num : (0 : ℝ) ≤ 5 / 6)) hd hd0 (by positivity) _ = (1 / pi + 5 * ρ * t / 12) * (1 / 6 + ρ * t / 8) * t ^ 2 := by field_simp ring _ ≤ C * t ^ 2 := by dsimp [C]; gcongr _ = _ := by rw [intervalIntegral.integral_const_mul, integral_pow] dsimp [C] norm_num ring
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_compact_initial_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetLowCompact.lean:95
  • prawitz_low_compact_cell_integral_bound theorem — On positive parameter and frequency cells inside the kernel band, the normalized cell integral is bounded using the better envelope branch.
    ρ r s a b :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 < a
    hab :
    a ≤ b
    hbU :
    b ≤ 12 / (5 * ρ)
    (5 / 6 : ℝ) * (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t)
    ≤ (b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10)) ((min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r)
    Proof (Lean source)
    theorem prawitz_low_compact_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hab : a ≤ b) (hbU : b ≤ 12 / (5 * ρ)) : (5 / 6 : ℝ) * (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t) ≤ (b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10)) ((min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r) := by have hρ : 0 < ρ := hr.trans_le hrρ have hU : 0 < 12 / (5 * ρ) := by positivity have hib := prawitz_low_compact_intervalIntegrable ρ (12 / (5 * ρ)) b hρ.le hU (ha.le.trans hab) hbU have hia := prawitz_low_compact_intervalIntegrable ρ (12 / (5 * ρ)) a hρ.le hU ha.le (hab.trans hbU) have hi := hia.symm.trans hib rw [← intervalIntegral.integral_const_mul] calc _ ≤ ∫ _t in a..b, (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (-(a ^ 2 / 4) + s * b ^ 3 / 10)) ((min 1 (exp (-(a ^ 2 / 2) + s * b ^ 3 / 5)) + exp (-(a ^ 2 / 2))) / r) := by apply intervalIntegral.integral_mono_on hab (hi.const_mul _) intervalIntegrable_const intro t ht simpa only [mul_assoc] using prawitz_low_compact_cell_bound ρ r s t a b hr hrρ hρs ha ht.1 ht.2 (ht.2.trans hbU) _ = _ := by rw [intervalIntegral.integral_const]; ring
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_compact_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzBudgetLowCompact.lean:163
Prawitz­Budget­Low­Small 1 core · 0 supporting This assembly lemma connects the spectral kernel and discrepancy envelope to the independently proved polynomial Gaussian moment bound. ★ prawitz_budget_low_small

Low-frequency Prawitz allocation at small moment ratios

This assembly lemma connects the spectral kernel and discrepancy envelope to the independently proved polynomial Gaussian moment bound. The complementary ratio interval is handled separately; the full budget retains all ratios.

theorem prawitz_budget_low_small reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive moment ratio ρ at most one hundredth, with the logarithmic inner cutoff U0 = max(3/2, √(4 log(1/ρ))) and the reciprocal outer cutoff U = 12/(5ρ), the low-frequency Prawitz contribution (2/U)·∫ over [0, U0] of the Prawitz filter magnitude at t/U times the discrepancy envelope is at most one quarter of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hsmall :
ρ ≤ 1 / 100
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
(2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t)
≤ ρ / 4
Proof (Lean source)
theorem prawitz_budget_low_small (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ ≤ 1 / 100) : let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) ≤ ρ / 4 := by /- All imported analytic leaves are closed. Establish rho*U0 <= 1/5: log(1/rho) <= 1/rho-1 and rho <= 1/100 give rho^2 * 4*log(1/rho) <= 4*rho*(1-rho) <= 1/25. Handle the max's 3/2 branch separately. For 0<t<=U0, use the kernel norm bound and U0<=U to obtain (2/U)*norm(K(t/U)) <= 1/(pi*t)+5*rho/12. The first member of the discrepancy min is at most (rho*t^3/6+rho^2*t^4/8)*exp(-23*t^2/100) since rho*t<=1/5. Multiplication cancels the apparent 1/t singularity and gives exactly the polynomial in prawitz_low_gaussian_moment_budget. Prove measurability and interval integrability using domination by that nonsingular polynomial Gaussian (the assigned kernel value at t=0 is harmless). Move 2/U inside the interval integral, rewrite as an Ioc set integral, compare, and extend the nonnegative majorant to Ioi 0. Reuse the Gaussian moment leaf without redoing its Gamma calculation. This module must not import either full or complementary budget theorem. -/ dsimp only let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) let g := fun t : ℝ => (ρ * t ^ 2 / (6 * pi) + ρ ^ 2 * t ^ 3 / (8 * pi) + 5 * ρ ^ 2 * t ^ 3 / 72 + 5 * ρ ^ 3 * t ^ 4 / 96) * exp (-(23 * t ^ 2 / 100)) let f := fun t : ℝ => (2 / U) * (‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) have hρ1 : ρ < 1 := by linarith have hcut := prawitz_budget_cutoffs ρ hρ hρ1 change 0 < U0 ∧ U0 ≤ U at hcut have hU : 0 < U := by dsimp [U]; positivity have hlog0 : 0 ≤ 4 * log (1 / ρ) := by have hinv : 1 ≤ 1 / ρ := (le_div_iff₀ hρ).2 (by linarith) positivity [Real.log_nonneg hinv] have hlog := Real.log_le_sub_one_of_pos (by positivity : 0 < 1 / ρ) have hrlog : ρ * log (1 / ρ) ≤ 1 - ρ := by have hm := mul_le_mul_of_nonneg_left hlog hρ.le have he : ρ * (1 / ρ - 1) = 1 - ρ := by field_simp rwa [he] at hm have hsquare : ρ ^ 2 * (4 * log (1 / ρ)) ≤ 1 / 25 := by have hm := mul_le_mul_of_nonneg_left hrlog hρ.le nlinarith [sq_nonneg ρ] have hroot : ρ * sqrt (4 * log (1 / ρ)) ≤ 1 / 5 := by have hs : (ρ * sqrt (4 * log (1 / ρ))) ^ 2 ≤ 1 / 25 := by rw [mul_pow, Real.sq_sqrt hlog0] exact hsquare nlinarith [Real.sqrt_nonneg (4 * log (1 / ρ))] have hsmallcut : ρ * U0 ≤ 1 / 5 := by dsimp [U0] rw [mul_max_of_nonneg _ _ hρ.le] exact max_le (by nlinarith) hroot have hnonneg (t : ℝ) (ht : 0 ≤ t) : 0 ≤ prawitzDiscrepancyEnvelope ρ t := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity have hg0 (t : ℝ) (ht : 0 ≤ t) : 0 ≤ g t := by dsimp [g] positivity have hbound (t : ℝ) (ht : t ∈ Ioc 0 U0) : f t ≤ g t := by have ht0 : 0 < t := ht.1 have htU : t ≤ U := ht.2.trans hcut.2 have hrt : ρ * t ≤ 1 / 5 := (mul_le_mul_of_nonneg_left ht.2 hρ.le).trans hsmallcut have hquot : 0 < t / U := div_pos ht0 hU have hk := prawitzKernel_norm_le (t / U) (by simpa only [abs_of_pos hquot] using hquot) (by rw [abs_of_pos hquot]; exact (div_le_one hU).2 htU) have hk' : (2 / U) * ‖prawitzKernel (t / U)‖ ≤ 1 / (pi * t) + 5 * ρ / 12 := by have hm := mul_le_mul_of_nonneg_left hk (by positivity : 0 ≤ 2 / U) rw [abs_of_pos hquot] at hm have he : (2 / U) * (1 / (2 * pi * (t / U)) + 1 / 2) = 1 / (pi * t) + 5 * ρ / 12 := by dsimp [U] field_simp exact hm.trans_eq he have hexp : -(t ^ 2 / 4) + ρ * t ^ 3 / 10 ≤ -(23 * t ^ 2 / 100) := by have hm := mul_le_mul_of_nonneg_right hrt (sq_nonneg t) nlinarith have hd : prawitzDiscrepancyEnvelope ρ t ≤ (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(23 * t ^ 2 / 100)) := by unfold prawitzDiscrepancyEnvelope refine (min_le_left _ _).trans ?_ rw [abs_of_pos ht0] exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hexp) (by positivity) calc f t = ((2 / U) * ‖prawitzKernel (t / U)‖) * prawitzDiscrepancyEnvelope ρ t := by dsimp [f]; ring _ ≤ (1 / (pi * t) + 5 * ρ / 12) * ((ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(23 * t ^ 2 / 100))) := mul_le_mul hk' hd (hnonneg t ht0.le) (by positivity) _ = g t := by dsimp [g]; field_simp; ring have hmeasK : Measurable prawitzKernel := by have hs : Measurable sign := by unfold sign exact Measurable.ite (measurableSet_lt measurable_id measurable_const) measurable_const (Measurable.ite (measurableSet_lt measurable_const measurable_id) measurable_const measurable_const) have hab : Measurable (fun t : ℝ => |t|) := by fun_prop unfold prawitzKernel apply Measurable.ite · exact (measurableSet_eq_fun measurable_id measurable_const).union (measurableSet_lt measurable_const hab) · fun_prop · fun_prop have hmeasD : Measurable (prawitzDiscrepancyEnvelope ρ) := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope fun_prop have hmeasf : Measurable f := by dsimp [f]; fun_prop have hint (n : ℕ) : IntegrableOn (fun t : ℝ => t ^ n * exp (-(23 / 100 : ℝ) * t ^ 2)) (Ioi 0) := by simpa only [Real.rpow_natCast, Real.rpow_two] using (integrableOn_rpow_mul_exp_neg_mul_sq (s := (n : ℝ)) (by norm_num : (0 : ℝ) < 23 / 100) (by have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n; linarith)) have hgi : IntegrableOn g (Ioi 0) := by have hi := (((hint 2).const_mul (ρ / (6 * pi))).add ((hint 3).const_mul (ρ ^ 2 / (8 * pi)))).add ((hint 3).const_mul (5 * ρ ^ 2 / 72)) have hi' := hi.add ((hint 4).const_mul (5 * ρ ^ 3 / 96)) change Integrable g (volume.restrict (Ioi 0)) apply hi'.congr filter_upwards [] with t dsimp [g] rw [show -(23 * t ^ 2 / 100) = -(23 / 100 : ℝ) * t ^ 2 by ring] ring have hsub : Ioc 0 U0 ⊆ Ioi (0 : ℝ) := fun _ ht => ht.1 have hgi' := hgi.mono_set hsub have hfi : IntegrableOn f (Ioc 0 U0) := by apply hgi'.mono' hmeasf.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (by dsimp [f] exact mul_nonneg (by positivity) (mul_nonneg (norm_nonneg _) (hnonneg t ht.1.le)))] exact hbound t ht calc (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) = ∫ t in Ioc 0 U0, f t := by rw [← intervalIntegral.integral_const_mul, intervalIntegral.integral_of_le hcut.1.le] _ ≤ ∫ t in Ioc 0 U0, g t := setIntegral_mono_on hfi hgi' measurableSet_Ioc hbound _ ≤ ∫ t in Ioi (0 : ℝ), g t := by apply setIntegral_mono_set hgi · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact hg0 t ht.le · exact Filter.Eventually.of_forall hsub _ ≤ ρ / 4 := prawitz_low_gaussian_moment_budget ρ hρ hsmall
Prawitz­Compact­Cell­Integrals 1 core · 2 supporting These cell inequalities retain the cubic exponent's endpoint maximum and the quartic/reflected kernel bounds. ★ prawitz_high_compact_upper_cell_integral_bound

Endpoint integral enclosures for compact Prawitz certificates

These cell inequalities retain the cubic exponent's endpoint maximum and the quartic/reflected kernel bounds. Their imports are proved, including integrability at zero and at the assigned upper endpoint. They do not assert either compact allocation. Subsequent certificates must choose explicit parameter and frequency partitions and certify finite sums of these bounds.

theorem prawitz_high_compact_upper_cell_integral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

On a positive parameter cell r ≤ ρ ≤ s and a positive frequency cell a ≤ b inside the outer band b ≤ 12/(5ρ) whose rescaled lower endpoint α = 5ra/12 is at least one half, the integral over [a, b] of the Prawitz filter magnitude at t/(12/(5ρ)) times the moment envelope is at most (b − a)·√Q·min(1, exp E), where Q = (1 − α)²/4 + π²(1 − α)⁴/16 is a reflected quartic bound on the filter and E is the larger endpoint value of −t²/2 + s·t³/5, so the bound decays at the outer endpoint.

Formal statement
ρ r s a b :
ℝ
hr :
0 < r
hrρ :
r ≤ ρ
hρs :
ρ ≤ s
ha :
0 < a
hab :
a ≤ b
hbU :
b ≤ 12 / (5 * ρ)
hhalf :
1 / 2 ≤ 5 * r * a / 12
α :
5 * r * a / 12
Q :
(1 - α) ^ 2 / 4 + pi ^ 2 * (1 - α) ^ 4 / 16
E :
max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
(∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzMomentEnvelope ρ t)
≤ (b - a) * sqrt Q * min 1 (exp E)
Proof (Lean source)
theorem prawitz_high_compact_upper_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hab : a ≤ b) (hbU : b ≤ 12 / (5 * ρ)) (hhalf : 1 / 2 ≤ 5 * r * a / 12) : let α := 5 * r * a / 12 let Q := (1 - α) ^ 2 / 4 + pi ^ 2 * (1 - α) ^ 4 / 16 let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzMomentEnvelope ρ t) ≤ (b - a) * sqrt Q * min 1 (exp E) := by /- Use integral_mono_on_of_le_Ioo so t<b<=U gives t/U<1. The assigned value at t=U has not been replaced and does not satisfy the vanishing reflected bound; it is a null endpoint. Apply the proved upper-half squared estimate and monotonically bound 1-t/U by 1-alpha, then use the same endpoint moment estimate and constant integration. Imports have no admissions. This is the smallest upper-band integral step; the unchanged high budget awaits a finite-sum certificate. -/ dsimp only let α := 5 * r * a / 12 let Q := (1 - α) ^ 2 / 4 + pi ^ 2 * (1 - α) ^ 4 / 16 let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) have hρ : 0 < ρ := hr.trans_le hrρ have hU : 0 < 12 / (5 * ρ) := by positivity have hi := prawitz_high_compact_intervalIntegrable ρ (12 / (5 * ρ)) a b hU ha hab hbU calc _ ≤ ∫ _t in a..b, sqrt Q * min 1 (exp E) := by apply intervalIntegral.integral_mono_on_of_le_Ioo hab hi intervalIntegrable_const intro t ht have ht0 : 0 < t := ha.trans ht.1 have heq : t / (12 / (5 * ρ)) = 5 * ρ * t / 12 := by field_simp have hα : α ≤ t / (12 / (5 * ρ)) := by rw [heq] dsimp [α] gcongr exact ht.1.le have hu : t / (12 / (5 * ρ)) < 1 := (div_lt_one hU).2 (ht.2.trans_le hbU) have hk : ‖prawitzKernel (t / (12 / (5 * ρ)))‖ ≤ sqrt Q := by apply Real.le_sqrt_of_sq_le apply (prawitz_high_compact_kernel_sq_upper _ (hhalf.trans hα) hu).trans dsimp [Q] gcongr have he := (prawitz_envelope_cell_bounds ρ s t a b hρ.le hρs ha.le ht.1.le ht.2.le).1 exact mul_le_mul hk he (by unfold prawitzMomentEnvelope; positivity) (Real.sqrt_nonneg _) _ = _ := by rw [intervalIntegral.integral_const]; ring
Causalean.Stat.CLT.BerryEsseen.prawitz_high_compact_upper_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactCellIntegrals.lean:187 · uses prawitzKernel , prawitzMomentEnvelope
2 supporting declarations (lemmas, instances)
  • prawitz_low_compact_endpoint_cell_integral_bound theorem — On positive parameter and frequency cells inside the original kernel band, the normalized low-frequency integral is enclosed by the better branch using the sharp endpoint cubic exponent.
    ρ r s a b :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 < a
    hab :
    a ≤ b
    hbU :
    b ≤ 12 / (5 * ρ)
    E :
    max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
    (5 / 6 : ℝ) * (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t)
    ≤ (b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2)) ((min 1 (exp E) + exp (-(a ^ 2 / 2))) / r)
    Proof (Lean source)
    theorem prawitz_low_compact_endpoint_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hab : a ≤ b) (hbU : b ≤ 12 / (5 * ρ)) : let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) (5 / 6 : ℝ) * (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzDiscrepancyEnvelope ρ t) ≤ (b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2)) ((min 1 (exp E) + exp (-(a ^ 2 / 2))) / r) := by /- Reproduce the normalized algebra of the proved, older low cell bound, but use prawitz_envelope_cell_bounds instead of independent exponent endpoints. The two polynomial factors are monotone on positive cells. Bound the discrepancy divided by rho by each branch; combine with the triangle kernel estimate. Integrate using extracted low integrability. This leaf imports neither compact budget and changes neither headline. It is a cell enclosure, not the still-missing total <=3/10 certificate. -/ dsimp only let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) have hρ : 0 < ρ := hr.trans_le hrρ have hU : 0 < 12 / (5 * ρ) := by positivity have hib := prawitz_low_compact_intervalIntegrable ρ (12 / (5 * ρ)) b hρ.le hU (ha.le.trans hab) hbU have hia := prawitz_low_compact_intervalIntegrable ρ (12 / (5 * ρ)) a hρ.le hU ha.le (hab.trans hbU) have hi := hia.symm.trans hib rw [← intervalIntegral.integral_const_mul] calc _ ≤ ∫ _t in a..b, (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2)) ((min 1 (exp E) + exp (-(a ^ 2 / 2))) / r) := by apply intervalIntegral.integral_mono_on hab (hi.const_mul _) intervalIntegrable_const intro t htcell have hat := htcell.1 have htb := htcell.2 have htU := htb.trans hbU change (5 / 6 : ℝ) * (_ * _) ≤ _ rw [← mul_assoc] have hρ : 0 < ρ := hr.trans_le hrρ have hs : 0 < s := hρ.trans_le hρs have ht : 0 < t := ha.trans_le hat have hb : 0 < b := ht.trans_le htb have hU : 0 < 12 / (5 * ρ) := by positivity have hfreq : 0 < t / (12 / (5 * ρ)) := div_pos ht hU have hfreq1 : t / (12 / (5 * ρ)) ≤ 1 := (div_le_one hU).2 htU have hk := prawitzKernel_norm_le (t / (12 / (5 * ρ))) (by simpa only [abs_of_pos hfreq] using hfreq) (by simpa only [abs_of_pos hfreq] using hfreq1) rw [abs_of_pos hfreq] at hk have hk' : (5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * ρ ≤ 1 / (pi * a) + 5 * s / 12 := by calc _ ≤ (5 / 6 : ℝ) * (1 / (2 * pi * (t / (12 / (5 * ρ)))) + 1 / 2) * ρ := by gcongr _ = 1 / (pi * t) + 5 * ρ / 12 := by field_simp; norm_num _ ≤ _ := by gcongr have he := prawitz_envelope_cell_bounds ρ s t a b hρ.le hρs ha.le hat htb let T := (b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2) let S := (min 1 (exp E) + exp (-(a ^ 2 / 2))) / r have hT : (t ^ 3 / 6 + ρ * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) ≤ T := by dsimp [T] exact mul_le_mul (by gcongr) (by simpa only [abs_of_pos ht] using he.2) (by positivity) (by positivity) have hM : prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2)) ≤ min 1 (exp E) + exp (-(a ^ 2 / 2)) := by exact add_le_add he.1 (Real.exp_le_exp.mpr (by have hsq := pow_le_pow_left₀ ha.le hat 2 linarith)) have hd : prawitzDiscrepancyEnvelope ρ t / ρ ≤ min T S := by apply le_min · apply (div_le_iff₀ hρ).2 calc _ ≤ (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) := by unfold prawitzDiscrepancyEnvelope rw [abs_of_pos ht] exact min_le_left _ _ _ = ((t ^ 3 / 6 + ρ * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10)) * ρ := by ring _ ≤ T * ρ := mul_le_mul_of_nonneg_right hT hρ.le · calc _ ≤ (prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2))) / ρ := div_le_div_of_nonneg_right (min_le_right _ _) hρ.le _ ≤ S := by dsimp [S]; gcongr have hd0 : 0 ≤ prawitzDiscrepancyEnvelope ρ t / ρ := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity calc _ = ((5 / 6 : ℝ) * ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * ρ) * (prawitzDiscrepancyEnvelope ρ t / ρ) := by field_simp _ ≤ (1 / (pi * a) + 5 * s / 12) * min T S := mul_le_mul hk' hd hd0 (by positivity) _ = _ := by rw [intervalIntegral.integral_const]; ring
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_compact_endpoint_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactCellIntegrals.lean:21
  • prawitz_high_compact_lower_cell_integral_bound theorem — On positive parameter and frequency cells inside the lower half of every kernel band, the high-frequency cell integral is bounded by the quartic kernel enclosure times the cubic moment envelope.
    ρ r s a b :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 < a
    hab :
    a ≤ b
    hbU :
    b ≤ 12 / (5 * ρ)
    hhalf :
    5 * s * b / 12 ≤ 1 / 2
    α :
    5 * r * a / 12
    β :
    5 * s * b / 12
    Q :
    (1 - α) ^ 2 / 4
    + (((1 - α) * (1 - (pi * α) ^ 2 / 2 + (pi * β) ^ 4 / 24) / (pi * α * (1 - (pi * β) ^ 2 / 6)) + 1 / pi) / 2) ^ 2
    E :
    max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
    (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzMomentEnvelope ρ t)
    ≤ (b - a) * sqrt Q * min 1 (exp E)
    Proof (Lean source)
    theorem prawitz_high_compact_lower_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hab : a ≤ b) (hbU : b ≤ 12 / (5 * ρ)) (hhalf : 5 * s * b / 12 ≤ 1 / 2) : let α := 5 * r * a / 12 let β := 5 * s * b / 12 let Q := (1 - α) ^ 2 / 4 + (((1 - α) * (1 - (pi * α) ^ 2 / 2 + (pi * β) ^ 4 / 24) / (pi * α * (1 - (pi * β) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) (∫ t in a..b, ‖prawitzKernel (t / (12 / (5 * ρ)))‖ * prawitzMomentEnvelope ρ t) ≤ (b - a) * sqrt Q * min 1 (exp E) := by /- For t in [a,b], t/U=5*rho*t/12 lies in [alpha,beta]. Apply the proved lower-cell Taylor squared norm bound, then Real.le_sqrt_of_sq_le. Apply prawitz_envelope_cell_bounds and integrate the constant majorant using prawitz_high_compact_intervalIntegrable. The resulting finite integral sums still require certified arithmetic; no allocation is assumed by this lemma. -/ dsimp only let α := 5 * r * a / 12 let β := 5 * s * b / 12 let Q := (1 - α) ^ 2 / 4 + (((1 - α) * (1 - (pi * α) ^ 2 / 2 + (pi * β) ^ 4 / 24) / (pi * α * (1 - (pi * β) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) have hρ : 0 < ρ := hr.trans_le hrρ have hs : 0 < s := hρ.trans_le hρs have hU : 0 < 12 / (5 * ρ) := by positivity have hi := prawitz_high_compact_intervalIntegrable ρ (12 / (5 * ρ)) a b hU ha hab hbU calc _ ≤ ∫ _t in a..b, sqrt Q * min 1 (exp E) := by apply intervalIntegral.integral_mono_on hab hi intervalIntegrable_const intro t ht have ht0 : 0 < t := ha.trans_le ht.1 have heq : t / (12 / (5 * ρ)) = 5 * ρ * t / 12 := by field_simp have hα : α ≤ t / (12 / (5 * ρ)) := by rw [heq] dsimp [α] gcongr exact ht.1 have hβ : t / (12 / (5 * ρ)) ≤ β := by rw [heq] dsimp [β] gcongr exact ht.2 have hk : ‖prawitzKernel (t / (12 / (5 * ρ)))‖ ≤ sqrt Q := Real.le_sqrt_of_sq_le (prawitzKernel_lower_cell_taylor_sq_bound _ α β (by dsimp [α]; positivity) hα hβ hhalf) have he := (prawitz_envelope_cell_bounds ρ s t a b hρ.le hρs ha.le ht.1 ht.2).1 exact mul_le_mul hk he (by unfold prawitzMomentEnvelope; positivity) (Real.sqrt_nonneg _) _ = _ := by rw [intervalIntegral.integral_const]; ring
    Causalean.Stat.CLT.BerryEsseen.prawitz_high_compact_lower_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactCellIntegrals.lean:126
Prawitz­Compact­Envelope­Cells 1 core · 2 supporting These deterministic helpers split the complementary Prawitz certificates into parameter geometry, endpoint exponent bounds, and later finite-sum arithmetic. ★ prawitz_envelope_cell_bounds

Cutoff geometry and cubic envelope enclosures on parameter cells

These deterministic helpers split the complementary Prawitz certificates into parameter geometry, endpoint exponent bounds, and later finite-sum arithmetic. They assert no budget or Gaussian approximation as a hypothesis. For rational negative exponent endpoints, reuse Real.sum_le_exp_of_nonneg followed by Real.exp_neg to obtain rational reciprocal-polynomial upper bounds. For the logarithmic cutoff, certify endpoint exponentials and use Real.log_le_iff_le_exp. Mathlib's sum_integral_adjacent_intervals provides partition integration; it must be combined with the existing low/high interval-integrability results.

theorem prawitz_envelope_cell_bounds reviewed
Causalean.Stat.CLT.BerryEsseen

For a frequency t in a nonnegative cell [a, b] and a nonnegative ratio ρ at most s, with E the larger of the endpoint exponents −a²/2 + s·a³/5 and −b²/2 + s·b³/5, the moment envelope at ratio ρ and frequency t is at most min(1, exp E), and the Taylor exponential exp(−t²/4 + ρ|t|³/10) is at most exp(E/2).

Formal statement
ρ s t a b :
ℝ
hρ :
0 ≤ ρ
hρs :
ρ ≤ s
ha :
0 ≤ a
hat :
a ≤ t
htb :
t ≤ b
E :
max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10) ≤ exp (E / 2)
Proof (Lean source)
theorem prawitz_envelope_cell_bounds (ρ s t a b : ℝ) (hρ : 0 ≤ ρ) (hρs : ρ ≤ s) (ha : 0 ≤ a) (hat : a ≤ t) (htb : t ≤ b) : let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) prawitzMomentEnvelope ρ t ≤ min 1 (exp E) ∧ exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10) ≤ exp (E / 2) := by dsimp only have ht : 0 ≤ t := ha.trans hat have he := prawitz_cubic_exponent_cell_bound ρ s t a b hρ hρs ha hat htb constructor · unfold prawitzMomentEnvelope rw [abs_of_nonneg ht] exact min_le_min_left 1 (Real.exp_le_exp.mpr he) · rw [abs_of_nonneg ht] apply Real.exp_le_exp.mpr linarith only [he]
Causalean.Stat.CLT.BerryEsseen.prawitz_envelope_cell_bounds · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactEnvelopeCells.lean:109 · uses prawitzMomentEnvelope
2 supporting declarations (lemmas, instances)
  • prawitz_compact_cutoff_cell_bounds theorem — On a positive parameter cell, the inner logarithmic cutoff lies between the cutoffs at the cell endpoints, and the outer cutoff lies between the reciprocal endpoints.
    ρ r s :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    conclusion 1
    max (3 / 2 : ℝ) (sqrt (4 * log (1 / s)))
    ≤ max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
    conclusion 2
    max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
    ≤ max (3 / 2 : ℝ) (sqrt (4 * log (1 / r)))
    conclusion 3
    12 / (5 * s) ≤ 12 / (5 * ρ)
    conclusion 4
    12 / (5 * ρ) ≤ 12 / (5 * r)
    Proof (Lean source)
    theorem prawitz_compact_cutoff_cell_bounds (ρ r s : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) : max (3 / 2 : ℝ) (sqrt (4 * log (1 / s))) ≤ max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) ∧ max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) ≤ max (3 / 2 : ℝ) (sqrt (4 * log (1 / r))) ∧ 12 / (5 * s) ≤ 12 / (5 * ρ) ∧ 12 / (5 * ρ) ≤ 12 / (5 * r) := by have hρ : 0 < ρ := hr.trans_le hrρ have hs : 0 < s := hρ.trans_le hρs have hleft : 1 / s ≤ 1 / ρ := div_le_div_of_nonneg_left (by norm_num) hρ hρs have hright : 1 / ρ ≤ 1 / r := div_le_div_of_nonneg_left (by norm_num) hr hrρ have hl : log (1 / s) ≤ log (1 / ρ) := Real.log_le_log (by positivity) hleft have hu : log (1 / ρ) ≤ log (1 / r) := Real.log_le_log (by positivity) hright refine ⟨?_, ?_, ?_, ?_⟩ · gcongr · gcongr · gcongr · gcongr
    Causalean.Stat.CLT.BerryEsseen.prawitz_compact_cutoff_cell_bounds · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactEnvelopeCells.lean:21
  • prawitz_cubic_exponent_cell_bound theorem — Throughout a nonnegative frequency cell and a nonnegative parameter cell, the cubic Gaussian exponent is bounded by its two endpoint values at the upper parameter.
    ρ s t a b :
    ℝ
    hρ :
    0 ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 ≤ a
    hat :
    a ≤ t
    htb :
    t ≤ b
    -(t ^ 2 / 2) + ρ * t ^ 3 / 5
    ≤ max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
    Proof (Lean source)
    theorem prawitz_cubic_exponent_cell_bound (ρ s t a b : ℝ) (hρ : 0 ≤ ρ) (hρs : ρ ≤ s) (ha : 0 ≤ a) (hat : a ≤ t) (htb : t ≤ b) : -(t ^ 2 / 2) + ρ * t ^ 3 / 5 ≤ max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) := by /- Smallest open exponent obligation; do not dispatch a compact budget. First replace ρ by s using t≥0. At s=0 the exponent is decreasing. At s>0 its derivative is t*(-1+3*s*t/5), so the exponent decreases up to 5/(3*s) and increases afterwards. Split according to which side contains t, and compare to a or b on the corresponding interval using monotoneOn/antitoneOn_of_deriv_nonneg/nonpos. The critical point is a minimum, so endpoint maxima enclose every cell including cells crossing it. This preserves the cubic damping; -a²/2+s*b³/5 is an unnecessarily loose independent-term bound. The Taylor discrepancy exponent is exactly half this exponent and can use the same enclosure. Certify later endpoint exponentials with Mathlib's finite Taylor bounds, never floating-point scans. The eventual normalized totals remain ≤1/4 and ≤3/20 for low/high contributions (equivalently raw integrals ≤3/10 and ≤9/50); this lemma supplies no such total as an assumption. -/ have hs : 0 ≤ s := hρ.trans hρs have ht : 0 ≤ t := ha.trans hat have hparam : -(t ^ 2 / 2) + ρ * t ^ 3 / 5 ≤ -(t ^ 2 / 2) + s * t ^ 3 / 5 := by gcongr have hd (x : ℝ) : deriv (fun x : ℝ => -(x ^ 2 / 2) + s * x ^ 3 / 5) x = x * (-1 + 3 * s * x / 5) := by simp (disch := fun_prop) ring -- The sign test includes s = 0, when the decreasing branch always applies. by_cases hturn : 3 * s * t ≤ 5 · have hm : AntitoneOn (fun x : ℝ => -(x ^ 2 / 2) + s * x ^ 3 / 5) (Icc a t) := by apply antitoneOn_of_deriv_nonpos (convex_Icc a t) (by fun_prop) (by fun_prop) intro x hx have hxcell : x ∈ Icc a t := interior_subset hx have hx : 0 ≤ x := ha.trans hxcell.1 have hxt : 3 * s * x ≤ 3 * s * t := mul_le_mul_of_nonneg_left hxcell.2 (by positivity) rw [hd] exact mul_nonpos_of_nonneg_of_nonpos hx (by linarith) exact hparam.trans ((hm ⟨le_rfl, hat⟩ ⟨hat, le_rfl⟩ hat).trans (le_max_left _ _)) · have hm : MonotoneOn (fun x : ℝ => -(x ^ 2 / 2) + s * x ^ 3 / 5) (Icc t b) := by apply monotoneOn_of_deriv_nonneg (convex_Icc t b) (by fun_prop) (by fun_prop) intro x hx have hxcell : x ∈ Icc t b := interior_subset hx have hx : 0 ≤ x := ht.trans hxcell.1 have htx : 3 * s * t ≤ 3 * s * x := mul_le_mul_of_nonneg_left hxcell.1 (by positivity) rw [hd] exact mul_nonneg hx (by linarith) exact hparam.trans ((hm ⟨le_rfl, htb⟩ ⟨htb, le_rfl⟩ htb).trans (le_max_right _ _))
    Causalean.Stat.CLT.BerryEsseen.prawitz_cubic_exponent_cell_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactEnvelopeCells.lean:47
Prawitz­Compact­Integrability 1 core · 1 supporting The low-frequency discrepancy cancels the singularity of the filter at zero. ★ prawitz_high_compact_intervalIntegrable

Integrability for deterministic Prawitz compact certificates

The low-frequency discrepancy cancels the singularity of the filter at zero. The high-frequency moment factor is integrable on every positive subinterval of the kernel band. These unchanged proofs are extracted from the compact budget files so cell certificates have no admitted import dependency.

theorem prawitz_high_compact_intervalIntegrable reviewed
Causalean.Stat.CLT.BerryEsseen

On a positive frequency interval [a, b] inside the kernel band of positive width U, the product of the Prawitz filter magnitude at t/U and the cubic moment envelope is interval integrable on [a, b] for any ratio ρ. The statement covers the assigned value of the filter at the upper endpoint.

Formal statement
ρ U a b :
ℝ
hU :
0 < U
ha :
0 < a
hab :
a ≤ b
hbU :
b ≤ U
IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) volume a b
Proof (Lean source)
theorem prawitz_high_compact_intervalIntegrable (ρ U a b : ℝ) (hU : 0 < U) (ha : 0 < a) (hab : a ≤ b) (hbU : b ≤ U) : IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) volume a b := by have hK : Measurable prawitzKernel := by unfold prawitzKernel sign apply Measurable.ite · exact (measurableSet_eq_fun measurable_id measurable_const).union (measurableSet_lt measurable_const continuous_abs.measurable) · exact measurable_const · apply add · exact Complex.measurable_ofReal.comp (by fun_prop) · apply mul _ measurable_const apply Complex.measurable_ofReal.comp apply Measurable.div_const apply add · fun_prop · apply Measurable.div_const apply Measurable.ite (measurableSet_lt measurable_id measurable_const) measurable_const exact Measurable.ite (measurableSet_lt measurable_const measurable_id) measurable_const measurable_const have hM : Continuous (prawitzMomentEnvelope ρ) := by unfold prawitzMomentEnvelope fun_prop have hm : Measurable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) := ((hK.comp (measurable_id.div_const U)).norm).mul hM.measurable apply (intervalIntegrable_const (c := 1 / (2 * pi * (a / U)) + 1 / 2)).mono_fun' hm.aestronglyMeasurable rw [Set.uIoc_of_le hab] filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht have ht0 : 0 < t := ha.trans ht.1 have hs : 0 < t / U := div_pos ht0 hU have hs1 : t / U ≤ 1 := (div_le_one hU).2 (ht.2.trans hbU) have hk := prawitzKernel_norm_le (t / U) (by simpa only [abs_of_pos hs] using hs) (by simpa only [abs_of_pos hs] using hs1) rw [abs_of_pos hs] at hk have hm0 : 0 ≤ prawitzMomentEnvelope ρ t := by unfold prawitzMomentEnvelope positivity have hm1 : prawitzMomentEnvelope ρ t ≤ 1 := min_le_left _ _ rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (norm_nonneg _) hm0)] calc _ ≤ ‖prawitzKernel (t / U)‖ * 1 := mul_le_mul_of_nonneg_left hm1 (norm_nonneg _) _ ≤ 1 / (2 * pi * (t / U)) + 1 / 2 := by simpa using hk _ ≤ 1 / (2 * pi * (a / U)) + 1 / 2 := by gcongr exact ht.1.le
Causalean.Stat.CLT.BerryEsseen.prawitz_high_compact_intervalIntegrable · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactIntegrability.lean:88 · uses prawitzKernel , prawitzMomentEnvelope
1 supporting declaration (lemmas, instances)
  • prawitz_low_compact_intervalIntegrable theorem — For a nonnegative ratio and an interval contained in a positive kernel band, the low-frequency discrepancy integrand is interval integrable, including at zero.
    ρ U a :
    ℝ
    hρ :
    0 ≤ ρ
    hU :
    0 < U
    ha :
    0 ≤ a
    haU :
    a ≤ U
    IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) volume 0 a
    Proof (Lean source)
    theorem prawitz_low_compact_intervalIntegrable (ρ U a : ℝ) (hρ : 0 ≤ ρ) (hU : 0 < U) (ha : 0 ≤ a) (haU : a ≤ U) : IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) volume 0 a := by let G : ℝ → ℝ := fun t => (U / (2 * pi) * (ρ * t ^ 2 / 6 + ρ ^ 2 * t ^ 3 / 8) + (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) / 2) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) have hG : Continuous G := by dsimp [G]; fun_prop have hK : Measurable prawitzKernel := by unfold prawitzKernel sign apply Measurable.ite · exact (measurableSet_eq_fun measurable_id measurable_const).union (measurableSet_lt measurable_const continuous_abs.measurable) · exact measurable_const · apply add · exact Complex.measurable_ofReal.comp (by fun_prop) · apply mul _ measurable_const apply Complex.measurable_ofReal.comp apply Measurable.div_const apply add · fun_prop · apply Measurable.div_const apply Measurable.ite (measurableSet_lt measurable_id measurable_const) measurable_const exact Measurable.ite (measurableSet_lt measurable_const measurable_id) measurable_const measurable_const have hD : Continuous (prawitzDiscrepancyEnvelope ρ) := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope fun_prop have hm : Measurable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * prawitzDiscrepancyEnvelope ρ t) := ((hK.comp (measurable_id.div_const U)).norm).mul hD.measurable apply (hG.intervalIntegrable 0 a).mono_fun' hm.aestronglyMeasurable rw [Set.uIoc_of_le ha] filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht have ht0 : 0 < t := ht.1 have htU : t ≤ U := ht.2.trans haU have hs : 0 < t / U := div_pos ht0 hU have hs1 : t / U ≤ 1 := (div_le_one hU).2 htU have hk := prawitzKernel_norm_le (t / U) (by simpa only [abs_of_pos hs] using hs) (by simpa only [abs_of_pos hs] using hs1) rw [abs_of_pos hs] at hk have hd0 : 0 ≤ prawitzDiscrepancyEnvelope ρ t := by unfold prawitzDiscrepancyEnvelope prawitzMomentEnvelope positivity have hd : prawitzDiscrepancyEnvelope ρ t ≤ (ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10) := by simpa only [prawitzDiscrepancyEnvelope, abs_of_pos ht0] using (min_le_left ((ρ * |t| ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * |t| ^ 3 / 10)) (prawitzMomentEnvelope ρ t + exp (-(t ^ 2 / 2)))) rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (norm_nonneg _) hd0)] calc _ ≤ (1 / (2 * pi * (t / U)) + 1 / 2) * ((ρ * t ^ 3 / 6 + ρ ^ 2 * t ^ 4 / 8) * exp (-(t ^ 2 / 4) + ρ * t ^ 3 / 10)) := mul_le_mul hk hd hd0 (by positivity) _ = G t := by dsimp [G] field_simp
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_compact_intervalIntegrable · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactIntegrability.lean:18
Prawitz­Compact­Kernel­Cells 1 core · 2 supporting These deterministic bounds remove cotangent from frequency-cell certificates. ★ prawitzKernel_lower_cell_taylor_sq_bound

Polynomial cell enclosures for the Prawitz filter

These deterministic bounds remove cotangent from frequency-cell certificates. The reflected upper-band and Jordan lower-band estimates are extracted from PrawitzBudgetHighCompact without changing their statements or proofs. The quartic lower-band cell enclosure is the remaining analytic leaf; it uses only the endpoints of a cell, and retains the full positive half-band.

theorem prawitzKernel_lower_cell_taylor_sq_bound reviewed
Causalean.Stat.CLT.BerryEsseen

On a frequency u in a positive cell [a, b] of the lower half-band b ≤ 1/2, the squared Prawitz filter norm at u is at most (1 − a)²/4 + (((1 − a)·(1 − (πa)²/2 + (πb)⁴/24)/(πa·(1 − (πb)²/6)) + 1/π)/2)², a bound that involves only the cell endpoints and π.

Formal statement
u a b :
ℝ
ha :
0 < a
hat :
a ≤ u
htb :
u ≤ b
hb :
b ≤ 1 / 2
‖prawitzKernel u‖ ^ 2
≤ (1 - a) ^ 2 / 4
+ (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2
Proof (Lean source)
theorem prawitzKernel_lower_cell_taylor_sq_bound (u a b : ℝ) (ha : 0 < a) (hat : a ≤ u) (htb : u ≤ b) (hb : b ≤ 1 / 2) : ‖prawitzKernel u‖ ^ 2 ≤ (1 - a) ^ 2 / 4 + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 := by /- Smallest open kernel obligation, independent of all budgets and smoothing. Let x=πu. Real.sin_ge_sub_cube and the endpoint inequalities give sin(x) ≥ πa * (1-(πb)^2/6) > 0. Positivity follows from b≤1/2 and π<4, so no additional cell-size condition is needed. cos_le_quadratic_add_quartic gives cos(x) ≤ 1-(πa)^2/2+(πb)^4/24. On this half-band cos(x)≥0 and 1-u≥0. Bound the nonnegative imaginary component by division, bound the real component by (1-a)/2, and compare their squares using Complex.sq_norm and Complex.normSq_apply. The existing Jordan estimate below can guide component algebra; it is too loose to certify the high-frequency allocation. Do not assume a numerical integral budget, and do not add imports of any compact-budget headline. -/ have hu : 0 < u := lt_of_lt_of_le ha hat have huHalf : u ≤ 1 / 2 := htb.trans hb have haOne : 0 ≤ 1 - a := by linarith have huOne : 0 ≤ 1 - u := by linarith have hpa : 0 < pi * a := mul_pos Real.pi_pos ha have hpu : 0 < pi * u := mul_pos Real.pi_pos hu have hpb : 0 ≤ pi * b := mul_nonneg Real.pi_pos.le (hu.le.trans htb) have hpau : pi * a ≤ pi * u := mul_le_mul_of_nonneg_left hat Real.pi_pos.le have hpub : pi * u ≤ pi * b := mul_le_mul_of_nonneg_left htb Real.pi_pos.le have hpbTwo : pi * b < 2 := by nlinarith [Real.pi_pos, Real.pi_lt_four] have hpbSq : (pi * b) ^ 2 < 4 := by nlinarith have hfactor : 0 < 1 - (pi * b) ^ 2 / 6 := by linarith let d := pi * a * (1 - (pi * b) ^ 2 / 6) have hd : 0 < d := mul_pos hpa hfactor have hsqau := pow_le_pow_left₀ hpa.le hpau 2 have hsqub := pow_le_pow_left₀ hpu.le hpub 2 have hfourub := pow_le_pow_left₀ hpu.le hpub 4 have hsinLower : d ≤ sin (pi * u) := by have hmul := mul_le_mul_of_nonneg_left (show 1 - (pi * b) ^ 2 / 6 ≤ 1 - (pi * u) ^ 2 / 6 by linarith) hpu.le have hend := mul_le_mul_of_nonneg_right hpau hfactor.le have ht := Real.sin_ge_sub_cube hpu.le dsimp [d] nlinarith only [hmul, hend, ht] have hsin : 0 < sin (pi * u) := hd.trans_le hsinLower have hcos : 0 ≤ cos (pi * u) := Real.cos_nonneg_of_mem_Icc ⟨by linarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ let c := 1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24 have hcosUpper : cos (pi * u) ≤ c := by have ht := cos_le_quadratic_add_quartic (pi * u) dsimp [c] linarith have hc : 0 ≤ c := hcos.trans hcosUpper have hcot : cos (pi * u) / sin (pi * u) ≤ c / d := by calc _ ≤ cos (pi * u) / d := div_le_div_of_nonneg_left hcos hd hsinLower _ ≤ _ := div_le_div_of_nonneg_right hcosUpper hd.le let q := ((1 - u) * cos (pi * u) / sin (pi * u) + 1 / pi) / 2 have hq : 0 ≤ q := by dsimp [q]; positivity have hqUpper : q ≤ ((1 - a) * c / d + 1 / pi) / 2 := by have h := mul_le_mul (show 1 - u ≤ 1 - a by linarith) hcot (div_nonneg hcos hsin.le) haOne dsimp [q] simp only [← mul_div_assoc] at h linarith have hne : ¬(u = 0 ∨ 1 < |u|) := by simp only [abs_of_pos hu, not_or, not_lt] exact ⟨hu.ne', by linarith⟩ have hre : (prawitzKernel u).re = (1 - u) / 2 := by rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hu, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] ring have him : (prawitzKernel u).im = q := by rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hu, Real.sign_of_pos hu, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.I_re] dsimp [q] ring have hsqRe := pow_le_pow_left₀ huOne (show 1 - u ≤ 1 - a by linarith) 2 have hsqIm := pow_le_pow_left₀ hq hqUpper 2 rw [Complex.sq_norm, Complex.normSq_apply, hre, him] change (1 - u) / 2 * ((1 - u) / 2) + q * q ≤ (1 - a) ^ 2 / 4 + (((1 - a) * c / d + 1 / pi) / 2) ^ 2 nlinarith only [hsqRe, hsqIm]
Causalean.Stat.CLT.BerryEsseen.prawitzKernel_lower_cell_taylor_sq_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactKernelCells.lean:150 · uses prawitzKernel
2 supporting declarations (lemmas, instances)
  • prawitz_high_compact_kernel_sq_upper theorem — On the upper half of the open kernel band, reflection about π gives a polynomial bound for the squared filter norm. The assigned endpoint value is excluded.
    s :
    ℝ
    hs :
    1 / 2 ≤ s
    hs1 :
    s < 1
    ‖prawitzKernel s‖ ^ 2 ≤ (1 - s) ^ 2 / 4 + pi ^ 2 * (1 - s) ^ 4 / 16
    Proof (Lean source)
    theorem prawitz_high_compact_kernel_sq_upper (s : ℝ) (hs : 1 / 2 ≤ s) (hs1 : s < 1) : ‖prawitzKernel s‖ ^ 2 ≤ (1 - s) ^ 2 / 4 + pi ^ 2 * (1 - s) ^ 4 / 16 := by have hs0 : 0 < s := by linarith let y := pi * (1 - s) have hy : 0 < y := by dsimp [y]; positivity have hyhalf : y ≤ pi / 2 := by dsimp [y]; nlinarith [Real.pi_pos] have hypi : y < pi := by linarith [Real.pi_pos] have hsin : 0 < sin y := Real.sin_pos_of_mem_Ioo ⟨hy, hypi⟩ have hcos : 0 ≤ cos y := Real.cos_nonneg_of_mem_Icc ⟨by linarith [Real.pi_pos], hyhalf⟩ have hmul : y * cos y ≤ sin y := by rcases hyhalf.eq_or_lt with he | hlt · rw [he, Real.cos_pi_div_two, Real.sin_pi_div_two] norm_num · have hcpos : 0 < cos y := Real.cos_pos_of_mem_Ioo ⟨by linarith [Real.pi_pos], hlt⟩ have htan := Real.le_tan hy.le hlt rw [Real.tan_eq_sin_div_cos] at htan exact (le_div_iff₀ hcpos).mp htan have hcot : 1 / y - y / 2 ≤ cos y / sin y := by have hr : cos y / y ≤ cos y / sin y := div_le_div_of_nonneg_left hcos hsin (Real.sin_le hy.le) apply le_trans _ hr apply (le_div_iff₀ hy).mpr have ht := Real.one_sub_sq_div_two_le_cos (x := y) field_simp nlinarith let q := (1 / pi - (1 - s) * cos y / sin y) / 2 have hq0 : 0 ≤ q := by dsimp [q] apply div_nonneg _ (by norm_num) apply sub_nonneg.mpr apply (div_le_iff₀ hsin).mpr have hp : 0 < pi := Real.pi_pos rw [one_div_mul_eq_div] apply (le_div_iff₀ hp).mpr dsimp [y] at hmul nlinarith have hqupper : q ≤ pi * (1 - s) ^ 2 / 4 := by have h := mul_le_mul_of_nonneg_left hcot (show 0 ≤ 1 - s by linarith) have he : (1 - s) * (1 / y - y / 2) = 1 / pi - pi * (1 - s) ^ 2 / 2 := by dsimp [y] field_simp [sub_ne_zero.mpr hs1.ne', Real.pi_ne_zero] rw [he] at h dsimp [q] simp only [← mul_div_assoc] at h nlinarith have hne : ¬(s = 0 ∨ 1 < |s|) := by simp only [abs_of_pos hs0, not_or, not_lt] exact ⟨hs0.ne', hs1.le⟩ have hre : (prawitzKernel s).re = (1 - s) / 2 := by rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hs0, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] ring have him : (prawitzKernel s).im = q := by rw [prawitzKernel, if_neg hne] dsimp [q, y] rw [mul_sub, mul_one, Real.cos_pi_sub, Real.sin_pi_sub] simp only [abs_of_pos hs0, Real.sign_of_pos hs0, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.I_re] ring have hsq := pow_le_pow_left₀ hq0 hqupper 2 rw [Complex.sq_norm, Complex.normSq_apply, hre, him] nlinarith
    Causalean.Stat.CLT.BerryEsseen.prawitz_high_compact_kernel_sq_upper · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactKernelCells.lean:18
  • prawitz_high_compact_kernel_sq_lower theorem — On the positive lower half of the kernel band, Jordan's inequality and reflection about π/2 give a squared filter bound without a trigonometric denominator.
    s :
    ℝ
    hs :
    0 < s
    hsHalf :
    s ≤ 1 / 2
    ‖prawitzKernel s‖ ^ 2
    ≤ (1 - s) ^ 2 / 4 + (((1 - s) * pi * (1 / 2 - s) / (2 * s) + 1 / pi) / 2) ^ 2
    Proof (Lean source)
    theorem prawitz_high_compact_kernel_sq_lower (s : ℝ) (hs : 0 < s) (hsHalf : s ≤ 1 / 2) : ‖prawitzKernel s‖ ^ 2 ≤ (1 - s) ^ 2 / 4 + (((1 - s) * pi * (1 / 2 - s) / (2 * s) + 1 / pi) / 2) ^ 2 := by have hp : 0 < pi * s := mul_pos Real.pi_pos hs have hhalf : pi * s ≤ pi / 2 := by nlinarith [Real.pi_pos] have hsin : 0 < sin (pi * s) := Real.sin_pos_of_mem_Ioo ⟨hp, by nlinarith [Real.pi_pos]⟩ have hcos : 0 ≤ cos (pi * s) := Real.cos_nonneg_of_mem_Icc ⟨by linarith [Real.pi_pos], hhalf⟩ have hsinLower : 2 * s ≤ sin (pi * s) := by have h := Real.mul_le_sin hp.le hhalf convert h using 1 field_simp have hcosUpper : cos (pi * s) ≤ pi * (1 / 2 - s) := by have h := Real.sin_le (show 0 ≤ pi / 2 - pi * s by linarith) rw [Real.sin_pi_div_two_sub] at h nlinarith have hcot : cos (pi * s) / sin (pi * s) ≤ pi * (1 / 2 - s) / (2 * s) := by calc _ ≤ cos (pi * s) / (2 * s) := div_le_div_of_nonneg_left hcos (by positivity) hsinLower _ ≤ _ := div_le_div_of_nonneg_right hcosUpper (by positivity) let q := ((1 - s) * cos (pi * s) / sin (pi * s) + 1 / pi) / 2 have hq0 : 0 ≤ q := by have h1s : 0 ≤ 1 - s := by linarith dsimp [q] positivity have hqUpper : q ≤ ((1 - s) * pi * (1 / 2 - s) / (2 * s) + 1 / pi) / 2 := by have h := mul_le_mul_of_nonneg_left hcot (show 0 ≤ 1 - s by linarith) simp only [← mul_div_assoc] at h rw [← mul_assoc] at h dsimp [q] nlinarith have hne : ¬(s = 0 ∨ 1 < |s|) := by simp only [abs_of_pos hs, not_or, not_lt] exact ⟨hs.ne', by linarith⟩ have hre : (prawitzKernel s).re = (1 - s) / 2 := by rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hs, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] ring have him : (prawitzKernel s).im = q := by rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hs, Real.sign_of_pos hs, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.I_re] dsimp [q] ring have hsq := pow_le_pow_left₀ hq0 hqUpper 2 rw [Complex.sq_norm, Complex.normSq_apply, hre, him] nlinarith
    Causalean.Stat.CLT.BerryEsseen.prawitz_high_compact_kernel_sq_lower · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactKernelCells.lean:91
Prawitz­Compact­Real­Cutoffs 1 core · 1 supporting The finite rational cutoff certificate is already proved. ★ prawitz_compact_real_cutoff_enclosures

Real cutoff adapters for the certified compact parameter grid

The finite rational cutoff certificate is already proved. This module bridges its Taylor inequalities to the original logarithmic cutoffs over entire real parameter cells. It also locates every compact ratio in the explicit grid. Neither integral budget is imported or assumed.

theorem prawitz_compact_real_cutoff_enclosures reviewed
Causalean.Stat.CLT.BerryEsseen

Throughout the j-th certified parameter cell, for every ratio ρ between the cell's left and right endpoints, with B the cell's low grid endpoint (its low cutoff index over 200), A its high grid endpoint (its high cutoff index over 1000), inner cutoff U0 = max(3/2, √(4 log(1/ρ))) and outer cutoff U = 12/(5ρ), the inner cutoff U0 is at most B, B is at most the outer cutoff U, and the rescaled high endpoint U·A is at most U0.

Formal statement
j :
Fin 270
ρ :
ℝ
hrρ :
(prawitzCompactLeft j.val : ℝ) ≤ ρ
hρs :
ρ ≤ (prawitzCompactRight j.val : ℝ)
B :
(prawitzLowCutoffIndex j.val : ℝ) / 200
A :
(prawitzHighCutoffIndex j.val : ℝ) / 1000
U0 :
max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ)))
U :
12 / (5 * ρ)
U0 ≤ B
B ≤ U
U * A ≤ U0
Proof (Lean source)
theorem prawitz_compact_real_cutoff_enclosures (j : Fin 270) (ρ : ℝ) (hrρ : (prawitzCompactLeft j.val : ℝ) ≤ ρ) (hρs : ρ ≤ (prawitzCompactRight j.val : ℝ)) : let B := (prawitzLowCutoffIndex j.val : ℝ) / 200 let A := (prawitzHighCutoffIndex j.val : ℝ) / 1000 let U0 := max (3 / 2 : ℝ) (sqrt (4 * log (1 / ρ))) let U := 12 / (5 * ρ) U0 ≤ B ∧ B ≤ U ∧ U * A ≤ U0 := by /- Round 8 lowest analytic layer. Destructure the CLOSED rational cutoff certificate, cast its inequalities, and use the proved monotone cutoff geometry. For low B, B>=3/2 and 1<=r*Taylor16(B²/4) imply 1/r<=exp(B²/4). Apply log and sqrt_le_left to enclose U0(r). B<=12/(5*s)<=U follows directly from the certificate and geometry. For high A set C=12*A/(5*r)>=0. If C<=3/2 the max suffices. Otherwise exp(C²/4)<=ExpUpper8(C²/4)<=1/s; apply log and sqrt to obtain C<=U0(s)<=U0(rho), and U*A<=C. All exp comparisons are in PrawitzRationalArithmetic. Do not prove a sampled cutoff or assume the real cutoff bounds as new premises. The interval includes rho=1; use non-strict log/sqrt bounds at that endpoint. -/ let r := prawitzCompactLeft j.val let s := prawitzCompactRight j.val let b : ℚ := (prawitzLowCutoffIndex j.val : ℚ) / 200 let a : ℚ := (prawitzHighCutoffIndex j.val : ℚ) / 1000 let c : ℚ := 12 * a / (5 * r) rcases prawitz_compact_cutoff_rational_certificate j with ⟨hr, hrs, hs, hb, _, ha, _, hband, htaylor, hhigh⟩ change c ≤ 3 / 2 ∨ (0 ≤ c ^ 2 / 4 ∧ c ^ 2 / 4 ≤ 8 ∧ s * prawitzExpUpper8 (c ^ 2 / 4) ≤ 1) at hhigh have hr' : (0 : ℝ) < r := by exact_mod_cast hr have hrs' : (r : ℝ) < s := by exact_mod_cast hrs have hb' : (3 / 2 : ℝ) ≤ b := by dsimp only [b] push_cast have : (300 : ℝ) ≤ prawitzLowCutoffIndex j.val := by exact_mod_cast hb linarith have ha' : (0 : ℝ) ≤ a := by dsimp only [a] push_cast exact div_nonneg (Nat.cast_nonneg _) (by norm_num) have hband' : (b : ℝ) ≤ 12 / (5 * (s : ℝ)) := by exact_mod_cast hband have htaylor' : (1 : ℝ) ≤ (r : ℝ) * (prawitzTaylor16 (b ^ 2 / 4) : ℝ) := by exact_mod_cast htaylor have hcastb : (b : ℝ) = (prawitzLowCutoffIndex j.val : ℝ) / 200 := by simp only [b, Rat.cast_div, Rat.cast_natCast, Rat.cast_ofNat] have hcasta : (a : ℝ) = (prawitzHighCutoffIndex j.val : ℝ) / 1000 := by simp only [a, Rat.cast_div, Rat.cast_natCast, Rat.cast_ofNat] have hcastc : (c : ℝ) = 12 * (a : ℝ) / (5 * (r : ℝ)) := by simp only [c, Rat.cast_div, Rat.cast_mul, Rat.cast_ofNat] have hgeometry := prawitz_compact_cutoff_cell_bounds ρ (r : ℝ) (s : ℝ) hr' hrρ hρs have hlow : max (3 / 2 : ℝ) (sqrt (4 * log (1 / (r : ℝ)))) ≤ b := by apply max_le hb' apply (Real.sqrt_le_left (by linarith : (0 : ℝ) ≤ b)).2 have he := (prawitz_taylor16_pos_le_exp ((b : ℝ) ^ 2 / 4) (by positivity)).2 have hpoly : (prawitzTaylor16 (b ^ 2 / 4) : ℝ) ≤ exp ((b : ℝ) ^ 2 / 4) := by simpa only [prawitzTaylor16_cast, Rat.cast_div, Rat.cast_pow, Rat.cast_ofNat] using he have hexp : 1 / (r : ℝ) ≤ exp ((b : ℝ) ^ 2 / 4) := by apply (div_le_iff₀ hr').2 have hm := mul_le_mul_of_nonneg_left hpoly hr'.le linarith only [htaylor', hm] have hlog := (Real.log_le_iff_le_exp (by positivity : (0 : ℝ) < 1 / (r : ℝ))).2 hexp linarith have hupper : (c : ℝ) ≤ max (3 / 2 : ℝ) (sqrt (4 * log (1 / (s : ℝ)))) := by rcases hhigh with hsmall | ⟨hx, hx8, hu⟩ · have hsmall' : (c : ℝ) ≤ 3 / 2 := by have hh : (c : ℝ) ≤ ((3 / 2 : ℚ) : ℝ) := Rat.cast_le.mpr hsmall simpa only [Rat.cast_div, Rat.cast_ofNat] using hh exact hsmall'.trans (le_max_left _ _) · have he := prawitz_exp_le_upper8 (c ^ 2 / 4) hx hx8 have hu' : (s : ℝ) * (prawitzExpUpper8 (c ^ 2 / 4) : ℝ) ≤ 1 := by exact_mod_cast hu have hs' : (0 : ℝ) < s := hr'.trans hrs' have hexp : exp ((c : ℝ) ^ 2 / 4) ≤ 1 / (s : ℝ) := by apply (le_div_iff₀ hs').2 simp only [Rat.cast_div, Rat.cast_pow, Rat.cast_ofNat] at he have hm := mul_le_mul_of_nonneg_left he hs'.le linarith only [hu', hm] have hlog := (Real.le_log_iff_exp_le (by positivity : (0 : ℝ) < 1 / (s : ℝ))).2 hexp apply le_trans (Real.le_sqrt_of_sq_le (by linarith : (c : ℝ) ^ 2 ≤ 4 * log (1 / (s : ℝ)))) (le_max_right _ _) have hscaled : 12 / (5 * ρ) * (a : ℝ) ≤ c := by rw [hcastc] calc 12 / (5 * ρ) * (a : ℝ) ≤ 12 / (5 * (r : ℝ)) * (a : ℝ) := mul_le_mul_of_nonneg_right hgeometry.2.2.2 ha' _ = 12 * (a : ℝ) / (5 * (r : ℝ)) := by ring dsimp only rw [← hcastb, ← hcasta] exact ⟨hgeometry.2.1.trans hlow, hband'.trans hgeometry.2.2.1, hscaled.trans (hupper.trans hgeometry.1)⟩
1 supporting declaration (lemmas, instances)
  • prawitz_compact_parameter_cell_exists theorem — Every real ratio in the closed compact range belongs to one of the 270 adjacent rational parameter cells.
    ρ :
    ℝ
    hρ0 :
    1 / 100 ≤ ρ
    hρ1 :
    ρ ≤ 1
    ∃ j : Fin 270,
    conclusion 1
    (prawitzCompactLeft j.val : ℝ) ≤ ρ
    conclusion 2
    ρ ≤ (prawitzCompactRight j.val : ℝ)
    Proof (Lean source)
    theorem prawitz_compact_parameter_cell_exists (ρ : ℝ) (hρ0 : 1 / 100 ≤ ρ) (hρ1 : ρ ≤ 1) : ∃ j : Fin 270, (prawitzCompactLeft j.val : ℝ) ≤ ρ ∧ ρ ≤ (prawitzCompactRight j.val : ℝ) := by by_cases heq : ρ = 1 · refine ⟨269, ?_, ?_⟩ <;> norm_num [heq, prawitzCompactLeft, prawitzCompactRight] · have hlast : (prawitzCompactLeft 270 : ℝ) = 1 := by norm_num [prawitzCompactLeft] have hfirst : (prawitzCompactLeft 0 : ℝ) = 1 / 100 := by norm_num [prawitzCompactLeft] have hmem : ρ ∈ Ico (prawitzCompactLeft 0 : ℝ) (prawitzCompactLeft 270 : ℝ) := by rw [hfirst, hlast] exact ⟨hρ0, lt_of_le_of_ne hρ1 heq⟩ have hcover := Ico_subset_biUnion_Ico 270 (fun i => (prawitzCompactLeft i : ℝ)) hmem rcases Set.mem_iUnion.mp hcover with ⟨i, hi⟩ rcases Set.mem_iUnion.mp hi with ⟨hi, hcell⟩ exact ⟨⟨i, Finset.mem_range.mp hi⟩, hcell.1, hcell.2.le⟩
    Causalean.Stat.CLT.BerryEsseen.prawitz_compact_parameter_cell_exists · Causalean/Stat/CLT/BerryEsseen/PrawitzCompactRealCutoffs.lean:18
Prawitz­Cutoff­Rational­Certificate 1 core · 0 supporting This is a finite arithmetic obligation, independent of either integral budget. ★ prawitz_compact_cutoff_rational_certificate

Finite rational certificates for the moving Prawitz cutoffs

This is a finite arithmetic obligation, independent of either integral budget. The low table certifies exp(B²/4) ≥ 1/r using a lower Taylor polynomial. The high table certifies C ≤ 3/2 or exp(C²/4) ≤ 1/s using the proved eighth-power exponential enclosure. Thus B bounds the actual inner cutoff from above, and the rescaled high index bounds it from below on the WHOLE parameter cell [r,s]. No sampled log/sqrt value is a premise.

theorem prawitz_compact_cutoff_rational_certificate reviewed
Causalean.Stat.CLT.BerryEsseen

At every cell j of the explicit 270-cell compact parameter grid, with r and s the cell's left and right endpoints, B its low cutoff index over 200, A its high cutoff index over 1000 and C = 12A/(5r), the endpoints satisfy 0 < r < s ≤ 1, the low cutoff index lies between 300 and 859 and the high cutoff index between 1 and 999, B is at most 12/(5s), the low certificate 1 ≤ r·T(B²/4) holds, and either C ≤ 3/2 or both 0 ≤ C²/4 ≤ 8 and s·E(C²/4) ≤ 1. Here T is the sixteen-term Taylor polynomial of the exponential and E the rational eighth-power upper enclosure of the exponential.

Formal statement
j :
Fin 270
r :
B :
(prawitzLowCutoffIndex j.val : ℚ) / 200
A :
(prawitzHighCutoffIndex j.val : ℚ) / 1000
C :
12 * A / (5 * r)
0 < r
r < s
s ≤ 1
300 ≤ prawitzLowCutoffIndex j.val
prawitzLowCutoffIndex j.val ≤ 859
1 ≤ prawitzHighCutoffIndex j.val
prawitzHighCutoffIndex j.val < 1000
B ≤ 12 / (5 * s)
1 ≤ r * prawitzTaylor16 (B ^ 2 / 4)
C ≤ 3 / 2 ∨ (0 ≤ C ^ 2 / 4 ∧ C ^ 2 / 4 ≤ 8 ∧ s * prawitzExpUpper8 (C ^ 2 / 4) ≤ 1)
Proof (Lean source)
theorem prawitz_compact_cutoff_rational_certificate (j : Fin 270) : let r := prawitzCompactLeft j.val let s := prawitzCompactRight j.val let B := (prawitzLowCutoffIndex j.val : ℚ) / 200 let A := (prawitzHighCutoffIndex j.val : ℚ) / 1000 let C := 12 * A / (5 * r) 0 < r ∧ r < s ∧ s ≤ 1 ∧ 300 ≤ prawitzLowCutoffIndex j.val ∧ prawitzLowCutoffIndex j.val ≤ 859 ∧ 1 ≤ prawitzHighCutoffIndex j.val ∧ prawitzHighCutoffIndex j.val < 1000 ∧ B ≤ 12 / (5 * s) ∧ 1 ≤ r * prawitzTaylor16 (B ^ 2 / 4) ∧ (C ≤ 3 / 2 ∨ (0 ≤ C ^ 2 / 4 ∧ C ^ 2 / 4 ≤ 8 ∧ s * prawitzExpUpper8 (C ^ 2 / 4) ≤ 1)) := by /- Lowest open layer: only finite rational arithmetic. Use interval_cases on j.val (retaining j.isLt), unfold the explicit arrays/getD and the degree-16 series, and close with kernel-checked norm_num/decide proofs. Split into helper certificates by index blocks if proof reduction is expensive; do not use native_decide, unsafe elaboration, or new axioms. All 270 cases were independently evaluated with Python Fraction as a scaffold sanity check, including every displayed inequality. That check is NOT a Lean proof and supplies no hypothesis here. Later analytic adapters: positive r,s and the Taylor lower comparison give 1/r <= exp(B²/4), hence sqrt(4*log(1/r)) <= B. For the high index, C<=3/2 is already below U0(s); otherwise the upper comparison yields exp(C²/4)<=1/s and C<=sqrt(4*log(1/s)). Multiply by 5*r/12 and use the proved monotonic cutoff lemma to cover all rho in [r,s]. The original low/high integrals and constants are unchanged. -/ -- Each branch is a closed decidable proposition; kernel reduction checks -- the exact rational arithmetic, including the Taylor sum and eighth power. have hj := j.isLt generalize hjval : j.val = i at * interval_cases i <;> (dsimp only unfold prawitzCompactRight prawitzCompactLeft prawitzLowCutoffIndex prawitzHighCutoffIndex prawitzExpUpper8 prawitzTaylor16 decide +kernel)
Prawitz­Far­Gaussian­Tail 1 core · 0 supporting This bounded real integral handles the far part of the high-frequency budget using the coarse global damping bound. ★ prawitz_far_gaussian_tail_budget

Far-frequency Gaussian allocation for small Prawitz ratios

This bounded real integral handles the far part of the high-frequency budget using the coarse global damping bound. The reciprocal weight is nonsingular throughout this interval. The full high-frequency budget remains a separate theorem over all ratios strictly between zero and one.

theorem prawitz_far_gaussian_tail_budget reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive ratio ρ at most one hundredth, the integral from the reciprocal-ratio cutoff 1/(2ρ) to the fixed outer cutoff 12/(5ρ) of (1/(πt) + 5ρ/12)·exp(−t²/50) is at most one twentieth of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hsmall :
ρ ≤ 1 / 100
(∫ t in (1 / (2 * ρ))..(12 / (5 * ρ)), (1 / (pi * t) + 5 * ρ / 12) * exp (-(t ^ 2 / 50)))
≤ ρ / 20
Proof (Lean source)
theorem prawitz_far_gaussian_tail_budget (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ ≤ 1 / 100) : (∫ t in (1 / (2 * ρ))..(12 / (5 * ρ)), (1 / (pi * t) + 5 * ρ / 12) * exp (-(t ^ 2 / 50))) ≤ ρ / 20 := by /- Prove interval integrability by continuity (t stays positive). Bound 1/(πt)+5ρ/12 by (2/π+5/12)*ρ and the exponential by exp(-1/(200ρ²)). The interval length is 19/(10ρ). For q>0, exp(q)≥q³/6 gives exp(-q)≤6/q³. At q=1/(200ρ²), the resulting bound is (19/10)*(2/π+5/12)*48000000*ρ⁶. After dividing by ρ, ρ⁵≤(1/100)⁵ and π>3 certify the stated rational allocation. No floating-point quadrature is needed for this helper. Connection to PrawitzBudgetHigh: on t≤U=12/(5ρ), the cubic exponent -t²/2+ρt³/5 is at most -t²/50. Combine this leaf with GaussianWeightedTail for the middle subinterval when ρ≤1/100. The complementary ρ>1/100 case still needs its own compact-parameter certificate with the actual kernel/envelope. Do not replace the full high-budget statement by this helper case. -/ have hab : 1 / (2 * ρ) ≤ 12 / (5 * ρ) := by apply (div_le_div_iff₀ (by positivity) (by positivity)).2 nlinarith have ha : 0 < 1 / (2 * ρ) := by positivity have hf : IntervalIntegrable (fun t : ℝ => (1 / (pi * t) + 5 * ρ / 12) * exp (-(t ^ 2 / 50))) volume (1 / (2 * ρ)) (12 / (5 * ρ)) := by apply ContinuousOn.intervalIntegrable rw [Set.uIcc_of_le hab] apply ContinuousOn.mul · apply ContinuousOn.add · exact continuousOn_const.div (continuous_const.mul continuous_id).continuousOn (fun t ht => ne_of_gt (mul_pos Real.pi_pos (lt_of_lt_of_le ha ht.1))) · exact continuousOn_const · fun_prop have hpoint : ∀ t ∈ Icc (1 / (2 * ρ)) (12 / (5 * ρ)), (1 / (pi * t) + 5 * ρ / 12) * exp (-(t ^ 2 / 50)) ≤ 2 * ρ * (48000000 * ρ ^ 6) := by intro t ht have htpos : 0 < t := lt_of_lt_of_le ha ht.1 have hrt : 1 ≤ 2 * ρ * t := by have hh := (div_le_iff₀ (by positivity : 0 < 2 * ρ)).1 ht.1 nlinarith have hw : 1 / (pi * t) + 5 * ρ / 12 ≤ 2 * ρ := by have hrec' : 1 / (pi * t) ≤ ρ := by apply (div_le_iff₀ (by positivity)).2 nlinarith [Real.pi_gt_three] linarith have he : exp (-(t ^ 2 / 50)) ≤ 48000000 * ρ ^ 6 := by have hq : 0 < t ^ 2 / 50 := by positivity have hex := Real.pow_div_factorial_le_exp (t ^ 2 / 50) hq.le 3 norm_num at hex have hprod : (t ^ 2 / 50) ^ 3 * exp (-(t ^ 2 / 50)) ≤ 6 := by have hm := mul_le_mul_of_nonneg_right hex (Real.exp_nonneg (-(t ^ 2 / 50))) rw [← Real.exp_add] at hm simp only [add_neg_cancel, Real.exp_zero] at hm nlinarith have hpow := pow_le_pow_left₀ (by norm_num : (0 : ℝ) ≤ 1) hrt 6 have hlower : 1 ≤ 8000000 * ρ ^ 6 * t ^ 6 := by nlinarith [hpow] have hm := mul_le_mul_of_nonneg_right hprod (by positivity : 0 ≤ 8000000 * ρ ^ 6) have hepos := Real.exp_nonneg (-(t ^ 2 / 50)) have hl := mul_le_mul_of_nonneg_right hlower hepos nlinarith exact mul_le_mul hw he (Real.exp_nonneg _) (by positivity) have hi := intervalIntegral.integral_mono_on hab hf (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => 2 * ρ * (48000000 * ρ ^ 6)) volume (1 / (2 * ρ)) (12 / (5 * ρ))) hpoint rw [intervalIntegral.integral_const, smul_eq_mul] at hi have hlen : (12 / (5 * ρ) - 1 / (2 * ρ)) * (2 * ρ * (48000000 * ρ ^ 6)) = 182400000 * ρ ^ 6 := by field_simp ring rw [hlen] at hi have hp := pow_le_pow_left₀ hρ.le hsmall 5 norm_num at hp have hm := mul_le_mul_of_nonneg_right hp hρ.le nlinarith [hi]
Causalean.Stat.CLT.BerryEsseen.prawitz_far_gaussian_tail_budget · Causalean/Stat/CLT/BerryEsseen/PrawitzFarGaussianTail.lean:20
Prawitz­High­Real­Enclosures 1 core · 1 supporting The lower-half Taylor kernel and upper-half reflected polynomial use the actual real pi here. ★ prawitz_high_real_exponential_enclosure

Analytic adapters for the rational high-frequency cells

The lower-half Taylor kernel and upper-half reflected polynomial use the actual real pi here. The first adapter compares their squared enclosures with the rational pi interval; the second compares the rescaled cubic exponential with the reciprocal Taylor entry. These are pointwise scalar inequalities, not integral allocations. They import no open budget or real cutoff adapter. At the outer kernel endpoint the later integral comparison must still be made only almost everywhere, as in PrawitzRescaledCells.

theorem prawitz_high_real_exponential_enclosure reviewed
Causalean.Stat.CLT.BerryEsseen

On the j-th certified compact parameter cell and the i-th positive high-frequency grid cell [i/1000, (i+1)/1000], for i from 1 to 999, with s the parameter cell's right endpoint and E the larger of the values of (−72x²/25 + 1728x³/625)/s² at the two grid endpoints x = i/1000 and x = (i+1)/1000, the exponential of E is at most 1/T(−E), where T is the sixteen-term Taylor polynomial of the exponential and −E is the matching rational exponent from the high table.

Formal statement
j :
Fin 270
i :
ℕ
hi :
i ∈ Ico 1 1000
s :
(prawitzCompactRight j.val : ℝ)
a :
(i : ℝ) / 1000
b :
((i + 1 : ℕ) : ℝ) / 1000
E :
max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2)
aq :
(i : ℚ) / 1000
bq :
((i + 1 : ℕ) : ℚ) / 1000
e :
min (72 * aq ^ 2 / 25 - 1728 * aq ^ 3 / 625) (72 * bq ^ 2 / 25 - 1728 * bq ^ 3 / 625) / (prawitzCompactRight j.val) ^ 2
exp E ≤ ((1 / prawitzTaylor16 e : ℚ) : ℝ)
Proof (Lean source)
theorem prawitz_high_real_exponential_enclosure (j : Fin 270) (i : ℕ) (hi : i ∈ Ico 1 1000) : let s := (prawitzCompactRight j.val : ℝ) let a := (i : ℝ) / 1000 let b := ((i + 1 : ℕ) : ℝ) / 1000 let E := max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2) let aq := (i : ℚ) / 1000 let bq := ((i + 1 : ℕ) : ℚ) / 1000 let e := min (72 * aq ^ 2 / 25 - 1728 * aq ^ 3 / 625) (72 * bq ^ 2 / 25 - 1728 * bq ^ 3 / 625) / (prawitzCompactRight j.val) ^ 2 exp E ≤ ((1 / prawitzTaylor16 e : ℚ) : ℝ) := by /- Round 8 independent exponent leaf. The CLOSED cutoff certificate gives s>0, and hi gives 0<=a<=b<=1. For z in [0,1], 72*z²/25-1728*z³/625 = (72/625)*z²*(25-24*z)>=0. Thus e>=0; after casting, e=-E (min/max and division by s²>0). Apply prawitz_exp_neg_le_reciprocal_taylor16. This preserves the cubic damping rather than the rejected exp(-t²/50) majorant. Later assembly combines this and the kernel square adapter with the CLOSED square certificate to bound each existing rescaled cell integral by prawitzRationalHighCell, then outward rounds it. -/ dsimp only let s := prawitzCompactRight j.val let a : ℚ := i / 1000 let b : ℚ := (i + 1 : ℕ) / 1000 let e := min (72 * a ^ 2 / 25 - 1728 * a ^ 3 / 625) (72 * b ^ 2 / 25 - 1728 * b ^ 3 / 625) / s ^ 2 have hc := prawitz_compact_cutoff_rational_certificate j dsimp only at hc have hs : 0 < s := hc.1.trans hc.2.1 have ha : 0 ≤ a := by dsimp [a]; positivity have hb : 0 ≤ b := by dsimp [b]; positivity have hab : a ≤ b := by dsimp [a, b]; push_cast; linarith have hbOne : b ≤ 1 := by have h : (i + 1 : ℕ) ≤ 1000 := by have := (mem_Ico.mp hi).2; omega have h' : ((i + 1 : ℕ) : ℚ) ≤ 1000 := by exact_mod_cast h dsimp [b] linarith have damping : ∀ z : ℚ, 0 ≤ z → z ≤ 1 → 0 ≤ 72 * z ^ 2 / 25 - 1728 * z ^ 3 / 625 := by intro z hz hzOne have h : 0 ≤ (72 / 625 : ℚ) * z ^ 2 * (25 - 24 * z) := mul_nonneg (by positivity) (by linarith) nlinarith only [h] have he : 0 ≤ e := div_nonneg (le_min (damping a ha (hab.trans hbOne)) (damping b hb hbOne)) (sq_nonneg s) have hE : max ((-72 * (a : ℝ) ^ 2 / 25 + 1728 * (a : ℝ) ^ 3 / 625) / (s : ℝ) ^ 2) ((-72 * (b : ℝ) ^ 2 / 25 + 1728 * (b : ℝ) ^ 3 / 625) / (s : ℝ) ^ 2) = -(e : ℝ) := by dsimp [e] push_cast rw [← min_div_div_right (sq_nonneg (s : ℝ))] have hneg (z : ℝ) : -((72 * z ^ 2 / 25 - 1728 * z ^ 3 / 625) / (s : ℝ) ^ 2) = (-72 * z ^ 2 / 25 + 1728 * z ^ 3 / 625) / (s : ℝ) ^ 2 := by ring rw [neg_inf, hneg, hneg] have hbound := prawitz_exp_neg_le_reciprocal_taylor16 e he rw [← hE] at hbound simpa only [a, b, s, e, Rat.cast_div, Rat.cast_natCast, Rat.cast_ofNat] using hbound
Causalean.Stat.CLT.BerryEsseen.prawitz_high_real_exponential_enclosure · Causalean/Stat/CLT/BerryEsseen/PrawitzHighRealEnclosures.lean:131 · uses prawitzCompactRight , prawitzTaylor16
1 supporting declaration (lemmas, instances)
  • prawitz_high_real_kernel_square_enclosure theorem — On every positive high grid cell, the squared analytic kernel enclosure with real pi is bounded by the rational pi enclosure used by the kernel magnitude certificate.
    i :
    ℕ
    hi :
    i ∈ Ico 1 1000
    a :
    (i : ℝ) / 1000
    b :
    ((i + 1 : ℕ) : ℝ) / 1000
    Q :
    if i < 500 then (1 - a) ^ 2 / 4
    + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 else (1 - a) ^ 2 / 4
    + pi ^ 2 * (1 - a) ^ 4 / 16
    Q ≤ (prawitzRationalKernelSq i : ℝ)
    Proof (Lean source)
    theorem prawitz_high_real_kernel_square_enclosure (i : ℕ) (hi : i ∈ Ico 1 1000) : let a := (i : ℝ) / 1000 let b := ((i + 1 : ℕ) : ℝ) / 1000 let Q := if i < 500 then (1 - a) ^ 2 / 4 + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 else (1 - a) ^ 2 / 4 + pi ^ 2 * (1 - a) ^ 4 / 16 Q ≤ (prawitzRationalKernelSq i : ℝ) := by /- Round 8 lowest analytic kernel layer. Let p=314159/100000 and q=314160/100000; use the CLOSED rational pi bounds. If i<500, 0<a<=b<=1/2. Compare 1-(pi*a)²/2+(pi*b)^4/24 with 1-(p*a)²/2+(q*b)^4/24, and pi*a*(1-(pi*b)²/6) with p*a*(1-(q*b)²/6)>0. The denominator factor is positive since q<4 and b<=1/2. Establish numerator nonnegativity before division and squaring (the proved cosine quartic estimate at pi*a supplies it, since b>=a and cos(pi*a)>=0). Use 1/pi<=1/p. In the upper branch only pi²<=q² and (1-a)^4>=0 are needed. After push_cast, the result is exactly prawitzRationalKernelSq. This is NOT a bound on the assigned kernel value at u=1, which remains excluded a.e. -/ dsimp only let a : ℝ := i / 1000 let b : ℝ := (i + 1 : ℕ) / 1000 let p : ℝ := 314159 / 100000 let q : ℝ := 314160 / 100000 have hpi := prawitz_rational_pi_bounds have hp : 0 < p := by norm_num [p] have hq : q < 4 := by norm_num [q] have hpaPi : p ≤ pi := hpi.1 have hpiq : pi ≤ q := hpi.2 have ha : 0 < a := by dsimp [a] exact div_pos (by exact_mod_cast (mem_Ico.mp hi).1) (by norm_num) have hab : a ≤ b := by dsimp [a, b]; push_cast; linarith have haOne : 0 ≤ 1 - a := by have h := (mem_Ico.mp hi).2 have h' : (i : ℝ) < 1000 := by exact_mod_cast h dsimp [a] linarith unfold prawitzRationalKernelSq split_ifs with h · have hb : b ≤ 1 / 2 := by have h' : (i : ℝ) + 1 ≤ 500 := by exact_mod_cast (by omega : i + 1 ≤ 500) dsimp [b] push_cast linarith have hpb : 0 ≤ pi * b := mul_nonneg Real.pi_pos.le (ha.le.trans hab) have hqb : 0 ≤ q * b := mul_nonneg (by norm_num [q]) (ha.le.trans hab) have hqbTwo : q * b < 2 := by nlinarith [ha.le.trans hab] have hqbSq : (q * b) ^ 2 < 4 := by nlinarith have hfactor : 0 < 1 - (q * b) ^ 2 / 6 := by apply sub_pos.mpr exact (div_lt_one (by norm_num)).2 (hqbSq.trans (by norm_num)) have hpbqb : pi * b ≤ q * b := mul_le_mul_of_nonneg_right hpiq (ha.le.trans hab) have hsqb := pow_le_pow_left₀ hpb hpbqb 2 have hfourb := pow_le_pow_left₀ hpb hpbqb 4 have hsqa := pow_le_pow_left₀ (mul_nonneg hp.le ha.le) (mul_le_mul_of_nonneg_right hpaPi ha.le) 2 let c := 1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24 let C := 1 - (p * a) ^ 2 / 2 + (q * b) ^ 4 / 24 let d := pi * a * (1 - (pi * b) ^ 2 / 6) let D := p * a * (1 - (q * b) ^ 2 / 6) have hc : 0 ≤ c := by have hcos : 0 ≤ cos (pi * a) := Real.cos_nonneg_of_mem_Icc ⟨by nlinarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ have ht := cos_le_quadratic_add_quartic (pi * a) have hfour := pow_le_pow_left₀ (mul_nonneg Real.pi_pos.le ha.le) (mul_le_mul_of_nonneg_left hab Real.pi_pos.le) 4 dsimp [c] linarith have hcC : c ≤ C := add_le_add (sub_le_sub_left (div_le_div_of_nonneg_right hsqa (by norm_num)) 1) (div_le_div_of_nonneg_right hfourb (by norm_num)) have hD : 0 < D := mul_pos (mul_pos hp ha) hfactor have hDd : D ≤ d := by exact mul_le_mul (mul_le_mul_of_nonneg_right hpaPi ha.le) (sub_le_sub_left (div_le_div_of_nonneg_right hsqb (by norm_num)) 1) hfactor.le (mul_nonneg Real.pi_pos.le ha.le) have hfrac : (1 - a) * c / d ≤ (1 - a) * C / D := by calc _ ≤ (1 - a) * c / D := div_le_div_of_nonneg_left (mul_nonneg haOne hc) hD hDd _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hcC haOne) hD.le have hinv : 1 / pi ≤ 1 / p := one_div_le_one_div_of_le hp hpaPi have hnonneg : 0 ≤ ((1 - a) * c / d + 1 / pi) / 2 := by have hd := hD.trans_le hDd positivity have hsq := pow_le_pow_left₀ hnonneg (show ((1 - a) * c / d + 1 / pi) / 2 ≤ ((1 - a) * C / D + 1 / p) / 2 by linarith) 2 push_cast simpa only [a, b, p, q, c, C, d, D, Nat.cast_add, Nat.cast_one] using add_le_add (le_refl ((1 - a) ^ 2 / 4)) hsq · have hsq := pow_le_pow_left₀ Real.pi_pos.le hpiq 2 have hmul := mul_le_mul_of_nonneg_right hsq (pow_nonneg haOne 4) push_cast change (1 - a) ^ 2 / 4 + pi ^ 2 * (1 - a) ^ 4 / 16 ≤ (1 - a) ^ 2 / 4 + q ^ 2 * (1 - a) ^ 4 / 16 exact add_le_add le_rfl (div_le_div_of_nonneg_right hmul (by norm_num))
    Causalean.Stat.CLT.BerryEsseen.prawitz_high_real_kernel_square_enclosure · Causalean/Stat/CLT/BerryEsseen/PrawitzHighRealEnclosures.lean:23
Prawitz­Kernel­Bounds 1 core · 1 supporting The difference from the singular Fourier transform of a half-line is uniformly bounded. ★ prawitzKernel_norm_le

Bounds on Prawitz's principal spectral correction

The difference from the singular Fourier transform of a half-line is uniformly bounded. Its bound supplies an integrable Gaussian smoothing penalty, with much smaller constants than baseline Esseen smoothing.

theorem prawitzKernel_norm_le reviewed
Causalean.Stat.CLT.BerryEsseen

At a nonzero frequency t in the unit band |t| ≤ 1, Prawitz's filter magnitude is at most the reciprocal principal frequency term 1/(2π|t|) plus one half.

Formal statement
t :
ℝ
ht :
0 < |t|
hband :
|t| ≤ 1
‖prawitzKernel t‖ ≤ 1 / (2 * pi * |t|) + 1 / 2
Proof (Lean source)
theorem prawitzKernel_norm_le (t : ℝ) (ht : 0 < |t|) (hband : |t| ≤ 1) : ‖prawitzKernel t‖ ≤ 1 / (2 * pi * |t|) + 1 / 2 := by have hprincipal : ‖Complex.I / ((2 * pi * t : ℝ) : ℂ)‖ = 1 / (2 * pi * |t|) := by simp [abs_of_pos Real.pi_pos] have htriangle : ‖prawitzKernel t‖ ≤ ‖prawitzKernel t - I / ((2 * pi * t : ℝ) : ℂ)‖ + ‖Complex.I / ((2 * pi * t : ℝ) : ℂ)‖ := by simpa only [sub_add_cancel] using norm_add_le (prawitzKernel t - I / ((2 * pi * t : ℝ) : ℂ)) (I / ((2 * pi * t : ℝ) : ℂ)) rw [hprincipal] at htriangle linarith [prawitzKernel_principal_correction_norm_le t ht hband]
Causalean.Stat.CLT.BerryEsseen.prawitzKernel_norm_le · Causalean/Stat/CLT/BerryEsseen/PrawitzKernelBounds.lean:164 · uses prawitzKernel
1 supporting declaration (lemmas, instances)
  • prawitzKernel_principal_correction_norm_le theorem — At each nonzero frequency in the unit band, Prawitz's spectral filter differs from the half-line principal term by at most one half.
    t :
    ℝ
    ht :
    0 < |t|
    hband :
    |t| ≤ 1
    ‖prawitzKernel t - I / ((2 * pi * t : ℝ) : ℂ)‖ ≤ 1 / 2
    Proof (Lean source)
    theorem prawitzKernel_principal_correction_norm_le (t : ℝ) (ht : 0 < |t|) (hband : |t| ≤ 1) : ‖prawitzKernel t - I / ((2 * pi * t : ℝ) : ℂ)‖ ≤ 1 / 2 := by have hpos (u : ℝ) (hu : 0 < u) (hub : u ≤ 1) : ‖prawitzKernel u - I / ((2 * pi * u : ℝ) : ℂ)‖ ≤ 1 / 2 := by have hne : ¬(u = 0 ∨ 1 < |u|) := by simp only [abs_of_pos hu, not_or, not_lt] exact ⟨hu.ne', hub⟩ let z := prawitzKernel u - I / ((2 * pi * u : ℝ) : ℂ) have hre : z.re = (1 - u) / 2 := by dsimp only [z] rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hu, Complex.sub_re, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.div_ofReal_re] ring have him : z.im = -((1 - u) * (1 / (pi * u) - cos (pi * u) / sin (pi * u))) / 2 := by dsimp only [z] rw [prawitzKernel, if_neg hne] simp only [abs_of_pos hu, Real.sign_of_pos hu, Complex.sub_im, Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.div_ofReal_im] simp only [zero_add, zero_mul, add_zero, mul_one] field_simp ring have hsq := correction_sq_le u hu hub have hnorm : ‖z‖ ^ 2 ≤ (1 / 2 : ℝ) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply, hre, him] nlinarith dsimp [z] at hnorm nlinarith [norm_nonneg (prawitzKernel u - I / ((2 * pi * u : ℝ) : ℂ))] rcases lt_or_gt_of_ne (show t ≠ 0 from by simpa using ne_of_gt ht) with hneg | hpositive · have hu : 0 < -t := neg_pos.mpr hneg have heq : prawitzKernel t - I / ((2 * pi * t : ℝ) : ℂ) = star (prawitzKernel (-t) - I / ((2 * pi * (-t) : ℝ) : ℂ)) := by have hne : ¬(t = 0 ∨ 1 < |t|) := not_or.mpr ⟨hneg.ne, not_lt.mpr hband⟩ have hne' : ¬(-t = 0 ∨ 1 < |-t|) := by simpa using hne rw [prawitzKernel, if_neg hne, prawitzKernel, if_neg hne'] apply Complex.ext <;> simp only [Real.sign_of_neg hneg, Real.sign_of_pos hu, abs_neg, Real.sin_neg, Real.cos_neg, mul_neg, Complex.sub_re, Complex.sub_im, Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.div_ofReal_re, Complex.div_ofReal_im, Complex.star_def, Complex.conj_re, Complex.conj_im] <;> ring rw [heq, norm_star] exact hpos (-t) hu (by simpa [abs_of_neg hneg] using hband) · exact hpos t hpositive (by simpa [abs_of_pos hpositive] using hband)
    Causalean.Stat.CLT.BerryEsseen.prawitzKernel_principal_correction_norm_le · Causalean/Stat/CLT/BerryEsseen/PrawitzKernelBounds.lean:110
Prawitz­Low­Gaussian­Moments 1 core · 0 supporting This elementary real integral controls a polynomial Gaussian majorant of the low-frequency Prawitz contribution when the moment ratio is at most one hundredth. ★ prawitz_low_gaussian_moment_budget

Gaussian moment allocation for small Prawitz ratios

This elementary real integral controls a polynomial Gaussian majorant of the low-frequency Prawitz contribution when the moment ratio is at most one hundredth. It is a helper case, not a replacement for the full budget. No characteristic-function or smoothing theorem is a premise.

theorem prawitz_low_gaussian_moment_budget reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive ratio ρ at most one hundredth, the integral over t > 0 of the polynomial Gaussian low-frequency majorant (ρt²/(6π) + ρ²t³/(8π) + 5ρ²t³/72 + 5ρ³t⁴/96)·exp(−23t²/100) is at most one quarter of ρ.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
hsmall :
ρ ≤ 1 / 100
(∫ t in Ioi (0 : ℝ), (ρ * t ^ 2 / (6 * pi) + ρ ^ 2 * t ^ 3 / (8 * pi) + 5 * ρ ^ 2 * t ^ 3 / 72 + 5 * ρ ^ 3 * t ^ 4 / 96) * exp (-(23 * t ^ 2 / 100)))
≤ ρ / 4
Proof (Lean source)
theorem prawitz_low_gaussian_moment_budget (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ ≤ 1 / 100) : (∫ t in Ioi (0 : ℝ), (ρ * t ^ 2 / (6 * pi) + ρ ^ 2 * t ^ 3 / (8 * pi) + 5 * ρ ^ 2 * t ^ 3 / 72 + 5 * ρ ^ 3 * t ^ 4 / 96) * exp (-(23 * t ^ 2 / 100))) ≤ ρ / 4 := by /- Evaluate the second, third, and fourth Gaussian moments with Mathlib's integral_rpow_mul_exp_neg_mul_rpow (p=2) and the Gamma half-integer identities. Prove integrability before splitting the integral. Bound the resulting constants using rational pi/sqrt bounds, and use ρ≤1/100. The coefficient after division by ρ is below .224 throughout this case; that numerical observation is guidance, never a certificate. Connection to the unchanged low budget: log(1/ρ)≤1/ρ-1 gives ρ*U0≤1/5 for ρ≤1/100. Thus on [0,U0] the Taylor envelope is at most its polynomial times exp(-23t²/100). The proven kernel bound gives (2/U)*‖K(t/U)‖≤1/(πt)+5ρ/12 for t>0. Expanding their product gives exactly this nonsingular polynomial. Endpoint integrability and that comparison, followed by nonnegative integral restriction, remain to be assembled in PrawitzBudgetLow. The complementary ρ>1/100 case still requires a separate compact-parameter certificate using the min envelope. Do not claim this lemma alone proves prawitz_budget_low. -/ let b : ℝ := 23 / 100 have hb : 0 < b := by norm_num [b] have hint (n : ℕ) : IntegrableOn (fun t : ℝ => t ^ n * exp (-b * t ^ 2)) (Ioi 0) := by simpa only [Real.rpow_natCast, Real.rpow_two] using (integrableOn_rpow_mul_exp_neg_mul_sq (s := (n : ℝ)) hb (by have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n linarith)) have heval (n : ℕ) : (∫ t in Ioi (0 : ℝ), t ^ n * exp (-b * t ^ 2)) = b ^ (-((n : ℝ) + 1) / 2) * (1 / 2) * Gamma (((n : ℝ) + 1) / 2) := by simpa only [Real.rpow_natCast, Real.rpow_two] using (integral_rpow_mul_exp_neg_mul_rpow (p := 2) (q := (n : ℝ)) (by norm_num) (by have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n linarith) hb) have hg3 : Gamma (3 / 2) = sqrt pi / 2 := by rw [show (3 / 2 : ℝ) = 1 / 2 + 1 by norm_num, Real.Gamma_add_one (by norm_num : (1 / 2 : ℝ) ≠ 0), Real.Gamma_one_half_eq] ring have hg5 : Gamma (5 / 2) = 3 * sqrt pi / 4 := by rw [show (5 / 2 : ℝ) = 3 / 2 + 1 by norm_num, Real.Gamma_add_one (by norm_num : (3 / 2 : ℝ) ≠ 0), hg3] ring have hr3 : b ^ (-(3 / 2 : ℝ)) = (b * sqrt b)⁻¹ := by rw [Real.rpow_neg hb.le, show (3 / 2 : ℝ) = 1 + 1 / 2 by norm_num, Real.rpow_add hb, Real.rpow_one, ← Real.sqrt_eq_rpow] have hr5 : b ^ (-(5 / 2 : ℝ)) = (b ^ 2 * sqrt b)⁻¹ := by rw [Real.rpow_neg hb.le, show (5 / 2 : ℝ) = (2 : ℕ) + 1 / 2 by norm_num, Real.rpow_add hb, Real.rpow_natCast, ← Real.sqrt_eq_rpow] have hs : 47 / 100 ≤ sqrt b := by have := Real.sq_sqrt hb.le have := Real.sqrt_nonneg b dsimp [b] at * nlinarith have hsp : sqrt pi ≤ 9 / 5 := by have := Real.sq_sqrt Real.pi_pos.le have := Real.sqrt_nonneg pi nlinarith [Real.pi_lt_d2] have h2 : (∫ t in Ioi (0 : ℝ), t ^ 2 * exp (-b * t ^ 2)) ≤ 21 / 5 := by rw [heval] rw [show (-((2 : ℕ) + 1 : ℝ) / 2) = -(3 / 2 : ℝ) by norm_num, show (((2 : ℕ) + 1 : ℝ) / 2) = (3 / 2 : ℝ) by norm_num] rw [hr3, hg3] have hden : 0 < b * sqrt b := by positivity have heq : (b * sqrt b)⁻¹ * (1 / 2) * (sqrt pi / 2) = sqrt pi / (4 * b * sqrt b) := by field_simp norm_num rw [heq] apply (div_le_iff₀ (by positivity)).2 dsimp [b] at * nlinarith have h3 : (∫ t in Ioi (0 : ℝ), t ^ 3 * exp (-b * t ^ 2)) ≤ 10 := by rw [heval] norm_num [b, Real.rpow_neg, Real.rpow_natCast, Real.Gamma_nat_eq_factorial] have h4 : (∫ t in Ioi (0 : ℝ), t ^ 4 * exp (-b * t ^ 2)) ≤ 30 := by rw [heval] rw [show (-((4 : ℕ) + 1 : ℝ) / 2) = -(5 / 2 : ℝ) by norm_num, show (((4 : ℕ) + 1 : ℝ) / 2) = (5 / 2 : ℝ) by norm_num] rw [hr5, hg5] have heq : (b ^ 2 * sqrt b)⁻¹ * (1 / 2) * (3 * sqrt pi / 4) = 3 * sqrt pi / (8 * b ^ 2 * sqrt b) := by field_simp norm_num rw [heq] apply (div_le_iff₀ (by positivity)).2 dsimp [b] at * nlinarith have hsplit : (∫ t in Ioi (0 : ℝ), (ρ * t ^ 2 / (6 * pi) + ρ ^ 2 * t ^ 3 / (8 * pi) + 5 * ρ ^ 2 * t ^ 3 / 72 + 5 * ρ ^ 3 * t ^ 4 / 96) * exp (-(23 * t ^ 2 / 100))) = (ρ / (6 * pi)) * (∫ t in Ioi (0 : ℝ), t ^ 2 * exp (-b * t ^ 2)) + (ρ ^ 2 / (8 * pi)) * (∫ t in Ioi (0 : ℝ), t ^ 3 * exp (-b * t ^ 2)) + (5 * ρ ^ 2 / 72) * (∫ t in Ioi (0 : ℝ), t ^ 3 * exp (-b * t ^ 2)) + (5 * ρ ^ 3 / 96) * (∫ t in Ioi (0 : ℝ), t ^ 4 * exp (-b * t ^ 2)) := by have heq : (fun t : ℝ => (ρ * t ^ 2 / (6 * pi) + ρ ^ 2 * t ^ 3 / (8 * pi) + 5 * ρ ^ 2 * t ^ 3 / 72 + 5 * ρ ^ 3 * t ^ 4 / 96) * exp (-(23 * t ^ 2 / 100))) = (fun t : ℝ => (ρ / (6 * pi)) * (t ^ 2 * exp (-b * t ^ 2)) + (ρ ^ 2 / (8 * pi)) * (t ^ 3 * exp (-b * t ^ 2)) + (5 * ρ ^ 2 / 72) * (t ^ 3 * exp (-b * t ^ 2)) + (5 * ρ ^ 3 / 96) * (t ^ 4 * exp (-b * t ^ 2))) := by funext t dsimp [b] rw [show -(23 * t ^ 2 / 100) = -(23 / 100 : ℝ) * t ^ 2 by ring] ring have hi2 := (hint 2).const_mul (ρ / (6 * pi)) have hi3 := (hint 3).const_mul (ρ ^ 2 / (8 * pi)) have hi3' := (hint 3).const_mul (5 * ρ ^ 2 / 72) have hi4 := (hint 4).const_mul (5 * ρ ^ 3 / 96) rw [heq] have hadd4 := integral_add ((hi2.add hi3).add hi3') hi4 have hadd3 := integral_add (hi2.add hi3) hi3' have hadd2 := integral_add hi2 hi3 simp only [Pi.add_apply] at hadd4 hadd3 hadd2 rw [hadd4, hadd3, hadd2] simp only [integral_const_mul] rw [hsplit] have hm2 := mul_le_mul_of_nonneg_left h2 (by positivity : 0 ≤ ρ / (6 * pi)) have hm3 := mul_le_mul_of_nonneg_left h3 (by positivity : 0 ≤ ρ ^ 2 / (8 * pi)) have hm3' := mul_le_mul_of_nonneg_left h3 (by positivity : 0 ≤ 5 * ρ ^ 2 / 72) have hm4 := mul_le_mul_of_nonneg_left h4 (by positivity : 0 ≤ 5 * ρ ^ 3 / 96) have hc2 : ρ / (6 * pi) * (21 / 5) ≤ 7 * ρ / 30 := by rw [div_mul_eq_mul_div] apply (div_le_iff₀ (by positivity)).2 nlinarith [Real.pi_gt_three] have hc3 : ρ ^ 2 / (8 * pi) * 10 ≤ 5 * ρ ^ 2 / 12 := by rw [div_mul_eq_mul_div] apply (div_le_iff₀ (by positivity)).2 nlinarith [Real.pi_gt_three, sq_nonneg ρ] have hr2 : ρ ^ 2 ≤ ρ / 100 := by nlinarith have hr3 : ρ ^ 3 ≤ ρ / 10000 := by have hm := mul_le_mul_of_nonneg_right hr2 hρ.le nlinarith nlinarith
Causalean.Stat.CLT.BerryEsseen.prawitz_low_gaussian_moment_budget · Causalean/Stat/CLT/BerryEsseen/PrawitzLowGaussianMoments.lean:20
Prawitz­Low­Real­Enclosures 1 core · 1 supporting These inequalities compare the proved analytic integral majorants with the unchanged rational table terms. ★ prawitz_low_real_cell_enclosure

Analytic adapters for the rational low-frequency cells

These inequalities compare the proved analytic integral majorants with the unchanged rational table terms. They are independent of the real cutoff adapter, the finite low sum certificate, and both integral budgets. The positive grid cells stay inside the band by the rational cutoff certificate, so their cubic endpoint damping is nonnegative before reciprocal Taylor bounds are used. No numerical integral allocation is a premise.

theorem prawitz_low_real_cell_enclosure reviewed
Causalean.Stat.CLT.BerryEsseen

On the j-th certified parameter cell, with rational endpoints r < s, and the i-th positive low grid cell [a, b] = [i/200, (i+1)/200] below the cell's low cutoff index, the analytic cell majorant (b − a)·(1/(πa) + 5s/12)·min((b³/6 + s·b⁴/8)·exp(E/2), (min(1, exp E) + exp(−a²/2))/r), where E is the larger of the two endpoint exponents −a²/2 + s·a³/5 and −b²/2 + s·b³/5, is at most the cell's rational table entry.

Formal statement
j :
Fin 270
i :
ℕ
hi :
i ∈ Ico 1 (prawitzLowCutoffIndex j.val)
r :
(prawitzCompactLeft j.val : ℝ)
s :
(prawitzCompactRight j.val : ℝ)
a :
(i : ℝ) / 200
b :
((i + 1 : ℕ) : ℝ) / 200
E :
max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5)
(b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2)) ((min 1 (exp E) + exp (-(a ^ 2 / 2))) / r)
≤ (prawitzRationalLowCell j.val i : ℝ)
Proof (Lean source)
theorem prawitz_low_real_cell_enclosure (j : Fin 270) (i : ℕ) (hi : i ∈ Ico 1 (prawitzLowCutoffIndex j.val)) : let r := (prawitzCompactLeft j.val : ℝ) let s := (prawitzCompactRight j.val : ℝ) let a := (i : ℝ) / 200 let b := ((i + 1 : ℕ) : ℝ) / 200 let E := max (-(a ^ 2 / 2) + s * a ^ 3 / 5) (-(b ^ 2 / 2) + s * b ^ 3 / 5) (b - a) * (1 / (pi * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) * exp (E / 2)) ((min 1 (exp E) + exp (-(a ^ 2 / 2))) / r) ≤ (prawitzRationalLowCell j.val i : ℝ) := by /- Round 8 lowest analytic layer. From hi obtain 1<=i and i+1<=K. The CLOSED cutoff certificate gives 0<r<s<=1 and K/200<=12/(5*s). Thus 0<a<=b and s*b<=12/5<5/2, so both a²/2-s*a³/5 and b²/2-s*b³/5 are nonnegative. Their rational minimum e casts to -E. Use prawitz_exp_neg_le_reciprocal_taylor16 at e/2, e, and a²/2. Dropping min 1 in the second branch is an upper bound, not a new approximation premise. Replace 1/(pi*a) by 1/(p*a), p=314159/100000; all factors are nonnegative. Show b-a=1/200 and push_cast to match prawitzRationalLowCell exactly. This retains the SHARP endpoint maximum in PrawitzCompactCellIntegrals, not the looser independent endpoint majorant. Do not replace the minimum by one chosen branch, alter grid endpoints, or import either compact budget. -/ dsimp only let r := prawitzCompactLeft j.val let s := prawitzCompactRight j.val let a : ℚ := i / 200 let b : ℚ := (i + 1 : ℕ) / 200 let e := min (a ^ 2 / 2 - s * a ^ 3 / 5) (b ^ 2 / 2 - s * b ^ 3 / 5) have hc := prawitz_compact_cutoff_rational_certificate j dsimp only at hc have hr : 0 < r := hc.1 have hs : 0 < s := hr.trans hc.2.1 have hia := (mem_Ico.mp hi).1 have hib : i + 1 ≤ prawitzLowCutoffIndex j.val := by have := (mem_Ico.mp hi).2 omega have ha : 0 < a := by dsimp [a]; positivity have hab : a ≤ b := by dsimp [a, b] exact div_le_div_of_nonneg_right (by exact_mod_cast (by omega : i ≤ i + 1)) (by norm_num) have hb : b ≤ (prawitzLowCutoffIndex j.val : ℚ) / 200 := by dsimp [b] exact div_le_div_of_nonneg_right (by exact_mod_cast hib) (by norm_num) have hsb : s * b ≤ 12 / 5 := by have hcut := hc.2.2.2.2.2.2.2.1 have h := (le_div_iff₀ (by positivity : 0 < 5 * s)).mp hcut nlinarith only [h, mul_le_mul_of_nonneg_left hb hs.le] have hsa : s * a ≤ 12 / 5 := (mul_le_mul_of_nonneg_left hab hs.le).trans hsb have hda : 0 ≤ a ^ 2 / 2 - s * a ^ 3 / 5 := by have h : 0 ≤ a ^ 2 * (1 / 2 - s * a / 5) := mul_nonneg (sq_nonneg a) (by linarith only [hsa]) nlinarith only [h] have hdb : 0 ≤ b ^ 2 / 2 - s * b ^ 3 / 5 := by have h : 0 ≤ b ^ 2 * (1 / 2 - s * b / 5) := mul_nonneg (sq_nonneg b) (by linarith only [hsb]) nlinarith only [h] have he : 0 ≤ e := le_min hda hdb have hE : max (-(((a : ℝ) ^ 2) / 2) + (s : ℝ) * (a : ℝ) ^ 3 / 5) (-(((b : ℝ) ^ 2) / 2) + (s : ℝ) * (b : ℝ) ^ 3 / 5) = -(e : ℝ) := by dsimp [e] push_cast rcases le_total ((a : ℝ) ^ 2 / 2 - (s : ℝ) * (a : ℝ) ^ 3 / 5) ((b : ℝ) ^ 2 / 2 - (s : ℝ) * (b : ℝ) ^ 3 / 5) with h | h · rw [min_eq_left h, max_eq_left (by linarith only [h])] ring · rw [min_eq_right h, max_eq_right (by linarith only [h])] ring have hhalf := prawitz_exp_neg_le_reciprocal_taylor16 (e / 2) (by positivity) have hfull := prawitz_exp_neg_le_reciprocal_taylor16 e he have hgauss := prawitz_exp_neg_le_reciprocal_taylor16 (a ^ 2 / 2) (by positivity) push_cast at hhalf hfull hgauss have hr' : 0 < (r : ℝ) := by exact_mod_cast hr have hs' : 0 < (s : ℝ) := by exact_mod_cast hs have ha' : 0 < (a : ℝ) := by exact_mod_cast ha have hb' : 0 < (b : ℝ) := by exact_mod_cast (ha.trans_le hab) have hwidth : (b : ℝ) - (a : ℝ) = 1 / 200 := by dsimp [a, b] push_cast ring have hp : 1 / (pi * (a : ℝ)) ≤ 1 / ((314159 / 100000 : ℝ) * (a : ℝ)) := by gcongr exact prawitz_rational_pi_bounds.1 have hbranches : min (((b : ℝ) ^ 3 / 6 + (s : ℝ) * (b : ℝ) ^ 4 / 8) * exp (-(e : ℝ) / 2)) ((min 1 (exp (-(e : ℝ))) + exp (-((a : ℝ) ^ 2 / 2))) / (r : ℝ)) ≤ min (((b : ℝ) ^ 3 / 6 + (s : ℝ) * (b : ℝ) ^ 4 / 8) / (prawitzTaylor16 (e / 2) : ℝ)) ((1 / (prawitzTaylor16 e : ℝ) + 1 / (prawitzTaylor16 (a ^ 2 / 2) : ℝ)) / (r : ℝ)) := by apply min_le_min · simpa only [div_eq_mul_inv, one_mul, neg_mul] using mul_le_mul_of_nonneg_left hhalf (by positivity : 0 ≤ (b : ℝ) ^ 3 / 6 + (s : ℝ) * (b : ℝ) ^ 4 / 8) · exact div_le_div_of_nonneg_right (add_le_add ((min_le_right _ _).trans hfull) hgauss) hr'.le have hac : (i : ℝ) / 200 = (a : ℝ) := by simp [a] have hbc : ((i + 1 : ℕ) : ℝ) / 200 = (b : ℝ) := by simp [b] rw [hac, hbc] change ((b : ℝ) - (a : ℝ)) * (1 / (pi * (a : ℝ)) + 5 * (s : ℝ) / 12) * min (((b : ℝ) ^ 3 / 6 + (s : ℝ) * (b : ℝ) ^ 4 / 8) * exp (max (-((a : ℝ) ^ 2 / 2) + (s : ℝ) * (a : ℝ) ^ 3 / 5) (-((b : ℝ) ^ 2 / 2) + (s : ℝ) * (b : ℝ) ^ 3 / 5) / 2)) ((min 1 (exp (max (-((a : ℝ) ^ 2 / 2) + (s : ℝ) * (a : ℝ) ^ 3 / 5) (-((b : ℝ) ^ 2 / 2) + (s : ℝ) * (b : ℝ) ^ 3 / 5))) + exp (-((a : ℝ) ^ 2 / 2))) / (r : ℝ)) ≤ _ rw [hE, hwidth] unfold prawitzRationalLowCell change _ ≤ (((1 / 200 : ℚ) * (1 / ((314159 / 100000 : ℚ) * a) + 5 * s / 12) * min ((b ^ 3 / 6 + s * b ^ 4 / 8) / prawitzTaylor16 (e / 2)) ((1 / prawitzTaylor16 e + 1 / prawitzTaylor16 (a ^ 2 / 2)) / r) : ℚ) : ℝ) push_cast apply mul_le_mul · exact mul_le_mul_of_nonneg_left (add_le_add hp le_rfl) (by norm_num) · exact hbranches · positivity · positivity
1 supporting declaration (lemmas, instances)
  • prawitz_low_real_initial_enclosure theorem — On each certified parameter cell, the analytic polynomial enclosure of the singular initial low interval is bounded by its rational table entry.
    j :
    Fin 270
    s :
    (prawitzCompactRight j.val : ℝ)
    a :
    (1 / 200 : ℝ)
    (1 / pi + 5 * s * a / 12) * (1 / 6 + s * a / 8) * a ^ 3 / 3
    ≤ (prawitzRationalLowInitial j.val : ℝ)
    Proof (Lean source)
    theorem prawitz_low_real_initial_enclosure (j : Fin 270) : let s := (prawitzCompactRight j.val : ℝ) let a := (1 / 200 : ℝ) (1 / pi + 5 * s * a / 12) * (1 / 6 + s * a / 8) * a ^ 3 / 3 ≤ (prawitzRationalLowInitial j.val : ℝ) := by /- Use positive s from the CLOSED cutoff certificate. Replace only 1/pi by 1/(314159/100000), using prawitz_rational_pi_bounds. All other nonnegative factors are identical after push_cast. This corresponds exactly to prawitz_low_compact_initial_integral_bound in PrawitzBudgetLowCompact; no integral proof needs to be copied. -/ dsimp only have hc := prawitz_compact_cutoff_rational_certificate j dsimp only at hc have hs : 0 ≤ (prawitzCompactRight j.val : ℝ) := by exact_mod_cast (hc.1.trans hc.2.1).le have hp := prawitz_rational_pi_bounds unfold prawitzRationalLowInitial push_cast gcongr exact hp.1
    Causalean.Stat.CLT.BerryEsseen.prawitz_low_real_initial_enclosure · Causalean/Stat/CLT/BerryEsseen/PrawitzLowRealEnclosures.lean:20
Prawitz­Rescaled­Cells 1 core · 2 supporting The frequency endpoints in these enclosures are fixed fractions of the actual outer cutoff. ★ prawitz_high_rescaled_upper_cell_integral_bound

High-frequency certificates with cells proportional to the bandwidth

The frequency endpoints in these enclosures are fixed fractions of the actual outer cutoff. This avoids extending a frequency cell beyond that cutoff as the moment ratio varies. On such cells the cubic exponent is a negative polynomial divided by the squared moment ratio. Its upper bound uses only the upper parameter endpoint, while the interval length uses the lower endpoint. These are analytic cell bounds, not numerical budgets.

The file proves three bounds: the moment envelope at a rescaled frequency is dominated by the two endpoint cubic exponents at the upper parameter (prawitz_rescaled_moment_cell_bound), and the lower-half and upper-half cell integrals of the high-frequency integrand are bounded by the cell length times an explicit polynomial bound on the filter times the endpoint exponential envelope (prawitz_high_rescaled_lower_cell_integral_bound, prawitz_high_rescaled_upper_cell_integral_bound). Summing these cell bounds over a rational grid into the numerical high-frequency budget is done downstream in PrawitzBudgetHighCompact, not here.

theorem prawitz_high_rescaled_upper_cell_integral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

On a positive parameter cell r ≤ ρ ≤ s and an upper-half kernel cell 1/2 ≤ a ≤ b ≤ 1, with outer cutoff U = 12/(5ρ), the integral over the moving frequency cell [Ua, Ub] of the Prawitz filter magnitude at t/U times the moment envelope is at most (12/(5r))·(b − a)·√Q·min(1, exp E), where Q = (1 − a)²/4 + π²(1 − a)⁴/16 is a reflected polynomial bound on the filter and E is the larger of the two rescaled endpoint exponents (−72c²/25 + 1728c³/625)/s² at c = a and c = b; this includes cells ending at the outer cutoff.

Formal statement
ρ r s a b :
ℝ
hr :
0 < r
hrρ :
r ≤ ρ
hρs :
ρ ≤ s
ha :
1 / 2 ≤ a
hab :
a ≤ b
hb :
b ≤ 1
U :
12 / (5 * ρ)
Q :
(1 - a) ^ 2 / 4 + pi ^ 2 * (1 - a) ^ 4 / 16
E :
max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2)
(∫ t in (U * a)..(U * b), ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t)
≤ (12 / (5 * r)) * (b - a) * sqrt Q * min 1 (exp E)
Proof (Lean source)
theorem prawitz_high_rescaled_upper_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 1 / 2 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) : let U := 12 / (5 * ρ) let Q := (1 - a) ^ 2 / 4 + pi ^ 2 * (1 - a) ^ 4 / 16 let E := max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2) (∫ t in (U * a)..(U * b), ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ (12 / (5 * r)) * (b - a) * sqrt Q * min 1 (exp E) := by /- As in the lower cell but compare only on Ioo: t<U*b<=U excludes the assigned outer endpoint. Use prawitz_high_compact_kernel_sq_upper and 1-t/U<=1-a, then the proved rescaled moment cell bound. The original kernel value at t=U is unchanged and excluded ONLY almost everywhere. This imports no numerical budget and assumes no such allocation. -/ dsimp only let U := 12 / (5 * ρ) let Q := (1 - a) ^ 2 / 4 + pi ^ 2 * (1 - a) ^ 4 / 16 let E := max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2) have hρ : 0 < ρ := hr.trans_le hrρ have hU : 0 < U := by dsimp [U]; positivity have ha0 : 0 < a := by linarith have hb1 : b ≤ 1 := hb have hcell : U * a ≤ U * b := mul_le_mul_of_nonneg_left hab hU.le have hbU : U * b ≤ U := by simpa using mul_le_mul_of_nonneg_left hb1 hU.le have hi := prawitz_high_compact_intervalIntegrable ρ U (U * a) (U * b) hU (mul_pos hU ha0) hcell hbU have hUr : U ≤ 12 / (5 * r) := by dsimp [U] exact div_le_div_of_nonneg_left (by norm_num) (by positivity) (mul_le_mul_of_nonneg_left hrρ (by norm_num)) calc _ ≤ ∫ _t in (U * a)..(U * b), sqrt Q * min 1 (exp E) := by apply intervalIntegral.integral_mono_on_of_le_Ioo hcell hi intervalIntegrable_const intro t ht have hau : a ≤ t / U := (le_div_iff₀ hU).2 (by simpa [mul_comm] using ht.1.le) have hub : t / U ≤ b := (div_le_iff₀ hU).2 (by simpa [mul_comm] using ht.2.le) have hu1 : t / U < 1 := (div_lt_one hU).2 (ht.2.trans_le hbU) have hk : ‖prawitzKernel (t / U)‖ ≤ sqrt Q := by apply Real.le_sqrt_of_sq_le apply (prawitz_high_compact_kernel_sq_upper _ (ha.trans hau) hu1).trans dsimp [Q] gcongr have heq : U * (t / U) = t := by field_simp have he := prawitz_rescaled_moment_cell_bound ρ s (t / U) a b hρ hρs ha0.le hau hub hb1 change prawitzMomentEnvelope ρ (U * (t / U)) ≤ min 1 (exp E) at he rw [heq] at he exact mul_le_mul hk he (by unfold prawitzMomentEnvelope; positivity) (Real.sqrt_nonneg _) _ = U * (b - a) * sqrt Q * min 1 (exp E) := by rw [intervalIntegral.integral_const] ring _ ≤ _ := by apply mul_le_mul_of_nonneg_right _ (by positivity) apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) exact mul_le_mul_of_nonneg_right hUr (sub_nonneg.mpr hab)
Causalean.Stat.CLT.BerryEsseen.prawitz_high_rescaled_upper_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzRescaledCells.lean:146 · uses prawitzKernel , prawitzMomentEnvelope
2 supporting declarations (lemmas, instances)
  • prawitz_rescaled_moment_cell_bound theorem — Within a positive parameter cell and a nonnegative cell of the kernel band, the moment envelope at the rescaled frequency is bounded by the two endpoint cubic exponents at the upper parameter.
    ρ s u a b :
    ℝ
    hρ :
    0 < ρ
    hρs :
    ρ ≤ s
    ha :
    0 ≤ a
    hau :
    a ≤ u
    hub :
    u ≤ b
    hb :
    b ≤ 1
    prawitzMomentEnvelope ρ ((12 / (5 * ρ)) * u)
    ≤ min 1 (exp (max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2)))
    Proof (Lean source)
    theorem prawitz_rescaled_moment_cell_bound (ρ s u a b : ℝ) (hρ : 0 < ρ) (hρs : ρ ≤ s) (ha : 0 ≤ a) (hau : a ≤ u) (hub : u ≤ b) (hb : b ≤ 1) : prawitzMomentEnvelope ρ ((12 / (5 * ρ)) * u) ≤ min 1 (exp (max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2))) := by have hs : 0 < s := hρ.trans_le hρs have hu : 0 ≤ u := ha.trans hau have hu1 : u ≤ 1 := hub.trans hb let C : ℝ := -72 * u ^ 2 / 25 + 1728 * u ^ 3 / 625 have hC : C ≤ 0 := by have h := mul_nonneg (sq_nonneg u) (sub_nonneg.mpr hu1) dsimp [C] nlinarith [sq_nonneg u] have hsq : ρ ^ 2 ≤ s ^ 2 := pow_le_pow_left₀ hρ.le hρs 2 have hdiv : C / ρ ^ 2 ≤ C / s ^ 2 := by apply (div_le_div_iff₀ (sq_pos_of_pos hρ) (sq_pos_of_pos hs)).mpr have h := mul_nonpos_of_nonpos_of_nonneg hC (sub_nonneg.mpr hsq) nlinarith have he := prawitz_cubic_exponent_cell_bound s s ((12 / (5 * s)) * u) ((12 / (5 * s)) * a) ((12 / (5 * s)) * b) hs.le le_rfl (by positivity) (mul_le_mul_of_nonneg_left hau (by positivity)) (mul_le_mul_of_nonneg_left hub (by positivity)) have heq (z : ℝ) : -(((12 / (5 * s)) * z) ^ 2 / 2) + s * ((12 / (5 * s)) * z) ^ 3 / 5 = (-72 * z ^ 2 / 25 + 1728 * z ^ 3 / 625) / s ^ 2 := by field_simp ring rw [heq u, heq a, heq b] at he unfold prawitzMomentEnvelope apply min_le_min_left 1 apply Real.exp_le_exp.mpr have hfreq : 0 ≤ (12 / (5 * ρ)) * u := by positivity rw [abs_of_nonneg hfreq] have hreal : -(((12 / (5 * ρ)) * u) ^ 2 / 2) + ρ * ((12 / (5 * ρ)) * u) ^ 3 / 5 = C / ρ ^ 2 := by dsimp [C] field_simp ring rw [hreal] exact hdiv.trans he
    Causalean.Stat.CLT.BerryEsseen.prawitz_rescaled_moment_cell_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzRescaledCells.lean:32
  • prawitz_high_rescaled_lower_cell_integral_bound theorem — On a positive parameter cell and a positive lower-half kernel cell, the high-frequency integral over the corresponding moving frequency cell has an explicit endpoint enclosure.
    ρ r s a b :
    ℝ
    hr :
    0 < r
    hrρ :
    r ≤ ρ
    hρs :
    ρ ≤ s
    ha :
    0 < a
    hab :
    a ≤ b
    hb :
    b ≤ 1 / 2
    U :
    12 / (5 * ρ)
    Q :
    (1 - a) ^ 2 / 4
    + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2
    E :
    max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2)
    (∫ t in (U * a)..(U * b), ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t)
    ≤ (12 / (5 * r)) * (b - a) * sqrt Q * min 1 (exp E)
    Proof (Lean source)
    theorem prawitz_high_rescaled_lower_cell_integral_bound (ρ r s a b : ℝ) (hr : 0 < r) (hrρ : r ≤ ρ) (hρs : ρ ≤ s) (ha : 0 < a) (hab : a ≤ b) (hb : b ≤ 1 / 2) : let U := 12 / (5 * ρ) let Q := (1 - a) ^ 2 / 4 + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 let E := max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2) (∫ t in (U * a)..(U * b), ‖prawitzKernel (t / U)‖ * prawitzMomentEnvelope ρ t) ≤ (12 / (5 * r)) * (b - a) * sqrt Q * min 1 (exp E) := by /- Apply the proved high interval-integrability helper on [U*a,U*b]. For interior t set u=t/U in [a,b]. The proved Taylor squared norm enclosure uses these FIXED kernel endpoints, independent of rho. Apply prawitz_rescaled_moment_cell_bound and U*(t/U)=t, then integrate the constant bound. Finally U<=12/(5*r) and all factors are nonnegative. No substitution theorem or cutoff/log certificate is needed for this leaf. -/ dsimp only let U := 12 / (5 * ρ) let Q := (1 - a) ^ 2 / 4 + (((1 - a) * (1 - (pi * a) ^ 2 / 2 + (pi * b) ^ 4 / 24) / (pi * a * (1 - (pi * b) ^ 2 / 6)) + 1 / pi) / 2) ^ 2 let E := max ((-72 * a ^ 2 / 25 + 1728 * a ^ 3 / 625) / s ^ 2) ((-72 * b ^ 2 / 25 + 1728 * b ^ 3 / 625) / s ^ 2) have hρ : 0 < ρ := hr.trans_le hrρ have hU : 0 < U := by dsimp [U]; positivity have ha0 : 0 < a := ha have hb1 : b ≤ 1 := by linarith have hcell : U * a ≤ U * b := mul_le_mul_of_nonneg_left hab hU.le have hbU : U * b ≤ U := by simpa using mul_le_mul_of_nonneg_left hb1 hU.le have hi := prawitz_high_compact_intervalIntegrable ρ U (U * a) (U * b) hU (mul_pos hU ha0) hcell hbU have hUr : U ≤ 12 / (5 * r) := by dsimp [U] exact div_le_div_of_nonneg_left (by norm_num) (by positivity) (mul_le_mul_of_nonneg_left hrρ (by norm_num)) calc _ ≤ ∫ _t in (U * a)..(U * b), sqrt Q * min 1 (exp E) := by apply intervalIntegral.integral_mono_on hcell hi intervalIntegrable_const intro t ht have hau : a ≤ t / U := (le_div_iff₀ hU).2 (by simpa [mul_comm] using ht.1) have hub : t / U ≤ b := (div_le_iff₀ hU).2 (by simpa [mul_comm] using ht.2) have hk : ‖prawitzKernel (t / U)‖ ≤ sqrt Q := Real.le_sqrt_of_sq_le (prawitzKernel_lower_cell_taylor_sq_bound _ a b ha hau hub hb) have heq : U * (t / U) = t := by field_simp have he := prawitz_rescaled_moment_cell_bound ρ s (t / U) a b hρ hρs ha0.le hau hub hb1 change prawitzMomentEnvelope ρ (U * (t / U)) ≤ min 1 (exp E) at he rw [heq] at he exact mul_le_mul hk he (by unfold prawitzMomentEnvelope; positivity) (Real.sqrt_nonneg _) _ = U * (b - a) * sqrt Q * min 1 (exp E) := by rw [intervalIntegral.integral_const] ring _ ≤ _ := by apply mul_le_mul_of_nonneg_right _ (by positivity) apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) exact mul_le_mul_of_nonneg_right hUr (sub_nonneg.mpr hab)
    Causalean.Stat.CLT.BerryEsseen.prawitz_high_rescaled_lower_cell_integral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzRescaledCells.lean:81
Prawitz­Sign­Comparison 1 core · 2 supporting The cotangent sine approximation has a squared-sinc error majorant. ★ prawitzSignApprox_integrable_and_error

Pointwise half-line comparison for Prawitz smoothing

The cotangent sine approximation has a squared-sinc error majorant. This is a deterministic spatial inequality, not an assumed probability bound. It includes the discontinuity at zero, so later CDF bounds allow atoms.

theorem prawitzSignApprox_integrable_and_error reviewed
Causalean.Stat.CLT.BerryEsseen

At every real point y, the sine integrand defining Prawitz's sign approximation is integrable on [0, 1], and the error between the sign of y and Prawitz's sign approximation at y is at most sinc(y/2)².

Formal statement
y :
ℝ
conclusion 1
IntervalIntegrable (fun t : ℝ => prawitzSineWeight t * sin (t * y)) volume 0 1
conclusion 2
|sign y - prawitzSignApprox y| ≤ sinc (y / 2) ^ 2
Proof (Lean source)
theorem prawitzSignApprox_integrable_and_error (y : ℝ) : IntervalIntegrable (fun t : ℝ => prawitzSineWeight t * sin (t * y)) volume 0 1 ∧ |sign y - prawitzSignApprox y| ≤ sinc (y / 2) ^ 2 := by /- Round 4 splits endpoint integrability, the integral-to-series bridge, and the elementary tail sandwich into three distinct import leaves. Use prawitz_sine_intervalIntegrable for the first conjunct. For y>0, set x=y/(2π) and use prawitzSignApprox_reciprocal_sq_identity. reciprocal_sq_tail_bounds places S between 1/(x+1) and 1/x, hence |x^(-2)+2S-2/x|≤x^(-2). Convert sin(πx)/(πx) to sinc. For y<0, use prawitzSignApprox_neg and sinc evenness. At y=0 the approximation is zero and sinc is one. Thus the upper half-line majorant takes value one at zero, while the lower takes zero; integrating both bounds remains valid for atomic probability laws. Do not replace this spatial inequality by a CDF/CLT assumption. -/ refine ⟨prawitz_sine_intervalIntegrable y, ?_⟩ have hpos (z : ℝ) (hz : 0 < z) : |1 - prawitzSignApprox z| ≤ sinc (z / 2) ^ 2 := by let x := z / (2 * pi) have hx : 0 < x := by dsimp [x]; positivity have hscale : 2 * pi * x = z := by dsimp [x] field_simp have htail := reciprocal_sq_tail_bounds x hx let S := ∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2 have hSlo : 1 / (x + 1) ≤ S := htail.2.1 have hShi : S ≤ 1 / x := htail.2.2 have hlo : 1 / x - 1 / x ^ 2 ≤ 1 / (x + 1) := by apply (le_div_iff₀ (by positivity : 0 < x + 1)).mpr field_simp nlinarith have hbracket : |1 / x ^ 2 + 2 * S - 2 / x| ≤ 1 / x ^ 2 := by rw [abs_le] simp only [div_eq_mul_inv] at hSlo hShi hlo ⊢ constructor <;> linarith have hsin : sinc (z / 2) = sin (pi * x) / (pi * x) := by have he : z / 2 = pi * x := by linarith [hscale] rw [he, Real.sinc_of_ne_zero (by positivity : pi * x ≠ 0)] rw [← hscale, prawitzSignApprox_reciprocal_sq_identity x hx, abs_mul, abs_of_nonneg (sq_nonneg _)] calc _ ≤ (sin (pi * x) / pi) ^ 2 * (1 / x ^ 2) := mul_le_mul_of_nonneg_left hbracket (sq_nonneg _) _ = sinc ((2 * pi * x) / 2) ^ 2 := by rw [hscale, hsin] field_simp rcases lt_trichotomy y 0 with hy | hy | hy · have h := hpos (-y) (neg_pos.mpr hy) rw [Real.sign_of_neg hy, show -1 - prawitzSignApprox y = -(1 + prawitzSignApprox y) by ring, abs_neg] simpa [prawitzSignApprox_neg, neg_div, Real.sinc_neg] using h · subst y simp [prawitzSignApprox_zero] · simpa [Real.sign_of_pos hy] using hpos y hy
Causalean.Stat.CLT.BerryEsseen.prawitzSignApprox_integrable_and_error · Causalean/Stat/CLT/BerryEsseen/PrawitzSignComparison.lean:29 · uses prawitzSignApprox , prawitzSineWeight
2 supporting declarations (lemmas, instances)
Prawitz­Sign­Integrability 1 core · 0 supporting The compact-interval sine integrand has removable endpoint singularities. ★ prawitz_sine_intervalIntegrable

Endpoint regularity of the Prawitz sine integral

The compact-interval sine integrand has removable endpoint singularities. This regularity task is independent of the Beurling partial-fraction identity and the pointwise approximation inequality.

theorem prawitz_sine_intervalIntegrable reviewed
Causalean.Stat.CLT.BerryEsseen

For any real spatial argument y, the Prawitz sine integrand, the cotangent weight at t times sin(ty), is integrable on the unit interval.

Formal statement
y :
ℝ
IntervalIntegrable (fun t : ℝ => prawitzSineWeight t * sin (t * y)) volume 0 1
Proof (Lean source)
theorem prawitz_sine_intervalIntegrable (y : ℝ) : IntervalIntegrable (fun t : ℝ => prawitzSineWeight t * sin (t * y)) volume 0 1 := by /- Write sin(ty)=ty*sinc(ty). At zero use sin(πt)=πt*sinc(πt) to cancel t; the limit is y/π. At one reflect sin(πt) as sin(π(1-t)); the factor (1-t) cancels, and the weight tends to zero. Extend continuously with these endpoint values and use equality a.e. on (0,1) to obtain interval integrability. The assigned original values at the two endpoints need not equal the continuous extension values. This leaf does not require any series identity or approximation bound. -/ have hsin (z : ℝ) : sin z = z * sinc z := by by_cases hz : z = 0 · simp [hz] · rw [Real.sinc_of_ne_zero hz, mul_div_cancel₀ _ hz] have hne (t : ℝ) (ht : 0 ≤ t) (ht' : t ≤ 1 / 2) : sinc (Real.pi * t) ≠ 0 := by by_cases h : t = 0 · simp [h] · have hp : 0 < Real.pi * t := mul_pos Real.pi_pos (lt_of_le_of_ne ht (Ne.symm h)) rw [Real.sinc_of_ne_zero hp.ne'] exact div_ne_zero (Real.sin_pos_of_pos_of_lt_pi hp (by nlinarith [Real.pi_pos])).ne' hp.ne' let f : ℝ → ℝ := fun t => (1 - t) * cos (Real.pi * t) * y * sinc (t * y) / (Real.pi * sinc (Real.pi * t)) + sin (t * y) / Real.pi let g : ℝ → ℝ := fun t => cos (Real.pi * t) * sin (t * y) / (Real.pi * sinc (Real.pi * (1 - t))) + sin (t * y) / Real.pi have hf : ContinuousOn f (uIcc 0 (1 / 2)) := by rw [Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1 / 2)] apply ContinuousOn.add · apply ContinuousOn.div · fun_prop · fun_prop · intro t ht exact mul_ne_zero Real.pi_ne_zero (hne t ht.1 ht.2) · fun_prop have hg : ContinuousOn g (uIcc (1 / 2) 1) := by rw [Set.uIcc_of_le (by norm_num : (1 / 2 : ℝ) ≤ 1)] apply ContinuousOn.add · apply ContinuousOn.div · fun_prop · fun_prop · intro t ht exact mul_ne_zero Real.pi_ne_zero (hne (1 - t) (by linarith [ht.2]) (by linarith [ht.1])) · fun_prop have hi : IntervalIntegrable (fun t => prawitzSineWeight t * sin (t * y)) volume 0 (1 / 2) := by apply (hf.intervalIntegrable.congr_uIoo ?_) intro t ht rw [Set.uIoo_of_lt (by norm_num : (0 : ℝ) < 1 / 2)] at ht rcases ht with ⟨htl, htr⟩ have ht0 : t ≠ 0 := ne_of_gt htl have hp : Real.pi * t ≠ 0 := mul_ne_zero Real.pi_ne_zero ht0 have hs : sin (Real.pi * t) ≠ 0 := (Real.sin_pos_of_pos_of_lt_pi (by positivity) (by nlinarith [Real.pi_pos])).ne' dsimp [f, prawitzSineWeight] rw [Real.sinc_of_ne_zero hp, hsin (t * y)] field_simp have hj : IntervalIntegrable (fun t => prawitzSineWeight t * sin (t * y)) volume (1 / 2) 1 := by apply (hg.intervalIntegrable.congr_uIoo ?_) intro t ht rw [Set.uIoo_of_lt (by norm_num : (1 / 2 : ℝ) < 1)] at ht rcases ht with ⟨htl, htr⟩ have hpt : Real.pi * (1 - t) ≠ 0 := mul_ne_zero Real.pi_ne_zero (by linarith) have hs : sin (Real.pi * t) ≠ 0 := (Real.sin_pos_of_pos_of_lt_pi (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos])).ne' have hr : sin (Real.pi * (1 - t)) = sin (Real.pi * t) := by rw [mul_sub, mul_one, Real.sin_pi_sub] dsimp [g, prawitzSineWeight] rw [Real.sinc_of_ne_zero hpt, hr] field_simp exact hi.trans hj
Causalean.Stat.CLT.BerryEsseen.prawitz_sine_intervalIntegrable · Causalean/Stat/CLT/BerryEsseen/PrawitzSignIntegrability.lean:18 · uses prawitzSineWeight
Prawitz­Sign­Series 1 core · 0 supporting This exact deterministic identity isolates the harmonic-analysis bridge from the endpoint integrability and the elementary reciprocal-tail bounds. ★ prawitzSignApprox_reciprocal_sq_identity

The Prawitz sine integral as a reciprocal-square series

This exact deterministic identity isolates the harmonic-analysis bridge from the endpoint integrability and the elementary reciprocal-tail bounds. It uses radians y=2πx, and includes positive integer x without an exclusion.

theorem prawitzSignApprox_reciprocal_sq_identity reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive spatial coordinate x, the Prawitz sign approximation error, one minus the approximation at 2πx, equals (sin(πx)/π)² times the reciprocal-square series correction 1/x² + 2·Σ_{n≥0} 1/(x+n+1)² − 2/x.

Formal statement
x :
ℝ
hx :
0 < x
1 - prawitzSignApprox (2 * pi * x)
= (sin (pi * x) / pi) ^ 2 * (1 / x ^ 2 + 2 * (∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2) - 2 / x)
Proof (Lean source)
theorem prawitzSignApprox_reciprocal_sq_identity (x : ℝ) (hx : 0 < x) : 1 - prawitzSignApprox (2 * pi * x) = (sin (pi * x) / pi) ^ 2 * (1 / x ^ 2 + 2 * (∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2) - 2 / x) := by classical let c : ℕ → ℝ := fun n => ∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * ((n : ℝ) + 1) * t) * sin (2 * pi * x * t) let S : ℝ := (sin (pi * x) / pi) ^ 2 have hc (n : ℕ) : c n = (sinc (pi * ((n : ℝ) + 1 - x)) ^ 2 - sinc (pi * ((n : ℝ) + 1 + x)) ^ 2) / 4 := triangular_sine_product_integral _ _ -- Undamp the coefficient series and add the constant part of the sine weight. have hbridge (hs : Summable c) : prawitzSignApprox (2 * pi * x) = 4 * (∑' n, c n) + 2 * S / x := by have hlim := Real.tendsto_tsum_powerSeries_nhdsWithin_lt hs.hasSum.tendsto_sum_nat have hlim' : Tendsto (fun r : ℝ => 2 * (∑' n, r ^ (n + 1) * c n)) (nhdsWithin 1 (Iio 1)) (nhds (2 * ∑' n, c n)) := by have ht := (tendsto_const_nhds (x := (2 : ℝ))).mul ((continuousAt_id.tendsto.mono_left nhdsWithin_le_nhds).mul hlim) simp only [id_eq, one_mul] at ht convert ht using 1 · funext r congr 1 rw [← tsum_mul_left] apply tsum_congr intro n rw [pow_succ] ring have heq : (fun r : ℝ => ∫ t in (0 : ℝ)..1, (1 - t) * (2 * r * sin (2 * pi * t) / (1 - 2 * r * cos (2 * pi * t) + r ^ 2)) * sin (2 * pi * x * t)) =ᶠ[nhdsWithin 1 (Iio 1)] (fun r => 2 * ∑' n, r ^ (n + 1) * c n) := by filter_upwards [eventually_nhdsWithin_of_eventually_nhds (eventually_gt_nhds (show (0 : ℝ) < 1 by norm_num)), self_mem_nhdsWithin] with r hr hr1 exact (prawitz_abel_weighted_integral_series x r hr hr1).2 have hi := tendsto_nhds_unique (prawitz_abel_weighted_integral_tendsto x) (hlim'.congr' heq.symm) have hconst : (∫ t in (0 : ℝ)..1, sin (t * (2 * pi * x)) / pi) = S / x := by rw [intervalIntegral.integral_div, intervalIntegral.integral_comp_mul_right sin (by positivity), integral_sin] simp only [zero_mul, one_mul, Real.cos_zero, smul_eq_mul] have hcos := Real.sin_sq_eq_half_sub (pi * x) dsimp [S] rw [show 2 * pi * x = 2 * (pi * x) by ring] field_simp rw [show 2 * pi * x = 2 * (pi * x) by ring] nlinarith have hcont : IntervalIntegrable (fun t : ℝ => sin (t * (2 * pi * x)) / pi) MeasureTheory.volume 0 1 := (show Continuous (fun t : ℝ => sin (t * (2 * pi * x)) / pi) by fun_prop).intervalIntegrable _ _ have hw := (prawitz_sine_intervalIntegrable (2 * pi * x)).sub hcont have hw' : IntervalIntegrable (fun t : ℝ => (1 - t) * cos (pi * t) / sin (pi * t) * sin (t * (2 * pi * x))) MeasureTheory.volume 0 1 := by convert hw using 1 funext t dsimp [prawitzSineWeight] ring unfold prawitzSignApprox rw [show (fun t : ℝ => prawitzSineWeight t * sin (t * (2 * pi * x))) = (fun t => (1 - t) * cos (pi * t) / sin (pi * t) * sin (t * (2 * pi * x)) + sin (t * (2 * pi * x)) / pi) by funext t; dsimp [prawitzSineWeight]; ring, intervalIntegral.integral_add hw' hcont, hconst] have hi' : (∫ t in (0 : ℝ)..1, (1 - t) * cos (pi * t) / sin (pi * t) * sin (t * (2 * pi * x))) = 2 * ∑' n, c n := by simpa only [mul_comm (2 * pi * x)] using hi rw [hi'] ring -- At an integer, precisely one squared-sinc coefficient survives. by_cases hsin : sin (pi * x) = 0 · obtain ⟨m, hm⟩ := Real.sin_eq_zero_iff.mp hsin have hmx : (m : ℝ) = x := by nlinarith [Real.pi_pos] have hmpos : 0 ≤ m := by exact_mod_cast (show (0 : ℝ) ≤ m by linarith) lift m to ℕ using hmpos have hmne : m ≠ 0 := by intro h; simp [h] at hmx; linarith obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hmne have hxc : x = (k : ℝ) + 1 := by simpa using hmx.symm have hcoef (n : ℕ) : c n = if n = k then 1 / 4 else 0 := by rw [hc] have hp : sinc (pi * ((n : ℝ) + 1 + x)) = 0 := by rw [Real.sinc_of_ne_zero (by positivity)] rw [show pi * ((n : ℝ) + 1 + x) = pi * x + (n + 1 : ℕ) * pi by push_cast; ring, Real.sin_add_nat_mul_pi, hsin] simp rw [hp] by_cases hn : n = k · simp [hn, hxc] · have hn' : (n : ℝ) + 1 - x ≠ 0 := by rw [hxc] intro h apply hn exact_mod_cast (show (n : ℝ) = k by linarith) rw [Real.sinc_of_ne_zero (mul_ne_zero Real.pi_ne_zero hn')] rw [show pi * ((n : ℝ) + 1 - x) = (n + 1 : ℕ) * pi - pi * x by push_cast; ring, Real.sin_nat_mul_pi_sub, hsin] simp [hn] have hs : Summable c := by change Summable (fun n => c n) simp_rw [hcoef] exact (hasSum_ite_eq k (1 / 4 : ℝ)).summable have hsum : (∑' n, c n) = 1 / 4 := by simp_rw [hcoef]; simp rw [hbridge hs, hsum] simp [S, hsin] -- Away from integers, the csc identity eliminates the negative-shift tail. · have hsym := csc_squared_reciprocal_series x hsin let f : ℕ → ℝ := fun n => 1 / (x - ((n : ℝ) + 1)) ^ 2 let g : ℕ → ℝ := fun n => 1 / (x + ((n : ℝ) + 1)) ^ 2 have hf : Summable f := Summable.of_nonneg_of_le (fun n => by dsimp [f]; positivity) (fun n => by dsimp [f]; exact le_add_of_nonneg_right (by positivity)) hsym.1 have hg : Summable g := Summable.of_nonneg_of_le (fun n => by dsimp [g]; positivity) (fun n => by dsimp [g]; exact le_add_of_nonneg_left (by positivity)) hsym.1 have hcoef (n : ℕ) : c n = S / 4 * (f n - g n) := by have hm : (n : ℝ) + 1 - x ≠ 0 := by intro h apply hsin have he : x = (n + 1 : ℕ) := by push_cast; linarith rw [he, mul_comm] exact Real.sin_nat_mul_pi _ have hp : (n : ℝ) + 1 + x ≠ 0 := by positivity rw [hc, Real.sinc_of_ne_zero (mul_ne_zero Real.pi_ne_zero hm), Real.sinc_of_ne_zero (mul_ne_zero Real.pi_ne_zero hp)] rw [show pi * ((n : ℝ) + 1 - x) = (n + 1 : ℕ) * pi - pi * x by push_cast; ring, Real.sin_nat_mul_pi_sub, show pi * ((n : ℝ) + 1 + x) = pi * x + (n + 1 : ℕ) * pi by push_cast; ring, Real.sin_add_nat_mul_pi] dsimp [S, f, g] have hpow : ((-1 : ℝ) ^ (n + 1)) ^ 2 = 1 := by rw [← pow_mul, Nat.mul_comm, pow_mul]; norm_num simp only [div_pow, neg_sq, mul_pow, hpow, one_mul] push_cast have hm' : x - ((n : ℝ) + 1) ≠ 0 := by intro h; apply hm; linarith field_simp [Real.pi_ne_zero, hm, hp, hm'] ring have hs : Summable c := by change Summable (fun n => c n) simp_rw [hcoef] exact (hf.sub hg).mul_left _ have hsum : (∑' n, c n) = S / 4 * ((∑' n, f n) - ∑' n, g n) := by simp_rw [hcoef] rw [tsum_mul_left, hf.tsum_sub hg] have hid : S * (1 / x ^ 2 + ((∑' n, f n) + ∑' n, g n)) = 1 := by simpa only [S, f, g, hf.tsum_add hg] using hsym.2 have hg' : (∑' n, g n) = ∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2 := by apply tsum_congr intro n dsimp [g] rw [add_assoc] rw [hbridge hs, hsum, ← hg'] change 1 - (4 * (S / 4 * _) + 2 * S / x) = S * _ linear_combination -hid
Causalean.Stat.CLT.BerryEsseen.prawitzSignApprox_reciprocal_sq_identity · Causalean/Stat/CLT/BerryEsseen/PrawitzSignSeries.lean:25 · uses prawitzSignApprox
Prawitz­Sine­Coefficient 1 core · 0 supporting This exact coefficient evaluation supplies the algebraic part of the Prawitz Abel-series assembly. ★ triangular_sine_product_integral

Triangular sine-product coefficients

This exact coefficient evaluation supplies the algebraic part of the Prawitz Abel-series assembly. The sinc formulation includes coincident frequencies, so the coefficient at an integer spatial coordinate needs no limiting argument.

theorem triangular_sine_product_integral reviewed
Causalean.Stat.CLT.BerryEsseen

At any two real frequencies a and b, the triangularly weighted integral over [0, 1] of (1 − t)·sin(2πat)·sin(2πbt) equals one quarter of the difference sinc(π(a − b))² − sinc(π(a + b))².

Formal statement
a b :
ℝ
(∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * a * t) * sin (2 * pi * b * t))
= (sinc (pi * (a - b)) ^ 2 - sinc (pi * (a + b)) ^ 2) / 4
Proof (Lean source)
theorem triangular_sine_product_integral (a b : ℝ) : (∫ t in (0 : ℝ)..1, (1 - t) * sin (2 * pi * a * t) * sin (2 * pi * b * t)) = (sinc (pi * (a - b)) ^ 2 - sinc (pi * (a + b)) ^ 2) / 4 := by have hpoint (t : ℝ) : (1 - t) * sin (2 * pi * a * t) * sin (2 * pi * b * t) = (1 / 2 : ℝ) * ((1 - t) * cos (2 * pi * (a - b) * t) - (1 - t) * cos (2 * pi * (a + b) * t)) := by have h := Real.two_mul_sin_mul_sin (2 * pi * a * t) (2 * pi * b * t) rw [show 2 * pi * a * t - 2 * pi * b * t = 2 * pi * (a - b) * t by ring, show 2 * pi * a * t + 2 * pi * b * t = 2 * pi * (a + b) * t by ring] at h calc _ = (1 / 2 : ℝ) * (1 - t) * (2 * sin (2 * pi * a * t) * sin (2 * pi * b * t)) := by ring _ = _ := by rw [h]; ring rw [intervalIntegral.integral_congr (fun t _ => hpoint t), intervalIntegral.integral_const_mul, intervalIntegral.integral_sub ((show Continuous (fun t : ℝ => (1 - t) * cos (2 * pi * (a - b) * t)) by fun_prop).intervalIntegrable 0 1) ((show Continuous (fun t : ℝ => (1 - t) * cos (2 * pi * (a + b) * t)) by fun_prop).intervalIntegrable 0 1), triangular_cosine_integral, triangular_cosine_integral] ring
Causalean.Stat.CLT.BerryEsseen.triangular_sine_product_integral · Causalean/Stat/CLT/BerryEsseen/PrawitzSineCoefficient.lean:17
Prawitz­Smoothing 1 core · 0 supporting This four-term Fourier inequality separates low-frequency approximation, high-frequency damping, the bounded principal correction, and the Gaussian tail. ★ normal_cdf_prawitz_smoothing

Prawitz's Gaussian CDF smoothing inequality

This four-term Fourier inequality separates low-frequency approximation, high-frequency damping, the bounded principal correction, and the Gaussian tail. It is the analytic transfer needed by a constant-one Berry–Esseen proof.

theorem normal_cdf_prawitz_smoothing reviewed
Causalean.Stat.CLT.BerryEsseen

For a scalar probability law with finite first moment, positive cutoffs U0 ≤ U, and any threshold x, the CDF of the law at x differs from the standard Gaussian CDF at x by at most the sum of four Prawitz Fourier terms, (2/U)·∫₀^{U0} |K(t/U)|·|φ_μ(t) − φ_γ(t)| dt + (2/U)·∫_{U0}^{U} |K(t/U)|·|φ_μ(t)| dt + 2·∫₀^{U0} |K(t/U)/U − i/(2πt)|·exp(−t²/2) dt + (1/π)·∫_{U0}^{∞} exp(−t²/2)/t dt. Here K is the Prawitz spectral filter, φ_μ the characteristic function of the law, and φ_γ that of the standard Gaussian. The four terms are the filtered low-frequency characteristic-function discrepancy, the filtered high-frequency characteristic-function modulus, the Gaussian principal correction, and the Gaussian tail beyond U0.

Formal statement
hfirst :
Integrable (fun y : ℝ => y) μ
U0 U :
ℝ
hU0 :
0 < U0
hcut :
U0 ≤ U
x :
ℝ
|(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal|
≤ (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖)
+ (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖)
+ 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2)))
+ (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t)
Proof (Lean source)
theorem normal_cdf_prawitz_smoothing (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (U0 U : ℝ) (hU0 : 0 < U0) (hcut : U0 ≤ U) (x : ℝ) : |(μ (Iic x)).toReal - ((gaussianReal 0 1) (Iic x)).toReal| ≤ (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖) + (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖) + 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) + (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t) := by apply prawitz_cdf_error_of_spectral_bound μ U (hU0.trans_le hcut) x have hspec := prawitz_gaussian_sine_spectral_bound μ hfirst U0 U hU0 hcut x have he : 1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - 2 * ((gaussianReal 0 1) (Iic x)).toReal = 2 * ((∫ y, prawitzSignApprox (U * (x - y)) ∂μ) / 2 - (1 / pi) * (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t)) := by rw [gaussian_cdf_sine_inversion x] ring rw [he, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] linarith only [hspec]
Causalean.Stat.CLT.BerryEsseen.normal_cdf_prawitz_smoothing · Causalean/Stat/CLT/BerryEsseen/PrawitzSmoothing.lean:18 · uses prawitzKernel
Prawitz­Spatial­Fourier 1 core · 10 supporting These atomic half-line sandwiches, integrability results, Fubini identities, and CDF reduction are proved independently of Gaussian sine inversion and the signed spectral comparison, which are proved in separate modules. ★ prawitz_cdf_error_of_spectral_bound

Spatial and Fourier ingredients for Prawitz smoothing

These atomic half-line sandwiches, integrability results, Fubini identities, and CDF reduction are proved independently of Gaussian sine inversion and the signed spectral comparison, which are proved in separate modules.

theorem prawitz_cdf_error_of_spectral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a probability law μ, a positive bandwidth U, a threshold x, and a reference value q and error R, if the distance between one plus the expected Prawitz sign approximation at U(x − y) and 2q, plus the expected squared sinc of U(x − y)/2, is at most 2R, then the CDF of μ at x is within R of q. This isolates the remaining spectral comparison from the atomic endpoint step.

Formal statement
U :
ℝ
hU :
0 < U
x q R :
ℝ
hspectral :
|1
+ (∫ y, prawitzSignApprox (U * (x - y)) ∂μ)
- 2 * q|
+ (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)
≤ 2 * R
|(μ (Iic x)).toReal - q| ≤ R
Proof (Lean source)
theorem prawitz_cdf_error_of_spectral_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (U : ℝ) (hU : 0 < U) (x q R : ℝ) (hspectral : |1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - 2 * q| + (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ) ≤ 2 * R) : |(μ (Iic x)).toReal - q| ≤ R := by obtain ⟨hlo, hhi⟩ := prawitz_cdf_spatial_bounds μ U hU x have hl := neg_abs_le (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - 2 * q) have hu := le_abs_self (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - 2 * q) rw [abs_le] constructor <;> linarith
Causalean.Stat.CLT.BerryEsseen.prawitz_cdf_error_of_spectral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:232 · uses prawitzSignApprox
10 supporting declarations (lemmas, instances)
  • measurable_prawitzSignApprox theorem — The Prawitz sign approximation is measurable, including its assigned endpoint values.
    Proof (Lean source)
    @[fun_prop] theorem measurable_prawitzSignApprox : Measurable prawitzSignApprox := by have hm : Measurable (fun p : ℝ × ℝ => prawitzSineWeight p.2 * sin (p.2 * p.1)) := by unfold prawitzSineWeight fun_prop have hi := hm.stronglyMeasurable.integral_prod_right' (ν := volume.restrict (Ioc (0 : ℝ) 1)) unfold prawitzSignApprox simpa only [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] using hi.measurable.const_mul 2
    Causalean.Stat.CLT.BerryEsseen.measurable_prawitzSignApprox · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:19
  • prawitzSignApprox_abs_le_two theorem — At every spatial argument, the sign approximation has absolute value at most two.
    y :
    ℝ
    Proof (Lean source)
    theorem prawitzSignApprox_abs_le_two (y : ℝ) : |prawitzSignApprox y| ≤ 2 := by have he := (prawitzSignApprox_integrable_and_error y).2 have hs : sinc (y / 2) ^ 2 ≤ 1 := by have h := Real.abs_sinc_le_one (y / 2) nlinarith [le_abs_self (sinc (y / 2)), neg_abs_le (sinc (y / 2))] have hsign : |sign y| ≤ 1 := by rcases lt_trichotomy y 0 with h | h | h · simp [Real.sign_of_neg h] · simp [h] · simp [Real.sign_of_pos h] have ht := abs_sub_le (prawitzSignApprox y) (sign y) 0 rw [sub_zero, sub_zero, abs_sub_comm (prawitzSignApprox y)] at ht linarith
    Causalean.Stat.CLT.BerryEsseen.prawitzSignApprox_abs_le_two · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:33
  • prawitz_halfLine_indicator_bounds theorem — At positive bandwidth, the closed-half-line indicator at the threshold and spatial point lies between the two Prawitz majorants, with the endpoint included in the upper bound.
    U :
    ℝ
    hU :
    0 < U
    x y :
    ℝ
    conclusion 1
    (1 + prawitzSignApprox (U * (x - y)) - sinc (U * (x - y) / 2) ^ 2) / 2
    ≤ (Iic x).indicator (fun _ : ℝ => (1 : ℝ)) y
    conclusion 2
    (Iic x).indicator (fun _ : ℝ => (1 : ℝ)) y
    ≤ (1 + prawitzSignApprox (U * (x - y)) + sinc (U * (x - y) / 2) ^ 2) / 2
    Proof (Lean source)
    theorem prawitz_halfLine_indicator_bounds (U : ℝ) (hU : 0 < U) (x y : ℝ) : (1 + prawitzSignApprox (U * (x - y)) - sinc (U * (x - y) / 2) ^ 2) / 2 ≤ (Iic x).indicator (fun _ : ℝ => (1 : ℝ)) y ∧ (Iic x).indicator (fun _ : ℝ => (1 : ℝ)) y ≤ (1 + prawitzSignApprox (U * (x - y)) + sinc (U * (x - y) / 2) ^ 2) / 2 := by have he := (abs_le.mp (prawitzSignApprox_integrable_and_error (U * (x - y))).2) rcases lt_trichotomy y x with h | h | h · have hz : 0 < U * (x - y) := mul_pos hU (sub_pos.mpr h) rw [Real.sign_of_pos hz] at he simp only [Set.indicator_of_mem (show y ∈ Iic x from h.le)] constructor <;> linarith [he.1, he.2] · subst y simp [prawitzSignApprox_zero] · have hz : U * (x - y) < 0 := mul_neg_of_pos_of_neg hU (sub_neg.mpr h) rw [Real.sign_of_neg hz] at he simp only [Set.indicator_of_notMem (show y ∉ Iic x from not_le.mpr h)] constructor <;> linarith [he.1, he.2]
    Causalean.Stat.CLT.BerryEsseen.prawitz_halfLine_indicator_bounds · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:49
  • prawitz_spatial_integrable theorem — For any probability law at any bandwidth and threshold, both spatial factors are integrable. No moment or absence-of-atoms hypothesis is needed for this step.
    U x :
    ℝ
    conclusion 1
    Integrable (fun y : ℝ => prawitzSignApprox (U * (x - y))) μ
    conclusion 2
    Integrable (fun y : ℝ => sinc (U * (x - y) / 2) ^ 2) μ
    Proof (Lean source)
    theorem prawitz_spatial_integrable (μ : Measure ℝ) [IsProbabilityMeasure μ] (U x : ℝ) : Integrable (fun y : ℝ => prawitzSignApprox (U * (x - y))) μ ∧ Integrable (fun y : ℝ => sinc (U * (x - y) / 2) ^ 2) μ := by constructor · apply Integrable.of_bound (measurable_prawitzSignApprox.comp (by fun_prop)).aestronglyMeasurable 2 filter_upwards with y exact prawitzSignApprox_abs_le_two _ · apply Integrable.of_bound (by fun_prop) 1 filter_upwards with y have h := Real.abs_sinc_le_one (U * (x - y) / 2) rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] nlinarith [le_abs_self (sinc (U * (x - y) / 2)), neg_abs_le (sinc (U * (x - y) / 2))]
    Causalean.Stat.CLT.BerryEsseen.prawitz_spatial_integrable · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:70
  • prawitz_cdf_spatial_bounds theorem — Integrating the spatial majorants for a probability law, at positive bandwidth and any threshold, gives a CDF sandwich valid even when the law has an atom at the threshold.
    U :
    ℝ
    hU :
    0 < U
    x :
    ℝ
    conclusion 1
    (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)) / 2
    ≤ (μ (Iic x)).toReal
    conclusion 2
    (μ (Iic x)).toReal
    ≤ (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) + (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)) / 2
    Proof (Lean source)
    theorem prawitz_cdf_spatial_bounds (μ : Measure ℝ) [IsProbabilityMeasure μ] (U : ℝ) (hU : 0 < U) (x : ℝ) : (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) - (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)) / 2 ≤ (μ (Iic x)).toReal ∧ (μ (Iic x)).toReal ≤ (1 + (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) + (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)) / 2 := by obtain ⟨hA, hB⟩ := prawitz_spatial_integrable μ U x have hc : Integrable (fun _ : ℝ => (1 : ℝ)) μ := integrable_const 1 have hi := hc.indicator (measurableSet_Iic (a := x)) have hlo := integral_mono ((hc.add hA).sub hB |>.div_const 2) hi (fun y => (prawitz_halfLine_indicator_bounds U hU x y).1) have hhi := integral_mono hi ((hc.add hA).add hB |>.div_const 2) (fun y => (prawitz_halfLine_indicator_bounds U hU x y).2) simp only [integral_div, integral_add' hc hA, integral_sub' (hc.add hA) hB, integral_add' (hc.add hA) hB, integral_const, measure_univ, ENNReal.toReal_one, smul_eq_mul, integral_indicator_const (1 : ℝ) measurableSet_Iic, mul_one, Measure.real] at hlo hhi exact ⟨hlo, hhi⟩
    Causalean.Stat.CLT.BerryEsseen.prawitz_cdf_spatial_bounds · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:89
  • prawitzSineWeight_abs_le theorem — On the positive unit band, the sine-weight singularity is at most reciprocal-linear.
    t :
    ℝ
    ht :
    0 < t
    hband :
    t ≤ 1
    |prawitzSineWeight t| ≤ 1 / (pi * t) + 1
    Proof (Lean source)
    theorem prawitzSineWeight_abs_le (t : ℝ) (ht : 0 < t) (hband : t ≤ 1) : |prawitzSineWeight t| ≤ 1 / (pi * t) + 1 := by have him : (prawitzKernel t).im = prawitzSineWeight t / 2 := by rw [prawitzKernel, if_neg (show ¬(t = 0 ∨ 1 < |t|) from not_or.mpr ⟨ht.ne', by simpa [abs_of_pos ht] using not_lt.mpr hband⟩)] simp only [Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, zero_mul, mul_one, zero_add, add_zero, prawitzSineWeight, abs_of_pos ht, Real.sign_of_pos ht] have hn := prawitzKernel_norm_le t (by simpa [abs_of_pos ht]) (by simpa [abs_of_pos ht] using hband) have hi := Complex.abs_im_le_norm (prawitzKernel t) rw [him, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] at hi rw [abs_of_pos ht] at hn have he : 2 * (1 / (2 * pi * t) + 1 / 2) = 1 / (pi * t) + 1 := by field_simp linarith
    Causalean.Stat.CLT.BerryEsseen.prawitzSineWeight_abs_le · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:112
  • prawitz_sine_abs_le theorem — Multiplying by the sine wave cancels the zero-frequency singularity: on the positive unit band, the integrand at spatial argument is bounded linearly in that argument.
    t z :
    ℝ
    ht :
    0 < t
    hband :
    t ≤ 1
    |prawitzSineWeight t * sin (t * z)| ≤ (1 / pi + 1) * |z|
    Proof (Lean source)
    theorem prawitz_sine_abs_le (t z : ℝ) (ht : 0 < t) (hband : t ≤ 1) : |prawitzSineWeight t * sin (t * z)| ≤ (1 / pi + 1) * |z| := by have hsin : |sin (t * z)| ≤ t * |z| := by simpa [abs_mul, abs_of_pos ht] using (Real.abs_sin_le_abs (x := t * z)) have hcoef : (1 / (pi * t) + 1) * t = 1 / pi + t := by field_simp calc _ = |prawitzSineWeight t| * |sin (t * z)| := abs_mul _ _ _ ≤ (1 / (pi * t) + 1) * (t * |z|) := mul_le_mul (prawitzSineWeight_abs_le t ht hband) hsin (abs_nonneg _) (by positivity) _ = (1 / pi + t) * |z| := by rw [← mul_assoc, hcoef] _ ≤ _ := mul_le_mul_of_nonneg_right (by linarith) (abs_nonneg _)
    Causalean.Stat.CLT.BerryEsseen.prawitz_sine_abs_le · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:131
  • prawitz_sine_joint_integrable theorem — With a finite first moment, the Prawitz sine integrand at any bandwidth and threshold is jointly integrable. This is the cancellation needed for the singular-filter Fubini step.
    hfirst :
    Integrable (fun y : ℝ => y) μ
    U x :
    ℝ
    Integrable (fun p : ℝ × ℝ => prawitzSineWeight p.1 * sin (p.1 * (U * (x - p.2)))) ((volume.restrict (Ioc (0 : ℝ) 1)).prod μ)
    Proof (Lean source)
    theorem prawitz_sine_joint_integrable (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (U x : ℝ) : Integrable (fun p : ℝ × ℝ => prawitzSineWeight p.1 * sin (p.1 * (U * (x - p.2)))) ((volume.restrict (Ioc (0 : ℝ) 1)).prod μ) := by have hmajor : Integrable (fun y : ℝ => (1 / pi + 1) * |U * (x - y)|) μ := (((integrable_const x).sub hfirst).const_mul U).norm.const_mul _ have hprod := hmajor.comp_snd (volume.restrict (Ioc (0 : ℝ) 1)) apply hprod.mono' (by unfold prawitzSineWeight; fun_prop) have hmem : ∀ᵐ p : ℝ × ℝ ∂((volume.restrict (Ioc (0 : ℝ) 1)).prod μ), p.1 ∈ Ioc (0 : ℝ) 1 := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_Ioc.preimage measurable_fst)).mpr filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht exact Filter.Eventually.of_forall (fun _ => ht) filter_upwards [hmem] with p hp exact prawitz_sine_abs_le p.1 (U * (x - p.2)) hp.1 hp.2
    Causalean.Stat.CLT.BerryEsseen.prawitz_sine_joint_integrable · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:148
  • prawitz_sign_expectation_fubini theorem — For a probability law with finite first moment, the expected sign approximation at any bandwidth and threshold equals the frequency-first sine integral.
    hfirst :
    Integrable (fun y : ℝ => y) μ
    U x :
    ℝ
    (∫ y, prawitzSignApprox (U * (x - y)) ∂μ)
    = 2 * ∫ t in (0 : ℝ)..1, prawitzSineWeight t * (∫ y, sin (t * (U * (x - y))) ∂μ)
    Proof (Lean source)
    theorem prawitz_sign_expectation_fubini (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (U x : ℝ) : (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) = 2 * ∫ t in (0 : ℝ)..1, prawitzSineWeight t * (∫ y, sin (t * (U * (x - y))) ∂μ) := by have hi := prawitz_sine_joint_integrable μ hfirst U x rw [← Set.uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hi have hswap := intervalIntegral_integral_swap (f := fun t y => prawitzSineWeight t * sin (t * (U * (x - y)))) hi simp only [prawitzSignApprox, integral_const_mul] rw [← hswap] congr 1 apply intervalIntegral.integral_congr intro t _ exact integral_const_mul _ _
    Causalean.Stat.CLT.BerryEsseen.prawitz_sign_expectation_fubini · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:169
  • prawitz_sinc_expectation_fubini theorem — For any probability law, the expected squared-sinc majorant at any bandwidth and threshold equals the triangular cosine integral.
    U x :
    ℝ
    (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ)
    = 2 * ∫ t in (0 : ℝ)..1, (1 - t) * (∫ y, cos (t * (U * (x - y))) ∂μ)
    Proof (Lean source)
    theorem prawitz_sinc_expectation_fubini (μ : Measure ℝ) [IsProbabilityMeasure μ] (U x : ℝ) : (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ) = 2 * ∫ t in (0 : ℝ)..1, (1 - t) * (∫ y, cos (t * (U * (x - y))) ∂μ) := by have hpoint (y : ℝ) : sinc (U * (x - y) / 2) ^ 2 = 2 * ∫ t in (0 : ℝ)..1, (1 - t) * cos (t * (U * (x - y))) := by have h := triangular_cosine_integral (U * (x - y) / (2 * pi)) have he : 2 * pi * (U * (x - y) / (2 * pi)) = U * (x - y) := by field_simp have he' : pi * (U * (x - y) / (2 * pi)) = U * (x - y) / 2 := by field_simp rw [he, he'] at h simp only [mul_comm (U * (x - y))] at h linarith have hi : Integrable (fun p : ℝ × ℝ => (1 - p.1) * cos (p.1 * (U * (x - p.2)))) ((volume.restrict (Ioc (0 : ℝ) 1)).prod μ) := by apply Integrable.of_bound (by fun_prop) 1 have hmem : ∀ᵐ p : ℝ × ℝ ∂((volume.restrict (Ioc (0 : ℝ) 1)).prod μ), p.1 ∈ Ioc (0 : ℝ) 1 := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_Ioc.preimage measurable_fst)).mpr filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht exact Filter.Eventually.of_forall (fun _ => ht) filter_upwards [hmem] with p hp rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (by linarith [hp.2] : 0 ≤ 1 - p.1)] calc _ ≤ (1 - p.1) * 1 := mul_le_mul_of_nonneg_left (Real.abs_cos_le_one _) (by linarith [hp.2]) _ ≤ 1 := by linarith [hp.1] rw [← Set.uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hi have hswap := intervalIntegral_integral_swap (f := fun t y => (1 - t) * cos (t * (U * (x - y)))) hi simp_rw [hpoint] rw [integral_const_mul, ← hswap] congr 1 apply intervalIntegral.integral_congr intro t _ exact integral_const_mul _ _
    Causalean.Stat.CLT.BerryEsseen.prawitz_sinc_expectation_fubini · Causalean/Stat/CLT/BerryEsseen/PrawitzSpatialFourier.lean:188
Prawitz­Spectral­Comparison 1 core · 0 supporting This module compares the expected spatial sign approximation and squared-sinc majorant directly to the Gaussian sine integral. ★ prawitz_gaussian_sine_spectral_bound

Signed spectral assembly for the Prawitz filter

This module compares the expected spatial sign approximation and squared-sinc majorant directly to the Gaussian sine integral. Gaussian CDF inversion is independent: it is used only in the later smoothing assembly. Integrability of the four comparison terms is proved in the separate imported module.

theorem prawitz_gaussian_sine_spectral_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For a probability law with finite first moment, positive ordered cutoffs U0 ≤ U, and any threshold x, the distance between half the expected Prawitz sign approximation at U(x − y) and the Gaussian sine integral (1/π)·∫₀^∞ exp(−t²/2)·sin(tx)/t dt, plus half the expected squared sinc of U(x − y)/2, is at most the sum of the four Prawitz spectral terms (2/U)·∫₀^{U0} |K(t/U)|·|φ_μ(t) − φ_γ(t)| dt + (2/U)·∫_{U0}^{U} |K(t/U)|·|φ_μ(t)| dt + 2·∫₀^{U0} |K(t/U)/U − i/(2πt)|·exp(−t²/2) dt + (1/π)·∫_{U0}^{∞} exp(−t²/2)/t dt. The expectations are over y drawn from the law. Here K is the Prawitz spectral filter, φ_μ the characteristic function of the law, and φ_γ that of the standard Gaussian.

Formal statement
hfirst :
Integrable (fun y : ℝ => y) μ
U0 U :
ℝ
hU0 :
0 < U0
hcut :
U0 ≤ U
x :
ℝ
|(∫ y, prawitzSignApprox (U * (x - y)) ∂μ) / 2
- (1 / pi) * (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t)|
+ (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ) / 2
≤ (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖)
+ (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖)
+ 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2)))
+ (1 / pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t)
Proof (Lean source)
theorem prawitz_gaussian_sine_spectral_bound (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (U0 U : ℝ) (hU0 : 0 < U0) (hcut : U0 ≤ U) (x : ℝ) : |(∫ y, prawitzSignApprox (U * (x - y)) ∂μ) / 2 - (1 / Real.pi) * (∫ t in Ioi (0 : ℝ), exp (-(t ^ 2 / 2)) * sin (t * x) / t)| + (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ) / 2 ≤ (2 / U) * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖) + (2 / U) * (∫ t in U0..U, ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖) + 2 * (∫ t in (0 : ℝ)..U0, ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * Real.pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) + (1 / Real.pi) * (∫ t in Ioi U0, exp (-(t ^ 2 / 2)) / t) := by have hU : 0 < U := hU0.trans_le hcut -- Both signs use a real component of the same complex comparison. have hcomplex (K P z w : ℂ) (hP : P.re = 0) : |2 * K.im * z.im - 2 * P.im * w.im| + 2 * K.re * z.re ≤ 2 * ‖K‖ * ‖z - w‖ + 2 * ‖K - P‖ * ‖w‖ := by have hb (z w : ℂ) : (K * z - P * w).re ≤ ‖K‖ * ‖z - w‖ + ‖K - P‖ * ‖w‖ := by calc _ ≤ |(K * z - P * w).re| := le_abs_self _ _ ≤ ‖K * z - P * w‖ := Complex.abs_re_le_norm _ _ = ‖K * (z - w) + (K - P) * w‖ := by congr 1; ring _ ≤ ‖K * (z - w)‖ + ‖(K - P) * w‖ := norm_add_le _ _ _ = _ := by rw [norm_mul, norm_mul] have hlo := hb z w have hhi := hb (star z) (star w) rw [← star_sub, norm_star, norm_star] at hhi simp only [Complex.sub_re, Complex.mul_re, hP, zero_mul, Complex.star_def, Complex.conj_re, Complex.conj_im] at hlo hhi have ha : |2 * K.im * z.im - 2 * P.im * w.im| ≤ 2 * ‖K‖ * ‖z - w‖ + 2 * ‖K - P‖ * ‖w‖ - 2 * K.re * z.re := by apply abs_le.mpr constructor <;> linarith linarith let z : ℝ → ℂ := fun t => exp ((t * x : ℝ) * I) * charFun μ (-t) have hzint (t : ℝ) : z t = ∫ y, exp ((t * (x - y) : ℝ) * I) ∂μ := by dsimp [z] rw [charFun_apply_real, ← integral_const_mul] apply integral_congr_ae filter_upwards with y rw [← Complex.exp_add] congr 1 push_cast ring have hzi (t : ℝ) : Integrable (fun y : ℝ => exp ((t * (x - y) : ℝ) * I)) μ := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards with y exact (Complex.norm_exp_ofReal_mul_I _).le have hzre (t : ℝ) : (z t).re = ∫ y, cos (t * (x - y)) ∂μ := by rw [hzint] simpa only [RCLike.re_to_complex, Complex.exp_ofReal_mul_I_re] using (integral_re (hzi t)).symm have hzim (t : ℝ) : (z t).im = ∫ y, sin (t * (x - y)) ∂μ := by rw [hzint] simpa only [RCLike.im_to_complex, Complex.exp_ofReal_mul_I_im] using (integral_im (hzi t)).symm have hzcont : Continuous z := by dsimp [z] exact (show Continuous (fun t : ℝ => exp ((t * x : ℝ) * I)) by fun_prop).mul ((continuous_charFun (μ := μ)).comp continuous_neg) let S : ℝ → ℝ := fun t => prawitzSineWeight (t / U) * (z t).im / U let C : ℝ → ℝ := fun t => (1 - t / U) * (z t).re / U let G : ℝ → ℝ := fun t => exp (-(t ^ 2 / 2)) * sin (t * x) / t / Real.pi have hS : IntervalIntegrable S volume 0 U := by have hi := (prawitz_sine_joint_integrable μ hfirst U x).integral_prod_left simp only [integral_const_mul] at hi have hi' : IntervalIntegrable (fun t : ℝ => prawitzSineWeight t * (∫ y, sin (t * (U * (x - y))) ∂μ)) volume 0 1 := (intervalIntegrable_iff_integrableOn_Ioc_of_le (by norm_num)).mpr hi have hh := hi'.comp_mul_left (c := U⁻¹) simp only [div_inv_eq_mul, one_mul, zero_mul] at hh convert hh.div_const U using 1 funext t dsimp [S] rw [hzim] congr 1 congr 1 · rw [div_eq_mul_inv, mul_comm] · congr 1 funext y congr 1 field_simp have hC : IntervalIntegrable C volume 0 U := by apply Continuous.intervalIntegrable dsimp [C] exact ((continuous_const.sub (continuous_id.div_const U)).mul (Complex.continuous_re.comp hzcont)).div_const U have hG : IntegrableOn G (Ioi 0) := by have hg : Integrable (fun t : ℝ => exp (-(t ^ 2 / 2))) := by convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 funext t congr 1 ring have hi : IntegrableOn (fun t : ℝ => exp (-(t ^ 2 / 2)) * sin (t * x) / t) (Ioi 0) := by apply (hg.integrableOn.const_mul |x|).mono' (show Measurable (fun t : ℝ => exp (-(t ^ 2 / 2)) * sin (t * x) / t) by fun_prop).aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have ht0 : 0 < t := ht simp only [Real.norm_eq_abs, abs_div, abs_mul, abs_of_pos (Real.exp_pos _), abs_of_pos ht0] have hs : |sin (t * x)| / t ≤ |x| := by apply (div_le_iff₀ ht).mpr simpa [abs_mul, abs_of_pos ht0, mul_comm] using Real.abs_sin_le_abs (x := t * x) calc _ = exp (-(t ^ 2 / 2)) * (|sin (t * x)| / t) := by ring _ ≤ exp (-(t ^ 2 / 2)) * |x| := mul_le_mul_of_nonneg_left hs (Real.exp_pos _).le _ = _ := by ring exact hi.div_const Real.pi have hA : (∫ y, prawitzSignApprox (U * (x - y)) ∂μ) / 2 = ∫ t in (0 : ℝ)..U, S t := by rw [prawitz_sign_expectation_fubini μ hfirst] dsimp [S] rw [intervalIntegral.integral_div] have hh := intervalIntegral.integral_comp_div (a := 0) (b := U) (fun t : ℝ => prawitzSineWeight t * (∫ y, sin (t * (U * (x - y))) ∂μ)) hU.ne' simp only [zero_div, div_self hU.ne', smul_eq_mul] at hh have he : (fun t : ℝ => prawitzSineWeight (t / U) * (z t).im) = (fun t : ℝ => prawitzSineWeight (t / U) * (∫ y, sin (t / U * (U * (x - y))) ∂μ)) := by funext t rw [hzim] congr 1 apply integral_congr_ae filter_upwards with y congr 1 field_simp rw [he, hh] field_simp simp only [mul_comm U] have hB : (∫ y, sinc (U * (x - y) / 2) ^ 2 ∂μ) / 2 = ∫ t in (0 : ℝ)..U, C t := by rw [prawitz_sinc_expectation_fubini μ] dsimp [C] rw [intervalIntegral.integral_div] have hh := intervalIntegral.integral_comp_div (a := 0) (b := U) (fun t : ℝ => (1 - t) * (∫ y, cos (t * (U * (x - y))) ∂μ)) hU.ne' simp only [zero_div, div_self hU.ne', smul_eq_mul] at hh have he : (fun t : ℝ => (1 - t / U) * (z t).re) = (fun t : ℝ => (1 - t / U) * (∫ y, cos (t / U * (U * (x - y))) ∂μ)) := by funext t rw [hzre] congr 1 apply integral_congr_ae filter_upwards with y congr 1 field_simp rw [he, hh] field_simp simp only [mul_comm U] let K : ℝ → ℂ := fun t => prawitzKernel (t / U) / (U : ℂ) let P : ℝ → ℂ := fun t => I / ((2 * Real.pi * t : ℝ) : ℂ) let w : ℝ → ℂ := fun t => exp ((t * x : ℝ) * I) * (exp (-(t ^ 2 / 2)) : ℂ) have hgamma (t : ℝ) : charFun (gaussianReal 0 1) t = (exp (-(t ^ 2 / 2)) : ℂ) := by rw [charFun_gaussianReal, Complex.ofReal_exp] congr 1 push_cast norm_num have hz_norm (t : ℝ) : ‖z t‖ = ‖charFun μ t‖ := by dsimp [z] rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, charFun_neg] exact norm_star _ have hw_norm (t : ℝ) : ‖w t‖ = exp (-(t ^ 2 / 2)) := by dsimp [w] rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] have hzw_norm (t : ℝ) : ‖z t - w t‖ = ‖charFun μ t - charFun (gaussianReal 0 1) t‖ := by have he : z t - w t = exp ((t * x : ℝ) * I) * star (charFun μ t - charFun (gaussianReal 0 1) t) := by simp only [z, w, hgamma, charFun_neg, star_sub, Complex.star_def, Complex.conj_ofReal, mul_sub] rw [he, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, norm_star] have hK_norm (t : ℝ) : ‖K t‖ = ‖prawitzKernel (t / U)‖ / U := by dsimp [K] rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hU] -- This component formula includes t = U; no endpoint continuity is used. have hcomponents (t : ℝ) (ht : 0 < t) (htU : t ≤ U) : S t = 2 * (K t).im * (z t).im ∧ C t = 2 * (K t).re * (z t).re := by have ht' : 0 < t / U := div_pos ht hU have hband : |t / U| ≤ 1 := by rw [abs_of_pos ht'] exact (div_le_one hU).mpr htU have hk : ¬(t / U = 0 ∨ 1 < |t / U|) := not_or.mpr ⟨ht'.ne', not_lt.mpr hband⟩ dsimp [S, C, K] rw [Complex.div_ofReal_im, Complex.div_ofReal_re, prawitzKernel, if_neg hk] simp only [Complex.add_im, Complex.add_re, Complex.mul_im, Complex.mul_re, Complex.ofReal_im, Complex.ofReal_re, Complex.I_re, Complex.I_im, mul_zero, mul_one, add_zero, zero_add, sub_zero, abs_of_pos ht', Real.sign_of_pos ht', prawitzSineWeight] constructor <;> ring have hP_re (t : ℝ) : (P t).re = 0 := by dsimp [P] rw [Complex.div_ofReal_re, Complex.I_re, zero_div] have hG_component (t : ℝ) : G t = 2 * (P t).im * (w t).im := by simp only [G, P, w, Complex.div_ofReal_im, Complex.I_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, mul_zero, zero_add, Complex.exp_ofReal_mul_I_im] ring let L : ℝ → ℝ := fun t => (2 / U) * (‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖) + 2 * (‖K t - P t‖ * exp (-(t ^ 2 / 2))) let H : ℝ → ℝ := fun t => (2 / U) * (‖prawitzKernel (t / U)‖ * ‖charFun μ t‖) have hlow_point (t : ℝ) (ht : 0 < t) (htU : t ≤ U) : |S t - G t| + C t ≤ L t := by obtain ⟨hs, hc⟩ := hcomponents t ht htU rw [hs, hc, hG_component] have hb := hcomplex (K t) (P t) (z t) (w t) (hP_re t) rw [hzw_norm, hw_norm, hK_norm] at hb convert hb using 1 dsimp [L] ring have hhigh_point (t : ℝ) (ht : 0 < t) (htU : t ≤ U) : |S t| + C t ≤ H t := by obtain ⟨hs, hc⟩ := hcomponents t ht htU rw [hs, hc] have hb := hcomplex (K t) 0 (z t) 0 rfl simp only [Complex.zero_im, mul_zero, sub_zero, norm_zero, add_zero] at hb rw [hz_norm, hK_norm] at hb convert hb using 1 -- … truncated; follow the source link for the rest …
Causalean.Stat.CLT.BerryEsseen.prawitz_gaussian_sine_spectral_bound · Causalean/Stat/CLT/BerryEsseen/PrawitzSpectralComparison.lean:19 · uses prawitzKernel , prawitzSignApprox
Prawitz­Spectral­Integrability 1 core · 0 supporting Finite first moment cancels the low-frequency characteristic-function discrepancy. ★ prawitz_four_terms_integrable

Integrability of the four Gaussian Prawitz spectral terms

Finite first moment cancels the low-frequency characteristic-function discrepancy. The principal correction is bounded, and the two remaining terms stay away from zero. These analytic side conditions are separated from Gaussian sine inversion and the final signed spectral comparison.

theorem prawitz_four_terms_integrable reviewed
Causalean.Stat.CLT.BerryEsseen

For a probability law with finite first moment and positive ordered cutoffs U0 ≤ U, each of the four Prawitz spectral integrands is integrable on its frequency region: the filtered characteristic-function discrepancy on [0, U0], the filtered characteristic-function modulus on [U0, U], the Gaussian principal correction on [0, U0], and the Gaussian tail integrand on (U0, ∞).

Formal statement
hfirst :
Integrable (fun y : ℝ => y) μ
U0 U :
ℝ
hU0 :
0 < U0
hcut :
U0 ≤ U
conclusion 1
IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖) volume 0 U0
conclusion 2
IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖) volume U0 U
conclusion 3
IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) volume 0 U0
conclusion 4
IntegrableOn (fun t : ℝ => exp (-(t ^ 2 / 2)) / t) (Ioi U0)
Proof (Lean source)
theorem prawitz_four_terms_integrable (μ : Measure ℝ) [IsProbabilityMeasure μ] (hfirst : Integrable (fun y : ℝ => y) μ) (U0 U : ℝ) (hU0 : 0 < U0) (hcut : U0 ≤ U) : IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * ‖charFun μ t - charFun (gaussianReal 0 1) t‖) volume 0 U0 ∧ IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U)‖ * ‖charFun μ t‖) volume U0 U ∧ IntervalIntegrable (fun t : ℝ => ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) volume 0 U0 ∧ IntegrableOn (fun t : ℝ => exp (-(t ^ 2 / 2)) / t) (Ioi U0) := by have hU : 0 < U := hU0.trans_le hcut -- The total piecewise formula is measurable, including its assigned endpoints. have hkernel : Measurable prawitzKernel := by have hs : Measurable sign := by unfold sign exact Measurable.ite measurableSet_Iio measurable_const (Measurable.ite measurableSet_Ioi measurable_const measurable_const) unfold prawitzKernel apply Measurable.ite · exact (measurableSet_eq_fun measurable_id measurable_const).union (measurableSet_lt measurable_const (measurable_id.abs)) · fun_prop · fun_prop have hscaled : Measurable (fun t : ℝ => prawitzKernel (t / U)) := hkernel.comp (by fun_prop) have hband (t : ℝ) (ht : 0 < t) (htU : t ≤ U) : 0 < |t / U| ∧ |t / U| ≤ 1 := by rw [abs_of_pos (div_pos ht hU)] exact ⟨div_pos ht hU, (div_le_one hU).mpr htU⟩ have hkbound (t : ℝ) (ht : 0 < t) (htU : t ≤ U) : ‖prawitzKernel (t / U)‖ ≤ U / (2 * pi) / t + 1 / 2 := by have hb := prawitzKernel_norm_le (t / U) (hband t ht htU).1 (hband t ht htU).2 rw [abs_of_pos (div_pos ht hU)] at hb convert hb using 1 field_simp have hquot : IntervalIntegrable (fun t : ℝ => ‖charFun μ t - charFun (gaussianReal 0 1) t‖ / |t|) volume 0 U0 := by apply (charFun_normal_quotient_intervalIntegrable μ hfirst U0).mono_set rw [Set.uIcc_of_le hU0.le, Set.uIcc_of_le (by linarith : -U0 ≤ U0)] intro t ht exact ⟨by linarith [ht.1], ht.2⟩ have hdiff : IntervalIntegrable (fun t : ℝ => ‖charFun μ t - charFun (gaussianReal 0 1) t‖) volume 0 U0 := by exact ((continuous_charFun (μ := μ)).sub (continuous_charFun (μ := gaussianReal 0 1))).norm.intervalIntegrable 0 U0 -- Ioc domains exclude zero a.e. without assuming continuity of the kernel. refine ⟨?_, ?_, ?_, ?_⟩ · apply (intervalIntegrable_iff_integrableOn_Ioc_of_le hU0.le).mpr apply ((hquot.const_mul (U / (2 * pi))).add (hdiff.const_mul (1 / 2))).1.mono' · exact ((hscaled.norm).mul (by fun_prop)).aestronglyMeasurable · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _))] have hb := mul_le_mul_of_nonneg_right (hkbound t ht.1 (ht.2.trans hcut)) (norm_nonneg (charFun μ t - charFun (gaussianReal 0 1) t)) rw [abs_of_pos ht.1] convert hb using 1 <;> first | rfl | ring · apply (intervalIntegrable_iff_integrableOn_Ioc_of_le hcut).mpr apply (intervalIntegrable_const (c := U / (2 * pi) / U0 + 1 / 2) (a := U0) (b := U) (μ := volume)).1.mono' · exact (hscaled.norm.mul (by fun_prop)).aestronglyMeasurable · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _))] calc _ ≤ ‖prawitzKernel (t / U)‖ * 1 := mul_le_mul_of_nonneg_left (norm_charFun_le_one t) (norm_nonneg _) _ ≤ U / (2 * pi) / t + 1 / 2 := by simpa using hkbound t (hU0.trans ht.1) ht.2 _ ≤ U / (2 * pi) / U0 + 1 / 2 := by gcongr exact ht.1.le · apply (intervalIntegrable_iff_integrableOn_Ioc_of_le hU0.le).mpr apply (intervalIntegrable_const (c := 1 / (2 * U)) (a := 0) (b := U0) (μ := volume)).1.mono' · have hm : Measurable (fun t : ℝ => ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ * exp (-(t ^ 2 / 2))) := by fun_prop exact hm.aestronglyMeasurable · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht have heq : prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ) = (prawitzKernel (t / U) - I / ((2 * pi * (t / U) : ℝ) : ℂ)) / (U : ℂ) := by push_cast have hUc : (U : ℂ) ≠ 0 := by exact_mod_cast hU.ne' field_simp [hUc] have hb := prawitzKernel_principal_correction_norm_le (t / U) (hband t ht.1 (ht.2.trans hcut)).1 (hband t ht.1 (ht.2.trans hcut)).2 have hc : ‖prawitzKernel (t / U) / (U : ℂ) - I / ((2 * pi * t : ℝ) : ℂ)‖ ≤ 1 / (2 * U) := by rw [heq, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hU] calc _ ≤ (1 / 2) / U := (div_le_div_iff_of_pos_right hU).mpr hb _ = _ := by ring rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (norm_nonneg _) (Real.exp_pos _).le)] calc _ ≤ (1 / (2 * U)) * exp (-(t ^ 2 / 2)) := mul_le_mul_of_nonneg_right hc (Real.exp_pos _).le _ ≤ (1 / (2 * U)) * 1 := by gcongr apply Real.exp_le_one_iff.mpr exact neg_nonpos.mpr (by positivity) _ = _ := mul_one _ · have hg : Integrable (fun t : ℝ => exp (-(t ^ 2 / 2))) volume := by convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 funext t congr 1 ring apply (hg.div_const U0).integrableOn.mono' · exact (by fun_prop : Measurable (fun t : ℝ => exp (-(t ^ 2 / 2)) / t)).aestronglyMeasurable · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht rw [Real.norm_eq_abs, abs_of_pos (div_pos (Real.exp_pos _) (hU0.trans ht))] exact div_le_div_of_nonneg_left (Real.exp_pos _).le hU0 ht.le
Causalean.Stat.CLT.BerryEsseen.prawitz_four_terms_integrable · Causalean/Stat/CLT/BerryEsseen/PrawitzSpectralIntegrability.lean:20 · uses prawitzKernel
Reciprocal­Square­Tail 1 core · 0 supporting Telescoping reciprocal differences sandwich the summable positive tail. ★ reciprocal_sq_tail_bounds

Elementary bounds on a shifted reciprocal-square tail

Telescoping reciprocal differences sandwich the summable positive tail. This leaf supplies the deterministic error bound after the Prawitz series identity, without any trigonometric or probability dependency.

theorem reciprocal_sq_tail_bounds reviewed
Causalean.Stat.CLT.BerryEsseen

At a positive shift x, the reciprocal-square tail Σ_{n≥0} 1/(x+n+1)² is summable and lies between 1/(x+1) and 1/x.

Formal statement
x :
ℝ
hx :
0 < x
conclusion 1
Summable (fun n : ℕ => 1 / (x + (n : ℝ) + 1) ^ 2)
conclusion 2
1 / (x + 1) ≤ (∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2)
conclusion 3
(∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2) ≤ 1 / x
Proof (Lean source)
theorem reciprocal_sq_tail_bounds (x : ℝ) (hx : 0 < x) : Summable (fun n : ℕ => 1 / (x + (n : ℝ) + 1) ^ 2) ∧ 1 / (x + 1) ≤ (∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2) ∧ (∑' n : ℕ, 1 / (x + (n : ℝ) + 1) ^ 2) ≤ 1 / x := by /- Reuse Real.summable_one_div_nat_add_rpow or p-series comparison. For a=x+n>0, sandwich (a+1)^(-2) between 1/(a+1)-1/(a+2) and 1/a-1/(a+1). Sum over range N, telescope, then pass to N→∞; the trailing reciprocals tend to zero. This is a discrete elementary leaf, independent of PrawitzSignSeries. The lower bound implies S≥1/x-1/x² by elementary field algebra. -/ have hs : Summable (fun n : ℕ => 1 / (x + (n : ℝ) + 1) ^ 2) := by have h := (Real.summable_one_div_nat_add_rpow (x + 1) 2).2 (by norm_num) convert h using 1 ext n rw [abs_of_pos (by positivity), Real.rpow_two] congr 2; ring have ht (a : ℝ) (ha : 0 < a) : HasSum (fun n : ℕ => 1 / (a + n) - 1 / (a + (n + 1 : ℕ))) (1 / a) := by apply (hasSum_iff_tendsto_nat_of_nonneg (fun n => ?_) _).2 · simp only [Finset.sum_range_sub', Nat.cast_zero, add_zero] have hlim : Tendsto (fun n : ℕ => 1 / (a + (n : ℝ))) atTop (nhds 0) := by simpa only [one_div, Function.comp_def] using tendsto_inv_atTop_zero.comp (Filter.tendsto_atTop_add_const_left _ a (tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop)) simpa using tendsto_const_nhds.sub hlim · apply sub_nonneg.mpr apply one_div_le_one_div_of_le (by positivity) simp only [Nat.cast_add, Nat.cast_one] linarith have hl := ht (x + 1) (by linarith) have hu := ht x hx refine ⟨hs, ?_, ?_⟩ · rw [← hl.tsum_eq] apply hl.summable.tsum_le_tsum _ hs intro n have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp only [Nat.cast_add, Nat.cast_one] apply (sub_le_iff_le_add).2 have h1 : 0 < x + (n : ℝ) + 1 := by positivity have h2 : 0 < x + 1 + ((n : ℝ) + 1) := by positivity field_simp nlinarith · rw [← hu.tsum_eq] apply hs.tsum_le_tsum _ hu.summable intro n have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp only [Nat.cast_add, Nat.cast_one] have h0 : 0 < x + (n : ℝ) := by positivity have h1 : 0 < x + ((n : ℝ) + 1) := by positivity apply (le_sub_iff_add_le).2 field_simp nlinarith
Causalean.Stat.CLT.BerryEsseen.reciprocal_sq_tail_bounds · Causalean/Stat/CLT/BerryEsseen/ReciprocalSquareTail.lean:15
Shifted­Reciprocal­Square­Regularity 1 core · 0 supporting The integer reciprocal-square series converges locally uniformly away from its integer poles, including at noninteger real arguments. ★ shifted_reciprocal_sq_summableLocallyUniformlyOn

Local uniform convergence of shifted reciprocal squares

The integer reciprocal-square series converges locally uniformly away from its integer poles, including at noninteger real arguments. This is the boundary-continuity prerequisite missing from the upper-half-plane-only cotangent derivative theorem in Mathlib.

theorem shifted_reciprocal_sq_summableLocallyUniformlyOn reviewed
Causalean.Stat.CLT.BerryEsseen

The integer shifted reciprocal-square series Σ_{m∈ℤ} 1/(z+m)² converges locally uniformly on the complex plane with the integers removed.

Formal statement
SummableLocallyUniformlyOn (fun m : ℤ => fun z : ℂ => 1 / (z + (m : ℂ)) ^ 2) integerComplement
Proof (Lean source)
theorem shifted_reciprocal_sq_summableLocallyUniformlyOn : SummableLocallyUniformlyOn (fun m : ℤ => fun z : ℂ => 1 / (z + (m : ℂ)) ^ 2) integerComplement := by /- Lowest independent analytic leaf. Reuse SummableLocallyUniformlyOn.of_locally_bounded_eventually. On each compact K, choose R bounding ‖z‖. For |m|≥2R, reverse triangle gives ‖z+m‖≥|m|/2, hence ‖1/(z+m)^2‖≤4/|m|^2. The finite exceptional indices need no uniform bound in the eventual-majorant criterion. Reuse integer p-series summability; do not add a positive-imaginary-part hypothesis. Individual summands are continuous on integerComplement. Consequently their tsum is continuous there, enabling z=x+iε, ε↓0 in the independent upper-half-plane identity. No partial-fraction identity is needed here. -/ apply SummableLocallyUniformlyOn.of_locally_bounded_eventually Complex.isOpen_compl_range_intCast intro K _ hK obtain ⟨R, hRpos, hR⟩ := hK.isBounded.exists_pos_norm_le refine ⟨fun m : ℤ => 4 / (m : ℝ) ^ 2, ?_, ?_⟩ · simpa only [mul_one_div] using (Real.summable_one_div_int_pow.mpr (by norm_num : 1 < (2 : ℕ))).mul_left 4 · have hlarge : ∀ᶠ m : ℤ in Filter.cofinite, 2 * R ≤ ‖(m : ℂ)‖ := (tendsto_norm_comp_cofinite_atTop_of_isClosedEmbedding Complex.isClosedEmbedding_intCast).eventually_ge_atTop (2 * R) filter_upwards [hlarge] with m hm z hz have hmpos : 0 < |(m : ℝ)| := by rw [Complex.norm_intCast] at hm linarith have htriangle : ‖(m : ℂ)‖ ≤ ‖z + (m : ℂ)‖ + ‖z‖ := by simpa only [add_sub_cancel_left] using norm_sub_le (z + (m : ℂ)) z have hhalf : |(m : ℝ)| ≤ 2 * ‖z + (m : ℂ)‖ := by rw [Complex.norm_intCast] at hm htriangle have := hR z hz linarith have hzpos : 0 < ‖z + (m : ℂ)‖ := by linarith have hsquare : (m : ℝ) ^ 2 ≤ 4 * ‖z + (m : ℂ)‖ ^ 2 := by have := mul_self_le_mul_self (abs_nonneg (m : ℝ)) hhalf nlinarith [sq_abs (m : ℝ)] simp only [norm_div, norm_one, norm_pow] have hmSq : 0 < (m : ℝ) ^ 2 := by simpa only [sq_abs] using sq_pos_of_pos hmpos apply (div_le_div_iff₀ (sq_pos_of_pos hzpos) hmSq).2 simpa only [one_mul] using hsquare
Causalean.Stat.CLT.BerryEsseen.shifted_reciprocal_sq_summableLocallyUniformlyOn · Causalean/Stat/CLT/BerryEsseen/ShiftedReciprocalSquareRegularity.lean:17
Sinc­Box­Convolution 1 core · 0 supporting The interval density whose Fourier transform is sinc has a triangular self-convolution. ★ sincBox_self_convolution

Self-convolution of the sinc interval density

The interval density whose Fourier transform is sinc has a triangular self-convolution. This spatial calculation is the next step toward the Fourier transform of squared sinc.

theorem sincBox_self_convolution reviewed
Causalean.Stat.CLT.BerryEsseen

At every real argument t, the self-convolution of the interval density equal to π on (−1/(2π), 1/(2π)], whose Fourier transform is sinc, equals the triangular function π·max(1 − π|t|, 0).

Formal statement
t :
ℝ
∫ u : ℝ, sincBox (t - u) * sincBox u = ((pi * max (1 - pi * |t|) 0 : ℝ) : ℂ)
Proof (Lean source)
theorem sincBox_self_convolution (t : ℝ) : ∫ u : ℝ, sincBox (t - u) * sincBox u = ((Real.pi * max (1 - Real.pi * |t|) 0 : ℝ) : ℂ) := by let a : ℝ := (2 * Real.pi)⁻¹ let s : Set ℝ := Icc (-a) a ∩ Icc (t - a) (t + a) have hae (x : ℝ) : ∀ᵐ u : ℝ ∂volume, u ≠ x := by rw [ae_iff] simpa only [not_ne_iff, Set.ofPred_eq_eq_singleton] using (measure_singleton x : volume {x} = 0) have hfun : (fun u : ℝ => sincBox (t - u) * sincBox u) =ᵐ[volume] (fun u => s.indicator (fun _ => ((Real.pi ^ 2 : ℝ) : ℂ)) u) := by filter_upwards [hae (-a), hae a, hae (t - a), hae (t + a)] with u h₁ h₂ h₃ h₄ have hleft : t - u ∈ Ioc (-a) a ↔ u ∈ Icc (t - a) (t + a) := by simp only [Set.mem_Ioc, Set.mem_Icc] constructor · rintro ⟨hlo, hhi⟩ constructor <;> linarith · rintro ⟨hlo, hhi⟩ constructor · linarith [lt_of_le_of_ne hhi h₄] · linarith have hright : u ∈ Ioc (-a) a ↔ u ∈ Icc (-a) a := by simp only [Set.mem_Ioc, Set.mem_Icc] constructor · rintro ⟨hlo, hhi⟩ exact ⟨hlo.le, hhi⟩ · rintro ⟨hlo, hhi⟩ exact ⟨lt_of_le_of_ne hlo (Ne.symm h₁), hhi⟩ change (Ioc (-a) a).indicator (fun _ => (Real.pi : ℂ)) (t - u) * (Ioc (-a) a).indicator (fun _ => (Real.pi : ℂ)) u = s.indicator (fun _ => ((Real.pi ^ 2 : ℝ) : ℂ)) u have hs : u ∈ s ↔ u ∈ Ioc (-a) a ∧ t - u ∈ Ioc (-a) a := by change (u ∈ Icc (-a) a ∧ u ∈ Icc (t - a) (t + a)) ↔ _ exact and_congr hright.symm hleft.symm by_cases hp : t - u ∈ Ioc (-a) a <;> by_cases hq : u ∈ Ioc (-a) a <;> simp [indicator, hp, hq, hs, pow_two] rw [integral_congr_ae hfun, integral_indicator_const _ (measurableSet_Icc.inter measurableSet_Icc)] have hoverlap : volume.real s = max (2 * a - |t|) 0 := by dsimp [s] rw [Set.Icc_inter_Icc, Real.volume_real_Icc] change max (min a (t + a) - max (-a) (t - a)) 0 = max (2 * a - |t|) 0 rcases le_total t 0 with ht | ht · rw [max_eq_left (by linarith : t - a ≤ -a), min_eq_right (by linarith : t + a ≤ a), abs_of_nonpos ht] congr 1 ring · rw [max_eq_right (by linarith : -a ≤ t - a), min_eq_left (by linarith : a ≤ t + a), abs_of_nonneg ht] congr 1 ring rw [hoverlap] have hpi : 0 < Real.pi := Real.pi_pos have haπ : Real.pi * (2 * a) = 1 := by dsimp [a] field_simp [Real.pi_ne_zero] rw [Complex.real_smul, ← Complex.ofReal_mul] congr 1 by_cases h : 0 ≤ 2 * a - |t| · rw [max_eq_left h, max_eq_left (by nlinarith [mul_nonneg hpi.le h] : 0 ≤ 1 - Real.pi * |t|)] nlinarith · rw [max_eq_right (le_of_lt (lt_of_not_ge h)), max_eq_right (by nlinarith [mul_nonpos_of_nonneg_of_nonpos hpi.le (le_of_lt (lt_of_not_ge h))] : 1 - Real.pi * |t| ≤ 0)] simp
Causalean.Stat.CLT.BerryEsseen.sincBox_self_convolution · Causalean/Stat/CLT/BerryEsseen/SincBoxConvolution.lean:18 · uses sincBox
Sinc­Fourth­Fourier 1 core · 0 supporting The transform of sinc⁴ is the self-convolution of the squared-sinc Fourier triangle, divided by 2π. ★ sincFourth_fourier_triangleConvolution

Fourier transform of fourth-power sinc

The transform of sinc⁴ is the self-convolution of the squared-sinc Fourier triangle, divided by 2π. This identity is the unscaled analytic input for the compact-frequency probability kernel.

theorem sincFourth_fourier_triangleConvolution reviewed
Causalean.Stat.CLT.BerryEsseen

At every frequency t, the Fourier integral of the fourth power of sinc equals 1/(2π) times the self-convolution at t of the squared-sinc triangle u ↦ π·max(1 − |u|/2, 0). In particular this identity holds at zero and at the support endpoints.

Formal statement
t :
ℝ
∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 4 : ℝ) : ℂ)
= ((1 / (2 * pi) * ∫ u : ℝ, (pi * max (1 - |u| / 2) 0) * (pi * max (1 - |t - u| / 2) 0) : ℝ) : ℂ)
Proof (Lean source)
theorem sincFourth_fourier_triangleConvolution (t : ℝ) : ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 4 : ℝ) : ℂ) = ((1 / (2 * pi) * ∫ u : ℝ, (pi * max (1 - |u| / 2) 0) * (pi * max (1 - |t - u| / 2) 0) : ℝ) : ℂ) := by /- Write sinc⁴ as sinc² * sinc² and substitute `sincSquared_fourier_inversion` into the second factor. Move its constant `1/(2π)` outside the x-integral with `integral_mul_const`, then apply `sincSquared_triangle_integral_swap`. For each u, rewrite the inner integral by `sincSquared_fourier_triangle (t - u)`. Finally commute the real-to-complex cast with the integrable convolution (`integral_ofReal`), and use `integral_const_mul` for the outer constant. The existing Fubini lemma already handles all double-integrability issues; no Fourier-product theorem or new analytic assumption is needed. -/ calc _ = ∫ x : ℝ, (exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)) * (((1 / (2 * pi) : ℝ) : ℂ) * ∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)) := by apply integral_congr_ae filter_upwards with x rw [← sincSquared_fourier_inversion x] push_cast ring _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ x : ℝ, (exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)) * (∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)) := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards with x ring _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ u : ℝ, ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ) * (∫ x : ℝ, exp (((((t - u) * x : ℝ) : ℂ) * I)) * ((sinc x ^ 2 : ℝ) : ℂ)) := by rw [sincSquared_triangle_integral_swap t] _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ u : ℝ, (((pi * max (1 - |u| / 2) 0) * (pi * max (1 - |t - u| / 2) 0) : ℝ) : ℂ) := by congr 1 apply integral_congr_ae filter_upwards with u rw [sincSquared_fourier_triangle (t - u)] push_cast rfl _ = _ := by rw [integral_complex_ofReal] push_cast ring
Causalean.Stat.CLT.BerryEsseen.sincFourth_fourier_triangleConvolution · Causalean/Stat/CLT/BerryEsseen/SincFourthFourier.lean:18
Sinc­Fourth­Fubini 1 core · 0 supporting The squared-sinc factor and its integrable Fourier triangle give an absolutely integrable double integral. ★ sincSquared_triangle_integral_swap

Fubini step for the fourth-power sinc transform

The squared-sinc factor and its integrable Fourier triangle give an absolutely integrable double integral. Swapping its order is the analytic step in the fourth-power sinc transform, isolated from Fourier normalization.

theorem sincSquared_triangle_integral_swap reviewed
Causalean.Stat.CLT.BerryEsseen

At any frequency t, the integral over x of the Fourier exponential times squared sinc times the inverse transform of the triangle u ↦ π·max(1 − |u|/2, 0) equals the integral over u of the triangle times the Fourier integral of squared sinc at t − u: the spatial and frequency integrals may be exchanged.

Formal statement
t :
ℝ
(∫ x : ℝ, (exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)) * (∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)))
= ∫ u : ℝ, ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ) * (∫ x : ℝ, exp (((((t - u) * x : ℝ) : ℂ) * I)) * ((sinc x ^ 2 : ℝ) : ℂ))
Proof (Lean source)
theorem sincSquared_triangle_integral_swap (t : ℝ) : (∫ x : ℝ, (exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)) * (∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ))) = ∫ u : ℝ, ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ) * (∫ x : ℝ, exp (((((t - u) * x : ℝ) : ℂ) * I)) * ((sinc x ^ 2 : ℝ) : ℂ)) := by let F : ℝ → ℝ → ℂ := fun x u => (exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)) * (exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)) have hmajor : Integrable (fun z : ℝ × ℝ => ‖Real.sinc z.1 ^ 2‖ * ‖Real.pi * max (1 - |z.2| / 2) 0‖) (volume.prod volume) := sincSquared_integrable.norm.mul_prod sincTriangle_integrable.norm have hF : Integrable (uncurry F) (volume.prod volume) := by apply Integrable.mono' hmajor · have hc : Continuous (uncurry F) := by dsimp [F, uncurry] fun_prop exact hc.aestronglyMeasurable · filter_upwards with z dsimp [F, uncurry] simp only [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, Complex.norm_real, Real.norm_eq_abs] rw [abs_mul] have hswap := integral_integral_swap hF calc _ = ∫ x : ℝ, ∫ u : ℝ, F x u := by apply integral_congr_ae filter_upwards with x dsimp [F] rw [integral_const_mul] _ = ∫ u : ℝ, ∫ x : ℝ, F x u := hswap _ = _ := by apply integral_congr_ae filter_upwards with u dsimp [F] calc (∫ x : ℝ, F x u) = ∫ x : ℝ, ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ) * (exp (((((t - u) * x : ℝ) : ℂ) * I)) * ((sinc x ^ 2 : ℝ) : ℂ)) := by apply integral_congr_ae filter_upwards with x have hexp : exp (((t * x : ℝ) : ℂ) * I) * exp (((-u * x : ℝ) : ℂ) * I) = exp (((((t - u) * x : ℝ) : ℂ) * I)) := by rw [← Complex.exp_add] congr 1 push_cast ring dsimp [F] rw [← hexp] ring _ = _ := integral_const_mul _ _
Causalean.Stat.CLT.BerryEsseen.sincSquared_triangle_integral_swap · Causalean/Stat/CLT/BerryEsseen/SincFourthFubini.lean:17
Sinc­Kernel­Inversion 1 core · 0 supporting This analytic identity is the independent inversion step needed to bound a CDF difference after convolution with the fourth-power sinc kernel. ★ sinc4Kernel_fourier_inversion

Fourier inversion of the compact-frequency sinc kernel

This analytic identity is the independent inversion step needed to bound a CDF difference after convolution with the fourth-power sinc kernel. It uses the same positive-frequency Fourier convention as sinc4Kernel_fourier_eq_zero.

theorem sinc4Kernel_fourier_inversion reviewed
Causalean.Stat.CLT.BerryEsseen

At positive bandwidth T, the fourth-power sinc density at every point y equals 1/(2π) times the inverse Fourier integral, over the support interval [−T, T], of its Fourier transform.

Formal statement
T :
ℝ
hT :
0 < T
y :
ℝ
(sinc4Kernel T y : ℂ)
= ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ))
Proof (Lean source)
theorem sinc4Kernel_fourier_inversion (T : ℝ) (hT : 0 < T) (y : ℝ) : (sinc4Kernel T y : ℂ) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)) := by let f : ℝ → ℂ := fun u => (sinc4Kernel T u : ℂ) let F : ℝ → ℂ := fun t => ∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * f u let g : ℝ → ℂ := fun t => exp (((-(t * y) : ℝ) : ℂ) * I) * F t have hf : Integrable f := (sinc4Kernel_integrable T hT).ofReal have hfc : Continuous f := by dsimp [f, sinc4Kernel] fun_prop have hzero (t : ℝ) (ht : T ≤ |t|) : F t = 0 := by exact sinc4Kernel_fourier_eq_zero T t hT ht have hFfourier (w : ℝ) : fourier f w = F ((-2 * Real.pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with u simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hFcont : Continuous F := by have hc : Continuous (fourier f) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hf have heq : F = fun t : ℝ => fourier f (t / (-2 * Real.pi)) := by funext t rw [hFfourier] congr 1 field_simp rw [heq] fun_prop have hFsupp : support F ⊆ Icc (-T) T := by intro t ht simp only [Function.mem_support, Set.mem_Icc] at * constructor · by_contra hn exact ht (hzero t (by rw [abs_of_nonpos (by linarith)]; linarith)) · by_contra hn exact ht (hzero t (by rw [abs_of_nonneg (by linarith)]; linarith)) have hFint : Integrable F := (integrableOn_iff_integrable_of_support_subset hFsupp).mp hFcont.integrableOn_Icc have hFourierInt : Integrable (fourier f) := by rw [funext hFfourier] exact hFint.comp_mul_left' (by positivity : (-2 * Real.pi : ℝ) ≠ 0) have hinv := hf.fourierInv_fourier_eq hFourierInt hfc.continuousAt (v := y) have hgsupp : support g ⊆ Ioc (-T) T := by intro t ht simp only [Function.mem_support, Set.mem_Ioc] at * constructor · by_contra hn exact ht (by dsimp [g]; rw [hzero t (by rw [abs_of_nonpos (by linarith)]; linarith)]; simp) · by_contra hn exact ht (by dsimp [g]; rw [hzero t (by rw [abs_of_nonneg (by linarith)]; linarith)]; simp) have hchange : (∫ w : ℝ, g ((-2 * Real.pi) * w)) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, g t := by rw [Measure.integral_comp_mul_left] have hcoeff : |((-2 * Real.pi : ℝ)⁻¹)| = 1 / (2 * Real.pi) := by rw [abs_inv, abs_mul, abs_neg, abs_of_pos Real.pi_pos] norm_num rw [hcoeff, Complex.real_smul] calc (sinc4Kernel T y : ℂ) = FourierTransform.fourierInv (fourier f) y := hinv.symm _ = ∫ w : ℝ, g ((-2 * Real.pi) * w) := by rw [Real.fourierInv_eq'] simp_rw [hFfourier] apply integral_congr_ae filter_upwards with w dsimp [g] simp only [starRingEnd_apply, star_trivial] congr 2 push_cast ring _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, g t := hchange _ = _ := by rw [← intervalIntegral.integral_eq_integral_of_support_subset hgsupp]
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_fourier_inversion · Causalean/Stat/CLT/BerryEsseen/SincKernelInversion.lean:18 · uses sinc4Kernel
Sinc­Squared­Fourier 1 core · 0 supporting The triangle transform of squared sinc is the base analytic calculation for the compact-frequency fourth-power smoothing kernel. ★ sincSquared_fourier_triangle

Fourier transform of squared sinc

The triangle transform of squared sinc is the base analytic calculation for the compact-frequency fourth-power smoothing kernel. The endpoint formula includes the boundary of its Fourier support.

theorem sincSquared_fourier_triangle reviewed
Causalean.Stat.CLT.BerryEsseen

At every real frequency t, the Fourier integral of squared sinc is the triangular function π·max(1 − |t|/2, 0): it equals π(1 − |t|/2) on frequencies of absolute value at most two and zero outside, including at the two support endpoints.

Formal statement
t :
ℝ
∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ)
= ((pi * max (1 - |t| / 2) 0 : ℝ) : ℂ)
Proof (Lean source)
theorem sincSquared_fourier_triangle (t : ℝ) : ∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * ((sinc x ^ 2 : ℝ) : ℂ) = ((pi * max (1 - |t| / 2) 0 : ℝ) : ℂ) := by let f : ℝ → ℂ := sincBox ⋆[ContinuousLinearMap.mul ℂ ℂ] sincBox have hf (u : ℝ) : f u = ((pi * max (1 - pi * |u|) 0 : ℝ) : ℂ) := by simpa [f, convolution, mul_comm] using sincBox_self_convolution u have hcont : Continuous f := by have h : Continuous (fun u : ℝ => ((pi * max (1 - pi * |u|) 0 : ℝ) : ℂ)) := by fun_prop simpa only [← funext hf] using h have hfi : Integrable f := sincBox_integrable.integrable_convolution (ContinuousLinearMap.mul ℂ ℂ) sincBox_integrable have hFourier (u : ℝ) : fourier f u = ((sinc u ^ 2 : ℝ) : ℂ) := by rw [Real.fourier_mul_convolution_eq sincBox_integrable sincBox_integrable] simp [sincBox_fourier, pow_two] have hFourierInt : Integrable (fourier f) := by rw [funext hFourier] exact sincSquared_integrable.ofReal calc _ = FourierTransform.fourierInv (fourier f) (t / (2 * pi)) := by rw [Real.fourierInv_eq'] simp_rw [hFourier] apply integral_congr_ae filter_upwards with x have hx : 2 * pi * inner ℝ x (t / (2 * pi)) = t * x := by simp only [RCLike.inner_apply', starRingEnd_apply, star_trivial] field_simp [Real.pi_ne_zero] simp only [smul_eq_mul, hx] _ = f (t / (2 * pi)) := hfi.fourierInv_fourier_eq hFourierInt hcont.continuousAt _ = ((pi * max (1 - |t| / 2) 0 : ℝ) : ℂ) := by rw [hf] congr 1 have hpi : 0 < pi := Real.pi_pos rw [abs_div, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2), abs_of_pos hpi] field_simp [Real.pi_ne_zero]
Causalean.Stat.CLT.BerryEsseen.sincSquared_fourier_triangle · Causalean/Stat/CLT/BerryEsseen/SincSquaredFourier.lean:24
Sinc­Squared­Inversion 1 core · 1 supporting The triangle transform of squared sinc is integrable. ★ sincSquared_fourier_inversion

Inversion of the squared-sinc Fourier triangle

The triangle transform of squared sinc is integrable. Fourier inversion then recovers squared sinc at every spatial point, with the positive-exponential transform convention and its 1/(2π) normalization made explicit.

theorem sincSquared_fourier_inversion reviewed
Causalean.Stat.CLT.BerryEsseen

At every real point x, including zero, squared sinc equals 1/(2π) times the inverse Fourier integral of its triangle transform u ↦ π·max(1 − |u|/2, 0).

Formal statement
x :
ℝ
((sinc x ^ 2 : ℝ) : ℂ)
= (((1 / (2 * pi) : ℝ) : ℂ) * ∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((pi * max (1 - |u| / 2) 0 : ℝ) : ℂ))
Proof (Lean source)
theorem sincSquared_fourier_inversion (x : ℝ) : ((sinc x ^ 2 : ℝ) : ℂ) = (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ u : ℝ, exp (((-u * x : ℝ) : ℂ) * I) * ((Real.pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)) := by let f : ℝ → ℂ := fun y => ((sinc y ^ 2 : ℝ) : ℂ) let g : ℝ → ℂ := fun u => exp (((-u * x : ℝ) : ℂ) * I) * ((Real.pi * max (1 - |u| / 2) 0 : ℝ) : ℂ) have hscale : (-2 * Real.pi : ℝ) ≠ 0 := by positivity have hf : Integrable f := by exact sincSquared_integrable.ofReal have hcont : Continuous f := by dsimp [f] fun_prop have hFourier (t : ℝ) : fourier f t = ((Real.pi * max (1 - |(-2 * Real.pi) * t| / 2) 0 : ℝ) : ℂ) := by rw [Real.fourier_eq'] convert sincSquared_fourier_triangle ((-2 * Real.pi) * t) using 1 apply integral_congr_ae filter_upwards with y simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hFourierInt : Integrable (fourier f) := by rw [funext hFourier] have htri : Integrable (fun u : ℝ => ((Real.pi * max (1 - |u| / 2) 0 : ℝ) : ℂ)) := sincTriangle_integrable.ofReal exact htri.comp_mul_left' hscale have hinv := hf.fourierInv_fourier_eq hFourierInt hcont.continuousAt (v := x) have hchange : (∫ t : ℝ, g ((-2 * Real.pi) * t)) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ u : ℝ, g u := by rw [Measure.integral_comp_mul_left] have hcoeff : |((-2 * Real.pi : ℝ)⁻¹)| = 1 / (2 * Real.pi) := by rw [abs_inv, abs_mul, abs_neg, abs_of_pos Real.pi_pos] norm_num rw [hcoeff] rw [Complex.real_smul] calc ((sinc x ^ 2 : ℝ) : ℂ) = FourierTransform.fourierInv (fourier f) x := hinv.symm _ = ∫ t : ℝ, g ((-2 * Real.pi) * t) := by rw [Real.fourierInv_eq'] simp_rw [hFourier] apply integral_congr_ae filter_upwards with t dsimp [g] simp only [starRingEnd_apply, star_trivial] congr 2 push_cast ring _ = _ := hchange
Causalean.Stat.CLT.BerryEsseen.sincSquared_fourier_inversion · Causalean/Stat/CLT/BerryEsseen/SincSquaredInversion.lean:45
1 supporting declaration (lemmas, instances)
  • sincTriangle_integrable theorem — The real triangular Fourier transform π max (1 - |u|/2) 0 of squared sinc is integrable over the whole line.
    Integrable (fun u : ℝ => pi * max (1 - |u| / 2) 0) volume
    Proof (Lean source)
    theorem sincTriangle_integrable : Integrable (fun u : ℝ => pi * max (1 - |u| / 2) 0) volume := by let f : ℝ → ℝ := fun u => pi * max (1 - |u| / 2) 0 have hf : Continuous f := by dsimp [f] fun_prop have hsupp : support f ⊆ Icc (-2) 2 := by intro u hu simp only [Function.mem_support] at hu constructor · by_contra hn have hle : u < -2 := lt_of_not_ge hn have hz : f u = 0 := by dsimp [f] rw [abs_of_nonpos (by linarith), max_eq_right (by linarith)] ring exact hu hz · by_contra hn have hge : 2 < u := lt_of_not_ge hn have hz : f u = 0 := by dsimp [f] rw [abs_of_nonneg (by linarith), max_eq_right (by linarith)] ring exact hu hz exact (integrableOn_iff_integrable_of_support_subset hsupp).mp hf.integrableOn_Icc
    Causalean.Stat.CLT.BerryEsseen.sincTriangle_integrable · Causalean/Stat/CLT/BerryEsseen/SincSquaredInversion.lean:17
Sinc­Squared­Prereqs 1 core · 1 supporting The squared-sinc transform uses an integrable spatial function and the overlap length of two translated unit intervals. ★ centeredUnitIntervals_overlap

Elementary prerequisites for the squared-sinc Fourier transform

The squared-sinc transform uses an integrable spatial function and the overlap length of two translated unit intervals. Both facts are stated here without Fourier analysis so they can be proved independently.

theorem centeredUnitIntervals_overlap reviewed
Causalean.Stat.CLT.BerryEsseen

The two closed intervals of length two centered at zero and at t overlap in a set of Lebesgue length max(2 − |t|, 0), for every real t.

Formal statement
t :
ℝ
volume.real (Icc (-1 : ℝ) 1 ∩ Icc (t - 1) (t + 1)) = max (2 - |t|) 0
Proof (Lean source)
theorem centeredUnitIntervals_overlap (t : ℝ) : volume.real (Icc (-1 : ℝ) 1 ∩ Icc (t - 1) (t + 1)) = max (2 - |t|) 0 := by rw [Set.Icc_inter_Icc, Real.volume_real_Icc] change max (min 1 (t + 1) - max (-1) (t - 1)) 0 = max (2 - |t|) 0 rcases le_total t 0 with ht | ht · rw [max_eq_left (by linarith : t - 1 ≤ (-1 : ℝ)), min_eq_right (by linarith : t + 1 ≤ (1 : ℝ)), abs_of_nonpos ht] congr 1 ring · rw [max_eq_right (by linarith : (-1 : ℝ) ≤ t - 1), min_eq_left (by linarith : (1 : ℝ) ≤ t + 1), abs_of_nonneg ht] congr 1 ring
Causalean.Stat.CLT.BerryEsseen.centeredUnitIntervals_overlap · Causalean/Stat/CLT/BerryEsseen/SincSquaredPrereqs.lean:56
1 supporting declaration (lemmas, instances)
  • sincSquared_integrable theorem — The square of the real sinc function has finite integral over the real line.
    Integrable (fun x : ℝ => sinc x ^ 2) volume
    Proof (Lean source)
    theorem sincSquared_integrable : Integrable (fun x : ℝ => sinc x ^ 2) volume := by apply (integrable_inv_one_add_sq.const_mul (2 : ℝ)).mono · fun_prop · filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ sinc x ^ 2)] rw [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 2 * (1 + x ^ 2)⁻¹)] rw [inv_eq_one_div, mul_one_div] apply (le_div_iff₀ (by positivity : 0 < 1 + x ^ 2)).2 by_cases hx : |x| ≤ 1 · have ha2 : |x| * |x| ≤ 1 * 1 := mul_self_le_mul_self (abs_nonneg x) hx have hx2 : x ^ 2 ≤ 1 := by simpa [sq_abs, pow_two] using ha2 have hs := Real.abs_sinc_le_one x have hsl := neg_abs_le (sinc x) have hsr := le_abs_self (sinc x) have hs2 : sinc x ^ 2 ≤ 1 := by nlinarith nlinarith [sq_nonneg (sinc x)] · have hxabs : 1 < |x| := lt_of_not_ge hx have hx0 : x ≠ 0 := by intro h subst x norm_num at hxabs rw [Real.sinc_of_ne_zero hx0, div_pow, div_mul_eq_mul_div] apply (div_le_iff₀ (by positivity : 0 < x ^ 2)).2 have habs2 : (1 : ℝ) ^ 2 < |x| ^ 2 := (sq_lt_sq₀ (by positivity) (abs_nonneg x)).2 hxabs have hx2 : 1 < x ^ 2 := by simpa [sq_abs] using habs2 have hs := Real.abs_sin_le_one x have hsl := neg_abs_le (sin x) have hsr := le_abs_self (sin x) have hs2 : sin x ^ 2 ≤ 1 := by nlinarith nlinarith [sq_nonneg (sin x)]
    Causalean.Stat.CLT.BerryEsseen.sincSquared_integrable · Causalean/Stat/CLT/BerryEsseen/SincSquaredPrereqs.lean:19
Sinc­Triangle­Convolution 1 core · 1 supporting The squared-sinc transform is a compactly supported triangle. ★ sincTriangle_convolution_outside

Real integrals of the squared-sinc Fourier triangle

The squared-sinc transform is a compactly supported triangle. These two real-variable integrals isolate the compact-support and normalization calculations used in the fourth-power smoothing kernel.

theorem sincTriangle_convolution_outside reviewed
Causalean.Stat.CLT.BerryEsseen

The self-convolution of the squared-sinc Fourier triangle u ↦ π·max(1 − |u|/2, 0) vanishes at every frequency t of absolute value at least four, including the endpoints.

Formal statement
t :
ℝ
ht :
4 ≤ |t|
(∫ u : ℝ, (pi * max (1 - |u| / 2) 0) * (pi * max (1 - |t - u| / 2) 0)) = 0
Proof (Lean source)
theorem sincTriangle_convolution_outside (t : ℝ) (ht : 4 ≤ |t|) : (∫ u : ℝ, (pi * max (1 - |u| / 2) 0) * (pi * max (1 - |t - u| / 2) 0)) = 0 := by /- At each u, nonzero factors would imply |u| < 2 and |t-u| < 2, contradicting 4 ≤ |t| by the triangle inequality. Thus the integrand is pointwise zero, even when |t| = 4. -/ apply integral_eq_zero_of_ae filter_upwards with u by_cases hu : 2 ≤ |u| · have hzero : max (1 - |u| / 2) 0 = 0 := by apply max_eq_right linarith simp [hzero] · have hu' : |u| < 2 := lt_of_not_ge hu have htri : |t| ≤ |t - u| + |u| := by calc |t| = |(t - u) + u| := by ring_nf _ ≤ |t - u| + |u| := abs_add_le _ _ have hfar : 2 ≤ |t - u| := by linarith have hzero : max (1 - |t - u| / 2) 0 = 0 := by apply max_eq_right linarith simp [hzero]
Causalean.Stat.CLT.BerryEsseen.sincTriangle_convolution_outside · Causalean/Stat/CLT/BerryEsseen/SincTriangleConvolution.lean:111
1 supporting declaration (lemmas, instances)
  • sincTriangle_square_integral theorem — The squared-sinc Fourier triangle has squared integral 4π²/3 over the real line. The triangle is π max (1 - |u|/2) 0.
    (∫ u : ℝ, (pi * max (1 - |u| / 2) 0) ^ 2) = 4 * pi ^ 2 / 3
    Proof (Lean source)
    theorem sincTriangle_square_integral : (∫ u : ℝ, (pi * max (1 - |u| / 2) 0) ^ 2) = 4 * pi ^ 2 / 3 := by /- Split at -2, 0, and 2. Outside [-2,2] the integrand vanishes; on each half it is the square of an affine function. -/ let f : ℝ → ℝ := fun u => (pi * max (1 - |u| / 2) 0) ^ 2 have hcont : Continuous f := by dsimp [f] fun_prop have hzero (u : ℝ) (hu : 2 ≤ |u|) : f u = 0 := by dsimp [f] rw [max_eq_right (by linarith : 1 - |u| / 2 ≤ 0)] ring have hsupp : support f ⊆ Ioc (-2) 2 := by intro u hu simp only [Function.mem_support] at hu constructor · by_contra hn have hle : u ≤ -2 := le_of_not_gt hn exact hu (hzero u (by rw [abs_of_nonpos (by linarith)]; linarith)) · by_contra hn have hge : 2 ≤ u := le_of_lt (lt_of_not_ge hn) exact hu (hzero u (by rw [abs_of_nonneg (by linarith)]; linarith)) have hleft : (∫ u in (-2 : ℝ)..0, f u) = 2 * pi ^ 2 / 3 := by have heq : ∀ u ∈ uIcc (-2 : ℝ) 0, f u = (pi * (1 + u / 2)) ^ 2 := by intro u hu have hle : u ≤ 0 := by simpa using hu.2 have hge : -2 ≤ u := by simpa using hu.1 dsimp [f] rw [abs_of_nonpos hle, max_eq_left (by linarith : 0 ≤ 1 - -u / 2)] ring have hderiv (u : ℝ) : HasDerivAt (fun v : ℝ => pi ^ 2 * (v + 2) ^ 3 / 12) ((pi * (1 + u / 2)) ^ 2) u := by have h := ((hasDerivAt_id u).add_const 2 |>.pow 3 |>.const_mul (pi ^ 2) |>.div_const 12) change HasDerivAt (fun v : ℝ => pi ^ 2 * (v + 2) ^ 3 / 12) (pi ^ 2 * (3 * (u + 2) ^ 2 * 1) / 12) u at h convert h using 1; ring calc _ = ∫ u in (-2 : ℝ)..0, (pi * (1 + u / 2)) ^ 2 := by apply intervalIntegral.integral_congr exact heq _ = (pi ^ 2 * (0 + 2) ^ 3 / 12) - (pi ^ 2 * (-2 + 2) ^ 3 / 12) := by apply intervalIntegral.integral_eq_sub_of_hasDerivAt (f := fun v : ℝ => pi ^ 2 * (v + 2) ^ 3 / 12) (f' := fun v : ℝ => (pi * (1 + v / 2)) ^ 2) · intro u _ exact hderiv u · have hc : Continuous (fun v : ℝ => (pi * (1 + v / 2)) ^ 2) := by fun_prop exact hc.intervalIntegrable _ _ _ = _ := by ring have hright : (∫ u in (0 : ℝ)..2, f u) = 2 * pi ^ 2 / 3 := by have heq : ∀ u ∈ uIcc (0 : ℝ) 2, f u = (pi * (1 - u / 2)) ^ 2 := by intro u hu have hge : 0 ≤ u := by simpa using hu.1 have hle : u ≤ 2 := by simpa using hu.2 dsimp [f] rw [abs_of_nonneg hge, max_eq_left (by linarith : 0 ≤ 1 - u / 2)] have hderiv (u : ℝ) : HasDerivAt (fun v : ℝ => -(pi ^ 2 * (2 - v) ^ 3 / 12)) ((pi * (1 - u / 2)) ^ 2) u := by have h := (((hasDerivAt_const u (2 : ℝ)).sub (hasDerivAt_id u)).pow 3 |>.const_mul (pi ^ 2) |>.div_const 12 |>.neg) change HasDerivAt (fun v : ℝ => -(pi ^ 2 * (2 - v) ^ 3 / 12)) (-(pi ^ 2 * (3 * (2 - u) ^ 2 * (0 - 1)) / 12)) u at h convert h using 1; ring calc _ = ∫ u in (0 : ℝ)..2, (pi * (1 - u / 2)) ^ 2 := by apply intervalIntegral.integral_congr exact heq _ = -(pi ^ 2 * (2 - 2) ^ 3 / 12) - -(pi ^ 2 * (2 - 0) ^ 3 / 12) := by apply intervalIntegral.integral_eq_sub_of_hasDerivAt (f := fun v : ℝ => -(pi ^ 2 * (2 - v) ^ 3 / 12)) (f' := fun v : ℝ => (pi * (1 - v / 2)) ^ 2) · intro u _ exact hderiv u · have hc : Continuous (fun v : ℝ => (pi * (1 - v / 2)) ^ 2) := by fun_prop exact hc.intervalIntegrable _ _ _ = _ := by ring change (∫ u : ℝ, f u) = _ rw [← intervalIntegral.integral_eq_integral_of_support_subset hsupp, ← intervalIntegral.integral_add_adjacent_intervals (hcont.intervalIntegrable (-2) 0) (hcont.intervalIntegrable 0 2), hleft, hright] ring
    Causalean.Stat.CLT.BerryEsseen.sincTriangle_square_integral · Causalean/Stat/CLT/BerryEsseen/SincTriangleConvolution.lean:17
Smoothed­CDFFourier 1 core · 0 supporting This module isolates the Fourier-analytic part of the scalar Esseen smoothing argument. ★ sinc4_smoothed_cdf_fourier_bound

Fourier control of sinc-smoothed distribution functions

This module isolates the Fourier-analytic part of the scalar Esseen smoothing argument. The difference of two finite-first-moment CDFs is integrable; smoothing it by a compact-frequency kernel gives a bound in terms of their characteristic functions.

theorem sinc4_smoothed_cdf_fourier_bound reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws with finite first moments and a positive bandwidth T, the convolution at every point z of their CDF difference with the fourth-power sinc density is bounded in absolute value by 1/(2π) times the integral over [−T, T] of their characteristic-function discrepancy divided by |t|.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
T :
ℝ
hT :
0 < T
z :
ℝ
|∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y|
≤ (1 / (2 * pi)) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|)
Proof (Lean source)
theorem sinc4_smoothed_cdf_fourier_bound (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (T : ℝ) (hT : 0 < T) (z : ℝ) : |∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y| ≤ (1 / (2 * pi)) * (∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t|) := by have hchar (ρ : Measure ℝ) [IsProbabilityMeasure ρ] (hρ : Integrable (fun y : ℝ => y) ρ) (t : ℝ) : ‖charFun ρ t - 1‖ ≤ |t| * ∫ y, |y| ∂ρ := by have he : Integrable (fun y : ℝ => exp ((t * y : ℝ) * I)) ρ := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with y simpa [mul_comm] using (Complex.norm_exp_I_mul_ofReal (t * y)).le have hEq : charFun ρ t - 1 = ∫ y, (exp ((t * y : ℝ) * I) - 1) ∂ρ := by rw [charFun_apply_real] simp only [← Complex.ofReal_mul] rw [integral_sub he (integrable_const 1)] simp rw [hEq] calc ‖∫ y, (exp ((t * y : ℝ) * I) - 1) ∂ρ‖ ≤ ∫ y, |t| * |y| ∂ρ := by apply norm_integral_le_of_norm_le (hρ.norm.const_mul |t|) filter_upwards [] with y have hp := Real.norm_exp_I_mul_ofReal_sub_one_le (x := t * y) simpa [Real.norm_eq_abs, abs_mul, mul_comm] using hp _ = |t| * ∫ y, |y| ∂ρ := by rw [integral_const_mul] have hquot : IntervalIntegrable (fun t : ℝ => ‖charFun μ t - charFun ν t‖ / |t|) volume (-T) T := by have hbound (t : ℝ) (ht : t ≠ 0) : ‖charFun μ t - charFun ν t‖ / |t| ≤ (∫ y, |y| ∂μ) + (∫ y, |y| ∂ν) := by have htpos : 0 < |t| := abs_pos.mpr ht have htri : ‖charFun μ t - charFun ν t‖ ≤ ‖charFun μ t - 1‖ + ‖charFun ν t - 1‖ := by convert norm_sub_le (charFun μ t - 1) (charFun ν t - 1) using 1 ring_nf apply (div_le_iff₀ htpos).2 nlinarith [hchar μ hμ t, hchar ν hν t] have hmeas : Measurable (fun t : ℝ => ‖charFun μ t - charFun ν t‖ / |t|) := by fun_prop apply (intervalIntegrable_iff).2 apply IntegrableOn.of_bound (by rw [Real.volume_uIoc]; exact ENNReal.ofReal_lt_top) hmeas.aestronglyMeasurable ((∫ y, |y| ∂μ) + (∫ y, |y| ∂ν)) filter_upwards [] with t by_cases ht : t = 0 · subst t simp only [charFun_zero, probReal_univ, Complex.ofReal_one, sub_self, norm_zero, abs_zero, div_zero] exact add_nonneg (integral_nonneg (fun y => abs_nonneg y)) (integral_nonneg (fun y => abs_nonneg y)) · simpa [Real.norm_eq_abs, abs_of_nonneg (div_nonneg (norm_nonneg _) (abs_nonneg t))] using hbound t ht let K : ℝ → ℂ := fun t => ∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ) have hK (t : ℝ) : ‖K t‖ ≤ 1 := by calc ‖K t‖ ≤ ∫ u : ℝ, ‖Complex.exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)‖ := norm_integral_le_integral_norm _ _ = ∫ u : ℝ, sinc4Kernel T u := by apply integral_congr_ae filter_upwards with u rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (sinc4Kernel_nonneg T hT u)] _ = 1 := sinc4Kernel_integral_eq_one T hT have hpoint (t : ℝ) : ‖(exp (((-(t * z) : ℝ) : ℂ) * I) * (I * (charFun μ t - charFun ν t)) / (t : ℂ)) * K t‖ ≤ ‖charFun μ t - charFun ν t‖ / |t| := by simp only [norm_mul, norm_div, Complex.norm_exp_ofReal_mul_I, Complex.norm_I, one_mul, Complex.norm_real, Real.norm_eq_abs] exact mul_le_of_le_one_right (div_nonneg (norm_nonneg _) (abs_nonneg t)) (hK t) have hbound : ‖∫ t in (-T)..T, (exp (((-(t * z) : ℝ) : ℂ) * I) * (I * (charFun μ t - charFun ν t)) / (t : ℂ)) * K t‖ ≤ ∫ t in (-T)..T, ‖charFun μ t - charFun ν t‖ / |t| := by apply intervalIntegral.norm_integral_le_of_norm_le (by linarith) _ hquot filter_upwards [] with t exact fun _ => hpoint t have hfactor : 0 ≤ (1 / (2 * pi) : ℝ) := by positivity have hid := sinc4_smoothed_cdf_fourier_identity μ ν hμ hν T hT z change _ = (↑(1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, (exp (((-(t * z) : ℝ) : ℂ) * I) * (I * (charFun μ t - charFun ν t)) / (t : ℂ)) * K t at hid have hnorm := congrArg norm hid simp only [Complex.norm_real, Real.norm_eq_abs, norm_mul, abs_of_nonneg hfactor] at hnorm rw [hnorm] exact mul_le_mul_of_nonneg_left hbound hfactor
Causalean.Stat.CLT.BerryEsseen.sinc4_smoothed_cdf_fourier_bound · Causalean/Stat/CLT/BerryEsseen/SmoothedCDFFourier.lean:23 · uses sinc4Kernel
Smoothed­CDFFourier­Fubini 1 core · 0 supporting This isolates the Fubini and frequency-zero steps in the smoothing bound. ★ sinc4_smoothed_cdf_fourier_identity

Fourier representation of a smoothed CDF difference

This isolates the Fubini and frequency-zero steps in the smoothing bound. The real CDF difference has an integrable envelope from the first moments, and the sinc kernel has compact Fourier support.

theorem sinc4_smoothed_cdf_fourier_identity reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws μ and ν with finite first moments and a positive bandwidth T, the convolution at z of their CDF difference with the fourth-power sinc density equals 1/(2π) times the integral over [−T, T] of exp(−itz)·i·(φ_μ(t) − φ_ν(t))/t times the kernel's Fourier transform at t. The quotient is assigned zero at frequency zero, which does not change the interval integral.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
T :
ℝ
hT :
0 < T
z :
ℝ
((∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y : ℝ) : ℂ)
= ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, (exp (((-(t * z) : ℝ) : ℂ) * I) * (I * (charFun μ t - charFun ν t)) / (t : ℂ)) * (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ))
Proof (Lean source)
theorem sinc4_smoothed_cdf_fourier_identity (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (T : ℝ) (hT : 0 < T) (z : ℝ) : ((∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y : ℝ) : ℂ) = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, (exp (((-(t * z) : ℝ) : ℂ) * I) * (I * (charFun μ t - charFun ν t)) / (t : ℂ)) * (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)) := by /- Apply `sinc4_smoothed_cdf_fourier_swap`, then `cdf_difference_fourier_shift`. Apply `cdf_difference_fourier_identity` for t ≠ 0; divide its displayed `t * integral = i * (charFun μ t - charFun ν t)` equality in ℂ using `Complex.ofReal_ne_zero.mpr ht`. Identify the two interval integrands almost everywhere by excluding the singleton {0}; `volume_singleton` and `intervalIntegral.integral_congr_ae` should dispose of that point. Move the reflected phase and kernel transform outside the spatial integral using `integral_const_mul`, keeping the factor order explicit. The displayed order of complex factors is chosen so the remaining bound follows directly from `norm_integral_le_of_norm_le`. -/ have hfreq (t : ℝ) (ht : t ≠ 0) : (∫ x : ℝ, exp (((t * x : ℝ) : ℂ) * I) * (((μ (Iic x)).toReal - (ν (Iic x)).toReal : ℝ) : ℂ)) = I * (charFun μ t - charFun ν t) / (t : ℂ) := by apply (eq_div_iff (Complex.ofReal_ne_zero.mpr ht)).2 simpa only [mul_comm] using cdf_difference_fourier_identity μ ν hμ hν t ht rw [sinc4_smoothed_cdf_fourier_swap μ ν hμ hν T hT z] congr 1 apply intervalIntegral.integral_congr_ae filter_upwards [Measure.ae_ne volume (0 : ℝ)] with t ht _ rw [cdf_difference_fourier_shift μ ν hμ hν t z, hfreq t ht] ring
Causalean.Stat.CLT.BerryEsseen.sinc4_smoothed_cdf_fourier_identity · Causalean/Stat/CLT/BerryEsseen/SmoothedCDFFourierFubini.lean:21 · uses sinc4Kernel
Smoothed­CDFFourier­Swap 1 core · 0 supporting This module isolates the absolute-integrability and Fubini step after inserting the compact-frequency inverse Fourier formula for sinc fourth. ★ sinc4_smoothed_cdf_fourier_swap

Fubini interchange for a smoothed CDF difference

This module isolates the absolute-integrability and Fubini step after inserting the compact-frequency inverse Fourier formula for sinc fourth.

theorem sinc4_smoothed_cdf_fourier_swap reviewed
Causalean.Stat.CLT.BerryEsseen

For two probability laws with finite first moments and a positive bandwidth T, the convolution at z of their CDF difference with the fourth-power sinc density equals 1/(2π) times the integral over [−T, T] of the kernel's Fourier transform times the spatial transform of the shifted CDF difference; no change of variables or division by frequency is used.

Formal statement
hμ :
Integrable (fun y : ℝ => y) μ
hν :
Integrable (fun y : ℝ => y) ν
T :
ℝ
hT :
0 < T
z :
ℝ
((∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y : ℝ) : ℂ)
= ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)) * (∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal : ℝ) : ℂ))
Proof (Lean source)
theorem sinc4_smoothed_cdf_fourier_swap (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : Integrable (fun y : ℝ => y) μ) (hν : Integrable (fun y : ℝ => y) ν) (T : ℝ) (hT : 0 < T) (z : ℝ) : ((∫ y : ℝ, ((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal) * sinc4Kernel T y : ℝ) : ℂ) = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, (∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)) * (∫ y : ℝ, exp (((-(t * y) : ℝ) : ℂ) * I) * (((μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal : ℝ) : ℂ)) := by /- Insert `sinc4Kernel_fourier_inversion`. The spatial factor is integrable by `integrable_cdf_difference_of_first_moments` and reflection; the frequency transform is bounded by `sinc4Kernel_integral_eq_one`. Establish joint integrability on the finite interval, swap, then pull out the constant and coerce the real integral to a complex integral. -/ let D : ℝ → ℝ := fun y => (μ (Iic (z - y))).toReal - (ν (Iic (z - y))).toReal let K : ℝ → ℂ := fun t => ∫ u : ℝ, exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ) let F : ℝ → ℝ → ℂ := fun t y => K t * (exp (((-(t * y) : ℝ) : ℂ) * I) * (D y : ℂ)) have hD : Integrable D volume := by exact (integrable_cdf_difference_of_first_moments μ ν hμ hν).comp_sub_left z have hkernel : Integrable (fun u : ℝ => (sinc4Kernel T u : ℂ)) volume := (sinc4Kernel_integrable T hT).ofReal have hKcont : Continuous K := by let f : ℝ → ℂ := fun u => (sinc4Kernel T u : ℂ) have hFfourier (w : ℝ) : fourier f w = K ((-2 * pi) * w) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards with u simp only [smul_eq_mul, f, RCLike.inner_apply', starRingEnd_apply, star_trivial] congr 2 push_cast ring have hc : Continuous (fourier f) := VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hkernel have heq : K = fun t : ℝ => fourier f (t / (-2 * pi)) := by funext t rw [hFfourier] congr 1 field_simp rw [heq] fun_prop have hKbound (t : ℝ) : ‖K t‖ ≤ 1 := by calc ‖K t‖ ≤ ∫ u : ℝ, ‖Complex.exp (((t * u : ℝ) : ℂ) * I) * (sinc4Kernel T u : ℂ)‖ := norm_integral_le_integral_norm _ _ = ∫ u : ℝ, sinc4Kernel T u := by apply integral_congr_ae filter_upwards with u rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (sinc4Kernel_nonneg T hT u)] _ = 1 := sinc4Kernel_integral_eq_one T hT have hDℂ : Integrable (fun y : ℝ => (D y : ℂ)) volume := hD.ofReal have : IsFiniteMeasure (volume.restrict (Set.uIoc (-T) T)) := by rw [Set.uIoc_of_le (by linarith : -T ≤ T)] infer_instance have hmajor : Integrable (fun p : ℝ × ℝ => ‖(D p.2 : ℂ)‖) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := hDℂ.norm.comp_snd _ have hF : Integrable (uncurry F) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := by apply Integrable.mono' hmajor · have hc : Continuous (fun p : ℝ × ℝ => K p.1 * exp (((-(p.1 * p.2) : ℝ) : ℂ) * I)) := by fun_prop have hd : AEStronglyMeasurable (fun p : ℝ × ℝ => (D p.2 : ℂ)) ((volume.restrict (Set.uIoc (-T) T)).prod volume) := (hDℂ.comp_snd _).aestronglyMeasurable convert hc.aestronglyMeasurable.mul hd using 1 ext p simp only [F, uncurry, Pi.mul_apply] ring · filter_upwards with p dsimp [F, uncurry] rw [norm_mul, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hKbound p.1) have hswap := intervalIntegral_integral_swap (a := -T) (b := T) hF calc ((∫ y : ℝ, D y * sinc4Kernel T y : ℝ) : ℂ) = ∫ y : ℝ, (D y : ℂ) * (sinc4Kernel T y : ℂ) := by calc ((∫ y : ℝ, D y * sinc4Kernel T y : ℝ) : ℂ) = ∫ y : ℝ, ((D y * sinc4Kernel T y : ℝ) : ℂ) := (integral_complex_ofReal).symm _ = _ := by congr 1 ext y push_cast rfl _ = ∫ y : ℝ, (D y : ℂ) * (((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * K t) := by apply integral_congr_ae filter_upwards with y rw [sinc4Kernel_fourier_inversion T hT y] _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ y : ℝ, ∫ t in (-T)..T, F t y := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards with y calc (D y : ℂ) * (((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * K t) = ((1 / (2 * pi) : ℝ) : ℂ) * ((D y : ℂ) * ∫ t in (-T)..T, exp (((-(t * y) : ℝ) : ℂ) * I) * K t) := by ring _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, F t y := by congr 1 rw [← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_congr intro t _ dsimp [F] ring _ = ((1 / (2 * pi) : ℝ) : ℂ) * ∫ t in (-T)..T, ∫ y : ℝ, F t y := by rw [hswap] _ = _ := by congr 1 apply intervalIntegral.integral_congr intro t _ dsimp [F, K, D] rw [← integral_const_mul]
Causalean.Stat.CLT.BerryEsseen.sinc4_smoothed_cdf_fourier_swap · Causalean/Stat/CLT/BerryEsseen/SmoothedCDFFourierSwap.lean:17 · uses sinc4Kernel
Smoothing­Kernel­Tail 1 core · 0 supporting The sinc fourth-power kernel has a quantitative concentration bound at the inverse-bandwidth scale. ★ sinc4Kernel_tail_le_quarter

Tail control for the compact-frequency smoothing kernel

The sinc fourth-power kernel has a quantitative concentration bound at the inverse-bandwidth scale. This is the kernel estimate used when a smoothed CDF is compared with its original CDF.

theorem sinc4Kernel_tail_le_quarter reviewed
Causalean.Stat.CLT.BerryEsseen

For a positive bandwidth T, at most one quarter of the fourth-power sinc kernel's mass lies at distance at least 6/T from zero.

Formal statement
T :
ℝ
hT :
0 < T
∫ x in {x : ℝ | 6 / T ≤ |x|}, sinc4Kernel T x ≤ 1 / 4
Proof (Lean source)
theorem sinc4Kernel_tail_le_quarter (T : ℝ) (hT : 0 < T) : ∫ x in {x : ℝ | 6 / T ≤ |x|}, sinc4Kernel T x ≤ 1 / 4 := by let a : ℝ := T / 4 let s : Set ℝ := {y | (3 : ℝ) / 2 ≤ |y|} have ha : 0 < a := by dsimp [a]; positivity have hs : MeasurableSet s := by dsimp [s] exact measurableSet_le measurable_const measurable_abs have hset : a • {x : ℝ | 6 / T ≤ |x|} = s := by dsimp [s] ext y rw [Set.mem_smul_set_iff_inv_smul_mem₀ ha.ne'] simp only [Set.mem_ofPred_eq, smul_eq_mul, abs_mul, abs_inv, abs_of_pos ha] dsimp [a] rw [div_le_iff₀ hT] have hfactor : (T / 4)⁻¹ * |y| * T = 4 * |y| := by field_simp rw [hfactor] constructor <;> intro h <;> linarith have htailset : s = Iic (-(3/2 : ℝ)) ∪ Ici (3/2 : ℝ) := by dsimp [s] ext y simp only [Set.mem_ofPred_eq, Set.mem_union, Set.mem_Iic, Set.mem_Ici] rcases le_total 0 y with hy | hy · rw [abs_of_nonneg hy] constructor <;> intro h · exact inr h · rcases h with h | h · linarith · exact h · rw [abs_of_nonpos hy] constructor <;> intro h · exact inl (by linarith) · rcases h with h | h <;> linarith have hpos : IntegrableOn (fun y : ℝ => y ^ (-4 : ℝ)) (Ici (3/2 : ℝ)) := by rw [integrableOn_Ici_iff_integrableOn_Ioi] exact integrableOn_Ioi_rpow_of_lt (by norm_num) (by norm_num) have hneg : IntegrableOn (fun y : ℝ => |y| ^ (-4 : ℝ)) (Iic (-(3/2 : ℝ))) := by have hn : IntegrableOn (fun y : ℝ => (-y) ^ (-4 : ℝ)) (Iic (-(3/2 : ℝ))) := by simpa only [Set.neg_Ici] using hpos.comp_neg apply hn.congr_fun · intro y hy exact congrArg (fun z : ℝ => z ^ (-4 : ℝ)) (abs_of_nonpos (le_trans (Set.mem_Iic.mp hy) (by norm_num))).symm · exact measurableSet_Iic have hposabs : IntegrableOn (fun y : ℝ => |y| ^ (-4 : ℝ)) (Ici (3/2 : ℝ)) := by apply hpos.congr_fun · intro y hy exact congrArg (fun z : ℝ => z ^ (-4 : ℝ)) (abs_of_nonneg (le_trans (by norm_num) (Set.mem_Ici.mp hy))).symm · exact measurableSet_Ici have hmajor : IntegrableOn (fun y : ℝ => |y| ^ (-4 : ℝ)) s := by rw [htailset, integrableOn_union] exact ⟨hneg, hposabs⟩ have hpower : (∫ y : ℝ in Ioi (3/2 : ℝ), y ^ (-4 : ℝ)) = 8/81 := by rw [integral_Ioi_rpow_of_lt (by norm_num) (by norm_num)] norm_num [Real.rpow_neg_natCast] have htail : (∫ y in s, |y| ^ (-4 : ℝ)) = 16/81 := by rw [htailset] have hdisj : Disjoint (Iic (-(3/2 : ℝ))) (Ici (3/2 : ℝ)) := by rw [Set.Iic_disjoint_Ici] norm_num rw [setIntegral_union hdisj measurableSet_Ici hneg hposabs] have hn : (∫ y in Iic (-(3/2 : ℝ)), |y| ^ (-4 : ℝ)) = ∫ y in Ioi (3/2 : ℝ), y ^ (-4 : ℝ) := by calc (∫ y in Iic (-(3/2 : ℝ)), |y| ^ (-4 : ℝ)) = ∫ y in Iic (-(3/2 : ℝ)), (-y) ^ (-4 : ℝ) := by apply setIntegral_congr_fun measurableSet_Iic intro y hy exact congrArg (fun z : ℝ => z ^ (-4 : ℝ)) (abs_of_nonpos (le_trans (Set.mem_Iic.mp hy) (by norm_num))) _ = ∫ y in Ioi (-(-(3/2 : ℝ))), y ^ (-4 : ℝ) := by simpa using (integral_comp_neg_Iic (-(3/2 : ℝ)) (fun y : ℝ => y ^ (-4 : ℝ))) _ = _ := by norm_num have hp : (∫ y in Ici (3/2 : ℝ), |y| ^ (-4 : ℝ)) = ∫ y in Ioi (3/2 : ℝ), y ^ (-4 : ℝ) := by rw [integral_Ici_eq_integral_Ioi] apply setIntegral_congr_fun measurableSet_Ioi intro y hy exact congrArg (fun z : ℝ => z ^ (-4 : ℝ)) (abs_of_pos (lt_trans (by norm_num) (Set.mem_Ioi.mp hy))) rw [hn, hp, hpower] norm_num have hpoint (y : ℝ) (hy : y ∈ s) : sinc y ^ 4 ≤ |y| ^ (-4 : ℝ) := by have hy' : (3 : ℝ) / 2 ≤ |y| := hy have hy0 : y ≠ 0 := by intro h subst y norm_num at hy' have hsin := Real.abs_sin_le_one y have hs2 : sin y ^ 2 ≤ 1 := by nlinarith [neg_abs_le (sin y), le_abs_self (sin y)] have hs4 : sin y ^ 4 ≤ 1 := by nlinarith [mul_self_le_mul_self (sq_nonneg (sin y)) hs2] rw [Real.sinc_of_ne_zero hy0, div_pow] have hpow : y ^ 4 = |y| ^ 4 := by rw [← abs_pow] exact (abs_of_nonneg (by positivity : 0 ≤ y ^ 4)).symm rw [hpow] simpa [div_eq_mul_inv, Real.rpow_neg (abs_nonneg y), Real.rpow_natCast] using mul_le_mul_of_nonneg_right hs4 (inv_nonneg.mpr (by positivity : 0 ≤ |y| ^ 4)) have hsinc : IntegrableOn (fun y : ℝ => sinc y ^ 4) s := by apply hmajor.mono' · fun_prop · filter_upwards [ae_restrict_mem hs] with y hy rw [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ sinc y ^ 4)] exact hpoint y hy have hbound : (∫ y in s, sinc y ^ 4) ≤ 16/81 := by rw [← htail] exact setIntegral_mono_on hsinc hmajor hs hpoint have hscale : (∫ x in {x : ℝ | 6 / T ≤ |x|}, sinc (a * x) ^ 4) = a⁻¹ * ∫ y in s, sinc y ^ 4 := by have h := Measure.setIntegral_comp_smul_of_pos (volume : Measure ℝ) (fun y : ℝ => sinc y ^ 4) {x : ℝ | 6 / T ≤ |x|} ha simpa only [smul_eq_mul, Module.finrank_self, pow_one, hset] using h unfold sinc4Kernel rw [integral_const_mul] have hpi : 2 ≤ pi := Real.two_le_pi calc (3 * T / (8 * pi)) * (∫ x in {x : ℝ | 6 / T ≤ |x|}, sinc (T * x / 4) ^ 4) = (3 / (2 * pi)) * (∫ y in s, sinc y ^ 4) := by have hfun : (fun x : ℝ => sinc (T * x / 4) ^ 4) = (fun x : ℝ => sinc (a * x) ^ 4) := by funext x apply congrArg (fun z : ℝ => sinc z ^ 4) dsimp [a] ring rw [hfun, hscale] dsimp [a] field_simp ring _ ≤ (3 / (2 * pi)) * (16/81) := by exact mul_le_mul_of_nonneg_left hbound (by positivity) _ ≤ 1/4 := by apply (le_div_iff₀ (by positivity : 0 < (4 : ℝ))).2 have hpi0 : 0 < pi := Real.pi_pos field_simp nlinarith
Causalean.Stat.CLT.BerryEsseen.sinc4Kernel_tail_le_quarter · Causalean/Stat/CLT/BerryEsseen/SmoothingKernelTail.lean:18 · uses sinc4Kernel
Symmetrized­Third­Moment 1 core · 1 supporting This leaf isolates the moment ingredient of Prawitz's modulus estimate. ★ symmetrized_unit_third_moment_le

Cubic moment control for an independent difference

This leaf isolates the moment ingredient of Prawitz's modulus estimate. The independent difference is integrated against the product law explicitly. The polynomial majorant needs only third moments and products of second moments; it does not require a fourth moment of either marginal.

theorem symmetrized_unit_third_moment_le reviewed
Causalean.Stat.CLT.BerryEsseen

For a centered probability law with unit second moment and integrable third absolute moment, the difference of two independent draws has an integrable absolute cube whose expectation is at most twice the marginal third absolute moment plus two.

Formal statement
hmean_int :
Integrable (fun x : ℝ => x) μ
hmean :
∫ x : ℝ, x ∂μ = 0
hvar_int :
Integrable (fun x : ℝ => x ^ 2) μ
hvar :
∫ x : ℝ, x ^ 2 ∂μ = 1
hthird_int :
Integrable (fun x : ℝ => |x| ^ 3) μ
conclusion 1
Integrable (fun p : ℝ × ℝ => |p.1 - p.2| ^ 3) (μ.prod μ)
conclusion 2
(∫ p : ℝ × ℝ, |p.1 - p.2| ^ 3 ∂μ.prod μ) ≤ 2 * ((∫ x : ℝ, |x| ^ 3 ∂μ) + 1)
Proof (Lean source)
theorem symmetrized_unit_third_moment_le (μ : Measure ℝ) [IsProbabilityMeasure μ] (hmean_int : Integrable (fun x : ℝ => x) μ) (hmean : ∫ x : ℝ, x ∂μ = 0) (hvar_int : Integrable (fun x : ℝ => x ^ 2) μ) (hvar : ∫ x : ℝ, x ^ 2 ∂μ = 1) (hthird_int : Integrable (fun x : ℝ => |x| ^ 3) μ) : Integrable (fun p : ℝ × ℝ => |p.1 - p.2| ^ 3) (μ.prod μ) ∧ (∫ p : ℝ × ℝ, |p.1 - p.2| ^ 3 ∂μ.prod μ) ≤ 2 * ((∫ x : ℝ, |x| ^ 3 ∂μ) + 1) := by -- The signed absolute-square factor needs only the second moment. have hsigned : Integrable (fun x : ℝ => x * |x|) μ := by refine hvar_int.mono' (by fun_prop) (Filter.Eventually.of_forall ?_) intro x simp only [Real.norm_eq_abs, abs_mul, abs_abs, ← pow_two, sq_abs] exact le_refl _ have h₃₁ := hthird_int.comp_fst μ have h₃₂ := hthird_int.comp_snd μ have h₂₁ := hvar_int.comp_fst μ have h₂₂ := hvar_int.comp_snd μ have hm₁ := hsigned.mul_prod hmean_int have hm₂ := hmean_int.mul_prod hsigned have h₂₂prod := hvar_int.mul_prod hvar_int let P : ℝ × ℝ → ℝ := fun p => (|p.1| ^ 3 + |p.2| ^ 3) - 2 * ((p.1 * |p.1|) * p.2 + p.1 * (p.2 * |p.2|)) + p.1 ^ 2 * p.2 ^ 2 + (p.1 ^ 2 + p.2 ^ 2) / 2 have hP : Integrable P (μ.prod μ) := (((h₃₁.add h₃₂).sub ((hm₁.add hm₂).const_mul 2)).add h₂₂prod).add ((h₂₁.add h₂₂).div_const 2) have hbound (p : ℝ × ℝ) : |p.1 - p.2| ^ 3 ≤ P p := by calc _ ≤ |p.1| ^ 3 + |p.2| ^ 3 - 2 * p.1 * p.2 * (|p.1| + |p.2|) + p.1 ^ 2 * p.2 ^ 2 + (p.1 ^ 2 + p.2 ^ 2) / 2 := abs_sub_cube_le_moment_polynomial p.1 p.2 _ = P p := by dsimp [P]; ring have hdiff : Integrable (fun p : ℝ × ℝ => |p.1 - p.2| ^ 3) (μ.prod μ) := by refine hP.mono_nonneg (by fun_prop) (Filter.Eventually.of_forall ?_) (Filter.Eventually.of_forall hbound) intro p positivity refine ⟨hdiff, (integral_mono hdiff hP (fun p => hbound p)).trans ?_⟩ change (∫ p : ℝ × ℝ, (|p.1| ^ 3 + |p.2| ^ 3) - 2 * ((p.1 * |p.1|) * p.2 + p.1 * (p.2 * |p.2|)) + p.1 ^ 2 * p.2 ^ 2 + (p.1 ^ 2 + p.2 ^ 2) / 2 ∂μ.prod μ) ≤ _ have hsum : Integrable (fun p : ℝ × ℝ => |p.1| ^ 3 + |p.2| ^ 3) (μ.prod μ) := h₃₁.add h₃₂ have hmix : Integrable (fun p : ℝ × ℝ => 2 * ((p.1 * |p.1|) * p.2 + p.1 * (p.2 * |p.2|))) (μ.prod μ) := (hm₁.add hm₂).const_mul 2 have hsub : Integrable (fun p : ℝ × ℝ => (|p.1| ^ 3 + |p.2| ^ 3) - 2 * ((p.1 * |p.1|) * p.2 + p.1 * (p.2 * |p.2|))) (μ.prod μ) := hsum.sub hmix have hmain : Integrable (fun p : ℝ × ℝ => (|p.1| ^ 3 + |p.2| ^ 3) - 2 * ((p.1 * |p.1|) * p.2 + p.1 * (p.2 * |p.2|)) + p.1 ^ 2 * p.2 ^ 2) (μ.prod μ) := hsub.add h₂₂prod have hhalf : Integrable (fun p : ℝ × ℝ => (p.1 ^ 2 + p.2 ^ 2) / 2) (μ.prod μ) := (h₂₁.add h₂₂).div_const 2 rw [integral_add hmain hhalf, integral_add hsub h₂₂prod, integral_sub hsum hmix, integral_add h₃₁ h₃₂, integral_const_mul, integral_add hm₁ hm₂, integral_div, integral_add h₂₁ h₂₂] rw [integral_prod_mul (fun x : ℝ => x * |x|) (fun y : ℝ => y), integral_prod_mul (fun x : ℝ => x) (fun y : ℝ => y * |y|), integral_prod_mul (fun x : ℝ => x ^ 2) (fun y : ℝ => y ^ 2), integral_fun_fst (fun x : ℝ => |x| ^ 3), integral_fun_snd (fun x : ℝ => |x| ^ 3), integral_fun_fst (fun x : ℝ => x ^ 2), integral_fun_snd (fun x : ℝ => x ^ 2)] simp only [probReal_univ, one_smul, hmean, hvar, mul_zero, zero_mul, zero_add, sub_zero, mul_one] linarith
Causalean.Stat.CLT.BerryEsseen.symmetrized_unit_third_moment_le · Causalean/Stat/CLT/BerryEsseen/SymmetrizedThirdMoment.lean:79
1 supporting declaration (lemmas, instances)
  • abs_sub_cube_le_moment_polynomial theorem — The absolute cube of a difference of two real numbers is bounded by a polynomial whose mixed linear terms cancel under centering.
    x y :
    ℝ
    |x - y| ^ 3
    ≤ |x| ^ 3 + |y| ^ 3 - 2 * x * y * (|x| + |y|) + x ^ 2 * y ^ 2 + (x ^ 2 + y ^ 2) / 2
    Proof (Lean source)
    theorem abs_sub_cube_le_moment_polynomial (x y : ℝ) : |x - y| ^ 3 ≤ |x| ^ 3 + |y| ^ 3 - 2 * x * y * (|x| + |y|) + x ^ 2 * y ^ 2 + (x ^ 2 + y ^ 2) / 2 := by have hsame (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : |a - b| ^ 3 ≤ a ^ 3 + b ^ 3 - 2 * a * b * (a + b) + a ^ 2 * b ^ 2 + (a ^ 2 + b ^ 2) / 2 := by by_cases hab : b ≤ a · exact nonneg_cube_bound a b ha hb hab · have h := nonneg_cube_bound b a hb ha (le_of_not_ge hab) rw [abs_sub_comm] at h nlinarith [h] have hopposite (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : (a + b) ^ 3 ≤ a ^ 3 + b ^ 3 + 2 * a * b * (a + b) + a ^ 2 * b ^ 2 + (a ^ 2 + b ^ 2) / 2 := by nlinarith [sq_nonneg (a * b - (a + b) / 2), sq_nonneg (a - b)] rcases le_total 0 x with hx | hx <;> rcases le_total 0 y with hy | hy · simpa only [abs_of_nonneg hx, abs_of_nonneg hy] using hsame x y hx hy · have h := hopposite x (-y) hx (neg_nonneg.mpr hy) rw [abs_of_nonneg hx, abs_of_nonpos hy, abs_of_nonneg (show 0 ≤ x - y by linarith)] nlinarith [h] · have h := hopposite (-x) y (neg_nonneg.mpr hx) hy rw [abs_of_nonpos hx, abs_of_nonneg hy, abs_of_nonpos (show x - y ≤ 0 by linarith)] nlinarith [h] · have h := hsame (-x) (-y) (neg_nonneg.mpr hx) (neg_nonneg.mpr hy) have he : |(-x) - (-y)| = |x - y| := by rw [neg_sub_neg, abs_sub_comm] rw [he] at h rw [abs_of_nonpos hx, abs_of_nonpos hy] nlinarith [h]
    Causalean.Stat.CLT.BerryEsseen.abs_sub_cube_le_moment_polynomial · Causalean/Stat/CLT/BerryEsseen/SymmetrizedThirdMoment.lean:45
Triangular­Cosine­Integral 1 core · 0 supporting The deterministic coefficient is valid at zero frequency as well. ★ triangular_cosine_integral

Fourier coefficient of a triangular weight

The deterministic coefficient is valid at zero frequency as well. Product-to-sum then evaluates the weighted sine coefficients in the Abel expansion of cotangent.

theorem triangular_cosine_integral reviewed
Causalean.Stat.CLT.BerryEsseen

The unit-interval triangular cosine coefficient ∫₀¹ (1 − t)·cos(2πat) dt equals one half of sinc(πa)² at any real frequency a.

Formal statement
a :
ℝ
(∫ t in (0 : ℝ)..1, (1 - t) * cos (2 * pi * a * t))
= sinc (pi * a) ^ 2 / 2
Proof (Lean source)
theorem triangular_cosine_integral (a : ℝ) : (∫ t in (0 : ℝ)..1, (1 - t) * cos (2 * pi * a * t)) = sinc (pi * a) ^ 2 / 2 := by /- Separate a=0. Otherwise integrate twice, or use an explicit antiderivative (1-t)*sin(c*t)/c-cos(c*t)/c² with c=2πa. The endpoint value is (1-cos(2πa))/(2πa)²; use 1-cos(2z)=2sin(z)² and sinc_of_ne_zero. All functions here are continuous: no singular integral or series exchange. Weighted sine products are half the difference of the coefficients at n-x and n+x. At integer n this simplifies to reciprocal squares when sin(πx)≠0. -/ by_cases ha : a = 0 · subst a simp only [mul_zero, zero_mul, Real.cos_zero, mul_one, Real.sinc_zero, one_pow] rw [intervalIntegral.integral_sub (f := fun _ : ℝ => (1 : ℝ)) (g := fun t : ℝ => t) (continuous_const.intervalIntegrable 0 1) (continuous_id.intervalIntegrable 0 1)] norm_num [integral_id] let c : ℝ := 2 * pi * a have hc : c ≠ 0 := by dsimp [c]; exact mul_ne_zero (by positivity) ha let f : ℝ → ℝ := fun t => (1 - t) * sin (c * t) / c - cos (c * t) / c ^ 2 have hd (t : ℝ) : HasDerivAt f ((1 - t) * cos (c * t)) t := by have hl := (hasDerivAt_id t).const_mul c convert! ((((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)).mul hl.sin).div_const c).sub (hl.cos.div_const (c ^ 2)) using 1 dsimp [f] field_simp ring have hi : IntervalIntegrable (fun t : ℝ => (1 - t) * cos (c * t)) volume 0 1 := (by fun_prop : Continuous (fun t : ℝ => (1 - t) * cos (c * t))).intervalIntegrable 0 1 have he := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hd t) hi change (∫ t in (0 : ℝ)..1, (1 - t) * cos (c * t)) = _ rw [he] dsimp [f, c] simp only [mul_one, mul_zero, sub_self, zero_mul, zero_div, Real.cos_zero, sub_zero, Real.sin_zero, Real.sinc_of_ne_zero (mul_ne_zero Real.pi_ne_zero ha)] rw [show 2 * pi * a = 2 * (pi * a) by ring, Real.cos_two_mul_eq_one_sub] field_simp ring
Causalean.Stat.CLT.BerryEsseen.triangular_cosine_integral · Causalean/Stat/CLT/BerryEsseen/TriangularCosineIntegral.lean:17