Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Gains from trade: specialization by comparative advantage expands both countries' consumption possibilities

Proved
ComparativeAdvantage.gains_from_trade

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

comparative-advantageeconomicsinternational-trade

Let Home and Foreign be two countries of the Ricardian model, Home with labour force LLL and unit labour requirements aLC,aLWa_{LC},a_{LW}aLC​,aLW​, Foreign with L′,aLC′,aLW′L',a'_{LC},a'_{LW}L′,aLC′​,aLW′​ (all positive), and suppose Home has a comparative advantage in cloth, aLC/aLW<aLC′/aLW′a_{LC}/a_{LW}<a'_{LC}/a'_{LW}aLC​/aLW​<aLC′​/aLW′​. Let world prices PC,PW>0P_C,P_W>0PC​,PW​>0 satisfy

aLCaLW≤PCPW≤aLC′aLW′.\frac{a_{LC}}{a_{LW}}\le\frac{P_C}{P_W}\le\frac{a'_{LC}}{a'_{LW}}.aLW​aLC​​≤PW​PC​​≤aLW′​aLC′​​.

Then

  1. every bundle Home can produce in autarky, aLCQC+aLWQW≤La_{LC}Q_C+a_{LW}Q_W\le LaLC​QC​+aLW​QW​≤L, can be consumed by Home when it produces only cloth and trades, aLCQC+aLC(PW/PC)QW≤La_{LC}Q_C+a_{LC}(P_W/P_C)Q_W\le LaLC​QC​+aLC​(PW​/PC​)QW​≤L;
  2. every bundle Foreign can produce in autarky can be consumed by Foreign when it produces only wine and trades, aLW′(PC/PW)QC+aLW′QW≤L′a'_{LW}(P_C/P_W)Q_C+a'_{LW}Q_W\le L'aLW′​(PC​/PW​)QC​+aLW′​QW​≤L′;
  3. if aLC/aLW<PC/PWa_{LC}/a_{LW}<P_C/P_WaLC​/aLW​<PC​/PW​, Home's inclusion is strict;
  4. if PC/PW<aLC′/aLW′P_C/P_W<a'_{LC}/a'_{LW}PC​/PW​<aLC′​/aLW′​, Foreign's inclusion is strict.

By trading and specializing in the good of its comparative advantage, each country can expand its consumption possibilities and choose bundles it could not have produced in a closed economy.

Formalization Note The comparative-advantage hypothesis is the standing assumption of the source section; the two price bounds already imply its non-strict form.

Preamble
import Mathlib
import Definitions.Def_ComparativeAdvantage_Model
Formal statement
namespace ComparativeAdvantage

theorem gains_from_trade (h f : Country) (hCA : HasComparativeAdvantageInCloth h f)
    (PC PW : ℝ) (hPC : 0 < PC) (hPW : 0 < PW)
    (hlow : h.aLC / h.aLW ≤ PC / PW) (hhigh : PC / PW ≤ f.aLC / f.aLW) :
    autarkySet h ⊆ tradeSetCloth h PC PW ∧ autarkySet f ⊆ tradeSetWine f PC PW ∧
    (h.aLC / h.aLW < PC / PW → autarkySet h ⊂ tradeSetCloth h PC PW) ∧
    (PC / PW < f.aLC / f.aLW → autarkySet f ⊂ tradeSetWine f PC PW) := by sorry

end ComparativeAdvantage
Source
Wikipedia, "Comparative advantage" (PDF export supplied with the request); https://en.wikipedia.org/wiki/Comparative_advantage, section "Ricardian model"
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent as the drafter; non-blind

Disclosure — NON-BLIND read-back. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement it describes, with full knowledge of the source article and of the intended meaning. It is not independent, blind testimony and must not be mistaken for one. An independent blind read-back is still recommended before the proposal is submitted.

Here a country ccc is a triple of real numbers (L,aLC,aLW)(L, a_{LC}, a_{LW})(L,aLC​,aLW​), all strictly positive (the structure itself carries the positivity proofs). Let h=(L,aLC,aLW)h=(L,a_{LC},a_{LW})h=(L,aLC​,aLW​) and f=(L′,aLC′,aLW′)f=(L',a'_{LC},a'_{LW})f=(L′,aLC′​,aLW′​) be countries with aLC/aLW<aLC′/aLW′a_{LC}/a_{LW}<a'_{LC}/a'_{LW}aLC​/aLW​<aLC′​/aLW′​, and let PC>0P_C>0PC​>0, PW>0P_W>0PW​>0 with

aLCaLW≤PCPW≤aLC′aLW′.\frac{a_{LC}}{a_{LW}}\le\frac{P_C}{P_W}\le\frac{a'_{LC}}{a'_{LW}}.aLW​aLC​​≤PW​PC​​≤aLW′​aLC′​​.

Write Ah={(x,y):x,y≥0, aLCx+aLWy≤L}A_h=\{(x,y):x,y\ge0,\ a_{LC}x+a_{LW}y\le L\}Ah​={(x,y):x,y≥0, aLC​x+aLW​y≤L}, AfA_fAf​ likewise for fff, Th={(x,y):x,y≥0, aLCx+aLC(PW/PC)y≤L}T_h=\{(x,y):x,y\ge0,\ a_{LC}x+a_{LC}(P_W/P_C)y\le L\}Th​={(x,y):x,y≥0, aLC​x+aLC​(PW​/PC​)y≤L}, and Tf={(x,y):x,y≥0, aLW′(PC/PW)x+aLW′y≤L′}T_f=\{(x,y):x,y\ge0,\ a'_{LW}(P_C/P_W)x+a'_{LW}y\le L'\}Tf​={(x,y):x,y≥0, aLW′​(PC​/PW​)x+aLW′​y≤L′}. The statement asserts the conjunction:

  1. Ah⊆ThA_h\subseteq T_hAh​⊆Th​;
  2. Af⊆TfA_f\subseteq T_fAf​⊆Tf​;
  3. if aLC/aLW<PC/PWa_{LC}/a_{LW}<P_C/P_WaLC​/aLW​<PC​/PW​, then Ah⊊ThA_h\subsetneq T_hAh​⊊Th​ (contained and not equal);
  4. if PC/PW<aLC′/aLW′P_C/P_W<a'_{LC}/a'_{LW}PC​/PW​<aLC′​/aLW′​, then Af⊊TfA_f\subsetneq T_fAf​⊊Tf​.
Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 10, 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