Stat.SampleSplit
Sample splitting and cross-fitting: fold structures, split σ-algebras, and the independence facts they deliver.
OneShot 4 core · 3 supporting This file defines a two-fold split of an i.i.d. ★ folds_indep
One-Shot Sample Splits
This file defines a two-fold split of an i.i.d. sample into a nuisance-estimation fold and a target-estimation fold, with both folds growing without bound. It proves the finite-sample independence of the two fold-indexed sample tuples, which is the basic splitting fact used in debiased estimation.
One-shot sample split. For an i.i.d. sample S, a fold-size schedule n₁ : ℕ → ℕ splitting the sample of size n into a nuisance fold and an estimation fold , where the nuisance fold never exceeds the full sample, , the nuisance fold grows without bound, and the estimation fold also grows without bound, .
Nuisance-fold index set at horizon n: A(n) := {0, …, n₁(n)−1}.
Estimation-fold index set at horizon n: B(n) := {n₁(n), …, n−1}.
Independence of folds. For a fixed sample size n, the sample sub-tuple indexed by the nuisance fold A(n) is independent, under μ, of the sub-tuple indexed by the estimation fold B(n).
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
foldB_cardlemma — Cardinality of the estimation fold: |B(n)| = n - n₁(n).hypothesesn :ℕconclusion(split.foldB n).card = n - split.n₁ nProof (Lean source)
lemma foldB_card (n : ℕ) : (split.foldB n).card = n - split.n₁ n := by have hfoldB_eq : split.foldB n = Ico (split.n₁ n) n := by ext i simp [OneShotSplit.foldB, Finset.mem_Ico, and_comm] rw [hfoldB_eq] exact Nat.card_Ico (split.n₁ n) n -
foldA_disjoint_foldBlemma — Fold-A and fold-B index sets are disjoint.Proof (Lean source)
lemma foldA_disjoint_foldB (n : ℕ) : Disjoint (split.foldA n) (split.foldB n) := by rw [foldA, foldB] refine Finset.disjoint_left.mpr ?_ intro i hiA hiB simp only [Finset.mem_range, mem_filter] at hiA hiB have hnot : ¬ split.n₁ n ≤ i := Nat.not_le_of_gt hiA exact hnot hiB.2
KFold 3 core · 1 supporting This file defines \(K\)-fold sample-splitting schedules for an i.i.d. ★ folds_indep
K-Fold Sample Splits
This file defines -fold sample-splitting schedules for an i.i.d. sample, including disjointness, coverage, fold growth, and limiting fold proportions. It also proves that each evaluation fold is independent of its training complement, supporting cross-fitted estimation procedures.
K-fold sample split. For an i.i.d. sample S, a schedule assigning each sample size n and fold index k a finite index set fold n k, forming a K-fold cross-fitting scheme in which distinct folds are pairwise disjoint at every sample size, the K folds together cover the full index set , every fold grows without bound as , and each fold's share of the sample converges to .
Definition (Lean source)
The training complement of fold k at sample size n: {0, …, n-1} \ fold(n, k).
Definition (Lean source)
Independence of evaluation fold and training complement. For a fixed sample size n and fold index k, the sample sub-tuple indexed by the evaluation fold is independent, under μ, of the sub-tuple indexed by the training complement.
Formal statement
1 supporting declaration (lemmas, instances)
-
fold_disjoint_trainComplementlemma — The evaluation fold is disjoint from its training complement.Proof (Lean source)
lemma fold_disjoint_trainComplement (n : ℕ) (k : Fin K) : Disjoint (split.fold n k) (split.trainComplement n k) := by rw [trainComplement] refine Finset.disjoint_left.mpr ?_ intro i hi hi' exact (Finset.mem_sdiff.mp hi').2 hi
FiniteCategoryPilot 6 core · 8 supporting 6 to review This module controls threshold selection from finite-category counts on an arbitrary finite block of iid pilot observations. ★ finiteCategoryPilot_bad_probability
Finite-category counts on arbitrary IID pilot blocks
This module controls threshold selection from finite-category counts on an arbitrary finite block of iid pilot observations. Its simultaneous good event ensures that selected categories have enough population mass while rejected categories have no more than a supplied upper mass band.
The file provides measurable counts, cellwise tilted Chernoff bounds, and a cardinality-explicit union bound. Empty coordinate blocks and empty category types remain totalized.
A category's population mass is the probability that the observation's label equals that category, represented as a real number.
A category indicator is one when an observation has the designated label and zero otherwise.
Definition (Lean source)
A pilot category count is the number of coordinates in a chosen finite block whose observed label equals the designated category.
Definition (Lean source)
Pilot thresholding selects exactly the categories whose finite-block count is strictly larger than the threshold.
Definition (Lean source)
The finite-category pilot good event requires every selected category to have at least the lower population-mass band and every rejected category to have at most the upper band.
Definition (Lean source)
Given an iid sample, a measurable category label, a finite pilot block, a positive selection threshold, a lower population-mass band, an upper population-mass band, an upper-tail exponential tilt, a lower-tail exponential tilt, nonnegativity of the upper-tail tilt, and nonpositivity of the lower-tail tilt, failure of the simultaneous category-mass sandwich has probability at most the number of categories times the sum of the two explicit Chernoff tails. The bound also covers empty blocks and empty category types.
Formal statement
Proof (Lean source)
8 supporting declarations (lemmas, instances)
-
measurable_categoryIndicatorlemma — Given a measurable category label and a fixed category, the corresponding zero-one category indicator is measurable.hypothesesconclusionMeasurable (categoryIndicator label k)Proof (Lean source)
lemma measurable_categoryIndicator [DecidableEq Iota] [MeasurableSingletonClass Iota] {label : X -> Iota} (hlabel : Measurable label) (k : Iota) : Measurable (categoryIndicator label k) := by unfold categoryIndicator exact measurable_const.ite (hlabel (measurableSet_singleton k)) measurable_const -
integral_categoryIndicatorlemma — Given a measurable category label and a fixed category, the mean of its zero-one indicator under a probability law equals the category's population mass.hypothesesconclusion∫ x, categoryIndicator label k x ∂P = categoryMass P label kProof (Lean source)
lemma integral_categoryIndicator [DecidableEq Iota] [MeasurableSingletonClass Iota] [IsProbabilityMeasure P] {label : X -> Iota} (hlabel : Measurable label) (k : Iota) : ∫ x, categoryIndicator label k x ∂P = categoryMass P label k := by rw [show categoryIndicator label k = (label ⁻¹' {k}).indicator (fun _ => (1 : Real)) by funext x by_cases hx : label x = k <;> simp [categoryIndicator, hx]] rw [integral_indicator (hlabel (measurableSet_singleton k)), integral_const] simp [categoryMass] -
measurable_pilotCategoryCountlemma — Given an iid sample, a measurable category label, a finite coordinate block, and a fixed category, the pilot count of that category is measurable.hypothesesconclusionMeasurable (pilotCategoryCount S label block k)Proof (Lean source)
lemma measurable_pilotCategoryCount [DecidableEq Iota] [MeasurableSingletonClass Iota] (S : IIDSample Omega X mu P) {label : X -> Iota} (hlabel : Measurable label) (block : Finset Nat) (k : Iota) : Measurable (pilotCategoryCount S label block k) := by induction block using Finset.induction_on with | empty => unfold pilotCategoryCount exact measurable_const | @insert j block hj ih => have hset : MeasurableSet {omega | label (S.Z j omega) = k} := (hlabel.comp (S.meas j)) (measurableSet_singleton k) unfold pilotCategoryCount at ih have hsucc : Measurable (fun omega => (block.filter (fun i => label (S.Z i omega) = k)).card + 1) := ih.add measurable_const unfold pilotCategoryCount have heq : (fun omega => ((insert j block).filter (fun i => label (S.Z i omega) = k)).card) = fun omega => if label (S.Z j omega) = k then (block.filter (fun i => label (S.Z i omega) = k)).card + 1 else (block.filter (fun i => label (S.Z i omega) = k)).card := by funext omega by_cases h : label (S.Z j omega) = k · rw [Finset.filter_insert] simp [h, Finset.card_insert_of_notMem, hj] · rw [Finset.filter_insert] simp [h] rw [heq] exact hsucc.ite hset ih -
pilotCategoryCount_cast_eq_sumlemma — Given an iid sample, a category label, a finite coordinate block, a category, and a sample outcome, the real-valued pilot count equals the sum of category indicators over the block.hypothesesconclusion(pilotCategoryCount S label block k omega : Real)= ∑ j ∈ block, categoryIndicator label k (S.Z j omega)Proof (Lean source)
lemma pilotCategoryCount_cast_eq_sum [DecidableEq Iota] (S : IIDSample Omega X mu P) (label : X -> Iota) (block : Finset Nat) (k : Iota) (omega : Omega) : (pilotCategoryCount S label block k omega : Real) = ∑ j ∈ block, categoryIndicator label k (S.Z j omega) := by simp only [pilotCategoryCount, categoryIndicator, Finset.card_filter, Nat.cast_sum, Nat.cast_ite, cast_one, cast_zero] -
pilotCategoryCount_upper_tail_of_tilttheorem — Given an iid sample, a measurable category label, a finite pilot block, a fixed category, an upper bound on that category's population mass, an exponential tilt, and nonnegativity of the tilt, the probability that the category count exceeds the specified level is bounded by the corresponding Chernoff exponent.hypothesesDecidableEq Iotalabel :X -> Iotahlabel :Measurable labelk :Iotap a :hmass :categoryMass P label k ≤ ps :hs :0 ≤ sProof (Lean source)
theorem pilotCategoryCount_upper_tail_of_tilt [DecidableEq Iota] [MeasurableSingletonClass Iota] (S : IIDSample Omega X mu P) {label : X -> Iota} (hlabel : Measurable label) (block : Finset Nat) (k : Iota) {p a : Real} (hmass : categoryMass P label k ≤ p) (s : Real) (hs : 0 ≤ s) : mu.real {omega | a < (pilotCategoryCount S label block k omega : Real)} ≤ exp (-s * a + (block.card : Real) * (p * (exp s - 1))) := by /- Repeat the bounded-count MGF proof from `BinomialCount` over `block` instead of `range m`: the composed indicators are independent by `S.indep.comp`, each has mean `categoryMass`, and `iIndepFun.mgf_sum` tensorizes the MGF. Finish with `measure_ge_le_exp_mul_mgf`. -/ haveI : IsProbabilityMeasure mu := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.map_eq 0] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable let Xk : Nat -> Omega -> Real := fun j => categoryIndicator label k ∘ S.Z j have hindicator : Measurable (categoryIndicator label k) := measurable_categoryIndicator hlabel k have hXk_meas : ∀ j, Measurable (Xk j) := fun j => hindicator.comp (S.meas j) have hXk_indep : iIndepFun Xk mu := S.indep.comp (fun _ => categoryIndicator label k) (fun _ => hindicator) have h01 : ∀ x, categoryIndicator label k x ∈ Icc (0 : Real) 1 := by intro x by_cases hx : label x = k <;> simp [categoryIndicator, hx] have hmgf_one : ∀ j, mgf (Xk j) mu s ≤ exp (categoryMass P label k * (exp s - 1)) := by intro j rw [← mgf_map (S.meas j).aemeasurable (by fun_prop), S.map_eq] rw [← integral_categoryIndicator hlabel k] exact mgf_le_of_mem_Icc_zero_one hindicator.aemeasurable (ae_of_all _ h01) s have hsum : (fun omega => (pilotCategoryCount S label block k omega : Real)) = ∑ j ∈ block, Xk j := by funext omega simpa [Xk, Function.comp_apply] using pilotCategoryCount_cast_eq_sum S label block k omega have hmgf_base : mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s ≤ exp ((block.card : Real) * (categoryMass P label k * (exp s - 1))) := by rw [hsum, hXk_indep.mgf_sum hXk_meas] calc (∏ j ∈ block, mgf (Xk j) mu s) ≤ ∏ _j ∈ block, exp (categoryMass P label k * (exp s - 1)) := Finset.prod_le_prod (fun j _ => mgf_nonneg) (fun j _ => hmgf_one j) _ = exp ((block.card : Real) * (categoryMass P label k * (exp s - 1))) := by rw [Finset.prod_const, ← Real.exp_nat_mul] have hcoef : 0 ≤ exp s - 1 := by linarith [Real.one_le_exp hs] have hmgf : mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s ≤ exp ((block.card : Real) * (p * (exp s - 1))) := hmgf_base.trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hmass hcoef) (Nat.cast_nonneg block.card))) have hcount_meas : Measurable (fun omega => (pilotCategoryCount S label block k omega : Real)) := by rw [hsum] convert (Finset.measurable_fun_sum block fun j _ => hXk_meas j) using 1 ext omega simp have hcount_le : ∀ omega, (pilotCategoryCount S label block k omega : Real) ≤ (block.card : Real) := by intro omega exact_mod_cast Finset.card_filter_le block (fun j => label (S.Z j omega) = k) have hint : Integrable (fun omega => exp (s * (pilotCategoryCount S label block k omega : Real))) mu := by refine Integrable.of_bound (hcount_meas.const_mul _ |>.exp.aestronglyMeasurable) (exp (s * block.card)) (ae_of_all _ fun omega => ?_) rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] exact Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (hcount_le omega) hs) calc mu.real {omega | a < (pilotCategoryCount S label block k omega : Real)} ≤ mu.real {omega | a ≤ (pilotCategoryCount S label block k omega : Real)} := measureReal_mono (by intro omega homega change a < (pilotCategoryCount S label block k omega : Real) at homega exact homega.le) _ ≤ exp (-s * a) * mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s := measure_ge_le_exp_mul_mgf a hs hint _ ≤ exp (-s * a) * exp ((block.card : Real) * (p * (exp s - 1))) := mul_le_mul_of_nonneg_left hmgf (Real.exp_pos _).le _ = exp (-s * a + (block.card : Real) * (p * (exp s - 1))) := (Real.exp_add _ _).symm -
pilotCategoryCount_lower_tail_of_tilttheorem — Given an iid sample, a measurable category label, a finite pilot block, a fixed category, a lower bound on that category's population mass, an exponential tilt, and nonpositivity of the tilt, the probability that the category count is at most the specified level is bounded by the corresponding Chernoff exponent.hypothesesDecidableEq Iotalabel :X -> Iotahlabel :Measurable labelk :Iotap a :hmass :p ≤ categoryMass P label ks :hs :s ≤ 0Proof (Lean source)
theorem pilotCategoryCount_lower_tail_of_tilt [DecidableEq Iota] [MeasurableSingletonClass Iota] (S : IIDSample Omega X mu P) {label : X -> Iota} (hlabel : Measurable label) (block : Finset Nat) (k : Iota) {p a : Real} (hmass : p ≤ categoryMass P label k) (s : Real) (hs : s ≤ 0) : mu.real {omega | (pilotCategoryCount S label block k omega : Real) ≤ a} ≤ exp (-s * a + (block.card : Real) * (p * (exp s - 1))) := by /- Use the same finite-block MGF tensorization at a nonpositive tilt. Since `exp s - 1 ≤ 0`, replace the true category mass by its lower bound `p`, then apply `measure_le_le_exp_mul_mgf`. -/ haveI : IsProbabilityMeasure mu := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.map_eq 0] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable let Xk : Nat -> Omega -> Real := fun j => categoryIndicator label k ∘ S.Z j have hindicator : Measurable (categoryIndicator label k) := measurable_categoryIndicator hlabel k have hXk_meas : ∀ j, Measurable (Xk j) := fun j => hindicator.comp (S.meas j) have hXk_indep : iIndepFun Xk mu := S.indep.comp (fun _ => categoryIndicator label k) (fun _ => hindicator) have h01 : ∀ x, categoryIndicator label k x ∈ Icc (0 : Real) 1 := by intro x by_cases hx : label x = k <;> simp [categoryIndicator, hx] have hmgf_one : ∀ j, mgf (Xk j) mu s ≤ exp (categoryMass P label k * (exp s - 1)) := by intro j rw [← mgf_map (S.meas j).aemeasurable (by fun_prop), S.map_eq] rw [← integral_categoryIndicator hlabel k] exact mgf_le_of_mem_Icc_zero_one hindicator.aemeasurable (ae_of_all _ h01) s have hsum : (fun omega => (pilotCategoryCount S label block k omega : Real)) = ∑ j ∈ block, Xk j := by funext omega simpa [Xk, Function.comp_apply] using pilotCategoryCount_cast_eq_sum S label block k omega have hmgf_base : mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s ≤ exp ((block.card : Real) * (categoryMass P label k * (exp s - 1))) := by rw [hsum, hXk_indep.mgf_sum hXk_meas] calc (∏ j ∈ block, mgf (Xk j) mu s) ≤ ∏ _j ∈ block, exp (categoryMass P label k * (exp s - 1)) := Finset.prod_le_prod (fun j _ => mgf_nonneg) (fun j _ => hmgf_one j) _ = exp ((block.card : Real) * (categoryMass P label k * (exp s - 1))) := by rw [Finset.prod_const, ← Real.exp_nat_mul] have hcoef : exp s - 1 ≤ 0 := by linarith [Real.exp_le_one_iff.mpr hs] have hmgf : mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s ≤ exp ((block.card : Real) * (p * (exp s - 1))) := hmgf_base.trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonpos_right hmass hcoef) (Nat.cast_nonneg block.card))) have hcount_meas : Measurable (fun omega => (pilotCategoryCount S label block k omega : Real)) := by rw [hsum] convert (Finset.measurable_fun_sum block fun j _ => hXk_meas j) using 1 ext omega simp have hcount_nonneg : ∀ omega, 0 ≤ (pilotCategoryCount S label block k omega : Real) := fun _ => Nat.cast_nonneg _ have hint : Integrable (fun omega => exp (s * (pilotCategoryCount S label block k omega : Real))) mu := by refine Integrable.of_bound (hcount_meas.const_mul _ |>.exp.aestronglyMeasurable) 1 (ae_of_all _ fun omega => ?_) rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] calc exp (s * (pilotCategoryCount S label block k omega : Real)) ≤ exp 0 := Real.exp_le_exp.mpr (mul_nonpos_of_nonpos_of_nonneg hs (hcount_nonneg omega)) _ = 1 := Real.exp_zero calc mu.real {omega | (pilotCategoryCount S label block k omega : Real) ≤ a} ≤ exp (-s * a) * mgf (fun omega => (pilotCategoryCount S label block k omega : Real)) mu s := measure_le_le_exp_mul_mgf a hs hint _ ≤ exp (-s * a) * exp ((block.card : Real) * (p * (exp s - 1))) := mul_le_mul_of_nonneg_left hmgf (Real.exp_pos _).le _ = exp (-s * a + (block.card : Real) * (p * (exp s - 1))) := (Real.exp_add _ _).symm -
measurableSet_finiteCategoryPilotGoodlemma — Given an iid sample, a measurable category label, a finite pilot block, a selection threshold, a lower mass band, and an upper mass band, the simultaneous finite-category pilot good event is measurable.hypothesesconclusionMeasurableSet (finiteCategoryPilotGood S label block t lowerBand upperBand)Proof (Lean source)
lemma measurableSet_finiteCategoryPilotGood [Fintype Iota] [DecidableEq Iota] [MeasurableSingletonClass Iota] (S : IIDSample Omega X mu P) {label : X -> Iota} (hlabel : Measurable label) (block : Finset Nat) (t lowerBand upperBand : Real) : MeasurableSet (finiteCategoryPilotGood S label block t lowerBand upperBand) := by classical have hcount : ∀ k, Measurable (fun omega => (pilotCategoryCount S label block k omega : Real)) := fun k => MeasurableEmbedding.natCast.measurable.comp (measurable_pilotCategoryCount S hlabel block k) rw [show finiteCategoryPilotGood S label block t lowerBand upperBand = (⋂ k, {omega | t < (pilotCategoryCount S label block k omega : Real) -> lowerBand ≤ categoryMass P label k}) ∩ (⋂ k, {omega | (pilotCategoryCount S label block k omega : Real) ≤ t -> categoryMass P label k ≤ upperBand}) by ext omega simp [finiteCategoryPilotGood, pilotSelected]] apply MeasurableSet.inter · apply MeasurableSet.iInter intro k by_cases hk : lowerBand ≤ categoryMass P label k · simpa [hk] using (MeasurableSet.univ : MeasurableSet (Set.univ : Set Omega)) · simpa [hk, not_lt] using measurableSet_le (hcount k) measurable_const · apply MeasurableSet.iInter intro k by_cases hk : categoryMass P label k ≤ upperBand · simpa [hk] using (MeasurableSet.univ : MeasurableSet (Set.univ : Set Omega)) · simpa [hk, not_le] using measurableSet_lt measurable_const (hcount k) -
finiteCategoryPilot_bad_probability_log_twotheorem — Given an iid sample, a measurable category label, a finite pilot block, a positive selection threshold, a lower population-mass band, and an upper population-mass band, the simultaneous category-mass sandwich failure probability obeys the explicit bound obtained from opposite logarithmic tilts of magnitude log two.hypothesesFintype IotaDecidableEq Iotalabel :X -> Iotahlabel :Measurable labelt :ht :0 < tlowerBand upperBand :Proof (Lean source)
theorem finiteCategoryPilot_bad_probability_log_two [Fintype Iota] [DecidableEq Iota] [MeasurableSingletonClass Iota] (S : IIDSample Omega X mu P) {label : X -> Iota} (hlabel : Measurable label) (block : Finset Nat) {t : Real} (ht : 0 < t) (lowerBand upperBand : Real) : mu.real (finiteCategoryPilotGood S label block t lowerBand upperBand)ᶜ ≤ (Fintype.card Iota : Real) * (exp (-log 2 * t + (block.card : Real) * lowerBand) + exp (log 2 * t - (block.card : Real) * upperBand / 2)) := by have hlog : 0 ≤ log (2 : Real) := (Real.log_pos (by norm_num)).le have h := finiteCategoryPilot_bad_probability S hlabel block ht lowerBand upperBand (log 2) (-log 2) hlog (neg_nonpos.mpr hlog) have hexp_pos : exp (log 2) = (2 : Real) := Real.exp_log (by norm_num) have hexp_neg : exp (-log 2) = (1 / 2 : Real) := by rw [Real.exp_neg, hexp_pos] norm_num convert h using 1 <;> rw [hexp_pos, hexp_neg] <;> ring
FiniteSelector 2 core · 8 supporting 2 to review This module transfers uniform squared-risk bounds through a finite branch chosen from an independent pilot sample. ★ integral_finiteSelector_sq_le
Finite pilot-selected L2 transfer
This module transfers uniform squared-risk bounds through a finite branch chosen from an independent pilot sample. It also bounds the full risk after a controlled bad pilot event and supplies the corresponding one-shot iid split bridge.
The construction expands the selected risk over measurable selector cells and uses independence to factor each cell probability from its fixed-branch tail risk. The statements are neutral about the meaning of the branches and sample coordinates.
The selector cell for a branch is the part of a designated pilot event on which a finite-valued selection rule chooses that branch.
Definition (Lean source)
If pilot and tail coordinates are independent, the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, the designated pilot event is measurable, the common risk bound is nonnegative, every branch selected on that event is eligible, eligible branches have integrable squared tail error, and their fixed-branch risks obey the common bound, the pilot-selected risk on the event obeys that same bound.
Formal statement
Proof (Lean source)
8 supporting declarations (lemmas, instances)
-
measurableSet_selectorCelllemma — When the selection rule is measurable, the designated pilot event is measurable, and a branch is fixed, its selector cell is measurable.hypothesesselect :Alpha -> Iotahselect :Measurable selectgood :Set Alphahgood :MeasurableSet goodi :IotaconclusionMeasurableSet (selectorCell select good i)Proof (Lean source)
lemma measurableSet_selectorCell [MeasurableSingletonClass Iota] {select : Alpha -> Iota} (hselect : Measurable select) {good : Set Alpha} (hgood : MeasurableSet good) (i : Iota) : MeasurableSet (selectorCell select good i) := by exact hgood.inter (hselect (measurableSet_singleton i)) -
measurable_finiteSelector_applylemma — When finite branch selection is measurable and each branch-specific error is measurable, evaluating the selected error on a pilot-tail pair is measurable.hypothesesFintype Iotaselect :Alpha -> Iotahselect :Measurable selecterr :Iota -> Beta -> Realherr :∀ i, Measurable (err i)conclusionMeasurable (fun z : Alpha × Beta => err (select z.1) z.2)Proof (Lean source)
lemma measurable_finiteSelector_apply [Fintype Iota] [MeasurableSingletonClass Iota] {select : Alpha -> Iota} (hselect : Measurable select) {err : Iota -> Beta -> Real} (herr : ∀ i, Measurable (err i)) : Measurable (fun z : Alpha × Beta => err (select z.1) z.2) := by classical let cell : Iota → Set (Alpha × Beta) := fun i => (fun z : Alpha × Beta => select z.1) ⁻¹' {i} have hcell : ∀ i, MeasurableSet (cell i) := fun i => (hselect.comp measurable_fst) (measurableSet_singleton i) have hsum : Measurable (fun z : Alpha × Beta => ∑ i : Iota, (cell i).indicator (fun z => err i z.2) z) := by exact measurable_sum univ fun i _ => ((herr i).comp measurable_snd).indicator (hcell i) convert hsum using 1 funext z simp only [cell, indicator, Set.mem_preimage, Set.mem_singleton_iff] simp -
measurable_finiteSelector_sqlemma — If the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, and every branch error is measurable, the selected squared error is measurable.hypothesesFintype Iotapilot :Omega -> Alphatail :Omega -> Betaselect :Alpha -> Iotaerr :Iota -> Beta -> Realhpilot :Measurable pilothtail :Measurable tailhselect :Measurable selectherr :∀ i, Measurable (err i)conclusionMeasurable (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2)Proof (Lean source)
lemma measurable_finiteSelector_sq [Fintype Iota] [MeasurableSingletonClass Iota] {pilot : Omega -> Alpha} {tail : Omega -> Beta} {select : Alpha -> Iota} {err : Iota -> Beta -> Real} (hpilot : Measurable pilot) (htail : Measurable tail) (hselect : Measurable select) (herr : ∀ i, Measurable (err i)) : Measurable (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2) := by exact ((measurable_finiteSelector_apply hselect herr).comp (hpilot.prodMk htail)).pow_const 2 -
integrable_finiteSelector_sqtheorem — If pilot and tail coordinates are independent, the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, and every fixed branch has integrable squared error under the tail law, the pilot-selected squared error is integrable under the ambient probability law.hypothesesFintype Iotamu :Measure Omegapilot :Omega -> Alphatail :Omega -> Betaselect :Alpha -> Iotaerr :Iota -> Beta -> Realhind :IndepFun pilot tail muhpilot :Measurable pilothtail :Measurable tailhselect :Measurable selectherr :∀ i, Integrable (fun b => (err i b) ^ 2) (mu.map tail)conclusionIntegrable (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2) muProof (Lean source)
theorem IndepFun.integrable_finiteSelector_sq [Fintype Iota] [MeasurableSingletonClass Iota] {mu : Measure Omega} [IsProbabilityMeasure mu] {pilot : Omega -> Alpha} {tail : Omega -> Beta} {select : Alpha -> Iota} {err : Iota -> Beta -> Real} (hind : IndepFun pilot tail mu) (hpilot : Measurable pilot) (htail : Measurable tail) (hselect : Measurable select) (herr : ∀ i, Integrable (fun b => (err i b) ^ 2) (mu.map tail)) : Integrable (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2) mu := by /- Expand over the measurable selector fibers. On each fiber, independence transports the branch integrability from `mu.map tail`; combine the finitely many restricted integrable functions. -/ classical let cell : Iota → Set Omega := fun i => pilot ⁻¹' (select ⁻¹' {i}) have hcell : ∀ i, MeasurableSet (cell i) := fun i => hpilot ((hselect (measurableSet_singleton i))) have hcover : (⋃ i, cell i) = univ := by ext omega simp [cell] rw [← integrableOn_univ, ← hcover, integrableOn_finite_iUnion] intro i have hi : Integrable (fun omega => (err i (tail omega)) ^ 2) mu := (herr i).comp_aemeasurable htail.aemeasurable refine hi.integrableOn.congr_fun ?_ (hcell i) intro omega homega have hsel : select (pilot omega) = i := homega simp [hsel] -
integral_finiteSelector_sq_eq_sumtheorem — If pilot and tail coordinates are independent, the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, the designated pilot event is measurable, and every fixed branch has integrable squared error under the tail law, the selected risk on that event equals the sum of each selector-cell probability times its fixed-branch tail risk.hypothesesFintype Iotamu :Measure Omegapilot :Omega -> Alphatail :Omega -> Betaselect :Alpha -> Iotaerr :Iota -> Beta -> Realhind :IndepFun pilot tail muhpilot :Measurable pilothtail :Measurable tailhselect :Measurable selectgood :Set Alphahgood :MeasurableSet goodherr :∀ i, Integrable (fun b => (err i b) ^ 2) (mu.map tail)conclusion∫ omega in pilot ⁻¹' good, (err (select (pilot omega)) (tail omega)) ^ 2 ∂mu= ∑ i : Iota, (mu (pilot ⁻¹' selectorCell select good i)).toReal * ∫ b, (err i b) ^ 2 ∂(mu.map tail)Proof (Lean source)
theorem IndepFun.integral_finiteSelector_sq_eq_sum [Fintype Iota] [MeasurableSingletonClass Iota] {mu : Measure Omega} [IsProbabilityMeasure mu] {pilot : Omega -> Alpha} {tail : Omega -> Beta} {select : Alpha -> Iota} {err : Iota -> Beta -> Real} (hind : IndepFun pilot tail mu) (hpilot : Measurable pilot) (htail : Measurable tail) (hselect : Measurable select) {good : Set Alpha} (hgood : MeasurableSet good) (herr : ∀ i, Integrable (fun b => (err i b) ^ 2) (mu.map tail)) : ∫ omega in pilot ⁻¹' good, (err (select (pilot omega)) (tail omega)) ^ 2 ∂mu = ∑ i : Iota, (mu (pilot ⁻¹' selectorCell select good i)).toReal * ∫ b, (err i b) ^ 2 ∂(mu.map tail) := by /- Integrability is essential here: without it, Lean's Bochner integral is zero for a non-integrable function, so finite additivity across selector cells can fail when one cell is non-integrable and another contributes a positive finite integral. Partition `pilot ⁻¹' good` by the disjoint selector fibers. On the `i`th fiber replace the selected branch pointwise by `err i`, apply `IndepFun.integral_restrict_preimage_eq_mul`, then rewrite the tail-composed integral with `integral_map`. -/ classical let F : Omega → Real := fun omega => (err (select (pilot omega)) (tail omega)) ^ 2 let cell : Iota → Set Omega := fun i => pilot ⁻¹' selectorCell select good i have hcell : ∀ i, MeasurableSet (cell i) := fun i => hpilot (measurableSet_selectorCell hselect hgood i) have hpair : Pairwise (onFun Disjoint cell) := by intro i j hij simp only [onFun] rw [Set.disjoint_left] intro omega hi hj exact hij (hi.2.symm.trans hj.2) have hcover : (⋃ i, cell i) = pilot ⁻¹' good := by ext omega simp [cell, selectorCell] have hInt : IntegrableOn F (pilot ⁻¹' good) mu := (IndepFun.integrable_finiteSelector_sq hind hpilot htail hselect herr).integrableOn have hsplit : ∫ omega in pilot ⁻¹' good, F omega ∂mu = ∑ i : Iota, ∫ omega in cell i, F omega ∂mu := by rw [← hcover] exact integral_iUnion_fintype hcell hpair fun i => hInt.mono_set (by rw [← hcover]; exact Set.subset_iUnion cell i) have hfactor : ∀ i : Iota, ∫ omega in cell i, F omega ∂mu = (mu (cell i)).toReal * ∫ b, (err i b) ^ 2 ∂(mu.map tail) := by intro i have hcongr : ∫ omega in cell i, F omega ∂mu = ∫ omega in cell i, (err i (tail omega)) ^ 2 ∂mu := by refine setIntegral_congr_fun (hcell i) ?_ intro omega homega simp only [F] rw [homega.2] rw [hcongr] have hdrop := hind.integral_restrict_preimage_eq_mul hpilot.aemeasurable htail.aemeasurable (measurableSet_selectorCell hselect hgood i) (hcell i) (herr i).aestronglyMeasurable rw [hdrop, integral_map htail.aemeasurable (herr i).aestronglyMeasurable] rw [show (∫ omega in pilot ⁻¹' good, (err (select (pilot omega)) (tail omega)) ^ 2 ∂mu) = ∫ omega in pilot ⁻¹' good, F omega ∂mu from rfl, hsplit] apply Finset.sum_congr rfl intro i _ exact hfactor i -
integrableOn_finiteSelector_sq_of_eligibletheorem — If the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, the designated pilot event is measurable, every branch selected there is eligible, and eligible branches have integrable squared error under the tail law, the selected squared error is integrable on that pilot event.hypothesesFintype Iotamu :Measure Omegapilot :Omega -> Alphatail :Omega -> Betaselect :Alpha -> Iotaerr :Iota -> Beta -> RealEligible :Iota -> Prophpilot :Measurable pilothtail :Measurable tailhselect :Measurable selectgood :Set Alphahgood :MeasurableSet goodhEligible :∀ a ∈ good, Eligible (select a)hbranchInt :∀ i, Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map tail)conclusionIntegrableOn (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2) (pilot ⁻¹' good) muProof (Lean source)
theorem integrableOn_finiteSelector_sq_of_eligible [Fintype Iota] [MeasurableSingletonClass Iota] {mu : Measure Omega} {pilot : Omega -> Alpha} {tail : Omega -> Beta} {select : Alpha -> Iota} {err : Iota -> Beta -> Real} {Eligible : Iota -> Prop} (hpilot : Measurable pilot) (htail : Measurable tail) (hselect : Measurable select) {good : Set Alpha} (hgood : MeasurableSet good) (hEligible : ∀ a ∈ good, Eligible (select a)) (hbranchInt : ∀ i, Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map tail)) : IntegrableOn (fun omega => (err (select (pilot omega)) (tail omega)) ^ 2) (pilot ⁻¹' good) mu := by /- Partition the good pullback into selector cells. An empty cell is integrable trivially. From a point in a nonempty ambient cell, its pilot value lies in the corresponding `selectorCell`; `hEligible` makes the branch eligible, and `hbranchInt` transported along `tail` gives ambient integrability. Replace the selected branch by that fixed branch on the cell and combine the finite union with `integrableOn_finite_iUnion`. -/ classical let cell : Iota → Set Omega := fun i => pilot ⁻¹' selectorCell select good i have hcell : ∀ i, MeasurableSet (cell i) := fun i => hpilot (measurableSet_selectorCell hselect hgood i) have hcover : (⋃ i, cell i) = pilot ⁻¹' good := by ext omega simp [cell, selectorCell] rw [← hcover, integrableOn_finite_iUnion] intro i by_cases hi_empty : cell i = ∅ · simp [hi_empty] · obtain ⟨omega, homega⟩ := Set.nonempty_iff_ne_empty.mpr hi_empty have hi_eligible : Eligible i := by have hsel : select (pilot omega) = i := homega.2 exact hsel ▸ hEligible (pilot omega) homega.1 have hi : Integrable (fun omega => (err i (tail omega)) ^ 2) mu := (hbranchInt i hi_eligible).comp_aemeasurable htail.aemeasurable refine hi.integrableOn.congr_fun ?_ (hcell i) intro omega homega change (err i (tail omega)) ^ 2 = (err (select (pilot omega)) (tail omega)) ^ 2 rw [homega.2] -
integral_finiteSelector_sq_le_add_badtheorem — If pilot and tail coordinates are independent, the pilot coordinate is measurable, the tail coordinate is measurable, the finite selection rule is measurable, all branch errors are measurable, the designated pilot event is measurable, the good-event risk bound is nonnegative, the global squared-error envelope is nonnegative, every branch selected on the good event is eligible, eligible branches have integrable squared tail error, their fixed-branch risks obey the good-event bound, the selected squared error obeys the global envelope, and the bad pilot event has probability at most the given tolerance, the full risk is at most the good-event bound plus the envelope times that tolerance.hypothesesFintype Iotamu :Measure Omegapilot :Omega -> Alphatail :Omega -> Betaselect :Alpha -> Iotaerr :Iota -> Beta -> RealEligible :Iota -> PropV H delta :hind :IndepFun pilot tail muhpilot :Measurable pilothtail :Measurable tailhselect :Measurable selectherr :∀ i, Measurable (err i)good :Set Alphahgood :MeasurableSet goodhV :0 ≤ VhH :0 ≤ HhEligible :∀ a ∈ good, Eligible (select a)hbranchInt :∀ i, Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map tail)hbranch :∀ i, Eligible i -> ∫ b, (err i b) ^ 2 ∂(mu.map tail) ≤ Vhbounded :∀ omega, (err (select (pilot omega)) (tail omega)) ^ 2 ≤ Hhbad :mu.real (pilot ⁻¹' goodᶜ) ≤ deltaconclusion∫ omega, (err (select (pilot omega)) (tail omega)) ^ 2 ∂mu ≤ V + H * deltaProof (Lean source)
theorem IndepFun.integral_finiteSelector_sq_le_add_bad [Fintype Iota] [MeasurableSingletonClass Iota] {mu : Measure Omega} [IsProbabilityMeasure mu] {pilot : Omega -> Alpha} {tail : Omega -> Beta} {select : Alpha -> Iota} {err : Iota -> Beta -> Real} {Eligible : Iota -> Prop} {V H delta : Real} (hind : IndepFun pilot tail mu) (hpilot : Measurable pilot) (htail : Measurable tail) (hselect : Measurable select) (herr : ∀ i, Measurable (err i)) {good : Set Alpha} (hgood : MeasurableSet good) (hV : 0 ≤ V) (hH : 0 ≤ H) (hEligible : ∀ a ∈ good, Eligible (select a)) (hbranchInt : ∀ i, Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map tail)) (hbranch : ∀ i, Eligible i -> ∫ b, (err i b) ^ 2 ∂(mu.map tail) ≤ V) (hbounded : ∀ omega, (err (select (pilot omega)) (tail omega)) ^ 2 ≤ H) (hbad : mu.real (pilot ⁻¹' goodᶜ) ≤ delta) : ∫ omega, (err (select (pilot omega)) (tail omega)) ^ 2 ∂mu ≤ V + H * delta := by /- The pointwise bound plus measurability makes the full square integrable. Split its integral over the good event and its complement. Apply the selector theorem on the good part and the constant bound `H` on the bad part, whose real probability is at most `delta`. -/ let F : Omega → Real := fun omega => (err (select (pilot omega)) (tail omega)) ^ 2 have hFmeas : Measurable F := by exact measurable_finiteSelector_sq hpilot htail hselect herr have hFint : Integrable F mu := by rw [← integrableOn_univ] apply mu.integrableOn_of_bounded (M := H) (by finiteness) hFmeas.aestronglyMeasurable filter_upwards with omega have hs : 0 ≤ F omega := by exact sq_nonneg _ rw [Real.norm_eq_abs, abs_of_nonneg hs] exact hbounded omega have hgood_pre : MeasurableSet (pilot ⁻¹' good) := hpilot hgood have hbad_pre : (pilot ⁻¹' good)ᶜ = pilot ⁻¹' goodᶜ := by ext omega simp have hgood_bound : ∫ omega in pilot ⁻¹' good, F omega ∂mu ≤ V := by exact IndepFun.integral_finiteSelector_sq_le hind hpilot htail hselect hgood hV hEligible hbranchInt hbranch have hbad_bound : ∫ omega in pilot ⁻¹' goodᶜ, F omega ∂mu ≤ H * delta := by calc ∫ omega in pilot ⁻¹' goodᶜ, F omega ∂mu ≤ ∫ _omega in pilot ⁻¹' goodᶜ, H ∂mu := by apply setIntegral_mono_on hFint.integrableOn integrableOn_const (hpilot hgood.compl) intro omega _ exact hbounded omega _ = H * mu.real (pilot ⁻¹' goodᶜ) := by simp [integral_const, mul_comm] _ ≤ H * delta := mul_le_mul_of_nonneg_left hbad hH have hsplit := integral_add_compl hgood_pre hFint rw [hbad_pre] at hsplit change ∫ omega, F omega ∂mu ≤ V + H * delta linarith -
integral_finiteSelector_sq_letheorem — Given an iid one-shot sample split, a sample horizon, a measurable finite branch selector on the pilot fold, a measurable good pilot event, a nonnegative common risk bound, eligibility of every branch selected on the good event, integrability of every eligible branch's squared error under the tail-fold law, and the common fixed-branch risk bound, the selected squared risk on the good event is at most that common bound.hypothesesmu :Measure OmegaP :Measure XFintype IotaS :IIDSample Omega X mu Psplit :Eligible :Iota -> PropV :hselect :Measurable selectgood :Set (split.foldA n -> X)hgood :MeasurableSet goodhV :0 ≤ VhEligible :∀ a ∈ good, Eligible (select a)hbranchInt :∀ i,Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map (fun omega => fun j : split.foldB n => S.Z j omega))hbranch :∀ i,Eligible i -> ∫ b, (err i b) ^ 2 ∂(mu.map (fun omega => fun j : split.foldB n => S.Z j omega))≤ Vconclusion∫ omega in (fun omega => fun j : split.foldA n => S.Z j omega) ⁻¹' good, (err (select (fun j : split.foldA n => S.Z j omega)) (fun j : split.foldB n => S.Z j omega)) ^ 2 ∂mu≤ VProof (Lean source)
theorem OneShotSplit.integral_finiteSelector_sq_le {mu : Measure Omega} {P : Measure X} [Fintype Iota] [MeasurableSingletonClass Iota] {S : IIDSample Omega X mu P} (split : OneShotSplit S) (n : Nat) {select : (split.foldA n -> X) -> Iota} {err : Iota -> (split.foldB n -> X) -> Real} {Eligible : Iota -> Prop} {V : Real} (hselect : Measurable select) {good : Set (split.foldA n -> X)} (hgood : MeasurableSet good) (hV : 0 ≤ V) (hEligible : ∀ a ∈ good, Eligible (select a)) (hbranchInt : ∀ i, Eligible i -> Integrable (fun b => (err i b) ^ 2) (mu.map (fun omega => fun j : split.foldB n => S.Z j omega))) (hbranch : ∀ i, Eligible i -> ∫ b, (err i b) ^ 2 ∂(mu.map (fun omega => fun j : split.foldB n => S.Z j omega)) ≤ V) : ∫ omega in (fun omega => fun j : split.foldA n => S.Z j omega) ⁻¹' good, (err (select (fun j : split.foldA n => S.Z j omega)) (fun j : split.foldB n => S.Z j omega)) ^ 2 ∂mu ≤ V := by letI : IsProbabilityMeasure mu := S.indep.isProbabilityMeasure have hfoldA : Measurable (fun omega => fun j : split.foldA n => S.Z j omega) := measurable_pi_lambda _ fun j => S.meas j have hfoldB : Measurable (fun omega => fun j : split.foldB n => S.Z j omega) := measurable_pi_lambda _ fun j => S.meas j exact IndepFun.integral_finiteSelector_sq_le (split.folds_indep n) hfoldA hfoldB hselect hgood hV hEligible hbranchInt hbranch
FoldBEmpiricalProcess 4 core · 1 supporting This module proves the empirical-process estimates used to turn sample-split orthogonal expansions into stochastic remainders. ★ foldB_centered_sum_isLittleOp_one★ sqrtFoldB_integral_isLittleOp_one★ fold_centered_sum_isLittleOp_one★ sqrtFold_integral_isLittleOp_one
Fold-B empirical-process bounds
This module proves the empirical-process estimates used to turn sample-split
orthogonal expansions into stochastic remainders. The main one-shot results are
foldB_centered_sum_isLittleOp_one, which makes a centered evaluation-fold sum
o_p(1) from an L²(P) o_p(1) nuisance rate, and
sqrtFoldB_integral_isLittleOp_one, which controls the fold-B bias term from an
o_p(n^{-1/2}) L²(P) rate and a fixed split proportion.
The same abstract conditional-independence argument is reused for K-fold splits
through KFoldSplit.fold_centered_sum_isLittleOp_one and
KFoldSplit.sqrtFold_integral_isLittleOp_one. The public helper oneShot_iid
records the fold-B product-law bridge needed by downstream local empirical
process modules.
Centered fold-B empirical sum is o_p(1) from L²-rate o_p(1). For an i.i.d. sample and a one-shot split into a nuisance fold and an estimation fold, given a family of random functions f n ω : X → ℝ that is jointly measurable in the training data and the outcome, for every n, measurable with respect to the fold-A σ-algebra jointly with the outcome, for every n, square-integrable under the population measure, for every n and ω, and whose norm is under the sampling measure, the centered fold-B empirical sum of f — the estimation-fold sample average of f n ω minus its population mean, rescaled by — is .
Formal statement
Proof (Lean source)
Bias term is o_p(1) under fixed-ratio split. Given a positive limiting fold-B sampling ratio with the fold-B fraction converging to , and a family of random functions f n ω that is square-integrable under the population measure, for every n, ω with norm that is under the sampling measure, the bias term is .
Formal statement
Proof (Lean source)
Per-fold centered evaluation sum is o_p(1) (K-fold). For an i.i.d. sample and a K-fold split, fixing an evaluation fold k, given a family of random functions f n ω : X → ℝ that is jointly measurable in the training-complement data and the outcome, for every n, measurable with respect to the training-complement σ-algebra jointly with the outcome, for every n, square-integrable under the population measure, for every n and ω, and whose norm is , the centered per-fold empirical sum of f over the evaluation fold k — its fold sample average minus its population mean, rescaled by the square root of the fold size — is .
Formal statement
Proof (Lean source)
Per-fold bias term is o_p(1) under a nonempty K-fold split. For an i.i.d. sample and a K-fold split with a positive number of folds , given a family of random functions f n ω that is square-integrable under the population measure, for every n, ω with norm that is , the per-fold bias term at evaluation fold k is .
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
oneShot_iidlemma — OneShot evaluation-fold i.i.d. product law. Public because the orthogonal-learning modulus chain consumes it as the joint-law bridge between fold B and Measure.pi (see Estimation/OrthogonalLearning/LocalEmpProcess/Rademacher.lean).hypothesesconclusionμ.map (fun ω (i : split.foldB n) => S.Z i ω) = Measure.pi (fun _ : split.foldB n => P)Proof (Lean source)
lemma oneShot_iid (S : IIDSample Ω X μ P) (split : OneShotSplit S) (n : ℕ) : μ.map (fun ω (i : split.foldB n) => S.Z i ω) = Measure.pi (fun _ : split.foldB n => P) := by have hindep_s : iIndepFun (fun i : split.foldB n => S.Z i) μ := by exact S.indep.precomp val_injective have hmap := (ProbabilityTheory.iIndepFun_iff_map_fun_eq_pi_map (fun i : split.foldB n => (S.meas i).aemeasurable)).mp hindep_s calc μ.map (fun ω (i : split.foldB n) => S.Z i ω) = Measure.pi (fun i : split.foldB n => μ.map (S.Z i)) := hmap _ = Measure.pi (fun _ : split.foldB n => P) := by congr with i rw [← (S.identDist i).map_eq, S.law]
FoldBWLLN 1 core · 0 supporting This file provides a weak law of large numbers for the estimation fold of a one-shot sample split: the fold-B average of a fixed square-integrable statistic converges in probability to its population mean. ★ foldB_sampleMean_tendsto_inProb
Fold-B Weak Law of Large Numbers
This file provides a weak law of large numbers for the estimation fold of a one-shot sample split: the fold-B average of a fixed square-integrable statistic converges in probability to its population mean. It is the substrate that lets a fold-B average of a fixed function converge to its mean, as opposed to the existing fold-B lemmas which only treat the nuisance-vanishing regime.
Fold-B weak law of large numbers. For an i.i.d. sample and a one-shot split into a nuisance fold and an estimation fold, given a measurable statistic g that is square-integrable under the population measure, the estimation-fold sample average of g converges in probability to the population integral as the sample size grows.
Formal statement
Proof (Lean source)
PartialFoldCLT 3 core · 3 supporting This file provides the central-limit-theorem contact point for one-shot sample splits. ★ clt_normalizedFoldB★ tendsto_normal_foldB★ tendsto_normal_foldB_sqrt_n
Fold-Restricted Central Limit Theorems
This file provides the central-limit-theorem contact point for one-shot sample
splits. It proves the fold-B normalized-sum CLT, converts fold-B asymptotic
linearity into asymptotic normality at rate √|B(n)|, and gives the √n-rate
conversion under a fixed split ratio with variance inflation.
Fold-B CLT. Along an i.i.d. sample S under a one-shot sample split split, fix a transform ψ : X → ℝ that is measurable, has population mean zero under P, and is square-integrable; provided the fold-B normalized partial sum is almost-everywhere measurable at every sample size, the fold-B normalized partial sum (1/√|B(n)|) Σ_{i∈B(n)} ψ(Z_i) converges in distribution to the centered Gaussian law with variance ∫ψ²dP.
Formal statement
Proof (Lean source)
Fold-B asymptotic linearity ⇒ asymptotic normality at rate √|B(n)|. Along an i.i.d. sample S under a one-shot sample split split, if the estimator sequence θn is fold-B asymptotically linear toward θ₀ with influence function ψ that is measurable, and if the rescaled estimator and the fold-B normalized influence-function sum are almost-everywhere measurable at every sample size, then √|B(n)| · (θn n − θ₀) converges in distribution to the centered Gaussian law with variance ∫ψ²dP.
Formal statement
Proof (Lean source)
Conversion to √n-rate under a fixed split ratio. Along an i.i.d. sample S under a one-shot sample split split with a fold-B asymptotically linear estimator sequence θn (h), suppose the split ratio c is strictly positive, the estimation-fold share |B(n)|/n converges to c, the influence function ψ is measurable, and the √n-rescaled estimator is almost-everywhere measurable at every sample size; then √n · (θn n − θ₀) converges in distribution to the centered Gaussian law with variance (∫ψ²dP)/c.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
foldB_eq_Icolemma — The estimation fold of a one-shot split is the interval from the split point to the sample size.Proof (Lean source)
lemma foldB_eq_Ico (split : OneShotSplit S) (n : ℕ) : split.foldB n = Ico (split.n₁ n) n := by ext i simp [OneShotSplit.foldB, Finset.mem_Ico, and_comm] -
card_foldBlemma — The size of the estimation fold is the sample size minus the split point.Proof (Lean source)
lemma card_foldB (split : OneShotSplit S) (n : ℕ) : (split.foldB n).card = n - split.n₁ n := by rw [split.foldB_eq_Ico n] exact Nat.card_Ico (split.n₁ n) n -
charFun_normalizedSum_finset_eq_range_cardlemma — A normalized finite-set sum has the characteristic function of an equal-size initial block.hypothesesProof (Lean source)
lemma charFun_normalizedSum_finset_eq_range_card (S : IIDSample Ω X μ P) {ψ : X → ℝ} (hψ_meas : Measurable ψ) (s : Finset ℕ) (t : ℝ) : charFun (μ.map (fun ω => (sqrt (s.card : ℝ))⁻¹ * ∑ i ∈ s, ψ (S.Z i ω))) t = charFun (μ.map (fun ω => (sqrt (s.card : ℝ))⁻¹ * ∑ i ∈ range s.card, ψ (S.Z i ω))) t := by let Y : ℕ → Ω → ℝ := fun i ω => ψ (S.Z i ω) let c : ℝ := (sqrt (s.card : ℝ))⁻¹ have hY_meas : ∀ i, Measurable (Y i) := by intro i exact hψ_meas.comp (S.meas i) have hY_ident : ∀ i, IdentDistrib (Y i) (Y 0) μ μ := by intro i simpa [Y, Function.comp_def] using (S.identDist i).symm.comp hψ_meas have hindep_Y : iIndepFun Y μ := by simpa [Y, Function.comp_def] using S.indep.comp (fun _ x => ψ x) (fun _ => hψ_meas) have hindep_s : iIndepFun (fun i : s => Y i) μ := by exact hindep_Y.precomp Subtype.val_injective have hleft_sum : (fun ω => ∑ i : s, Y i ω) = fun ω => ∑ i ∈ s, Y i ω := by funext ω exact Finset.sum_attach s (fun i => Y i ω) have hleft_unscaled : charFun (μ.map (fun ω => ∑ i ∈ s, Y i ω)) (c * t) = charFun (μ.map (Y 0)) (c * t) ^ s.card := by calc charFun (μ.map (fun ω => ∑ i ∈ s, Y i ω)) (c * t) = charFun (μ.map (fun ω => ∑ i : s, Y i ω)) (c * t) := by rw [hleft_sum] _ = (∏ i : s, charFun (μ.map (Y i)) (c * t)) := by simpa [Finset.prod_apply] using congrFun (iIndepFun.charFun_map_fun_sum_eq_prod (fun i : s => (hY_meas i).aemeasurable) hindep_s) (c * t) _ = charFun (μ.map (Y 0)) (c * t) ^ s.card := by rw [show (∏ i : s, charFun (μ.map (Y i)) (c * t)) = ∏ _i : s, charFun (μ.map (Y 0)) (c * t) by apply Finset.prod_congr rfl intro i _hi exact congrFun (congrArg charFun ((hY_ident i).map_eq)) (c * t)] simp have hleft_scaled : charFun (μ.map (fun ω => c * ∑ i ∈ s, Y i ω)) t = charFun (μ.map (Y 0)) (c * t) ^ s.card := by calc charFun (μ.map (fun ω => c * ∑ i ∈ s, Y i ω)) t = charFun (μ.map (fun ω => ∑ i ∈ s, Y i ω)) (c * t) := by rw [show μ.map (fun ω => c * ∑ i ∈ s, Y i ω) = (μ.map (fun ω => ∑ i ∈ s, Y i ω)).map (fun x => c * x) by rw [Measure.map_map] · rfl · exact measurable_const.mul measurable_id · exact measurable_sum _ (fun i _ => hY_meas i)] rw [charFun_map_mul] _ = charFun (μ.map (Y 0)) (c * t) ^ s.card := hleft_unscaled have hright_scaled : charFun (μ.map (fun ω => c * ∑ i ∈ range s.card, Y i ω)) t = charFun (μ.map (Y 0)) (c * t) ^ s.card := by simpa [c] using (ProbabilityTheory.charFun_inv_sqrt_mul_sum (X := Y) (P := μ) hindep_Y (fun i => hY_ident i) (n := s.card) (t := t)) simpa [Y, c] using hleft_scaled.trans hright_scaled.symm