Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1: inventory balancing with a concave penalty Ψ\PsiΨ is αcmin⁡(Ψ)\alpha_{c_{\min}}(\Psi)αcmin​​(Ψ)-competitive

Proved
PersonalizedAssortment.IB.inventory_balancing_competitive_ratio

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

assortment-optimizationcompetitive-ratioonline-algorithmsp2o-batch-rm-cafterp2o-gran-per-chapterp2o-plan-paperp2o-v1primal-dualrevenue-management

A firm sells n≥1n\ge1n≥1 products with revenues ri>0r_i>0ri​>0 and initial inventories ci∈{1,2,… }c_i\in\{1,2,\dots\}ci​∈{1,2,…}, with no replenishment. Let cmin⁡=min⁡icic_{\min}=\min_i c_icmin​=mini​ci​. Let S\mathcal SS be a family of feasible assortments with ∅∈S\emptyset\in\mathcal S∅∈S, which means the firm may offer nothing. Each customer type zzz has a general choice model φz\varphi^zφz, and the family satisfies Assumption 1 (substitutability). Let Ψ:[0,1]→[0,1]\Psi:[0,1]\to[0,1]Ψ:[0,1]→[0,1] be a penalty function: increasing, with Ψ(0)=0\Psi(0)=0Ψ(0)=0 and Ψ(1)=1\Psi(1)=1Ψ(1)=1. Suppose moreover that Ψ\PsiΨ is concave and twice differentiable on [0,1][0,1][0,1].

Consider any horizon TTT and any sequence of customer types z1,…,zTz_1,\dots,z_Tz1​,…,zT​, possibly chosen by an adversary. In each period ttt, the inventory-balancing algorithm offers an assortment St∈SS^t\in\mathcal SSt∈S that maximizes ∑i∈SΨ(Iit−1/ci) ri φizt(S)\sum_{i\in S}\Psi(I_i^{t-1}/c_i)\,r_i\,\varphi_i^{z_t}(S)∑i∈S​Ψ(Iit−1​/ci​)ri​φizt​​(S), breaking ties by the fewest products. Let Rev\mathrm{Rev}Rev be its expected revenue. Then for every feasible solution yyy of the benchmark linear program Primal({zt}t=1T)\mathrm{Primal}(\{z_t\}_{t=1}^T)Primal({zt​}t=1T​),

Rev  ≥  αcmin⁡(Ψ)⋅∑t=1T∑S∈S∑i=1nri φizt(S) yt(S),\mathrm{Rev}\;\ge\;\alpha_{c_{\min}}(\Psi)\cdot\sum_{t=1}^T\sum_{S\in\mathcal S}\sum_{i=1}^n r_i\,\varphi_i^{z_t}(S)\,y^t(S),Rev≥αcmin​​(Ψ)⋅t=1∑T​S∈S∑​i=1∑n​ri​φizt​​(S)yt(S),

where

αcmin⁡(Ψ)=min⁡x∈[0, 1−1/cmin⁡]1−x1cmin⁡+1−Ψ(x)+∫x+1/cmin⁡1Ψ(y) dy.\alpha_{c_{\min}}(\Psi)=\min_{x\in[0,\,1-1/c_{\min}]}\frac{1-x}{\dfrac1{c_{\min}}+1-\Psi(x)+\displaystyle\int_{x+1/c_{\min}}^{1}\Psi(y)\,dy}.αcmin​​(Ψ)=x∈[0,1−1/cmin​]min​cmin​1​+1−Ψ(x)+∫x+1/cmin​1​Ψ(y)dy1−x​.

Equivalently, the competitive ratio of the algorithm against Primal({zt}t=1T)\mathrm{Primal}(\{z_t\}_{t=1}^T)Primal({zt​}t=1T​) is at least αcmin⁡(Ψ)\alpha_{c_{\min}}(\Psi)αcmin​​(Ψ). The bound depends only on cmin⁡c_{\min}cmin​ and Ψ\PsiΨ, not on TTT or on the arrival sequence.

This is the main theorem of the paper. With Ψ(x)=x\Psi(x)=xΨ(x)=x the guarantee is 1/21/21/2. With the exponential penalty it approaches 1−1/e1-1/e1−1/e as cmin⁡→∞c_{\min}\to\inftycmin​→∞, which is optimal.

Formalization Note Definition 2 defines the competitive ratio as inf⁡Tinf⁡{zt}Rev/Primal\inf_T\inf_{\{z_t\}}\mathrm{Rev}/\mathrm{Primal}infT​inf{zt​}​Rev/Primal. That ratio form is not used. In Lean, 0/0=00/0=00/0=0 would make it false when the LP value is 000 (for instance when no product is ever bought), and a real infimum over an unbounded family is a junk value. The statement is instead the equivalent multiplied form for every horizon, every arrival sequence and every feasible yyy; since αcmin⁡(Ψ)≥0\alpha_{c_{\min}}(\Psi)\ge0αcmin​​(Ψ)≥0, this is the same as comparing with the LP optimum. The case T=0T=0T=0 is allowed, and both sides are then 000. The theorem holds for every selection rule meeting the maximization and tie-breaking specification. Twice differentiability is encoded as differentiability of Ψ\PsiΨ and of its derivative within [0,1][0,1][0,1].

Preamble
import Mathlib
import Definitions.Def_PersonalizedAssortment_IB_ChoiceModel
import Definitions.Def_PersonalizedAssortment_IB_PenaltyFunction
import Definitions.Def_PersonalizedAssortment_IB_PrimalLP
import Definitions.Def_PersonalizedAssortment_IB_InventoryBalancing
Formal statement
namespace PersonalizedAssortment.IB

/-- Theorem 1 (Competitive Ratio), p. 1538. Let `c_min = min_i c_i` and let `Ψ` be an increasing,
concave, twice-differentiable penalty function. For every arrival sequence `z_1, …, z_T` of any
length, every inventory-balancing selection rule and every feasible solution `y` of
`Primal({z_t})`, the expected revenue of inventory balancing is at least `α_{c_min}(Ψ)` times the
objective of `y`. Standing assumptions: `r_i > 0`, `c_i ∈ ℤ_+` positive, `∅ ∈ 𝒮` (§2),
Assumption 1 (p. 1537), `Ψ : [0,1] → [0,1]` with `Ψ(0) = 0`, `Ψ(1) = 1` (§3). -/
theorem inventory_balancing_competitive_ratio {n : ℕ} (hn : 0 < n) {Z : Type*}
    (r : Fin n → ℝ) (hr : ∀ i, 0 < r i) (c : Fin n → ℕ) (hc : ∀ i, 0 < c i)
    (𝒮 : Finset (Finset (Fin n))) (h𝒮 : ∅ ∈ 𝒮) (φ : Z → ChoiceModel n)
    (hsub : Substitutable 𝒮 φ) (Ψ : ℝ → ℝ) (hΨ : IsPenaltyFunction Ψ)
    (hconc : ConcaveOn ℝ (Set.Icc 0 1) Ψ) (hdiff : DifferentiableOn ℝ Ψ (Set.Icc 0 1))
    (hdiff2 : DifferentiableOn ℝ (derivWithin Ψ (Set.Icc 0 1)) (Set.Icc 0 1))
    {T : ℕ} (z : Fin T → Z) (sel : Fin T → (Fin n → ℕ) → Finset (Fin n))
    (hsel : IsIBRule Ψ r c 𝒮 φ z sel)
    (y : Fin T → Finset (Fin n) → ℝ) (hy : PrimalFeasible c 𝒮 φ z y) :
    alphaC Ψ (cMin c hn) * primalObj r 𝒮 φ z y ≤ ibRevenue r c φ z sel := by sorry

end PersonalizedAssortment.IB
Source
Golrezaei, Nazerzadeh, Rusmevichientong, Real-Time Optimization of Personalized Assortments, Management Sci. 60(6), 2014, https://doi.org/10.1287/mnsc.2014.1939, p. 1538, Theorem 1 (proof in Section A.3, pp. 1548-1549)
Read-back

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

The statement quantifies over the following data.

  • Products. A natural number nnn with n>0n > 0n>0. Products are indexed by {0,1,…,n−1}\{0, 1, \dots, n-1\}{0,1,…,n−1}, written [n][n][n] below.

  • Customer types. An arbitrary type ZZZ, with no finiteness, nonemptiness or other structure assumed.

  • Prices. A real vector r=(ri)i∈[n]r = (r_i)_{i \in [n]}r=(ri​)i∈[n]​ with ri>0r_i > 0ri​>0 for every iii.

  • Capacities. A vector of natural numbers c=(ci)i∈[n]c = (c_i)_{i \in [n]}c=(ci​)i∈[n]​ with ci≥1c_i \ge 1ci​≥1 for every iii.

  • Allowed assortments. A finite family S\mathcal{S}S of subsets of [n][n][n] with ∅∈S\emptyset \in \mathcal{S}∅∈S.

  • Choice models. A map φ\varphiφ assigning to each type z∈Zz \in Zz∈Z an object φ(z)\varphi(z)φ(z) of type ChoiceModel n. This notion is defined in an imported module that is not shown here, so its content cannot be unfolded.

  • Substitutability. The pair (S,φ)(\mathcal{S}, \varphi)(S,φ) satisfies the imported predicate Substitutable, whose definition is not shown.

  • Penalty function. A function Ψ:R→R\Psi : \mathbb{R} \to \mathbb{R}Ψ:R→R that satisfies the imported predicate IsPenaltyFunction, whose definition is not shown. In addition, Ψ\PsiΨ is:

    • concave on [0,1][0,1][0,1];
    • differentiable at every point of [0,1][0,1][0,1] relative to [0,1][0,1][0,1], which means one-sided at the endpoints 000 and 111;
    • such that its derivative relative to [0,1][0,1][0,1], written Ψ[0,1]′\Psi'_{[0,1]}Ψ[0,1]′​, is itself differentiable at every point of [0,1][0,1][0,1] relative to [0,1][0,1][0,1].

    No monotonicity hypothesis, and no condition on the values Ψ(0)\Psi(0)Ψ(0) or Ψ(1)\Psi(1)Ψ(1), appears among these visible hypotheses. Whether IsPenaltyFunction imposes any of these is not visible. None of the visible hypotheses constrain Ψ\PsiΨ outside [0,1][0,1][0,1].

  • Horizon and arrivals. A natural number TTT and an arrival sequence z0,…,zT−1∈Zz_0, \dots, z_{T-1} \in Zz0​,…,zT−1​∈Z.

  • Selection rule. A rule sel\mathrm{sel}sel that, for each period t∈{0,…,T−1}t \in \{0, \dots, T-1\}t∈{0,…,T−1} and each vector x∈Nnx \in \mathbb{N}^{n}x∈Nn (which may be read as remaining inventory), returns a subset selt(x)⊆[n]\mathrm{sel}_t(x) \subseteq [n]selt​(x)⊆[n]. The type does not require selt(x)∈S\mathrm{sel}_t(x) \in \mathcal{S}selt​(x)∈S. The rule satisfies the imported predicate IsIBRule for the data Ψ,r,c,S,φ,z\Psi, r, c, \mathcal{S}, \varphi, zΨ,r,c,S,φ,z, whose definition is not shown.

  • Primal candidate. A real-valued function yt(S)y_t(S)yt​(S) defined for every period ttt and every subset S⊆[n]S \subseteq [n]S⊆[n], not only for S∈SS \in \mathcal{S}S∈S. It satisfies the imported predicate PrimalFeasible for the data c,S,φ,zc, \mathcal{S}, \varphi, zc,S,φ,z, whose definition is not shown.

Under all of these hypotheses, the statement asserts the real-number inequality

α(Ψ, cmin⁡)⋅Objr,S,φ,z(y) ≤ Revr,c,φ,z(sel).\alpha\bigl(\Psi,\ c_{\min}\bigr)\cdot \mathrm{Obj}_{r,\mathcal{S},\varphi,z}(y)\ \le\ \mathrm{Rev}_{r,c,\varphi,z}(\mathrm{sel}).α(Ψ, cmin​)⋅Objr,S,φ,z​(y) ≤ Revr,c,φ,z​(sel).

Each symbol in the inequality comes from an imported definition whose content is not shown:

  • cmin⁡c_{\min}cmin​ is cMin c hn, a natural number computed from ccc, which uses the proof that n>0n > 0n>0.
  • α(Ψ,k)\alpha(\Psi, k)α(Ψ,k) is alphaC Ψ k, a real number depending on Ψ\PsiΨ and a natural number kkk.
  • Objr,S,φ,z(y)\mathrm{Obj}_{r,\mathcal{S},\varphi,z}(y)Objr,S,φ,z​(y) is primalObj r 𝒮 φ z y, a real number.
  • Revr,c,φ,z(sel)\mathrm{Rev}_{r,c,\varphi,z}(\mathrm{sel})Revr,c,φ,z​(sel) is ibRevenue r c φ z sel, a real number.

Nothing in the visible code says that cmin⁡c_{\min}cmin​ is the minimum of the cic_ici​, that Obj\mathrm{Obj}Obj is a linear-program objective, or that Rev\mathrm{Rev}Rev is an expected revenue. Those meanings, if they hold, reside entirely in the unshown definitions. The inequality is claimed for every n≥1n \ge 1n≥1, every type ZZZ, every horizon T∈NT \in \mathbb{N}T∈N, and every sel\mathrm{sel}sel and yyy meeting the stated predicates.

Degenerate cases.

  • n=0n = 0n=0 is excluded by hypothesis.
  • n=1n = 1n=1 is permitted. Then S\mathcal{S}S is either {∅}\{\emptyset\}{∅} or {∅,{0}}\{\emptyset, \{0\}\}{∅,{0}}.
  • S={∅}\mathcal{S} = \{\emptyset\}S={∅} is permitted for any nnn.
  • T=0T = 0T=0 is permitted. Then zzz, sel\mathrm{sel}sel and yyy are the empty functions, and the claim reduces to α(Ψ,cmin⁡)⋅Obj(empty)≤Rev(empty)\alpha(\Psi, c_{\min}) \cdot \mathrm{Obj}(\text{empty}) \le \mathrm{Rev}(\text{empty})α(Ψ,cmin​)⋅Obj(empty)≤Rev(empty). Whether this holds trivially, for example as 0≤00 \le 00≤0, depends on the unshown definitions of Obj\mathrm{Obj}Obj and Rev\mathrm{Rev}Rev.
  • ZZZ empty is compatible with the hypotheses only when T=0T = 0T=0, because zzz must produce elements of ZZZ.
  • Capacities are all at least 111, so no zero capacities occur.
  • sel\mathrm{sel}sel on arbitrary vectors. The rule is defined on all of Nn\mathbb{N}^nNn, including vectors exceeding ccc. Its behaviour there is constrained only by whatever IsIBRule requires.
  • yyy outside S\mathcal{S}S. The values of yyy on sets outside S\mathcal{S}S are constrained only by whatever PrimalFeasible requires.
  • Vacuity cannot be checked. Whether the hypotheses can be satisfied simultaneously cannot be determined from the visible code, because Substitutable, IsPenaltyFunction, IsIBRule and PrimalFeasible are opaque here. If any combination of them is unsatisfiable for some data, the statement is vacuously true for that data.
  • Default values of total functions. The visible statement itself contains no division, no subtraction in N\mathbb{N}N, no integral and no supremum. Any default-value behaviour of such operations, including in cmin⁡c_{\min}cmin​ or α\alphaα, would come from inside the unshown definitions.
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