Theorem 2: learnability in the single-distribution space iff the linear condition
ProvedOODLearnable.single_distribution_learnable_iff_linearLet , let be a loss with iff , let be a nonempty hypothesis space and let be a domain. OOD detection is learnable in the single-distribution space
for if and only if the linear condition (Condition 1) holds in , that is,
Formalization Note The hypothesis that is nonempty is implicit in the paper: for both infima are , Condition 1 holds, and no algorithm with values in exists. 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 single_distribution_learnable_iff_linear {dim : ℕ}
{𝒳 : Set (EuclideanSpace ℝ (Fin dim))} {K : ℕ}
(ℓ : Fin (K + 1) → Fin (K + 1) → ℝ≥0) (hℓ : IsOODLoss ℓ)
(H : Set (𝒳 → Fin (K + 1))) (hHne : H.Nonempty) (hHmeas : ∀ h ∈ H, Measurable h)
(D : Domain 𝒳 K) :
IsLearnable ℓ (singleSpace D) H ↔ LinearCondition ℓ (singleSpace D) H := by sorry
end OODLearnableRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix natural numbers (the ambient dimension) and . Let be an arbitrary subset, carrying the σ-algebra induced from the Borel σ-algebra of . Labels are . The labels are the in-distribution (ID) labels, and is the out-of-distribution (OOD) label.
Hypotheses. The statement assumes the following data:
- Loss. A loss such that, for all , if and only if .
- Hypothesis set. A set of functions . It is assumed nonempty, and every is measurable, with every subset of measurable.
- Domain. A domain , which consists of three components:
- a probability measure on ;
- a probability measure on ;
- a number .
Degenerate cases. If , or if , then no probability measure exists, so no such exists and the statement holds vacuously. The value of plays no role below.
Single-distribution space. For , let denote the domain with the same and as , but with prior . The space considered is
Risks. For a hypothesis , the ID and OOD risks are the following integrals with values in :
Note the argument order: the prediction comes first and the true label second. Both risks are the same for every . The risk of under is
computed in with the convention .
Claim. The theorem asserts that the following two statements are equivalent.
(Learnability) There exist an algorithm and a real sequence satisfying all of the following.
- The algorithm. is a completely arbitrary map, with no measurability required. For each sample size , it sends each sample to a function .
- Range. for every and every . Nothing is required at .
- The sequence. is non-increasing and . Hence for all ; negative values would in any case be treated as .
- The bound. For every and every , two things hold. First, the map is almost-everywhere measurable with respect to the -fold product measure . Second,
Training samples are drawn only from . The case is not included.
(Linear condition) For every and every ,
Every has the same and as . The condition is therefore just this displayed identity, with and taken from , for all . At the identity holds trivially.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.