AFTD Auto-Formalizing Theoretical Domains

GS.propTarget

defimported Lean

The woman man i proposes to at cursor index k (none if out of bounds).

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open List Finset in
def GS.propTarget {n : ℕ} (m : Preferences n) (i : Fin n) (k : ℕ) : Option (Fin n)
Defined in
EconCSLib, `GS.propTarget`
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
none listed
Built on 1
  • GS.PreferencesList-based preferences: prefs i is a full permutation of Fin n, ordered from most to least preferred.
Used by 16
  • proposal_rank_boundWhen free man j proposes to woman i in daStep, the resulting hold has rank ≤ j.
  • holdinv_stepHoldInv is preserved by one DA step. Proof structure: case-analyze on the pair (s.holding p, bestNew p) that drives daStep's…
  • GS.propTarget_ltpropTarget returns some when k < n.
  • 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.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…
  • jinv_stepJInv is preserved by one daStep.
  • pl_free_propsHelper: membership in the proposerList implies freedom and proposal target.
  • GS.daStep_nc_heldGS.daStep_nc_held
  • GS.daStep_nc_freeGS.daStep_nc_free
  • GS.daStep_NoAchievableRejectionInductive step (KEY LEMMA). NoAchievableRejection is preserved by one daStep. Also threads HoldInv (for the old-holder index…
  • 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…
  • daStep_held_of_free_propFree man i proposing to woman p makes her held in daStep.
  • 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, woman j's held man's rank can only decrease (she only upgrades).
  • holding_injective_stepIn daStep, holding remains injective.
  • rsinv_stepRSInv is preserved by one daStep.

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open List Finset in
/-- The woman man `i` proposes to at cursor index `k` (none if out of bounds). -/
def GS.propTarget {n : ℕ} (m : Preferences n) (i : Fin n) (k : ℕ) : Option (Fin n) :=
  (m.prefs i)[k]?
See it in the graphDiscuss this resultChallenge it