Skip to content

Add a 21-state machine for Legendre's conjecture (legendre_21) with Lean proofs - #32

Open
veljjanoski wants to merge 1 commit into
google-deepmind:mainfrom
veljjanoski:legendre-21
Open

veljjanoski wants to merge 1 commit into
google-deepmind:mainfrom
veljjanoski:legendre-21

Conversation

@veljjanoski

Copy link
Copy Markdown
Contributor

This PR adds legendre_21, a 21-state 2-symbol Turing machine that halts on the blank tape if
and only if Legendre's conjecture is false: some n ≥ 1 has no prime strictly between n^2 and
(n + 1)^2.

Machine. Everything is unary. The primality test is the one of goldbach_21 (16 of the 21
states). A hole in a walker area moves one cell per tested number and reaches the left end at
the last number of each interval n^2, …, n^2 + 2n. A flag records whether the interval had a
prime; if it had none, the machine halts. Details: artifacts/legendre_21/README.md.

Proofs (Cryptids/Legendre21.lean, Cryptids/Semantics/Legendre21.lean):

  • halts_legendre21_iff_exists_gap : Halts legendre21 ↔ ∃ n, 1 ≤ n ∧ ∀ p, p.Prime → ¬ (n ^ 2 < p ∧ p < (n + 1) ^ 2)
    — propext, Quot.sound.
  • halts_legendre21_iff_not_legendre : Halts legendre21 ↔ ¬ LegendreConjecture — classical
    (Markov).

Wiring. Machines.lean, Propositions.lean, Challenge.lean, comparator configs,
verify.py, docs and formalization.yaml.

Prior work. Charlie Reams's 44-state machine with a Lean proof
(calr3/tinycryptids, November 2026),
which also uses an interval register with a hole and a flag. The primality test comes from the
Goldbach machines (anonymous 2016 machine, Yao & Leng, Faldor & Firsching).

Claude (Anthropic) was used as assistant.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant