Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 1, proof: Fa′F'_aFa′​ is a legal CDF and Fa′≥FaF'_a\ge F_aFa′​≥Fa​

Proved
OpenCategoryPAC.upper_bound_alien_cdf

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 with CDFs F0,FaF_0,F_aF0​,Fa​, let 0<α≤α′≤10<\alpha\le\alpha'\le10<α≤α′≤1, and let μm=(1−α)μ0+αμa\mu_m=(1-\alpha)\mu_0+\alpha\mu_aμm​=(1−α)μ0​+αμa​ with CDF FmF_mFm​. Put

Fa′(x)=Fm(x)−(1−α′)F0(x)α′.F'_a(x)=\frac{F_m(x)-(1-\alpha')F_0(x)}{\alpha'}.Fa′​(x)=α′Fm​(x)−(1−α′)F0​(x)​.

Then:

  1. Fa′F'_aFa′​ is a legal CDF: it is nondecreasing, Fa′(−∞)=0F'_a(-\infty)=0Fa′​(−∞)=0, Fa′(∞)=1F'_a(\infty)=1Fa′​(∞)=1, and it is the CDF of a probability measure on R\mathbb RR.
  2. For all x∈Rx\in\mathbb Rx∈R, Fa′(x)−Fa(x)=(α−α′)(Fm(x)−F0(x))αα′\displaystyle F'_a(x)-F_a(x)=\frac{(\alpha-\alpha')(F_m(x)-F_0(x))}{\alpha\alpha'}Fa′​(x)−Fa​(x)=αα′(α−α′)(Fm​(x)−F0​(x))​.
  3. If the anomaly detector is admissible (F0≥FmF_0\ge F_mF0​≥Fm​ on R\mathbb RR), then Fa′(x)≥Fa(x)F'_a(x)\ge F_a(x)Fa′​(x)≥Fa​(x) for all x∈Rx\in\mathbb Rx∈R.

These are the facts the proof of Corollary 1 uses to reduce the case of an upper bound α′\alpha'α′ to Theorem 1.

Formalization Note The paper's Fa′(−∞)=0F'_a(-\infty)=0Fa′​(−∞)=0 and Fa′(∞)=1F'_a(\infty)=1Fa′​(∞)=1 are stated as limits at ∓∞\mp\infty∓∞. "Legal CDF" is also stated as the existence of a probability measure with CDF Fa′F'_aFa′​, which is how the proof uses it. α′≤1\alpha'\le1α′≤1 is the paper's implicit reading of α′\alpha'α′ as an upper bound on a fraction.

Preamble
import Mathlib
import Definitions.Def_OpenCategoryPAC_Basic

open MeasureTheory ProbabilityTheory Filter Topology
Formal statement
namespace OpenCategoryPAC

theorem upper_bound_alien_cdf (μ0 μa μm : Measure ℝ) [IsProbabilityMeasure μ0]
    [IsProbabilityMeasure μa] [IsProbabilityMeasure μm] (α α' : ℝ) (hα0 : 0 < α)
    (hαα' : α ≤ α') (hα'1 : α' ≤ 1) (hm : μm = mixture α μ0 μa) :
    (Monotone (alienCDF α' (cdf μm) (cdf μ0)) ∧
      Tendsto (alienCDF α' (cdf μm) (cdf μ0)) atBot (𝓝 0) ∧
      Tendsto (alienCDF α' (cdf μm) (cdf μ0)) atTop (𝓝 1) ∧
      ∃ ν : Measure ℝ, IsProbabilityMeasure ν ∧ ⇑(cdf ν) = alienCDF α' (cdf μm) (cdf μ0)) ∧
    (∀ t : ℝ, alienCDF α' (cdf μm) (cdf μ0) t - cdf μa t =
      (α - α') * (cdf μm t - cdf μ0 t) / (α * α')) ∧
    (IsAdmissible μ0 μm → ∀ t : ℝ, cdf μa t ≤ alienCDF α' (cdf μm) (cdf μ0) t) := by sorry

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

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

Setting. The statement is about three probability measures on the real line:

  • μ0\mu_0μ0​, read as the "nominal" score law;
  • μa\mu_aμa​, read as the "alien" score law;
  • μm\mu_mμm​, a third law.

Write their cumulative distribution functions as F0(t)=μ0((−∞,t])F_0(t) = \mu_0((-\infty,t])F0​(t)=μ0​((−∞,t]), Fa(t)=μa((−∞,t])F_a(t) = \mu_a((-\infty,t])Fa​(t)=μa​((−∞,t]) and Fm(t)=μm((−∞,t])F_m(t) = \mu_m((-\infty,t])Fm​(t)=μm​((−∞,t]).

There are two real parameters α\alphaα and α′\alpha'α′, assumed to satisfy

0<α≤α′≤1.0 < \alpha \le \alpha' \le 1.0<α≤α′≤1.

It is further assumed that μm\mu_mμm​ is the mixture

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

The weights 1−α1-\alpha1−α and α\alphaα are nonnegative, since 0<α≤10<\alpha\le 10<α≤1. The boundary case α=1\alpha = 1α=1, where μm=μa\mu_m = \mu_aμm​=μa​, is allowed, and so is α=α′\alpha = \alpha'α=α′.

The function GGG. Using the second parameter α′\alpha'α′, define

G(t)=Fm(t)−(1−α′) F0(t)α′,t∈R.G(t) = \frac{F_m(t) - (1-\alpha')\,F_0(t)}{\alpha'}, \qquad t \in \mathbb{R}.G(t)=α′Fm​(t)−(1−α′)F0​(t)​,t∈R.

This is well defined because α′≥α>0\alpha' \ge \alpha > 0α′≥α>0. The mixture weight used to build μm\mu_mμm​ is α\alphaα, while the weight used in GGG is α′\alpha'α′; these may differ.

Part 1 (G is a distribution function). All four of the following hold:

  • GGG is nondecreasing on R\mathbb{R}R;
  • G(t)→0G(t) \to 0G(t)→0 as t→−∞t \to -\inftyt→−∞;
  • G(t)→1G(t) \to 1G(t)→1 as t→+∞t \to +\inftyt→+∞;
  • there exists a probability measure ν\nuν on R\mathbb{R}R whose CDF equals GGG at every point, that is, ν((−∞,t])=G(t)\nu((-\infty,t]) = G(t)ν((−∞,t])=G(t) for all ttt.

Part 2 (exact error identity). For every real ttt,

G(t)−Fa(t)=(α−α′) (Fm(t)−F0(t))α α′.G(t) - F_a(t) = \frac{(\alpha - \alpha')\,\bigl(F_m(t) - F_0(t)\bigr)}{\alpha\,\alpha'}.G(t)−Fa​(t)=αα′(α−α′)(Fm​(t)−F0​(t))​.

Part 3 (one-sided bound under admissibility). Suppose additionally that Fm(t)≤F0(t)F_m(t) \le F_0(t)Fm​(t)≤F0​(t) for every real ttt; this is the definition of "admissible" used here. Then

Fa(t)≤G(t)for every real t.F_a(t) \le G(t) \quad \text{for every real } t.Fa​(t)≤G(t)for every real t.

This is an implication. Admissibility is not assumed elsewhere in the statement, and the other parts do not depend on it.

Scope. The statement involves only the true CDFs. No samples, empirical CDFs, thresholds or probabilities over random samples appear in it.

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