Corollary 1 (as proved): the guarantee with an upper bound
ProvedOpenCategoryPAC.corollary_1Assume the setting of Theorem 1: score laws with continuous CDFs, , , and independent samples , . Assume also that the anomaly detector is admissible, for all . Let be an upper bound on the true fraction, , and run Algorithm 1 with in place of . Let , , , and suppose
Then, with probability at least , if Algorithm 1 returns a threshold , that threshold achieves an alien detection rate of at least , :
So knowing an upper bound on the alien fraction suffices, at the price of a more conservative threshold.
Formalization Note As in Theorem 1, the printed claim that Algorithm 1 returns a threshold is not proved and is false in general. The statement gives the guarantee for the returned threshold whenever one is returned, as an upper bound on the probability of the failure event. is the paper's implicit reading of as an upper bound on a fraction.
import Mathlib import Definitions.Def_OpenCategoryPAC_Basic open MeasureTheory ProbabilityTheory Filter Topology
namespace OpenCategoryPAC
theorem corollary_1 (μ0 μa μm : Measure ℝ) [IsProbabilityMeasure μ0]
[IsProbabilityMeasure μa] [IsProbabilityMeasure μm] (α α' : ℝ) (hα0 : 0 < α)
(hαα' : α ≤ α') (hα'1 : α' ≤ 1)
(hm : μm = mixture α μ0 μa) (hF0 : Continuous (cdf μ0)) (hFa : Continuous (cdf μa))
(hadm : IsAdmissible μ0 μm)
(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 probability measures on . These are the laws of the nominal, alien, and mixture anomaly scores. Write , , for their cumulative distribution functions, with . Let be real numbers, and let be real numbers. Let be a natural number. The theorem assumes all of the following:
- Mixture weights: . Here is the true alien proportion. The algorithm below is run with , not .
- Mixture law: . Consequently .
- Continuity: and are continuous functions on . Nothing is assumed directly about the continuity of .
- Admissibility: for every . Given the mixture identity and , this is the same as for all .
- Parameters: , (which in particular forces ), and .
- Sample size: is strictly larger than the bound evaluated at (not at ):
For the logarithm's argument exceeds , so the bound is positive and .
Random sample. A sample is a pair with and . Both vectors have the same length . It is drawn from the product law . So the are i.i.d. with law , the are i.i.d. with law , and the two vectors are independent.
Estimates. From the sample, define the empirical CDFs
The alien-CDF estimate, computed with weight , is
Let be the pooled set of observed scores.
Threshold. A real number is called an algorithm threshold for when is the largest element of . This means three things hold:
- ;
- ;
- every with satisfies .
Such a is unique when it exists. If no element of satisfies , no threshold exists.
Detection rate. The detection rate of is , the alien mass strictly above .
Conclusion. The theorem asserts the following inequality. When the event below is not measurable, the left side is the outer measure.
In words, the probability is at most that two things happen together: the threshold exists, and its alien detection rate is strictly below . Samples for which no threshold exists are not counted in this event.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.