Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.2.4 — every optimal matching is ordered

Proved
Supermodularity.Matching.isOrdered_of_optimal_of_strictlySupermodular

by mikedeng1 · Sep 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

comparative-staticsmatchingorder-theorysupermodularity

Suppose f(x,j)f(x,j)f(x,j) is supermodular in the joint variable (x,j)(x,j)(x,j) on (∏i=1nXi)×{1,…,m}\bigl(\prod_{i=1}^n X_i\bigr) \times \{1,\dots,m\}(∏i=1n​Xi​)×{1,…,m}, and, for each fixed firm jjj, f(⋅,j)f(\cdot,j)f(⋅,j) is strictly supermodular in xxx on ∏i=1nXi\prod_{i=1}^n X_i∏i=1n​Xi​. Then every optimal matching is ordered (IsOrderedMatching): any two of the mmm quality vectors it assigns are comparable.

Topkis, Theorem 3.2.4 (p. 100): "If f(x,j)f(x,j)f(x,j) is supermodular in (x,j)(x,j)(x,j) on ×i=1nXi×{1,…,m}\times_{i=1}^n X_i \times \{1,\dots,m\}×i=1n​Xi​×{1,…,m} and is strictly supermodular in xxx on ×i=1nXi\times_{i=1}^n X_i×i=1n​Xi​ for each jjj, then each optimal matching is ordered." The proof exchanges the assignments of any two unordered firms via ∨,∧\vee,\wedge∨,∧ and derives a strict profit improvement from the two supermodularity hypotheses together, contradicting optimality.

Formalization Note. The two supermodularity hypotheses are genuinely different in kind (joint, non-strict, in (x,j)(x,j)(x,j); and per-firm, strict, in xxx alone) and are kept as two separate hypotheses rather than merged into one strengthened statement, matching the book's own remark that this pair is equivalent to "f(x,j)f(x,j)f(x,j) has increasing differences in (x,j)(x,j)(x,j) and is strictly supermodular in xxx" by Theorems 2.6.1–2.6.2.

Preamble
import Mathlib
import Definitions.Def_Supermodularity_Monotonicity_SupermodularOn
import Definitions.Def_Supermodularity_Matching_StrictlySupermodularOn
import Definitions.Def_Supermodularity_Matching_IsOptimalMatching
import Definitions.Def_Supermodularity_Matching_IsOrderedMatching
Formal statement
namespace Supermodularity.Matching

theorem isOrdered_of_optimal_of_strictlySupermodular
    {n m : ℕ} {X : Fin n → Type*} [∀ i, Lattice (X i)]
    (f : (∀ i, X i) → Fin m → ℝ)
    (hf : Supermodularity.Monotonicity.SupermodularOn
      (fun p : (∀ i, X i) × Fin m => f p.1 p.2) Set.univ)
    (hfx : ∀ j : Fin m, StrictlySupermodularOn (fun x : ∀ i, X i => f x j) Set.univ) :
    ∀ x : Fin m → ∀ i, X i, IsOptimalMatching f x → IsOrderedMatching x := by sorry

end Supermodularity.Matching
Source
Topkis, Supermodularity and Complementarity, Princeton University Press, 2011, p. 100, Theorem 3.2.4
Read-back

What the Lean code literally says, in plain math · claude-opus-5

This statement concerns an assignment problem in which mmm "matchings" are each a full profile of coordinates, and asserts that optimality forces them to be ordered.

The setting. Fix natural numbers nnn and mmm. For each index i∈{0,…,n−1}i \in \{0,\dots,n-1\}i∈{0,…,n−1} (the finite type Fin n\mathrm{Fin}\,nFinn) we are given a type XiX_iXi​ equipped with a lattice structure, so that any two elements a,b∈Xia,b \in X_ia,b∈Xi​ have a meet a∧ba \wedge ba∧b and a join a∨ba \vee ba∨b. The product type P:=∏iXiP := \prod_{i} X_iP:=∏i​Xi​ consists of profiles x=(xi)i<nx = (x_i)_{i < n}x=(xi​)i<n​; it inherits the componentwise lattice order. We are also given a function

f:P×Fin m→R,f : P \times \mathrm{Fin}\,m \to \mathbb{R},f:P×Finm→R,

written f(x,j)f(x, j)f(x,j), assigning a real number to each profile xxx and each index j∈{0,…,m−1}j \in \{0,\dots,m-1\}j∈{0,…,m−1}.

The two hypotheses.

  • hf: the uncurried function (x,j)↦f(x,j)(x, j) \mapsto f(x, j)(x,j)↦f(x,j), viewed as a function on the product type P×Fin mP \times \mathrm{Fin}\,mP×Finm, satisfies SupermodularOn on the set Set.univ, i.e. on all of P×Fin mP \times \mathrm{Fin}\,mP×Finm. The lattice structure on this product is the componentwise one, where the second factor Fin m\mathrm{Fin}\,mFinm carries its own lattice order (the linear order on {0,…,m−1}\{0,\dots,m-1\}{0,…,m−1}), so meets and joins here act on the profile coordinate and the index coordinate simultaneously. The precise content of SupermodularOn is whatever the imported definition Supermodularity.Monotonicity.SupermodularOn states — it is not unfolded here, and the read-back cannot report its exact inequality; it is a predicate taking a function into R\mathbb{R}R and a subset of its domain.

  • hfx: for every index j∈Fin mj \in \mathrm{Fin}\,mj∈Finm, the section x↦f(x,j)x \mapsto f(x, j)x↦f(x,j), as a function on PPP alone, satisfies StrictlySupermodularOn on Set.univ, i.e. on all of PPP. Again the exact inequality is supplied by the imported definition Supermodularity.Matching.StrictlySupermodularOn and is not visible in this statement.

Note that hf and hfx are separate assumptions: supermodularity of the joint function in (x,j)(x,j)(x,j) together, and strict supermodularity of each fixed-jjj slice in xxx.

The conclusion. For every function

x:Fin m→∏i<nXi,x : \mathrm{Fin}\,m \to \prod_{i<n} X_i,x:Finm→i<n∏​Xi​,

that is, every assignment j↦x(j)j \mapsto x(j)j↦x(j) of a full profile x(j)∈Px(j) \in Px(j)∈P to each index jjj, the implication

IsOptimalMatching(f,x)  ⟹  IsOrderedMatching(x)\mathrm{IsOptimalMatching}(f, x) \;\Longrightarrow\; \mathrm{IsOrderedMatching}(x)IsOptimalMatching(f,x)⟹IsOrderedMatching(x)

holds. The meanings of IsOptimalMatching and IsOrderedMatching are supplied by the imported definitions Supermodularity.Matching.IsOptimalMatching and Supermodularity.Matching.IsOrderedMatching; this statement does not unfold them. What is visible is their signatures: optimality is a predicate of both fff and xxx, while orderedness is a predicate of xxx alone, making no reference to fff — so whatever notion of "ordered" is meant, it is a property of the assignment j↦x(j)j \mapsto x(j)j↦x(j) intrinsic to the lattice orders on the XiX_iXi​, not relative to the objective.

Direction and strength. The implication runs one way only: optimal ⇒\Rightarrow⇒ ordered. Nothing is asserted about ordered matchings being optimal, about existence of an optimal matching, or about uniqueness. The universal quantifier ranges over all functions x:Fin m→Px : \mathrm{Fin}\,m \to Px:Finm→P, with no injectivity, surjectivity or distinctness requirement — so an xxx that sends every index jjj to the same profile is included, as is any xxx repeating profiles arbitrarily.

Degenerate cases. The statement is proved by sorry and so carries no verified content; what follows is what it asserts in the boundary cases its hypotheses permit. If m=0m = 0m=0, then Fin 0\mathrm{Fin}\,0Fin0 is empty: hypothesis hfx is vacuously true, the domain P×Fin 0P \times \mathrm{Fin}\,0P×Fin0 of hf is empty (so hf is a supermodularity claim over an empty set, presumably vacuous), and there is exactly one function x:Fin 0→Px : \mathrm{Fin}\,0 \to Px:Fin0→P, the empty one — the claim then reduces to whether that empty assignment, if optimal, is ordered, entirely as IsOptimalMatching and IsOrderedMatching decide on the empty index set. If m=1m = 1m=1, there is a single index and no pair of distinct indices to compare, so the orderedness conclusion is whatever IsOrderedMatching says about a one-element family. If n=0n = 0n=0, the product ∏i<0Xi\prod_{i<0} X_i∏i<0​Xi​ is a singleton (the empty profile) — a one-element lattice — so every x:Fin m→Px : \mathrm{Fin}\,m \to Px:Finm→P is the constant map to that single point; hfx then demands strict supermodularity of a function on a one-point lattice, which, depending on how StrictlySupermodularOn is phrased, may be either automatic or unsatisfiable, and if unsatisfiable the whole theorem is vacuous for n=0n = 0n=0. If any individual XiX_iXi​ is empty, then PPP is empty, hence (for m≥1m \ge 1m≥1) no function x:Fin m→Px : \mathrm{Fin}\,m \to Px:Finm→P exists and the conclusion holds vacuously, while hf and hfx are claims about functions on empty domains. If some XiX_iXi​ is a singleton, the lattice operations there are trivial and the strictness in hfx may again be impossible to witness on comparable-only pairs, which would make the hypotheses unsatisfiable and the theorem vacuously true; nothing in the statement rules this out. No division, subtraction in N\mathbb{N}N, integration, or supremum over a possibly-empty or unbounded set appears at this level, so no Lean default or junk value is invoked by the statement itself — though such values may occur inside the four imported definitions, which are opaque here. Finally, because the strength of SupermodularOn and StrictlySupermodularOn is not exhibited, this read-back cannot report whether the hypotheses are jointly satisfiable by any fff at all: if they are not, the theorem asserts nothing.

Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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