Repository navigation
Import the 28-state Brocard Turing machine - #1030
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Medium impact] No blocking code issue was found; external source checks remain unverified. SummaryAdds the 28-state Brocard machine and proves that it halts exactly when some natural number greater than seven has square factorial-plus-one.
Reviews (7) · Last reviewed commit: "Share the Brocard copy and chunk-test tr..." · Reviewed by Greptile |
Vilin97
left a comment
There was a problem hiding this comment.
The Brocard reduction at 3a13a5ab checks out. The published project card needs the source pin that includes it.
- All 56 transition cells match the pinned 28-state artifact, including the undefined transition that halts the machine. The proof starts in state zero on the blank tape, suppresses the known solutions, and establishes both directions of the halting equivalence for a square
n! + 1withn > 7. I found no duplicate in Lean Pool, Mathlib, or Tau Ceti. Pinned transition table - The published card uses
source.urland omitsbrocard_url. Update the canonical URL and commit to481f4e3, which contains both developments, and retainf873434as the Goldbach port’s origin. The existing Goldbach proofs and their statements are unchanged. Both new modules retain the upstream attribution and note the port changes. Upstream comparison - Reusing the existing tape-sweep proofs is a maintainability improvement. The current sweeps support the verified reduction without changing the shared execution API.
Vilin97
left a comment
There was a problem hiding this comment.
Source approved at 74290ba3. The canonical source link now reaches the pinned Brocard artifact.
The four Brocard wrappers specialize the two shared sweep proofs with the same tape symbols and effects, including the rightward erase. The original Goldbach sweep signatures and the Brocard transition table and halting equivalence are preserved. Earlier review
Proof profile (new / modified Lean files)
This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget. A base→head comparison was attempted but its measurements are unavailable (see the run log); modified files are omitted from the tables below. Statement changes✅ No statements changed — all 116 tracked declarations across 3 modified files kept their type; only proofs / definition bodies changed. Also: 0 declarations added, 27 removed. A reorganization moves declarations between files, which shows up here as an add in one file and a remove in another. ➖ Declarations removed (27)
Statements are compared textually against the merge base (comments and whitespace ignored; Total heartbeats: 104,190 maxHeartbeats units across 3 valid files (1,387 added LOC). Sum of Count-heartbeats wall-clock total: 16.13 s. Repeated import cost inside Heartbeat values sum disjoint root command traces with LOC counts added lines in the profiled Lean files from this PR diff.
Aggregate phase totals
Slowest changed modules (from
|
| Changed module | Lake time |
|---|---|
LeanPool.CryptidsGoldbach.Brocard28 |
6.90 s |
LeanPool.CryptidsGoldbach.MachineSupport |
2.80 s |
LeanPool.CryptidsGoldbach.BrocardSemantics |
0.71 s |
Per-file `lean --profile` output
LeanPool/CryptidsGoldbach/Brocard28.lean
import took 845ms
type checking took 982ms
type checking took 1.01s
type checking took 1.05s
type checking took 229ms
cumulative profiling times:
attribute application 7.37ms
blocked (unaccounted) 17.7ms
compilation (IR) 1.4ms
compilation (LCNF base) 21.4ms
compilation (LCNF impure) 5.54ms
compilation (LCNF mono) 12.4ms
congr simp thm 3.64ms
declTypeLinter 27.4ms
elaboration 620ms
fix level params 3.45ms
import 845ms
initialization 31.4ms
instantiate metavars 8.91ms
interpretation 571ms
let-to-have transformation 2.17ms
linting 98.4ms
module linting 0.0219ms
norm_num 0.605ms
parsing 80.9ms
process pre-definitions 42.9ms
ring 6.03ms
share common exprs 24.3ms
simp 323ms
tactic execution 996ms
tacticAnalysis 22.4ms
type checking 3.82s
typeclass inference 554ms
real 6.29
user 7.74
sys 0.72
LeanPool/CryptidsGoldbach/BrocardSemantics.lean
import took 431ms
cumulative profiling times:
attribute application 0.0413ms
blocked (unaccounted) 81.4ms
declTypeLinter 2.65ms
elaboration 38.2ms
fix level params 0.166ms
import 431ms
initialization 25.2ms
instantiate metavars 0.683ms
interpretation 122ms
let-to-have transformation 0.051ms
linting 4.82ms
module linting 0.0264ms
norm_num 0.77ms
parsing 2.93ms
process pre-definitions 2.18ms
ring 8.9ms
share common exprs 1.93ms
tactic execution 50.2ms
tacticAnalysis 2.47ms
type checking 78ms
typeclass inference 30.9ms
real 1.30
user 0.83
sys 0.66
LeanPool/CryptidsGoldbach/MachineSupport.lean
import took 376ms
cumulative profiling times:
attribute application 1.75ms
compilation (IR) 0.292ms
compilation (LCNF base) 2.19ms
compilation (LCNF impure) 1.33ms
compilation (LCNF mono) 1.93ms
congr simp thm 1.89ms
declTypeLinter 6.04ms
elaboration 95.9ms
fix level params 0.648ms
import 376ms
initialization 24.8ms
instantiate metavars 0.827ms
interpretation 164ms
let-to-have transformation 0.369ms
linting 18.9ms
module linting 0.0342ms
parsing 11ms
process pre-definitions 5.48ms
share common exprs 3.28ms
simp 56.3ms
tactic execution 58.1ms
tacticAnalysis 5.3ms
type checking 28.4ms
typeclass inference 54.6ms
real 1.26
user 1.00
sys 0.63
Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.
Vilin97
left a comment
There was a problem hiding this comment.
Approve on 74290ba3c862e7e8cbec2ed3ae11b213f501a8b7.
Faithfulness and significance
halts_brocard28_iff_exists_square states ConjectureMachines.Halts brocard28 ↔ ∃ n, 7 < n ∧ IsSquare (n.factorial + 1). The machine uses the existing blank-tape semantics. The stages initialize the tape, multiply the unary factorial block, test triangularity, suppress the known successes at 5 and 7, and reach a halted configuration exactly at a new solution. The arithmetic bridge handles both directions using (8 mid n!) for (n ge 4). This preserves an explicit small-state reduction for a published open problem.
Novelty and sources
The existing Goldbach port supplies the finite-machine and tape semantics. The new transition table, simulation, and Brocard equivalence are distinct from its prime-search result. I checked the pool’s cards, source, PRs and history and the pinned Mathlib and Tau Ceti sources for an equivalent Brocard development. I also compared all 56 entries against the pinned Apache-2.0 table. The card’s published source now lands on the Brocard revision, with the earlier Goldbach revision recorded separately. Upstream credits Veljjanoski and identifies Claude’s assistance. Source and attribution
Engineering and verification
The four machine-specific sweeps use the two general scan inductions. The two original Goldbach scan statements retain their signatures. The startup is checked by kernel reduction and the existing trailing-blank equality. The resized proofs replace a single large simplifier invocation with the rewrites used by each transition segment. The matched project build took 10.36 s before optimization and 7.85 s at this head. The machine module’s synchronous profile dropped from 130,009 to 65,050 heartbeats in Lean’s maxHeartbeats units.
Local index, style, warning-free build, linter, card endpoint, axiom, prohibited-mechanism, and build-message checks passed across eight modules. The required hosted Build project check passed on this head, together with the content separation check and applicable validation workflows. Both new modules compiled in the hosted advisory profile. Lean CI · Profile
|
/review |
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | Brocard import and shared machine API extraction |
| Introduces tech debt | ✅ no |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
Existing Goldbach callers retain their import path, while named transition rewrites and shared branch traces make the Brocard proofs easier to debug and update.
Tokens: 2,632,500 in / 9,512 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $10.6727 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
|
Both findings fixed in
The revised head builds warning-free and passes synchronous profiling. Hosted checks are running again. Updated Lean CI |
Vilin97
left a comment
There was a problem hiding this comment.
Source approved at af415920. The shared binary-machine module preserves the proof interfaces.
The 29 moved declarations retain their names and statements and are re-exported by the Goldbach module. The Brocard table and halting equivalence are unchanged. The revised startup proof follows the same transitions. Earlier source review
Vilin97
left a comment
There was a problem hiding this comment.
Approve on af41592083298bd3ff9c40827ac296ffdc50e9e7.
I reviewed the shared-machine extraction and last startup proof against the exact built sources. The support module moves the generic finite execution, tape and reachability declarations under the same namespace and with the same names. Its clients are the two independent simulations. The compiler dependency inventory for Brocard28 contains only MachineSupport and Machines among Lean Pool modules. The final startup segment uses named rewrites through the ten steps and the equality for a blank cell. It needs no assumption about the concrete list representative of the resulting tape.
The arithmetic endpoint and all 56 table entries remain the verified ones from the cited Apache-licensed revision. The exact-head local build, generated indexes, text style, declaration lint, card endpoints, axiom closure, prohibited-mechanism and build-message checks passed. The matched project runs took 20.27 s → 12.03 s from the first warning-free port. The main machine proof fell from 130,009 to 67,763 maxHeartbeats units. The required hosted build and content separation checks passed on this head. Greptile completed its rereview. Lean CI · Earlier review
|
/review |
|
Both follow-up findings fixed in
The exact-head project build, profiling, declaration lint, and trust audit passed locally. Updated Lean CI |
Vilin97
left a comment
There was a problem hiding this comment.
Approve on 8cd74d12e2d4513a64b6588fe807886bef0faf4c.
I verified the follow-up diff against the previously reviewed head. All four startup segments use the named transition lemmas, and the block-append proofs use the shared machine support. The transition table and halting equivalence retain their verified contents. The exact head passed the local index, style, warning-free build, declaration lint, card endpoint, axiom closure, prohibited-mechanism, and build-message checks. The matched project build took 20.27 s → 15.87 s, and the machine proof used 130,009 → 97,826 maxHeartbeats units. The matching hosted build passed the index, build, declaration lint, text style, and repository quality stages. The earlier review covers the upstream table, endpoint, and isolation from the Goldbach simulation.
|
/review |
|
Both follow-up findings addressed in
|
Vilin97
left a comment
There was a problem hiding this comment.
Source approved at f925e3fb. The transition table and halting equivalence are unchanged.
The left and right move wrappers use the shared tape lemmas. Both cleanup paths now use the same trace, which erases the remainder of the block, returns over the erased cells, and starts the next round in the same configuration as before. Earlier source review
Vilin97
left a comment
There was a problem hiding this comment.
Approve on 2e558380281839725d132d2f894605cc7e0fd9c6.
- The last diff changes the proofs of two tape moves to use
MachineSupportand shares one erasure path for the failed test and suppressed success. The shared lemma composes theER2scan, the turn on the blank, theER3scan over both erased blocks, and the two transitions into the next round. The two callers enter with respectively an erased prefix and an empty prefix. The transition table and public theorem statements are unchanged. - The local shard passed declaration lint across nine modules and 674 declarations, endpoint validation, axiom closure, prohibited-mechanism and build-message checks. The local warning-free build, indexes, static quality and text style passed. The matched build took 20.27 s → 7.69 s and the machine proof used 130,009 → 96,965
maxHeartbeatsunits. - The project card now cites the November 9 commit introducing the 28-state machine. The PR description also records the November 11 merge. The endpoint audit reran after the metadata change. Public 28-state commit · Upstream PR
- The hosted run passed index, build, declaration lint, text style, and quality checks. The required content separation check passed as well. The earlier review covers the pinned table, endpoint, existing API and compiler dependency closure.
|
/review |
|
Both transition-trace findings addressed in
|
Vilin97
left a comment
There was a problem hiding this comment.
Source review passed for 129acd13. Hosted Lean validation is pending.
The review confirms that all 128 public statements and the 28-state transition table are unchanged. The description now ties the 28-state announcement to the actual upstream commit where that machine appeared. The shared sweep trace preserves both the copy and chunked runs, including zero-length and empty segments.
Vilin97
left a comment
There was a problem hiding this comment.
Approve on 129acd13cfb03c21abce8e3243b759680f7adb5b.
- The follow-up factors out the two repeated machine traces.
copy_appendstartsR0at the separator and ends atL1after adding one output cell.shift_chunk_holestartsTR0on the test separator and ends atTL1with one cell transferred across the hole. Each shared trace specifies both halves of its final tape, and the four callers retain their public types and continue with their original branch-specific transitions. - The table, blank-tape halting equivalence, and project card retain their reviewed contents. The warning-free local build, indexes, text style, static quality, and shard checks passed. Declaration lint covered nine modules and 676 declarations. The shard audited card endpoints, axiom closure, prohibited mechanisms and build messages. The matched build took 20.27 s → 9.81 s and the main proof used 130,009 → 95,188
maxHeartbeatsunits. - The hosted run passed index, build, declaration lint, text style, and quality checks. The required content separation check also passed. The earlier review covers source, table and dependency closure.
|
/review |
Ready for review. Imports Daniel Veljjanoski’s 28-state binary Turing machine for Brocard’s problem and the proof of its blank-tape halting equivalence. The machine halts exactly when some natural number (n > 7) makes (n! + 1) a square. The reduction gives a concrete small-state machine for the open problem raised in Gasarch’s September 2026 SIGACT News column.
Source and scope
481f4e3e39907304dbcad33e508bf21d80c6d5a6. Veljjanoski credits Claude for assistance with the machine and proofs. The project card records mixed provenance across the two developments. Upstream PR · Source and licensePort and validation
fc4f59e577feb1a4956671bc04ac18aaaf8cd842, and Tau Ceti0642eae29e0a59ef798d04de325386445906e755. The table is a Lean literal corresponding cell for cell to the upstream artifact. The startup proof replays the four transition segments with explicit rewrite lists and the blank-tape equality. The one-symbol tape append facts reuse the general append lemmas, and individual tape moves use the shared step API. The successful and failed test paths share the proof that the erasure states return to the next round. The copy and chunk-test branches each use a shared prefix trace.lake --no-ansi --no-cache build LeanPool.CryptidsGoldbach.Imports. At the revised head, wall time fell from 20.27 s to 9.81 s compared with the first warning-free port. The machine module used 130,009 → 95,188 synchronous command heartbeats in Lean’smaxHeartbeatsunits. Its wall times were 9.7 s and 6.3 s under shared-host load.The GPT follow-up prompted the shared
MachineSupportmodule and the explicit last startup trace. The Brocard proof’s compiler dependency inventory now contains the shared machine modules and excludes the Goldbach simulation.