Theorem 2: nonexchangeable full and split conformal prediction
ProvedConformalBeyondExchangeability.nonexchangeable_conformal_coverageLet the data have an arbitrary joint law . Let be fixed weights with normalized weights (eq. (10)), and let .
- Full conformal. Let be an algorithm on tagged data points with fixed tags (eq. (16)), such that the residual map , with , is measurable. Let be the nonexchangeable full conformal set (eq. (18)), built with the random index drawn independently of . Then
- Split conformal. For a measurable pre-fitted and the interval of eq. (11), the same bound holds with , .
The coverage gap is bounded by the total variation between the residual vectors before and after swapping the test point with each training point. It vanishes for exchangeable data, for any weights and any algorithm.
Formalization Note The probability over is written as , where is the set built with . The paper requires each fitted to be measurable. The statement assumes the residual map is measurable, which makes a random vector and its total variation distances defined. The miscoverage level is the paper's implicit range.
import Mathlib import Definitions.Def_ConformalBeyondExchangeability_Basic open MeasureTheory
namespace ConformalBeyondExchangeability
theorem nonexchangeable_conformal_coverage {X T : Type*} [MeasurableSpace X] {n : ℕ}
(P : Measure (Fin (n + 1) → X × ℝ)) [IsProbabilityMeasure P]
(w : Fin n → ℝ) (hw : ∀ i, 0 ≤ w i ∧ w i ≤ 1) {α : ℝ} (hα0 : 0 < α) (hα1 : α < 1) :
(∀ (alg : TaggedAlg X T) (t : Fin (n + 1) → T), Measurable (residuals alg t) →
1 - α - swapGap P w (residuals alg t) ≤ fullCoverage P alg t w α) ∧
(∀ μ : X → ℝ, Measurable μ →
1 - α - swapGap P w (splitResiduals μ) ≤ splitCoverage P μ w α) := by sorry
end ConformalBeyondExchangeabilityRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
The statement assumes the following:
- and are arbitrary types (feature space and tag space), and carries a σ-algebra; has its Borel σ-algebra.
- is a natural number.
- is a probability measure on . It is the joint law of a data sequence with , where is the test point.
- is a fixed, non-random vector of reals with for every .
- is a real number with .
No independence, exchangeability or other distributional assumption is placed on .
The statement uses the following notation:
- Normalized weights. For ,
These are non-negative and sum to .
- Weighted quantile. For weights and points ,
with .
- Swapped sequence. is with entries and swapped.
- Total variation distance. , where the supremum is over measurable sets .
- Coverage gap. For a map of the data sequence, define
where denotes the law (pushforward of ).
The theorem asserts that both of the following hold.
(1) Full conformal with a tagged, possibly nonsymmetric, algorithm. Let be any function that maps every finite list of tagged points to a function . No symmetry, regularity or measurability of is assumed. Let be any fixed tag sequence.
The residual map is defined by
for , with the list in this order. If is measurable, then
The prediction set is built as follows:
- Let denote with the test response replaced by ; the feature is kept.
- Let be the transposition of and , the identity when .
- Fit
The data are permuted, but the tags stay in their original positions.
- Set for , where is the -th entry of , not of the swapped sequence.
- Finally,
The right-hand side is the probability under a random index drawn independently of , written out as a weighted sum. The event is not assumed measurable. When it is not, is applied as an outer measure.
(2) Split conformal with a fixed model. For every measurable , define
which includes the test residual. Then
where
Again, is applied as an outer measure if this event is not measurable.
Edge cases.
- . There are no training points, and . Both coverage probabilities are then trivially :
- in (1), ;
- in (2), the quantile is .
- Empty tag space. If is empty, no tag sequence exists and part (1) holds vacuously.
- Empty feature space. If is empty, no probability measure exists and the whole statement is vacuous.
- Upper bound on weights. The bound is an extra restriction on the allowed weights. Because the weights are fixed vectors, they cannot depend on the data.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.