Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Drug-market vertical network: equilibrium objects

Definition
drug_market_equilibrium

by LG · Nov 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

economicsgame-theoryindustrial-organization

Equilibrium objects of the drug-market game, defined from the primitives. Retail price best responses are pa=t+(2wa+wb)/3p_a=t+(2w_a+w_b)/3pa​=t+(2wa​+wb​)/3, pb=t+(2wb+wa)/3p_b=t+(2w_b+w_a)/3pb​=t+(2wb​+wa​)/3, giving gross profit πa′=(t+(wb−wa)/3)2/(2t)\pi'_a=(t+(w_b-w_a)/3)^2/(2t)πa′​=(t+(wb​−wa​)/3)2/(2t). Writing ρi=q1/vri\rho_i=q^{1/v_{ri}}ρi​=q1/vri​ and ki=sρi/(1−ρi)k_i=s\rho_i/(1-\rho_i)ki​=sρi​/(1−ρi​), the wholesale equilibrium prices are wa∗=3t+c+(2ka+kb)/3w_a^*=3t+c+(2k_a+k_b)/3wa∗​=3t+c+(2ka​+kb​)/3 and wb∗=3t+c+(2kb+ka)/3w_b^*=3t+c+(2k_b+k_a)/3wb∗​=3t+c+(2kb​+ka​)/3. The retail violence best response is vi∗=vrln⁡(q^i)/ln⁡qv_i^*=v_r\ln(\hat q_i)/\ln qvi∗​=vr​ln(q^​i​)/lnq with q^i=−vr/(ln⁡q (πi′+s))\hat q_i=-v_r/(\ln q\,(\pi'_i+s))q^​i​=−vr​/(lnq(πi′​+s)). Downstream equilibrium objects are the retail price 4t+c+(5ka+4kb)/94t+c+(5k_a+4k_b)/94t+c+(5ka​+4kb​)/9, demand 12+(kb−ka)/(18t)\tfrac12+(k_b-k_a)/(18t)21​+(kb​−ka​)/(18t), gross margin t+(kb−ka)/9t+(k_b-k_a)/9t+(kb​−ka​)/9, gross profit (t+(kb−ka)/9)2/(2t)(t+(k_b-k_a)/9)^2/(2t)(t+(kb​−ka​)/9)2/(2t), and violence vrln⁡(q^i)/ln⁡qv_r\ln(\hat q_i)/\ln qvr​ln(q^​i​)/lnq evaluated at equilibrium profit. NOTE: the printed closed forms (3.50), (3.53), (3.55), (3.59), (3.62) carry inconsistent constant factors (3s3s3s versus s/3s/3s/3, a missing 1/(18t)1/(18t)1/(18t), 3t3t3t versus 4t4t4t); 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.

Definition code
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
Source
Gilberto José Nogueira Júnior, *Mercado de Drogas e Repressão: Efeitos da Intervenção Governamental sobre a Violência gerada pelo Mercado de Drogas numa Rede Verticalmente Relacionada*, MSc dissertation, UFPE/PIMES, 2019, Chapter 3. Equations (3.21)–(3.35), (3.48)–(3.64); printed constant factors corrected as documented.
Human review
  • Endorsed by Shuze Chen · Nov 16, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Nov 16, 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