#!/usr/bin/env python3 """Synchronize the Terminal-Bench finite-problem contribution. The UnsolvedMath export is denormalized across problems.json, dataset.json, statistics.json, sets.json, and README.md. This script keeps those copies consistent and makes the proposed contribution straightforward to review. """ from __future__ import annotations import json import re from collections import Counter from pathlib import Path ROOT = Path(__file__).resolve().parents[2] STAMP = "2026-07-31T00:00:00Z" SET_ID = 14 SET_RECORD = { "id": SET_ID, "name": "terminal_bench_verifiable_problems", "display_name": "Terminal-Bench Verifiable Open Problems", "description": ( "Finite open mathematical and cryptanalytic problems selected and " "formalized for Terminal-Bench, with exact witness checkers or Lean " "statements supplied as optional verification artifacts." ), "slug": "terminal-bench-verifiable-problems", "order_index": SET_ID, "created_at": STAMP, } PROBLEMS = [ { "number": "TBV-001", "title": "AES S-Box Multiplicative Complexity", "statement": ( "Determine whether the AES field-inversion map $F:\\mathbb F_{2^8}" "\\to\\mathbb F_{2^8}$, $F(0)=0$ and $F(x)=x^{254}$ for $x\\ne0$, " "has multiplicative complexity below 29. Equivalently, construct an " "XOR/AND/NOT circuit with at most 28 AND gates, or prove that every " "such circuit requires at least 29 AND gates. The field is " "$\\mathbb F_2[X]/(X^8+X^4+X^3+X+1)$; XOR and NOT are free." ), "background": ( "Multiplicative complexity counts nonlinear gates in a Boolean " "circuit. In July 2026 an explicit 29-AND construction improved the " "previous public 32-AND NIST circuit and was exhaustively checked on " "all 256 inputs. The construction establishes only the upper bound; " "no 28-AND circuit or matching 29-gate lower bound was located in the " "status audit. Sources: https://umizame.github.io/S-box_29-AND/ ; " "https://csrc.nist.gov/projects/circuit-complexity ; FIPS 197, " "https://doi.org/10.6028/NIST.FIPS.197-upd1 . Status audited 31 July " "2026. Formal statement and exhaustive checker: " "verification/terminal-bench/TBV-001/." ), "category": 15, "difficulty": 4, }, { "number": "TBV-002", "title": "Existence of a Costas Array of Order 32", "statement": ( "Does there exist a permutation $p$ of $\\{0,\\ldots,31\\}$ for " "which all 496 displacement vectors $(j-i,p(j)-p(i))$, " "$0\\le i