Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 6: multiplicative bounds under Huber contamination

Proved
ConformalBeyondExchangeability.multiplicative_bounds

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

conformal-predictioncoverage-guaranteesdistribution-free-inferencejackknife-plustotal-variation

Let Z1,…,Zn+1Z_1,\dots,Z_{n+1}Z1​,…,Zn+1​ be independent with laws μ1,…,μn+1\mu_1,\dots,\mu_{n+1}μ1​,…,μn+1​ on X×R\mathcal X\times\mathbb RX×R. Let A\mathcal AA be an algorithm that treats its input points symmetrically, let w1,…,wn∈[0,1]w_1,\dots,w_n\in[0,1]w1​,…,wn​∈[0,1] with w1+⋯+wn>0w_1+\dots+w_n>0w1​+⋯+wn​>0, let wˉi=wi/(w1+⋯+wn)\bar w_i=w_i/(w_1+\dots+w_n)wˉi​=wi​/(w1​+⋯+wn​), and let α∈(0,1)\alpha\in(0,1)α∈(0,1). Write Δ=∑i=1nwˉi dmix(Zi,Zn+1)\Delta=\sum_{i=1}^n\bar w_i\,\mathsf d_{\mathrm{mix}}(Z_i,Z_{n+1})Δ=∑i=1n​wˉi​dmix​(Zi​,Zn+1​).

  1. If the residual map z↦R(z)z\mapsto R(z)z↦R(z) is measurable, the nonexchangeable full conformal set for a symmetric algorithm (eq. (12)) satisfies
P{Yn+1∉C^n(Xn+1)}≤α1−Δ.P\{Y_{n+1}\notin\hat C_n(X_{n+1})\}\le\frac{\alpha}{1-\Delta}.P{Yn+1​∈/C^n​(Xn+1​)}≤1−Δα​.

This includes nonexchangeable split conformal (eq. (11)) as the special case of an algorithm that returns a fixed function. 2. If the leave-two-out residual matrix z↦Rjack+(z)z\mapsto R_{\mathrm{jack+}}(z)z↦Rjack+​(z) is measurable, the nonexchangeable jackknife+ interval for a symmetric algorithm (eq. (33)) satisfies

P{Yn+1∉C^n(Xn+1)}≤2α1−Δ.P\{Y_{n+1}\notin\hat C_n(X_{n+1})\}\le\frac{2\alpha}{1-\Delta}.P{Yn+1​∈/C^n​(Xn+1​)}≤1−Δ2α​.

Under an ϵ\epsilonϵ-Huber contamination model the miscoverage inflates by at most the factor 1/(1−ϵ)1/(1-\epsilon)1/(1−ϵ).

Formalization Note The bounds are stated in [0,∞][0,\infty][0,∞] with x/0=+∞x/0=+\inftyx/0=+∞ for x>0x>0x>0, so the case Δ=1\Delta=1Δ=1, where the right side is +∞+\infty+∞, is included. Independence is the product form of the joint law.

Preamble
import Mathlib
import Definitions.Def_ConformalBeyondExchangeability_Basic

open MeasureTheory
Formal statement
namespace ConformalBeyondExchangeability

theorem multiplicative_bounds {X : Type*} [MeasurableSpace X] {n : ℕ}
    (μ : Fin (n + 1) → Measure (X × ℝ)) [∀ i, IsProbabilityMeasure (μ i)]
    (alg : Alg X) (halg : IsSymmetric alg)
    (w : Fin n → ℝ) (hw : ∀ i, 0 ≤ w i ∧ w i ≤ 1) (hwpos : 0 < ∑ i, w i)
    {α : ℝ} (hα0 : 0 < α) (hα1 : α < 1) :
    (Measurable (symResiduals (n := n) alg) →
      Measure.pi μ {z | (z (Fin.last n)).2 ∉ symFullSet alg w α z} ≤
        ENNReal.ofReal α / ENNReal.ofReal (1 - mixTerm μ w)) ∧
    (Measurable (symJackResiduals (n := n) alg) →
      Measure.pi μ {z | (z (Fin.last n)).2 ∉ symJackInterval alg w α z} ≤
        ENNReal.ofReal (2 * α) / ENNReal.ofReal (1 - mixTerm μ w)) := by sorry

end ConformalBeyondExchangeability
Source
Barber, Candès, Ramdas and Tibshirani, Conformal prediction beyond exchangeability, arXiv:2202.13415v5 (2023), Appendix C, Theorem 6, eqs. (12), (33), (36), p. 41; proof in Appendix E.5, pp. 53-54
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let X\mathcal XX be any measurable space and n≥0n \ge 0n≥0 a natural number. A data point is a pair z=(x,y)∈X×Rz = (x, y) \in \mathcal X \times \mathbb Rz=(x,y)∈X×R. A data sequence z=(z1,…,zn+1)z = (z_1, \dots, z_{n+1})z=(z1​,…,zn+1​) consists of training points z1,…,znz_1, \dots, z_nz1​,…,zn​ and a test point zn+1=(xn+1,yn+1)z_{n+1} = (x_{n+1}, y_{n+1})zn+1​=(xn+1​,yn+1​).

The theorem assumes the following:

  • Distributions. μ1,…,μn+1\mu_1, \dots, \mu_{n+1}μ1​,…,μn+1​ are probability measures on X×R\mathcal X \times \mathbb RX×R. Write P=μ1⊗⋯⊗μn+1P = \mu_1 \otimes \cdots \otimes \mu_{n+1}P=μ1​⊗⋯⊗μn+1​ for their product measure on (X×R)n+1(\mathcal X \times \mathbb R)^{n+1}(X×R)n+1. Under PPP the points Z1,…,Zn+1Z_1, \dots, Z_{n+1}Z1​,…,Zn+1​ are independent, with Zi∼μiZ_i \sim \mu_iZi​∼μi​. No identical-distribution or exchangeability assumption is made.
  • Algorithm. AAA maps every finite list of data points to a function X→R\mathcal X \to \mathbb RX→R. It is assumed symmetric: any two lists that are permutations of each other produce the same fitted function.
  • Weights. w1,…,wnw_1, \dots, w_nw1​,…,wn​ are fixed (non-random) reals with 0≤wi≤10 \le w_i \le 10≤wi​≤1 for each iii, and ∑i=1nwi>0\sum_{i=1}^n w_i > 0∑i=1n​wi​>0. The positivity condition forces n≥1n \ge 1n≥1, since an empty sum is 000.
  • Level. α\alphaα is a real number with 0<α<10 < \alpha < 10<α<1.

Auxiliary notions.

Normalized weights. For i≤ni \le ni≤n and for the test point,

w~i=wiw1+⋯+wn+1,w~n+1=1w1+⋯+wn+1.\tilde w_i = \frac{w_i}{w_1 + \cdots + w_n + 1}, \qquad \tilde w_{n+1} = \frac{1}{w_1 + \cdots + w_n + 1}.w~i​=w1​+⋯+wn​+1wi​​,w~n+1​=w1​+⋯+wn​+11​.

Lower weighted quantile. For masses pip_ipi​ at points vi∈[−∞,+∞]v_i \in [-\infty, +\infty]vi​∈[−∞,+∞],

Qτ(∑ipiδvi)=inf⁡{q∈[−∞,+∞]:∑i:vi≤qpi≥τ},Q_\tau\Big(\sum_i p_i \delta_{v_i}\Big) = \inf\Big\{ q \in [-\infty,+\infty] : \sum_{i : v_i \le q} p_i \ge \tau \Big\},Qτ​(i∑​pi​δvi​​)=inf{q∈[−∞,+∞]:i:vi​≤q∑​pi​≥τ},

with inf⁡∅=+∞\inf \emptyset = +\inftyinf∅=+∞.

Upper weighted quantile.

Qτ+(∑ipiδvi)=sup⁡{q∈[−∞,+∞]:∑i:vi<qpi≤τ}.Q^{+}_\tau\Big(\sum_i p_i \delta_{v_i}\Big) = \sup\Big\{ q \in [-\infty,+\infty] : \sum_{i : v_i < q} p_i \le \tau \Big\}.Qτ+​(i∑​pi​δvi​​)=sup{q∈[−∞,+∞]:i:vi​<q∑​pi​≤τ}.

Contamination distance. For probability measures D,D′D, D'D,D′,

dmix(D,D′)=inf⁡{t∈[0,1]:D=(1−t)D′+tD′′ for some probability measure D′′}.d_{\mathrm{mix}}(D, D') = \inf\big\{ t \in [0,1] : D = (1-t)D' + tD'' \text{ for some probability measure } D'' \big\}.dmix​(D,D′)=inf{t∈[0,1]:D=(1−t)D′+tD′′ for some probability measure D′′}.

The value t=1t = 1t=1 always qualifies (take D′′=DD'' = DD′′=D), so dmix∈[0,1]d_{\mathrm{mix}} \in [0,1]dmix​∈[0,1]. It equals 000 when D=D′D = D'D=D′.

Contamination term. With wˉi=wi/(w1+⋯+wn)\bar w_i = w_i / (w_1 + \cdots + w_n)wˉi​=wi​/(w1​+⋯+wn​), note this normalization has no "+1+1+1" in the denominator:

M=∑i=1nwˉi dmix(μi,μn+1)∈[0,1].M = \sum_{i=1}^n \bar w_i \, d_{\mathrm{mix}}(\mu_i, \mu_{n+1}) \in [0, 1].M=i=1∑n​wˉi​dmix​(μi​,μn+1​)∈[0,1].

Full conformal set. For a hypothesized test label yyy:

  • Let μ^y=A((x1,y1),…,(xn,yn),(xn+1,y))\hat\mu^y = A\big((x_1,y_1), \dots, (x_n,y_n), (x_{n+1}, y)\big)μ^​y=A((x1​,y1​),…,(xn​,yn​),(xn+1​,y)).
  • Let Riy=∣yi−μ^y(xi)∣R^y_i = |y_i - \hat\mu^y(x_i)|Riy​=∣yi​−μ^​y(xi​)∣ for i≤ni \le ni≤n, and Rn+1y=∣y−μ^y(xn+1)∣R^y_{n+1} = |y - \hat\mu^y(x_{n+1})|Rn+1y​=∣y−μ^​y(xn+1​)∣.

Then

C^full(z)={y∈R:Rn+1y≤Q1−α(∑i=1n+1w~i δRiy)}.\hat C^{\mathrm{full}}(z) = \Big\{ y \in \mathbb R : R^y_{n+1} \le Q_{1-\alpha}\Big( \sum_{i=1}^{n+1} \tilde w_i \, \delta_{R^y_i} \Big) \Big\}.C^full(z)={y∈R:Rn+1y​≤Q1−α​(i=1∑n+1​w~i​δRiy​​)}.

The mass w~n+1\tilde w_{n+1}w~n+1​ sits at the test residual Rn+1yR^y_{n+1}Rn+1y​ itself, not at +∞+\infty+∞.

Jackknife+ interval.

  • For i≤ni \le ni≤n, let μ^−i\hat\mu_{-i}μ^​−i​ be AAA applied to the training points zjz_jzj​, j∈{1,…,n}∖{i}j \in \{1,\dots,n\} \setminus \{i\}j∈{1,…,n}∖{i}, listed in index order.
  • Let RiLOO=∣yi−μ^−i(xi)∣R^{\mathrm{LOO}}_i = |y_i - \hat\mu_{-i}(x_i)|RiLOO​=∣yi​−μ^​−i​(xi​)∣.

Then C^J+(z)\hat C^{\mathrm{J+}}(z)C^J+(z) is the set of y∈Ry \in \mathbb Ry∈R such that

Qα+(∑i=1nw~i δμ^−i(xn+1)−RiLOO+w~n+1δ−∞)  ≤  y  ≤  Q1−α(∑i=1nw~i δμ^−i(xn+1)+RiLOO+w~n+1δ+∞).Q^{+}_{\alpha}\Big( \sum_{i=1}^n \tilde w_i \, \delta_{\hat\mu_{-i}(x_{n+1}) - R^{\mathrm{LOO}}_i} + \tilde w_{n+1}\delta_{-\infty} \Big) \;\le\; y \;\le\; Q_{1-\alpha}\Big( \sum_{i=1}^n \tilde w_i \, \delta_{\hat\mu_{-i}(x_{n+1}) + R^{\mathrm{LOO}}_i} + \tilde w_{n+1}\delta_{+\infty} \Big).Qα+​(i=1∑n​w~i​δμ^​−i​(xn+1​)−RiLOO​​+w~n+1​δ−∞​)≤y≤Q1−α​(i=1∑n​w~i​δμ^​−i​(xn+1​)+RiLOO​​+w~n+1​δ+∞​).

Residual vector. R:(X×R)n+1→Rn+1R : (\mathcal X\times\mathbb R)^{n+1} \to \mathbb R^{n+1}R:(X×R)n+1→Rn+1 is defined by

R(z)i=∣yi−μ^(xi)∣,μ^=A(z1,…,zn+1).R(z)_i = |y_i - \hat\mu(x_i)|, \qquad \hat\mu = A(z_1, \dots, z_{n+1}).R(z)i​=∣yi​−μ^​(xi​)∣,μ^​=A(z1​,…,zn+1​).

Residual matrix. RJ+:(X×R)n+1→R(n+1)×(n+1)R^{\mathrm{J+}} : (\mathcal X\times\mathbb R)^{n+1} \to \mathbb R^{(n+1)\times(n+1)}RJ+:(X×R)n+1→R(n+1)×(n+1) has zero diagonal. For i≠ji \ne ji=j,

RJ+(z)ij=∣yi−μ^−ij(xi)∣,R^{\mathrm{J+}}(z)_{ij} = |y_i - \hat\mu_{-ij}(x_i)|,RJ+(z)ij​=∣yi​−μ^​−ij​(xi​)∣,

where μ^−ij\hat\mu_{-ij}μ^​−ij​ is AAA applied to the points zkz_kzk​, k∈{1,…,n+1}∖{i,j}k \in \{1,\dots,n+1\}\setminus\{i,j\}k∈{1,…,n+1}∖{i,j}, in index order.

Conclusion. Both of the following hold.

  1. Full conformal. If the map z↦R(z)z \mapsto R(z)z↦R(z) is measurable, then
P{Z:Yn+1∉C^full(Z)}  ≤  αmax⁡(1−M,0).P\big\{ Z : Y_{n+1} \notin \hat C^{\mathrm{full}}(Z) \big\} \;\le\; \frac{\alpha}{\max(1 - M, 0)}.P{Z:Yn+1​∈/C^full(Z)}≤max(1−M,0)α​.
  1. Jackknife+. If the map z↦RJ+(z)z \mapsto R^{\mathrm{J+}}(z)z↦RJ+(z) is measurable, then
P{Z:Yn+1∉C^J+(Z)}  ≤  2αmax⁡(1−M,0).P\big\{ Z : Y_{n+1} \notin \hat C^{\mathrm{J+}}(Z) \big\} \;\le\; \frac{2\alpha}{\max(1 - M, 0)}.P{Z:Yn+1​∈/C^J+(Z)}≤max(1−M,0)2α​.

How to read the bounds.

  • Both bounds are inequalities in [0,+∞][0, +\infty][0,+∞], and the right-hand sides are not capped at 111.
  • If M=1M = 1M=1, the denominator is 000 and the bound is +∞+\infty+∞, so the claim is vacuous.
  • If all μi=μn+1\mu_i = \mu_{n+1}μi​=μn+1​, then M=0M = 0M=0 and the bounds are α\alphaα and 2α2\alpha2α.
  • The measurability hypotheses concern only RRR and RJ+R^{\mathrm{J+}}RJ+ evaluated at the observed data. Nothing is assumed about measurability of C^full\hat C^{\mathrm{full}}C^full, C^J+\hat C^{\mathrm{J+}}C^J+, or the non-coverage events. If an event is not measurable, PPP of it means its outer measure.
Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me