Independent-error pricing model and revenue objectives
DefinitionFBMSP_ModelThis bundle defines inclusive survival , integrable mean-zero error, nonnegative integrable prediction laws, and density-bearing MHR through log-concave survival. It defines customer revenue, the least optimal price, price menus, unrestricted -menu revenue, personalized revenue, model-market revenue, mean, variance, and segmentation loss. General prediction distributions remain available. A separate predicate records nonnegative realized valuations and is explicitly used by Theorem 3 and Corollary 2.
The finite layer specifies sorted distinct prediction values, positive normalized weights, arbitrary assignments and nonnegative prices, index-block revenues, an attaining block-price oracle, cuts, and the assignment that realizes them. The final definitions specify submodularity, finite-candidate greedy chains, and their optimization benchmark. These objects are built from the economic primitives; none assumes interval optimality or the desired approximation/concavity conclusions.
import Mathlib
/-! Independent location-family pricing. Prediction values and errors are
sampled from separate probability laws. All suprema optimize over prices,
not over a set defined in terms of the desired theorem. -/
noncomputable section
open MeasureTheory Set
open scoped BigOperators ENNReal
namespace FBMSP
/-- Inclusive survival, including atoms at a posted price. -/
def survival (η : Measure ℝ) (t : ℝ) : ℝ := (η (Ici t)).toReal
def ValidNoise (η : Measure ℝ) : Prop :=
IsProbabilityMeasure η ∧ Integrable (fun e : ℝ => e) η ∧
(∫ e, e ∂η) = 0
def ValidPredictions (ν : Measure ℝ) : Prop :=
IsProbabilityMeasure ν ∧ Integrable (fun x : ℝ => x) ν ∧
∀ᵐ x ∂ν, 0 ≤ x
/-- A density-bearing MHR law, using the log-concave-survival formulation
used in the proof of Lemma 2(b). Zeros outside the support are allowed. -/
def HasMHR (η : Measure ℝ) : Prop :=
η ≪ volume ∧
ConcaveOn ℝ {t : ℝ | 0 < survival η t}
(fun t => Real.log (survival η t))
def NonnegativeValuations (ν η : Measure ℝ) : Prop :=
∀ᵐ x ∂ν, ∀ᵐ e ∂η, 0 ≤ x + e
def postedRevenue (η : Measure ℝ) (x p : ℝ) : ℝ :=
p * survival η (p - x)
def singleRevenue (η : Measure ℝ) (x : ℝ) : ℝ :=
sSup {r : ℝ | ∃ p : ℝ, 0 ≤ p ∧ r = postedRevenue η x p}
def IsOptimalPrice (η : Measure ℝ) (x p : ℝ) : Prop :=
0 ≤ p ∧ ∀ q : ℝ, 0 ≤ q → postedRevenue η x q ≤ postedRevenue η x p
def IsLeastOptimalPrice (η : Measure ℝ) (x p : ℝ) : Prop :=
IsOptimalPrice η x p ∧ ∀ q, IsOptimalPrice η x q → p ≤ q
def singlePrice (η : Measure ℝ) (x : ℝ) : ℝ :=
sInf {p : ℝ | IsOptimalPrice η x p}
def margin (η : Measure ℝ) (x : ℝ) : ℝ := singlePrice η x - x
/-- Price zero is always available as the zero-revenue outside option. -/
def menuAt (η : Measure ℝ) (x : ℝ) (P : Finset ℝ) : ℝ :=
if h : P.Nonempty then max 0 (P.sup' h (fun p => postedRevenue η x p)) else 0
def FeasibleMenu (P : Finset ℝ) (k : ℕ) : Prop :=
P.card ≤ k ∧ ∀ p ∈ P, 0 ≤ p
def menuRevenue (ν η : Measure ℝ) (P : Finset ℝ) : ℝ :=
∫ x, menuAt η x P ∂ν
/-- At most k prices; ties and unused/duplicate price slots do not change revenue. -/
def optimalRevenue (ν η : Measure ℝ) (k : ℕ) : ℝ :=
sSup {r : ℝ | ∃ P : Finset ℝ, FeasibleMenu P k ∧ r = menuRevenue ν η P}
def personalizedRevenue (ν η : Measure ℝ) : ℝ :=
∫ x, singleRevenue η x ∂ν
def predictionMean (ν : Measure ℝ) : ℝ := ∫ x, x ∂ν
def predictionVariance (ν : Measure ℝ) : ℝ :=
∫ x, (x - predictionMean ν) ^ 2 ∂ν
def modelRevenue (ν : Measure ℝ) (k : ℕ) : ℝ :=
optimalRevenue ν (Measure.dirac 0) k
def segmentationLoss (ν η : Measure ℝ) (k : ℕ) : ℝ :=
personalizedRevenue ν η - optimalRevenue ν η k
def finitePolicyRevenue {n k : ℕ} (η : Measure ℝ)
(μ w : Fin n → ℝ) (a : Fin n → Fin k) (p : Fin k → ℝ) : ℝ :=
∑ i, w i * postedRevenue η (μ i) (p (a i))
def finiteMenuRevenue {n : ℕ} (η : Measure ℝ)
(μ w : Fin n → ℝ) (P : Finset ℝ) : ℝ :=
∑ i, w i * menuAt η (μ i) P
def ValidFiniteMarket {n : ℕ} (μ w : Fin n → ℝ) : Prop :=
0 < n ∧ StrictMono μ ∧ (∀ i, 0 ≤ μ i) ∧ (∀ i, 0 < w i) ∧ (∑ i, w i) = 1
/-- The score of an index interval [a,b), so the largest type is included
when b=n. Empty intervals have score zero. -/
def blockRevenue {n : ℕ} (η : Measure ℝ) (μ w : Fin n → ℝ)
(a b : ℕ) (p : ℝ) : ℝ :=
∑ i ∈ Finset.univ.filter (fun i : Fin n => a ≤ i.val ∧ i.val < b),
w i * postedRevenue η (μ i) p
/-- The oracle returns an attaining price. Its charged cost includes
evaluation of the attained block revenue. -/
def BlockOracle {n : ℕ} (η : Measure ℝ) (μ w : Fin n → ℝ)
(o : ℕ → ℕ → ℝ) : Prop :=
∀ a b, a ≤ b → b ≤ n →
0 ≤ o a b ∧ ∀ p : ℝ, 0 ≤ p →
blockRevenue η μ w a b p ≤ blockRevenue η μ w a b (o a b)
def oracleScore {n : ℕ} (η : Measure ℝ) (μ w : Fin n → ℝ)
(o : ℕ → ℕ → ℝ) (a b : ℕ) : ℝ :=
blockRevenue η μ w a b (o a b)
def ValidCuts (n k : ℕ) (c : Fin (k + 1) → ℕ) : Prop :=
Monotone c ∧ c 0 = 0 ∧ c (Fin.last k) = n
def RealizesCuts {n k : ℕ} (a : Fin n → Fin k) (c : Fin (k + 1) → ℕ) : Prop :=
∀ i, c (a i).castSucc ≤ i.val ∧ i.val < c (a i).succ
def cutsRevenue {n k : ℕ} (η : Measure ℝ) (μ w : Fin n → ℝ)
(o : ℕ → ℕ → ℝ) (c : Fin (k + 1) → ℕ) : ℝ :=
∑ j : Fin k, oracleScore η μ w o (c j.castSucc) (c j.succ)
def IsSubmodular (F : Finset ℝ → ℝ) : Prop :=
∀ A B, F (A ∩ B) + F (A ∪ B) ≤ F A + F B
def IsGreedyChain (F : Finset ℝ → ℝ) (P : Finset ℝ)
(k : ℕ) (A : ℕ → Finset ℝ) : Prop :=
A 0 = ∅ ∧ ∀ t, t < k → A t ⊆ P ∧
∃ p ∈ P \ A t, A (t + 1) = insert p (A t) ∧
∀ q ∈ P \ A t, F (insert q (A t)) - F (A t) ≤
F (insert p (A t)) - F (A t)
def candidateOptimum (F : Finset ℝ → ℝ) (P : Finset ℝ) (k : ℕ) : ℝ :=
sSup {r : ℝ | ∃ A : Finset ℝ, A ⊆ P ∧ A.card ≤ k ∧ r = F A}
end FBMSP
Read-back
What the Lean code literally says, in plain math · gpt-6-astra
For arbitrary Borel measures on , define to be the real conversion of , so a finite measure value is retained and the extended value converts to . Valid noise means that is a probability measure, the identity function is integrable with respect to , and ; valid predictions mean that is a probability measure, the identity is integrable with respect to , and for -almost every . The predicate called MHR means that is absolutely continuous with respect to Lebesgue measure and that is convex and is concave on : for and , its value at is at least . This predicate alone does not assert probability normalization, an integrable first moment, or nonemptiness of ; concavity on an empty is vacuous. Nonnegative valuations mean that for -almost every , one has for -almost every . The posted revenue at arbitrary real is ; purchase uses the inclusive inequality . Define . A price is optimal precisely when it is nonnegative and its posted revenue is at least that of every nonnegative real price; it is least optimal when it is optimal and no greater than every optimal price. The quantity called the single price is the infimum of the set of optimal prices, and the margin is that infimum minus ; these definitions do not assert that an optimal price exists or that this infimum is itself optimal. For a finite set of real prices , set , including . A feasible menu for a natural number is a finite with . Its revenue is , the optimal -menu revenue is , and personalized revenue is . The prediction mean is , and prediction variance is , without an integrability hypothesis built into the variance definition. Model revenue replaces by the point mass at in , and segmentation loss is personalized revenue minus . These are real-valued operations: a real supremum of an empty or unbounded-above set, or an infimum of an empty or unbounded-below set, is , and a nonintegrable real-valued Bochner integral is defined to be . In particular the single price is if its optimizer set is empty, and because only the empty menu is feasible. For natural , real arrays , an assignment , and prices , finite policy revenue is ; finite menu revenue is . These formulas alone impose no sign, normalization, or ordering conditions. A valid finite market requires , strictly increasing , all , all , and . For arbitrary natural endpoints and real , block revenue is , with an empty index set giving ; endpoints beyond simply leave only indices below . A block oracle is a function such that whenever , and for every ; its values outside these endpoint conditions are unrestricted. The oracle score is . For a natural , valid cuts are natural numbers that are nondecreasing with and . An assignment realizes cuts when for every ; the predicate itself does not additionally impose validity of the cuts. Cuts revenue is , whether or not the cuts are valid. Repeated cuts, and thus empty blocks, are allowed; valid cuts with force , and no assignment from a nonempty index set to zero slots exists. Finally, for any real-valued function on finite real sets, submodularity means for all finite . A greedy chain of length from a finite candidate set is a sequence with such that for each , and some satisfies and for every . There are no restrictions on for ; for only is required, and a chain cannot exist when . The candidate optimum is , a maximum of a nonempty finite collection that includes ; for it equals , with no general nonnegativity or monotonicity requirement on .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.