Lemma 1: quantiles and exchangeability
ProvedConformalizedQuantileRegression.quantile_exchangeabilityLet and let be exchangeable real random variables, and let be their empirical quantile function. For every ,
If moreover are almost surely distinct, then also
The probabilities are over all of . This is the basic rank argument behind every coverage guarantee of the paper.
Formalization Note is the variable with index in Lean's -based indexing. "Almost surely distinct" is the statement that almost surely is injective. The empirical quantile is valued in the extended reals; for it is finite.
import Mathlib import Definitions.Def_ConformalizedQuantileRegression_Basic open MeasureTheory ProbabilityTheory
namespace ConformalizedQuantileRegression
theorem quantile_exchangeability {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
[IsProbabilityMeasure P] {n : ℕ} (hn : 0 < n) (Z : Fin n → Ω → ℝ) (hZ : IsExchangeable P Z)
(α : ℝ) (hα0 : 0 < α) (hα1 : α < 1) :
ENNReal.ofReal α ≤
P {ω | (Z ⟨n - 1, by omega⟩ ω : EReal) ≤ empQuantile Finset.univ (fun i => Z i ω) α} ∧
((∀ᵐ ω ∂P, Function.Injective (fun i => Z i ω)) →
P {ω | (Z ⟨n - 1, by omega⟩ ω : EReal) ≤ empQuantile Finset.univ (fun i => Z i ω) α} ≤
ENNReal.ofReal (α + 1 / (n : ℝ))) := by sorry
end ConformalizedQuantileRegressionRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a probability space, a natural number, and real-valued functions. The statement indexes them by ; here they are written , so the distinguished variable at index is the last one, .
Hypothesis: exchangeability. The sequence is assumed exchangeable under , meaning:
- each is measurable, and
- for every permutation of , the random vector has the same joint law on as .
Hypothesis on the level. Let be a real number with .
The empirical quantile. For each outcome , define the empirical distribution function of all values , including itself:
The empirical -quantile is the infimum, taken in the extended reals :
This infimum would be if the set were empty. For , however, the set is nonempty and bounded below, so is a real number.
The event. Consider the event
Conclusion. The statement asserts two things.
- Without further assumptions,
- Suppose additionally that, for -almost every , the values are pairwise distinct. That is, the set of with a tie is contained in a -null set. Then
Edge cases and remarks.
- Both bounds are stated as comparisons of probabilities with nonnegative numbers. Since , no truncation at occurs.
- The upper bound in part 2 may exceed , in which case it is trivially true. For example, when the quantile is itself, so is the whole space and , while .
- No condition relates to .
- The only distributional assumption is exchangeability. No independence or continuity of the laws is assumed, apart from the almost-sure distinctness hypothesis in part 2.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.