Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (37): deterministic bound behind the upper coverage bound

Proved
ConformalBeyondExchangeability.overcover_weight_lt

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

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

Let w1,…,wn∈[0,1]w_1,\dots,w_n\in[0,1]w1​,…,wn​∈[0,1] with normalized weights w~i\tilde w_iw~i​ (eq. (10)), and let α∈(0,1)\alpha\in(0,1)α∈(0,1). For every r∈Rn+1r\in\mathbb R^{n+1}r∈Rn+1 with distinct entries r1,…,rn+1r_1,\dots,r_{n+1}r1​,…,rn+1​,

∑k=1n+1w~k⋅1{rk≤Q1−α(∑i=1n+1w~πk(i)δri)}<1−α+w~n+1,\sum_{k=1}^{n+1}\tilde w_k\cdot\mathbb 1\Big\{r_k\le\mathsf Q_{1-\alpha}\Big(\sum_{i=1}^{n+1}\tilde w_{\pi_k(i)}\delta_{r_i}\Big)\Big\}<1-\alpha+\tilde w_{n+1},k=1∑n+1​w~k​⋅1{rk​≤Q1−α​(i=1∑n+1​w~πk​(i)​δri​​)}<1−α+w~n+1​,

where πk\pi_kπk​ swaps kkk and n+1n+1n+1.

This is the deterministic inequality (37), from which Theorem 3 follows.

Preamble
import Mathlib
import Definitions.Def_ConformalBeyondExchangeability_Basic

open MeasureTheory
Formal statement
namespace ConformalBeyondExchangeability

theorem overcover_weight_lt {n : ℕ} (w : Fin n → ℝ) (hw : ∀ i, 0 ≤ w i ∧ w i ≤ 1)
    {α : ℝ} (hα0 : 0 < α) (hα1 : α < 1) (r : Fin (n + 1) → ℝ) (hr : Function.Injective r) :
    ∑ k, normWeights w k *
        (if (r k : EReal) ≤
            wQuantile (fun i => normWeights w (swapIdx k i)) (fun i => (r i : EReal)) (1 - α)
          then 1 else 0) <
      1 - α + normWeights w (Fin.last n) := by sorry

end ConformalBeyondExchangeability
Source
Barber, Candès, Ramdas and Tibshirani, Conformal prediction beyond exchangeability, arXiv:2202.13415v5 (2023), Appendix E.2, eq. (37), pp. 44-45
Read-back

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

Setting. The statement fixes:

  • a natural number n≥0n \ge 0n≥0;
  • real weights w1,…,wnw_1, \dots, w_nw1​,…,wn​, each satisfying 0≤wi≤10 \le w_i \le 10≤wi​≤1;
  • a real number α\alphaα with 0<α<10 < \alpha < 10<α<1;
  • a vector r=(r1,…,rn+1)∈Rn+1r = (r_1, \dots, r_{n+1}) \in \mathbb{R}^{n+1}r=(r1​,…,rn+1​)∈Rn+1 that is injective, meaning its n+1n+1n+1 entries are pairwise distinct.

The case n=0n = 0n=0 is allowed. Then there are no weights wiw_iwi​, the injectivity condition holds automatically, and rrr has the single entry r1r_1r1​.

Normalized weights. Let W=w1+⋯+wnW = w_1 + \dots + w_nW=w1​+⋯+wn​, which is 000 when n=0n = 0n=0. The normalized weights w~1,…,w~n+1\tilde w_1, \dots, \tilde w_{n+1}w~1​,…,w~n+1​ are

w~i=wiW+1(1≤i≤n),w~n+1=1W+1.\tilde w_i = \frac{w_i}{W + 1} \quad (1 \le i \le n), \qquad \tilde w_{n+1} = \frac{1}{W + 1}.w~i​=W+1wi​​(1≤i≤n),w~n+1​=W+11​.

Because every wi≥0w_i \ge 0wi​≥0, the denominator satisfies W+1≥1W + 1 \ge 1W+1≥1. Each w~i\tilde w_iw~i​ is therefore nonnegative, and together they sum to 111.

Swapped weights. For each index k∈{1,…,n+1}k \in \{1, \dots, n+1\}k∈{1,…,n+1}, let πk\pi_kπk​ be the transposition of {1,…,n+1}\{1, \dots, n+1\}{1,…,n+1} that exchanges kkk and n+1n+1n+1. When k=n+1k = n+1k=n+1, πk\pi_kπk​ is the identity. Define the swapped weights pi(k)=w~πk(i)p^{(k)}_i = \tilde w_{\pi_k(i)}pi(k)​=w~πk​(i)​. Explicitly:

  • pk(k)=w~n+1p^{(k)}_k = \tilde w_{n+1}pk(k)​=w~n+1​;
  • pn+1(k)=w~kp^{(k)}_{n+1} = \tilde w_kpn+1(k)​=w~k​;
  • pi(k)=w~ip^{(k)}_i = \tilde w_ipi(k)​=w~i​ for every other iii.

Weighted quantile. For each kkk, define Q(k)∈[−∞,+∞]Q^{(k)} \in [-\infty, +\infty]Q(k)∈[−∞,+∞] as the smallest (1−α)(1-\alpha)(1−α)-quantile of the discrete distribution placing mass pi(k)p^{(k)}_ipi(k)​ at rir_iri​:

Q(k)=inf⁡{q∈[−∞,+∞]  :  ∑i : ri≤qpi(k)  ≥  1−α},Q^{(k)} = \inf\Big\{ q \in [-\infty, +\infty] \;:\; \sum_{i \,:\, r_i \le q} p^{(k)}_i \;\ge\; 1 - \alpha \Big\},Q(k)=inf{q∈[−∞,+∞]:i:ri​≤q∑​pi(k)​≥1−α},

where the infimum of the empty set is +∞+\infty+∞.

Claim. Under all the hypotheses above,

∑k=1n+1w~k⋅1{rk≤Q(k)}  <  1−α+w~n+1.\sum_{k=1}^{n+1} \tilde w_k \cdot \mathbf{1}\big\{ r_k \le Q^{(k)} \big\} \;<\; 1 - \alpha + \tilde w_{n+1}.k=1∑n+1​w~k​⋅1{rk​≤Q(k)}<1−α+w~n+1​.

In words: weight each index kkk by w~k\tilde w_kw~k​, and add up the weights of those kkk for which rkr_krk​ does not exceed the (1−α)(1-\alpha)(1−α)-quantile computed with the kkk-swapped weights. The resulting total is strictly less than 1−α+w~n+11 - \alpha + \tilde w_{n+1}1−α+w~n+1​.

The inequality is strict. The hypothesis wi≤1w_i \le 1wi​≤1 is required for every iii, and the entries of rrr must be distinct.

In the degenerate case n=0n = 0n=0, the only index is k=1=n+1k = 1 = n+1k=1=n+1, and the weights are w~1=1\tilde w_1 = 1w~1​=1. The quantile is Q(1)=r1Q^{(1)} = r_1Q(1)=r1​, so the indicator equals 111. The claim then reads 1<2−α1 < 2 - \alpha1<2−α.

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