daStep_held_of_free_prop
theoremverifiedformalizationimported Lean
Free man i proposing to woman p makes her held in daStep.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open List Finset in open GS in variable {n : ℕ} [NeZero n] in lemma daStep_held_of_free_prop (w m : Preferences n) (s : DAState n) (i p : Fin n) (hfi : isFree s i = true) (hpt : propTarget m i (s.nextChoice i) = some p) : ∃ h : Fin n, (daStep w m s).holding p = some h
- Formalizes
- EconCSLib, `daStep_held_of_free_prop`
- 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.daStep_held_of_free_prop← daStep_held_of_free_prop (EconCSLib/MarketDesign/Matching/GaleShapley.lean:483): verbatim
- Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 5
- 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.propTargetThe woman man
iproposes to at cursor indexk(none if out of bounds). - GS.isFreeMan
iis free insiff no woman holds him. - GS.DAStateDA state: per-man proposal cursor + per-woman tentative hold.
- GS.PreferencesList-based preferences:
prefs iis a full permutation ofFin n, ordered from most to least preferred.
- Used by 1
- jinv_step
JInvis preserved by onedaStep.
- jinv_step
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen List Finset inopen GS invariable {n : ℕ} [NeZero n] in/-- Free man `i` proposing to woman `p` makes her held in `daStep`. -/lemma daStep_held_of_free_prop (w m : Preferences n) (s : DAState n) (i p : Fin n) (hfi : isFree s i = true) (hpt : propTarget m i (s.nextChoice i) = some p) : ∃ h : Fin n, (daStep w m s).holding p = some h := by have hi_in : i ∈ (Finset.univ.filter (fun k : Fin n => isFree s k && (propTarget m k (s.nextChoice k) == some p))).val.toList := Multiset.mem_toList.mpr (Finset.mem_val.mpr (Finset.mem_filter.mpr ⟨Finset.mem_univ _, by simp [hfi, hpt]⟩)) -- The proposer list is nonempty (i is in it), so argmin returns Some. set pl := (Finset.univ.filter (fun k : Fin n => isFree s k && (propTarget m k (s.nextChoice k) == some p))).val.toList with hpl_def have hne_pl : pl ≠ [] := List.ne_nil_of_mem hi_in have hbn : ∃ q : Fin n, pl.argmin (fun k => (w.prefs p).idxOf k) = some q := (Option.ne_none_iff_exists.mp (List.argmin_eq_none.not.mpr hne_pl)).imp (fun _ h => h.symm) obtain ⟨q, hq⟩ := hbn simp only [daStep, ← hpl_def] cases hs : s.holding p with | none => simp only [hs, hq]; exact ⟨q, rfl⟩ | some h => simp only [hs, hq]; split_ifs <;> exact ⟨_, rfl⟩