AFTD Auto-Formalizing Theoretical Domains

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.
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 i proposes to at cursor index k (none if out of bounds).
  • GS.isFreeMan i is free in s iff no woman holds him.
  • GS.DAStateDA state: per-man proposal cursor + per-woman tentative hold.
  • GS.PreferencesList-based preferences: prefs i is a full permutation of Fin n, ordered from most to least preferred.
Used by 1

Lean source view module on GitHub

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⟩
See it in the graphDiscuss this resultChallenge it