Theorem 1 (as proved): PAC guarantee on the alien detection rate
ProvedOpenCategoryPAC.theorem_1Let (nominal) and (alien) be the anomaly-score laws, with continuous CDFs and , let , and let the mixture score law be . Let consist of i.i.d. draws from and, independently, of i.i.d. draws from . Let , and , and suppose
Let . Then, with probability at least over the draw of and , if Algorithm 1 returns a threshold , that threshold achieves an alien detection rate of at least :
Equivalently, the event that Algorithm 1 returns a threshold whose alien detection rate is below has probability at most . This is the paper's central result: a PAC guarantee on the fraction of aliens detected, for any anomaly detector, given the alien fraction .
Formalization Note The printed theorem also asserts that Algorithm 1 returns a threshold, i.e. that is nonempty. That claim is false: for , , , and (which exceeds the bound ), with nominal scores uniform on and alien scores uniform on , the set is empty with probability at least . The proof in Appendix A only shows that every with has , so the statement is the guarantee for the returned threshold whenever one is returned. The probability bound is stated as an upper bound on the failure event, and the independence of the two samples is built into their product law.
import Mathlib import Definitions.Def_OpenCategoryPAC_Basic open MeasureTheory ProbabilityTheory Filter Topology
namespace OpenCategoryPAC
theorem theorem_1 (μ0 μa μm : Measure ℝ) [IsProbabilityMeasure μ0]
[IsProbabilityMeasure μa] [IsProbabilityMeasure μm] (α : ℝ) (hα0 : 0 < α) (hα1 : α ≤ 1)
(hm : μm = mixture α μ0 μa) (hF0 : Continuous (cdf μ0)) (hFa : Continuous (cdf μa))
(q ε δ : ℝ) (hq : 0 < q) (hε0 : 0 < ε) (hε1 : ε < 1 - q) (hδ0 : 0 < δ) (hδ1 : δ < 1)
(n : ℕ) (hn : sampleSizeBound α ε δ < n) :
sampleLaw μ0 μm n
{s | ∃ τ : ℝ, IsAlgThreshold α q s.1 s.2 τ ∧ detectionRate μa τ < 1 - (q + ε)} ≤
ENNReal.ofReal δ := by sorry
end OpenCategoryPACRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let , , be three arbitrary probability measures on . Read as the nominal score law, as the alien score law, and as the mixture score law. Write and for the cumulative distribution functions of and .
The theorem assumes the following.
- Mixture weight. is a real number with .
- Mixture law. is exactly the mixture
At the endpoint this forces .
- Continuity. Both and are continuous functions on .
- Parameters , , . These are real numbers with
In particular and .
- Sample size. is a natural number strictly larger than the bound
Under the stated ranges , so the logarithm is positive. Therefore and necessarily .
The samples. A sample is a pair of two vectors of the same length :
- , the nominal scores, drawn i.i.d. from ;
- , the mixture scores, drawn i.i.d. from , independently of .
The joint law is the product measure on .
Estimates computed from a sample. The empirical CDFs are
and the alien-CDF estimate is
The estimate need not lie in .
Pooled set and threshold. The pooled score set is . A real number is called an algorithm threshold for the sample if all three of the following hold:
- ;
- ;
- every with satisfies .
That is, is the largest element of . Such a is unique when it exists. If no pooled score satisfies , no threshold exists for that sample.
Detection rate. The detection rate of a threshold is , the -probability of a score strictly exceeding .
Conclusion. Under all the hypotheses above, the theorem asserts
The measure is applied to this set directly. If the set were not measurable, this would be the outer measure.
Samples for which no algorithm threshold exists are not in the event, so they do not count toward the bad probability. The statement bounds only this one-sided failure, a detection rate strictly below . It says nothing about the probability that the detection rate is at least .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.