Repository navigation
Make ListBlank quotient-free, add zero-axiom gate, and make Riemannn95 choice-free - #25
Conversation
mo271
commented
Nov 2, 2026
- Replace Quot-based ListBlank in Challenge.lean and Cryptids/Machines.lean with canonical blank-trimmed lists (ListBlank.IsTrimmed / ListBlank.trimCons) and constructive Zero/LT/LE/OfNat/Inhabited/NeZero instances + listGetD so ListBlank, Tape, Halts, Machine, BundledMachine, and PAProvable depend on zero axioms ([]).
- Make ConjectureMachines.Semantics.PA.not_paProvable_false and all four candidate_fewer_states theorems completely axiom-free (permitted_axioms = []) and audit them in CI via comparator/zero_axioms.json.
- Eliminate Classical.choice from ConjectureMachines.Riemann95.candidate_equivalent (constructive primality witness in ShuniaCounterexample, constructive order instances on Fin/Nat, and constructive contradiction handling in run_return98_after_one and fenceReturn_exact) and add it to comparator/constructive.json and comparator/riemann_95_reduction.json.
1310aaa to
8b4ea14
Compare
8b4ea14 to
88c865b
Compare
TomZahavy
left a comment
There was a problem hiding this comment.
Very clean refactor — replacing Quot-based ListBlank with canonical blank-trimmed lists, proving not_paProvable_false in pure CIC ([]), and removing Classical.choice from Riemann95.candidate_equivalent via isPrimeBool brings all five state reductions into comparator/constructive.json. Verified locally that #print axioms on ListBlank, Tape.move, init, Halts, and BundledMachine.Halts reports zero axioms, and verify.py, render_challenge.py --check, check_manifest.py, and formalization.yaml (all 36 main_results) are in sync.
Left a few inline comments (most notably a coverage gap in zero_axioms.json for ListBlank/Tape/Halts, plus unused/single-caller helpers), along with minor metadata/doc nits:
- PR title & body: typo
Riemannn95→Riemann95in the PR title, and the PR body still says "all fourcandidate_fewer_statestheorems" (already updated to "all five" and 17 theorems inconstructive.jsonin the amended commit message). artifacts/riemann_95/README.md: lines 34–43 still only mentioncomparator/riemann_95.json(propext,Classical.choice,Quot.sound); worth notingcomparator/riemann_95_reduction.json(propext,Quot.sound, noClassical.choice) there too.
| "theorem_names": [ | ||
| "ConjectureMachines.Goldbach21.candidate_fewer_states", | ||
| "ConjectureMachines.Zf380.candidate_fewer_states", | ||
| "ConjectureMachines.Riemann104.candidate_fewer_states", | ||
| "ConjectureMachines.Riemann95.candidate_fewer_states", | ||
| "ConjectureMachines.ErdosTernary14.candidate_fewer_states", | ||
| "ConjectureMachines.Semantics.PA.not_paProvable_false" | ||
| ], | ||
| "permitted_axioms": [] |
There was a problem hiding this comment.
None of the 6 theorems here transitively reference ListBlank, Tape, step, init, or Halts (*.candidate_fewer_states only projects .states on BundledMachine/Machine/listGetD, and not_paProvable_false only touches PAFormula/PAProvable). While ConjectureMachines.BundledMachine.Halts really is axiom-free right now, if propext or Classical.choice later crept back into ListBlank (e.g. via by_cases/simp in isTrimmed_trimCons), zero_axioms.json would still pass green.
Adding a #guard_msgs check in Cryptids/Machines.lean (and/or Challenge.lean), e.g.:
/-- info: 'ConjectureMachines.BundledMachine.Halts' does not depend on any axioms -/
#guard_msgs in #print axioms ConjectureMachines.BundledMachine.Halts(or adding a small zero-axiom theorem mentioning Halts to zero_axioms.json) would mechanically enforce the zero-axiom guarantee on ListBlank, Tape, step, init, and Halts in CI.
| protected abbrev ListBlank.liftOn {Γ : Type*} [Inhabited Γ] {α : Sort*} (l : ListBlank Γ) | ||
| (f : List Γ → α) (H : ∀ a b, Turing.BlankExtends a b → f a = f b) : α := | ||
| Quot.liftOn l f fun a b h => h.elim (H a b) fun h' => (H b a h').symm | ||
| (f : List Γ → α) (_H : ∀ a b, Turing.BlankExtends a b → f a = f b) : α := | ||
| f l.toList |
There was a problem hiding this comment.
Now that ListBlank.head, tail, and cons operate directly on l.toList and trimCons, ListBlank.liftOn has no callers in Challenge.lean and is outside the statement closure of every challenge theorem. Keeping ListBlank.liftOn in Cryptids/Machines.lean (for PA/Adequacy.lean and CtlCertificate.lean) and dropping this unused copy from Challenge.lean keeps the challenge specification minimal.
| theorem list_getD_eq_getElem {α : Type*} : ∀ (l : List α) (d : α) {i : ℕ} (hi : i < l.length), | ||
| l.getD i d = l[i] | ||
| | [], _, _, hi => absurd hi (Nat.not_lt_zero _) | ||
| | _ :: _, _, 0, _ => rfl | ||
| | _ :: xs, d, _ + 1, hi => list_getD_eq_getElem xs d (Nat.lt_of_succ_lt_succ hi) | ||
|
|
||
| theorem list_getD_append_left {α : Type*} : ∀ (l₁ l₂ : List α) (d : α) (i : ℕ), | ||
| i < l₁.length → (l₁ ++ l₂).getD i d = l₁.getD i d | ||
| | [], _, _, _, hi => absurd hi (Nat.not_lt_zero _) | ||
| | _ :: _, _, _, 0, _ => rfl | ||
| | _ :: xs, l₂, d, n + 1, hi => list_getD_append_left xs l₂ d n (Nat.lt_of_succ_lt_succ hi) |
There was a problem hiding this comment.
Nit: unlike list_length_five (shared across 3 files) and reaches_total_det / reaches_of_none (used in Machines.lean and Initializer95.lean), list_getD_eq_getElem is only called in Auxiliary95RawPhysical.lean and list_getD_append_left is only called in PhysicalTrace95.lean (and both are about List.getD rather than ConjectureMachines.listGetD). Making them private in their single caller files would match repo convention.
…scoping - Challenge.lean & Cryptids/Machines.lean: add #guard_msgs in #print axioms ConjectureMachines.BundledMachine.Halts so CI mechanically rejects any axiom creeping into ListBlank, Tape, step, init, or Halts. - Challenge.lean: drop unused ListBlank.liftOn (keeping it in Cryptids/Machines.lean for PA/Adequacy and CtlCertificate). - Cryptids/Machines.lean & Riemann95/: move single-caller list_getD_eq_getElem and list_getD_append_left into Auxiliary95RawPhysical.lean and PhysicalTrace95.lean as private lemmas. - artifacts/riemann_95/README.md: document comparator/riemann_95_reduction.json (no Classical.choice) and comparator/zero_axioms.json alongside comparator/riemann_95.json.
… choice-free - Replace Quot-based ListBlank in Challenge.lean and Cryptids/Machines.lean with canonical blank-trimmed lists (ListBlank.IsTrimmed / ListBlank.trimCons) and constructive Zero/LT/LE/OfNat/Inhabited/NeZero instances + @[simp] def listGetD so ListBlank, Tape, Halts, Machine, BundledMachine, and PAProvable depend on zero axioms ([]), while keeping simp/dsimp unfolding compatible with BusyBeaver proofs. - Make ConjectureMachines.Semantics.PA.not_paProvable_false and all five candidate_fewer_states theorems (including ErdosTernary14) completely axiom-free (permitted_axioms = []) and audit them in CI via comparator/zero_axioms.json. - Eliminate Classical.choice from ConjectureMachines.Riemann95.candidate_equivalent (constructive primality witness in ShuniaCounterexample, constructive order instances on Fin/Nat, and constructive contradiction handling in run_return98_after_one and fenceReturn_exact) and add it to comparator/constructive.json (17 theorems including Brocard28) and comparator/riemann_95_reduction.json. - Pin lean-action to v1.7.0 with exact semver tag comments in lean_action_ci.yml.
…scoping - Challenge.lean & Cryptids/Machines.lean: add #guard_msgs in #print axioms ConjectureMachines.BundledMachine.Halts so CI mechanically rejects any axiom creeping into ListBlank, Tape, step, init, or Halts. - Challenge.lean: drop unused ListBlank.liftOn (keeping it in Cryptids/Machines.lean for PA/Adequacy and CtlCertificate). - Cryptids/Machines.lean & Riemann95/: move single-caller list_getD_eq_getElem and list_getD_append_left into Auxiliary95RawPhysical.lean and PhysicalTrace95.lean as private lemmas. - artifacts/riemann_95/README.md: document comparator/riemann_95_reduction.json (no Classical.choice) and comparator/zero_axioms.json alongside comparator/riemann_95.json.
b09a93a to
1cd6958
Compare