Lower bound for one-feature regression.
ProvedLogic.PhaseRoute.msse_affine_lower_boundaether-cataloglogic
Lower bound for one-feature regression. No affine function of a single
feature f can beat varr y - cov y f ^ 2 / varr f.
theorem Logic.PhaseRoute.msse_affine_lower_bound{y f : ι → ℝ} (hf : 0 < varr f) (a b : ℝ) :
varr y - cov y f * cov y f / varr f ≤ msse y (fun i => a * f i + b) := by sorry
Formalization Note Transplanted verbatim from the Aether Catalog source Logic/PhaseRouteLeastSquares.lean; the statement is byte-identical to the source declaration, elaborated with autoImplicit disabled in the platform environment.
Preamble
-- Thm stub generated from Logic/PhaseRouteLeastSquares.lean
import Mathlib
import Definitions.Def_Logic_PhaseRouteLeastSquares
/-
# Finite-sample least squares: the exact incremental-`R²` calculus
This file builds, from scratch, the algebraic core needed to state and prove
*negative* results about feature encodings in a finite-sample linear model:
* `Logic.PhaseRoute.avg`, `cov`, `varr` — empirical mean / covariance / variance,
* `Logic.PhaseRoute.msse` — mean squared error of a predictor,
* `Logic.PhaseRoute.Rsq` — coefficient of determination against the
constant (intercept-only) baseline.
The main results are exact identities, not inequalities-with-slack:
* `msse_decomp` : `msse y h = varr y - 2*cov y h + varr h + (avg y - avg h)^2`,
the complete bias/variance/alignment split of the error of *any* predictor;
* `msse_ge_varr_of_cov_eq_zero` and its strict form `msse_gt_varr_of_cov_eq_zero`
: a predictor uncorrelated with the target is *never* useful and is strictly
harmful unless it is constant;
* `msse_affine_lower_bound` / `msse_affine_opt` : the optimal single-feature
affine fit and its exact error, hence
* `Rsq_affine_le_corr_sq` / `Rsq_affine_opt_eq_corr_sq` : the best attainable
`R²` of a one-feature model is *exactly* the squared empirical correlation.
As a by-product we derive Cauchy–Schwarz for the empirical covariance
(`cov_sq_le`) from the regression identity rather than the other way round.
This is the "dial" calculus used in `Logic.PhaseRouteAlignment` to prove that a
whole family of encodings is provably worthless while a degree-`2` interaction
encoding is provably perfect.
-/
open Logic.PhaseRoute
open Finset
variable {ι : Type*} [Fintype ι] [Nonempty ι]
/-! ### Linearity of the empirical mean -/
/-! ### Variance -/
/-! ### The exact error decomposition -/
/-! ### Uncorrelated predictors are useless, and strictly harmful unless constant -/
/-! ### The optimal single-feature affine model -/Formal statement
theorem Logic.PhaseRoute.msse_affine_lower_bound{y f : ι → ℝ} (hf : 0 < varr f) (a b : ℝ) :
varr y - cov y f * cov y f / varr f ≤ msse y (fun i => a * f i + b) := by sorrySource