Theorem 4: conditional p-value adjustment
ProvedConformalOutlierTesting.conditional_pvalue_adjustmentLet be i.i.d. uniform on with order statistics , and fix . Let satisfy
let and , and let for . Let the calibration scores be i.i.d. with law , and let be an inlier whose score has law and is independent of . Then is a calibration-conditionally valid p-value:
Any simultaneous upper confidence band for uniform order statistics therefore yields p-values that are valid conditionally on the calibration data, with high probability.
Formalization Note The theorem does not assume continuous scores, and its proof treats a general score law, so is any probability law on . The inner conditional probability is the -probability with the calibration scores held fixed.
import Mathlib import Definitions.Def_ConformalOutlierTesting_Basic open MeasureTheory ProbabilityTheory Filter Topology Set BoundedContinuousFunction
namespace ConformalOutlierTesting
theorem conditional_pvalue_adjustment {n : ℕ} (μ : Measure ℝ) [IsProbabilityMeasure μ]
(δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) (b : ℕ → ℝ) (hb : IsCCVSequence n δ b) :
ENNReal.ofReal (1 - δ) ≤ (Measure.pi fun _ : Fin n => μ)
{s | ∀ t ∈ Ioo (0 : ℝ) 1, μ {x | adjFun b n (margPval s x) ≤ t} ≤ ENNReal.ofReal t} := by sorry
end ConformalOutlierTestingRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a natural number and let be an arbitrary probability measure on . No continuity or atomlessness is assumed, so may have atoms. Let be a real number with
and let be a real sequence indexed by all natural numbers. The sequence is assumed to satisfy all of the following:
- and ;
- for every ;
- for every , so that ;
- the probability condition below holds.
For the probability condition, let be i.i.d. with the uniform law on (Lebesgue measure restricted to ). Let be their increasing order statistics. The condition is
The terms with are unconstrained and play no role.
For calibration scores and a point , define the marginal conformal p-value
The comparison is non-strict. Next define the adjustment function , where is the ceiling taken as a natural number, with negative arguments sent to .
Since is an integer, the adjusted p-value is
This value is always one of .
The theorem asserts the following. Draw i.i.d. from (product measure on ). Then, with probability at least , the drawn vector has this property: for every in the open interval ,
In symbols,
The quantity is the probability that a fresh point , drawn independently of , has adjusted p-value at most .
Technical notes on how the measures are applied:
- Both measures are applied directly to the indicated sets. For sets that are not measurable this would mean outer measure.
- Comparisons are made in , where and are their own nonnegative values.
- The endpoints and are excluded from the inner quantifier.
Degenerate case : there are no calibration scores. Then and for every . The inner set is therefore empty for every , and the conclusion holds trivially. The uniform-order-statistic hypothesis also holds automatically, since it concerns an empty family of events, which has probability .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.