Repository navigation
Add deeply embedded first-order Peano Arithmetic - #17
Conversation
TomZahavy
left a comment
There was a problem hiding this comment.
Thanks, this is a nice foundation! I went through the trusted-base changes (Challenge.lean, Propositions.lean, comparator configs, READMEs) in detail and skimmed the proof modules. CI is green.
Spec check. I compared every PAProvable constructor against a textbook Hilbert-style PA:
genis unrestricted, which is fine since there are no hypotheses.all_elim/ex_intro/eq_substare guarded byfreeFor, andall_vacuous/ex_elimbyhasFree.pa_indsubstitutesS xforx, which is always free forx.PAModel.indis the first-order schema.
I found no extra axioms. Together with not_paProvable_false and paProvable_sound_nat, that makes me comfortable with the definition. I also like that paHalts/paZFInconsistent don't need to be trusted by eye: the adequacy theorems pin their meaning in ℕ to the existing Halts/ZFInconsistent.
Requested changes:
-
Layering / instance perturbation.
Propositions.leannow importsCryptids.Machines, which declares global priority-10000 instances (e.g.instPreorderNatConstructive : Preorder ℕ). As a result, the existingMatiyasevichRiemannCounterexamplehad to be changed to(@Finset.Icc ℕ Nat.instPreorder Nat.instLocallyFiniteOrder 1 x), whileChallenge.leanstill hasFinset.Icc 1 x. The comparator accepts this, but it silently edits an existing trusted definition, and future additions toPropositions.leanwill hit the same trap. Could the TM-dependent PA definitions (paStep,paHalted,paHalts, possibly all of §4) move to their own module that importsPropositions+Machines, with theIccchange reverted? At minimum, please add a comment explaining the pinned instance. -
Docs claim more is audited than is.
Cryptids.lean,Cryptids/README.mdandSemantics/README.mdlistpaProvable_iff_holdsIn_all_models(andpaProvable_sound) next to the audited theorems. Neither is inChallenge.leanor any comparator config. Please either add them to the challenge and toall.json/pa_semantics.json(this needsPAStructure/PAModel/HoldsInin the challenge), or reword the docs as "proved, not comparator-audited". This matters more in #20, where completeness becomes load-bearing. -
Doc accuracy nits:
Semantics/README.mdsays "positive formulas (PAFormula)", but they includeimp/bot.- The README signature of
paProvable_iff_holdsIn_all_modelsomits[PAStructure M]. - "without relying on Lean's ambient type-theoretic strength" overstates this PR. All theorems here are still metatheoretic; the object-level
PAProvableresults only arrive in #20. - "PAProvable … cannot prove Con(PA) or Con(ZF)" (Challenge docstring) is Gödel II under the assumption that PA is consistent. Please say so, or soften it.
-
Housekeeping:
- Please add a PR description: what's added, the trusted-base delta, and which theorems are constructive vs classical.
- The branch currently conflicts with
mainincomparator/README.md(after #18). Please rebase and refresh the theorem counts. - FYI: CI only runs
constructive.jsonandall.json, sopa_semantics.jsonis covered only indirectly. That's consistent with the other per-module configs.
Happy to approve once 1–3 are addressed.
No description provided.