Drug-market vertical network: equilibrium objects
Definitiondrug_market_equilibriumEquilibrium objects of the drug-market game, defined from the primitives. Retail price best responses are , , giving gross profit . Writing and , the wholesale equilibrium prices are and . The retail violence best response is with . Downstream equilibrium objects are the retail price , demand , gross margin , gross profit , and violence evaluated at equilibrium profit. NOTE: the printed closed forms (3.50), (3.53), (3.55), (3.59), (3.62) carry inconsistent constant factors ( versus , a missing , versus ); the constants used here are those obtained by solving the model's own first-order conditions (3.48)–(3.49) composed with (3.21)–(3.25). All qualitative sign results are unaffected.
import Mathlib import Definitions.Def_drug_market_model noncomputable section namespace DrugMarket /-- Retailer A's equilibrium price as a function of wholesale prices (eq. 3.21). -/ def retailPriceA (t w_a w_b : ℝ) : ℝ := t + (2 * w_a + w_b) / 3 /-- Retailer B's equilibrium price as a function of wholesale prices (eq. 3.22). -/ def retailPriceB (t w_a w_b : ℝ) : ℝ := t + (2 * w_b + w_a) / 3 /-- Retailer A's gross profit at the retail price equilibrium, `π'_a` (eq. 3.25). -/ def grossProfitA (t w_a w_b : ℝ) : ℝ := (t + (w_b - w_a) / 3) ^ 2 / (2 * t) /-- Retailer B's gross profit at the retail price equilibrium, `π'_b` (eq. 3.25). -/ def grossProfitB (t w_a w_b : ℝ) : ℝ := (t + (w_a - w_b) / 3) ^ 2 / (2 * t) /-- The expected-repression cost markup `k_i = s ρ_i / (1 - ρ_i)`, where `ρ_i = q ^ (1 / v_ri)` is the police success probability against wholesaler i (appears in eq. 3.48–3.51). -/ def kappa (q s v_ri : ℝ) : ℝ := s * catchWholesale q v_ri / (1 - catchWholesale q v_ri) /-- The quantity `q̂_i = -v_r / (ln q · (π'_i + s))` (eq. 3.32–3.33). -/ def qHat (q s v_r g : ℝ) : ℝ := -v_r / (Real.log q * (g + s)) /-- The interior violence best response `v*_i = v_r · ln(q̂_i) / ln q` (eq. 3.34–3.35). -/ def violenceBR (q s v_r g : ℝ) : ℝ := v_r * Real.log (qHat q s v_r g) / Real.log q /-- Wholesaler A's equilibrium price (eq. 3.50, with the constant corrected to `s/3` as obtained by solving (3.48)–(3.49)). -/ def wholesalePriceA (q s t c v_ra v_rb : ℝ) : ℝ := 3 * t + c + (2 * kappa q s v_ra + kappa q s v_rb) / 3 /-- Wholesaler B's equilibrium price (eq. 3.51, constant corrected to `s/3`). -/ def wholesalePriceB (q s t c v_ra v_rb : ℝ) : ℝ := 3 * t + c + (2 * kappa q s v_rb + kappa q s v_ra) / 3 /-- Retailer A's equilibrium gross margin `t + (k_b - k_a)/9` (eq. 3.62). -/ def eqMarginA (q s t c v_ra v_rb : ℝ) : ℝ := t + (kappa q s v_rb - kappa q s v_ra) / 9 /-- Retailer B's equilibrium gross margin `t + (k_a - k_b)/9`. -/ def eqMarginB (q s t c v_ra v_rb : ℝ) : ℝ := t + (kappa q s v_ra - kappa q s v_rb) / 9 /-- Retailer A's equilibrium retail price (eq. 3.55 / 3.63, constant corrected: `4t + c + (5k_a + 4k_b)/9`). -/ def eqRetailPriceA (q s t c v_ra v_rb : ℝ) : ℝ := 4 * t + c + (5 * kappa q s v_ra + 4 * kappa q s v_rb) / 9 /-- Retailer B's equilibrium retail price (eq. 3.56 / 3.63, constant corrected). -/ def eqRetailPriceB (q s t c v_ra v_rb : ℝ) : ℝ := 4 * t + c + (5 * kappa q s v_rb + 4 * kappa q s v_ra) / 9 /-- Retailer A's equilibrium demand (eq. 3.53 / 3.64, constant corrected: `1/2 + (k_b - k_a)/(18t)`). -/ def eqDemandA (q s t c v_ra v_rb : ℝ) : ℝ := (1 : ℝ) / 2 + (kappa q s v_rb - kappa q s v_ra) / (18 * t) /-- Retailer B's equilibrium demand (eq. 3.54, constant corrected). -/ def eqDemandB (q s t c v_ra v_rb : ℝ) : ℝ := (1 : ℝ) / 2 + (kappa q s v_ra - kappa q s v_rb) / (18 * t) /-- Retailer A's equilibrium gross profit `π'_a = (t + (k_b - k_a)/9)² / (2t)` (eq. 3.59 / 3.62, constant corrected). -/ def eqGrossProfitA (q s t c v_ra v_rb : ℝ) : ℝ := eqMarginA q s t c v_ra v_rb ^ 2 / (2 * t) /-- Retailer B's equilibrium gross profit (eq. 3.59, constant corrected). -/ def eqGrossProfitB (q s t c v_ra v_rb : ℝ) : ℝ := eqMarginB q s t c v_ra v_rb ^ 2 / (2 * t) /-- Retailer A's equilibrium violence (eq. 3.57), as a function of the repression intensities through the equilibrium gross profit. -/ def eqViolenceA (q s t c v_r v_ra v_rb : ℝ) : ℝ := violenceBR q s v_r (eqGrossProfitA q s t c v_ra v_rb) /-- Retailer B's equilibrium violence (eq. 3.58). -/ def eqViolenceB (q s t c v_r v_ra v_rb : ℝ) : ℝ := violenceBR q s v_r (eqGrossProfitB q s t c v_ra v_rb) end DrugMarket end
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.