Proposition 4: quantile risk control
ProvedConformalRiskControl.quantile_risk_controlLet be nonempty and compact with , let , and . Let be as in Theorem 1: exchangeable, with non-increasing, right-continuous realisations, and almost surely and . With
the -quantile of the test loss satisfies
where .
Formalization Note The paper does not state the range of . It is taken to be , where the quantile is a finite real number.
import Mathlib import Definitions.Def_ConformalRiskControl_Basic open MeasureTheory ProbabilityTheory Filter
namespace ConformalRiskControl
theorem quantile_risk_control {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
[IsProbabilityMeasure P] (n : ℕ) (hn : 0 < n) (Λ : Set ℝ) (hΛ : IsCompact Λ)
(hΛne : Λ.Nonempty) (B α : ℝ) (hαB : α < B) (β : ℝ) (hβ₀ : 0 < β) (hβ₁ : β ≤ 1)
(L : Fin (n + 1) → Ω → ℝ → ℝ)
(hexch : IsExchangeable P Λ L) (hanti : ∀ i ω, AntitoneOn (L i ω) Λ)
(hrc : ∀ i ω, IsRightContOn Λ (L i ω)) (h5 : ∀ᵐ ω ∂P, ∀ i, LossBounds Λ B α (L i ω)) :
quantile P (fun ω =>
L (Fin.last n) ω (lhatQuantile Λ α β (fun i : Fin n => L i.castSucc ω))) β ≤ α := by sorry
end ConformalRiskControlRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be a measurable space with a probability measure . The theorem assumes the following data and hypotheses:
- an integer ;
- a compact, nonempty set , with (which lies in );
- real numbers and with ;
- a real number with ;
- random functions . For each index and outcome , . The first are the calibration losses and is the test loss. (In the code the indices are , with the last one, , playing the role of .)
Hypotheses on the losses.
-
Exchangeability. For every and every , the map is measurable. View as a random element of with the product -algebra. For every permutation of , its law under equals the law of .
-
Monotonicity. For every and every (not merely almost surely), is non-increasing on .
-
Right-continuity. For every and every , is right-continuous on . That is, at each it is continuous at relative to .
-
Bounds. For -almost every , simultaneously for all :
The here is the same that appears in the conclusion.
The parameter. For each , define the set
Note that the sum runs over the calibration losses only, while the denominator is . The parameter is then
The constant does not enter . If , the set is always empty and ; in particular, this happens whenever .
The test loss and its quantile. Let . The code defines the -quantile as
Two conventions apply to this definition:
- is evaluated as the (outer) measure of the set . No measurability of is assumed.
- The infimum of a set that is empty or unbounded below is taken to be .
Conclusion. Under all of the above hypotheses, the theorem asserts
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.