TY - UNPB ID - ARR-2026-79CS7K6ZE58JYRQ7-v2 TI - Type-Safe Monadic-Continuation Alpha-Beta Pruning: Exact CPS Equivalence, Knuth-Moore Fail-Soft Soundness, Ply-by-Ply Subgame Optimality, and Critical-Tree Complexity in Standalone Lean 4 AU - Lluis Eriksson PY - 2026 DA - 2026/12/04 PB - AIRR.SCIENCE UR - https://airr.science/papers/ARR-2026-79CS7K6ZE58JYRQ7/versions/v2/ N1 - Research preprint; ARR-2026-79CS7K6ZE58JYRQ7 v2. Not peer reviewed by AIRR. AB - We present a complete, standalone, zero-dependency Lean 4.36.0 formalization (AlphaBetaContV2.lean, 1,628 lines, zero Mathlib imports, compiled with -DwarningAsError=true, zero sorry, zero native_decide, zero partial, and zero custom axioms) of monadic-continuation alpha-beta pruning, optimal-play extraction, and exact leaf-evaluation complexity. This major revision (v2) resolves every structural and technical defect of the 3-page v1 summary across five mechanized pillars (20 audited primary theorems: 14 strictly constructive in {propext, Quot.sound} or empty axiom set and 6 adding only standard Classical.choice): (1) a type-safe non-empty inductive game tree (GameTree) making empty internal nodes unrepresentable by construction, with exact minimax bounds, negamax duality, and child-swap invariance; (2) full Knuth-Moore (1975) three-case fail-soft soundness, fail-hard clamping identity, full-window exactness, and aspiration-window re-search soundness; (3) genuine higher-order ReaderCont and callCC monadic continuations with exact parametric CPS-to-direct equivalence (abCPS t (alpha, beta) k = k (abVal alpha beta t) for every answer type r and continuation k : Int -> r); (4) genuine ply-by-ply Definition-2 subgame optimality (IsOptimalPlay) verified along child-index paths, principal-variation extraction (abPlay), and a formal counterexample on max(min(5,1),5) refuting v1's weak leaf-value criterion; and (5) leaf-count instrumentation (abCount), a kernel-certified 36-leaf Wikipedia tree certificate (value 6, exact 18 pruned leaves, CPS value 6, and IsOptimalPlay path [1,0,0,0]), the exact Knuth-Moore best-case critical-tree complexity (k+1)^ceil(d/2) + (k+1)^floor(d/2) - 1 versus adversarial worst-case (k+1)^d, and strict quadratic separation 2 b^m - 1 < b^(2m). Corroborated by a 5,759-node AST-audited pure-integer Python certifier (25 critical/worst (b,d) regimes up to 15,625 -> 249 leaves, 200 stress trees, and unambiguous early-win-terminating Tic-Tac-Toe from 255,168 -> 7,330 terminal games) and a 6/6 passing adversarial red-team harness. DO - 10.5281/zenodo.24648070 ER -