Lemma 1: null conformal p-values have pairwise correlation 1/(n+2)
ProvedConformalOutlierTesting.pairwise_correlationLet the calibration scores be i.i.d. with a continuous (atomless) law . Let test points be inliers, so their scores have law , and let all test scores be independent of each other and of the calibration data. Let be finite-valued and not constant on the grid . Then
So null conformal p-values are positively correlated after any transformation. This makes the variance of a combination statistic larger than under independence.
Formalization Note The paper allows any finite-valued . If is constant on the grid, both variances are and the correlation is undefined. The hypothesis that takes two different values on the grid is therefore added.
import Mathlib import Definitions.Def_ConformalOutlierTesting_Basic open MeasureTheory ProbabilityTheory Filter Topology Set BoundedContinuousFunction
namespace ConformalOutlierTesting
theorem pairwise_correlation {n m : ℕ} (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ]
(ν : Fin m → Measure ℝ) [∀ j, IsProbabilityMeasure (ν j)] (I : Finset (Fin m))
(hI : ∀ j ∈ I, ν j = μ) (i j : Fin m) (hi : i ∈ I) (hj : j ∈ I) (hij : i ≠ j)
(G : ℝ → ℝ)
(hG : ∃ k k' : ℕ, 1 ≤ k ∧ k ≤ n + 1 ∧ 1 ≤ k' ∧ k' ≤ n + 1 ∧
G ((k : ℝ) / (n + 1)) ≠ G ((k' : ℝ) / (n + 1))) :
corr (scoreLaw (n := n) μ ν) (fun ω => G (margPvals ω i)) (fun ω => G (margPvals ω j)) =
1 / ((n : ℝ) + 2) := by sorry
end ConformalOutlierTestingRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be natural numbers. The hypotheses are:
- Calibration law. is a probability measure on that assigns measure zero to every single point, so has no atoms.
- Test laws. For each test index , is a probability measure on .
- Inlier indices. is a finite set of test indices with for every . No condition is placed on for .
- Two distinct inliers. are two test indices with , and . Such a pair exists only when .
- The function . is an arbitrary function, with no measurability, continuity or monotonicity assumed. It must satisfy one condition: there exist integers with and such that
In words, is not constant on the grid . When the grid is the single point , so the condition cannot be satisfied and the statement holds vacuously. The statement therefore has content only for .
The probability space. The sample space consists of pairs . Here are the calibration scores and are the test scores. The probability measure on this space is the product measure
Under :
- are i.i.d. with law ;
- the are mutually independent and independent of ;
- each has law .
The marginal conformal p-value. For a test score , the marginal conformal p-value is
It always takes one of the values . Define the two random variables
The conclusion. The theorem asserts the exact equality
The correlation is computed under and is defined as
where:
- ;
- is the variance, which is taken to be if it is infinite;
- an integral of a non-integrable function is taken to be ;
- division by yields , so the correlation is whenever the product of the variances is .
The asserted value does not depend on , on , on , on the laws of the other test points, or on beyond its being an atomless probability measure.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.