Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 — the nested two-fare protection level (1 − b(r))n is b(r)-competitive, and b(r) is best possible

Proved
RobustBooking.TwoFare.nested_protection_optimal

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

competitive-ratioonline-algorithmsp2o-batch-rm-cafterp2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-algorithmsrevenue-management

Consider the continuous two-fare booking problem: capacity n>0n > 0n>0 (real), fares f1>f2>0f_1 > f_2 > 0f1​>f2​>0, discount ratio r=f2/f1∈(0,1)r = f_2/f_1 \in (0,1)r=f2​/f1​∈(0,1), requests arriving online with positive real quantities that may be partially accepted, irrevocable decisions. Let b(r)=1/(2−r)b(r) = 1/(2-r)b(r)=1/(2−r) (Eq. (1)). Then:

  1. the nested booking policy with protection level θ1=(1−b(r)) n\theta_1 = (1-b(r))\,nθ1​=(1−b(r))n (low-fare booking limit b(r) nb(r)\,nb(r)n) has competitive ratio exactly b(r)b(r)b(r);
  2. every deterministic online booking policy has competitive ratio at most b(r)b(r)b(r);
  3. every randomized online booking policy — a random choice A(ω)A(\omega)A(ω), ω∼μ\omega \sim \muω∼μ, of deterministic policies with ω↦R(A(ω),I)\omega \mapsto R(A(\omega), I)ω↦R(A(ω),I) measurable for each instance III — has competitive ratio at most b(r)b(r)b(r):
inf⁡I:v∗(I)>0Eμ[R(A,I)]v∗(I)≤12−r.\inf_{I : v^*(I) > 0} \frac{\mathbb{E}_\mu[R(A, I)]}{v^*(I)} \le \frac{1}{2-r}.I:v∗(I)>0inf​v∗(I)Eμ​[R(A,I)]​≤2−r1​.

So the nested policy is best possible among all online booking policies, deterministic or randomized, and the optimal competitive ratio of the continuous two-fare problem is 1/(2−r)1/(2-r)1/(2−r).

Formalization Note. The competitive ratio is the infimum over instances with positive offline optimum; the randomized ratio uses the Bochner integral, which is well defined because revenue is bounded by f1nf_1 nf1​n and measurable by hypothesis. Clause 2 is the Dirac case of clause 3 and is stated separately for readability.

Preamble
import Mathlib
import Definitions.Def_RobustBooking_TwoFare_Booking
import Definitions.Def_RobustBooking_TwoFare_BookingPolicies

open MeasureTheory
Formal statement
namespace RobustBooking.TwoFare

/-- Theorem 1 (Ball–Queyranne 2009, p. 954). For the continuous two-fare booking problem with
fares `f₁ > f₂ > 0` (discount ratio `r = f₂ / f₁ ∈ (0, 1)`) and capacity `n > 0`, the nested policy
with protection level `θ₁ = (1 - b(r)) n` has competitive ratio exactly `b(r) = 1 / (2 - r)`, and no
online booking policy, deterministic or randomized, has a larger competitive ratio. -/
theorem nested_protection_optimal (f₁ f₂ n : ℝ) (hf₂ : 0 < f₂) (hf₁₂ : f₂ < f₁) (hn : 0 < n) :
    competitiveRatio f₁ f₂ n (nested n ((1 - b (f₂ / f₁)) * n)) = b (f₂ / f₁) ∧
    (∀ A : DetPolicy, competitiveRatio f₁ f₂ n A ≤ b (f₂ / f₁)) ∧
    (∀ {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]
      (A : Ω → DetPolicy), (∀ I : List Request, Measurable fun ω => revenue f₁ f₂ n (A ω) I) →
      randCompetitiveRatio f₁ f₂ n μ A ≤ b (f₂ / f₁)) := by sorry

end RobustBooking.TwoFare
Source
Ball, Queyranne, Toward Robust Revenue Management: Competitive Analysis of Online Booking, Oper. Res. 57(4), 2009, p. 954, Theorem 1
Read-back

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

Throughout, f1,f2,nf_1, f_2, nf1​,f2​,n are arbitrary real numbers. The statement assumes

0<f2,f2<f1,0<n,0 < f_2, \qquad f_2 < f_1, \qquad 0 < n,0<f2​,f2​<f1​,0<n,

so f1>0f_1 > 0f1​>0 as well. Write r:=f2/f1r := f_2 / f_1r:=f2​/f1​. Under these hypotheses 0<r<10 < r < 10<r<1 and no division by zero occurs. Nothing else is assumed: in particular, f1,f2,nf_1, f_2, nf1​,f2​,n need not be integers.

The statement uses several names that are defined in the imported files Definitions.Def_RobustBooking_TwoFare_Booking and Definitions.Def_RobustBooking_TwoFare_BookingPolicies. Their definitions are not part of the code under audit, so this read-back cannot expand them. Only their types can be read off from how they are used:

  • bbb is a function from real numbers to real numbers. Its formula is not shown.
  • DetPolicy\mathrm{DetPolicy}DetPolicy is a type of "deterministic policies". It takes no parameters, so it does not depend on f1f_1f1​, f2f_2f2​ or nnn.
  • Request\mathrm{Request}Request is a type, and List Request\mathrm{List}\ \mathrm{Request}List Request is the type of finite sequences of requests, including the empty sequence.
  • nested(n,θ)\mathrm{nested}(n, \theta)nested(n,θ) takes nnn and a real number θ\thetaθ and produces a policy, which is then passed to competitiveRatio\mathrm{competitiveRatio}competitiveRatio.
  • competitiveRatio(f1,f2,n,A)\mathrm{competitiveRatio}(f_1, f_2, n, A)competitiveRatio(f1​,f2​,n,A) is a real number that depends on the fares, on nnn and on a policy AAA.
  • revenue(f1,f2,n,A,I)\mathrm{revenue}(f_1, f_2, n, A, I)revenue(f1​,f2​,n,A,I) is a value in some measurable space that depends on the fares, on nnn, on a deterministic policy AAA and on a request list III. The code does not show which space.
  • randCompetitiveRatio(f1,f2,n,μ,A)\mathrm{randCompetitiveRatio}(f_1, f_2, n, \mu, A)randCompetitiveRatio(f1​,f2​,n,μ,A) is a real number that depends on a probability measure μ\muμ and a random family of policies AAA.

The docstring attached to the theorem makes informal claims about these objects, including a closed form for bbb. The code itself does not establish those claims, and this read-back does not rely on them.

The theorem asserts that the following three statements hold together.

  1. The nested policy attains b(r)b(r)b(r) exactly. The nested policy built from nnn and the protection level θ1:=(1−b(r)) n\theta_1 := (1 - b(r))\, nθ1​:=(1−b(r))n has competitive ratio equal to b(r)b(r)b(r):
competitiveRatio(f1,f2,n, nested(n,(1−b(r)) n))=b(r).\mathrm{competitiveRatio}\bigl(f_1, f_2, n,\ \mathrm{nested}(n, (1 - b(r))\,n)\bigr) = b(r).competitiveRatio(f1​,f2​,n, nested(n,(1−b(r))n))=b(r).

Nothing in the statement requires θ1\theta_1θ1​ to lie in [0,n][0, n][0,n]. Whether it does depends on the unseen value of b(r)b(r)b(r).

  1. No deterministic policy exceeds b(r)b(r)b(r). For every AAA in DetPolicy\mathrm{DetPolicy}DetPolicy,
competitiveRatio(f1,f2,n,A)≤b(r).\mathrm{competitiveRatio}(f_1, f_2, n, A) \le b(r).competitiveRatio(f1​,f2​,n,A)≤b(r).
  1. No randomized policy exceeds b(r)b(r)b(r). This holds for every type Ω\OmegaΩ of any universe level, equipped with any σ-algebra, and for every probability measure μ\muμ on Ω\OmegaΩ (so μ(Ω)=1\mu(\Omega) = 1μ(Ω)=1). It also holds for every function A:Ω→DetPolicyA : \Omega \to \mathrm{DetPolicy}A:Ω→DetPolicy, meaning a policy AωA_\omegaAω​ chosen according to the outcome ω\omegaω. The claim applies only when a measurability condition holds: for every request list III, including the empty list, the map
ω↦revenue(f1,f2,n,Aω,I)\omega \mapsto \mathrm{revenue}(f_1, f_2, n, A_\omega, I)ω↦revenue(f1​,f2​,n,Aω​,I)

must be measurable. Whenever that condition holds,

randCompetitiveRatio(f1,f2,n,μ,A)≤b(r).\mathrm{randCompetitiveRatio}(f_1, f_2, n, \mu, A) \le b(r).randCompetitiveRatio(f1​,f2​,n,μ,A)≤b(r).

Nothing is asserted about families that fail the condition. No other link between Ω\OmegaΩ, μ\muμ and the booking problem is required.

Degenerate cases.

  • Zero capacity and equal fares are excluded. The hypotheses rule out n=0n = 0n=0, negative capacity, f2≤0f_2 \le 0f2​≤0 and f1≤f2f_1 \le f_2f1​≤f2​. So rrr is always a genuine ratio in (0,1)(0,1)(0,1), and the division f2/f1f_2/f_1f2​/f1​ never falls back to Lean's default value of 000.

  • The randomized part cannot be vacuous through Ω\OmegaΩ. A probability measure cannot exist on an empty type, so Ω\OmegaΩ is always nonempty.

  • One-point Ω\OmegaΩ is included. When Ω\OmegaΩ has a single point, or when AAA is constant, the family behaves like a single deterministic policy. What part 3 then asserts depends on how the unseen randCompetitiveRatio\mathrm{randCompetitiveRatio}randCompetitiveRatio treats such a family.

  • The measurability hypothesis cannot be judged. If the values of revenue\mathrm{revenue}revenue live in a space where constant maps are measurable, then every constant family meets the hypothesis. Whether non-constant families can meet it depends on the unseen σ-algebra on Ω\OmegaΩ and on the definition of revenue\mathrm{revenue}revenue. The code does not show whether the hypothesis is easy, hard or impossible to satisfy for them.

  • Junk values in the unseen definitions cannot be ruled out. The code does not show whether competitiveRatio\mathrm{competitiveRatio}competitiveRatio or randCompetitiveRatio\mathrm{randCompetitiveRatio}randCompetitiveRatio is an infimum or a supremum of a ratio taken over request lists. If it is, then:

    • an empty or unbounded index set would give Lean's default value of 000;
    • a division by zero, for example when the optimal offline revenue on the empty request list is zero, would also give 000;
    • either kind of default value could make the equality in part 1, or the inequalities in parts 2 and 3, hold or fail for reasons unrelated to booking performance.

    The same caution applies to any subtraction inside nested\mathrm{nested}nested or revenue\mathrm{revenue}revenue. It also applies to bbb at arguments where its unseen formula may divide by zero. Here r∈(0,1)r \in (0,1)r∈(0,1), so bbb is only ever evaluated at such an rrr.

Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

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