Concrete triangular probability laws and canonical markets
DefinitionMinBuying_TriangularDefines concretely as the image of uniform measure on under . Positive parameters give the source's cap atom and triangular revenue curve. Defines finite independent triangular families, the continuation recursion from zero, the rejection product, and the canonical joint product law and designated cap-price vector. Distributional and revenue identities are separate theorem obligations.
import Definitions.Def_MinBuying_Model
import Definitions.Def_MinBuying_CanonicalAlgebra
/-! Concrete triangular-revenue probability laws and their canonical market.
The measure is an explicit pushforward; none of its distributional or pricing
properties is inserted as an assumption in the definitions. -/
noncomputable section
open MeasureTheory Set
open scoped BigOperators
namespace MinBuying
/-- Uniform probability measure on the open unit interval. -/
def unitIntervalLaw : Measure ℝ := volume.restrict (Ioo (0 : ℝ) 1)
/-- `Tri(a,v)` from equation (11), for positive `a` and `v`.
An equal-revenue quantile transform is capped at `v`, leaving the stated atom
at the cap. Inclusive affordability accepts that atom at price `v`. -/
def triangularLaw (a v : ℝ) : Measure ℝ :=
Measure.map (fun u : ℝ => min v (a * u / (1 - u))) unitIntervalLaw
/-- Right CDF of the triangular law. This differs from strict rejection
at the cap: the right CDF is one there, whereas rejection is `v/(v+a)`. -/
def triangularCDF (a v p : ℝ) : ℝ :=
if p < 0 then 0 else if p < v then p / (p + a) else 1
/-- A finite family of genuine positive-parameter triangular laws.
Empty families are allowed for the rejection-product base case; pricing
theorems require a positive number of items explicitly. -/
structure TriangularInstance (n : ℕ) where
a : Fin n → ℝ
cap : Fin n → ℝ
a_pos : ∀ i, 0 < a i
cap_pos : ∀ i, 0 < cap i
def triangularMarginals {n : ℕ} (I : TriangularInstance n) : Fin n → Measure ℝ :=
fun i => triangularLaw (I.a i) (I.cap i)
def triangularJoint {n : ℕ} (I : TriangularInstance n) : JointLaw n :=
productLaw (triangularMarginals I)
/-- Continuation recursion from zero, when the cap vector is in decreasing
order. The final stage is `k=n`; intermediate stages restrict `k ≤ n`. -/
def triangularContinuation {n : ℕ} (I : TriangularInstance n) (k : ℕ) : ℝ :=
((List.finRange n).take k).foldl
(fun C i => continuationStep (I.a i) (I.cap i) C) 0
/-- Product appearing in Lemma EC.1; it equals actual joint rejection
when the positive common price is at most every cap. -/
def triangularRejectionProduct {n : ℕ} (I : TriangularInstance n) (t : ℝ) : ℝ :=
∏ i : Fin n, t / (t + I.a i)
/-- Insert the terminal `Tri(1,P)` item before the additional canonical items.
The ordering here is decreasing cap order, not buyer inspection order. -/
def canonicalParameters (I : CanonicalInstance) : TriangularInstance (I.count + 1) where
a := Fin.cons 1 I.a
cap := Fin.cons I.terminalCap I.cap
a_pos := by
intro i
refine Fin.cases ?_ ?_ i
· exact zero_lt_one
· intro j
exact I.a_pos j
cap_pos := by
intro i
refine Fin.cases ?_ ?_ i
· exact lt_trans zero_lt_one I.terminal_one_lt
· intro j
exact lt_trans zero_lt_one (I.cap_one_lt j)
def canonicalLaw (I : CanonicalInstance) : JointLaw (I.count + 1) :=
triangularJoint (canonicalParameters I)
def canonicalPrices (I : CanonicalInstance) : Prices (I.count + 1) :=
Fin.cons I.terminalCap I.cap
end MinBuying
Read-back
What the Lean code literally says, in plain math · gpt-6-astra
The unit-interval measure is Lebesgue measure restricted to the open interval . For every pair of real numbers , with no positivity hypotheses in this definition, is its image under the function . A separately defined scalar function is if , if , and if and . Real division is total, with division by zero equal to zero; in particular the image-map value at is defined, although the source measure gives that point zero mass, and unrestricted choices of can also make the denominator in zero. For every natural number , a triangular instance consists of arrays with and for each index. Its marginal family is and its joint measure is the finite product . Its continuation after steps is , where and for , so the coordinates are processed in increasing index order and taking more than steps has no further effect. Its rejection-product expression at an arbitrary real is , regardless of the caps ; no positivity assumption on appears in this definition, and a zero denominator is evaluated by the same real-division convention. If , the parameter requirements are vacuous, every continuation is , and this product is . A canonical instance used by the remaining definitions consists of a count , a terminal cap , arrays and for , and the strict ordering whenever . Its associated triangular instance has coordinates: coordinate has parameters and coordinate has parameters . Its canonical law is the product of those triangular marginal measures, and its canonical price vector is . The case is included and gives one coordinate with parameters and price .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.