Stat.Bootstrap.EfronResampling.Mean
This directory proves almost-sure consistency of Efron's nonparametric bootstrap for a sample mean of a measurable real statistic with a finite second moment.
Basic 6 core · 9 supporting This module defines the centered empirical row law, the conditional bootstrap law of the root-sample-size mean, and the corresponding true sampling law. ★ bootstrapMeanLaw_eq_iidRowNormalizedSumLaw
Laws used in the Efron bootstrap CLT for a mean
This module defines the centered empirical row law, the conditional bootstrap law of the
root-sample-size mean, and the corresponding true sampling law. The definitions are totalized
at sample size zero by a point mass at zero; every theorem identifying them with Efron's literal
bootstrap law assumes the genuine case n ≠ 0.
Given an observation statistic, observed data, and a same-size resample, the centered bootstrap sum is the resample's statistic total minus the data-average total, normalized by the square root of the sample size.
Given an iid sample, an observation statistic, a row size, and a realized outcome, the centered empirical row law is the empirical distribution of statistic values centered at their sample average, with a point mass at zero for the zero row.
Definition (Lean source)
Given an iid sample, a measurable observation statistic, a row size, and a realized outcome, the conditional bootstrap law of the centered normalized mean is Efron's resampling law at positive sizes and a point mass at zero at size zero.
Definition (Lean source)
With a nonzero row size, an iid sample, a measurable observation statistic, and a realized outcome, the conditional bootstrap mean law equals the normalized iid row-sum law from the centered empirical distribution.
Formal statement
Proof (Lean source)
Given an iid sample, a measurable observation statistic, and a row size, the sampling law of the square-root-scaled centered sample mean is its distribution under repeated draws from the population.
Definition (Lean source)
Given an observation statistic and a measure on the observation space, the nonnegative population variance is the variance of the statistic represented as a nonnegative real number for use as a Gaussian variance parameter.
9 supporting declarations (lemmas, instances)
-
centeredBootstrapSum_eq_sqrt_mul_finAverage_subtheorem — With a nonzero sample size, an observation statistic, observed data, and a resample, the centered bootstrap sum equals the square-root-scaled difference between their averages.hypothesesconclusioncenteredBootstrapSum ψ x xstarProof (Lean source)
theorem centeredBootstrapSum_eq_sqrt_mul_finAverage_sub {n : ℕ} (hn : n ≠ 0) (ψ : X → ℝ) (x xstar : Fin n → X) : centeredBootstrapSum ψ x xstar = sqrt (n : ℝ) * (finMean (fun i ↦ ψ (xstar i)) - finMean (fun i ↦ ψ (x i))) := by -- Expand both finite averages and `Finset.sum_sub_distrib`; use `Real.sq_sqrt` and `hn` to -- rewrite `√n / n` as `(√n)⁻¹`. unfold centeredBootstrapSum finMean rw [Finset.sum_sub_distrib] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] have hnR : (n : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hn have hsqrt : sqrt (n : ℝ) ≠ 0 := Real.sqrt_ne_zero'.mpr (Nat.cast_pos.mpr (Nat.pos_of_ne_zero hn)) simp only [smul_eq_mul] field_simp rw [Real.sq_sqrt (Nat.cast_nonneg n)] -
measurable_centeredBootstrapSumtheorem — Given an observation statistic that is measurable and observed data, the centered bootstrap sum as a function of the resample is measurable.hypothesesconclusionProof (Lean source)
theorem measurable_centeredBootstrapSum {n : ℕ} (ψ : X → ℝ) (hψ : Measurable ψ) (x : Fin n → X) : Measurable (centeredBootstrapSum ψ x) := by unfold centeredBootstrapSum fun_prop -
centeredEmpiricalLaw_isProbabilityMeasuretheorem — For an iid sample, an observation statistic, a row size, and a realized outcome, the centered empirical row law is a probability measure.hypothesesconclusionIsProbabilityMeasure (centeredEmpiricalLaw S ψ n ω)Proof (Lean source)
theorem centeredEmpiricalLaw_isProbabilityMeasure (S : IIDSample Ω X μ P) (ψ : X → ℝ) (n : ℕ) (ω : Ω) : IsProbabilityMeasure (centeredEmpiricalLaw S ψ n ω) := by -- Split on `n = 0`; use the dirac instance in the zero branch and -- `empiricalMeasure_isProbabilityMeasure` otherwise. by_cases hn : n = 0 · subst n rw [centeredEmpiricalLaw, if_pos rfl] exact Measure.dirac.isProbabilityMeasure · rw [centeredEmpiricalLaw, if_neg hn] exact empiricalMeasure_isProbabilityMeasure _ hn -
instIsProbabilityMeasureinstance — Given an iid sample, an observation statistic, a row size, and a realized outcome, the probability-measure instance for the centered empirical row law supplies its unit total mass.parametersinstancegiven by -
integral_id_centeredEmpiricalLawtheorem — With a nonzero row size, an iid sample, an observation statistic, and a realized outcome, the centered empirical row law has mean zero.hypothesesconclusion∫ y, y ∂centeredEmpiricalLaw S ψ n ω = 0Proof (Lean source)
theorem integral_id_centeredEmpiricalLaw {n : ℕ} (hn : n ≠ 0) (S : IIDSample Ω X μ P) (ψ : X → ℝ) (ω : Ω) : ∫ y, y ∂centeredEmpiricalLaw S ψ n ω = 0 := by -- Reduce the empirical integral to its finite average and cancel the sample mean. rw [centeredEmpiricalLaw, if_neg hn] unfold empiricalMeasure rw [integral_finiteSampleMeasure (f := fun y : ℝ ↦ y) _ measurable_id] unfold IIDSample.sampleMean rw [Finset.sum_sub_distrib] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] have hsum : (∑ i : Fin n, ψ (S.Z i ω)) = ∑ i ∈ range n, ψ (S.Z i ω) := Fin.sum_univ_eq_sum_range (fun i ↦ ψ (S.Z i ω)) n rw [hsum] field_simp ring -
memLp_id_centeredEmpiricalLawtheorem — Given an iid sample, an observation statistic, a row size, and a realized outcome, the identity function has a finite second moment under the centered empirical row law.hypothesesconclusionMemLp id 2 (centeredEmpiricalLaw S ψ n ω)Proof (Lean source)
theorem memLp_id_centeredEmpiricalLaw (S : IIDSample Ω X μ P) (ψ : X → ℝ) (n : ℕ) (ω : Ω) : MemLp id 2 (centeredEmpiricalLaw S ψ n ω) := by -- Both branches have finite support; unfold the empirical measure into its finite sum of -- dirac masses and use `memLp_finsetSum_measure`/the corresponding integrability criterion. rw [centeredEmpiricalLaw] split_ifs with hn · refine (memLp_two_iff_integrable_sq measurable_id.aestronglyMeasurable).2 ?_ exact integrable_dirac' (stronglyMeasurable_id.pow 2) (by simp) · refine (memLp_two_iff_integrable_sq measurable_id.aestronglyMeasurable).2 ?_ unfold empiricalMeasure finiteSampleMeasure apply Integrable.smul_measure · rw [integrable_finsetSum_measure] intro i hi exact integrable_dirac' (stronglyMeasurable_id.pow 2) (by simp) · simp [hn] -
integral_sq_centeredEmpiricalLaw_eq_empiricalVartheorem — With a nonzero row size, an iid sample, an observation statistic, and a realized outcome, the centered empirical row law's second moment equals the plug-in empirical variance.hypothesesconclusion∫ y, y ^ 2 ∂centeredEmpiricalLaw S ψ n ω = S.empiricalVar ψ n ωProof (Lean source)
theorem integral_sq_centeredEmpiricalLaw_eq_empiricalVar {n : ℕ} (hn : n ≠ 0) (S : IIDSample Ω X μ P) (ψ : X → ℝ) (ω : Ω) : ∫ y, y ^ 2 ∂centeredEmpiricalLaw S ψ n ω = S.empiricalVar ψ n ω := by -- Unfold the nonzero row and use the finite empirical integral formula, then -- `IIDSample.empiricalVar_eq_centered`. rw [centeredEmpiricalLaw, if_neg hn] unfold empiricalMeasure rw [integral_finiteSampleMeasure (f := fun y : ℝ ↦ y ^ 2) _ (measurable_id.pow_const 2)] rw [IIDSample.empiricalVar_eq_centered] rw [Fin.sum_univ_eq_sum_range (fun i ↦ (ψ (S.Z i ω) - S.sampleMean ψ n ω) ^ 2) n] simp only [one_div] -
setIntegral_sq_centeredEmpiricalLaw_eq_averagetheorem — With a nonzero row size, an iid sample, an observation statistic, a realized outcome, and a measurable real set, the centered empirical law's restricted second moment equals the corresponding finite empirical average.hypothesesProof (Lean source)
theorem setIntegral_sq_centeredEmpiricalLaw_eq_average {n : ℕ} (hn : n ≠ 0) (S : IIDSample Ω X μ P) (ψ : X → ℝ) (ω : Ω) (A : Set ℝ) (hA : MeasurableSet A) : ∫ y in A, y ^ 2 ∂centeredEmpiricalLaw S ψ n ω = (n : ℝ)⁻¹ * ∑ i : Fin n, indicator A (fun y : ℝ ↦ y ^ 2) (ψ (S.Z i ω) - S.sampleMean ψ n ω) := by -- Write the set integral as the integral of an indicator and apply -- `Concentration.integral_finiteSampleMeasure`. rw [centeredEmpiricalLaw, if_neg hn] rw [← integral_indicator hA] unfold empiricalMeasure rw [integral_finiteSampleMeasure (f := indicator A (fun y : ℝ ↦ y ^ 2)) _ ((measurable_id.pow_const 2).indicator hA)] simp only [one_div] -
bootstrapMeanLaw_toMeasuretheorem — With a nonzero row size, an iid sample, a measurable observation statistic, and a realized outcome, the bootstrap mean law has the literal Efron-bootstrap underlying measure.hypothesesconclusion(bootstrapMeanLaw S ψ hψ n ω : Measure ℝ)= bootstrapLaw (centeredBootstrapSum ψ (S.sampleVector n ω)) (S.sampleVector n ω)Proof (Lean source)
theorem bootstrapMeanLaw_toMeasure {n : ℕ} (hn : n ≠ 0) (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (ω : Ω) : (bootstrapMeanLaw S ψ hψ n ω : Measure ℝ) = bootstrapLaw (centeredBootstrapSum ψ (S.sampleVector n ω)) (S.sampleVector n ω) := by -- Unfold `bootstrapMeanLaw`; the nonzero branch reduces definitionally. simp [bootstrapMeanLaw, hn]
AlmostSure 3 core · 5 supporting This module derives the almost-sure convergence of the empirical mean and variance and the Lindeberg tail condition using only a finite second moment. ★ centeredEmpiricalSecondMoment_tendsto_ae★ centeredEmpiricalLindeberg_tendsto_ae
Almost-sure empirical conditions for the bootstrap mean CLT
This module derives the almost-sure convergence of the empirical mean and variance and the Lindeberg tail condition using only a finite second moment. The tail argument is organized around the measurable squared-tail truncation below, so no moment above order two is assumed.
Given an observation statistic, a tail threshold, and an observation, the squared tail contribution is the statistic's square when its absolute value exceeds the threshold and zero otherwise.
Definition (Lean source)
Given an iid sample, a measurable observation statistic, and an integrable population square, the centered empirical row law's second moment converges almost surely to the population variance.
Formal statement
Proof (Lean source)
Given an iid sample, a measurable observation statistic, and an integrable population square, every positive Lindeberg tail of the centered empirical row law vanishes almost surely at the square-root sample-size scale.
Formal statement
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
integral_squaredTail_tendsto_zerotheorem — If an observation statistic is measurable and has an integrable square under the population law, its squared-tail expectations vanish as the threshold grows without bound.hypothesesconclusionProof (Lean source)
theorem integral_squaredTail_tendsto_zero (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : Tendsto (fun M : ℝ ↦ ∫ x, squaredTail ψ M x ∂P) atTop (𝓝 0) := by have hmeas : ∀ M : ℝ, AEStronglyMeasurable (squaredTail ψ M) P := by intro M exact ((hψ.pow_const 2).mul (measurable_const.indicator (measurableSet_le measurable_const hψ.abs))).aestronglyMeasurable have hbound : ∀ M : ℝ, ∀ᵐ x ∂P, ‖squaredTail ψ M x‖ ≤ (ψ x) ^ 2 := by intro M filter_upwards with x by_cases hx : M ≤ |ψ x| · simp [squaredTail, hx] · simp [squaredTail, hx, sq_nonneg] have hpoint : ∀ᵐ x ∂P, Tendsto (fun M : ℝ ↦ squaredTail ψ M x) atTop (𝓝 0) := by filter_upwards with x apply tendsto_const_nhds.congr' filter_upwards [eventually_gt_atTop |ψ x|] with M hM simp [squaredTail, not_le.mpr hM] simpa using (tendsto_integral_filter_of_dominated_convergence (fun x ↦ (ψ x) ^ 2) (Eventually.of_forall hmeas) (Eventually.of_forall hbound) hψ2 hpoint) -
sampleMean_tendsto_aetheorem — Given an iid sample, a measurable observation statistic, and an integrable population square, the transformed sample mean converges almost surely to its population expectation.hypothesesΩ :sharedType u_1X :sharedType u_2S :IIDSample Ω X μ Pψ :X → ℝhψ :hψ2 :Integrable (fun x ↦ (ψ x) ^ 2) PProof (Lean source)
theorem sampleMean_tendsto_ae (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : ∀ᵐ ω ∂μ, Tendsto (fun n ↦ S.sampleMean ψ n ω) atTop (𝓝 (∫ x, ψ x ∂P)) := by haveI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable have hmem : MemLp ψ 2 P := (memLp_two_iff_integrable_sq hψ.aestronglyMeasurable).2 hψ2 have hψint : Integrable ψ P := hmem.integrable (by norm_num) have hψint_sample : Integrable (fun ω ↦ ψ (S.Z 0 ω)) μ := by have hmap : Integrable ψ (μ.map (S.Z 0)) := by simpa [S.law] using hψint exact hmap.comp_measurable (S.meas 0) have hindep : Pairwise (onFun (fun f g ↦ IndepFun f g μ) (fun i ω ↦ ψ (S.Z i ω))) := by have hi : iIndepFun (fun i ↦ ψ ∘ S.Z i) μ := S.indep.comp (fun _ ↦ ψ) (fun _ ↦ hψ) intro i j hij exact hi.indepFun hij have hident : ∀ i, IdentDistrib (fun ω ↦ ψ (S.Z i ω)) (fun ω ↦ ψ (S.Z 0 ω)) μ μ := by intro i exact ((S.identDist i).symm.comp hψ) have hslln := strong_law_ae_real (fun i ω ↦ ψ (S.Z i ω)) hψint_sample hindep hident have hint : (∫ ω, ψ (S.Z 0 ω) ∂μ) = ∫ x, ψ x ∂P := by rw [← integral_map (S.meas 0).aemeasurable hψ.aestronglyMeasurable, S.law] filter_upwards [hslln] with ω hω unfold IIDSample.sampleMean simpa [hint, div_eq_mul_inv, mul_comm] using hω -
sampleSecondMoment_tendsto_aetheorem — Given an iid sample, a measurable observation statistic, and an integrable population square, the empirical second moment converges almost surely to the population second moment.hypothesesΩ :sharedType u_1X :sharedType u_2S :IIDSample Ω X μ Pψ :X → ℝhψ :hψ2 :Integrable (fun x ↦ (ψ x) ^ 2) PProof (Lean source)
theorem sampleSecondMoment_tendsto_ae (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : ∀ᵐ ω ∂μ, Tendsto (fun n ↦ S.sampleMean (fun x ↦ (ψ x) ^ 2) n ω) atTop (𝓝 (∫ x, (ψ x) ^ 2 ∂P)) := by haveI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable let g : X → ℝ := fun x ↦ (ψ x) ^ 2 have hg : Measurable g := hψ.pow_const 2 have hg_sample : Integrable (fun ω ↦ g (S.Z 0 ω)) μ := by have hmap : Integrable g (μ.map (S.Z 0)) := by simpa [S.law, g] using hψ2 exact hmap.comp_measurable (S.meas 0) have hindep : Pairwise (onFun (fun f₁ f₂ ↦ IndepFun f₁ f₂ μ) (fun i ω ↦ g (S.Z i ω))) := by have hi : iIndepFun (fun i ↦ g ∘ S.Z i) μ := S.indep.comp (fun _ ↦ g) (fun _ ↦ hg) intro i j hij exact hi.indepFun hij have hident : ∀ i, IdentDistrib (fun ω ↦ g (S.Z i ω)) (fun ω ↦ g (S.Z 0 ω)) μ μ := by intro i exact ((S.identDist i).symm.comp hg) have hslln := strong_law_ae_real (fun i ω ↦ g (S.Z i ω)) hg_sample hindep hident have hint : (∫ ω, g (S.Z 0 ω) ∂μ) = ∫ x, g x ∂P := by rw [← integral_map (S.meas 0).aemeasurable hg.aestronglyMeasurable, S.law] filter_upwards [hslln] with ω hω unfold IIDSample.sampleMean simpa [g, hint, div_eq_mul_inv, mul_comm] using hω -
sampleSquaredTail_tendsto_aetheorem — Given an iid sample, a measurable observation statistic, and an integrable population square, all integer-threshold squared-tail sample averages converge on one common probability-one event.hypothesesΩ :sharedType u_1X :sharedType u_2S :IIDSample Ω X μ Pψ :X → ℝhψ :hψ2 :Integrable (fun x ↦ (ψ x) ^ 2) Pconclusion∀ᵐ ω ∂μ, ∀ M : ℕ, Tendsto (fun n ↦ S.sampleMean (squaredTail ψ M) n ω) atTop (𝓝 (∫ x, squaredTail ψ M x ∂P))Proof (Lean source)
theorem sampleSquaredTail_tendsto_ae (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : ∀ᵐ ω ∂μ, ∀ M : ℕ, Tendsto (fun n ↦ S.sampleMean (squaredTail ψ M) n ω) atTop (𝓝 (∫ x, squaredTail ψ M x ∂P)) := by haveI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable rw [ae_all_iff] intro M let g : X → ℝ := squaredTail ψ M have hg : Measurable g := by dsimp [g, squaredTail] exact (hψ.pow_const 2).mul (measurable_const.indicator (measurableSet_le measurable_const hψ.abs)) have hgint : Integrable g P := by refine Integrable.mono hψ2 hg.aestronglyMeasurable ?_ filter_upwards with x by_cases hx : (M : ℝ) ≤ |ψ x| · simp [g, squaredTail, hx] · simp [g, squaredTail, hx, sq_nonneg] have hg_sample : Integrable (fun ω ↦ g (S.Z 0 ω)) μ := by have hmap : Integrable g (μ.map (S.Z 0)) := by simpa [S.law] using hgint exact hmap.comp_measurable (S.meas 0) have hindep : Pairwise (onFun (fun f₁ f₂ ↦ IndepFun f₁ f₂ μ) (fun i ω ↦ g (S.Z i ω))) := by have hi : iIndepFun (fun i ↦ g ∘ S.Z i) μ := S.indep.comp (fun _ ↦ g) (fun _ ↦ hg) intro i j hij exact hi.indepFun hij have hident : ∀ i, IdentDistrib (fun ω ↦ g (S.Z i ω)) (fun ω ↦ g (S.Z 0 ω)) μ μ := by intro i exact ((S.identDist i).symm.comp hg) have hslln := strong_law_ae_real (fun i ω ↦ g (S.Z i ω)) hg_sample hindep hident have hint : (∫ ω, g (S.Z 0 ω) ∂μ) = ∫ x, g x ∂P := by rw [← integral_map (S.meas 0).aemeasurable hg.aestronglyMeasurable, S.law] filter_upwards [hslln] with ω hω unfold IIDSample.sampleMean simpa [g, hint, div_eq_mul_inv, mul_comm] using hω -
empiricalVar_tendsto_aetheorem — Given an iid sample, a measurable observation statistic, and an integrable population square, the plug-in empirical variance converges almost surely to the population variance.hypothesesΩ :sharedType u_1X :sharedType u_2S :IIDSample Ω X μ Pψ :X → ℝhψ :hψ2 :Integrable (fun x ↦ (ψ x) ^ 2) PProof (Lean source)
theorem empiricalVar_tendsto_ae (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : ∀ᵐ ω ∂μ, Tendsto (fun n ↦ S.empiricalVar ψ n ω) atTop (𝓝 (variance ψ P)) := by haveI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable have hmem : MemLp ψ 2 P := (memLp_two_iff_integrable_sq hψ.aestronglyMeasurable).2 hψ2 filter_upwards [sampleMean_tendsto_ae S ψ hψ hψ2, sampleSecondMoment_tendsto_ae S ψ hψ hψ2] with ω hmean hsecond rw [variance_eq_sub hmem] exact hsecond.sub (hmean.pow 2)
Main 2 core · 3 supporting This module formalizes the same-size specialization of the Bickel--Freedman mean result: the observed sample and the Efron resample both have size n. ★ bootstrapMeanLaw_tendsto_gaussian_ae★ bootstrapMeanLaw_cdfKolmogorov_samplingMeanLaw_tendsto_ae
Same-size Bickel--Freedman consistency for the Efron bootstrap mean
This module formalizes the same-size specialization of the Bickel--Freedman mean result: the
observed sample and the Efron resample both have size n. For a measurable real statistic of iid
observations with a finite second moment, the conditional bootstrap distribution of the centered
root-sample-size mean converges almost surely to the centered Gaussian with the population
variance. At positive variance it is also uniformly close, in Kolmogorov distance, to the true
finite-sample distribution. The final declarations specialize the result to real-valued
observations and the identity statistic.
Given an iid sample, a measurable observation statistic, and an integrable population square, the conditional Efron-bootstrap law of the square-root-scaled centered mean converges almost surely to the centered Gaussian with the population variance.
Formal statement
Proof (Lean source)
Given an iid sample, a measurable observation statistic, an integrable population square, and strictly positive population variance, the conditional bootstrap and sampling laws approach one another almost surely in Kolmogorov distance.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
samplingMeanLaw_tendsto_gaussiantheorem — Given an iid sample, a measurable observation statistic, and an integrable population square, the sampling laws of the square-root-scaled centered sample mean converge to the centered Gaussian with the population variance.hypothesesΩ :sharedType u_1X :sharedType u_2S :IIDSample Ω X μ Pψ :X → ℝhψ :hψ2 :Integrable (fun x ↦ (ψ x) ^ 2) PconclusionTendsto (samplingMeanLaw S ψ hψ) atTop (𝓝 (⟨gaussianReal 0 (populationVariance ψ P), inferInstance⟩ : ProbabilityMeasure ℝ))Proof (Lean source)
theorem samplingMeanLaw_tendsto_gaussian (S : IIDSample Ω X μ P) (ψ : X → ℝ) (hψ : Measurable ψ) (hψ2 : Integrable (fun x ↦ (ψ x) ^ 2) P) : Tendsto (samplingMeanLaw S ψ hψ) atTop (𝓝 (⟨gaussianReal 0 (populationVariance ψ P), inferInstance⟩ : ProbabilityMeasure ℝ)) := by letI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable have hψmem : MemLp ψ 2 P := (memLp_two_iff_integrable_sq hψ.aestronglyMeasurable).2 hψ2 have hZ0 : MeasurePreserving (S.Z 0) μ P := ⟨S.meas 0, S.law⟩ have hmem : MemLp (ψ ∘ S.Z 0) 2 μ := hψmem.comp_measurePreserving hZ0 have hindep : iIndepFun (fun i ↦ ψ ∘ S.Z i) μ := S.indep.comp (fun _ ↦ ψ) (fun _ ↦ hψ) have hident : ∀ i, IdentDistrib (ψ ∘ S.Z i) (ψ ∘ S.Z 0) μ μ := by intro i exact (S.identDist i).symm.comp hψ have hint : ∫ ω, ψ (S.Z 0 ω) ∂μ = ∫ x, ψ x ∂P := by rw [← integral_map (S.meas 0).aemeasurable hψ.aestronglyMeasurable, S.law] have hvar : variance (ψ ∘ S.Z 0) μ = variance ψ P := by apply IdentDistrib.variance_eq refine ⟨(hψ.comp (S.meas 0)).aemeasurable, hψ.aemeasurable, ?_⟩ rw [← Measure.map_map hψ (S.meas 0), S.law] let G : ProbabilityMeasure ℝ := ⟨gaussianReal 0 (populationVariance ψ P), inferInstance⟩ have hG : HasLaw id (gaussianReal 0 (variance (ψ ∘ S.Z 0) μ).toNNReal) (G : Measure ℝ) := by simpa [G, populationVariance, hvar] using (HasLaw.id (μ := (G : Measure ℝ))) have hclt := tendstoInDistribution_inv_sqrt_mul_sum_sub (X := fun i ↦ ψ ∘ S.Z i) (P := μ) (P' := (G : Measure ℝ)) (Y := id) hG hmem hindep hident have heq : (fun n : ℕ ↦ (⟨μ.map (fun ω ↦ (sqrt (n : ℝ))⁻¹ * (∑ k ∈ range n, (ψ ∘ S.Z k) ω - (n : ℝ) * ∫ x, (ψ ∘ S.Z 0) x ∂μ)), Measure.isProbabilityMeasure_map (by fun_prop)⟩ : ProbabilityMeasure ℝ)) =ᶠ[atTop] samplingMeanLaw S ψ hψ := by filter_upwards with n apply ProbabilityMeasure.toMeasure_injective simp only [samplingMeanLaw, ProbabilityMeasure.coe_mk] congr 1 funext ω unfold IIDSample.sampleMean simp only [Function.comp_apply] rw [hint] by_cases hn : n = 0 · subst n simp · have hnR : (n : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hn have hsqrt : sqrt (n : ℝ) ≠ 0 := Real.sqrt_ne_zero'.mpr (Nat.cast_pos.mpr (Nat.pos_of_ne_zero hn)) field_simp rw [Real.sq_sqrt (Nat.cast_nonneg n)] have ht := hclt.tendsto.congr' heq have hmap : (⟨Measure.map id (G : Measure ℝ), Measure.isProbabilityMeasure_map (by fun_prop)⟩ : ProbabilityMeasure ℝ) = G := by apply ProbabilityMeasure.toMeasure_injective exact Measure.map_id rw [hmap] at ht change Tendsto (samplingMeanLaw S ψ hψ) atTop (𝓝 G) exact ht -
bootstrapRealMeanLaw_tendsto_gaussian_aetheorem — Given an iid sample of real observations whose population square is integrable, the Efron-bootstrap law of its centered mean converges almost surely to the centered Gaussian with the population variance.hypothesesconclusion∀ᵐ ω ∂μ, Tendsto (fun n ↦ bootstrapMeanLaw S id measurable_id n ω) atTop (𝓝 (⟨gaussianReal 0 (populationVariance id P), inferInstance⟩ : ProbabilityMeasure ℝ))Proof (Lean source)
theorem bootstrapRealMeanLaw_tendsto_gaussian_ae {P : Measure ℝ} (S : IIDSample Ω ℝ μ P) (hX2 : Integrable (fun x : ℝ ↦ x ^ 2) P) : ∀ᵐ ω ∂μ, Tendsto (fun n ↦ bootstrapMeanLaw S id measurable_id n ω) atTop (𝓝 (⟨gaussianReal 0 (populationVariance id P), inferInstance⟩ : ProbabilityMeasure ℝ)) := by exact bootstrapMeanLaw_tendsto_gaussian_ae S id measurable_id hX2 -
bootstrapRealMeanLaw_cdfKolmogorov_samplingMeanLaw_tendsto_aetheorem — Given an iid sample of real observations with an integrable population square and strictly positive population variance, the Efron-bootstrap and sampling laws of the centered mean approach one another almost surely in Kolmogorov distance.hypothesesconclusion∀ᵐ ω ∂μ, Tendsto (fun n ↦ cdfKolmogorov (bootstrapMeanLaw S id measurable_id n ω) (samplingMeanLaw S id measurable_id n)) atTop (𝓝 0)Proof (Lean source)
theorem bootstrapRealMeanLaw_cdfKolmogorov_samplingMeanLaw_tendsto_ae {P : Measure ℝ} (S : IIDSample Ω ℝ μ P) (hX2 : Integrable (fun x : ℝ ↦ x ^ 2) P) (hvar : 0 < variance id P) : ∀ᵐ ω ∂μ, Tendsto (fun n ↦ cdfKolmogorov (bootstrapMeanLaw S id measurable_id n ω) (samplingMeanLaw S id measurable_id n)) atTop (𝓝 0) := by exact bootstrapMeanLaw_cdfKolmogorov_samplingMeanLaw_tendsto_ae S id measurable_id hX2 hvar