Theorem 3: upper bound on the coverage of nonexchangeable conformal prediction
ProvedConformalBeyondExchangeability.nonexchangeable_conformal_overcoverageLet the data have an arbitrary joint law , let with normalized weights , and let .
- Full conformal. Let be a tagged algorithm with fixed tags whose residual map is measurable. If are distinct with probability , then the nonexchangeable full conformal set (eq. (18)) satisfies
- Split conformal. For a measurable pre-fitted whose residuals , , are distinct with probability , the interval of eq. (11) satisfies the same bound with .
Together with Theorem 2, this shows that mild violations of exchangeability cause only mild over-coverage when is small.
Formalization Note "Distinct with probability 1" in the full conformal case refers to the pair . It is written as .
import Mathlib import Definitions.Def_ConformalBeyondExchangeability_Basic open MeasureTheory
namespace ConformalBeyondExchangeability
theorem nonexchangeable_conformal_overcoverage {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) →
randIndexProb P w
(fun k => {z | Function.Injective (swapResiduals alg t z (z (Fin.last n)).2 k)}) = 1 →
fullCoverage P alg t w α <
1 - α + normWeights w (Fin.last n) + swapGap P w (residuals alg t)) ∧
(∀ μ : X → ℝ, Measurable μ → (∀ᵐ z ∂P, Function.Injective (splitResiduals μ z)) →
splitCoverage P μ w α <
1 - α + normWeights w (Fin.last n) + swapGap P w (splitResiduals μ)) := by sorry
end ConformalBeyondExchangeabilityRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be a measurable space and an arbitrary set of "tags" (no structure assumed). Let be a natural number; is allowed. Data sequences are with . Index is the test point and are the training points. Let be any probability measure on with the product σ-algebra, and write with . No exchangeability, independence or other structure is assumed on .
Let be real weights with for every , and let satisfy . The normalized weights are
These are nonnegative, sum to , and satisfy .
Auxiliary notions.
- Weighted quantile. For masses at points , the smallest -quantile is
with .
- Swap. is the transposition of and ; it is the identity if . The swapped sequence has entries .
- Total variation. For measures , over measurable sets , where the measures are evaluated as real numbers.
- Gap term. For a map of the data sequence,
Here is the pushforward of under , and is the pushforward under .
The theorem asserts that both of the following statements hold.
(1) Full conformal with a tagged algorithm. Take any map from finite lists of triples to functions . No measurability or symmetry is assumed on . Take any tags . If is empty, no such tags exist and this part is vacuous.
Define the following objects.
- The residual map , where is fitted on all points in order.
- For , the swapped-model residuals for . Here : the data are swapped, but the tags stay in position.
Suppose two hypotheses hold:
- (a) is measurable.
- (b) The following identity holds:
Since the are nonnegative and sum to , this forces probability for every with , in particular for . If an event is not measurable, is evaluated as an outer measure.
Then the conclusion is
The left side is the coverage, under , of the full conformal set obtained by plugging in , averaged over an independent index drawn with probability .
(2) Split conformal. Take any measurable function , and set for . Suppose that for -almost every , the values are pairwise distinct. Then
Remarks on strength and edge cases.
- Both conclusions are strict upper bounds on coverage. Neither part asserts a lower bound.
- If , the gap terms are empty sums and . The right-hand sides then equal .
- If all , then and . The bound is again .
- In general the right-hand side is at least and may exceed .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.