An actual Gaussian joint-data risk has a first variation
AutoSamplingTheory.TechnicalLemmas.Probability.GaussianPolynomialRisk.gaussian_polynomial_joint_risk_first_variation · theorem · Teaching coverage
Mathematical statement
Let P be an actual probability law on E×ℝ, where E is a finite-dimensional real inner-product space with its Borel structure. Assume only that its input marginal is the standard Gaussian and its actual response coordinate Y is square-integrable. Let p be any finite real polynomial. For any probability ρ on the unit sphere define fρ(x)=∫p(⟨w,x⟩) dρ(w), F(ρ)=∫(fρ(x)−y)² dP(x,y), and Vρ(w)=2∫(fρ(x)−y)p(⟨w,x⟩) dP(x,y). Every squared loss is integrable, and every displayed inner residual-feature product is integrable at every unit direction. For any two parameter probabilities ρ₀,ρ₁, Vρ₀ is integrable under both laws. The actual scalar risk along (1−t)ρ₀+tρ₁ has right derivative ∫Vρ₀ dρ₁−∫Vρ₀ dρ₀ at zero, and F(ρ₁)≥F(ρ₀)+∫Vρ₀ dρ₁−∫Vρ₀ dρ₀.
Lean statement · gaussian_polynomial_joint_risk_first_variation
Let P be an actual probability law on E×ℝ, where E is a finite-dimensional real inner-product space with its Borel structure. Assume only that its input marginal is the standard Gaussian and its actual response coordinate Y is square-integrable. Let p be any finite real polynomial. For any probability ρ on the unit sphere define fρ(x)=∫p(⟨w,x⟩) dρ(w), F(ρ)=∫(fρ(x)−y)² dP(x,y), and Vρ(w)=2∫(fρ(x)−y)p(⟨w,x⟩) dP(x,y). Every squared loss is integrable, and every displayed inner residual-feature product is integrable at every unit direction. For any two parameter probabilities ρ₀,ρ₁, Vρ₀ is integrable under both laws. The actual scalar risk along (1−t)ρ₀+tρ₁ has right derivative ∫Vρ₀ dρ₁−∫Vρ₀ dρ₀ at zero, and F(ρ₁)≥F(ρ₀)+∫Vρ₀ dρ₁−∫Vρ₀ dρ₀.
Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.
theorem gaussian_polynomial_joint_risk_first_variation
{E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
(P : Measure (E × ℝ)) [IsProbabilityMeasure P]
(hGaussian : P.map Prod.fst = ProbabilityTheory.stdGaussian E)
(p : Polynomial ℝ)
(hlabel : MemLp (fun z : E × ℝ => z.2) 2 P) :
let U := {w : E // ‖w‖ = 1}
let predictor : Measure U → E → ℝ := fun rho x => ∫ w : U, p.eval ⟪w.1,x⟫_ℝ ∂rho
let risk : Measure U → ℝ := fun rho => ∫ z, (predictor rho z.1 - z.2)^2 ∂P
let potential : Measure U → U → ℝ := fun rho w =>
2 * ∫ z, (predictor rho z.1 - z.2) * p.eval ⟪w.1,z.1⟫_ℝ ∂P
(∀ rho : Measure U, IsProbabilityMeasure rho →
Integrable (fun z : E × ℝ => (predictor rho z.1 - z.2)^2) P ∧
∀ w : U, Integrable (fun z : E × ℝ =>
(predictor rho z.1 - z.2) * p.eval ⟪w.1,z.1⟫_ℝ) P) ∧
∀ rho0 rho1 : Measure U, IsProbabilityMeasure rho0 → IsProbabilityMeasure rho1 →
let curve : ℝ → Measure U := fun t =>
ENNReal.ofReal (1-t) • rho0 + ENNReal.ofReal t • rho1
Integrable (potential rho0) rho0 ∧ Integrable (potential rho0) rho1 ∧
HasDerivWithinAt (fun t => risk (curve t))
((∫ w, potential rho0 w ∂rho1) - (∫ w, potential rho0 w ∂rho0))
(Set.Icc (0 : ℝ) 1) 0 ∧
risk rho0 + ((∫ w, potential rho0 w ∂rho1) - (∫ w, potential rho0 w ∂rho0)) ≤
risk rho1Proof roadmap
- 1Pull the actual mean to the joint data law
The first-coordinate map preserves the actual marginal measures. Its continuous linear L² isometry commutes with Bochner integration, transporting the scalar-average class identity to L²(P).
- 2Identify the true squared risk
Subtract the actual label class. Its squared norm is the literal integrated squared residual. Cauchy–Schwarz also gives genuine residual-feature product integrability at every direction.
- 3Identify the actual potential
Almost-everywhere representative identities give the exact residual-feature inner-product formula. The bounded linear residual functional proves integrability of this scalar potential under both parameter laws.
- 4Use the positive probability segment
Apply the actual probability-segment mean calculus, and identify its norm risk with the literal scalar risk at every point of the interval. Restriction at zero gives the stated right derivative.
- 5Obtain linear convexity
The difference between the risk increment and the potential pairing is the squared mean increment. Its nonnegativity gives the supporting inequality with the correct sign and factor two.
Full assumptions and notation
All objects and hypotheses
- E has finite-dimensional real inner-product and Borel structures. P is a true joint probability with standard Gaussian first marginal.
- p is any finite real polynomial, and the actual second-coordinate response belongs to L²(P). Input and response need not be independent.
Mathematical proof
1. Pull the actual mean to the joint data law
The first-coordinate map preserves the actual marginal measures. Its continuous linear L² isometry commutes with Bochner integration, transporting the scalar-average class identity to L²(P).
Corresponding Lean step
The exact statement and proof are available in the adjacent initially folded Lean.
2. Identify the true squared risk
Subtract the actual label class. Its squared norm is the literal integrated squared residual. Cauchy–Schwarz also gives genuine residual-feature product integrability at every direction.
Corresponding Lean step
The exact statement and proof are available in the adjacent initially folded Lean.
3. Identify the actual potential
Almost-everywhere representative identities give the exact residual-feature inner-product formula. The bounded linear residual functional proves integrability of this scalar potential under both parameter laws.
Corresponding Lean step
The exact statement and proof are available in the adjacent initially folded Lean.
4. Use the positive probability segment
Apply the actual probability-segment mean calculus, and identify its norm risk with the literal scalar risk at every point of the interval. Restriction at zero gives the stated right derivative.
Corresponding Lean step
The exact statement and proof are available in the adjacent initially folded Lean.
5. Obtain linear convexity
The difference between the risk increment and the potential pairing is the squared mean increment. Its nonnegativity gives the supporting inequality with the correct sign and factor two.
Corresponding Lean step
The exact statement and proof are available in the adjacent initially folded Lean.
Lean verification
The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.
Lean proof · gaussian_polynomial_joint_risk_first_variation
The formula proof above explains the mathematical moves; the adjacent folded Lean gives their exact implementation.
Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.
theorem gaussian_polynomial_joint_risk_first_variation
{E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
(P : Measure (E × ℝ)) [IsProbabilityMeasure P]
(hGaussian : P.map Prod.fst = ProbabilityTheory.stdGaussian E)
(p : Polynomial ℝ)
(hlabel : MemLp (fun z : E × ℝ => z.2) 2 P) :
let U := {w : E // ‖w‖ = 1}
let predictor : Measure U → E → ℝ := fun rho x => ∫ w : U, p.eval ⟪w.1,x⟫_ℝ ∂rho
let risk : Measure U → ℝ := fun rho => ∫ z, (predictor rho z.1 - z.2)^2 ∂P
let potential : Measure U → U → ℝ := fun rho w =>
2 * ∫ z, (predictor rho z.1 - z.2) * p.eval ⟪w.1,z.1⟫_ℝ ∂P
(∀ rho : Measure U, IsProbabilityMeasure rho →
Integrable (fun z : E × ℝ => (predictor rho z.1 - z.2)^2) P ∧
∀ w : U, Integrable (fun z : E × ℝ =>
(predictor rho z.1 - z.2) * p.eval ⟪w.1,z.1⟫_ℝ) P) ∧
∀ rho0 rho1 : Measure U, IsProbabilityMeasure rho0 → IsProbabilityMeasure rho1 →
let curve : ℝ → Measure U := fun t =>
ENNReal.ofReal (1-t) • rho0 + ENNReal.ofReal t • rho1
Integrable (potential rho0) rho0 ∧ Integrable (potential rho0) rho1 ∧
HasDerivWithinAt (fun t => risk (curve t))
((∫ w, potential rho0 w ∂rho1) - (∫ w, potential rho0 w ∂rho0))
(Set.Icc (0 : ℝ) 1) 0 ∧
risk rho0 + ((∫ w, potential rho0 w ∂rho1) - (∫ w, potential rho0 w ∂rho0)) ≤
risk rho1 := by
classical
letI : CompleteSpace E := FiniteDimensional.complete ℝ E
dsimp only
let U := {w : E // ‖w‖ = 1}
let K : U → E → ℝ := fun w x => p.eval ⟪w.1,x⟫_ℝ
let predictor : Measure U → E → ℝ := fun rho x => ∫ w, K w x ∂rho
let risk : Measure U → ℝ := fun rho => ∫ z, (predictor rho z.1-z.2)^2 ∂P
let potential : Measure U → U → ℝ := fun rho w =>
2 * ∫ z, (predictor rho z.1-z.2) * K w z.1 ∂P
change (∀ rho : Measure U, IsProbabilityMeasure rho →
Integrable (fun z : E × ℝ => (predictor rho z.1-z.2)^2) P ∧
∀ w : U, Integrable (fun z : E × ℝ => (predictor rho z.1-z.2) * K w z.1) P) ∧
∀ rho0 rho1 : Measure U, IsProbabilityMeasure rho0 → IsProbabilityMeasure rho1 →
let curve : ℝ → Measure U := fun t => ENNReal.ofReal (1-t) • rho0 + ENNReal.ofReal t • rho1
Integrable (potential rho0) rho0 ∧ Integrable (potential rho0) rho1 ∧
HasDerivWithinAt (fun t => risk (curve t))
((∫ w, potential rho0 w ∂rho1)-(∫ w, potential rho0 w ∂rho0)) (Set.Icc (0 : ℝ) 1) 0 ∧
risk rho0 + ((∫ w, potential rho0 w ∂rho1)-(∫ w, potential rho0 w ∂rho0)) ≤ risk rho1
obtain ⟨hf,hcont,havg⟩ := AutoSamplingTheory.TechnicalLemmas.Probability.GaussianPolynomialAveraging.gaussian_polynomial_parameter_average_L2 (E := E) p
have hmarg : MeasurePreserving (Prod.fst : E × ℝ → E) P (stdGaussian E) :=
⟨measurable_fst,hGaussian⟩
let T : Lp ℝ 2 (stdGaussian E) →L[ℝ] Lp ℝ 2 P :=
(Lp.compMeasurePreservingₗᵢ ℝ Prod.fst hmarg).toContinuousLinearMap
let hfP : ∀ w : U, MemLp (fun z : E × ℝ => K w z.1) 2 P :=
fun w => (hf w).comp_measurePreserving hmarg
let feature : U → Lp ℝ 2 P := fun w => (hfP w).toLp (fun z => K w z.1)
let label : Lp ℝ 2 P := hlabel.toLp (fun z : E × ℝ => z.2)
let mean : Measure U → Lp ℝ 2 P := fun rho => ∫ w, feature w ∂rho
have hFint (rho : Measure U) (hrho : IsProbabilityMeasure rho) : Integrable feature rho := by
have h := T.integrable_comp (havg rho hrho).2.1
exact h
have hMeanClass (rho : Measure U) (hrho : IsProbabilityMeasure rho) :
∃ hpred : MemLp (fun z : E × ℝ => predictor rho z.1) 2 P,
hpred.toLp (fun z => predictor rho z.1) = mean rho := by
obtain ⟨hscalar,hint,hmean,hident⟩ := havg rho hrho
let hpred : MemLp (fun z : E × ℝ => predictor rho z.1) 2 P :=
hmean.comp_measurePreserving hmarg
refine ⟨hpred, ?_⟩
calc
hpred.toLp (fun z => predictor rho z.1) = T (hmean.toLp (predictor rho)) := rfl
_ = T (∫ w, (hf w).toLp (K w) ∂rho) := congrArg T hident
_ = mean rho := (T.integral_comp_comm hint).symm
have hMeanAE (rho : Measure U) (hrho : IsProbabilityMeasure rho) :
(fun z => mean rho z) =ᵐ[P] (fun z : E × ℝ => predictor rho z.1) := by
obtain ⟨hpred,hident⟩ := hMeanClass rho hrho
rw [← hident]
exact hpred.coeFn_toLp
have hResidual (rho : Measure U) (hrho : IsProbabilityMeasure rho) :
(fun z => (mean rho-label) z) =ᵐ[P] (fun z : E × ℝ => predictor rho z.1-z.2) := by
filter_upwards [Lp.coeFn_sub (mean rho) label, hMeanAE rho hrho,hlabel.coeFn_toLp]
with z hsub hm hy
simp only [Pi.sub_apply] at hsub
rw [hsub,hm,hy]
have hRisk (rho : Measure U) (hrho : IsProbabilityMeasure rho) :
risk rho = ‖mean rho-label‖^2 := by
rw [← real_inner_self_eq_norm_sq, L2.inner_def]
apply integral_congr_ae
filter_upwards [hResidual rho hrho] with z hz
simp only [risk,Real.inner_apply,hz,pow_two]
have hPot (rho : Measure U) (hrho : IsProbabilityMeasure rho) :
potential rho = fun w => 2 * ⟪mean rho-label,feature w⟫_ℝ := by
funext w
change 2 * (∫ z, (predictor rho z.1-z.2) * K w z.1 ∂P) = _
rw [L2.inner_def]
congr 1
apply integral_congr_ae
filter_upwards [hResidual rho hrho,(hfP w).coeFn_toLp] with z hr hw
change feature w z = K w z.1 at hw
simp only [Real.inner_apply,hr,hw]
refine ⟨?_,?_⟩
· intro rho hrho
obtain ⟨hpred,hident⟩ := hMeanClass rho hrho
exact ⟨(hpred.sub hlabel).integrable_sq,fun w =>
(hpred.sub hlabel).integrable_mul (hfP w)⟩
· intro rho0 rho1 h0 h1
letI : IsProbabilityMeasure rho0 := h0
letI : IsProbabilityMeasure rho1 := h1
dsimp only
let curve : ℝ → Measure U := fun t => ENNReal.ofReal (1-t) • rho0 + ENNReal.ofReal t • rho1
have hc := AutoSamplingTheory.TechnicalLemmas.Analysis.ProbabilitySegmentRisk.quadratic_feature_probability_segment
rho0 rho1 feature label (hFint rho0 h0) (hFint rho1 h1)
dsimp only at hc
rcases hc with ⟨hprops,hpot0,hpot1,hderiv,hbre,hsupport⟩
rw [hPot rho0 h0]
refine ⟨hpot0,hpot1,?_,?_⟩
· apply hderiv.congr_of_mem
· intro t ht
exact hRisk (curve t) (hprops t ht).1
· exact ⟨le_rfl,zero_le_one⟩
· rw [hRisk rho0 h0,hRisk rho1 h1]
exact hsupport
end AutoSamplingTheory.TechnicalLemmas.Probability.GaussianPolynomialRiskScope and omitted-condition boundaries
- The potential is a constructed canonical first-variation representative. No pointwise identification with an unspecified preselected first variation is asserted.
- The derivative is within the probability interval. Spatial gradient bounds, Wasserstein regularity, stochastic dynamics and statistical convergence are separate results.
Sources, dependencies, and reuse
Source and reuse
Samplinglib parents called
AutoSamplingTheory.TechnicalLemmas.Probability.GaussianPolynomialAveraging.gaussian_polynomial_parameter_average_L2AutoSamplingTheory.TechnicalLemmas.Analysis.ProbabilitySegmentRisk.quadratic_feature_probability_segment
Mathlib API called (external library)
- MeasureTheory.Lp.compMeasurePreservingₗᵢ
- ContinuousLinearMap.integral_comp_comm
- MeasureTheory.MemLp.comp_measurePreserving
- MeasureTheory.MemLp.integrable_mul
- MeasureTheory.L2.inner_def
- HasDerivWithinAt.congr_of_mem
Mathematical sources
- Samplinglib original probability and Gaussian feature regularity supplement v1 (2026-10-20) (historical source) — Original generic mathematical supplement from the cited pinned library prerequisites; no primary-textbook theorem or statistical convergence credit.
Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.