Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1, proof: the deviation of F^a\hat F_aF^a​ is split between F^m\hat F_mF^m​ and F^0\hat F_0F^0​

Proved
OpenCategoryPAC.alien_deviation_split

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

anomaly-detectiondkw-inequalityempirical-cdfopen-category-detectionpac-guarantee

Let μ0,μa\mu_0,\mu_aμ0​,μa​ be probability measures on R\mathbb RR, 0<α≤10<\alpha\le10<α≤1, μm=(1−α)μ0+αμa\mu_m=(1-\alpha)\mu_0+\alpha\mu_aμm​=(1−α)μ0​+αμa​, and let F0,Fa,FmF_0,F_a,F_mF0​,Fa​,Fm​ be their CDFs. Let ϵ>0\epsilon>0ϵ>0, let x1,…,xnx_1,\dots,x_nx1​,…,xn​ and y1,…,yny_1,\dots,y_ny1​,…,yn​ be any real numbers, and let F^0,F^m\hat F_0,\hat F_mF^0​,F^m​ be their empirical CDFs and F^a=(F^m−(1−α)F^0)/α\hat F_a=(\hat F_m-(1-\alpha)\hat F_0)/\alphaF^a​=(F^m​−(1−α)F^0​)/α. If

sup⁡t∣F^a(t)−Fa(t)∣>ϵ,\sup_t|\hat F_a(t)-F_a(t)|>\epsilon,tsup​∣F^a​(t)−Fa​(t)∣>ϵ,

then

sup⁡t∣F^m(t)−Fm(t)∣>α2−αϵorsup⁡t∣F^0(t)−F0(t)∣>α2−αϵ.\sup_t|\hat F_m(t)-F_m(t)|>\frac{\alpha}{2-\alpha}\epsilon\quad\text{or}\quad\sup_t|\hat F_0(t)-F_0(t)|>\frac{\alpha}{2-\alpha}\epsilon.tsup​∣F^m​(t)−Fm​(t)∣>2−αα​ϵortsup​∣F^0​(t)−F0​(t)∣>2−αα​ϵ.

This is the deterministic content of the first chain of inequalities in the proof of Theorem 1: the event that F^a\hat F_aF^a​ deviates by more than ϵ\epsilonϵ is contained in the union of the two events on the right.

Preamble
import Mathlib
import Definitions.Def_OpenCategoryPAC_Basic

open MeasureTheory ProbabilityTheory Filter Topology
Formal statement
namespace OpenCategoryPAC

theorem alien_deviation_split (μ0 μa μm : Measure ℝ) [IsProbabilityMeasure μ0]
    [IsProbabilityMeasure μa] [IsProbabilityMeasure μm] (α : ℝ) (hα0 : 0 < α) (hα1 : α ≤ 1)
    (hm : μm = mixture α μ0 μa) (ε : ℝ) (hε : 0 < ε) {n : ℕ} (x y : Fin n → ℝ)
    (h : ε < supDev (alienCDFEst α x y) (cdf μa)) :
    α / (2 - α) * ε < supDev (empCDF y) (cdf μm) ∨
      α / (2 - α) * ε < supDev (empCDF x) (cdf μ0) := by sorry

end OpenCategoryPAC
Source
Liu, Garrepalli, Dietterich, Fern and Hendrycks, Open Category Detection with PAC Guarantees, arXiv:1808.00529v1 (ICML 2018), Appendix A (Proof for Theorem 1), first chain of inequalities, p. 8
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let μ0\mu_0μ0​, μa\mu_aμa​ and μm\mu_mμm​ be arbitrary probability measures on the real line, with cumulative distribution functions

F0(t)=μ0((−∞,t]),Fa(t)=μa((−∞,t]),Fm(t)=μm((−∞,t]).F_0(t)=\mu_0((-\infty,t]),\qquad F_a(t)=\mu_a((-\infty,t]),\qquad F_m(t)=\mu_m((-\infty,t]).F0​(t)=μ0​((−∞,t]),Fa​(t)=μa​((−∞,t]),Fm​(t)=μm​((−∞,t]).

Let α\alphaα be a real number with 0<α≤10<\alpha\le 10<α≤1. Assume that μm\mu_mμm​ is exactly the mixture

μm=(1−α) μ0+α μa.\mu_m=(1-\alpha)\,\mu_0+\alpha\,\mu_a .μm​=(1−α)μ0​+αμa​.

Let ε>0\varepsilon>0ε>0 be a real number. Let n≥0n\ge 0n≥0 be any natural number, and let x=(x1,…,xn)x=(x_1,\dots,x_n)x=(x1​,…,xn​) and y=(y1,…,yn)y=(y_1,\dots,y_n)y=(y1​,…,yn​) be two arbitrary vectors of nnn real numbers each. These vectors are completely arbitrary, deterministic inputs. The statement places no sampling, independence or distributional assumption on them, and they are not required to be related to the measures in any way.

The following empirical quantities are defined from the two vectors.

  • The empirical CDF of xxx is
F^x(t)=#{i:xi≤t}n.\hat F_x(t)=\frac{\#\{i : x_i\le t\}}{n}.F^x​(t)=n#{i:xi​≤t}​.

The empirical CDF F^y\hat F_yF^y​ of yyy is defined the same way. When n=0n=0n=0, the division by zero is taken to give 000, so both empirical CDFs are identically 000.

  • The alien-CDF estimate is
F^a(t)=F^y(t)−(1−α) F^x(t)α.\hat F_a(t)=\frac{\hat F_y(t)-(1-\alpha)\,\hat F_x(t)}{\alpha}.F^a​(t)=αF^y​(t)−(1−α)F^x​(t)​.

Here yyy plays the role of the mixture sample and xxx plays the role of the nominal sample.

  • For two functions F,G:R→RF,G:\mathbb R\to\mathbb RF,G:R→R, the uniform distance is
d(F,G)=sup⁡t∈R∣F(t)−G(t)∣.d(F,G)=\sup_{t\in\mathbb R}|F(t)-G(t)|.d(F,G)=t∈Rsup​∣F(t)−G(t)∣.

All functions compared here are bounded, so each of these suprema is a genuine finite real number.

Hypothesis. The estimate deviates from the true alien CDF by strictly more than ε\varepsilonε:

ε<d(F^a,Fa).\varepsilon< d(\hat F_a,F_a).ε<d(F^a​,Fa​).

Conclusion. At least one of the following two strict inequalities holds (possibly both):

α2−α ε<d(F^y,Fm)orα2−α ε<d(F^x,F0).\frac{\alpha}{2-\alpha}\,\varepsilon< d(\hat F_y,F_m)\qquad\text{or}\qquad \frac{\alpha}{2-\alpha}\,\varepsilon< d(\hat F_x,F_0).2−αα​ε<d(F^y​,Fm​)or2−αα​ε<d(F^x​,F0​).

Since 0<α≤10<\alpha\le 10<α≤1, we have 2−α≥12-\alpha\ge 12−α≥1, so the factor α/(2−α)\alpha/(2-\alpha)α/(2−α) lies in (0,1](0,1](0,1]. It equals 111 exactly when α=1\alpha=1α=1.

Edge cases.

  • When n=0n=0n=0, the estimate F^a\hat F_aF^a​ is identically 000, so d(F^a,Fa)=sup⁡tFa(t)=1d(\hat F_a,F_a)=\sup_t F_a(t)=1d(F^a​,Fa​)=supt​Fa​(t)=1. The hypothesis then reduces to ε<1\varepsilon<1ε<1.
  • When α=1\alpha=1α=1, the mixture condition forces μm=μa\mu_m=\mu_aμm​=μa​, and F^a=F^y\hat F_a=\hat F_yF^a​=F^y​.

The statement is purely deterministic: it concerns every choice of the vectors x,yx,yx,y. It contains no probability bound on how the samples are drawn.

Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me