Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The classical secretary rule selects the maximum with probability at least 1/e

Proved
SecretaryWD.Graphic.classical_secretary_guarantee

by mikedeng1 · Oct 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

optimal-stoppingp2o-batch-pfp1bp2o-gran-per-chapterp2o-plan-paperp2o-v1secretary-problem

Let m≥1m\ge 1m≥1 and let v0,…,vm−1v_0,\dots,v_{m-1}v0​,…,vm−1​ be real values, ranked by the tie-break order (larger value first, and among equal values the smaller index first). Let the mmm elements arrive in a uniformly random order. The classical secretary rule observes the first ⌊m/e⌋\lfloor m/e\rfloor⌊m/e⌋ arrivals and then selects the first arrival that ranks above every earlier arrival. Then

Pr⁡π[the rule selects the top-ranked element]  ≥  1e.\Pr_\pi\big[\text{the rule selects the top-ranked element}\big]\;\ge\;\frac1e .πPr​[the rule selects the top-ranked element]≥e1​.

This is the guarantee behind the paper's remark that the classical secretary algorithm is eee-competitive. Theorem 5.4 applies it to each part of a partition matroid.

Formalization Note. The probability is the number of arrival orders σ\sigmaσ for which the selected position ttt carries the top-ranked element, divided by m!m!m!. The arrival order is σ\sigmaσ (time ↦\mapsto↦ element), and the keys handed to the rule are the tie-break keys of σ(0),σ(1),…\sigma(0),\sigma(1),\dotsσ(0),σ(1),…. For m=1,2m=1,2m=1,2 the sample is empty and the probability is 111 and 12\tfrac1221​.

Preamble
import Mathlib
import Definitions.Def_SecretaryWD_DiscUpper_ClassicalSecretary
Formal statement
namespace SecretaryWD.Graphic
theorem classical_secretary_guarantee (m : ℕ) (hm : 1 ≤ m) (v : Fin m → ℝ) :
    1 / Real.exp 1 ≤
      (1 / (m.factorial : ℝ)) *
        ((Finset.univ.filter fun σ : Equiv.Perm (Fin m) =>
            ∃ t : Fin m, SecretaryWD.DiscUpper.classicalSecretary m (fun s => SecretaryWD.DiscUpper.tieKey v (σ s)) = some t ∧
              ∀ e : Fin m, SecretaryWD.DiscUpper.tieKey v e ≤ SecretaryWD.DiscUpper.tieKey v (σ t)).card : ℝ) := by sorry
end SecretaryWD.Graphic
Source
Babaioff, Dinitz, Gupta, Immorlica and Talwar, Secretary Problems: Weights and Discounts, SODA 2009 (authors' version), p. 4, Section 2 (the classical secretary algorithm is e-competitive)
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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