Lemma 3: weighted quantile lemma
ProvedConformalCovariateShift.weighted_quantile_lemmaLet be weighted exchangeable random variables with values in a measurable space , with weight functions . Let be a score function and , where , for . Define
the sums running over permutations of . Then for every ,
This is the weighted generalization of Lemma 1, and the main technical result of the paper.
Formalization Note The score function is assumed measurable as in Theorem 1. In weighted exchangeability the base measure is required to be invariant under permutations of the coordinates; with an arbitrary base measure, as in the paper's footnote, the lemma is false.
import Mathlib import Definitions.Def_ConformalCovariateShift_Basic open MeasureTheory ProbabilityTheory
namespace ConformalCovariateShift
theorem weighted_quantile_lemma {Omega E : Type*} [MeasurableSpace Omega] [MeasurableSpace E]
(P : Measure Omega) [IsProbabilityMeasure P] {n : ℕ} (Z : Fin (n + 1) → Omega → E)
(w : Fin (n + 1) → E → ℝ) (hZ : IsWeightedExchangeable P Z w)
(S : ScoreFn E) (hS : ∀ i, Measurable (fun z : Fin (n + 1) → E => scores S z i))
(β : ℝ) (hβ0 : 0 < β) (hβ1 : β < 1) :
ENNReal.ofReal β ≤
P {ω | (scores S (fun k => Z k ω) (Fin.last n) : EReal) ≤
quantile β (augDist (permWeight w (fun k => Z k ω)) (scores S (fun k => Z k ω)))} := by sorry
end ConformalCovariateShiftRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. The statement involves the following objects:
- Measurable spaces and .
- A probability measure on .
- A natural number . The case is allowed, in which case there is a single random element.
- Random elements .
- Real-valued weight functions .
- A score function , with no assumptions placed on itself.
- A real number with (both inequalities strict).
For , the scores are
where the second argument is the multiset of the other points. Write .
Hypotheses.
-
Measurability of the scores. For each , the map is measurable from (product -algebra) to .
-
Weighted exchangeability of with weights . This consists of the following conditions:
- each is measurable;
- each is measurable and nonnegative, i.e. for all ;
- there exist a measure on and functions such that:
- is invariant under every coordinate permutation . That is, the pushforward of under equals . No finiteness or -finiteness of is required.
- is measurable.
- The joint law of under equals the measure with density with respect to .
- For every , .
- For every permutation and every , . No measurability of is required.
Weights. For and , define
Both sums run over permutations of . If the denominator is , the quotient is taken to be , so then all .
Weighted distribution and quantile. For each , form the measure on the extended real line
Any negative weight would be replaced by ; by nonnegativity of the none arises. The score is not used in .
The quantile is
with the infimum taken in . If the set is empty, for instance when all weights are , the quantile is .
Conclusion.
The comparison is made in . Here of the set is its outer measure, since measurability of this event is not asserted.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.