Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Removing an available proposal decreases the proposal budget by one

Proved
AppliedModelingLib.Matching.remainingProposalCount_removeProposal_add_one

by nkgarg · Sep 15, 2026 · Mathlib c5ea003 (Lean v4.30.0)

aml-gs62-stable-marriage-20260915game-theorystable-matching

Let M,WM,WM,W be finite sets and let a state sss give each man x∈Mx\in Mx∈M a finite remaining proposal set Px⊆WP_x\subseteq WPx​⊆W. Define

R(s)=∑x∈M∣Px∣.R(s)=\sum_{x\in M}|P_x|.R(s)=x∈M∑​∣Px​∣.

If w∈Pmw\in P_mw∈Pm​, replace PmP_mPm​ by Pm∖{w}P_m\setminus\{w\}Pm​∖{w} and leave every other proposal set unchanged, obtaining proposal sets Px′P'_xPx′​. Then

∑x∈M∣Px′∣+1=R(s).\sum_{x\in M}|P'_x|+1=R(s).x∈M∑​∣Px′​∣+1=R(s).

This is the finite counting identity behind termination of deferred acceptance.

Preamble
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Finset.Basic
import Mathlib.Data.Finset.Max
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Real.Basic
import Mathlib.Tactic.Linarith
import Definitions.Def_AMLGS62_AppliedModelingLib_Markets_Matching_DeferredAcceptance

open AppliedModelingLib
open AppliedModelingLib.Matching

variable {M W : Type*} [Fintype M] [Fintype W] [DecidableEq M] [DecidableEq W]

set_option linter.unusedSimpArgs false

set_option linter.unusedSimpArgs true

-- DA algorithm fold

Formal statement
theorem AppliedModelingLib.Matching.remainingProposalCount_removeProposal_add_one
    (s : DAState M W) {m : M} {w : W}
    (hw : w ∈ s.m_proposals m) :
    (∑ m' : M, ((removeProposal s m w) m').card) + 1 =
      remainingProposalCount s := by sorry
Source
Supporting lemma in the AppliedModelingLib deferred-acceptance formalization; https://github.com/nikhgarg/AppliedModelingLib/blob/e952266be81e96bbeecea6af83d639af324a4438/AppliedModelingLib/Markets/Matching/DeferredAcceptance.lean#L1221-L1247

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me