Estimation.OrthogonalLearning.LocalEmpProcess
Local empirical-process modulus machinery for orthogonal learning, derived from Rademacher, localized, fixed-nuisance, and random-nuisance regimes.
Local 1 core · 0 supporting This file states the local empirical-process modulus assumption used in orthogonal statistical learning: with high probability, empirical excess risk is uniformly close to population excess risk at a rate depending on th
Local Empirical-Process Modulus
This file states the local empirical-process modulus assumption used in orthogonal statistical learning: with high probability, empirical excess risk is uniformly close to population excess risk at a rate depending on the distance to the population target. The predicate serves as the bridge from empirical-process theory to oracle inequalities for plug-in estimators.
Given an orthogonal statistical-learning system, an independent and identically distributed sample with the system's population law, a one-shot sample split, a rate sequence, a confidence tolerance, and a nuisance function, the local empirical-process modulus condition holds exactly when, for every sample size, there exists an event that is measurable, has measure at least , with subtraction truncated at zero, and on which, uniformly over the target class, the population excess risk minus the fold-B empirical excess risk is at most times the distance from the distinguished target plus .
Definition (Lean source)
Rademacher 7 core · 1 supporting This file obtains a local empirical-process bound for orthogonal statistical learning from global control of the Rademacher complexity of the centred loss class. ★ foldB_pi_law★ localEmpProcessModulus_of_bounded_rademacher★ localEmpProcessModulus_of_bounded_rademacher_ae
Global Rademacher Modulus
This file obtains a local empirical-process bound for orthogonal statistical learning from global control of the Rademacher complexity of the centred loss class. It supplies versions for losses bounded everywhere or almost everywhere, and treats the degenerate case in which the target class contains one element.
Fold-B joint-law identification (public alias). For an IID sample S split via split, at any fold size n, the joint distribution of the fold-B subsample, mapped from μ via ω ↦ (i ↦ S.Z i ω) indexed by i ∈ split.foldB n, equals the product measure Measure.pi (fun _ ↦ P).
Formal statement
Proof (Lean source)
Given an orthogonal statistical-learning system, an independent and identically distributed sample with the system's population law, a one-shot sample split, a nuisance function, a sequence of targets in the target class, and a real sequence, the Rademacher-complexity bound holds exactly when, for every sample size, the proposed bound is nonnegative and the Rademacher complexity of the centred loss class indexed by that target sequence on fold B, computed under the ambient sample measure using the zeroth observation coordinate, is at most the proposed bound.
Definition (Lean source)
Given an orthogonal statistical-learning system, a nuisance function, and a real bound, the uniform bounded-loss condition holds exactly when, for every observation and every target in the target class, the absolute loss at that nuisance function is at most the bound.
Definition (Lean source)
Given an orthogonal statistical-learning system, a nuisance function, and a real bound, the almost-everywhere uniform bounded-loss condition holds exactly when, outside a set of population probability zero, every target in the target class has absolute loss at that nuisance function at most the bound.
Definition (Lean source)
Given an orthogonal statistical-learning system and a nuisance function, the target-continuity condition for the loss holds exactly when, for every observation, the loss as a function of the target is continuous on the system's target class at that fixed nuisance function.
Definition (Lean source)
Bounded-loss Rademacher bridge theorem. Assume b is nonnegative, that the loss magnitude is uniformly bounded by b over the parameter set, and that the loss is continuous in the parameter on the parameter set. Given a sequence R n that is nonnegative and upper-bounds the population Rademacher complexity of the centred loss class on the fold-B sample at every sample size, then for any confidence level 0 < δ ≤ 1 the local empirical-process modulus condition holds, with rate ρ n := √(2 · b) when the fold-B sample is empty and ρ n := √(2 · R n + 2 · b · √(2 · log(1/δ) / |foldB n|)) otherwise.
Formal statement
Proof (Lean source)
Almost-everywhere bounded-loss bridge. Assume b is nonnegative, that the loss magnitude is bounded by b at P_Z-almost-every observation, over the parameter set, and that the loss is continuous in the parameter on the parameter set. Given a sequence R n that is nonnegative and upper-bounds the population Rademacher complexity of the centred loss class on the fold-B sample at every sample size, and that the target parameter minimizes, over the parameter set, the population risk of the loss — evaluated at the model's baseline nuisance and clamped to [-b, b], then for any confidence level 0 < δ ≤ 1 the local empirical-process modulus condition holds, with rate ρ n := √(2 · b) when the fold-B sample is empty and ρ n := √(2 · R n + 2 · b · √(2 · log(1/δ) / |foldB n|)) otherwise.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
localEmpProcessModulus_singletontheorem — Trivial finite class. When Θ_set = {θ₀} (the class collapses to the truth), the modulus inequality holds with ρ n := 0.hypothesesΘ :sharedType u_3G :sharedType u_4S :LearningSystem Ω μ Z P_Z Θ GS_iid :IIDSample Ω Z μ P_Zsplit :OneShotSplit S_iidg :Ghsing :S.Θ_set = {S.θ₀}δ :ℝ_hδ :0 < δconclusionLocalEmpProcessModulus S S_iid split (fun _ => 0) δ gProof (Lean source)
theorem localEmpProcessModulus_singleton (S : LearningSystem Ω μ Z P_Z Θ G) (S_iid : IIDSample Ω Z μ P_Z) (split : OneShotSplit S_iid) [IsProbabilityMeasure μ] (g : G) (hsing : S.Θ_set = {S.θ₀}) {δ : ℝ} (_hδ : 0 < δ) : LocalEmpProcessModulus S S_iid split (fun _ => 0) δ g := by intro n refine ⟨Set.univ, MeasurableSet.univ, ?_, ?_⟩ · rw [measure_univ] exact tsub_le_self · intro ω _ θ hθ have hθ' : θ ∈ ({S.θ₀} : Set Θ) := by simpa [hsing] using hθ rcases hθ' with rfl simp
Localized 7 core · 1 supporting This file derives local empirical-process moduli for orthogonal statistical learning from localized Rademacher-complexity conditions. ★ localEmpProcessModulus_of_localized_bounded★ localEmpProcessModulus_of_localized_bounded_ae★ localEmpProcessModulus_of_localized_sharp★ localEmpProcessModulus_of_localized_sharp_ae
Localized Rademacher Moduli
This file derives local empirical-process moduli for orthogonal statistical learning from localized Rademacher-complexity conditions. It supplies both a bounded-loss fallback and a sharp critical-radius result, including an almost-everywhere version obtained by clamping the centered loss.
For an orthogonal statistical-learning system, an independent and identically distributed sample from its observation law, a one-shot sample split, a nuisance function, a sequence indexing candidate targets, a norm on real-valued observation functions, a family of real complexity envelopes, and a real bound, the localized Rademacher regime requires: the bound is nonnegative; the centered loss is bounded in absolute value by that bound for every observation and candidate target; each complexity envelope is sub-root; and at every sample size, the envelope upper-bounds the population Rademacher complexity of the indexed centered-loss class on the split's validation fold.
Definition (Lean source)
For an orthogonal statistical-learning system, an independent and identically distributed sample from its observation law, a one-shot sample split, a nuisance function, a sequence indexing candidate targets, a norm on real-valued observation functions, a family of real complexity envelopes, and a real bound, the almost-everywhere localized Rademacher regime requires: the bound is nonnegative; for almost every observation under the observation law, the centered loss is bounded in absolute value by that bound for every candidate target; each complexity envelope is sub-root; and at every sample size, the envelope upper-bounds the population Rademacher complexity of the indexed centered-loss class on the split's validation fold.
Definition (Lean source)
Uniform-bound fallback bridge. Under a localized Rademacher regime — a uniform bound b on the centred pointwise loss difference together with a sub-root Rademacher- complexity envelope ψ, and given that the population excess risk at every admissible parameter is likewise bounded by b, then for any confidence level 0 < δ ≤ 1 the local empirical-process modulus condition holds, with the constant envelope ρ n := √(2 · b).
Formal statement
Proof (Lean source)
Almost-everywhere uniform-bound fallback bridge. Under an almost-everywhere localized Rademacher regime — a P_Z-a.e. bound b on the centred pointwise loss difference together with a sub-root Rademacher-complexity envelope ψ, and given that the population excess risk at every admissible parameter is likewise bounded by b, then for any confidence level 0 < δ ≤ 1 the local empirical-process modulus condition holds, with the constant envelope ρ n := √(2 · b).
Formal statement
Proof (Lean source)
For an orthogonal statistical-learning system and a real clamp radius, the centered clamped target-minimization condition states that every candidate target has auxiliary population risk at least that of the designated target, where its excess loss relative to the designated target is clamped to .
Definition (Lean source)
Localized critical-radius modulus, countable-class Foster–Syrgkanis form. Fix a countable, densely-indexed target class on which the loss is continuous in the parameter for every observation and a localized Rademacher regime holds — a uniform centred-loss bound and a sub-root Rademacher-complexity envelope ψ. Suppose the Lipschitz constant L is nonnegative, that the chosen function-space norm of the centred loss difference at each parameter is bounded by L · ‖θ − θ₀‖, that the loss at each parameter is measurable and integrable under P_Z, and that the same centred loss difference has diameter at most Rmax in that norm. Assume the critical radius of ψ at every fold-B sample size satisfies criticalRadius (ψ m) ≤ Rmax and criticalRadius (ψ m) > 0, together with the sub-root fixed-point inequality ψ m (criticalRadius (ψ m)) ≤ criticalRadius (ψ m) ^ 2; that ψ upper-bounds the population Rademacher complexity of the star-hulled centred loss class on a fold-B-sized sample; and the technical regularity conditions that the empirical Rademacher supremum is bounded above and the upper empirical Rademacher complexity process is integrable. For any confidence level 0 < δ ≤ 1, assume the Foster–Syrgkanis peeling-absorption condition that at every dyadic shell count covering Rmax, the McDiarmid concentration slack at the union-bound-adjusted confidence is dominated by the squared critical radius. Then the local empirical-process modulus condition holds, with envelope ρ n := (8 · L + 3) · criticalRadius (ψ |foldB n|) (falling back to √(2 · b) when the fold-B sample is empty).
Formal statement
Proof (Lean source)
Almost-everywhere countable-class localized bridge. Fix a countable, densely-indexed target class on which the loss is continuous in the parameter for every observation and the chosen function-space norm is invariant under P_Z-a.e. equality of its argument. Assume an almost-everywhere localized Rademacher regime holds — a uniform centred-loss bound and a sub-root Rademacher-complexity envelope ψ, that the Lipschitz constant L is nonnegative, that the norm of the centred loss difference at each parameter is bounded by L · ‖θ − θ₀‖, that the loss at each parameter is measurable and integrable under P_Z, and that the same centred loss difference has diameter at most Rmax in that norm. Assume the critical radius of ψ at every fold-B sample size satisfies criticalRadius (ψ m) ≤ Rmax and criticalRadius (ψ m) > 0, together with the sub-root fixed-point inequality ψ m (criticalRadius (ψ m)) ≤ criticalRadius (ψ m) ^ 2; that ψ upper-bounds the population Rademacher complexity of the star-hulled centred loss class on a fold-B-sized sample; the technical regularity conditions that the empirical Rademacher supremum is bounded above and the upper empirical Rademacher complexity process is integrable; and that the population-optimal parameter minimizes the auxiliary population risk with the centred excess loss clamped to [-b, b]. For any confidence level 0 < δ ≤ 1, assume the Foster–Syrgkanis peeling-absorption condition that at every dyadic shell count covering Rmax, the McDiarmid concentration slack at the union-bound-adjusted confidence is dominated by the squared critical radius. Then the local empirical-process modulus condition holds, with envelope ρ n := (8 · L + 3) · criticalRadius (ψ |foldB n|) (falling back to √(2 · b) when the fold-B sample is empty).
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
localEmpProcessModulus_of_localized_singletontheorem — Trivial finite class. When Θ_set = {θ₀} the modulus inequality holds with ρ n := 0 (the centred excess risk is identically zero). Mirrors localEmpProcessModulus_singleton in the global-Rademacher bridge.hypothesesΘ :sharedType u_3G :sharedType u_4S :LearningSystem Ω μ Z P_Z Θ GS_iid :IIDSample Ω Z μ P_Zsplit :OneShotSplit S_iidg :Ghsing :S.Θ_set = {S.θ₀}δ :ℝ_hδ :0 < δconclusionLocalEmpProcessModulus S S_iid split (fun _ => 0) δ gProof (Lean source)
theorem localEmpProcessModulus_of_localized_singleton (S : LearningSystem Ω μ Z P_Z Θ G) (S_iid : IIDSample Ω Z μ P_Z) (split : OneShotSplit S_iid) [IsProbabilityMeasure μ] (g : G) (hsing : S.Θ_set = {S.θ₀}) {δ : ℝ} (_hδ : 0 < δ) : LocalEmpProcessModulus S S_iid split (fun _ => 0) δ g := by intro n refine ⟨Set.univ, MeasurableSet.univ, ?_, ?_⟩ · rw [measure_univ] exact tsub_le_self · intro ω _ θ hθ have hθ' : θ ∈ ({S.θ₀} : Set Θ) := by simpa [hsing] using hθ rcases hθ' with rfl simp
RandomNuisance 5 core · 4 supporting The fixed-nuisance bridge localEmpProcessModulus_of_bounded_rademacher (OrthogonalLearning/LocalEmpProcess/Rademacher.lean) controls the centred excess-risk process for a *fixed* nuisance g : G. ★ localEmpProcessModulus_random_of_bounded_rademacher
Random-nuisance empirical-process modulus (cross-fitting lift)
The fixed-nuisance bridge localEmpProcessModulus_of_bounded_rademacher
(OrthogonalLearning/LocalEmpProcess/Rademacher.lean) controls the centred
excess-risk process for a fixed nuisance g : G. Cross-fitting feeds a
random, fold-A-measurable nuisance
ĥ : ℕ → Ω → G into the fold-B evaluation, so the high-probability modulus
event becomes a random object: at sample n and sample point ω the bad set is
selected by ĥ n ω.
LocalEmpProcessModulusRandom is the random-g analogue of
LocalEmpProcessModulus — exactly the hMod hypothesis of
oracle_inequality_drLearner_random_nuisance.
The proof structure factors the fixed-nuisance Rademacher argument into
g-parametric lemmas, then lifts them with the cross-fit conditioning keystone
randomParam_event_le:
* foldBCoord / foldBCoord_law — the fold-B coordinate map Y : Ω → (Fin m → Z)
with law Measure.pi P_Z (independent of g);
* badDataSet g — despite the historical name, this is the product-sample
bad event for nuisance g, not an observed data set. Its
Measure.pi P_Z-mass is ≤ δ (badDataSet_mass_le, using McDiarmid and
symmetrization);
* modulus_of_not_badData g — on the complement, the modulus inequality holds
uniformly over Θ_set;
* randomParam_event_le — conditions on fold A, integrates the per-ĥ n ω
mass bound against the fold-A marginal, with no loss in the probability budget.
The fold-A-measurability of ĥ n and the joint measurability of
(ω, s) ↦ s ∈ badDataSet (ĥ n ω) enter as named regularity hypotheses, in the
same spirit as RademacherBound / LossContinuousOnΘset.
Given an orthogonal statistical-learning system, an independent and identically distributed sample with the system's population law, a one-shot sample split, a rate sequence, a confidence tolerance, and a sample-dependent nuisance estimator, the random-nuisance local empirical-process modulus condition holds exactly when, for every sample size, there exists an event that is measurable, has measure at least , with subtraction truncated at zero, and on which, uniformly over the target class, the population excess risk at the realized nuisance estimate minus the fold-B empirical excess risk is at most times the distance from the distinguished target plus .
Definition (Lean source)
Given an independent and identically distributed sample, a one-shot sample split, and a sample size, the fold-B coordinate map sends each sample realization to its fold-B observations, indexed in their canonical finite order.
Given an orthogonal statistical-learning system, an independent and identically distributed sample with the system's population law, a one-shot sample split, a sample size, a loss bound, a confidence tolerance, a candidate complexity-bound sequence, and a nuisance function, the product-sample bad event is the set of fold-B observation vectors for which twice the centred-loss Rademacher complexity plus , where is the fold-B size, does not exceed the centred-loss uniform deviation.
Definition (Lean source)
Given an independent and identically distributed sample, a one-shot sample split, a loss bound, a confidence tolerance, and a complexity-bound sequence, the deterministic modulus-radius sequence assigns to every sample size the value when fold B is empty, and otherwise the value , where is the fold-B size.
Definition (Lean source)
Cross-fit lift of the empirical-process modulus to a random nuisance. Let ĥ be a fold-A-measurable random nuisance sequence. Assume b is strictly positive, that at every sample size and sample point the loss magnitude at the realised nuisance ĥ n ω is uniformly bounded by b, and that the loss at that realised nuisance is continuous in the parameter. Given a sequence R n that Rademacher-controls the centred loss class at every realisation ĥ n ω, and a confidence level 0 < δ ≤ 1. Suppose further that the σ-algebra m_A n generating the fold-A information is coarser than the ambient σ-algebra, that fold A is independent of the fold-B coordinate block under this σ-algebra, and that the nuisance-indexed bad event depends jointly measurably on the fold-A outcome and the fold-B sample. Then the random-nuisance local empirical-process modulus condition holds, at rate ρ n := √(2·b) on empty folds and ρ n := √(2·R n + 2·b·√(2·log(1/δ)/|foldB n|)) otherwise, evaluated at the random nuisance ĥ.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
foldBCoord_lawtheorem — Fold-B coordinate law. μ.map (foldBCoord n) = Measure.pi P_Z. This identifies the validation-fold coordinates as an i.i.d. product sample.hypothesessplit :OneShotSplit S_iidn :ℕconclusionμ.map (foldBCoord S_iid split n) = Measure.pi (fun _ : Fin (split.foldB n).card => P_Z)Proof (Lean source)
theorem foldBCoord_law {S_iid : IIDSample Ω Z μ P_Z} [IsProbabilityMeasure μ] [IsProbabilityMeasure P_Z] (split : OneShotSplit S_iid) (n : ℕ) : μ.map (foldBCoord S_iid split n) = Measure.pi (fun _ : Fin (split.foldB n).card => P_Z) := by set m := (split.foldB n).card with hm let e : Fin m ≃o split.foldB n := (split.foldB n).orderIsoOfFin rfl let YB : Ω → split.foldB n → Z := fun ω i => S_iid.Z i.val ω let T : (split.foldB n → Z) ≃ᵐ (Fin m → Z) := MeasurableEquiv.piCongrLeft (fun _ : Fin m => Z) e.symm.toEquiv have hY_eq : foldBCoord S_iid split n = T ∘ YB := by funext ω j simpa [foldBCoord, YB, T, e] using (MeasurableEquiv.piCongrLeft_apply_apply (e := e.symm.toEquiv) (β := fun _ : Fin m => Z) (x := fun i : split.foldB n => S_iid.Z i.val ω) (i := e j)).symm rw [hY_eq, ← Measure.map_map T.measurable (measurable_pi_lambda YB fun i => S_iid.meas i.val)] rw [foldB_pi_law S_iid split n] simpa [T] using Measure.pi_map_piCongrLeft (e := e.symm.toEquiv) (β := fun _ : Fin m => Z) (μ := fun _ : Fin m => P_Z) -
badDataSet_mass_letheorem — Mass bound. The product-space bad set has Measure.pi P_Z-mass ≤ δ. The proof uses the deterministic fixed-nuisance construction from Rademacher.lean: McDiarmid concentration, symmetrization, and separable lifting.hypothesesΘ :sharedType u_3G :sharedType u_4S :LearningSystem Ω μ Z P_Z Θ GS_iid :IIDSample Ω Z μ P_Zsplit :OneShotSplit S_iidb :ℝhb_pos :0 < bg :Ghg_bdd :UniformlyBoundedLoss S g bhg_cont :idx :ℕ → S.Θ_setidx_dense :DenseRange idxR :ℕ → ℝ_hR :RademacherBound S S_iid split g idx Rδ :ℝhδ :0 < δhδ' :δ ≤ 1n :ℕhm_pos :0 < (split.foldB n).cardconclusionMeasure.pi (fun _ : Fin (split.foldB n).card => P_Z) (badDataSet S S_iid split n b δ R g)≤ ofReal δProof (Lean source)
theorem badDataSet_mass_le (S : LearningSystem Ω μ Z P_Z Θ G) [IsProbabilityMeasure μ] [IsProbabilityMeasure P_Z] (S_iid : IIDSample Ω Z μ P_Z) (split : OneShotSplit S_iid) {b : ℝ} (hb_pos : 0 < b) (g : G) (hg_bdd : UniformlyBoundedLoss S g b) (hg_cont : LossContinuousOnΘset S g) (idx : ℕ → S.Θ_set) (idx_dense : DenseRange idx) (R : ℕ → ℝ) (_hR : RademacherBound S S_iid split g idx R) {δ : ℝ} (hδ : 0 < δ) (hδ' : δ ≤ 1) (n : ℕ) (hm_pos : 0 < (split.foldB n).card) : Measure.pi (fun _ : Fin (split.foldB n).card => P_Z) (badDataSet S S_iid split n b δ R g) ≤ ENNReal.ofReal δ := by simp only [badDataSet] let m : ℕ := (split.foldB n).card let fθ : S.Θ_set → Z → ℝ := fun θ z => S.ℓ z θ.val g - S.ℓ z S.θ₀ g haveI : Nonempty Z := nonempty_of_isProbabilityMeasure P_Z haveI : Nonempty S.Θ_set := ⟨⟨S.θ₀, S.θ₀_mem⟩⟩ haveI : SeparableSpace S.Θ_set := by exact ⟨⟨Set.range idx, Set.countable_range idx, idx_dense⟩⟩ have hf_meas : ∀ θ : S.Θ_set, Measurable (fθ θ) := by intro θ exact (S.ℓ_meas θ.val g).sub (S.ℓ_meas S.θ₀ g) have hf_bdd : ∀ θ : S.Θ_set, ∀ z : Z, |fθ θ z| ≤ 2 * b := by intro θ z have h1 : |S.ℓ z θ.val g| ≤ b := hg_bdd z θ.val θ.property have h2 : |S.ℓ z S.θ₀ g| ≤ b := hg_bdd z S.θ₀ S.θ₀_mem have h := abs_sub (S.ℓ z θ.val g) (S.ℓ z S.θ₀ g) dsimp [fθ] linarith have hf_cont : ∀ z : Z, Continuous fun θ : S.Θ_set => fθ θ z := by intro z exact (hg_cont z).sub continuous_const let ε : ℝ := 2 * b * sqrt (2 * log (1 / δ) / m) have hε_nonneg : 0 ≤ ε := by dsimp [ε] positivity have hm_pos' : 0 < m := hm_pos have htail := uniform_deviation_tail_bound_separable_of_pos (μ := P_Z) (n := m) (f := fθ) hf_meas (X := id) measurable_id (b := 2 * b) (by linarith) hf_bdd hf_cont (ε := ε) hε_nonneg change Measure.pi (fun _ : Fin m => P_Z) {s | 2 • rademacherComplexity m fθ P_Z id + ε ≤ uniformDeviation m fθ P_Z id (id ∘ s)} ≤ ENNReal.ofReal δ have hbad_toReal : (Measure.pi (fun _ : Fin m => P_Z) {s | 2 • rademacherComplexity m fθ P_Z id + ε ≤ uniformDeviation m fθ P_Z id (id ∘ s)}).toReal ≤ δ := by have hle_exp := htail have hexp_le : exp (-ε ^ 2 * m / (2 * (2 * b) ^ 2)) ≤ δ := by have hδ_nonneg : 0 ≤ δ := le_of_lt hδ have hlog_nonneg : 0 ≤ log (1 / δ) := by apply Real.log_nonneg have : (1 : ℝ) ≤ 1 / δ := by rw [le_div_iff₀ hδ] simpa using hδ' exact this have hsqrt_sq : (sqrt (2 * log (1 / δ) / m)) ^ 2 = 2 * log (1 / δ) / m := by rw [Real.sq_sqrt] positivity have hcalc : -ε ^ 2 * m / (2 * (2 * b) ^ 2) = log δ := by have hεsq : ε ^ 2 = 4 * b ^ 2 * (2 * log (1 / δ) / m) := by dsimp [ε] rw [mul_pow, hsqrt_sq] ring have hloginv : log (1 / δ) = -log δ := by rw [one_div, Real.log_inv] rw [hεsq, hloginv] have hmne : (m : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hm_pos'.ne' have hbne : (b : ℝ) ≠ 0 := hb_pos.ne' field_simp ring rw [hcalc, Real.exp_log hδ] exact hle_exp.trans hexp_le rw [ENNReal.le_ofReal_iff_toReal_le (measure_ne_top _ _) (le_of_lt hδ)] exact hbad_toReal -
modulus_of_not_badDatatheorem — On-event modulus. Off the bad set, the modulus inequality holds uniformly over Θ_set for a fixed nuisance g, using the same bounded-loss Rademacher radius as the deterministic bridge in Rademacher.lean.hypothesesΘ :sharedType u_3G :sharedType u_4S :LearningSystem Ω μ Z P_Z Θ GS_iid :IIDSample Ω Z μ P_Zsplit :OneShotSplit S_iidb :ℝhb_pos :0 < bg :Ghg_bdd :UniformlyBoundedLoss S g bhg_cont :idx :ℕ → S.Θ_setidx_dense :DenseRange idxR :ℕ → ℝhR :RademacherBound S S_iid split g idx Rδ :ℝ_hδ :0 < δ_hδ' :δ ≤ 1n :ℕω :Ωhm_pos :0 < (split.foldB n).cardhoff :foldBCoord S_iid split n ω ∉ badDataSet S S_iid split n b δ R gθ :Θhθ :θ ∈ S.Θ_setconclusion(S.L θ g - S.L S.θ₀ g)- (empRiskFoldB S S_iid split n ω θ g - empRiskFoldB S S_iid split n ω S.θ₀ g)≤ modulusRadius split b δ R n * ‖θ - S.θ₀‖ + (modulusRadius split b δ R n) ^ 2Proof (Lean source)
theorem modulus_of_not_badData (S : LearningSystem Ω μ Z P_Z Θ G) [IsProbabilityMeasure μ] (S_iid : IIDSample Ω Z μ P_Z) (split : OneShotSplit S_iid) {b : ℝ} (hb_pos : 0 < b) (g : G) (hg_bdd : UniformlyBoundedLoss S g b) (hg_cont : LossContinuousOnΘset S g) (idx : ℕ → S.Θ_set) (idx_dense : DenseRange idx) (R : ℕ → ℝ) (hR : RademacherBound S S_iid split g idx R) {δ : ℝ} (_hδ : 0 < δ) (_hδ' : δ ≤ 1) (n : ℕ) (ω : Ω) (hm_pos : 0 < (split.foldB n).card) (hoff : foldBCoord S_iid split n ω ∉ badDataSet S S_iid split n b δ R g) (θ : Θ) (hθ : θ ∈ S.Θ_set) : (S.L θ g - S.L S.θ₀ g) - (empRiskFoldB S S_iid split n ω θ g - empRiskFoldB S S_iid split n ω S.θ₀ g) ≤ modulusRadius split b δ R n * ‖θ - S.θ₀‖ + (modulusRadius split b δ R n) ^ 2 := by classical haveI : IsProbabilityMeasure P_Z := by rw [← S_iid.law] exact Measure.isProbabilityMeasure_map (S_iid.meas 0).aemeasurable have hR_nonneg : 0 ≤ R n := (hR n).1 have hm0 : (split.foldB n).card ≠ 0 := hm_pos.ne' have hm_pos' : 0 < ((split.foldB n).card : ℝ) := Nat.cast_pos.mpr hm_pos set m : ℕ := (split.foldB n).card with hm_def let fθ : S.Θ_set → Z → ℝ := fun θ z => S.ℓ z θ.val g - S.ℓ z S.θ₀ g haveI : Nonempty Z := nonempty_of_isProbabilityMeasure P_Z haveI : Nonempty S.Θ_set := ⟨⟨S.θ₀, S.θ₀_mem⟩⟩ haveI : SeparableSpace S.Θ_set := by exact ⟨⟨Set.range idx, Set.countable_range idx, idx_dense⟩⟩ have hf_meas : ∀ θ : S.Θ_set, Measurable (fθ θ) := by intro θ exact (S.ℓ_meas θ.val g).sub (S.ℓ_meas S.θ₀ g) have hf_bdd : ∀ θ : S.Θ_set, ∀ z : Z, |fθ θ z| ≤ 2 * b := by intro θ z have h1 : |S.ℓ z θ.val g| ≤ b := hg_bdd z θ.val θ.property have h2 : |S.ℓ z S.θ₀ g| ≤ b := hg_bdd z S.θ₀ S.θ₀_mem have h := abs_sub (S.ℓ z θ.val g) (S.ℓ z S.θ₀ g) dsimp [fθ] linarith have hf_cont : ∀ z : Z, Continuous fun θ : S.Θ_set => fθ θ z := by intro z exact (hg_cont z).sub continuous_const let ε : ℝ := 2 * b * sqrt (2 * log (1 / δ) / m) have hε_nonneg : 0 ≤ ε := by dsimp [ε] positivity have hsep_sup : ∀ {f : S.Θ_set → ℝ}, Continuous f → ⨆ x : S.Θ_set, f x = ⨆ k : ℕ, f (idx k) := by intro f hf have hclosure : closure (range f) = closure (range (f ∘ idx)) := by rw [Set.range_comp f idx] apply Set.Subset.antisymm · have hsub : range f ⊆ closure (f '' range idx) := hf.range_subset_closure_image_dense idx_dense exact closure_minimal hsub isClosed_closure · apply closure_mono exact Set.image_subset_range f (range idx) by_cases hbdd : BddAbove (range f) · calc ⨆ x : S.Θ_set, f x = sSup (closure (range f)) := by exact sSup_eq_closure_sSup (Set.range_nonempty f) hbdd _ = sSup (closure (range (f ∘ idx))) := by rw [hclosure] _ = ⨆ k : ℕ, f (idx k) := by have hbdd_idx : BddAbove (range (f ∘ idx)) := by rw [Set.range_comp f idx] exact BddAbove.mono (Set.image_subset_range f (range idx)) hbdd exact (sSup_eq_closure_sSup (Set.range_nonempty (f ∘ idx)) hbdd_idx).symm · have hbdd_idx : ¬ BddAbove (range (f ∘ idx)) := by intro h have hclosure_bdd : BddAbove (closure (range (f ∘ idx))) := bddAbove_closure.mpr h rw [← hclosure] at hclosure_bdd exact hbdd (bddAbove_closure.mp hclosure_bdd) calc ⨆ x : S.Θ_set, f x = 0 := Real.iSup_of_not_bddAbove hbdd _ = ⨆ k : ℕ, f (idx k) := (Real.iSup_of_not_bddAbove hbdd_idx).symm have hemp_dense : ∀ sample : Fin m → Z, empiricalRademacherComplexity m fθ sample = empiricalRademacherComplexity m (fθ ∘ idx) sample := by intro sample dsimp [empiricalRademacherComplexity] congr ext σ exact hsep_sup (by apply Continuous.abs apply Continuous.const_mul exact continuous_finset_sum univ fun k _ => continuous_const.mul (hf_cont (sample k))) have hrad_full_le : rademacherComplexity m fθ P_Z id ≤ R n := by have hfull_dense : rademacherComplexity m fθ P_Z id = rademacherComplexity m (fθ ∘ idx) P_Z id := by dsimp [rademacherComplexity] congr ext ω' exact hemp_dense (id ∘ ω') have hmap : rademacherComplexity m (fθ ∘ idx) P_Z id = rademacherComplexity m (fθ ∘ idx) μ (S_iid.Z 0) := by have hmap' : rademacherComplexity m (fθ ∘ idx) (μ.map (S_iid.Z 0)) id = rademacherComplexity m (fθ ∘ idx) μ (S_iid.Z 0) := by dsimp [rademacherComplexity] let Φ : (Fin m → Ω) → (Fin m → Z) := fun ω' i => S_iid.Z 0 (ω' i) have hmapΦ : Measure.map Φ (Measure.pi fun _ : Fin m => μ) = Measure.pi fun _ : Fin m => μ.map (S_iid.Z 0) := by dsimp [Φ] rw [Measure.pi_map_pi] intro _ exact (S_iid.meas 0).aemeasurable rw [← hmapΦ] rw [integral_map] · rfl · exact (measurable_pi_lambda Φ (fun i => (S_iid.meas 0).comp (measurable_pi_apply i))).aemeasurable · apply Measurable.aestronglyMeasurable apply measurable_const.mul apply Finset.univ.measurable_sum intro σ _ apply Measurable.iSup intro i apply Measurable.abs apply measurable_const.mul apply Finset.univ.measurable_sum intro k _ apply measurable_const.mul exact (hf_meas (idx i)).comp (measurable_pi_apply k) simpa [S_iid.law] using hmap' calc rademacherComplexity m fθ P_Z id = rademacherComplexity m (fθ ∘ idx) P_Z id := hfull_dense _ = rademacherComplexity m (fθ ∘ idx) μ (S_iid.Z 0) := hmap _ ≤ R n := by simpa [m, fθ, Function.comp_def] using (hR n).2 let e : Fin m ≃o split.foldB n := (split.foldB n).orderIsoOfFin rfl let Y : Ω → Fin m → Z := fun ω j => S_iid.Z (e j).val ω have hgood : ¬ (2 • rademacherComplexity m fθ P_Z id + ε ≤ uniformDeviation m fθ P_Z id (id ∘ Y ω)) := by have hoff' := hoff simp only [badDataSet, Set.mem_setOf_eq] at hoff' exact hoff' let θs : S.Θ_set := ⟨θ, hθ⟩ have hdev_lt : uniformDeviation m fθ P_Z id (Y ω) < 2 * R n + ε := by have hnot : uniformDeviation m fθ P_Z id (Y ω) < 2 • rademacherComplexity m fθ P_Z id + ε := by rw [not_le] at hgood simpa using hgood have hrad_two : 2 • rademacherComplexity m fθ P_Z id + ε ≤ 2 * R n + ε := by simpa [two_nsmul] using add_le_add_right (mul_le_mul_of_nonneg_left hrad_full_le (by norm_num : (0 : ℝ) ≤ 2)) ε exact hnot.trans_le hrad_two have hpoint_le_dev : |(m : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin m => fθ θs (Y ω k)) - P_Z[fun z => fθ θs (id z)]| ≤ uniformDeviation m fθ P_Z id (Y ω) := by dsimp [uniformDeviation] apply le_ciSup (f := fun i : S.Θ_set => |(m : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin m => fθ i (Y ω k)) - P_Z[fun z => fθ i (id z)]|) rw [bddAbove_def] use 4 * b intro y hy rcases hy with ⟨θ', rfl⟩ have hsample : |(m : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin m => fθ θ' (Y ω k))| ≤ 2 * b := by calc _ = (m : ℝ)⁻¹ * |Finset.univ.sum fun k : Fin m => fθ θ' (Y ω k)| := by rw [abs_mul, abs_of_nonneg] exact inv_nonneg.mpr (Nat.cast_nonneg _) _ ≤ (m : ℝ)⁻¹ * (Finset.univ.sum fun _ : Fin m => 2 * b) := by apply mul_le_mul_of_nonneg_left · exact Finset.abs_sum_le_sum_abs _ _ |>.trans (Finset.sum_le_sum fun k _ => hf_bdd θ' (Y ω k)) · positivity _ = 2 * b := by rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, ← mul_assoc, inv_mul_cancel₀ hm_pos'.ne', one_mul] have hmean : |P_Z[fun z => fθ θ' (id z)]| ≤ 2 * b := by calc _ ≤ ∫ z, |fθ θ' z| ∂P_Z := abs_integral_le_integral_abs _ ≤ ∫ _z, 2 * b ∂P_Z := by apply integral_mono · exact Integrable.of_bound ((hf_meas θ').abs.aestronglyMeasurable) (2 * b) (by filter_upwards with z simpa [Real.norm_eq_abs] using hf_bdd θ' z) · exact integrable_const (2 * b) · intro z exact hf_bdd θ' z _ = 2 * b := by simp calc |(m : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin m => fθ θ' (Y ω k)) - P_Z[fun z => fθ θ' (id z)]| ≤ |(m : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin m => fθ θ' (Y ω k))| + |P_Z[fun z => fθ θ' (id z)]| := abs_sub _ _ _ ≤ 4 * b := by linarith have hcenter_abs : |(empRiskFoldB S S_iid split n ω θ g - empRiskFoldB S S_iid split n ω S.θ₀ g) - (S.L θ g - S.L S.θ₀ g)| ≤ 2 * R n + ε := by have hsum_reindex : (Finset.univ.sum fun k : Fin m => fθ θs (Y ω k)) = ∑ i ∈ split.foldB n, (S.ℓ (S_iid.Z i ω) θ g - S.ℓ (S_iid.Z i ω) S.θ₀ g) := by have hsum_subtype : (Finset.univ.sum fun k : Fin m => fθ θs (Y ω k)) = ∑ i : split.foldB n, (S.ℓ (S_iid.Z i.val ω) θ g - S.ℓ (S_iid.Z i.val ω) S.θ₀ g) := Fintype.sum_equiv e.toEquiv (fun k => fθ θs (Y ω k)) (fun i : split.foldB n => S.ℓ (S_iid.Z i.val ω) θ g - S.ℓ (S_iid.Z i.val ω) S.θ₀ g) (by intro k; rfl) have hsum_attach : (∑ i : split.foldB n, (S.ℓ (S_iid.Z i.val ω) θ g - S.ℓ (S_iid.Z i.val ω) S.θ₀ g)) = ∑ i ∈ split.foldB n, (S.ℓ (S_iid.Z i ω) θ g - S.ℓ (S_iid.Z i ω) S.θ₀ g) := by simpa using Finset.sum_attach (s := split.foldB n) (f := fun i => S.ℓ (S_iid.Z i ω) θ g - S.ℓ (S_iid.Z i ω) S.θ₀ g) exact hsum_subtype.trans hsum_attach have hmean_eq : (∫ z, fθ θs z ∂P_Z) = S.L θ g - S.L S.θ₀ g := by have hintθ : Integrable (fun z => S.ℓ z θ g) P_Z := Integrable.of_bound (S.ℓ_meas θ g).aestronglyMeasurable b (by filter_upwards with z simpa [Real.norm_eq_abs] using hg_bdd z θ hθ) have hint0 : Integrable (fun z => S.ℓ z S.θ₀ g) P_Z := Integrable.of_bound (S.ℓ_meas S.θ₀ g).aestronglyMeasurable b (by filter_upwards with z simpa [Real.norm_eq_abs] using hg_bdd z S.θ₀ S.θ₀_mem) change (∫ z, S.ℓ z θ g - S.ℓ z S.θ₀ g ∂P_Z) = S.L θ g - S.L S.θ₀ g change (∫ z, S.ℓ z θ g - S.ℓ z S.θ₀ g ∂P_Z) = (∫ z, S.ℓ z θ g ∂P_Z) - (∫ z, S.ℓ z S.θ₀ g ∂P_Z) exact integral_sub hintθ hint0 have hpoint := hpoint_le_dev.trans (le_of_lt hdev_lt) have hpoint' : |(m : ℝ)⁻¹ * -- … truncated; follow the source link for the rest … -
foldBCoord_meastheorem — The fold-B coordinate map is measurable.Proof (Lean source)
@[fun_prop] theorem foldBCoord_meas {S_iid : IIDSample Ω Z μ P_Z} (split : OneShotSplit S_iid) (n : ℕ) : Measurable (foldBCoord S_iid split n) := by apply measurable_pi_lambda intro j exact S_iid.meas _
RandomParam 1 core · 0 supporting This file supplies the measure-theoretic conditioning step used in cross-fitting. ★ randomParam_event_le
Cross-Fit Random Parameter Conditioning
This file supplies the measure-theoretic conditioning step used in cross-fitting. It shows that a fold-A-measurable random choice of a fold-B event inherits the same probability bound as each fixed fold-B event, using independence between the training and validation folds.
The main theorem randomParam_event_le is the cross-fit conditioning lemma:
if the fold-B coordinate map has law ν, the fold-A sigma-algebra is
independent of that coordinate block, and every selected bad set has
ν-mass at most δ, then the random event selected by fold-A data has
μ-mass at most δ.
Cross-fit conditioning keystone. Let Y be measurable with pushforward law μ.map Y = ν, and let m_A be a sub-σ-algebra with m_A ≤ mΩ that is independent of the σ-algebra generated by Y. Suppose the family of "bad" subsets of β indexed by ω has an m_A-measurable joint dependence on (ω, ·) and each individual bad set has ν-mass at most δ. Then the random event where Y ω falls in the ω-dependent bad set also has μ-mass at most δ.