AFTD Auto-Formalizing Theoretical Domains

gs_injective

theoremverifiedformalizationimported Lean

gs w m is injective.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open List Finset in
open GS in
variable {n : ℕ} [NeZero n] in
variable (w m : Preferences n) in
lemma gs_injective : Function.Injective (gs w m)
Formalizes
EconCSLib, `gs_injective`
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 6
  • final_holding_injectivefinalState holding is injective.
  • final_all_women_holdAt termination, every woman holds some man.
  • GS.PreferencesList-based preferences: prefs i is a full permutation of Fin n, ordered from most to least preferred.
  • GS.gsThe Gale-Shapley function: woman j's partner at termination.
  • GS.DAStateDA state: per-man proposal cursor + per-woman tentative hold.
  • GS.finalStatefinalState: run daRun with fuel n*n + 1 from initState.
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] invariable (w m : Preferences n) in/-- `gs w m` is injective. -/lemma gs_injective : Function.Injective (gs w m) := by  intro j1 j2 heq  simp only [gs] at heq  obtain ⟨i1, hi1⟩ := final_all_women_hold w m j1  obtain ⟨i2, hi2⟩ := final_all_women_hold w m j2  simp [hi1, hi2] at heq; subst heq  exact final_holding_injective w m j1 j2 i1 hi1 hi2
See it in the graphDiscuss this resultChallenge it