Theorem 1: conformal risk control
ProvedConformalRiskControl.risk_control_upper_boundLet be nonempty and compact, with , let , and let be real numbers. Let be an exchangeable collection of random functions. Assume that every realisation of each is non-increasing and right-continuous on , and that almost surely, for every ,
Let be the conformal risk control parameter (eq. 4) computed from . Then
This is the main guarantee of the paper. It extends the coverage guarantee of split conformal prediction to the expected value of any bounded monotone loss.
Formalization Note The losses are bounded above but not below, so the expectation is taken in as . The paper does not specify beyond . Compactness is the assumption under which , so that is defined.
import Mathlib import Definitions.Def_ConformalRiskControl_Basic open MeasureTheory ProbabilityTheory Filter
namespace ConformalRiskControl
theorem risk_control_upper_bound {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
[IsProbabilityMeasure P] (n : ℕ) (hn : 0 < n) (Λ : Set ℝ) (hΛ : IsCompact Λ)
(hΛne : Λ.Nonempty) (B α : ℝ) (hαB : α < B) (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 ω)) :
upperExp P B (fun ω => L (Fin.last n) ω (lhat Λ B α (fun i : Fin n => L i.castSucc ω)))
≤ (α : EReal) := by sorry
end ConformalRiskControlRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a measurable space carrying a probability measure . Fix:
- a natural number with ;
- a set that is compact and nonempty, so that exists and belongs to ;
- real numbers and with . No other sign or range restriction is placed on them; for example, may be negative.
Let be functions , written . In the code the indices are ; here they are relabelled . The first play the role of calibration losses and the last one, , is the test loss. Each is defined on all of , but every hypothesis below concerns only its values on . The functions are assumed to satisfy the following.
- Exchangeability.
- For every and every , the map is measurable.
- For every permutation of , the law under of the random element
equals the law of $\omega \mapsto \big(L_i(\omega)|_\Lambda\big)_{i=1}^{n+1}$.
- Here and its -fold power carry the product -algebras.
-
Monotonicity, for every (not merely almost surely). For every and every , is non-increasing on . That is, in implies .
-
Right-continuity, for every . For every , every and every , the function is continuous at relative to the set .
-
Bounds, almost surely. For -almost every and every :
- for all ;
- .
No lower bound on the losses is assumed.
For each , define the parameter from the calibration losses only. First, the empirical risk is
Then set
where
When is nonempty, its infimum is a genuine real infimum because is bounded. That infimum lies in because is closed, but it need not itself belong to .
Let be the test loss evaluated at this parameter. No measurability of is assumed or required. The quantity bounded is the extended-real number
whose ingredients are as follows:
- the integral is the lower Lebesgue integral of a -valued function;
- the subtraction is performed in the extended reals ;
- because of the truncation , any values of above (possible on the null set where hypothesis 4 fails) are treated as ;
- if the integral is , the quantity equals .
Conclusion:
as an inequality in the extended reals.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.