[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"RiL4mqIYxf":3},"# GameTheory (Lean 4)\n\nA formalization of finite game theory in Lean 4 / Mathlib, covering normal-form\ngames, extensive-form games, multi-agent influence diagrams (MAIDs),\nfactored-observation stochastic games (FOSGs), and their interconnections.\n\nThe library is organized around a single semantic target — `KernelGame` — that\npackages strategy spaces, stochastic outcomes, and utility. Solution concepts\nlike Nash equilibrium, dominance, and correlated equilibrium are defined once on\nthis shared abstraction, then inherited by every concrete representation through\ncompilation and bridging.\n\n## Theorems\n\nFormal proofs of standard results in finite game theory:\n\n- **Nash existence** — every finite game has a mixed Nash equilibrium\n  (via Brouwer fixed point on product simplices)\n- **Minimax** — von Neumann's minimax theorem for finite two-player zero-sum games\n- **Kuhn's theorem** — equivalence of mixed and behavioral strategies under\n  perfect recall, proved at a semantic model layer and instantiated for four\n  game representations:\n  - **EFG** — behavioral ↔ mixed for extensive-form games with information sets\n  - **MAID** — behavioral policy ↔ product mixed strategy for multi-agent\n    influence diagrams under DAG perfect recall\n  - **Sequential** — behavioral ↔ mixed for protocol-based sequential games\n  - **FOSG** — behavioral ↔ mixed for factored-observation stochastic games,\n    via the bridge to `ObsModelCore` and natively in terms of FOSG histories\n- **Zermelo / backward induction** — finite perfect-information games have\n  pure subgame-perfect equilibria\n- **One-shot deviation principle** — SPE characterization via single-step\n  deviations\n- **Correlated equilibrium existence** — every finite game has a correlated\n  equilibrium\n- **Folk theorem (discounted, approximate)** — every strictly\n  individually-rational feasible payoff vector of the mixed extension is\n  approachable by Nash equilibrium payoffs of the infinite discounted repeated\n  game as δ → 1, via an explicit trigger-strategy construction with finite\n  cycle approximation and minmax punishment\n- **MAID → EFG perfect recall preservation** — a MAID with perfect recall\n  produces an EFG tree with perfect recall, using DAG topological ordering\n- **Aumann's agreement theorem** — agents with a common prior who share an\n  information-partition cell have equal posteriors (\"agreeing to disagree\" is\n  impossible), with the full-agreement version on common self-evident events\n  and an S5 knowledge operator (`Concepts/CommonKnowledge.lean`)\n\n## Core abstractions\n\n| Abstraction | Role |\n|---|---|\n| `GameForm` | Utility-free game: strategies, outcomes, stochastic kernel. Protocol-level constructions live in `Core/`; preference-parametric solution concepts over game forms live in `Concepts/GameFormSolutionConcepts.lean`. |\n| `KernelGame` | `GameForm` + utility function. EU-based solution concepts (`IsNash`, `IsDominant`, …) live in `Concepts/SolutionConcepts.lean`. |\n| `ObsModel` | Observation-indexed actions over a `DSMachine`. Canonical model for Kuhn's theorem. |\n| `InfoModel` | State-based sequential game model with observations, actions, and signals. ODP and other sequential theorems are stated at this level. |\n\n`Payoff ι` is just `ι → ℝ`. Probabilities are `PMF` (discrete distributions).\nThere are no continuous strategy spaces or measure-theoretic foundations.\n\n## Solution concepts\n\nThe `Concepts/` directory defines ~40 interrelated notions, including:\n\n- Nash equilibrium, strict Nash, approximate (ε-)Nash\n- Dominant strategies, strict/weak dominance, iterated elimination\n- Correlated and coarse correlated equilibrium\n- Observable cheap-talk extensions and babbling-equilibrium transport\n- Best response, best-response dynamics\n- Mixed-extension gain tests, including uniform mixed balance ⇒ Nash and\n  binary-labeled matching-pennies-style exact mixed equilibrium characterizations\n- Security strategies (maximin), minimax guarantees, saddle points\n- Potential games (exact, ordinal, weighted), finite improvement property\n- Rationalizability, dominance solvability\n- Evolutionary stable strategies (ESS)\n- Price of anarchy, individual rationality, social welfare\n- Zero-sum, constant-sum, symmetric, and team game properties\n\nKey relationships are proved: dominant strategies are Nash, Nash EU dominates\nthe security level, ESS implies Nash, Nash equilibria are correlated equilibria,\npotential game maximizers are Nash.\n\nThe library keeps `Core/` dependency-light: it contains semantic structures and\nprotocol/distribution constructions. `Concepts/` contains preference-dependent\nand EU-dependent predicates and transport theorems.\n\n## Representations and bridges\n\nThe library treats game representations as *languages* with a uniform pipeline:\n`Syntax → SOS → Compile → KernelGame`.\n\n| Language | What it models |\n|---|---|\n| **NFG** | Simultaneous strategic choice (normal form) |\n| **EFG** | Sequential play with information sets (extensive form) |\n| **MAID** | Graph-structured decisions with chance, decision, and utility nodes |\n| **Sequential** | Protocol-based sequential games, repeated games, stochastic games |\n| **FOSG** | Factored-observation stochastic games: state-based, simultaneous moves, factored private/public observations, optional participation per player |\n| **Intrinsic** | Witsenhausen's intrinsic model — information as equivalence relations on a product configuration space |\n\nThe NFG layer also includes canonical worked examples. For Matching Pennies it\nnow records both the absence of pure Nash equilibria and the exact fair mixed\nNash characterization.\n\nBridges connect representations: MAID → EFG (topological unrolling, preserving\nperfect recall and evaluation semantics), EFG ↔ NFG (strategic form extraction\nand simultaneous-game embedding), FOSG → augmented-EFG (bounded-horizon\npresentation with two-way distributional transport — a respectful EFG profile\nmaps back to a legal FOSG profile via `efgToFOSGProfile`, and outcome kernels /\nexpected utilities agree in both directions), NFG → FOSG (one-shot embedding),\nand all languages compile to `KernelGame`.\n\n## Kuhn's theorem — proof architecture\n\nKuhn's equivalence theorem (behavioral ↔ mixed strategies) is proved at the\n`ObsModel` level — a multi-player observation model over a deterministic\nstochastic machine (`DSMachine`). This is the canonical abstraction: players\nobserve state through per-player observation functions, and actions are\nindexed by observations.\n\nThe proof decomposes into two independent directions:\n\n- **B→M** (`BehavioralToMixed.lean`): constructs a joint distribution over\n  pure profiles by taking products of per-step marginals. An involution/swap\n  argument establishes scalar independence. **No recall conditions needed.**\n\n- **M→B** (`CorrelatedRealization.lean`): starts with a correlated mediator\n  realization (always exists), then decentralizes under progressively weaker\n  recall conditions. The weakest sufficient condition is\n  `TracePlayerStepRecall` (weaker than classical perfect recall).\n\nEach concrete language compiles to `ObsModel` and applies the generic\ntheorems:\n\n- **EFG**: Both directions proved for the outcome distribution and\n  expected utility.\n- **MAID**: Both directions proved for the native frontier evaluation\n  semantics under DAG perfect recall (Koller & Milch).\n- **Sequential**: Both directions proved for the native sequential\n  evaluation semantics.\n- **FOSG**: Both directions proved natively in terms of FOSG histories,\n  legal behavioral profiles, terminal weights, and run distributions, plus\n  re-exposed through the `ObsModelCore` bridge.\n\nThe Intrinsic form (`Languages/Intrinsic/`) formalizes Witsenhausen's intrinsic\nmodel following Heymann, De Lara, and Chancelier (2020), where information is\nrepresented as equivalence relations on a product configuration space rather\nthan as tree-based information sets. Key results:\n\n- **Proposition 12**: product-mixed → behavioral (unconditional)\n- **Proposition 13**: behavioral → product-mixed via product PMF over\n  information classes, with the marginal identity proved using an equivalence\n  `PureStrategy ≃ (InfoClass → Decision)`\n- **Kuhn outcome-equivalence reduction**: the Intrinsic API proves full\n  outcome-law equivalence from the player-local event-mass realization\n  condition; the old behavioral-marginal statement is not exposed as Kuhn's\n  theorem.\n\n## Auctions and mechanism design\n\n- First-price, second-price (Vickrey), all-pay, and VCG auctions\n- Quasi-linear utility decomposition (allocation + payment)\n- Bayesian games with type spaces\n- Incentive compatibility (dominant-strategy and Bayesian)\n- Revelation principle\n- Finite information design / Bayesian persuasion (signal structures, Bayes\n  plausibility, sender/receiver persuasion primitives)\n- Social choice and aggregation, including one direction of **Arrow's\n  impossibility theorem** (a dictatorial social welfare function satisfies\n  Pareto and independence of irrelevant alternatives)\n\n## Cooperative game theory\n\nA parallel `Cooperative/` branch formalizes the cooperative tradition, whose\nprimitives are coalition value functions, feasible payoff sets, and preference\nrankings rather than per-player strategies. It does **not** go through\n`KernelGame` — apart from the player-index type and `ℝ` it shares no\nload-bearing abstractions with the non-cooperative core, and lives in the same\npackage only for packaging convenience.\n\n- **Coalitional (TU) games** — the **Shapley value** and its uniqueness via\n  unanimity-game decomposition (efficiency, symmetry, dummy, additivity), the\n  Banzhaf index and the Shapley–Shubik power index on simple games, convex\n  (supermodular) games with the monotone-marginals characterization, and the\n  core (with nonemptiness for convex games)\n- **Nash bargaining** — the Nash bargaining solution for two-player problems\n  (Pareto optimality, symmetry, affine invariance) and the egalitarian (Kalai)\n  solution\n- **Stable matching** — two-sided matching markets, blocking pairs, and\n  Gale–Shapley stability\n\nNote: \"cooperative\" here refers to the *formalism* (coalition-value functions,\naxiomatic solutions), not to strategic games with aligned interests — those\n(`IsTeamGame`, symmetric games) live in the non-cooperative `Concepts/` layer.\n\n## Mathematical infrastructure\n\nThe `Math/` directory provides supporting libraries for discrete probability\n(`PMF` products, marginals, conditioning), directed acyclic graphs (acyclicity,\ntopological orders), function/finset update lemmas, and local-to-global\noptimization.\n\n## Build\n\nRequires Lean 4 (`v4.30.0`) and Mathlib (`v4.30.0`). Also depends on\n[`fixed-point-theorems-lean4`](https://github.com/ldct/fixed-point-theorems-lean4)\nfor Brouwer/Kakutani.\n\n```bash\nlake exe cache get\nlake build GameTheory Math Semantics\nlake env lean scripts/AxiomAudit.lean\n```\n\n## Non-goals\n\n- Continuous strategy spaces with non-discrete distributions\n- Measure-theoretic probability\n- Algorithmic equilibrium computation\n\n## Countable-support PMFs\n\nStrategy and outcome types can be countably infinite. `pmfPi` is defined\nfor any per-coordinate PMF family over a finite player index, and\n`KernelGame.mixedExtension` inherits that generality. Expected-utility\nlemmas (`expect_bind`, `expect_pushforward`, `expect_mono_of_pointwise`)\nhave bounded/countable siblings in `Math.Probability`; the pushforward API\nalso has an image-bounded variant for utility-distribution morphisms.\nConcept-layer theorems such as `mixedExtension_eu`,\n`weighted_gain_sum_zero`, `isNash_iff_gains_nonpos`, the mixed-Nash support\nlemma, CE/CCE transport from mixed Nash, correlated-EU identities, OSD,\nZermelo, and EU morphism wrappers no longer need finite outcome carriers\nwhen a bounded-utility hypothesis is supplied. Finite outcomes remain as\nconvenient wrappers that derive boundedness automatically.\n\nRemaining finite assumptions are intentional proof boundaries:\n\n- `mixed_nash_exists_of_bounded`, `correlatedEq_exists_of_bounded`, and\n  `coarseCorrelatedEq_exists_of_bounded` remove finite outcomes but still\n  require finite nonempty strategy spaces because the current proof is\n  Brouwer-on-product-simplices. Removing that would require a different\n  compactness/fixed-point theorem and continuity hypotheses for\n  infinite-dimensional mixed spaces.\n- Security levels now have sup/inf definitions (`worstCaseEUInf`,\n  `securityLevelSup`) without finite profile/strategy enumerations. Existence\n  of an attaining security strategy still requires finite/compact attainment\n  hypotheses.\n- `zermelo_of_bounded` and `oneShotDeviation_iff_spe_of_bounded` remove finite\n  outcomes. They still rely on the finite game-tree/action structure for\n  backward induction and local action maximization.\n- Kuhn wrappers keep finiteness where they enumerate pure strategies,\n  histories, or reachable information/action carriers. Removing those would\n  require countable/integrable versions of the reweighting and pure-strategy\n  product arguments.\n- The CE/CCE theorem “mixed Nash induces CE/CCE” is now finite-strategy-free;\n  the product-deviation identity is proved directly for arbitrary coordinate\n  carriers over a finite player index.\n- Von Neumann minimax and zero-sum interchangeability have bounded-utility\n  variants without finite outcomes, but still depend on mixed Nash existence,\n  hence on finite nonempty pure strategy spaces in the current development.\n\nSee `Languages/NFG/CountableExample.lean` for a smoke test exercising\n`NFGGame` over `ℕ`-valued actions.\n",1780846774619]