Appendix A: explicit formula
ProvedConformalizedQuantileRegression.empQuantile_eq_orderStatLet , let be real numbers and let . The empirical quantile , with , is the -th smallest value:
This turns the inf-definition of the empirical quantile into an order statistic, the form in which the quantiles of Algorithm 1 are computed.
import Mathlib import Definitions.Def_ConformalizedQuantileRegression_Basic open MeasureTheory ProbabilityTheory
namespace ConformalizedQuantileRegression
theorem empQuantile_eq_orderStat {n : ℕ} (hn : 0 < n) (z : Fin n → ℝ) (α : ℝ)
(hα0 : 0 < α) (hα1 : α < 1) :
empQuantile Finset.univ z α = (orderStat Finset.univ z ⌈α * n⌉₊ : EReal) := by sorry
end ConformalizedQuantileRegressionRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix a natural number with , real numbers (any real values, ties allowed), and a real number with
All indices are used, so the full sample is involved.
Empirical CDF. For , the empirical distribution function of the values is
Empirical quantile. The empirical -quantile is defined in the extended reals as
By convention, the infimum of the empty set would be , and an unbounded-below set would give . Neither case is excluded by the definition itself.
Order statistic. List the values in non-decreasing order, keeping repeated values. For , the order statistic is the -th entry of this list. If falls outside the range , the definition returns the junk value . With , natural-number subtraction gives , so the first entry is returned.
Rank used. The rank is
the smallest natural number that is at least . Because , this satisfies .
Assertion. The theorem states that, under these hypotheses, the following equality holds in the extended reals:
Here the right-hand side is a real number regarded as an element of . In particular, the statement asserts that the empirical quantile is finite and equals the -th smallest of the .
Scope. The statement covers only levels strictly between and . The endpoint levels and , and levels above , are not addressed.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.