Theorem 8 (sufficiency and rate, as proved): compatibility gives learnability in the finite-ID-distribution space
ProvedOODLearnable.compatibility_implies_learnable_finite_idLet be bounded, let be a loss with iff , let be a nonempty hypothesis space, and let be a finite-ID-distribution space. If the compatibility condition (Condition 3) holds, then OOD detection is learnable in for ; moreover, for every the learning rate can be taken to be
Formalization Note Theorem 8 of the paper states an equivalence: learnability in if and only if Condition 3. Only the direction Condition 3 learnability, with the rate, is stated here. The proof of the converse picks one sample for each domain separately and then uses it for the whole equivalence class, and the converse can fail when an equivalence class contains infinitely many OOD distributions (a counterexample is given in the mission report). The rate is formalized as: some valid sequence satisfies for all . The hypothesis that is nonempty is implicit in the paper. The feature space is with the Borel structure; every hypothesis in is assumed measurable (the paper's implicit convention, needed for the risks to be defined).
import Mathlib import Definitions.Def_OODLearnable_Basic open MeasureTheory Filter Topology open scoped ENNReal NNReal
namespace OODLearnable
theorem compatibility_implies_learnable_finite_id {dim : ℕ}
{𝒳 : Set (EuclideanSpace ℝ (Fin dim))} (h𝒳 : Bornology.IsBounded 𝒳) {K : ℕ}
(ℓ : Fin (K + 1) → Fin (K + 1) → ℝ≥0) (hℓ : IsOODLoss ℓ)
(H : Set (𝒳 → Fin (K + 1))) (hHne : H.Nonempty) (hHmeas : ∀ h ∈ H, Measurable h)
(𝒟 : Set (Domain 𝒳 K)) (h𝒟 : IsFiniteIDSpace 𝒟) (hC3 : Compatibility ℓ 𝒟 H) :
IsLearnable ℓ 𝒟 H ∧
∀ θ ∈ Set.Ioo (0 : ℝ) 1,
IsLearnableAtRate ℓ 𝒟 H (fun n => 1 / Real.sqrt ((n : ℝ) ^ (1 - θ))) := by sorry
end OODLearnableRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix integers and , and a subset (Euclidean space) that is bounded. The feature space is with the σ-algebra induced from the Borel σ-algebra of . The label set is : labels are the in-distribution (ID) labels and is the out-of-distribution (OOD) label.
Hypotheses.
-
Loss. satisfies .
-
Hypothesis space. is a nonempty set of functions . Every is measurable, where every subset of the label set is measurable.
-
Domains. A domain is a triple consisting of:
- a probability measure on ;
- a probability measure on ;
- a number .
Note that if or , no probability measure exists. In that case there are no domains, and the domain set below is necessarily empty.
-
Finite-ID space. is a set of domains satisfying two conditions:
- It is prior-unknown: for every and every , the domain is also in . Here is with replaced by .
- The set of ID joint distributions occurring in is finite.
-
Compatibility. For every and every real there is a single such that, for every with , both of the following hold:
All risks take values in and are defined as follows:
The first argument of is the prediction and the second is the true label.
Further definitions used in the conclusion.
- Total risk. For a domain , the risk is
using the domain's own .
- Algorithm. An algorithm assigns to each and each sample a function . No measurability of itself is required.
- Training sample. Training samples are drawn from the product measure , that is, i.i.d. draws from the ID distribution only.
- Consistency. , with , is consistent for when all of the following hold:
- for all and all samples .
- is non-increasing.
- . Together with item 2, this forces .
- For every and every , the map is almost-everywhere measurable with respect to , and
Nothing is required at .
Conclusion. The theorem asserts both of the following:
- Learnability. There exist an algorithm and a sequence such that is consistent for .
- Rate. For every with , there exist an algorithm , a sequence and a real constant (of unrestricted sign) with the following properties:
- is consistent for ;
- for every ,
The algorithm, the sequence and the constant may depend on .
Neither conclusion involves the risk at priors other than each domain's own . When is empty (in particular whenever or ), the domain condition in item 4 of consistency is vacuous. The remaining requirements are then only that maps into and that is non-increasing, tends to , and satisfies the rate bound.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.