Corollary 1: conformal risk control with monotonized losses
ProvedConformalRiskControl.monotonized_risk_controlLet be nonempty and compact with , let and . Let be an exchangeable collection of random functions on with right-continuous, possibly non-monotone, realisations. Assume that almost surely and for every . Set
Then
Formalization Note The corollary says "any (possibly non-monotone) function satisfying (5)". The losses are kept right-continuous and exchangeable, as in Theorem 1, from which the corollary is derived. Without right-continuity the claim fails. For example, take on with , , . These losses are monotone, so ; then and .
import Mathlib import Definitions.Def_ConformalRiskControl_Basic open MeasureTheory ProbabilityTheory Filter
namespace ConformalRiskControl
theorem monotonized_risk_control {Ω : 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) (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 => supRight Λ (L i.castSucc ω))))
≤ (α : EReal) := by sorry
end ConformalRiskControlRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be a probability space. Let be a natural number. Let be a nonempty compact set, and write . Because is compact and nonempty, . Let be real numbers with (strict). We are given random loss functions
Each is defined for every real , not only for . The first indices play the role of calibration losses, and the last index is the test loss.
Hypotheses.
-
Exchangeability.
- For every and every , the map is measurable.
- Regard each restricted to as a random element of , with the product -algebra, and regard the whole family as a random element of .
- Then for every permutation of , the joint law under of equals the joint law of .
- Nothing is assumed about the values of outside .
-
Right-continuity, for every (not merely almost surely). For every , every and every , the function is continuous at within .
-
Bounds, almost surely. For -almost every , simultaneously for all :
- for all , and
- .
Monotonized calibration losses. For each calibration index and each , define
This uses the real-valued supremum convention, under which the value is in two cases:
- when the index set is empty, i.e. when ;
- when the family is not bounded above. This can happen only off the almost-sure event of hypothesis 3, since right-continuity alone does not force boundedness.
The parameter. Let
Define as the infimum of the set
which is the same as
If is empty, is set to instead.
Conclusion. Consider the random variable , which is the original, non-monotonized test loss evaluated at . The theorem asserts
as an inequality in the extended reals . Here:
- denotes the lower Lebesgue integral of a -valued function. No measurability of is assumed or asserted.
- The left-hand side lies in and equals .
- When almost surely, the left-hand side is the ordinary expectation , interpreted as if .
- If the integral is infinite, the left-hand side is and the inequality holds trivially.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.