Repository navigation
Add a 28-state machine for Brocard's problem (brocard_28) with Lean proofs - #27
Conversation
|
@mo271 this may be a new record for Brocard’s problem :) |
…challenge standard text
…hrough never-read gate cells
brocard_41) with Lean proofsbrocard_34) with Lean proofs
…43-state Brocard count)
brocard_34) with Lean proofsbrocard_28) with Lean proofs
|
Really nice work: getting Brocard's problem down to 28 states (beating both the 61-state proved bound and the 43-state unproved construction, and even clearing the ~30-state conjecture) is a great result! The I checked out the branch locally, ran Only found two tiny stale state-range headers in
LGTM once those two comments are touched up (or in a quick follow-up)! |
|
thanks, both headers fixed in the follow-up commit |
This PR adds a new conjecture-checking machine:
brocard_28, a 28-state 2-symbol Turing machinethat halts on the blank tape if and only if Brocard's problem
n! + 1 = m^2has a solution withn > 7, i.e. beyond the known solutionsn = 4, 5, 7(Brocard 1876, 1885; Ramanujan 1913;Erdős conjectured there are no others; none exist for
n ≤ 10^12).Machine. Everything is unary. The tape holds
ncells andn!/8cells;n! + 1 = m^2forces
m = 2k + 1, son!/8 = 1 + 2 + ⋯ + kis a triangular number. A round multiplies thesecond block by
n + 1(a hole walks through the first block, one copy per cell; at the start ofeach round one cell is written left of the first block) and tests the result by subtracting
1, 2, 3, …; the blank beyond the chunk block acts as its hole, so each wrap grows it for free. Asuccess walks back over the second block counting its ones modulo
4: residue0halts, andsince
32dividesn!forn ≥ 8this is exactly the casen ≥ 8; the known solutions give15 ≡ 3and630 ≡ 2 (mod 4)and return to the next round. The start is a single state thatsteers the loop's own states, through its two never-read cells, to write
1111 0 111in 46 steps(earlier versions with 41 and 34 states, whose gate counted the cells of the first block, are in
the PR history). Layout and credits:
artifacts/brocard_28/README.md.Proofs (
Cryptids/Brocard28.lean,Cryptids/Semantics/Brocard28.lean):halts_brocard28_iff_exists_tri : Halts brocard28 ↔ ∃ n, 8 ≤ n ∧ IsTri (n ! / 8)—propext,Quot.sound.halts_brocard28_iff_exists_square : Halts brocard28 ↔ ∃ n, 7 < n ∧ IsSquare (n ! + 1)—propext,Quot.sound(incomparator/constructive.json).halts_brocard28_iff_not_brocard : Halts brocard28 ↔ ¬ BrocardConjecture— classical (Markov).Wiring.
Machines.lean,Propositions.lean(BrocardConjecture),Challenge.lean,comparator/brocard_28.json(+constructive.json,all.json),verify.py(table and SHA-256checks against both Lean files, the 46-step start, blank-tape stage checks, a planted triangular
number halts and a non-triangular one reaches the next test with the expected tape), docs and
formalization.yaml.Prior work. Charlie Reams's 61-state machine with a Lean proof
(calr3/tinycryptids,
brocard/, November 2026) and a43-state table without a machine-checked proof in Tandi, Gonzalez-Hendrix and Brown
(arXiv:2605.20215).
Improving that 43-state count is Open Problem 6.2 in Gasarch's SIGACT News column (Sept 2026), which reports Jonathan Brown's conjecture that about 30 states may suffice.
The design here is different (triangularity of
n!/8, in-place multiply, counter grown at each round start, residue gate).Claude (Anthropic) was used as assistant.