Theorem 6: one-class OOD detection in the separate space with finite feature space
ProvedOODLearnable.one_class_separate_learnable_iffLet , so that with the ID label and the OOD label. Let be finite, let be a loss with iff , and let be a hypothesis space that is separate for OOD (Assumption 1) and contains the constant function . Then OOD detection is learnable in the separate space for if and only if
where is the set of all functions and .
Formalization Note The labels are in Fin 2. 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 one_class_separate_learnable_iff {dim : ℕ} {𝒳 : Set (EuclideanSpace ℝ (Fin dim))}
(h𝒳 : 𝒳.Finite) (ℓ : Fin (1 + 1) → Fin (1 + 1) → ℝ≥0) (hℓ : IsOODLoss ℓ)
(H : Set (𝒳 → Fin (1 + 1))) (hHmeas : ∀ h ∈ H, Measurable h) (hA1 : SeparateForOOD H)
(hhin : (fun _ => (0 : Fin (1 + 1))) ∈ H) :
IsLearnable ℓ (separateSpace : Set (Domain 𝒳 1)) H ↔
{h : 𝒳 → Fin (1 + 1) | h ≠ fun _ => Fin.last 1} ⊆ H := by sorry
end OODLearnableRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix a natural number and a finite subset (Euclidean space). may be empty, and when the ambient space is a single point. The feature space is with the subspace topology and the subspace Borel σ-algebra. Because is finite, the topology is discrete and every subset of is measurable.
Labels. There is a single in-distribution (ID) class, so . The label set is the two-element set , where is the label of the one ID class and is the out-of-distribution label.
Loss. is any function with if and only if .
Hypothesis class. is a set of functions satisfying three assumptions:
- every is measurable (this holds automatically here, since every subset of is measurable);
- for every there is some with ;
- the constant function belongs to .
Domains. A domain consists of three pieces of data:
- a probability measure on , with -marginal ;
- a probability measure on ;
- a number .
The separate space is the set of all domains for which the topological support of and the support of are disjoint. With the discrete topology, the support of a measure is the set of points of positive mass.
Risks. For a hypothesis , the risk is
where
Both integrals are lower Lebesgue integrals with values in .
Learnability. "OOD detection is learnable in for " means the following. There exist:
- an algorithm , assigning to each and each sample a function ;
- a sequence .
These must satisfy four conditions:
- for every and every sample .
- is non-increasing.
- .
- For every and every , the map is almost-everywhere measurable with respect to the product measure , and
In condition 4, the infimum and the sum are taken in . The training sample is drawn only from the ID distribution. The algorithm and must be the same for all .
The theorem. Under all the hypotheses above, it asserts the equivalence
In words, the right-hand side says that contains every function from to the two labels, except possibly the constant- function.
Edge case: empty . If , then:
- there is exactly one function , which is both the constant- and the constant- function;
- no probability measures on exist, so is empty.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.