Theorem 1 (proof), eqs. (12)-(14): coverage conditionally on the proper training set
ProvedConformalizedQuantileRegression.cqr_conditional_coverageLet , , be exchangeable. Partition into disjoint sets with and , fit with a measurable quantile regression algorithm on , let and let be the CQR interval (10)-(11). Then, almost surely,
If moreover the conformity scores , , are almost surely distinct, then, almost surely,
This is the conditional form of Theorem 1 that the paper proves; Theorem 1 follows by taking expectations.
Formalization Note The conditional probability is the conditional expectation of the indicator of the coverage event given the σ-algebra generated by the proper training samples. The split is fixed (deterministic); a random split drawn independently of the data is covered by conditioning on it. The paper's "the conformity scores are almost surely distinct" is read as the scores of the calibration points and the test point, the variables to which Lemma 2 is applied.
import Mathlib import Definitions.Def_ConformalizedQuantileRegression_Basic open MeasureTheory ProbabilityTheory
namespace ConformalizedQuantileRegression
theorem cqr_conditional_coverage {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
[IsProbabilityMeasure P] {p n : ℕ} (Z : Fin (n + 1) → Ω → Sample p) (hZ : IsExchangeable P Z)
(I₁ I₂ : Finset (Fin n)) (hdisj : Disjoint I₁ I₂) (hsplit : I₁ ∪ I₂ = Finset.univ)
(hI₂ : I₂.Nonempty) (A : QRAlgorithm p I₁) (hA : IsMeasurableAlgorithm A)
(α : ℝ) (hα0 : 0 < α) (hα1 : α < 1) :
(∀ᵐ ω ∂P, 1 - α ≤
(P[Set.indicator {ω' | (Z (Fin.last n) ω').2 ∈
cqrInterval A I₂ α (fun i => Z i.castSucc ω') (Z (Fin.last n) ω').1} (fun _ => (1 : ℝ)) |
MeasurableSpace.comap (fun ω' (i : ↥I₁) => Z (Fin.castSucc i.1) ω') inferInstance]) ω) ∧
((∀ᵐ ω ∂P, Set.InjOn
(fun j => conformityScore (fitQR A (fun i => Z i.castSucc ω)).1
(fitQR A (fun i => Z i.castSucc ω)).2 (Z j ω))
(↑(I₂.map Fin.castSuccEmb ∪ {Fin.last n}) : Set (Fin (n + 1)))) →
∀ᵐ ω ∂P,
(P[Set.indicator {ω' | (Z (Fin.last n) ω').2 ∈
cqrInterval A I₂ α (fun i => Z i.castSucc ω') (Z (Fin.last n) ω').1} (fun _ => (1 : ℝ)) |
MeasurableSpace.comap (fun ω' (i : ↥I₁) => Z (Fin.castSucc i.1) ω') inferInstance]) ω ≤
1 - α + 1 / ((I₂.card : ℝ) + 1)) := by sorry
end ConformalizedQuantileRegressionRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a probability space. Fix natural numbers (the feature dimension) and . A sample is a pair .
Random samples. Let be random samples, written . They are assumed exchangeable, which means two things:
- each is measurable, using the Borel structure on ;
- for every permutation of , the joint law of under equals the joint law of .
The first samples are the data, and is the test point.
Data split. Let satisfy:
- ;
- ;
- , which forces .
may be empty.
Algorithm. Let be any map sending a family of samples indexed by to a pair of functions , each from to . is assumed measurable in the following sense: both maps
are jointly measurable. No other property is assumed. In particular, is not assumed.
Miscoverage level. Let be a real number with .
Constructed objects. For each , define the following.
- Fitted functions. . These depend only on the training samples.
- Conformity scores. For every index ,
- Empirical distribution function of the calibration scores:
- Level. . Note that .
- Correction. , taken in the extended reals.
- When , the set is empty and . This happens exactly when .
- Otherwise is a finite real number, and it may be negative.
- Prediction interval.
- This is all of when .
- It is empty whenever .
Conditioning. Let be the σ-algebra generated by the training samples . When , is trivial.
Write for the conditional expectation given , evaluated at , of the indicator of the event
In this event, the interval is built from the fit and calibration scores of the same . Thus is the conditional coverage probability given the training samples. It is defined up to a -null set. By the library's convention, it would be if this indicator were not measurable.
Conclusion. The statement asserts two things.
- Lower bound. For -almost every ,
- Upper bound. Suppose that, for -almost every , the scores for are pairwise distinct. These are the calibration indices together with the test index, all scored with the fit from the training samples. Then, for -almost every ,
This distinctness assumption appears only as the premise of the second claim. It is not a hypothesis of the first claim.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.