GS.isFree
defimported Lean
Man i is free in s iff no woman holds him.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open List Finset in def GS.isFree {n : ℕ} (s : DAState n) (i : Fin n) : Bool
- Defined in
- EconCSLib, `GS.isFree`
- Lean proof
- By xbei (from the file's git history), from github.com/gametheoryinlean/EconCSLib at
1a88f809b538(Copyright (c) 2026 EconCSLib contributors. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.30.0.GS.isFree← GS.isFree (EconCSLib/MarketDesign/Matching/GaleShapley.lean:131): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 1
- GS.DAStateDA state: per-man proposal cursor + per-woman tentative hold.
- Used by 24
- proposal_rank_boundWhen free man
jproposes to womaniindaStep, the resulting hold has rank ≤ j. - holdinv_step
HoldInvis preserved by one DA step. Proof structure: case-analyze on the pair(s.holding p, bestNew p)that drivesdaStep's… - GS.daStepOne step of standard men-proposing DA. All free men propose; women pick the best of {held, new proposers} by rank; free men advance their…
- GS.freeMenSetThe finset of all free men in
s. - GS.daStep_holdingOne step of DA: woman
p's new holding, expanded once. This is the workhorse rewrite for any proof that needs to case-split on what… - nc_sum_increase
∑ nextChoicestrictly increases when free men exist. - jinv_step
JInvis preserved by onedaStep. - pl_free_propsHelper: membership in the proposerList implies freedom and proposal target.
- GS.daStep_nc_heldGS.daStep_nc_held
- not_free_of_nc_ge
nextChoice i ≥ n+ injectivity +JInv→ maniis not free. - GS.daStep_nc_freeGS.daStep_nc_free
- GS.daStep_NoAchievableRejectionInductive step (KEY LEMMA).
NoAchievableRejectionis preserved by onedaStep. Also threadsHoldInv(for the old-holder index… - finalState_no_free_menAt termination, every man is held (no free man remains). Proof: if a free man remained,
nc_sum_growswould given*n + 1 ≤ n*n,… - finalState_rank_boundAt termination: if man j proposed to woman i at some round (j was free, i was his nc-th choice at state s, and the rest of the run reaches…
- GS.mem_freeMenSetGS.mem_freeMenSet
- final_all_men_heldAt termination, every man is held by some woman.
- daStep_nc_le_n
nextChoice i ≤ nfordaStep. - GS.isFree_iffGS.isFree_iff
- daStep_held_of_free_propFree man
iproposing to womanpmakes her held indaStep. - proposal_rank_bound_runOver a daRun, if man j proposed to woman i at the first step, woman i's final partner has rank ≤ j's rank in w.prefs i.
- holding_rank_mono_stepAfter one
daStep, womanj's held man's rank can only decrease (she only upgrades). - holding_injective_stepIn
daStep,holdingremains injective. - rsinv_stepRSInv is preserved by one daStep.
- GS.not_isFree_iffGS.not_isFree_iff
- proposal_rank_boundWhen free man
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open List Finset in /-- Man `i` is free in `s` iff no woman holds him. -/ def GS.isFree {n : ℕ} (s : DAState n) (i : Fin n) : Bool := decide (∀ j : Fin n, s.holding j ≠ some i)