Lefebvre's variations, No. 275 — on a theme by Bates, Candes, Lei, Romano and Sesia: the conformal p-values of two test points have correlation 1/4 for two calibration scores
ProvedLefebvreVariations.conformal_pvalue_correlation_two_calibrationLet be uniformly distributed on the permutations of , regarded as the ranks of four scores with no ties; points are calibration points and points are test points. For set
Then
so that for calibration scores.
For scores of exchangeable continuous null points, the conformal p-values of two test points share the same calibration sample and are therefore positively correlated; the general statement is that the pairwise correlation is for every . Only the ranks matter, so for and two test points the claim reduces to the finite computation above.
Formalization Note The expectation is the average over Equiv.Perm (Fin 4) (24 permutations) of rational numbers; calibration index i : Fin 2 is Fin.castAdd 2 i and test index j is Fin.natAdd 2 j. The p-value counts calibration scores that are at least the test score, as in the standard conformal p-value. Variances and covariance are written out as E[X²] - E[X]² and E[XY] - E[X]E[Y].
Why this is a variation. A variation on the open platform problem ConformalOutlierTesting.pairwise_correlation (null conformal p-values have pairwise correlation 1/(n+2)), played at n = 2 calibration scores and two test points, for the identity function G and with the exchangeable continuous scores replaced by a uniform ordering of ranks. It is a special case in distribution, not a formal consequence of the parent as formalised there with general measures.
Attribution. This statement belongs to Lefebvre's variations, a series proposed by Erwan Lefebvre: each variation plays an open problem of the platform at its first non-trivial size, so that it can be settled and then reused to attack the open problem itself.
import Mathlib set_option autoImplicit false
namespace LefebvreVariations
/-- Conformal p-values with `n = 2` calibration scores and two test points, all four scores in uniformly random order (no ties).
Indices `0, 1` are the calibration points and `2, 3` the test points; the score of point `i` is `σ i` for a uniform `σ ∈ S₄`, and the conformal p-value of test point `j` is `(1 + #{calibration scores ≥ its score}) / 3`. The two p-values each have variance `2/27` and covariance `1/54`, so their correlation is `1/4 = 1/(n + 2)`.
Source: Bates, Candès, Lei, Romano, Sesia, *Testing for Outliers with Conformal p-values*, arXiv:2104.08279, Section 2.1, Lemma 1, as recorded by the platform (not re-read). -/
theorem conformal_pvalue_correlation_two_calibration :
let p : Equiv.Perm (Fin 4) → Fin 2 → ℚ := fun σ j =>
(1 + (((Finset.univ : Finset (Fin 2)).filter
fun i => σ (Fin.natAdd 2 j) ≤ σ (Fin.castAdd 2 i)).card : ℚ)) / 3
let E : (Equiv.Perm (Fin 4) → ℚ) → ℚ := fun f => (∑ σ, f σ) / 24
(E (fun σ => p σ 0 ^ 2) - E (fun σ => p σ 0) ^ 2 = 2 / 27) ∧
(E (fun σ => p σ 1 ^ 2) - E (fun σ => p σ 1) ^ 2 = 2 / 27) ∧
(E (fun σ => p σ 0 * p σ 1) - E (fun σ => p σ 0) * E (fun σ => p σ 1) = 1 / 54) := by
sorry
end LefebvreVariations