AFTD Auto-Formalizing Theoretical Domains

isNashEq

defimported Lean

Executable Nash equilibrium checker. Returns true iff σ is a pure Nash equilibrium of G.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {N U : Type*} [DecidableEq N] [Preorder U] [DecidableRel (· ≤ · : U → U → Prop)] in
open EconCSLib.StrategicGame in
def isNashEq [Fintype N] (G : EconCSLib.StrategicGame N U) [∀ i, Fintype (G.strategy i)]
    (σ : G.Profile) : Bool
Defined in
EconCSLib, `isNashEq`
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.
What was changed in isNashEq
--- EconCSLib/GameTheory/StrategicGame/Checker.lean:25 (isNashEq)
+++ as compiled here
@@ -1,5 +1,7 @@
-/-- Executable Nash equilibrium checker.
-    Returns `true` iff `σ` is a pure Nash equilibrium of `G`. -/
-def isNashEq [Fintype N] (G : StrategicGame N U) [∀ i, Fintype (G.strategy i)]
+set_option autoImplicit true in
+set_option relaxedAutoImplicit true in
+variable {N U : Type*} [DecidableEq N] [Preorder U] [DecidableRel (· ≤ · : U → U → Prop)] in
+open EconCSLib.StrategicGame in
+def isNashEq [Fintype N] (G : EconCSLib.StrategicGame N U) [∀ i, Fintype (G.strategy i)]
     (σ : G.Profile) : Bool :=
-  decide (∀ i : N, ∀ s' : G.strategy i, G.payoff (deviate σ i s') i ≤ G.payoff σ i)
+  decide (∀ i : N, ∀ s' : G.strategy i, G.payoff (EconCSLib.StrategicGame.deviate σ i s') i ≤ G.payoff σ i)
Verified
08 Oct 2026
Axioms
none listed
Built on 6
Used by 1
  • isNashEq_iffT6: The checker correctly decides Nash equilibrium (soundness and completeness).

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {N U : Type*} [DecidableEq N] [Preorder U] [DecidableRel (· ≤ · : U → U → Prop)] in
open EconCSLib.StrategicGame in
/-- Executable Nash equilibrium checker. Returns `true` iff `σ` is a pure Nash equilibrium of `G`. -/
def isNashEq [Fintype N] (G : EconCSLib.StrategicGame N U) [∀ i, Fintype (G.strategy i)]
    (σ : G.Profile) : Bool :=
  decide (∀ i : N, ∀ s' : G.strategy i, G.payoff (EconCSLib.StrategicGame.deviate σ i s') i ≤ G.payoff σ i)
See it in the graphDiscuss this resultChallenge it