[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"DRr0j2IVqp":3},"# Width-5 counterexample to a knight's-tour denominator conjecture\n\nA reproducible, computer-assisted **disproof** of a conjecture about knight's-tour\ngenerating functions, with a concrete counterexample at board width **m = 5**, assisted primarily by GPT-5.5 Pro.\n\n## The problem\n![problem](Knuth-Fas-8A-Ex-210.png)\n\nFor the knight's graph on an `m x n` board, let `S_{m,n}` count **closed** tours\n(Hamiltonian cycles) and `S^+_{m,n}` count **open** tours (Hamiltonian paths). For\nfixed `m` these are rational generating functions in `z` (the variable marking the\nnumber of columns `n`):\n\n```\nS_m(z)   = sum_{n>=0} S_{m,n}   z^n = P_m(z)   / Q_m(z),\nS_m^+(z) = sum_{n>=0} S^+_{m,n} z^n = P_m^+(z) / Q_m^+(z).\n```\n\n> **Exercise 210** (Donald E. Knuth, [*The Art of Computer Programming, Volume 4, Fascicle 8A*](https://www-cs-faculty.stanford.edu/~knuth/fasc8a.pdf), rated HM46):\n>\n> *Prove or disprove that `Q_m^+(z)` is a multiple of `Q_m(z)^3` when `m >= 5`.*\n\n**This repository disproves it.** At `m = 5`, `Q_5^+(z)` is **not** divisible by\n`Q_5(z)^3`, so the universal statement is false.\n\n## How the proof works\n\nThe polynomials `Q_5, Q_5^+` have degree in the thousands, so the proof never\ncomputes them directly. Instead it works modulo the prime **101** and tracks a\nsingle factor, `1 - 50z`:\n\n1. **Transfer decomposition.** The open-tour transfer matrix, built with an\n   auxiliary vertex `infinity` adjacent to every square, is block-triangular\n   `B = [[T,X,Z],[0,U,Y],[0,0,W]]` ordered by the degree of `infinity` (0 -> 1 -> 2).\n   `T` is the ordinary closed-tour transfer; after both `infinity` edges are placed,\n   `W` contracts to another copy of `T`. Hence the reduced open denominator divides\n   `det(I - zT) det(I - zU) det(I - zW_rel)` over the integers.\n2. **Visible factor.** Over `F_101`, `1 - 50z` divides the reduced closed\n   denominator `Q_5` (certified by an explicit `50`-eigenvector of the closed\n   transfer, obtained as a polynomial in the transfer applied to the terminal\n   vector and visible from the start state).\n3. **Multiplicity bound.** The algebraic multiplicity of eigenvalue `50` in\n   `T (+) U (+) W_rel` is **exactly 2** (`1 + 0 + 1`), certified by exact\n   Wiedemann / Berlekamp-Massey nonsingularity certificates over\n   `F_101[t]/(t^2 - 2) = F_(101^2)`, together with a border-matrix argument that\n   makes the eigenvalue algebraically simple in the relevant block.\n4. **Contradiction.** If `Q_5^3 | Q_5^+`, then `1 - 50z` would appear with\n   multiplicity at least `3` in that determinant, contradicting the certified\n   multiplicity `2`. Therefore `Q_5^+` is not a multiple of `Q_5^3`.\n\nThe full argument is in [PROOF.md](PROOF.md).\n\n## Requirements\n\n- a 64-bit little-endian machine;\n- a C++17 compiler;\n- GNU Make;\n- OpenMP is optional and only parallelizes the Krylov verification; the code has a\n  serial fallback. On Apple clang (which rejects `-fopenmp`), build with\n  `make OMPFLAGS= all`.\n\nNo external mathematical library is used.\n\n## Build\n\n```sh\nmake all                 # or: make OMPFLAGS= all   (no OpenMP, e.g. Apple clang)\n```\n\n## Verify the claims\n\n```sh\n# 1. Independent counts: a Held-Karp enumeration on the 5x4 board, plus the first\n#    closed/open transfer counts.\nmake sanity              # expect open 82, 864, 18784 for widths 4,5,6; closed 8 at width 6\n\n# 2. Regenerate every state graph and reflection block from source and compare\n#    byte-for-byte with the checked-in data (the generator is deterministic).\nmake regen-check\n\n# 3. The visible modular factor 1-50z in the closed denominator.\nmake visible-check\n\n# 4. The decisive step: exact rank / algebraic-multiplicity certificates. The\n#    checker recomputes every Krylov moment from the matrices -- it does not trust\n#    the stored moments -- and reruns Berlekamp-Massey.\nOMP_NUM_THREADS=8 make rank-check\n#    or run the six independent certificate checks in parallel:\nJOBS=6 OMP_NUM_THREADS=1 scripts/verify_ranks_parallel.sh\n\n# 5. Confirm every released file against its hash.\nmake hashes              # sha256sum -c SHA256SUMS\n```\n\nA pass on all five steps establishes that `1 - 50z` divides `Q_5` modulo 101, that\nits multiplicity in the open-side transfer determinant is exactly two, and therefore\nthat `Q_5^+` is not a multiple of `Q_5^3`.\n\n## Lean 4 verifier\n\nThis repository also includes a Lean 4 project that checks the formal\ncontradiction and independently verifies the checked-in binary certificate\nfiles.  See [LEAN.md](LEAN.md) for details.\n\nIn brief, the Lean executable:\n\n- checks SHA-256 hashes, binary magic/version fields, matrix dimensions, CSR\n  structure, state-label tails, and FNV bindings;\n- fully replays the visible-factor certificate by computing `r = g(A^2) beta`,\n  checking the `76` and `50` eigenvector equations, and comparing against the\n  restricted `Trel_plus` eigenvector;\n- recomputes all `2N + 32` Wiedemann/Krylov moments from the actual sparse\n  matrices for all six rank certificates when run in full mode;\n- reruns Berlekamp--Massey over the first `2N` stored moments and checks that\n  the resulting full-degree connection polynomials match the stored\n  coefficients;\n- builds the formal Lean theorem\n  `KnuthFasc8aEx210.WidthFiveCertificate.not_cubic_divisibility`, which proves\n  that the certified multiplicity facts contradict `Q_5(z)^3 | Q_5^+(z)`.\n\nQuick Lean check:\n\n```sh\nlake build\nlake build knuth_cert_check\n.lake/build/bin/knuth_cert_check\n```\n\nFull Lean certificate-file verification:\n\n```sh\n.lake/build/bin/knuth_cert_check . all all bm\n```\n\nThe full Lean verifier is intentionally slower than the C++ checker because it\nrecomputes the large sparse Krylov streams in Lean.\n\nExpected full-graph SHA-256 values (also checked by `make regen-check`):\n\n```text\nf6f3c08995a607bf6217fcfe6d432a9c712b8962a0b785fe2ff03b56d808055e  data/T5.bin\n847d20bc46ab8c060bfc00c49e26ab84e64d8bd4b0fe36a7915a9834be2d16ca  data/U5.bin\n37c75a7aea19bd1dd885ec304c36ea165c02947d2575de829798dc03024ef5d7  data/W5.bin\n```\n\n## Verification status\n\nThis release has been independently audited and no discrepancies were found. The\nchecks below are reproducible from this repository:\n\n- **Hashes and regeneration.** All `SHA256SUMS` entries verify, and `make regen-check`\n  rebuilds the state graphs `T`, `U`, `W` and every reflection block byte-for-byte\n  from source.\n- **Counts vs. brute force.** A separate enumeration independent of the transfer code\n  (Held-Karp on 5x4 via `bruteforce_5x4`, plus direct backtracking for wider boards)\n  reproduces the open counts `82, 864, 18784, 622868` for widths 4-7 and the closed\n  count `8` at width 6.\n- **Visible factor.** `e^T A^k beta (mod 101)` reproduces the closed-tour counts,\n  confirming that the eigenvalue `50` lives in the genuine closed denominator\n  (`make visible-check`).\n- **Multiplicity is two.** Each of the six nonsingularity / algebraic-simplicity\n  facts was re-confirmed by an independent Wiedemann / Berlekamp-Massey computation\n  over `F_(101^2)` with different random preconditioners, agreeing with the\n  checked-in certificates (`make rank-check`).\n\n## Regenerate the certificates\n\nThe checked-in certificates use seed `1`. Generation uses randomness only to *find*\nthe data; *verification* of the fixed data is deterministic and exact.\n\n```sh\nmake certs-regenerate    # overwrites data/certs/*, then compare with sha256sum -c SHA256SUMS\n```\n\n## Repository layout\n\n| Path | Purpose |\n|---|---|\n| `PROOF.md` | The mathematical argument, end to end |\n| `src/transfer_generator.cpp` | Frontier (broken-profile) transfer generator for `T, U, W`; SCCs; terminal/coreachability checks |\n| `src/extract_blocks.cpp` | Reflection decomposition into +/- blocks; exact `W_rel = T_rel` check; singleton checks |\n| `src/sanity_counts.cpp` | Scalar closed/open counts, including terminal endpoint choices |\n| `src/bruteforce_5x4.cpp` | Independent Held-Karp count on the 5x4 board |\n| `src/closed_factor.cpp` | Constructs the visible `50`-eigenvector |\n| `src/verify_visible.cpp` | Deterministic check that `1 - 50z` is visible in the closed scalar denominator |\n| `src/wiedemann_ext.cpp` | Exact certificate generator over `F_(101^2)` |\n| `src/verify_rank_cert.cpp` | Independent exact certificate verifier |\n| `LEAN.md`, `KnuthFasc8aEx210/` | Lean 4 theorem and certificate-file verifier |\n| `lakefile.lean`, `lean-toolchain` | Pinned Lean/Lake project configuration |\n| `data/`, `results/`, `SHA256SUMS` | Matrices, certificates, captured outputs, and hashes |\n\n## Binary formats\n\nAll integer fields are little-endian.\n\n- `KMC201` — sparse CSR matrix modulo 101, followed by canonical state labels.\n- `KMV101` — eigenvector and nonzero pivot.\n- `KMP101` — polynomial used for the visible factor.\n- `KMW2CERT` — rank certificate header, Krylov moments, and BM connection polynomial.\n\n`SHA256SUMS` covers every source, matrix, and certificate in the release.\n\n## Reproducibility notes\n\nThe generator is fully deterministic -- no hash-table iteration order is allowed to\naffect a saved transition list -- so `make regen-check` rebuilds every matrix\nbyte-for-byte from source. The certificate verifier reconstructs the random\npreconditioners and probe vectors from a recorded seed, recomputes all `2N + 32`\nmoments from the sparse matrix, reruns Berlekamp-Massey, and only then compares\nagainst the stored data, so a passing run does not depend on trusting any\nprecomputed file.\n",1785080814398]