Mathlib.Probability.SteinMethod
Stein-method normal-approximation helpers: Stein equation solutions, uniform bounds, local-dependence estimates, and dependency-graph CLTs.
Solution 3 core · 2 supporting This file defines gExpect, the bounded solution steinSol of the standard-normal Stein equation, and the two public identities steinSol_hasDerivAt and steinSol_stein_eq. ★ steinSol_hasDerivAt
Stein equation for the standard normal distribution
This file defines gExpect, the bounded solution steinSol of the
standard-normal Stein equation, and the two public identities
steinSol_hasDerivAt and steinSol_stein_eq. The supporting lemmas establish
the Gaussian expectation and integrability facts needed by the Stein-method
bounds.
Expectation of h under the standard normal law, E[h(Z)].
Definition (Lean source)
The bounded solution of the Stein equation f' − w·f = h − E[h(Z)].
The Stein equation. For a continuous test function h that is bounded in absolute value by a constant C, the Stein solution steinSol h is differentiable at every point w, with derivative w·steinSol h w + (h w − E[h(Z)]) for a standard normal Z, i.e. it solves the Stein equation f'(w) − w·f(w) = h(w) − E[h(Z)].
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
abs_gExpect_letheorem — The absolute value of the standard-normal expectation of a uniformly bounded function is at most the same bound. This is useful throughout Stein-method estimates.Proof (Lean source)
theorem abs_gExpect_le {h : ℝ → ℝ} {C : ℝ} (hb : ∀ x, |h x| ≤ C) : |gExpect h| ≤ C := by unfold gExpect calc |∫ x, h x ∂(gaussianReal 0 1)| ≤ ∫ x, |h x| ∂(gaussianReal 0 1) := MeasureTheory.abs_integral_le_integral_abs _ ≤ ∫ _x, C ∂(gaussianReal 0 1) := by apply MeasureTheory.integral_mono_of_nonneg · filter_upwards with x using abs_nonneg _ · exact MeasureTheory.integrable_const C · filter_upwards with x using hb x _ = C := by rw [MeasureTheory.integral_const]; simp -
steinSol_stein_eqtheorem — The Stein equation in subtractive form.hypothesesProof (Lean source)
theorem steinSol_stein_eq (h : ℝ → ℝ) (hh : Continuous h) {C : ℝ} (hb : ∀ x, |h x| ≤ C) (w : ℝ) : deriv (steinSol h) w - w * steinSol h w = h w - gExpect h := by have := (steinSol_hasDerivAt h hh hb w).deriv rw [this]; ring
DependencyCLT 3 core · 3 supporting This file defines the standardized sum depSum, the neighborhood sum nbhdSum, and proves the Chen-Goldstein-Shao/Ross style stein_local_dependence_bound for a finite family of mean-zero random variables with dependency ne ★ stein_local_dependence_bound
Local-dependence Stein bound
This file defines the standardized sum depSum, the neighborhood sum
nbhdSum, and proves the Chen-Goldstein-Shao/Ross style
stein_local_dependence_bound for a finite family of mean-zero random
variables with dependency neighborhoods. The bound controls the difference
between expectations under the standardized sum and the standard normal by two
local-dependence error terms.
The standardized sum W = ∑ᵢ Xᵢ.
Definition (Lean source)
The neighborhood sum Tᵢ = ∑_{j∈Nᵢ} Xⱼ.
The local-dependence Stein bound. For jointly measurable summands X i uniformly bounded in absolute value by a nonnegative constant B, each mean zero and independent of the sum of the summands outside its neighborhood set N i, with the standardized sum having unit variance, and for a test function h that is bounded in absolute value by C, has derivative bounded in absolute value by L, and is differentiable, the deviation of the expected test-function value of the local-dependence sum from its standard-normal expectation is at most 2L·√(Var(∑ᵢ Xᵢ·nbhdSumᵢ)) + L·∑ᵢ E[|Xᵢ|·nbhdSumᵢ²].
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
abs_integral_mul_le_sqrttheorem — For square-integrable real-valued functions, the absolute value of their product integral is at most the product of the square roots of their two squared integrals.hypothesesProof (Lean source)
theorem abs_integral_mul_le_sqrt {μ : Measure Ω} (f g : Ω → ℝ) (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : |∫ ω, f ω * g ω ∂μ| ≤ sqrt (∫ ω, f ω ^ 2 ∂μ) * sqrt (∫ ω, g ω ^ 2 ∂μ) := by have hpq : (2 : ℝ).HolderConjugate 2 := by rw [Real.holderConjugate_iff]; constructor <;> norm_num have hf2 : MemLp f (ofReal 2) μ := by rwa [show ofReal 2 = 2 by norm_num] have hg2 : MemLp g (ofReal 2) μ := by rwa [show ofReal 2 = 2 by norm_num] have hkey := integral_mul_norm_le_Lp_mul_Lq (μ := μ) hpq hf2 hg2 -- Translate norms/powers to abs/squares, and the `rpow (1/2)` to `sqrt`. have heq1 : ∀ ω, ‖f ω‖ * ‖g ω‖ = |f ω * g ω| := by intro ω; rw [Real.norm_eq_abs, Real.norm_eq_abs, ← abs_mul] have hsqrt : ∀ (c : ℝ), c ^ (1 / (2:ℝ)) = sqrt c := by intro c; rw [Real.sqrt_eq_rpow] have hnormsq : ∀ ω, ‖f ω‖ ^ (2:ℝ) = f ω ^ 2 := by intro ω; rw [Real.norm_eq_abs, Real.rpow_two, sq_abs] have hnormsqg : ∀ ω, ‖g ω‖ ^ (2:ℝ) = g ω ^ 2 := by intro ω; rw [Real.norm_eq_abs, Real.rpow_two, sq_abs] calc |∫ ω, f ω * g ω ∂μ| ≤ ∫ ω, |f ω * g ω| ∂μ := abs_integral_le_integral_abs _ = ∫ ω, ‖f ω‖ * ‖g ω‖ ∂μ := by simp_rw [heq1] _ ≤ (∫ ω, ‖f ω‖ ^ (2:ℝ) ∂μ) ^ (1 / (2:ℝ)) * (∫ ω, ‖g ω‖ ^ (2:ℝ) ∂μ) ^ (1 / (2:ℝ)) := hkey _ = sqrt (∫ ω, f ω ^ 2 ∂μ) * sqrt (∫ ω, g ω ^ 2 ∂μ) := by rw [hsqrt, hsqrt]; simp_rw [hnormsq, hnormsqg] -
steinSol_deriv_continuoustheorem — A continuous differentiable test function with bounded values and bounded derivative has a Stein solution whose derivative is continuous.hypothesesh :ℝ → ℝhh :C L :ℝhL :0 ≤ Lhb :∀ x, |h x| ≤ Chd :∀ x, |deriv h x| ≤ Lhdiff :Differentiable ℝ hconclusionProof (Lean source)
theorem steinSol_deriv_continuous (h : ℝ → ℝ) (hh : Continuous h) {C L : ℝ} (hL : 0 ≤ L) (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) : Continuous (deriv (steinSol h)) := by have hlip : LipschitzWith (2 * L).toNNReal (deriv (steinSol h)) := by refine LipschitzWith.of_dist_le_mul (fun u v => ?_) rw [Real.dist_eq, Real.dist_eq, Real.coe_toNNReal _ (by positivity)] exact steinSol_deriv_lipschitz h hb hd hdiff u v exact hlip.continuous -
steinSol_taylor_righttheorem — The standard-normal Stein solution has a first-order Taylor error that grows no faster than the test function's derivative bound times the squared step size.hypothesesProof (Lean source)
theorem steinSol_taylor_right (h : ℝ → ℝ) {C L : ℝ} (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) (a t : ℝ) : |steinSol h (a + t) - steinSol h a - t * deriv (steinSol h) (a + t)| ≤ L * t ^ 2 := by have hh : Continuous h := hdiff.continuous have hL : 0 ≤ L := le_trans (abs_nonneg (deriv h 0)) (hd 0) set f := steinSol h with hf set f' := deriv (steinSol h) with hf' have hf'cont : Continuous f' := steinSol_deriv_continuous h hh hL hb hd hdiff -- `s ↦ f (a + s * t)` has derivative `f' (a + s * t) * t`. have hg : ∀ s : ℝ, HasDerivAt (fun s => f (a + s * t)) (f' (a + s * t) * t) s := by intro s have hfderiv : HasDerivAt f (f' (a + s * t)) (a + s * t) := by rw [hf, hf']; exact steinSol_hasDerivAt h hh hb (a + s * t) |>.congr_deriv (by rw [(steinSol_hasDerivAt h hh hb (a + s * t)).deriv]) have hinner : HasDerivAt (fun s : ℝ => a + s * t) t s := by simpa using ((hasDerivAt_id s).mul_const t).const_add a exact hfderiv.comp s hinner -- FTC over `[0,1]`: `f (a + t) − f a = ∫₀¹ f' (a + s t) * t ds`. have hcont : Continuous (fun s : ℝ => f' (a + s * t) * t) := (hf'cont.comp (by fun_prop)).mul continuous_const have hFTC : (∫ s in (0:ℝ)..1, f' (a + s * t) * t) = f (a + t) - f a := by have := intervalIntegral.integral_eq_sub_of_hasDerivAt (f := fun s => f (a + s * t)) (f' := fun s => f' (a + s * t) * t) (fun s _ => hg s) (hcont.intervalIntegrable 0 1) simpa using this -- The remainder as an integral: `r = ∫₀¹ t·(f' (a + s t) − f' (a + t)) ds`. have hconst : (∫ _s in (0:ℝ)..1, t * deriv (steinSol h) (a + t)) = t * f' (a + t) := by rw [intervalIntegral.integral_const]; simp [hf'] have hrem : steinSol h (a + t) - steinSol h a - t * deriv (steinSol h) (a + t) = ∫ s in (0:ℝ)..1, (f' (a + s * t) * t - t * f' (a + t)) := by rw [intervalIntegral.integral_sub (hcont.intervalIntegrable 0 1) (continuous_const.intervalIntegrable 0 1)] rw [hFTC, hconst] rw [hrem] -- Bound the integrand pointwise by `2L·t²·(1 − s)` on `[0,1]`. have hbound_int : |∫ s in (0:ℝ)..1, (f' (a + s * t) * t - t * f' (a + t))| ≤ ∫ s in (0:ℝ)..1, 2 * L * t ^ 2 * (1 - s) := by refine (intervalIntegral.abs_integral_le_integral_abs (by norm_num)).trans ?_ refine intervalIntegral.integral_mono_on (by norm_num) ((hcont.sub continuous_const).abs.intervalIntegrable 0 1) ((continuous_const.mul (continuous_const.sub continuous_id)).intervalIntegrable 0 1) (fun s hs => ?_) have hs1 : s ≤ 1 := hs.2 have hlip := steinSol_deriv_lipschitz h hb hd hdiff (a + s * t) (a + t) calc |f' (a + s * t) * t - t * f' (a + t)| = |t| * |f' (a + s * t) - f' (a + t)| := by rw [← abs_mul]; ring_nf _ ≤ |t| * (2 * L * |(a + s * t) - (a + t)|) := by apply mul_le_mul_of_nonneg_left hlip (abs_nonneg _) _ = 2 * L * t ^ 2 * (1 - s) := by have hst : (a + s * t) - (a + t) = (s - 1) * t := by ring rw [hst, abs_mul, abs_of_nonpos (by linarith : s - 1 ≤ 0)] rw [show |t| * (2 * L * (-(s - 1) * |t|)) = 2 * L * (|t| * |t|) * (1 - s) by ring] rw [← abs_mul, abs_mul_self, sq] calc |∫ s in (0:ℝ)..1, (f' (a + s * t) * t - t * f' (a + t))| ≤ ∫ s in (0:ℝ)..1, 2 * L * t ^ 2 * (1 - s) := hbound_int _ = L * t ^ 2 := by rw [intervalIntegral.integral_const_mul] rw [show (fun s => 1 - s) = (fun s => (1:ℝ) - s) from rfl] rw [intervalIntegral.integral_sub (intervalIntegrable_const) (intervalIntegral.intervalIntegrable_id)] simp; ring
DepGraphCLT 3 core · 10 supporting This file derives the local-dependence Stein hypotheses from a dependency graph with bounded degree and uniformly small summands. ★ stein_cdf_clt_of_depGraph
Dependency-graph central limit theorem from primitive graph conditions
This file derives the local-dependence Stein hypotheses from a dependency graph
with bounded degree and uniformly small summands. It defines DepGraph and
DepGraph.nbhd, proves leave-out independence, separated-neighborhood
covariance cancellation, the bounds DepGraph.var_nbhd_prod_le and
DepGraph.sum_E_nbhd_sq_le, and concludes with the CDF central limit theorem
stein_cdf_clt_of_depGraph.
A dependency graph for a family of real-valued random variables X on a probability space with law μ: bundles an adjacency relation on the index set that is reflexive and symmetric, together with measurability of each variable in the family and the defining property that any two index sets joined by no edge carry independent variable tuples. The closed neighborhood of an index is the set of indices adjacent to it.
Definition (Lean source)
The closed dependency neighborhood N i = {j | G i j}.
Definition (Lean source)
The bounded dependency-graph CLT. Fix, for each n, a probability measure μ n, triangular-array summands X n i, and a dependency graph D n on the index set recording which pairs of summands may be dependent, with every dependency neighborhood of size at most m. Suppose the summands are uniformly bounded in absolute value by a constant sequence B n that tends to zero, with the product of the index-set cardinality and the cube of the bound also tending to zero, and suppose each summand is mean zero with the standardized sum having unit total variance. Then for every threshold s, the CDF of the dependency sum under μ n at s converges, as n → ∞, to the standard-normal CDF at s. The two Stein negligibility limits are derived internally.
Formal statement
Proof (Lean source)
10 supporting declarations (lemmas, instances)
-
mem_nbhd_ifftheorem — Membership in the neighborhood is exactly adjacency.hypothesesi j :ιconclusionj ∈ D.nbhd i ↔ D.G i jProof (Lean source)
theorem mem_nbhd_iff {i j : ι} : j ∈ D.nbhd i ↔ D.G i j := by letI := D.decG simp only [nbhd, mem_filter, Finset.mem_univ, true_and] -
self_mem_nbhdtheorem — Each index is in its own neighborhood.hypothesesi :ιconclusioni ∈ D.nbhd iProof (Lean source)
theorem self_mem_nbhd (i : ι) : i ∈ D.nbhd i := D.mem_nbhd_iff.mpr (D.refl i) -
abs_nbhdSum_letheorem — If each summand is bounded in absolute value by B and every closed neighborhood has at most m indices, then the absolute value of each neighborhood sum is at most m times B.hypothesesB :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕi :ιhdeg :(D.nbhd i).card ≤ mω :Ωconclusion|∑ k ∈ D.nbhd i, X k ω| ≤ (m : ℝ) * BProof (Lean source)
theorem abs_nbhdSum_le {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (i : ι) (hdeg : (D.nbhd i).card ≤ m) (ω : Ω) : |∑ k ∈ D.nbhd i, X k ω| ≤ (m : ℝ) * B := by calc |∑ k ∈ D.nbhd i, X k ω| ≤ ∑ k ∈ D.nbhd i, |X k ω| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _k ∈ D.nbhd i, B := Finset.sum_le_sum (fun k _ => hbound k ω) _ = (D.nbhd i).card * B := by rw [Finset.sum_const, nsmul_eq_mul] _ ≤ (m : ℝ) * B := by apply mul_le_mul_of_nonneg_right _ hB exact_mod_cast hdeg -
abs_locProd_letheorem — If each summand has absolute value at most B and each neighborhood has at most m members, then a summand times its neighborhood sum has absolute value at most m times B squared.hypothesesB :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕhdeg :∀ i, (D.nbhd i).card ≤ mi :ιω :Ωconclusion|X i ω * ∑ k ∈ D.nbhd i, X k ω| ≤ (m : ℝ) * B ^ 2Proof (Lean source)
theorem abs_locProd_le {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (hdeg : ∀ i, (D.nbhd i).card ≤ m) (i : ι) (ω : Ω) : |X i ω * ∑ k ∈ D.nbhd i, X k ω| ≤ (m : ℝ) * B ^ 2 := by rw [abs_mul] calc |X i ω| * |∑ k ∈ D.nbhd i, X k ω| ≤ B * ((m : ℝ) * B) := mul_le_mul (hbound i ω) (D.abs_nbhdSum_le hB hbound i (hdeg i) ω) (abs_nonneg _) hB _ = (m : ℝ) * B ^ 2 := by ring -
indepFun_leaveOuttheorem — Leave-out independence (the stein_cdf_clt hypothesis hindep).Proof (Lean source)
theorem indepFun_leaveOut (i : ι) : IndepFun (X i) (fun ω => ∑ j ∈ univ \ D.nbhd i, X j ω) μ := by classical -- The two index sets `{i}` and `univ \ N i` have no edges between them. have hsep : ∀ a ∈ ({i} : Finset ι), ∀ b ∈ univ \ D.nbhd i, ¬ D.G a b := by intro a ha b hb rw [mem_singleton] at ha; subst ha rw [mem_sdiff] at hb exact fun hab => hb.2 (D.mem_nbhd_iff.mpr hab) have hind := D.indep ({i} : Finset ι) (univ \ D.nbhd i) hsep -- Eval at `i` on the `{i}`-tuple, and the total sum on the `(univ \ N i)`-tuple. -- The two composing maps are measurable (Pi-evaluation / finite sum of evaluations). have hφ : Measurable fun t : (({i} : Finset ι) → ℝ) => t ⟨i, Finset.mem_singleton.mpr rfl⟩ := measurable_pi_apply _ have hψ : Measurable fun t : ((univ \ D.nbhd i : Finset ι) → ℝ) => ∑ k, t k := measurable_sum _ (fun k _ => measurable_pi_apply _) have hcomp := hind.comp hφ hψ -- Identify the two sides with `X i` and the leave-out sum. have h1 : (fun t : (({i} : Finset ι) → ℝ) => t ⟨i, Finset.mem_singleton.mpr rfl⟩) ∘ (fun ω => fun k : ({i} : Finset ι) => X k ω) = X i := rfl have h2 : (fun t : ((univ \ D.nbhd i : Finset ι) → ℝ) => ∑ k, t k) ∘ (fun ω => fun k : (univ \ D.nbhd i : Finset ι) => X k ω) = (fun ω => ∑ j ∈ univ \ D.nbhd i, X j ω) := by funext ω simp only [comp] rw [Finset.sum_coe_sort (univ \ D.nbhd i) (fun j => X j ω)] rw [h1, h2] at hcomp exact hcomp -
cov_mul_nbhd_eq_zerotheorem — Covariance vanishing for separated indices. If Nᵢ and Nⱼ have no edges between them, the localized products Xᵢ·Tᵢ and Xⱼ·Tⱼ are uncorrelated.hypothesesi j :ιhsep :∀ a ∈ D.nbhd i, ∀ b ∈ D.nbhd j, ¬ D.G a bconclusionμ[fun ω => (X i ω * ∑ k ∈ D.nbhd i, X k ω) * (X j ω * ∑ k ∈ D.nbhd j, X k ω)]= μ[fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω] * μ[fun ω => X j ω * ∑ k ∈ D.nbhd j, X k ω]Proof (Lean source)
theorem cov_mul_nbhd_eq_zero {i j : ι} (hsep : ∀ a ∈ D.nbhd i, ∀ b ∈ D.nbhd j, ¬ D.G a b) : μ[fun ω => (X i ω * ∑ k ∈ D.nbhd i, X k ω) * (X j ω * ∑ k ∈ D.nbhd j, X k ω)] = μ[fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω] * μ[fun ω => X j ω * ∑ k ∈ D.nbhd j, X k ω] := by classical -- Tuples over the two neighborhoods are independent. have hind := D.indep (D.nbhd i) (D.nbhd j) hsep -- `φ` reads off `Xᵢ` (via `i ∈ Nᵢ`) and forms `Xᵢ · ∑_{k∈Nᵢ} Xₖ` from the `Nᵢ`-tuple. let φ : (↥(D.nbhd i) → ℝ) → ℝ := fun t => t ⟨i, D.self_mem_nbhd i⟩ * ∑ k, t k let ψ : (↥(D.nbhd j) → ℝ) → ℝ := fun t => t ⟨j, D.self_mem_nbhd j⟩ * ∑ k, t k have hφ : Measurable φ := (measurable_pi_apply _).mul (measurable_sum _ (fun k _ => measurable_pi_apply _)) have hψ : Measurable ψ := (measurable_pi_apply _).mul (measurable_sum _ (fun k _ => measurable_pi_apply _)) -- Both tuples are AEMeasurable (each coordinate `X k` is measurable). have hXi : AEMeasurable (fun ω => fun k : ↥(D.nbhd i) => X k ω) μ := (measurable_pi_lambda _ (fun k : ↥(D.nbhd i) => D.meas (↑k))).aemeasurable have hXj : AEMeasurable (fun ω => fun k : ↥(D.nbhd j) => X k ω) μ := (measurable_pi_lambda _ (fun k : ↥(D.nbhd j) => D.meas (↑k))).aemeasurable have key := hind.integral_fun_comp_mul_comp hXi hXj hφ.aestronglyMeasurable hψ.aestronglyMeasurable -- Identify `φ ∘ tupleᵢ = gᵢ` pointwise. have eφ : ∀ ω, φ (fun k : ↥(D.nbhd i) => X k ω) = X i ω * ∑ k ∈ D.nbhd i, X k ω := by intro ω simp only [φ] rw [Finset.sum_coe_sort (D.nbhd i) (fun k => X k ω)] have eψ : ∀ ω, ψ (fun k : ↥(D.nbhd j) => X k ω) = X j ω * ∑ k ∈ D.nbhd j, X k ω := by intro ω simp only [ψ] rw [Finset.sum_coe_sort (D.nbhd j) (fun k => X k ω)] simp only [eφ, eψ] at key exact key -
memLp_locProdtheorem — If every variable is bounded in absolute value by a nonnegative constant and each closed dependency neighborhood has bounded size, each variable times its neighborhood sum has a finite second moment.hypothesesB :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕhdeg :∀ i, (D.nbhd i).card ≤ mi :ιconclusionMemLp (fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω) 2 μProof (Lean source)
theorem memLp_locProd {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (hdeg : ∀ i, (D.nbhd i).card ≤ m) (i : ι) : MemLp (fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω) 2 μ := MemLp.of_bound (D.measurable_locProd i).aestronglyMeasurable ((m : ℝ) * B ^ 2) (Filter.Eventually.of_forall (fun ω => by rw [Real.norm_eq_abs]; exact D.abs_locProd_le hB hbound hdeg i ω)) -
abs_cov_locProd_letheorem — If every variable is bounded in absolute value by a nonnegative constant and each closed dependency neighborhood has at most m members, the absolute covariance of any two localized products is at most twice the square of m times that bound squared.hypothesesB :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕhdeg :∀ i, (D.nbhd i).card ≤ mi j :ιconclusion|covariance (fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω) (fun ω => X j ω * ∑ k ∈ D.nbhd j, X k ω) μ|≤ 2 * ((m : ℝ) * B ^ 2) ^ 2Proof (Lean source)
theorem abs_cov_locProd_le {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (hdeg : ∀ i, (D.nbhd i).card ≤ m) (i j : ι) : |covariance (fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω) (fun ω => X j ω * ∑ k ∈ D.nbhd j, X k ω) μ| ≤ 2 * ((m : ℝ) * B ^ 2) ^ 2 := by set gi := fun ω => X i ω * ∑ k ∈ D.nbhd i, X k ω with hgi set gj := fun ω => X j ω * ∑ k ∈ D.nbhd j, X k ω with hgj have hMi := D.memLp_locProd hB hbound hdeg i have hMj := D.memLp_locProd hB hbound hdeg j rw [covariance_eq_sub hMi hMj] -- `|gᵢ| ≤ mB²` and `|gⱼ| ≤ mB²` pointwise. have hbi : ∀ ω, |gi ω| ≤ (m : ℝ) * B ^ 2 := fun ω => D.abs_locProd_le hB hbound hdeg i ω have hbj : ∀ ω, |gj ω| ≤ (m : ℝ) * B ^ 2 := fun ω => D.abs_locProd_le hB hbound hdeg j ω have hC : (0 : ℝ) ≤ (m : ℝ) * B ^ 2 := by positivity -- Bound `|μ[gᵢ·gⱼ]| ≤ (mB²)²`. have hMi_int : Integrable gi μ := hMi.integrable one_le_two have hMj_int : Integrable gj μ := hMj.integrable one_le_two have hprod : |μ[fun ω => gi ω * gj ω]| ≤ ((m : ℝ) * B ^ 2) ^ 2 := by have hint : Integrable (fun ω => gi ω * gj ω) μ := hMi.integrable_mul hMj refine (abs_integral_le_integral_abs).trans ?_ calc ∫ ω, |gi ω * gj ω| ∂μ ≤ ∫ _ω, ((m : ℝ) * B ^ 2) ^ 2 ∂μ := by refine integral_mono hint.abs (integrable_const _) (fun ω => ?_) rw [abs_mul, sq] exact mul_le_mul (hbi ω) (hbj ω) (abs_nonneg _) hC _ = ((m : ℝ) * B ^ 2) ^ 2 := by rw [integral_const, probReal_univ, one_smul] -- Bound `|μ[gᵢ]·μ[gⱼ]| ≤ (mB²)²`. have hEi : |μ[gi]| ≤ (m : ℝ) * B ^ 2 := by refine (abs_integral_le_integral_abs).trans ?_ calc ∫ ω, |gi ω| ∂μ ≤ ∫ _ω, (m : ℝ) * B ^ 2 ∂μ := integral_mono hMi_int.abs (integrable_const _) hbi _ = (m : ℝ) * B ^ 2 := by rw [integral_const, probReal_univ, one_smul] have hEj : |μ[gj]| ≤ (m : ℝ) * B ^ 2 := by refine (abs_integral_le_integral_abs).trans ?_ calc ∫ ω, |gj ω| ∂μ ≤ ∫ _ω, (m : ℝ) * B ^ 2 ∂μ := integral_mono hMj_int.abs (integrable_const _) hbj _ = (m : ℝ) * B ^ 2 := by rw [integral_const, probReal_univ, one_smul] have hmean_prod : |μ[gi] * μ[gj]| ≤ ((m : ℝ) * B ^ 2) ^ 2 := by rw [abs_mul, sq] exact mul_le_mul hEi hEj (abs_nonneg _) hC -- Combine via the triangle inequality. calc |μ[fun ω => gi ω * gj ω] - μ[gi] * μ[gj]| ≤ |μ[fun ω => gi ω * gj ω]| + |μ[gi] * μ[gj]| := abs_sub _ _ _ ≤ ((m : ℝ) * B ^ 2) ^ 2 + ((m : ℝ) * B ^ 2) ^ 2 := add_le_add hprod hmean_prod _ = 2 * ((m : ℝ) * B ^ 2) ^ 2 := by ring -
var_nbhd_prod_letheorem — Pair-counting variance bound (herr1). With bounded summands |Xᵢ| ≤ B and degree ≤ m, the covariance double sum collapses to the ≤ N·m³ pairs at graph distance at most three, each bounded by 2(mB²)², giving Var(∑ᵢ Xᵢ·Tᵢ) ≤ 2·m⁵·N·B⁴.hypothesesB :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕhdeg :∀ i, (D.nbhd i).card ≤ mconclusionvariance (fun ω => ∑ i, X i ω * ∑ k ∈ D.nbhd i, X k ω) μ≤ 2 * (m : ℝ) ^ 5 * (Fintype.card ι : ℝ) * B ^ 4Proof (Lean source)
theorem var_nbhd_prod_le {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (hdeg : ∀ i, (D.nbhd i).card ≤ m) : variance (fun ω => ∑ i, X i ω * ∑ k ∈ D.nbhd i, X k ω) μ ≤ 2 * (m : ℝ) ^ 5 * (Fintype.card ι : ℝ) * B ^ 4 := by classical set g : ι → Ω → ℝ := fun i ω => X i ω * ∑ k ∈ D.nbhd i, X k ω with hg have hM : ∀ i, MemLp (g i) 2 μ := fun i => D.memLp_locProd hB hbound hdeg i -- Expand the variance into a covariance double sum. have hvar_eq : variance (fun ω => ∑ i, g i ω) μ = ∑ i, ∑ j, covariance (g i) (g j) μ := variance_fun_sum hM rw [show (fun ω => ∑ i, X i ω * ∑ k ∈ D.nbhd i, X k ω) = (fun ω => ∑ i, g i ω) from rfl, hvar_eq] -- For each `i`, restrict the inner sum to the "non-separated" `j`s; separated ones vanish. -- The non-separated set sits inside a double neighborhood expansion of `Nᵢ`. set S : ι → Finset ι := fun i => (D.nbhd i).biUnion (fun a => D.nbhd a) with hS set T : ι → Finset ι := fun i => (S i).biUnion (fun b => D.nbhd b) with hT -- `cov[gᵢ, gⱼ] = 0` when `j ∉ T i` (the indices are separated). have hsep_zero : ∀ i j, j ∉ T i → covariance (g i) (g j) μ = 0 := by intro i j hj -- Show `Nᵢ` and `Nⱼ` are separated. have hsep : ∀ a ∈ D.nbhd i, ∀ b ∈ D.nbhd j, ¬ D.G a b := by intro a ha b hb hab -- `b ∈ N a ⊆ S i`, and `j ∈ N b` (by symm), so `j ∈ T i` — contradiction. apply hj rw [hT, Finset.mem_biUnion] refine ⟨b, ?_, ?_⟩ · rw [hS, Finset.mem_biUnion] exact ⟨a, ha, D.mem_nbhd_iff.mpr hab⟩ · -- `b ∈ Nⱼ` means `G j b`; by symm `G b j`, i.e. `j ∈ N b`. exact D.mem_nbhd_iff.mpr (D.symm j b (D.mem_nbhd_iff.mp hb)) have hcov := D.cov_mul_nbhd_eq_zero hsep rw [covariance_eq_sub (hM i) (hM j)] rw [show (g i * g j) = (fun ω => g i ω * g j ω) from rfl] at * rw [hcov]; ring -- Drop the separated `j`s from the inner sum. have hinner : ∀ i, ∑ j, covariance (g i) (g j) μ = ∑ j ∈ T i, covariance (g i) (g j) μ := by intro i symm apply Finset.sum_subset (Finset.subset_univ _) intro j _ hj exact hsep_zero i j hj -- Bound: each retained covariance ≤ 2(mB²)², and `#(T i) ≤ m³`. have hcard_S : ∀ i, (S i).card ≤ m * m := by intro i calc (S i).card ≤ ∑ a ∈ D.nbhd i, (D.nbhd a).card := Finset.card_biUnion_le _ ≤ ∑ _a ∈ D.nbhd i, m := Finset.sum_le_sum (fun a _ => hdeg a) _ = (D.nbhd i).card * m := by rw [Finset.sum_const, smul_eq_mul] _ ≤ m * m := Nat.mul_le_mul_right m (hdeg i) have hcard_T : ∀ i, (T i).card ≤ m ^ 3 := by intro i calc (T i).card ≤ ∑ b ∈ S i, (D.nbhd b).card := Finset.card_biUnion_le _ ≤ ∑ _b ∈ S i, m := Finset.sum_le_sum (fun b _ => hdeg b) _ = (S i).card * m := by rw [Finset.sum_const, smul_eq_mul] _ ≤ (m * m) * m := Nat.mul_le_mul_right m (hcard_S i) _ = m ^ 3 := by ring -- Now bound the full double sum. have hCnn : (0 : ℝ) ≤ 2 * ((m : ℝ) * B ^ 2) ^ 2 := by positivity calc ∑ i, ∑ j, covariance (g i) (g j) μ = ∑ i, ∑ j ∈ T i, covariance (g i) (g j) μ := by exact Finset.sum_congr rfl (fun i _ => hinner i) _ ≤ ∑ i, ∑ j ∈ T i, |covariance (g i) (g j) μ| := Finset.sum_le_sum (fun i _ => Finset.sum_le_sum (fun j _ => le_abs_self _)) _ ≤ ∑ i, ∑ _j ∈ T i, 2 * ((m : ℝ) * B ^ 2) ^ 2 := Finset.sum_le_sum (fun i _ => Finset.sum_le_sum (fun j _ => D.abs_cov_locProd_le hB hbound hdeg i j)) _ = ∑ i, (T i).card * (2 * ((m : ℝ) * B ^ 2) ^ 2) := by refine Finset.sum_congr rfl (fun i _ => ?_) rw [Finset.sum_const, nsmul_eq_mul] _ ≤ ∑ _i : ι, (m ^ 3 : ℝ) * (2 * ((m : ℝ) * B ^ 2) ^ 2) := by refine Finset.sum_le_sum (fun i _ => ?_) apply mul_le_mul_of_nonneg_right _ hCnn exact_mod_cast hcard_T i _ = (Fintype.card ι : ℝ) * ((m ^ 3 : ℝ) * (2 * ((m : ℝ) * B ^ 2) ^ 2)) := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] _ = 2 * (m : ℝ) ^ 5 * (Fintype.card ι : ℝ) * B ^ 4 := by ring -
sum_E_nbhd_sq_letheorem — Negligibility bound (herr2). For any finite neighborhoods of size at most m, measurable summands bounded by B satisfy ∑ᵢ E[|Xᵢ|·Tᵢ²] ≤ m²·N·B³.hypothesesN :ι → Finset ιhmeas :∀ i, Measurable (X i)B :ℝhB :0 ≤ Bhbound :∀ i ω, |X i ω| ≤ Bm :ℕhdeg :∀ i, (N i).card ≤ mconclusion∑ i, ∫ ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ∂μ ≤ (m : ℝ) ^ 2 * (Fintype.card ι : ℝ) * B ^ 3Proof (Lean source)
theorem sum_E_nbhd_sq_le (N : ι → Finset ι) (hmeas : ∀ i, Measurable (X i)) {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ i ω, |X i ω| ≤ B) {m : ℕ} (hdeg : ∀ i, (N i).card ≤ m) : ∑ i, ∫ ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ∂μ ≤ (m : ℝ) ^ 2 * (Fintype.card ι : ℝ) * B ^ 3 := by classical have hnbhd : ∀ i ω, |∑ k ∈ N i, X k ω| ≤ (m : ℝ) * B := by intro i ω calc |∑ k ∈ N i, X k ω| ≤ ∑ k ∈ N i, |X k ω| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _k ∈ N i, B := Finset.sum_le_sum (fun k _ => hbound k ω) _ = (N i).card * B := by rw [Finset.sum_const, nsmul_eq_mul] _ ≤ (m : ℝ) * B := by apply mul_le_mul_of_nonneg_right _ hB exact_mod_cast hdeg i -- Per `i`, the integrand is bounded by the constant `m²·B³`. have hpt : ∀ i ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ≤ (m : ℝ) ^ 2 * B ^ 3 := by intro i ω have h1 : |X i ω| ≤ B := hbound i ω have h2 : (∑ k ∈ N i, X k ω) ^ 2 ≤ ((m : ℝ) * B) ^ 2 := by rw [← sq_abs] exact pow_le_pow_left₀ (abs_nonneg _) (hnbhd i ω) 2 calc |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ≤ B * ((m : ℝ) * B) ^ 2 := mul_le_mul h1 h2 (sq_nonneg _) hB _ = (m : ℝ) ^ 2 * B ^ 3 := by ring -- Hence each integral is `≤ m²·B³`. have hint : ∀ i, ∫ ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ∂μ ≤ (m : ℝ) ^ 2 * B ^ 3 := by intro i have hmeas_i : Measurable (fun ω => |X i ω| * (∑ k ∈ N i, X k ω) ^ 2) := ((hmeas i).abs).mul ((measurable_sum _ (fun k _ => hmeas k)).pow_const 2) have hbdd : ∀ ω, |(|X i ω| * (∑ k ∈ N i, X k ω) ^ 2)| ≤ (m : ℝ) ^ 2 * B ^ 3 := by intro ω rw [abs_of_nonneg (by positivity)] exact hpt i ω have hintegrable : Integrable (fun ω => |X i ω| * (∑ k ∈ N i, X k ω) ^ 2) μ := (MemLp.of_bound hmeas_i.aestronglyMeasurable ((m : ℝ) ^ 2 * B ^ 3) (Filter.Eventually.of_forall (fun ω => by rw [Real.norm_eq_abs]; exact hbdd ω))).integrable le_rfl calc ∫ ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ∂μ ≤ ∫ _ω, (m : ℝ) ^ 2 * B ^ 3 ∂μ := integral_mono hintegrable (integrable_const _) (fun ω => hpt i ω) _ = (m : ℝ) ^ 2 * B ^ 3 := by rw [integral_const, probReal_univ, one_smul] -- Sum over `i` (there are `N = card ι` of them). calc ∑ i, ∫ ω, |X i ω| * (∑ k ∈ N i, X k ω) ^ 2 ∂μ ≤ ∑ _i : ι, (m : ℝ) ^ 2 * B ^ 3 := Finset.sum_le_sum (fun i _ => hint i) _ = (Fintype.card ι : ℝ) * ((m : ℝ) ^ 2 * B ^ 3) := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] _ = (m : ℝ) ^ 2 * (Fintype.card ι : ℝ) * B ^ 3 := by ring
Bounds 1 core · 5 supporting For an absolutely continuous test function h with bounded derivative ‖h'‖_∞ ≤ L, the Stein solution f_h is uniformly bounded by L and its derivative by 2·L: ‖f_h‖_∞ ≤ L, ‖f_h'‖_∞ ≤ 2·L. ★ steinSol_abs_le
Uniform bounds on the Stein solution (Chen–Goldstein–Shao)
For an absolutely continuous test function h with bounded derivative ‖h'‖_∞ ≤ L, the Stein
solution f_h is uniformly bounded by L and its derivative by 2·L:
‖f_h‖_∞ ≤ L, ‖f_h'‖_∞ ≤ 2·L.
The file proves the public bounds steinSol_abs_le, steinSol_deriv_abs_le,
and steinSol_deriv_lipschitz; the last packages the second-derivative bound
as Lipschitz control of f_h'. The proof develops the needed Gaussian tail
moment identities, two-sided lower Mills-ratio bounds, and the cancellation
inequalities behind Chen-Goldstein-Shao Lemma 2.5. These are the bounds that
make the local-dependence Stein estimate work for test functions such as
h = cos(t * ·) and h = sin(t * ·).
For a real-valued test function h that is bounded in absolute value by a constant C, has derivative bounded in absolute value by a constant L, and is differentiable everywhere, the Stein equation's solution steinSol h, evaluated at any point w, is bounded in absolute value by the derivative bound L.
Formal statement
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
abs_le_exp_sq_div_fourtheorem — The absolute value of any real number is at most the exponential of one quarter of its square.Proof (Lean source)
theorem abs_le_exp_sq_div_four (x : ℝ) : |x| ≤ exp (x ^ 2 / 4) := by have h1 : |x| ≤ 1 + x ^ 2 / 4 := by nlinarith [sq_nonneg (|x| / 2 - 1), sq_abs x, abs_nonneg x] exact h1.trans (by have := Real.add_one_le_exp (x ^ 2 / 4); linarith) -
steinSol_deriv_abs_letheorem — Sup bound on the derivative of the Stein solution in terms of the h-derivative bound.hypothesesProof (Lean source)
theorem steinSol_deriv_abs_le (h : ℝ → ℝ) {C L : ℝ} (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) (w : ℝ) : |deriv (steinSol h) w| ≤ 2 * L := by set K : ℝ := sqrt (2 * π) with hKdef have hKpos : 0 < K := Real.sqrt_pos.mpr (by positivity) have hKge43 : 4 / 3 ≤ K := by rw [hKdef, show (4/3:ℝ) = sqrt ((4/3)^2) by rw [Real.sqrt_sq (by norm_num)]] apply Real.sqrt_le_sqrt; nlinarith [Real.two_le_pi] set P : ℝ := ∫ x in Ioi w, phi x with hP set Q : ℝ := ∫ x in Iic w, phi x with hQ set A : ℝ := ∫ x in Iic w, (h x - h w) * phi x with hA set B : ℝ := ∫ x in Ioi w, (h x - h w) * phi x with hB set E : ℝ := exp (w ^ 2 / 2) with hE have hEpos : 0 < E := Real.exp_pos _ have hPpos : 0 ≤ P := by rw [hP]; exact setIntegral_nonneg measurableSet_Ioi (fun x _ => (phi_pos x).le) have hQpos : 0 ≤ Q := by rw [hQ]; exact setIntegral_nonneg measurableSet_Iic (fun x _ => (phi_pos x).le) -- The two nonnegative tail "first moments". have hao : phi w - w * P = ∫ x in Ioi w, (x - w) * phi x := by rw [hP]; exact (integral_Ioi_sub_mul_phi w).symm have hai : w * Q + phi w = ∫ x in Iic w, (w - x) * phi x := by rw [hQ]; exact (integral_Iic_sub_mul_phi w).symm have haoNonneg : 0 ≤ phi w - w * P := by rw [hao]; exact setIntegral_nonneg measurableSet_Ioi (fun x hx => mul_nonneg (by have := Set.mem_Ioi.mp hx; linarith) (phi_pos x).le) have haiNonneg : 0 ≤ w * Q + phi w := by rw [hai]; exact setIntegral_nonneg measurableSet_Iic (fun x hx => mul_nonneg (by have := Set.mem_Iic.mp hx; linarith) (phi_pos x).le) -- `E·φ w = 1`. have hEphi : E * phi w = 1 := exp_mul_phi w -- Stein equation and the weighted identity give the c-free derivative identity. have hstein : deriv (steinSol h) w = w * steinSol h w + (h w - gExpect h) := (steinSol_hasDerivAt h hdiff.continuous hb w).deriv have hwid : K * steinSol h w = E * (P * A - Q * B) := by rw [hKdef, hP, hQ, hA, hB, hE] exact steinSol_weighted_identity hdiff.continuous hb w have hKD : K * (h w - gExpect h) = -(A + B) := by rw [hKdef, hA, hB]; exact sqrt_mul_centered_eq hdiff.continuous hb w -- `K·deriv = w·E·(P A − Q B) − (A + B) = −E·(A·aₒ + B·aᵢ)`. have hKderiv : K * deriv (steinSol h) w = -(E * (A * (phi w - w * P) + B * (w * Q + phi w))) := by have hexpand : K * deriv (steinSol h) w = w * (K * steinSol h w) + K * (h w - gExpect h) := by rw [hstein]; ring rw [hexpand, hwid, hKD] -- `w·E(PA−QB) − (A+B) = −E(A(φ w−wP)+B(wQ+φ w))`, using `E·φ w = 1`. linear_combination (A + B) * hEphi -- Bound `K·|deriv| ≤ 2·L·E·(w Q + φ w)·(φ w − w P)`. have hAbound : |A| ≤ L * (w * Q + phi w) := by rw [hA, hQ]; exact abs_integral_diff_phi_Iic_le hdiff.continuous hb hd hdiff w have hBbound : |B| ≤ L * (phi w - w * P) := by rw [hB, hP]; exact abs_integral_diff_phi_Ioi_le hdiff.continuous hb hd hdiff w have hLnn : 0 ≤ L := le_trans (abs_nonneg (deriv h 0)) (hd 0) have hbound : K * |deriv (steinSol h) w| ≤ 2 * L * (E * ((w * Q + phi w) * (phi w - w * P))) := by calc K * |deriv (steinSol h) w| = |K * deriv (steinSol h) w| := by rw [abs_mul, abs_of_nonneg hKpos.le] _ = E * |A * (phi w - w * P) + B * (w * Q + phi w)| := by rw [hKderiv, abs_neg, abs_mul, abs_of_nonneg hEpos.le] _ ≤ E * (|A| * (phi w - w * P) + |B| * (w * Q + phi w)) := by gcongr calc |A * (phi w - w * P) + B * (w * Q + phi w)| ≤ |A * (phi w - w * P)| + |B * (w * Q + phi w)| := abs_add_le _ _ _ = |A| * (phi w - w * P) + |B| * (w * Q + phi w) := by rw [abs_mul, abs_mul, abs_of_nonneg haoNonneg, abs_of_nonneg haiNonneg] _ ≤ E * (L * (w * Q + phi w) * (phi w - w * P) + L * (phi w - w * P) * (w * Q + phi w)) := by gcongr _ = 2 * L * (E * ((w * Q + phi w) * (phi w - w * P))) := by ring -- `P, Q ≤ K`. have hPQK : Q + P = K := by rw [hQ, hP, hKdef]; exact integral_Iic_add_Ioi_phi w have hPleK : P ≤ K := by linarith have hQleK : Q ≤ K := by linarith have hden : (0:ℝ) < w ^ 2 + 1 := by positivity have hEaoNonneg : 0 ≤ E * (phi w - w * P) := mul_nonneg hEpos.le haoNonneg have hEaiNonneg : 0 ≤ E * (w * Q + phi w) := mul_nonneg hEpos.le haiNonneg -- `φ w ≤ 1`. have hphi_le_one : phi w ≤ 1 := by rw [show (1:ℝ) = exp 0 by simp]; unfold phi apply Real.exp_le_exp.mpr; nlinarith [sq_nonneg w] -- The analytic crux, via the pure inequality `crux_pure` and two-sided lower Mills. have hcrux : E * ((w * Q + phi w) * (phi w - w * P)) ≤ K := crux_pure hPpos hQpos hEpos hKge43 hEphi hPQK hphi_le_one haoNonneg haiNonneg (by rw [hP]; exact lower_mills w) (by rw [hQ]; exact lower_mills_left w) -- Conclude. have hfinal : K * |deriv (steinSol h) w| ≤ 2 * L * K := by calc K * |deriv (steinSol h) w| ≤ 2 * L * (E * ((w * Q + phi w) * (phi w - w * P))) := hbound _ ≤ 2 * L * K := by have h2L : 0 ≤ 2 * L := by linarith exact mul_le_mul_of_nonneg_left hcrux h2L have hfinal' : K * |deriv (steinSol h) w| ≤ K * (2 * L) := by rw [mul_comm K (2 * L)]; exact hfinal exact le_of_mul_le_mul_left hfinal' hKpos -
steinSol_deriv_hasDerivAttheorem — For a bounded differentiable test function, the derivative of its standard-normal Stein solution is differentiable at each point, with derivative equal to the solution value plus the point times its first derivative plus the derivative of the test function.hypothesesProof (Lean source)
theorem steinSol_deriv_hasDerivAt (h : ℝ → ℝ) {C : ℝ} (hb : ∀ x, |h x| ≤ C) (hdiff : Differentiable ℝ h) (w : ℝ) : HasDerivAt (deriv (steinSol h)) (steinSol h w + (w * deriv (steinSol h) w + deriv h w)) w := by -- `deriv (steinSol h) = fun u => u * steinSol h u + (h u - gExpect h)` (Stein equation). have hderiv_eq : deriv (steinSol h) = fun u => u * steinSol h u + (h u - gExpect h) := by funext u; exact (steinSol_hasDerivAt h hdiff.continuous hb u).deriv -- `f` is differentiable with derivative `deriv (steinSol h) w`. have hfderiv : deriv (steinSol h) w = w * steinSol h w + (h w - gExpect h) := (steinSol_hasDerivAt h hdiff.continuous hb w).deriv have hf : HasDerivAt (steinSol h) (deriv (steinSol h) w) w := by rw [hfderiv]; exact steinSol_hasDerivAt h hdiff.continuous hb w rw [hderiv_eq] -- Differentiate `u ↦ u·f(u) + (h u − c)`. have hprod : HasDerivAt (fun u => u * steinSol h u) (1 * steinSol h w + w * deriv (steinSol h) w) w := (hasDerivAt_id w).mul hf have hh' : HasDerivAt (fun u => h u - gExpect h) (deriv h w) w := ((hdiff w).hasDerivAt).sub_const _ exact (hprod.fun_add hh').congr_deriv (by rw [hfderiv]; ring) -
steinSol_secondDeriv_abs_letheorem — The absolute second derivative of the standard-normal Stein solution at each point is at most twice the uniform bound on the derivative of the test function.hypothesesProof (Lean source)
theorem steinSol_secondDeriv_abs_le (h : ℝ → ℝ) {C L : ℝ} (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) (w : ℝ) : |steinSol h w + (w * deriv (steinSol h) w + deriv h w)| ≤ 2 * L := by -- `f + w f' + h' = (1+w²) f + w (h − c) + h'`, using the Stein equation `f' = w f + (h − c)`. have hstein : deriv (steinSol h) w = w * steinSol h w + (h w - gExpect h) := (steinSol_hasDerivAt h hdiff.continuous hb w).deriv have hrewrite : steinSol h w + (w * deriv (steinSol h) w + deriv h w) = ((1 + w ^ 2) * steinSol h w + w * (h w - gExpect h)) + deriv h w := by rw [hstein]; ring rw [hrewrite] calc |((1 + w ^ 2) * steinSol h w + w * (h w - gExpect h)) + deriv h w| ≤ |(1 + w ^ 2) * steinSol h w + w * (h w - gExpect h)| + |deriv h w| := abs_add_le _ _ _ ≤ L + L := by gcongr · exact steinSol_crux_le h hdiff.continuous hb hd hdiff w · exact hd w _ = 2 * L := by ring -
steinSol_deriv_lipschitztheorem — Lipschitz bound on the derivative of the Stein solution (equivalent to ‖f_h''‖ ≤ 2L; Chen–Goldstein–Shao Lemma 2.5). The form f_h' is 2L-Lipschitz is what the second-order Taylor step in the local-dependence Stein bound consumes.hypothesesProof (Lean source)
theorem steinSol_deriv_lipschitz (h : ℝ → ℝ) {C L : ℝ} (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) (u v : ℝ) : |deriv (steinSol h) u - deriv (steinSol h) v| ≤ 2 * L * |u - v| := by -- Mean value inequality: `deriv (steinSol h)` is differentiable everywhere with second -- derivative bounded by `2L`, so it is `2L`-Lipschitz. have hbound := Convex.norm_image_sub_le_of_norm_deriv_le (𝕜 := ℝ) (f := deriv (steinSol h)) (s := univ) (fun z _ => (steinSol_deriv_hasDerivAt h hb hdiff z).differentiableAt) (fun z _ => by rw [Real.norm_eq_abs, (steinSol_deriv_hasDerivAt h hb hdiff z).deriv] exact steinSol_secondDeriv_abs_le h hb hd hdiff z) convex_univ (Set.mem_univ v) (Set.mem_univ u) simpa [Real.norm_eq_abs] using hbound
CLT 1 core · 3 supporting This file converts the local-dependence Stein estimate into CDF convergence to the standard normal law. ★ stein_cdf_clt
Local-dependence central limit theorem via Stein bounds
This file converts the local-dependence Stein estimate into CDF convergence to
the standard normal law. It proves the reusable implication
cdf_tendsto_of_charFun_tendsto from pointwise characteristic-function
convergence to pointwise Gaussian CDF convergence, then applies the Stein bound
to cosine and sine test functions in the bounded local-dependence central limit
theorem stein_cdf_clt.
The bounded local-dependence CLT (CDF form). Fix, for each sample size n, a probability measure μ n, triangular-array summands X n i, and an index-dependent neighborhood set N n i for each i, all jointly measurable. Suppose the summands are uniformly bounded by a nonnegative constant sequence B n, mean zero, and each summand is independent of the sum of the summands outside its neighborhood; suppose the standardized sum has unit variance, and that the variance of the neighborhood-weighted cross term and the aggregate third-absolute-moment error term both tend to zero as n → ∞. Then for every threshold s, the CDF of the dependency sum under μ n at s converges, as n → ∞, to the standard-normal CDF at s.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
cdf_tendsto_of_charFun_tendstotheorem — CDF convergence from characteristic-function convergence. A sequence of real probability laws whose characteristic functions converge to those of an atomless target law has convergent CDF values at every threshold.hypothesesProof (Lean source)
theorem cdf_tendsto_of_charFun_tendsto (lawn : ℕ → ProbabilityMeasure ℝ) (ν : ProbabilityMeasure ℝ) [NullSingletonClass (ν : Measure ℝ)] (hchar : ∀ t : ℝ, Tendsto (fun n => charFun (lawn n : Measure ℝ) t) atTop (𝓝 (charFun (ν : Measure ℝ) t))) (s : ℝ) : Tendsto (fun n => (lawn n : Measure ℝ).real (Iic s)) atTop (𝓝 ((ν : Measure ℝ).real (Iic s))) := by -- Lévy continuity (`clt` package): char-function convergence ⇒ weak convergence. have hweak : Tendsto lawn atTop (𝓝 ν) := by rw [MeasureTheory.ProbabilityMeasure.tendsto_iff_tendsto_charFun] intro t exact hchar t -- Atomlessness makes the frontier of `Iic s` null. have hnull : (ν : Measure ℝ) (frontier (Iic s)) = 0 := by rw [frontier_Iic] exact measure_singleton s -- Portmanteau: weak convergence ⇒ measure convergence on null-frontier sets. have hmeas := MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' (μ := ν) (μs := lawn) hweak (E := Iic s) hnull -- Pass to real-valued measures. have hfin : ∀ n, (lawn n : Measure ℝ) (Iic s) ≠ ⊤ := fun n => measure_ne_top _ _ refine (ENNReal.tendsto_toReal ?_).comp hmeas exact measure_ne_top _ _ -
charFun_map_eq_cos_sintheorem — A measurable real random variable under a finite measure has a characteristic function whose real and imaginary components are the corresponding cosine and sine integrals.hypothesesProof (Lean source)
theorem charFun_map_eq_cos_sin {Ω : Type*} [MeasurableSpace Ω] (ν : Measure Ω) [IsFiniteMeasure ν] (W : Ω → ℝ) (hW : Measurable W) (t : ℝ) : charFun (ν.map W) t = (↑(∫ ω, cos (t * W ω) ∂ν) : ℂ) + (↑(∫ ω, sin (t * W ω) ∂ν) : ℂ) * I := by -- Move the integral back to `ν` via `integral_map`. have hg : AEStronglyMeasurable (fun x : ℝ => exp (↑t * ↑x * I)) (ν.map W) := (Complex.measurable_exp.comp ((measurable_const.mul Complex.measurable_ofReal).mul measurable_const)).aestronglyMeasurable rw [charFun_apply_real, integral_map hW.aemeasurable hg] -- Integrability of the real/imaginary integrands. have hcosint : Integrable (fun ω => (↑(cos (t * W ω)) : ℂ)) ν := (integrable_bdd_real (fun ω => cos (t * W ω)) (Real.measurable_cos.comp (measurable_const.mul hW)) (fun ω => Real.abs_cos_le_one _)).ofReal have hsinint : Integrable (fun ω => (↑(sin (t * W ω)) : ℂ) * I) ν := ((integrable_bdd_real (fun ω => sin (t * W ω)) (Real.measurable_sin.comp (measurable_const.mul hW)) (fun ω => Real.abs_sin_le_one _)).ofReal).mul_const I -- Rewrite the complex exponential pointwise and split. have hpt : ∀ ω, exp (↑t * ↑(W ω) * I) = ↑(cos (t * W ω)) + ↑(sin (t * W ω)) * I := by intro ω rw [show (↑t * ↑(W ω) : ℂ) = ↑(t * W ω) by push_cast; ring, Complex.exp_mul_I, Complex.ofReal_cos, Complex.ofReal_sin] simp_rw [hpt] rw [integral_add hcosint hsinint] congr 1 · exact integral_complex_ofReal · have hmc := integral_mul_const (μ := ν) I (fun ω => (↑(sin (t * W ω)) : ℂ)) refine hmc.trans ?_ congr 1 exact integral_complex_ofReal -
stein_expect_tendstotheorem — For uniformly bounded, mean-zero locally dependent sums with unit variance whose Stein error terms vanish, expectations of a differentiable test function converge to its standard-normal expectation.hypothesesΩ :ℕ → Type*∀ n, MeasurableSpace (Ω n)μ :∀ n, Measure (Ω n)∀ n, IsProbabilityMeasure (μ n)ι :X :∀ nifι nandΩ nthenℝN :∀ nifι nthenFinset (ι n)hmeas :∀ n i, Measurable (X n i)B :ℕ → ℝhB :∀ n, 0 ≤ B nhbound :∀ n i ω, |X n i ω| ≤ B nhmean :∀ n i, ∫ ω, X n i ω ∂(μ n) = 0hvar :∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = 1herr1 :h :ℝ → ℝC L :ℝhb :∀ x, |h x| ≤ Chd :∀ x, |deriv h x| ≤ Lhdiff :Differentiable ℝ hProof (Lean source)
theorem stein_expect_tendsto {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) [∀ n, IsProbabilityMeasure (μ n)] {ι : ℕ → Type*} [∀ n, Fintype (ι n)] [∀ n, DecidableEq (ι n)] (X : ∀ n, ι n → Ω n → ℝ) (N : ∀ n, ι n → Finset (ι n)) (hmeas : ∀ n i, Measurable (X n i)) (B : ℕ → ℝ) (hB : ∀ n, 0 ≤ B n) (hbound : ∀ n i ω, |X n i ω| ≤ B n) (hmean : ∀ n i, ∫ ω, X n i ω ∂(μ n) = 0) (hindep : ∀ n i, IndepFun (X n i) (fun ω => ∑ j ∈ univ \ N n i, X n j ω) (μ n)) (hvar : ∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = 1) (herr1 : Tendsto (fun n => variance (fun ω => ∑ i, X n i ω * nbhdSum (X n) (N n) i ω) (μ n)) atTop (𝓝 0)) (herr2 : Tendsto (fun n => ∑ i, ∫ ω, |X n i ω| * (nbhdSum (X n) (N n) i ω) ^ 2 ∂(μ n)) atTop (𝓝 0)) (h : ℝ → ℝ) {C L : ℝ} (hb : ∀ x, |h x| ≤ C) (hd : ∀ x, |deriv h x| ≤ L) (hdiff : Differentiable ℝ h) : Tendsto (fun n => ∫ ω, h (depSum (X n) ω) ∂(μ n)) atTop (𝓝 (gExpect h)) := by -- The Stein bound: `|E[h(Wₙ)] − E[h(Z)]| ≤ err₁(n) + err₂(n)` with both errors → 0. set lhs : ℕ → ℝ := fun n => ∫ ω, h (depSum (X n) ω) ∂(μ n) with hlhs set rhs : ℕ → ℝ := fun n => 2 * L * sqrt (variance (fun ω => ∑ i, X n i ω * nbhdSum (X n) (N n) i ω) (μ n)) + L * ∑ i, ∫ ω, |X n i ω| * (nbhdSum (X n) (N n) i ω) ^ 2 ∂(μ n) with hrhs have hbound_n : ∀ n, |lhs n - gExpect h| ≤ rhs n := fun n => stein_local_dependence_bound (X n) (N n) (hmeas n) (hB n) (hbound n) (hmean n) (hindep n) (hvar n) h hb hd hdiff -- The error sequence converges to `0`. have hrhs0 : Tendsto rhs atTop (𝓝 0) := by have ht1 : Tendsto (fun n => 2 * L * sqrt (variance (fun ω => ∑ i, X n i ω * nbhdSum (X n) (N n) i ω) (μ n))) atTop (𝓝 0) := by have hsqrt : Tendsto (fun n => sqrt (variance (fun ω => ∑ i, X n i ω * nbhdSum (X n) (N n) i ω) (μ n))) atTop (𝓝 0) := by have := (Real.continuous_sqrt.tendsto 0).comp herr1 simpa [Real.sqrt_zero, Function.comp_def] using this simpa using hsqrt.const_mul (2 * L) have ht2 : Tendsto (fun n => L * ∑ i, ∫ ω, |X n i ω| * (nbhdSum (X n) (N n) i ω) ^ 2 ∂(μ n)) atTop (𝓝 0) := by simpa using herr2.const_mul L simpa [hrhs] using ht1.add ht2 -- Squeeze: `|lhs n − gExpect h| ≤ rhs n → 0` forces `lhs n → gExpect h`. rw [← tendsto_sub_nhds_zero_iff] refine squeeze_zero_norm (fun n => ?_) hrhs0 rw [Real.norm_eq_abs]; exact hbound_n n
StandardizedDepGraphCLT 2 core · 2 supporting A standardization wrapper around the abstract Stein dependency-graph CLT Causalean.SteinMethod.stein_cdf_clt_of_depGraph. ★ bounded_degree_dependency_clt
Standardized bounded-degree dependency-graph CLT
A standardization wrapper around the abstract Stein dependency-graph CLT
Causalean.SteinMethod.stein_cdf_clt_of_depGraph. The engine consumes an array that has already
been standardized to unit variance with a summand bound tending to 0 and a Lyapunov limit
card · Bₙ³ → 0. Real applications instead arrive with fixed bounded summands |X| ≤ M, a raw
second moment ∫ (∑ᵢ Xᵢ)² = vₙ, and a linear variance floor c · card ιₙ ≤ vₙ — so this file
supplies the missing layer: it divides through by √vₙ, re-derives unit variance, converts the
summand bound into Bₙ = (M/√c)/√(card ιₙ), discharges card · Bₙ³ → 0 internally, and adds the
prefix-shift plumbing for the eventual-hypothesis variants. Downstream a user can invoke it on raw
mean-zero bounded summands and get CDF convergence of (∑ᵢ Xᵢ)/√vₙ to N(0,1) in one step.
Dividing every summand in a dependency graph by the same deterministic constant preserves the graph and transfers the independence field by measurable post-composition.
Definition (Lean source)
Bounded-degree dependency-graph CLT (raw, variance-floor form). Fix, for each n, a probability measure μ n, triangular-array summands X n i, and a dependency graph Dep n on the index set, with every dependency neighborhood of size at most a fixed bound Dmax. Suppose the summands are uniformly bounded in absolute value by a nonnegative constant M and mean zero, with the total variance v n satisfying, for a strictly positive constant c, a floor v n ≥ c · card (ι n) eventually in n; suppose also the index-set cardinality diverges to infinity. Then for every threshold s, the CDF of the standardized sum depSum (X n) / √(v n) under μ n at s converges, as n → ∞, to the standard-normal CDF at s. The index-size divergence together with the variance floor forces the Lyapunov ratio card (ι n) · (M / √(v n))³ → 0 that drives the underlying Stein bound.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
bounded_degree_dependency_clt_of_variance_floor_alltheorem — Dependency-graph CLT wrapper when the linear variance floor holds at every index. The public theorem below removes this all-index convenience by shifting to a tail.hypothesesΩ :ℕ → Type*∀ n, MeasurableSpace (Ω n)μ :∀ n, Measure (Ω n)∀ n, IsProbabilityMeasure (μ n)ι :ℕ → Type*∀ n, Fintype (ι n)X :∀ nifι nandΩ nthenℝDep :∀ n, DepGraph (X n) (μ n)Dmax :ℕhdeg :∀ n i, ((Dep n).nbhd i).card ≤ DmaxM :ℝhM :0 ≤ Mhbound :∀ n i ω, |X n i ω| ≤ Mhmean :∀ n i, ∫ ω, X n i ω ∂(μ n) = 0v :ℕ → ℝhv :∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v nc :ℝhc :0 < chvc :∀ n, c * (card (ι n) : ℝ) ≤ v nhcard_pos :∀ n, 0 < card (ι n)s :ℝProof (Lean source)
theorem bounded_degree_dependency_clt_of_variance_floor_all {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) [∀ n, IsProbabilityMeasure (μ n)] {ι : ℕ → Type*} [∀ n, Fintype (ι n)] (X : ∀ n, ι n → Ω n → ℝ) (Dep : ∀ n, DepGraph (X n) (μ n)) (Dmax : ℕ) (hdeg : ∀ n i, ((Dep n).nbhd i).card ≤ Dmax) (M : ℝ) (hM : 0 ≤ M) (hbound : ∀ n i ω, |X n i ω| ≤ M) (hmean : ∀ n i, ∫ ω, X n i ω ∂(μ n) = 0) (v : ℕ → ℝ) (hv : ∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v n) (c : ℝ) (hc : 0 < c) (hvc : ∀ n, c * (card (ι n) : ℝ) ≤ v n) (hcard_pos : ∀ n, 0 < card (ι n)) (hcard : Tendsto (fun n => card (ι n)) atTop atTop) (s : ℝ) : Tendsto (fun n => ((μ n).map (fun ω => depSum (X n) ω / Real.sqrt (v n))).real (Iic s)) atTop (𝓝 ((gaussianReal 0 1).real (Iic s))) := by classical set Xs : ∀ n, ι n → Ω n → ℝ := fun n i ω => X n i ω / Real.sqrt (v n) with hXs set Ds : ∀ n, DepGraph (Xs n) (μ n) := fun n => depGraph_div_const (Dep n) (Real.sqrt (v n)) with hDs set cardR : ℕ → ℝ := fun n => (card (ι n) : ℝ) with hcardR set K : ℝ := M / Real.sqrt c with hK set B : ℕ → ℝ := fun n => K / Real.sqrt (cardR n) with hBdef have hcardR_pos : ∀ n, 0 < cardR n := by intro n have hpos : (0 : ℝ) < (card (ι n) : ℝ) := by exact_mod_cast hcard_pos n simpa [cardR] using hpos have hv_pos : ∀ n, 0 < v n := by intro n have hfloor : 0 < c * cardR n := mul_pos hc (hcardR_pos n) exact lt_of_lt_of_le hfloor (by simpa [cardR] using hvc n) have hmeas : ∀ n i, Measurable (Xs n i) := fun n i => (Ds n).meas i have hdeg' : ∀ n i, ((Ds n).nbhd i).card ≤ Dmax := by intro n i exact hdeg n i have hB_nonneg : ∀ n, 0 ≤ B n := by intro n have hc_sqrt : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc have hK_nonneg : 0 ≤ K := by rw [hK] exact div_nonneg hM hc_sqrt.le exact div_nonneg hK_nonneg (Real.sqrt_nonneg _) have hbound' : ∀ n i ω, |Xs n i ω| ≤ B n := by intro n i ω have hsv : 0 < Real.sqrt (v n) := Real.sqrt_pos.mpr (hv_pos n) have hsf : 0 < Real.sqrt (c * cardR n) := Real.sqrt_pos.mpr (mul_pos hc (hcardR_pos n)) have hs_le : Real.sqrt (c * cardR n) ≤ Real.sqrt (v n) := Real.sqrt_le_sqrt (by simpa [cardR] using hvc n) calc |Xs n i ω| = |X n i ω| / Real.sqrt (v n) := by simp [hXs, abs_div, abs_of_pos hsv] _ ≤ M / Real.sqrt (v n) := div_le_div_of_nonneg_right (hbound n i ω) hsv.le _ ≤ M / Real.sqrt (c * cardR n) := div_le_div_of_nonneg_left hM hsf hs_le _ = B n := by rw [hBdef, hK, Real.sqrt_mul hc.le (cardR n)] field_simp [(Real.sqrt_pos.mpr hc).ne', (Real.sqrt_pos.mpr (hcardR_pos n)).ne'] have hmean' : ∀ n i, ∫ ω, Xs n i ω ∂(μ n) = 0 := by intro n i have hsv_ne : Real.sqrt (v n) ≠ 0 := (Real.sqrt_pos.mpr (hv_pos n)).ne' have hfun : (fun ω => Xs n i ω) = fun ω => (Real.sqrt (v n))⁻¹ * X n i ω := by funext ω simp [hXs, div_eq_inv_mul] rw [hfun, integral_const_mul, hmean n i, mul_zero] have hdep : ∀ n, depSum (Xs n) = fun ω => depSum (X n) ω / Real.sqrt (v n) := by intro n funext ω simp [depSum, hXs, Finset.sum_div] have hvar' : ∀ n, ∫ ω, (depSum (Xs n) ω) ^ 2 ∂(μ n) = 1 := by intro n have hvn_pos : 0 < v n := hv_pos n have hsv_ne : Real.sqrt (v n) ≠ 0 := (Real.sqrt_pos.mpr hvn_pos).ne' rw [hdep n] have hfun : (fun ω => (depSum (X n) ω / Real.sqrt (v n)) ^ 2) = fun ω => ((Real.sqrt (v n)) ^ 2)⁻¹ * (depSum (X n) ω) ^ 2 := by funext ω field_simp [hsv_ne] rw [hfun, integral_const_mul, hv n, Real.sq_sqrt hvn_pos.le] field_simp [hvn_pos.ne'] have hcardR_tendsto : Tendsto cardR atTop atTop := by exact tendsto_natCast_atTop_atTop.comp hcard have hsqrtcard : Tendsto (fun n => Real.sqrt (cardR n)) atTop atTop := Real.tendsto_sqrt_atTop.comp hcardR_tendsto have hB0 : Tendsto B atTop (𝓝 0) := by have hlim : Tendsto (fun n => K / Real.sqrt (cardR n)) atTop (𝓝 0) := hsqrtcard.const_div_atTop K simpa [B] using hlim have hNB3eq : (fun n => cardR n * (B n) ^ 3) = fun n => K ^ 3 / Real.sqrt (cardR n) := by funext n have hcpos : 0 < cardR n := hcardR_pos n have hs_ne : Real.sqrt (cardR n) ≠ 0 := (Real.sqrt_pos.mpr hcpos).ne' rw [hBdef] calc cardR n * (K / Real.sqrt (cardR n)) ^ 3 = K ^ 3 * (cardR n / (Real.sqrt (cardR n)) ^ 3) := by ring _ = K ^ 3 / Real.sqrt (cardR n) := by rw [show (Real.sqrt (cardR n)) ^ 3 = Real.sqrt (cardR n) * (Real.sqrt (cardR n)) ^ 2 by ring, Real.sq_sqrt hcpos.le] field_simp [hs_ne] have hNB3 : Tendsto (fun n => (card (ι n) : ℝ) * (B n) ^ 3) atTop (𝓝 0) := by have hlim : Tendsto (fun n => K ^ 3 / Real.sqrt (cardR n)) atTop (𝓝 0) := hsqrtcard.const_div_atTop (K ^ 3) simpa [cardR, hNB3eq] using hlim have hclt := stein_cdf_clt_of_depGraph μ Xs Ds Dmax hdeg' B hB_nonneg hbound' hB0 hNB3 hmean' hvar' s exact hclt.congr (fun n => by rw [hdep n]) -
bounded_degree_dependency_clt_eventually_boundedtheorem — Eventual-bound variant of bounded_degree_dependency_clt: only the tail of a triangular array affects the limiting CDF, so the uniform summand bound need only hold after a finite prefix.hypothesesΩ :ℕ → Type*∀ n, MeasurableSpace (Ω n)μ :∀ n, Measure (Ω n)∀ n, IsProbabilityMeasure (μ n)ι :ℕ → Type*∀ n, Fintype (ι n)X :∀ nifι nandΩ nthenℝDep :∀ n, DepGraph (X n) (μ n)Dmax :ℕhdeg :∀ n i, ((Dep n).nbhd i).card ≤ DmaxM :ℝhM :0 ≤ Mhbound :∀ᶠ n in atTop, ∀ i ω, |X n i ω| ≤ Mhmean :∀ n i, ∫ ω, X n i ω ∂(μ n) = 0v :ℕ → ℝhv :∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v nc :ℝhc :0 < cs :ℝProof (Lean source)
theorem bounded_degree_dependency_clt_eventually_bounded {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) [∀ n, IsProbabilityMeasure (μ n)] {ι : ℕ → Type*} [∀ n, Fintype (ι n)] (X : ∀ n, ι n → Ω n → ℝ) (Dep : ∀ n, DepGraph (X n) (μ n)) (Dmax : ℕ) (hdeg : ∀ n i, ((Dep n).nbhd i).card ≤ Dmax) (M : ℝ) (hM : 0 ≤ M) (hbound : ∀ᶠ n in atTop, ∀ i ω, |X n i ω| ≤ M) (hmean : ∀ n i, ∫ ω, X n i ω ∂(μ n) = 0) (v : ℕ → ℝ) (hv : ∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v n) (c : ℝ) (hc : 0 < c) (hvc : ∀ᶠ n in atTop, c * (card (ι n) : ℝ) ≤ v n) (hcard : Tendsto (fun n => card (ι n)) atTop atTop) (s : ℝ) : Tendsto (fun n => ((μ n).map (fun ω => depSum (X n) ω / sqrt (v n))).real (Iic s)) atTop (𝓝 ((gaussianReal 0 1).real (Iic s))) := by classical rcases eventually_atTop.1 hbound with ⟨Nb, hNb⟩ have hbound_tail : ∀ n i ω, |X (n + Nb) i ω| ≤ M := by intro n i ω exact hNb (n + Nb) (by omega) i ω have hvc_tail : ∀ᶠ n in atTop, c * (card (ι (n + Nb)) : ℝ) ≤ v (n + Nb) := by rcases eventually_atTop.1 hvc with ⟨Nv, hNv⟩ exact eventually_atTop.2 ⟨Nv, fun n hn => hNv (n + Nb) (by omega)⟩ have hcard_tail : Tendsto (fun n => card (ι (n + Nb))) atTop atTop := hcard.comp (tendsto_add_atTop_nat Nb) have htail := bounded_degree_dependency_clt (μ := fun n => μ (n + Nb)) (X := fun n => X (n + Nb)) (Dep := fun n => Dep (n + Nb)) Dmax (fun n i => hdeg (n + Nb) i) M hM hbound_tail (fun n i => hmean (n + Nb) i) (fun n => v (n + Nb)) (fun n => hv (n + Nb)) c hc hvc_tail hcard_tail s exact (tendsto_add_atTop_iff_nat Nb).1 htail