Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Min-buying payments and pricing objectives

Definition
MinBuying_Model

by mikeh · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

min-buyingoperations-researchpricingprobability

Defines the payment as the least price among affordable products, with zero payment when none is affordable. Feasible price vectors have nonnegative coordinates. Revenue is the expected payment under a joint law. Defines all-price differentiated and uniform suprema, nonnegative probability laws, product and IID laws, and the source's finite attained positive-optimum conditions. Strict rejection is Pr⁡(V<p)\Pr(V<p)Pr(V<p); the right CDF is Pr⁡(V≤p)\Pr(V\le p)Pr(V≤p). No first-moment assumption is imposed.

Definition code
import Mathlib

/-! Unit-demand min-buying payments and the source's optimization conventions.
No first-moment hypothesis is imposed on valuations. Every fixed feasible
price vector has a bounded, measurable payment function. -/
noncomputable section
open MeasureTheory Set
open scoped BigOperators ENNReal

namespace MinBuying

abbrev Valuations (n : ℕ) := Fin n → ℝ
abbrev Prices (n : ℕ) := Fin n → ℝ
abbrev JointLaw (n : ℕ) := Measure (Valuations n)

def FeasiblePrices {n : ℕ} (p : Prices n) : Prop := ∀ i, 0 ≤ p i

/-- Inclusive affordability; equally priced purchases give the same payment. -/
def affordable {n : ℕ} (p : Prices n) (v : Valuations n) : Finset (Fin n) :=
  Finset.univ.filter (fun i => p i ≤ v i)

def payment {n : ℕ} (p : Prices n) (v : Valuations n) : ℝ :=
  if h : (affordable p v).Nonempty then (affordable p v).inf' h p else 0

def Revenue {n : ℕ} (μ : JointLaw n) (p : Prices n) : ℝ :=
  ∫ v, payment p v ∂μ

def uniformRevenue {n : ℕ} (μ : JointLaw n) (p : ℝ) : ℝ :=
  Revenue μ (fun _ => p)

def differentiatedValues {n : ℕ} (μ : JointLaw n) : Set ℝ :=
  {r | ∃ p : Prices n, FeasiblePrices p ∧ r = Revenue μ p}

def uniformValues {n : ℕ} (μ : JointLaw n) : Set ℝ :=
  {r | ∃ p : ℝ, 0 ≤ p ∧ r = uniformRevenue μ p}

def DPRevenue {n : ℕ} (μ : JointLaw n) : ℝ := sSup (differentiatedValues μ)
def UPRevenue {n : ℕ} (μ : JointLaw n) : ℝ := sSup (uniformValues μ)

def ValidLaw {n : ℕ} (μ : JointLaw n) : Prop :=
  IsProbabilityMeasure μ ∧ ∀ᵐ v ∂μ, ∀ i, 0 ≤ v i

def ValidMarginal (ν : Measure ℝ) : Prop :=
  IsProbabilityMeasure ν ∧ ∀ᵐ x ∂ν, 0 ≤ x

/-- The explicit standing assumptions on p.7: finite attained optima and
strictly positive optimal uniform revenue. Bounds protect the real suprema. -/
def WellPosed {n : ℕ} (μ : JointLaw n) : Prop :=
  BddAbove (differentiatedValues μ) ∧ BddAbove (uniformValues μ) ∧
  (∃ p : Prices n, FeasiblePrices p ∧ Revenue μ p = DPRevenue μ) ∧
  (∃ p : ℝ, 0 ≤ p ∧ uniformRevenue μ p = UPRevenue μ) ∧
  0 < UPRevenue μ

def productLaw {n : ℕ} (F : Fin n → Measure ℝ) : JointLaw n := Measure.pi F

def iidLaw (n : ℕ) (F : Measure ℝ) : JointLaw n := productLaw (fun _ => F)

/-- Strict rejection, deliberately different from the right CDF at atoms. -/
def rejection (F : Measure ℝ) (p : ℝ) : ℝ := (F (Iio p)).toReal

def cdf (F : Measure ℝ) (p : ℝ) : ℝ := (F (Iic p)).toReal

def independentRevenueFormula {n : ℕ} (F : Fin n → Measure ℝ)
    (p : Prices n) : ℝ :=
  ∑ i : Fin n, p i * (1 - rejection (F i) (p i)) *
    ∏ j ∈ Finset.univ.filter (fun j : Fin n => j < i), rejection (F j) (p j)

end MinBuying
Source
Titing Cui, Michael L. Hamilton, Jourdain Lamperski, and Kasra Ganjizadeh Tari, Unit-Demand Pricing for Min-Buying Customers, September 27, 2026 manuscript, 47 PDF pages (main pp.1–27; companion ec1–ec20). https://doi.org/10.2139/ssrn.5178133 . Section 2, pp.7–9, Eqs.(1)–(5).
Read-back

What the Lean code literally says, in plain math · gpt-6-astra

For each natural number nnn, including n=0n=0n=0, let In={0,…,n−1}I_n=\{0,\ldots,n-1\}In​={0,…,n−1} with its usual order. A valuation vector and a price vector are both arbitrary functions In→RI_n\to\mathbb RIn​→R, and a joint law is an arbitrary measure on the space of such valuation vectors. A price vector ppp is feasible exactly when pi≥0p_i\ge 0pi​≥0 for every i∈Ini\in I_ni∈In​. Its affordable set at vvv is Ap(v)={i∈In:pi≤vi}A_p(v)=\{i\in I_n:p_i\le v_i\}Ap​(v)={i∈In​:pi​≤vi​}, and its payment is mp(v)=min⁡i∈Ap(v)pim_p(v)=\min_{i\in A_p(v)}p_imp​(v)=mini∈Ap​(v)​pi​ when this finite set is nonempty and mp(v)=0m_p(v)=0mp​(v)=0 otherwise; equality of valuation and price counts as affordability. Revenue is Rμ(p)=∫mp(v) dμ(v)R_\mu(p)=\int m_p(v)\,d\mu(v)Rμ​(p)=∫mp​(v)dμ(v), the real-valued Bochner integral, which is defined to be zero if its integrand is not integrable. Uniform revenue at any real scalar ttt is Uμ(t)=Rμ((t)i∈In)U_\mu(t)=R_\mu((t)_{i\in I_n})Uμ​(t)=Rμ​((t)i∈In​​); this definition itself allows negative ttt. The differentiated and uniform attainable-value sets are respectively Dμ={Rμ(p):p∈RIn, ∀i pi≥0}\mathcal D_\mu=\{R_\mu(p):p\in\mathbb R^{I_n},\ \forall i\ p_i\ge0\}Dμ​={Rμ​(p):p∈RIn​, ∀i pi​≥0} and Uμ={Uμ(t):t∈R, t≥0}\mathcal U_\mu=\{U_\mu(t):t\in\mathbb R,\ t\ge0\}Uμ​={Uμ​(t):t∈R, t≥0}. The quantities called differentiated and uniform optimal revenues are Dμ=sup⁡DμD_\mu=\sup\mathcal D_\muDμ​=supDμ​ and Uμ∗=sup⁡UμU_\mu^*=\sup\mathcal U_\muUμ∗​=supUμ​, using the real-valued supremum operator, whose value on an empty or unbounded-above set is zero. Here both attainable-value sets contain zero, so they are never empty. A valid joint law has total mass one and satisfies vi≥0v_i\ge0vi​≥0 for every coordinate simultaneously for μ\muμ-almost every vvv; a valid marginal is a measure ν\nuν on R\mathbb RR with total mass one and x≥0x\ge0x≥0 for ν\nuν-almost every xxx. The condition called well-posedness is the conjunction that both Dμ\mathcal D_\muDμ​ and Uμ\mathcal U_\muUμ​ are bounded above, that there exists a feasible vector ppp with Rμ(p)=DμR_\mu(p)=D_\muRμ​(p)=Dμ​, that there exists a scalar t≥0t\ge0t≥0 with Uμ(t)=Uμ∗U_\mu(t)=U_\mu^*Uμ​(t)=Uμ∗​, and that Uμ∗>0U_\mu^*>0Uμ∗​>0; well-posedness does not itself include validity of the law. Given any family (Fi)i∈In(F_i)_{i\in I_n}(Fi​)i∈In​​ of measures on R\mathbb RR, its product law is the finite product measure ⨂i∈InFi\bigotimes_{i\in I_n}F_i⨂i∈In​​Fi​, and the identically distributed product law for nnn and a measure FFF is the product with every factor equal to FFF. The rejection function is rF(t)=toReal⁡(F((−∞,t)))r_F(t)=\operatorname{toReal}(F(({-\infty},t)))rF​(t)=toReal(F((−∞,t))), whereas the CDF used here is cF(t)=toReal⁡(F((−∞,t]))c_F(t)=\operatorname{toReal}(F(({-\infty},t]))cF​(t)=toReal(F((−∞,t])); conversion from a finite nonnegative extended real gives the same real number, and conversion of +∞+\infty+∞ gives zero. For arbitrary measures FiF_iFi​ and arbitrary real prices pip_ipi​, the quantity named the independent revenue formula is the finite algebraic expression ∑i∈Inpi(1−rFi(pi))∏j∈In, j<irFj(pj)\sum_{i\in I_n}p_i(1-r_{F_i}(p_i))\prod_{j\in I_n,\,j<i}r_{F_j}(p_j)∑i∈In​​pi​(1−rFi​​(pi​))∏j∈In​,j<i​rFj​​(pj​); its definition imposes neither feasibility nor index monotonicity on ppp and asserts no equality to an integral. Empty sums equal zero and empty products equal one. If n=0n=0n=0, the valuation and price spaces each consist of the empty function, every affordable set is empty, all revenues and both optimal revenues are zero, and the stated well-posedness condition is false.

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

    Confirmed by the moderator at approval.

  • Endorsed by mikeh · Oct 31, 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