Min-buying payments and pricing objectives
DefinitionMinBuying_ModelDefines 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 ; the right CDF is . No first-moment assumption is imposed.
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
Read-back
What the Lean code literally says, in plain math · gpt-6-astra
For each natural number , including , let with its usual order. A valuation vector and a price vector are both arbitrary functions , and a joint law is an arbitrary measure on the space of such valuation vectors. A price vector is feasible exactly when for every . Its affordable set at is , and its payment is when this finite set is nonempty and otherwise; equality of valuation and price counts as affordability. Revenue is , the real-valued Bochner integral, which is defined to be zero if its integrand is not integrable. Uniform revenue at any real scalar is ; this definition itself allows negative . The differentiated and uniform attainable-value sets are respectively and . The quantities called differentiated and uniform optimal revenues are and , 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 for every coordinate simultaneously for -almost every ; a valid marginal is a measure on with total mass one and for -almost every . The condition called well-posedness is the conjunction that both and are bounded above, that there exists a feasible vector with , that there exists a scalar with , and that ; well-posedness does not itself include validity of the law. Given any family of measures on , its product law is the finite product measure , and the identically distributed product law for and a measure is the product with every factor equal to . The rejection function is , whereas the CDF used here is ; conversion from a finite nonnegative extended real gives the same real number, and conversion of gives zero. For arbitrary measures and arbitrary real prices , the quantity named the independent revenue formula is the finite algebraic expression ; its definition imposes neither feasibility nor index monotonicity on and asserts no equality to an integral. Empty sums equal zero and empty products equal one. If , 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.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.