Theorem 2: coverage of weighted conformal prediction
ProvedConformalCovariateShift.weighted_conformal_coverageLet , , be weighted exchangeable with weight functions . Let be a score function and , and define the weighted conformal band at by
with the scores (4) and the weights (15). Then
This extends conformal prediction from exchangeable to weighted exchangeable data.
Formalization Note The score function is assumed measurable as in Theorem 1, and weighted exchangeability is that of the definitions file (permutation-invariant base measure).
import Mathlib import Definitions.Def_ConformalCovariateShift_Basic open MeasureTheory ProbabilityTheory
namespace ConformalCovariateShift
theorem weighted_conformal_coverage {Omega : Type*} [MeasurableSpace Omega] (P : Measure Omega)
[IsProbabilityMeasure P] {d n : ℕ} (Z : Fin (n + 1) → Omega → DataPt d)
(w : Fin (n + 1) → DataPt d → ℝ) (hZ : IsWeightedExchangeable P Z w)
(S : ScoreFn (DataPt d)) (hS : ∀ i, Measurable (fun z : Fin (n + 1) → DataPt d => scores S z i))
(α : ℝ) (hα0 : 0 < α) (hα1 : α < 1) :
ENNReal.ofReal (1 - α) ≤
P {ω | (Z (Fin.last n) ω).2 ∈
weightedConformalBand S α w (fun i => Z i.castSucc ω) (Z (Fin.last n) ω).1} := by sorry
end ConformalCovariateShiftRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be a probability space, and let be natural numbers. Both and are allowed. A data point is a pair , with the product Borel structure. The theorem takes the following inputs:
- random data points , written ;
- real-valued weight functions ;
- a score function that assigns a real number to a data point and a finite multiset of data points;
- a real number with .
Hypothesis 1: weighted exchangeability. The following all hold:
- each is measurable;
- each is measurable and satisfies everywhere;
- there exist a measure on , a measurable function and a function such that:
- is invariant under every permutation of the coordinates;
- the joint law of under equals the measure with density with respect to ;
- for every ,
using the convention ;
- for every permutation and every .
No σ-finiteness of and no measurability of is required.
Hypothesis 2: measurable scores. For , define the score
where the second argument is the multiset of the other points. For each , the map is assumed measurable on .
The band. For a test covariate and a candidate , form the augmented tuple
and write . Define the weights
where both sums run over permutations of .
- If the denominator is , every is defined to be .
- Otherwise the are nonnegative and sum to .
Let be the measure on the extended real line given by
The score itself does not enter . Define
with the infimum of the empty set equal to . Some edge cases:
- If the denominator above is , then , so .
- If the mass at exceeds , then .
- If , then is either or , so in all cases.
The band at is
Here , and the comparison is made in the extended reals. In particular, whenever .
Conclusion. The band is built from and evaluated at . Under the hypotheses above,
If this event is not measurable, here denotes the outer probability. Only this lower bound is asserted; no upper bound on coverage is stated.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.