Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2 — the classical secretary rule succeeds with probability at least 1/e1/e1/e

Proved
SecretaryWD.Weighted.classical_secretary_guarantee

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

online-algorithmsp2o-batch-pfp1bp2o-gran-per-chapterp2o-plan-paperp2o-v1secretary-problem

Let n≥1n\ge1n≥1 agents of nonnegative value arrive in a uniformly random order. Observe the first ⌊n/e⌋\lfloor n/e\rfloor⌊n/e⌋ without selecting anyone, then select the first agent who outranks every earlier arrival. With a fixed tie break, this rule selects the maximum-valued agent with probability at least 1/e1/e1/e:

Pr⁡(esec=emax⁡)≥1e.\Pr(e_{\mathrm{sec}}=e_{\max})\ge\frac1e.Pr(esec​=emax​)≥e1​.

This is the classical guarantee used for the single large-value case of Theorem 3.4.

Formalization Note Equal values are resolved by smaller original agent index, so the event concerns a unique maximum. The probability is a finite average over all n!n!n! permutations.

Preamble
import Mathlib
import Definitions.Def_SecretaryWD_Weighted_Assignment
import Definitions.Def_SecretaryWD_Weighted_ReservationAlgorithm
Formal statement
namespace SecretaryWD.Weighted

/-- Section 2: the `⌊n/e⌋` observation rule selects the maximum with probability at least `1/e`. -/
theorem classical_secretary_guarantee {n : ℕ} (hn : 0 < n)
    (v : Fin n → ℝ) (hv : ∀ e, 0 ≤ v e) :
    1 / Real.exp 1 ≤
      orderAverage (fun π =>
        if ∃ t : Fin n,
            classicalSecretary n (fun s => (v (π s), π s)) = some t ∧
              valueRank v (π t) = 0 then (1 : ℝ) else 0) := by sorry

end SecretaryWD.Weighted
Source
Babaioff, Dinitz, Gupta, Immorlica and Talwar, Secretary Problems: Weights and Discounts, SODA 2009 (authors' version), p. 4, Section 2, classical secretary algorithm
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