Theorem 1 (proof): iff
ProvedConformalizedQuantileRegression.interval_iff_scoreLet be the quantile functions that a quantile regression algorithm fits on the proper training set, let be the -th empirical quantile of the calibration scores, and let be the CQR interval (10). For every sample , with conformity score ,
This converts coverage of the test response into a comparison of the test score with an empirical quantile of the calibration scores.
Formalization Note The statement holds for every level and every split, as in the paper ("by the construction of the prediction interval"); is valued in the extended reals.
import Mathlib import Definitions.Def_ConformalizedQuantileRegression_Basic open MeasureTheory ProbabilityTheory
namespace ConformalizedQuantileRegression
theorem interval_iff_score {p n : ℕ} {I₁ : Finset (Fin n)} (A : QRAlgorithm p I₁)
(I₂ : Finset (Fin n)) (α : ℝ) (d : Fin n → Sample p) (z : Sample p) :
z.2 ∈ cqrInterval A I₂ α d z.1 ↔
(conformityScore (fitQR A d).1 (fitQR A d).2 z : EReal) ≤ cqrCorrection A I₂ α d := by sorry
end ConformalizedQuantileRegressionRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix natural numbers (feature dimension) and (number of data points). The statement holds for every choice of the following:
- a finite index set ;
- a "quantile regression algorithm" , which is any function at all. It takes a family of samples indexed by and returns a pair of functions , each . No measurability, monotonicity, or ordering is assumed.
- a finite index set . It may be empty, and it may overlap or coincide with it.
- an arbitrary real number , with no restriction to ;
- a data set of points in ;
- an arbitrary point . It need not be one of the data points.
There is no probability measure, exchangeability, or randomness anywhere in the statement. It is a purely deterministic identity about these objects.
Definitions unfolded. The fitted functions are
The conformity score of a sample is
For a finite index set and reals , the empirical CDF is
By the division convention, when .
The empirical quantile at level is the infimum, in the extended reals , of the reals with . It equals when no such exists, and when every real qualifies.
The correction is this empirical quantile, with , of the calibration scores for , at level
When , the term is taken to be , so .
The interval is the set of reals satisfying both
with the comparisons and arithmetic carried out in the extended reals.
Assertion. For all of the above,
where the real number is compared with the extended real .
Edge cases the quantifiers include:
- If , both sides are true. This happens e.g. when , or when and .
- If , both sides are false. This happens e.g. when with , or when and . The interval is then empty, since its lower endpoint is and its upper endpoint is .
- If is a negative real, the interval endpoints may cross, and the interval may be empty.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.