From Rules to Nash Equilibria: A Lean 4 Case Study in Game-Theoretic Analysis of a Competitive Trading Card Game
Arthur F. Ramos, Tulio Soria
cs.GT
Jul 9, 2026 · v1
cs.FL
TL;DR
Game-theoretic metagame analysis of the Pokemon TCG formalized in Lean 4, using native_decide over exact rationals to verify Nash equilibria and replicator dynamics.
Abstract
We present a metagame analysis of the competitive Pokemon Trading Card Game, machine-checked in Lean 4 over real tournament data. The headline game-theoretic results, including Nash equilibrium, replicator dynamics, and the matrix-level type-bridge computation, rely on native_decide, which trusts Lean's compiler rather than its kernel; the trust boundary is made explicit. The artifact spans approximately 31,900 lines, 87 files, and 2,627 theorems, of which roughly 200 directly verify empirical claims, with no sorry, admit, or custom axioms. Analyzing Trainer Hill data from January to February 2026 for events with at least 50 players, over 14 archetypes and their full pairwise matchup matrix, we prove a popularity paradox: the most played deck, Dragapult, with 15.5% metagame share, has only 46.7% expected win rate, while Grimmsnarl, with 5.1% share, achieves 52.7%. A machine-checked Nash equilibrium of the raw game assigns Dragapult 0% weight; exhaustive enumeration over all nonempty support subsets confirms a unique symmetric Nash equilibrium of the constant-sum symmetrization with seven-deck support. Against this equilibrium mix, Dragapult falls 40.4 permil below the game value. Single-step replicator dynamics indicate downward fitness pressure on Dragapult, upward pressure on Grimmsnarl, and strongest extinction pressure on Alakazam. A 10,000-iteration sensitivity analysis confirms qualitative stability, with core support decks appearing in more than 96% of resampled equilibria. The primary contribution is methodological: a reproducible case study showing how formal verification can turn qualitative metagame narratives into machine-checkable, re-runnable strategic science.
Problem
Competitive trading card game deck selection is naturally modeled as a strategic game, but informal metagame narratives risk silent modeling errors and are not machine-checkable or reproducible against updated data.
Approach
Game semantics, tournament data, and matchup matrices for the Pokemon TCG are encoded in Lean 4 using exact rational arithmetic. Strategic claims (expected win rates, Nash equilibria, replicator dynamics, tournament transforms) are stated as typed propositions. An untrusted Python discovery layer proposes candidate equilibria; Lean certifies best-response and dynamics claims at compile time, mostly via native_decide over exact rationals, with the compiler-trust boundary made explicit.
Results
The artifact spans 31,900 lines, 87 files, and 2,627 theorems with no sorry, admit, or custom axioms. It machine-checks a popularity paradox (Dragapult: 15.5% share, 46.7% expected WR vs Grimmsnarl: 5.1% share, 52.7% WR) and a unique seven-deck symmetric Nash equilibrium excluding Dragapult (40.4 permil below game value), with a 10,000-iteration sensitivity analysis confirming stability.
| Deck | Row wt. | Col wt. |
|---|
| Gholdengo Lunatone | 0.0% | 3.7% |
| Grimmsnarl Froslass | 37.8% | 40.5% |
| Mega Absol Box | 12.9% | 7.2% |
| Charizard Noctowl | 11.3% | 5.0% |
| Raging Bolt Ogerpon | 28.7% | 35.9% |
Lean-verified Nash supports for row and column strategies
| Category | Count | Level |
|---|
| Kernel subtotal | 2,482 | Kernel |
| Compiler subtotal | 145 | native_decide |
| Total | 2,627 | mixed |
Theorem counts by category and verification level