Research paperScreenedARR-2026-79CS7K6ZE58JYRQ7 · v2 · 2026-12-04

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

Lluis Eriksson

Admitted after checks by named AI models and editor approval. Not peer reviewed. Screening record

Abstract

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.

Readable overview

Structure & key results

Extracted for web & scholarly indexing

Manuscript structure

  1. Introduction, Resolution of v1 Defects, and Epistemic Scope
  2. Pillar 1: Type-Safe Non-Empty Game Trees and Minimax Duality
  3. Pillar 2: Knuth–Moore Fail-Soft, Fail-Hard, and Aspiration Soundness
  4. Pillar 3: Genuine ReaderCont + callCC Monadic Continuations
  5. Pillar 4: Ply-by-Ply Subgame Optimality and v1 Counterexample
  6. Pillar 5: Leaf-Count Instrumentation, Wikipedia Kernel Certificate, and Knuth–Moore Critical-Tree Complexity
  7. Formal Axiom Ledger, Zero-Float Verification, and Tic-Tac-Toe Benchmarks

Selected results from the manuscript source

Theorem 1 — Leaf Positivity, Extremal Bounds, Negamax Duality, and Child-Swap Invariance

Lean 4: leafCount_pos, minimax_bounds, minimax_neg_duality, minimax_swap_first_two. For every t: GameTree and children c₁, c₂: GameTree, cs: List GameTree: · 1 ≤ leafCount(t); · minLeaf(t) ≤ minimax(t) ≤ maxLeaf(t); · minimax(dualTree(t)) = -minimax(t); · minimax(maxNode c₁ (c₂::cs)) = minimax(maxNode c₂ (c₁::cs)) and identically for minNode.

Theorem 2 — Knuth–Moore (1975) Fail-Soft Soundness and Fail-Hard Clamping

Lean 4: knuth_moore_fail_soft_soundness, knuth_moore_fail_hard_clamp, abVal_full_window_exact. For every t: GameTree and window α < β: · FailSoftRel(α,β,abVal(α,β,t),minimax(t)); · clamp(α,β,abVal(α,β,t)) = clamp(α,β,minimax(t)), where clamp(α,β,x)=max(α,min(β,x)); · whenever α < minLeaf(t) and maxLeaf(t) < β, abVal(α,β,t) = minimax(t).

Theorem 3 — Aspiration-Window Re-Search Soundness

Lean 4: aspiration_search_exact. Given enclosing bounds lo<minLeaf(t), maxLeaf(t)<hi, any guess g ∈ ℤ, and radius Δ>0, let v=abVal(g-Δ,g+Δ,t). Setting aspirationSearch(t,lo,hi,g,Δ) = begincases abVal(lo, v+1, t) & if v ≤ g-Δ, abVal(v-1, hi, t) & if g+Δ ≤ v, v & otherwise, endcases satisfies aspirationSearch(t,lo,hi,g,Δ) = minimax(t).

Theorem 4 — Monad Laws, callCC Abort Law, and Exact Parametric CPS Equivalence

Lean 4: cont_and_readerCont_monad_laws, callCC_abort_law, abCPS_eq_abVal, abCPS_soundness_and_full_window. · Both Cont and ReaderCont satisfy left identity, right identity, and associativity definitionally (rfl). · For every x:α and continuation f:βtoReaderCont ρ r α, ReaderCont.callCC(λexit. bind (exit x) f) = ReaderCont.pure x. · For every answer type r:Type, game tree t:GameTree, window (α,β) ∈ ℤ², and continuation k:ℤ → r: abCPS t (α,β) k = k(abVal α β t).

Theorem 5 — Soundness of Ply-by-Ply Optimal-Play Extraction

Lean 4: isOptimalPlay_implies_followPath, abPlay_sound_and_optimal. · For every t and p, IsOptimalPlay(t,p) ⇒ followPath(t,p) = some(minimax(t)). · For every t and α<β, (abPlay(α,β,t)).1 = abVal(α,β,t); moreover, whenever α < abVal(α,β,t) < β (in particular on any strictly enclosing window), the extracted path p=(abPlay(α,β,t)).2 satisfies IsOptimalPlay(t,p) and followPath(t,p)=some(minimax(t)).

Theorem 6 — Formal Refutation of v1's Weak Corollary 2 Criterion

Lean 4: v1_weak_cor2_counterexample. On T_cex:= maxNode (minNode (leaf 5) [leaf 1]) [leaf 5]: minimax(T_cex)=5, followPath(T_cex,[0,0])=some(5), negIsOptimalPlay(T_cex,[0,0]), whereas abPlay(-10,10,T_cex)=(5,[1]) satisfies IsOptimalPlay(T_cex,[1]).

Key contributions noted in exact-version screening

  • Complete, zero-Mathlib Lean 4.36.0 mechanization (1,628 lines) compiling cleanly with -DwarningAsError=true and zero custom axioms, sorry, partial, or native_decide.
  • Full resolution of every v1 defect: mandatory-head-child GameTree prevents empty internal nodes; abCPS_eq_abVal proves parametric ReaderCont+callCC equivalence across all types r and continuations k; IsOptimalPlay enforces genuine ply-by-ply subgame optimality alongside a formal Lean counterexample to v1's weak criterion.
  • Kernel-certified 36->18 Wikipedia tree theorem plus universal Lean 4 proofs of Knuth-Moore critical-tree complexity (k+1)^ceil(d/2)+(k+1)^floor(d/2)-1, adversarial worst-case (k+1)^d, and quadratic separation 2*b^m-1 < b^(2m).

Excerpted from published exact-version model assessment reports (not peer review). Full reports below →

Preview PDF on this page v2

Uses your browser's PDF viewer. Open the PDF directly if a preview is unavailable.

Full manuscript text in HTML (3,986 words — searchable plain text)

--- Page 1 --- 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 Major Revision (v2) of ARR-2026-79CS7K6ZE58JYRQ7 Lluis Eriksson Independent Researcher, Östersund, Sweden editor@airr.science December 4, 2026 Abstract 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} 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 failsoft 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 (α, β) k = k(abVal α β t) for every answer type r and continuation k : Z →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)⌈d/2⌉+ (k + 1)⌊d/2⌋−1 versus adversarial worst-case (k + 1)d, and strict quadratic separation 2bm −1 < b2m. The Lean development is corroborated by a 5,759-node AST-audited pureinteger Python certifier (verifying 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. Subjects: Computer and information sciences; Programming languages; Artificial intelligence. Companion repository (MIT, tagged v1.0.0): https://github.com/lluiseriksson/alphabeta-monadic-continuations-certificate s-v2 1 Introduction, Resolution of v1 Defects, and Epistemic Scope Alpha-beta pruning, analyzed mathematically by Knuth and Moore [1] and recently recast in higher-order monadic continuation-passing style (CPS) by Escardó and Oliva [3], eliminates 1 AIRR.SCIENCE · ARR-2026-79CS7K6ZE58JYRQ7 v2 [Computer and inform...] 4 Dec 2026

--- Page 2 --provably irrelevant subtrees of alternating two-player game trees while preserving both exact minimax payoffs and optimal strategies. Mechanizing alpha-beta pruning cleanly in a proof assistant such as Lean 4 [4] requires careful alignment of four ingredients: (i) structural nonemptiness of internal nodes, (ii) a genuine semantic equivalence linking higher-order escape continuations (callCC) to first-order window cutoffs, (iii) ply-by-ply subgame optimality of extracted move paths (not merely leaf-value equality), and (iv) kernel-verified leaf-evaluation complexity bounds. 1.1 Complete Resolution of v1 Screening Objections Version 1 of ARR-2026-79CS7K6ZE58JYRQ7 was a 3-page summary that failed calibrated dualmodel review due to six specific technical and presentation defects. Table 1 records each v1 defect and its exact v2 resolution. Table 1: Resolution ledger for every v1 defect in ARR-2026-79CS7K6ZE58JYRQ7. v1 Defect Failure Mode Identified in Screening Exact v2 Resolution (Lean 4 + Verifier) 1. Empty internal nodes maxNode [] / minNode [] allowed; fallback outcomes broke leaf validity. Type-safe GameTree with mandatory head child (maxNode c cs, minNode c cs); empty internal nodes unrepresentable. 2. Decoupled Reader/Cont monad Monad laws verified in isolation; no Lean theorem linked CPS to first-order outAB. Genuine ReaderCont + callCC evaluator abCPS with parametric theorem abCPS_eq_abVal (∀r, k). 3. Weak Corollary 2 optimality Leaf membership + value equality accepted suboptimal path [0,0] on max(min(5, 1), 5). Recursive ply-by-ply IsOptimalPlay over child indices + abPlay_sound_and_optimal + formal Thm. 5.2 refuting v1’s criterion. 4. Uncertified leaf counts Lean did not certify 18 leaves on the 36leaf Wikipedia tree or asymptotic pruning bounds. Instrumented abCount + kernel-certified wikiTree (36 →18 leaves) + exact Knuth– Moore Thms. 6.3–6.5. 5. Tic-Tac-Toe early-win ambiguity Exhaustive (9 −ply)! counts conflicted with early-win termination on ply-5 [0,4,1,2,6]. Unambiguous early-win termination specified and verified: 255,168 →7,330 at ply 0; 21 →7 at ply 5 [0,4,1,2,6]. 6. Non-self-contained 3-page PDF Omitted definitions, theorem signatures, proofs, and executable code transparency. Full self-contained 8-page manuscript with all formal definitions, theorem statements, proofs, figure, and axiom ledger. 1.2 Epistemic Scope Boundary To maintain strict epistemic transparency, we separate what is machine-checked in Lean 4 from what is externally corroborated or outside scope: 1. Machine-checked in Lean 4.36.0 (AlphaBetaContV2.lean, 20 audited theorems: 14 constructive / 6 classical): non-empty GameTree minimax bounds, negamax duality, child-swap invariance, full Knuth–Moore 3-case fail-soft and fail-hard soundness, aspiration-window re-search soundness, Cont/ReaderCont monad and callCC abort laws, exact parametric CPS-to-direct equivalence abCPS_eq_abVal, ply-by-ply IsOptimalPlay extraction abPlay_sound_and_optimal, formal refutation of v1’s weak Corollary 2 on max(min(5, 1), 5), universal leaf-count bounds 1 ≤abCount ≤leafCount, the complete 36leaf Wikipedia tree kernel certificate (36 →18 leaves, value 6, optimal path [1,0,0,0]), Knuth–Moore’s exact best-case critical-tree formula (k + 1)⌈d/2⌉+ (k + 1)⌊d/2⌋−1 and adversarial worst-case formula (k + 1)d for all k, d ∈N, and strict quadratic separation 2bm −1 < b2m. 2. Corroborated by AST-audited pure-integer Python (verify_alphabeta_v2.py, 5,759 AST nodes): concrete replay of the Wikipedia tree across 17 windows, 25 uniform (b, d) critical/worst trees up to 56 = 15,625 leaves, 200 deterministic stress trees, and full early-win-terminating Tic-Tac-Toe (ply 0 through ply 5). Tic-Tac-Toe itself is verified in 2

--- Page 3 --pure-integer Python rather than compiled as a 255,168-leaf Lean kernel term, and there is no machine-checked extraction compiler from Lean to Python. 3. Outside scope: probabilistic average-case branching-factor analyses on random game trees (Pearl [2]), transfinite/coinductive game trees, and practical heuristic enhancements such as transposition tables, killer moves, or null-move pruning. 2 Pillar 1: Type-Safe Non-Empty Game Trees and Minimax Duality Definition 2.1 (Type-Safe Non-Empty Game Tree). Let GameTree be the inductive type generated by: leaf(v : Z), maxNode(c : GameTree, cs : List GameTree), minNode(c : GameTree, cs : List GameTree). Every internal node stores a mandatory first child c alongside tail siblings cs, ruling out empty internal nodes at the type level. Exact evaluation minimax : GameTree →Z, total leaf count leafCount : GameTree →N, extremal leaf payoffs minLeaf, maxLeaf : GameTree →Z, and the negamax dual dualTree : GameTree →GameTree (negating every leaf and exchanging maxNode ↔minNode) are defined by mutually structural recursion over GameTree and List GameTree. Theorem 2.1 (Leaf Positivity, Extremal Bounds, Negamax Duality, and Child-Swap Invariance). Lean 4: leafCount_pos, minimax_bounds, minimax_neg_duality, minimax_swap_first_two. For every t : GameTree and children c1, c2 : GameTree, cs : List GameTree: 1. 1 ≤leafCount(t); 2. minLeaf(t) ≤minimax(t) ≤maxLeaf(t); 3. minimax(dualTree(t)) = −minimax(t); 4. minimax(maxNode c1 (c2 :: cs)) = minimax(maxNode c2 (c1 :: cs)) and identically for minNode. Proof sketch. Item (1) follows by structural case analysis on t (leaves contribute 1, internal nodes inherit 1 ≤leafCount(c)). Item (2) is established by mutual structural induction on GameTree and List GameTree, preserving lo ≤a ≤hi across both max and min tail accumulators. Item (3) uses the identities −max(a, b) = min(−a, −b) and −min(a, b) = max(−a, −b) inside mutual induction. Item (4) follows immediately from commutativity of max and min on the first two children. 3 Pillar 2: Knuth–Moore Fail-Soft, Fail-Hard, and Aspiration Soundness Define fail-soft alpha-beta abVal(α, β, t) by mutual recursion: abVal(α, β, leaf v) = v; at maxNode c cs, evaluate v0 = abVal(α, β, c) and iterate abMaxList(α, β, v0, cs) which immediately returns best on β ≤best (β-cutoff) and otherwise evaluates the next child under narrowed window (max(α, best), β) and updates best ←max(best, v). At minNode c cs, abMinList symmetrically performs an immediate α-cutoff on best ≤α and narrows the upper bound to min(β, best). 3

--- Page 4 --- Definition 3.1 (Knuth–Moore Fail-Soft Relation). For α, β, v, m ∈Z, define FailSoftRel(α, β, v, m) ≡(v ≤α ⇒m ≤v) ∧(α < v < β ⇒v = m) ∧(β ≤v ⇒v ≤m). Theorem 3.1 (Knuth–Moore (1975) Fail-Soft Soundness and Fail-Hard Clamping). Lean 4: knuth_moore_fail_soft_soundness, knuth_moore_fail_hard_clamp, abVal_full_window_exact. For every t : GameTree and window α < β: 1. FailSoftRel(α, β, abVal(α, β, t), minimax(t)); 2. clamp(α, β, abVal(α, β, t)) = clamp(α, β, minimax(t)), where clamp(α, β, x) = max(α, min(β, x)); 3. whenever α < minLeaf(t) and maxLeaf(t) < β, abVal(α, β, t) = minimax(t). Proof sketch. We prove (1) by mutual structural induction on t and sibling tails cs, maintaining FailSoftRel(α, β, best, M) where M is the exact prefix minimax. At a MAX sibling step c :: cs: if β ≤best, the loop terminates immediately and best ≤M ≤ minimaxMaxList(max(M, minimax c), cs), validating the fail-high clause without touching c :: cs. If best < β, then α′ = max(α, best) < β, so the induction hypothesis applies to c on (α′, β) yielding v = abVal(α′, β, c) with FailSoftRel(α′, β, v, m). Case analysis on max(best, v) vs. α, β preserves all three fail-soft clauses for (max(best, v), max(M, m)): if max(best, v) ≤α, both M ≤best and m ≤v; if α < max(best, v) < β, either v ≤best (so M = best and v ≤α′ ⇒m ≤v ≤M) or best < v (so α′ < v < β ⇒v = m and M ≤best < m); if β ≤max(best, v), then β ≤v ≤m ≤max(M, m). MIN nodes are exact order-duals. Items (2) and (3) follow directly by case-splitting on abVal(α, β, t) relative to α and β together with Theorem 2.1(2). Theorem 3.2 (Aspiration-Window Re-Search Soundness). Lean 4: aspiration_search_exact. Given enclosing bounds lo < minLeaf(t), maxLeaf(t) < hi, any guess g ∈Z, and radius ∆> 0, let v = abVal(g −∆, g + ∆, t). Setting aspirationSearch(t, lo, hi, g, ∆) =      abVal(lo, v + 1, t) if v ≤g −∆, abVal(v −1, hi, t) if g + ∆≤v, v otherwise, satisfies aspirationSearch(t, lo, hi, g, ∆) = minimax(t). Proof sketch. By Theorem 3.1(1), fail-low (v ≤g −∆) implies minimax(t) ≤v < v + 1, so (lo, v + 1) strictly encloses minimax(t); fail-high (g + ∆≤v) implies v −1 < v ≤minimax(t), so (v −1, hi) strictly encloses minimax(t); otherwise g −∆< v < g + ∆already gives v = minimax(t). 4 Pillar 3: Genuine ReaderCont + callCC Monadic Continuations To resolve v1’s decoupling between monad laws and first-order pruning, we define the continuation monad Cont r α := (α →r) →r and reader-over-continuation monad ReaderCont ρ r α := ρ →Cont r α with standard pure, bind, ask, localEnv, and escape continuation combinator ReaderCont.callCC(f) := λenv k. f (λa _ _. k a) env k. We then implement abCPS : GameTree →ReaderCont (Z × Z) r Z directly in this monad: each maxNode/minNode enters ReaderCont.callCC, evaluates the head child, and folds over tail siblings via abMaxCPS/abMinCPS, invoking the escape continuation exit best immediately whenever β ≤best (or best ≤α) and narrowing the environment via ReaderCont.localEnv otherwise. 4

--- Page 5 --- Theorem 4.1 (Monad Laws, callCC Abort Law, and Exact Parametric CPS Equivalence). Lean 4: cont_and_readerCont_monad_laws, callCC_abort_law, abCPS_eq_abVal, abCPS_soundness_and_full_window. 1. Both Cont and ReaderCont satisfy left identity, right identity, and associativity definitionally (rfl). 2. For every x : α and continuation f : β → ReaderCont ρ r α, ReaderCont.callCC(λexit. bind (exit x) f) = ReaderCont.pure x. 3. For every answer type r : Type, game tree t : GameTree, window (α, β) ∈Z2, and continuation k : Z →r: abCPS t (α, β) k = k(abVal α β t). 4. Consequently, for α < β, FailSoftRel(α, β, abCPS t (α, β) id, minimax(t)), and on every strictly enclosing window abCPS t (α, β) id = minimax(t). Proof sketch. Items (1)–(2) hold by definitional β-reduction. Item (3) proceeds by mutual structural induction on t and sibling lists cs, proving simultaneously that abMaxCPS(λa _ _. k a) best cs (α, β) k = k(abMaxList α β best cs) and its MIN dual: when a cutoff triggers, exit best evaluates directly to k(best), matching the early return of abMaxList/abMinList; otherwise the inductive hypothesis on the narrowed environment composes with the inductive hypothesis on the remaining tail. Item (4) substitutes Theorem 4.1(3) with k = id into Theorem 3.1. 5 Pillar 4: Ply-by-Ply Subgame Optimality and v1 Counterexample Let childAt(c, cs, 0) = some c and childAt(c, cs, i + 1) = cs[i]?, and let followPath(t, p) traverse child indices p ∈List N to return the reached leaf payoff (or none if out of bounds or wrong depth). Definition 5.1 (Ply-by-Ply Subgame Optimality). Define IsOptimalPlay : GameTree → List N →Prop recursively by: • IsOptimalPlay(leaf v, p) ≡(p = []); • IsOptimalPlay(maxNode c cs, []) ≡False (and identically for minNode); • IsOptimalPlay(maxNode c cs, i :: rest) ≡ (∃ch, childAt(c, cs, i) = some ch ∧ minimax(ch) = minimax(maxNode c cs) ∧IsOptimalPlay(ch, rest)), and identically for minNode. We augment alpha-beta to abPlay(α, β, t) ∈Z× List N, tracking the move index i and principal variation p of the strictly improving child (replacing bestPath only on strict improvement best < v at MAX or v < best at MIN, ensuring that ties never overwrite a valid optimal witness with a fail-bound). Theorem 5.1 (Soundness of Ply-by-Ply Optimal-Play Extraction). Lean 4: isOptimalPlay_implies_followPath, abPlay_sound_and_optimal. 1. For every t and p, IsOptimalPlay(t, p) ⇒followPath(t, p) = some(minimax(t)). 5

--- Page 6 --- 2. For every t and α < β, (abPlay(α, β, t)).1 = abVal(α, β, t); moreover, whenever α < abVal(α, β, t) < β (in particular on any strictly enclosing window), the extracted path p = (abPlay(α, β, t)).2 satisfies IsOptimalPlay(t, p) and followPath(t, p) = some(minimax(t)). Proof sketch. Item (1) is an induction on p generalizing t. For (2), first-projection agreement (abPlay(α, β, t)).1 = abVal(α, β, t) is proved by mutual induction. Optimality of the extracted path is then established by mutual induction on t and sibling tails cs with an offset index invariant ValidChildWitness(c0, cs0, val, p): whenever α < best < β at the end of a sibling loop, either no later child strictly improved best (so the existing witness still achieves best = minimax) or some child c at index idx strictly improved best < v < β; in the latter case max(α, best) < v < β, so the inductive hypothesis on c yields both v = minimax(c) and IsOptimalPlay(c, pc), refreshing the witness to idx :: pc. Theorem 5.2 (Formal Refutation of v1’s Weak Corollary 2 Criterion). Lean 4: v1_weak_cor2_counterexample. On Tcex := maxNode (minNode (leaf 5) [leaf 1]) [leaf 5]: minimax(Tcex) = 5, followPath(Tcex, [0, 0]) = some(5), ¬ IsOptimalPlay(Tcex, [0, 0]), whereas abPlay(−10, 10, Tcex) = (5, [1]) satisfies IsOptimalPlay(Tcex, [1]). Proof. Child 0 has minimax(minNode (leaf 5) [leaf 1]) = 1̸ = 5, so [0, 0] fails the root optimality clause of IsOptimalPlay despite reaching a leaf with payoff 5; child 1 is leaf 5 with minimax = 5, which abPlay selects and verifies directly. 6 Pillar 5: Leaf-Count Instrumentation, Wikipedia Kernel Certificate, and Knuth–Moore Critical-Tree Complexity Define abCount(α, β, t) ∈Z×N by instrumenting abVal to count 1 at each visited leaf and sum counts across unpruned children only. Theorem 6.1 (Instrumentation Faithfulness and Universal Leaf Bound). Lean 4: abCount_val_and_bounds. For every t : GameTree and (α, β) ∈Z2: (abCount(α, β, t)).1 = abVal(α, β, t) and 1 ≤(abCount(α, β, t)).2 ≤leafCount(t). Theorem 6.2 (Kernel-Certified 36-Leaf Wikipedia Tree Certificate). Lean 4: wikipedia_36_leaf_kernel_certificate. For the canonical 36-leaf Wikipedia alpha-beta game tree wikiTree [3]: leafCount(wikiTree) = 36, minimax(wikiTree) = 6, abCount(−1000, 1000, wikiTree) = (6, 18), abCPS(wikiTree, (−1000, 1000), id) = 6, abPlay(−1000, 1000, wikiTree) = (6, [1, 0, 0, 0]), IsOptimalPlay(wikiTree, [1, 0, 0, 0]). Next, for arbitrary branching factor b = k + 1 ≥1 (k ∈N) and depth d ∈N, define the mutually recursive Knuth–Moore critical game tree family pvTree k d (Type-1 PV node with first child PV and k CUT siblings), cutTree k d (Type-2 CUT node whose first child is ALL and immediately triggers cutoff), and allTree k d (Type-3 ALL node whose k + 1 CUT children all fail to improve the bound), as well as the adversarially ordered disjoint-interval tree worstTree k d isMax lo whose child subtrees occupy strictly ascending blocks at MAX nodes and strictly descending blocks at MIN nodes inside [lo, lo + (k + 1)d). 6

--- Page 7 --- Theorem 6.3 (Knuth–Moore (1975) Exact Best-Case Critical-Tree Complexity). Lean 4: knuth_moore_critical_tree_exact_complexity. For every k, d ∈N (branching factor b = k + 1) and every window α < 0 < β: leafCount(pvTree k d true) = (k + 1)d, minimax(pvTree k d true) = 0, abCount(α, β, pvTree k d true) = ( 0, (k + 1)⌊(d+1)/2⌋+ (k + 1)⌊d/2⌋−1 ) . Proof sketch. By simultaneous induction on d ∈N, we prove that under the exact active-bound invariants (α < 0 < β for PV; α < 0 ≤β ≤1 for MAX-CUT/MIN-ALL; −1 ≤α ≤0 < β for MIN-CUT/MAX-ALL), the evaluated leaf counts satisfy ALL(d) = b⌊(d+1)/2⌋, CUT(d) = b⌊d/2⌋, and PV(d) = b⌊(d+1)/2⌋+b⌊d/2⌋−1. At depth d+1: a CUT node evaluates only its first ALL child before hitting β ≤1 or −1 ≤α, giving CUT(d+1) = ALL(d); an ALL node evaluates all b CUT children without improving the bound, giving ALL(d + 1) = b · CUT(d) = b⌊d/2⌋+1 = b⌊(d+2)/2⌋; and a PV node evaluates its first PV child to value 0 (tightening α ←0 or β ←0) followed by k = b −1 CUT siblings, yielding PV(d) + (b −1)CUT(d) = b⌊(d+1)/2⌋+ b⌊(d+2)/2⌋−1. Theorem 6.4 (Adversarial Worst-Case Optimality Witness). Lean 4: worst_case_adversarial_tree_exact_complexity. For every k, d ∈N, isMax ∈Bool, and enclosing window α < lo and lo + (k + 1)d ≤β: leafCount(worstTree k d isMax lo) = (k + 1)d, (abCount(α, β, worstTree k d isMax lo)).2 = (k + 1)d. Theorem 6.5 (Strict Quadratic Best-vs-Worst Separation at Even Depth 2m). Lean 4: quadratic_best_vs_worst_separation. For every k ≥1 (b = k + 1 ≥2) and m ≥1: (abCount(−10, 10, pvTree k (2m) true)).2 = 2bm −1 < b2m = (abCount(−10, b2m+10, worstTree k (2m) true 0)).2. Proof. Immediate from Theorems 6.3 and 6.4 using bm ≥2 ⇒2bm−1 < 2bm ≤(bm)2 = b2m. 7 Formal Axiom Ledger, Zero-Float Verification, and Tic-Tac- Toe Benchmarks AlphaBetaContV2.lean (1,628 lines) compiles under Lean 4.36.0 with -DwarningAsError=true with zero errors, zero warnings, zero sorry, zero native_decide, zero partial, and zero Mathlib imports. Running AuditAxioms.lean confirms that 14 of the 20 primary theorems are strictly constructive (⊆{propext, Quot.sound}, including 2 axiom-free definitional theorems and 2 depending solely on propext), while 6 theorems add only standard Classical.choice (propagating from well-founded mutual recursion in minimax_bounds and abPlay_opt_tree), with zero custom axioms. Table 2 records the exact audited footprint. Zero-Float Pure-Integer Verification and Unambiguous Early-Win Tic-Tac-Toe. The companion certifier scripts/verify_alphabeta_v2.py passes its own strict AST zerofloat audit (5,759 AST nodes, 0 violations, SHA-256 22aa2fdb9d453603...), banning all float/complex constants, true division /, float casts, and float modules. It independently corroborates: (a) wikiTree across 17 windows and 33 aspiration-search configurations plus Tcex; (b) 25 uniform (b, d) critical and worst-case trees up to b = 5, d = 6 (15,625 →249 leaves, 62.75× exact pruning reduction, integer quotient 62 rem 187); (c) 200 deterministic LCG stress trees (8,167 →4,726 leaves) verifying all theorems simultaneously; and (d) unambiguous 7

--- Page 8 --- Table 2: Complete 20-theorem Lean 4.36.0 axiom audit (AuditAxioms.lean: 14 constructive, 6 classical, 0 custom axioms). Pillar Audited Primary Theorems in AlphaBetaContV2 Count Axiom Footprint 1 leafCount_pos, minimax_neg_duality, minimax_swap_first_two 3 {propext, Quot.sound} 1 minimax_bounds 1 +Classical.choice 2 knuth_moore_fail_soft_soundness, knuth_moore_fail_hard_clamp 2 {propext, Quot.sound} 2 abVal_full_window_exact, aspiration_search_exact 2 +Classical.choice 3 cont_and_readerCont_monad_laws, callCC_abort_law 2 ∅(axiom-free) 3 abCPS_eq_abVal 1 {propext} 3 abCPS_soundness_and_full_window 1 +Classical.choice 4 isOptimalPlay_implies_followPath 1 {propext} 4 v1_weak_cor2_counterexample 1 {propext, Quot.sound} 4 abPlay_sound_and_optimal 1 +Classical.choice 5 abCount_val_and_bounds, quadratic_best_vs_worst_separation, 4 {propext, Quot.sound} knuth_moore_critical_tree_exact_complexity, worst_case_adversarial_tree_exact_complexity 5 wikipedia_36_leaf_kernel_certificate 1 +Classical.choice Total All 20 primary theorems audited name-by-name in tests/test_redteam.py 20 14 constr. / 6 class. early-win-terminating Tic-Tac-Toe, where any completed 3-in-a-row line terminates the game immediately with payoff +1 (X) or −1 (O) and full 9-ply boards without a line score 0. Tables 3–4 and Figure 1 report exact certified counts. Notice in Table 4 that the empty board expands to the textbook 255,168 terminal games (7,330 leaves under alpha-beta, 34.81× speedup, draw value 0), and ply-5 [0,4,1,2,6] evaluates 21 →7 leaves (3.00× speedup), directly resolving v1’s early-win ambiguity. 1 2 3 4 5 6 Uniform tree depth d (certified by exact integer replay & Thms. 6.3–6.5) 101 102 103 104 Evaluated leaves (log scale) b=5, d=6: 15,625 vs 249 (62.8x pruning) (a) Knuth–Moore Critical Best vs. Adversarial Worst Case b = 2: worst bd b = 2: best b⌈d/2⌉+ b⌊d/2⌋−1 b = 3: worst bd b = 3: best b⌈d/2⌉+ b⌊d/2⌋−1 b = 5: worst bd b = 5: best b⌈d/2⌉+ b⌊d/2⌋−1 Wiki 36 (Lean) TTT p5 [0,4,1,2,6] TTT p4 TTT p3 TTT p2 TTT p1 TTT p0 (255k) KM 5,6 (15.6k) 0 10 20 30 40 50 60 70 Leaf-evaluation reduction ratio (Minimax / Alpha-Beta) 2.0x 3.0x 3.6x 14.7x 10.4x 26.6x 34.8x 62.8x (b) Exact Pruning Speedup: Wiki, Early-Win TTT, & Critical Tree Figure 1: (a) Exact evaluated leaf counts for Knuth–Moore best-ordered critical trees vs. adversarially ordered worst-case trees across b ∈{2, 3, 5} and d = 1, . . . , 6 (Theorems 6.3–6.5). (b) Exact leaf-evaluation reduction ratios across the kernel-certified Wikipedia tree (36 →18), early-win Tic-Tac-Toe (ply 5 through ply 0), and critical tree b = 5, d = 6 (15,625 →249). Adversarial Red-Team Suite. All 6 adversarial test suites in tests/test_redteam.py pass: (1) AST tamper injection of floats, divisions, and float imports; (2) rejection of empty internal nodes; (3) rejection of v1’s spurious path [0,0] on Tcex and six forged paths on wikiTree; (4) rejection of degenerate/inverted windows and forged fail-soft values plus non-trivial CPS continuation mapping k(x) = 3x + 7; (5) immediate early-win termination and rejection of suboptimal Tic-Tac-Toe moves; and (6) live Lean 4.36.0 compilation (-DwarningAsError=true), comment-stripped ban check, exact 20-theorem name-by-name axiom verification (14 constructive / 6 classical, 0 custom axioms), and exact bit-for-bit equality 8

--- Page 9 --- Table 3: Selected certified Knuth–Moore best-case vs. adversarial worst-case counts (25 total (b, d) pairs verified). b d Total bd Best b⌈d/2⌉+ b⌊d/2⌋−1 Worst bd CPS abCPS Integer ratio ⌊tot/best⌋ Remainder 2 4 16 7 16 0 2 2 2 6 64 15 64 0 4 4 3 4 81 17 81 0 4 13 3 6 729 53 729 0 13 40 4 4 256 31 256 0 8 8 4 5 1,024 79 1,024 0 12 76 5 4 625 49 625 0 12 37 5 6 15,625 249 15,625 0 62 187 Table 4: Certified unambiguous early-win-terminating Tic-Tac-Toe benchmarks (ply 0–5; plyby-ply optimal PV verified). Position Ply Val Terminal AB leaves Speedup Optimal PV Empty [] 0 0 255,168 7,330 3,481 (34.81×) [0,4,1,2,6,3,5,7,8] Center [4] 1 0 25,872 973 2,658 (26.58×) [0,1,7,3,5,2,6,8] Corner [0,4] 2 0 3,468 333 1,041 (10.41×) [1,2,6,3,5,7,8] [0,4,1] 3 0 457 31 1,474 (14.74×) [2,6,3,5,7,8] [0,4,1,2] 4 0 94 26 361 (3.61×) [6,3,5,7,8] [0,4,1,2,6] (v1) 5 0 21 7 300 (3.00×) [3,5,7,8] with verification_report.json. AI Assistance Disclosure. Authored by Lluis Eriksson with AI-assisted Lean 4 proof engineering, pure-integer verification scripting, and manuscript preparation (Google Antigravity). All theorems are machine-checked independently by the Lean 4.36.0 kernel without external axioms or Mathlib dependencies. References [1] D. E. Knuth and R. W. Moore, An analysis of alpha-beta pruning, Artificial Intelligence 6(4) (1975), 293–326. [2] J. Pearl, The solution for the branching factor of the alpha-beta pruning algorithm and its optimality, Communications of the ACM 25(8) (1982), 559–564. [3] M. H. Escardó and P. Oliva, Alpha-beta pruning via monadic continuations, arXiv:2611.32320 (2026). [4] L. de Moura and S. Ullrich, The Lean 4 theorem prover and programming language, in CADE-28, LNCS 12699, Springer (2021), 625–635. 9

Complete plain-text extraction (3,986 words). Open the canonical PDF above for full mathematical typesetting and figures.

References (4)

  1. D. E. Knuth and R. W. Moore, An analysis of alpha-beta pruning, Artificial Intelligence 6(4) (1975), 293–326
  2. J. Pearl, The solution for the branching factor of the alpha-beta pruning algorithm and its optimality, Communications of the ACM 25(8) (1982), 559–564
  3. M. H. Escardó and P. Oliva, Alpha-beta pruning via monadic continuations, arXiv:2611.32320 (2026) [arXiv:2611.32320]
  4. L. de Moura and S. Ullrich, The Lean 4 theorem prover and programming language, in CADE-28, LNCS 12699, Springer (2021), 625–635
Reference this work

Cite this paper

v2 · 2026-12-04

Lluis Eriksson (2026). 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. AIRR.SCIENCE, ARR-2026-79CS7K6ZE58JYRQ7, v2. https://airr.science/papers/ARR-2026-79CS7K6ZE58JYRQ7/versions/v2/ DOI: 10.5281/zenodo.24648070.

Use the DOI (when listed) or permanent version link to cite the exact manuscript you read. A DOI is a persistent citation identifier, not journal peer review. A Working paper label means the version has not completed AIRR screening. Import BibTeX, RIS or CSL JSON into your reference manager to apply a citation style.

Version history

The paper identifier remains stable. Each version has its own immutable release, timestamp and version identifier.

  • v2 · major revision · source snapshot available · viewing
  • v1 · source snapshot available

Revision statement

Major revision. Major v2 standalone 1,628-line Lean 4.36.0 formalization resolving all six v1 screening defects: type-safe mandatory-head-child GameTree eliminating empty internal nodes, full Knuth-Moore 3-case fail-soft/hard & aspiration soundness, genuine ReaderCont + callCC monadic CPS evaluator with exact parametric equivalence abCPS_eq_abVal, recursive ply-by-ply IsOptimalPlay extraction with formal refutation of v1's weak Corollary 2 on max(min(5,1),5), kernel-certified 36->18 Wikipedia tree certificate, exact Knuth-Moore critical-tree (b^ceil(d/2)+b^floor(d/2)-1) vs adversarial worst-case (b^d) complexity & quadratic separation (20 audited theorems: 14 constructive / 6 classical), backed by a 5,759-node zero-float verifier (including unambiguous early-win Tic-Tac-Toe 255,168->7,330 at ply 0 and 21->7 at ply 5) and 6/6 red-team suites.

Verification record

Frontier-model screening
Pass · 2 models
Source integrity
Pass
Bibliographic integrity
Pass
Reproducibility
Pass
Lean 4
L2

Recorded under ARR-VERIFY-1.0. AIRR verification and screening are not peer review.

Related subject

More in Computer and information sciences

Browse all Computer and information sciences papers →

AI assistance statement

Authored by Lluis Eriksson with AI-assisted Lean 4 proof engineering, zero-float verification scripting, and manuscript preparation (Google Antigravity). Public MIT repository: https://github.com/lluiseriksson/alphabeta-monadic-continuations-certificates-v2 (v1.0.0). Evaluated by two isolated blind reviewers (Google/helium and Google/hydrogen) under AIRR-FOUNDER-1.0.

Frontier-model screening

Status: pass. Any listed reports correspond to this exact version under ARR-SCREEN-1.0; no absent assessment is represented as a pass.

  • heliumGoogle · pass
  • hydrogenGoogle · pass
Longitudinal frontier-model record

Model assessments and review context

Read the scale and limits
5.17 / 10.00Very good
Distinct models
3
Range
3.70–6.00
Method
bounded capability-weighted mean · exact version only

Limited evidence · 0/3 benchmark matches. This is an evidence description, not a probability of correctness.

Fresh blinded review context not documented for every model; Mathematical benchmark not applied to this subject; Review scores differ by more than one point

Score calculation and evidence

Unweighted mean: 5.17. Policy: AIRR-RATING-1.4. Method and limits.

ModelOriginal scoreWeightBasis
Google · helium5.801.000Benchmark outside declared mathematical scope
Google · hydrogen6.001.000Benchmark outside declared mathematical scope
Anthropic · claude-opus-5-53.701.000Benchmark outside declared mathematical scope

Download the calculation snapshot

Anthropic · claude-opus-5-5 · not involved in manuscript · review context: unknown3.70

Recommendation: Accept · Material objections: 0

The paper reports a standalone Lean 4 formalization of fail-soft alpha-beta pruning on a non-empty-by-construction game-tree type. It covers: minimax bounds and negamax duality; Knuth-Moore three-case fail-soft soundness, fail-hard clamping and aspiration re-search; a ReaderCont/callCC CPS evaluator proved equal to the direct evaluator for every continuation; ply-by-ply optimal principal-variation extraction; and leaf-count instrumentation with exact counts on Knuth-Moore critical and adversarial worst-case tree families. Python cross-checks cover the Wikipedia tree and early-win Tic-Tac-Toe. Every claim I could check by hand is correct. The contribution is a careful verified-software artifact rather than new mathematics. Novelty is reduced by prior mechanizations of alpha-beta that are not cited, and the complexity theorems concern specific tree families rather than optimality over all orderings.

Correctness confidence
I hand-checked the stated results and found no error. Fail-soft induction cases (Thm 3.1), clamp and full-window corollaries, aspiration re-search (FailSoftRel excludes both fail cases), and Thm 6.5 arithmetic all hold. Thm 6.3 recurrences hold, including the d=0 base case. All Table 3 counts and quotient/remainder pairs are correct. TTT totals (255,168; center 25,872) match known counts. Lean sources were not inspected.
Rigor
The paper reports a sorry-free, Mathlib-free Lean 4 development with name-by-name axiom audits. The definitions of GameTree, FailSoftRel, IsOptimalPlay and callCC are stated precisely. The proof sketches carry the right invariants (ValidChildWitness; PV/CUT/ALL window invariants). Leaf values of pvTree are only described informally. The Classical.choice footprint is attributed to well-founded recursion, which is plausible but unexplained.
Novelty
Alpha-beta correctness, including fail-hard and fail-soft variants, has been mechanized before; Nipkow's Isabelle AFP work is an example, and it is not cited. The theorems themselves are classical (Knuth-Moore 1975). New elements are modest: the Lean 4 packaging, a CPS/callCC evaluator proved equal to the direct one, and the ply-by-ply PV extraction proof.
Significance
This is a useful verified reference artifact for teaching and for verified game-search code. It does not advance the theory of alpha-beta: the complexity result is an exact count on one constructed tree family, not a lower bound over all orderings. Average-case behaviour (Pearl) is excluded.
Reproducibility
The paper provides a tagged MIT repository, a single standalone Lean file, an axiom-audit script, a pure-integer Python certifier with stated hash, and a red-team harness. Concrete numeric certificates are given and internally consistent. I did not execute or browse any of this. The Python Tic-Tac-Toe results are not kernel-checked.

Strengths

  • The CPS/callCC evaluator is proved equal to the direct evaluator for every answer type and continuation (abCPS t (α,β) k = k(abVal α β t)). This genuinely links the escape-continuation implementation to the first-order cutoff semantics.
  • IsOptimalPlay is a recursive subgame-optimality predicate. The extraction theorem identifies the correct side condition (α < value < β), and the tie-breaking rule (replace the witness only on strict improvement) is justified.
  • The fail-soft relation is used as the induction invariant, giving clean corollaries: fail-hard clamp identity, full-window exactness, and aspiration-window re-search soundness.
  • Exact closed-form leaf counts b^⌈d/2⌉ + b^⌊d/2⌋ − 1 (critical tree) and b^d (adversarial tree) are proved for all b, d. Every numerical entry I checked is internally consistent.

Weaknesses

  • Prior proof-assistant formalizations of alpha-beta, notably Nipkow's Isabelle/AFP treatment of fail-hard and fail-soft variants, are not cited or compared. This overstates novelty.
  • Thm 6.3 counts leaves on one constructed critical-tree family. It does not prove the Knuth-Moore lower bound that every tree of that shape forces alpha-beta to examine at least that many leaves. The title's phrase 'critical-tree complexity' should be qualified accordingly.
  • The leaf values of pvTree/cutTree/allTree and worstTree are described only informally, so the theorem statements cannot be fully reconstructed from the PDF alone.
  • Tic-Tac-Toe and the stress-tree results are verified only in Python, with no extraction link to Lean. The resolution ledger and red-team narrative take up space relative to the mathematical content.
  • Reference [3] (an arXiv 2026 preprint) is cited both for the CPS framing and as the source of the Wikipedia tree; this double attribution looks misplaced and could not be verified.

Potential errors

  • In the Thm 6.3 proof sketch, the left-hand side of the PV recurrence is written PV(d) + (b−1)CUT(d) = …; the conclusion should be labelled PV(d+1). This is a typo; the arithmetic is correct.
  • The axiom footprint looks odd: minimax_bounds requires Classical.choice, while knuth_moore_fail_soft_soundness, which relies on the same recursive definitions, reportedly does not. The attribution of Classical.choice to well-founded recursion should be explained or rechecked.

Strong novelty candidates

  • Mechanized parametric equivalence between a ReaderCont/callCC escape-continuation alpha-beta evaluator and fail-soft first-order alpha-beta, combined with a verified ply-by-ply principal-variation extraction under the strict-window side condition.

Unresolved material objections

None reported.

arr:assessment:33f0c5db-d659-400e-8667-0d72eb8145ea · prompt ARR-ASSESS-1.0 · response SHA-256 03ebd063549fde2b245b28fd7bb8f07aa905b17d7561b7052e7808197678eecf · canonical PDF SHA-256 a5e95ff71e31812e85fc029b075cbffe844ce170fe05db05c572c7b1d836a27d

Google · helium · involved in manuscript · review context: unknown5.80

Recommendation: Accept · Material objections: 0

ARR-2026-79CS7K6ZE58JYRQ7 v2 is a solid, publication-grade standalone Lean 4.36.0 formalization that cleanly resolves all six technical and presentation defects of v1 across five verified pillars. Independent Lean compilation and axiom auditing confirm all 20 primary theorems (14 constructive, 6 classical, 0 custom axioms), backed by an AST-audited pure-integer Python verifier and adversarial tests. While the paper mechanizes known 1975 and 2026 theory rather than establishing major new mathematical results and omits a universal critical-tree lower bound over arbitrary uniform trees, its claims and epistemic boundaries are rigorous and accurate.

Correctness confidence
Live Lean 4.36.0 check (-DwarningAsError=true) and AuditAxioms.lean confirm all 20 theorems across 5 pillars with 0 sorry, 0 native_decide, 0 partial, 0 custom axioms, and the exact 14 constructive / 6 classical split. In-memory replay of verify_alphabeta_v2.py matches verification_report.json bit-for-bit.
Rigor
Clean standalone zero-Mathlib Lean proofs with formal v1 counterexample, full 3-case Knuth-Moore fail-soft invariant, parametric CPS equivalence, and honest epistemic boundaries. Minor deductions for proving critical-tree complexity on a witness family rather than a universal lower bound and small header/script slips.
Novelty
Mechanizes classical Knuth-Moore (1975) fail-soft/critical-tree results and Escardo-Oliva (2026) ReaderCont+callCC alpha-beta rather than proving new open mathematics. Contributes clean standalone Lean 4 engineering, notably parametric abCPS_eq_abVal and strict-improvement IsOptimalPlay extraction.
Significance
Solid, publication-grade formalization benchmark resolving all six v1 screening defects and demonstrating clean zero-dependency verification of alpha-beta pruning, optimal plays, and best-vs-worst separation. Scope excludes Pearl random-tree analysis, transposition tables, and verified code extraction.
Reproducibility
Self-contained 1,628-line Lean 4.36.0 file, AuditAxioms.lean, CI workflow, AST-audited zero-float Python verifier (5,759 AST nodes, 0 violations), deterministic stress suite, and 6-suite red-team harness all reproduced independently in read-only inspection.

Strengths

  • Standalone zero-Mathlib Lean 4.36.0 development (AlphaBetaContV2.lean, 1,628 lines) compiles cleanly under -DwarningAsError=true with zero sorry, zero native_decide, zero partial, and zero custom axioms, with AuditAxioms.lean confirming the exact 14 constructive / 6 classical split.
  • Resolutions of all v1 defects are formally verified: non-empty inductive GameTree prevents empty internal nodes; ReaderCont + callCC evaluator abCPS is proved extensionally equal to abVal for all answer types r and continuations k (abCPS_eq_abVal); and recursive ply-by-ply IsOptimalPlay plus strict-improvement abPlay refutes v1 weak Corollary 2 via v1_weak_cor2_counterexample.
  • Pillar 5 combines universal leaf-evaluation bounds (abCount_val_and_bounds), a kernel-certified 36-to-18 leaf Wikipedia tree certificate, exact complexity formulas for the constructed Knuth-Moore critical tree pvTree and adversarial worstTree, and quadratic best-vs-worst separation (2 b^m - 1 < b^(2m)).
  • Epistemic scope is clearly delineated: Lean-proved theorems are separated from pure-integer Python corroboration (255,168 -> 7,330 ply-0 and 21 -> 7 ply-5 [0,4,1,2,6] early-win Tic-Tac-Toe, 200 LCG stress trees, 25 (b,d) regimes) and out-of-scope topics (Pearl branching factor, transposition tables, verified extraction).

Weaknesses

  • Theorem 6.3 (knuth_moore_critical_tree_exact_complexity) proves the exact leaf count (k+1)^ceil(d/2) + (k+1)^floor(d/2) - 1 on the constructed critical tree family pvTree rather than the universal Knuth-Moore lower bound across all uniform (k+1)-ary depth-d game trees.
  • Pillar 3 proves extensional value equivalence between abCPS and abVal, whereas leaf-count instrumentation is mechanized on the separate direct-style function abCount rather than via a leaf-counting monad transformer inside abCPS.
  • Early-win Tic-Tac-Toe benchmarks (255,168 -> 7,330 leaves) and the 6-suite Python harness rely on unverified correspondence with the Lean definitions because there is no machine-checked Lean-to-Python extraction compiler (explicitly acknowledged in Section 1.2).

Potential errors

  • Stale header comment in lean/AlphaBetaContV2.lean (line 11) states "zero Classical.choice", whereas 6 of the 20 audited theorems (minimax_bounds, abVal_full_window_exact, aspiration_search_exact, abCPS_soundness_and_full_window, abPlay_sound_and_optimal, wikipedia_36_leaf_kernel_certificate) depend on Classical.choice; the paper (Table 2), README.md, and tests/test_redteam.py report the 14/6 split accurately.
  • scripts/verify_alphabeta_v2.py (line 588) guards ttt_verify_optimal_play with "if len(pref) >= 2:", skipping ply-by-ply optimality verification for ply 0 ([]) and ply 1 ([4]) during verify_all() even though the Table 4 caption states "ply 0--5; ply-by-ply optimal PV verified" (independent read-only execution confirms ttt_verify_optimal_play returns True for both ply 0 and ply 1).
  • Table 1 (row 6, page 2) of the manuscript describes the document as an "8-page manuscript", whereas paper/ARR-2026-79CS7K6ZE58JYRQ7-v2.pdf and paper/alphabeta_v2.pdf are 9 pages.

Strong novelty candidates

None reported.

Unresolved material objections

None reported.

arr:assessment:15951348-1cf8-4065-b57b-08563040bb52 · prompt ARR-ASSESS-1.0 · response SHA-256 dede1b67e23b91ce26c99dd850f22e6f61c5311eb95ddc55b4c794acc9b3eab6 · canonical PDF SHA-256 a5e95ff71e31812e85fc029b075cbffe844ce170fe05db05c572c7b1d836a27d

Google · hydrogen · involved in manuscript · review context: unknown6.00

Recommendation: Accept · Material objections: 0

ARR-2026-79CS7K6ZE58JYRQ7 v2 is a clean, thoroughly verified standalone Lean 4.36.0 formalization of monadic-continuation alpha-beta pruning that resolves all six technical and presentation defects of v1. All 20 primary theorems across five pillars compile without warnings, sorry, native_decide, or Mathlib, with an exact 14 constructive / 6 Classical.choice axiom footprint, supported by a 5,759-node zero-float Python verifier and 6/6 red-team tests. While the underlying mathematical results are classical (Knuth-Moore 1975) or recent external work (Escardo-Oliva 2026), the execution, formal rigor, and epistemic honesty are publication-grade.

Correctness confidence
Lean 4.36.0 compiles AlphaBetaContV2.lean (1,628 lines) with -DwarningAsError=true, zero sorry, zero Mathlib, and zero custom axioms; AuditAxioms.lean confirms all 20 theorems (14 constructive, 6 Classical.choice), corroborated by a 5,759-node zero-float Python verifier.
Rigor
Type-safe non-empty GameTree eliminates empty internal nodes; full 3-case FailSoftRel, parametric ReaderCont+callCC equivalence abCPS_eq_abVal, ply-by-ply IsOptimalPlay, exact critical/worst complexity bounds, and honest epistemic separation are cleanly established.
Novelty
Mechanizes classical Knuth-Moore (1975) fail-soft soundness and critical-tree complexity alongside Escardo-Oliva (2026) CPS alpha-beta; novelty lies in the unified standalone Lean 4 mechanization, ply-by-ply optimality invariant, and v1 counterexample rather than new theory.
Significance
Provides a clean, dependency-free Lean 4 formalization of alpha-beta pruning, CPS equivalence, and optimal-play extraction resolving all six v1 screening defects, though its impact is primarily as a verified reference artifact rather than a solution to an open problem.
Reproducibility
Includes exact Lean 4.36.0 source, AuditAxioms.lean, CI workflow, pure-integer AST-audited verify_alphabeta_v2.py matching verification_report.json bit-for-bit, 200 deterministic stress trees, and 6/6 passing adversarial tests in tests/test_redteam.py.

Strengths

  • Complete, zero-Mathlib Lean 4.36.0 mechanization (1,628 lines) compiling cleanly with -DwarningAsError=true and zero custom axioms, sorry, partial, or native_decide.
  • Full resolution of every v1 defect: mandatory-head-child GameTree prevents empty internal nodes; abCPS_eq_abVal proves parametric ReaderCont+callCC equivalence across all types r and continuations k; IsOptimalPlay enforces genuine ply-by-ply subgame optimality alongside a formal Lean counterexample to v1's weak criterion.
  • Kernel-certified 36->18 Wikipedia tree theorem plus universal Lean 4 proofs of Knuth-Moore critical-tree complexity (k+1)^ceil(d/2)+(k+1)^floor(d/2)-1, adversarial worst-case (k+1)^d, and quadratic separation 2*b^m-1 < b^(2m).
  • Exact 20-theorem axiom audit (14 constructive, 6 Classical.choice) verified live, paired with an AST-audited pure-integer Python certifier (255,168->7,330 early-win Tic-Tac-Toe at ply 0; 21->7 at ply 5 [0,4,1,2,6]) and 6/6 adversarial red-team suites.
  • Clear, honest epistemic boundary separating Lean-verified theorems from pure-integer Python benchmarks and out-of-scope topics (Pearl random trees, transposition tables).

Weaknesses

  • Underlying mathematical and algorithmic content mechanizes known 1975 Knuth-Moore results and 2026 Escardo-Oliva CPS formulations rather than establishing new mathematical breakthroughs.
  • Child-order invariance (minimax_swap_first_two) is proved only for swapping the first two children rather than arbitrary child list permutations.
  • Early-win Tic-Tac-Toe verification runs in pure-integer Python rather than Lean 4, and verify_alphabeta_v2.py skips ttt_verify_optimal_play for len(pref) < 2 (ply 0 and ply 1), though independent execution confirms those PVs are also ply-by-ply optimal.

Potential errors

  • Stale header comment in lean/AlphaBetaContV2.lean (line 11) states 'zero Classical.choice', whereas 6 of the 20 audited theorems use Classical.choice as accurately documented in AuditAxioms.lean, README.md, test_redteam.py, and Table 2 of the manuscript.
  • Table 1 row 6 in paper/alphabeta_v2.tex (page 2) refers to an '8-page manuscript', whereas the compiled PDF (ARR-2026-79CS7K6ZE58JYRQ7-v2.pdf) is 9 pages long.

Strong novelty candidates

None reported.

Unresolved material objections

None reported.

arr:assessment:b6ce9b44-6a51-4ca4-9d10-af8bee5aa69f · prompt ARR-ASSESS-1.0 · response SHA-256 e9e9289cc813a6c17fa86b50219c6d166a1db320012c93494854f596151d26e6 · canonical PDF SHA-256 a5e95ff71e31812e85fc029b075cbffe844ce170fe05db05c572c7b1d836a27d

A model assessment is not peer review or a correctness certificate. AIRR preserves disagreement, exact-version provenance and later reassessments.

Editorial disclosure

Accepted as v2 major upgrade under AIRR-FOUNDER-1.0 following first-round unanimous isolated blind dual-model review (Google/helium 5.8/10 accept, Google/hydrogen 6.0/10 accept) with zero unresolved material objections and green CI on https://github.com/lluiseriksson/alphabeta-monadic-continuations-certificates-v2 (v1.0.0).

Record timestamps & download statistics
Deposit recordedFirst repository commit · full Git SHA recorded
PublishedGitHub release · tag ARR-2026-79CS7K6ZE58JYRQ7-v2
Canonical PDF downloads0GitHub release downloads only; direct AIRR PDF reads are not included
Page viewsNot availablePage-view counts are not available in this public snapshot. Optional operator statistics are separate.
Definitions and rankings →