Repository navigation
Support Lean 4.35 and loading compiled proof projects - #15
Draft
kiranandcode wants to merge 4 commits into
Draft
kiranandcode wants to merge 4 commits into
kiranandcode wants to merge 4 commits into
Conversation
* Harden C bridge; add stub, wheel, and type-check tooling - GIL: acquire around every CPython-touching bridge entry via a cleanup-attribute WITH_GIL macro (releases on all return paths). - Remove dead lean_types.py + manual m_rc helpers; route library.py through lean_dec. Replace magic IO.Error tag constants with lean_is_string. Clear stale worktree/autosave/pyc; fix README count. - stubgen: generate .pyi from the registry (mypy-clean). - packaging: vendor the dylib closure + lean.h into a py3-none wheel that loads with no toolchain present. - registry: TypeRepr drives both the stub annotation and a runtime predicate (matches/check); opt-in set_argument_typechecking. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix lint: ruff format, drop unused import, mypy None-guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Harden C bridge; add stub, wheel, and type-check tooling - GIL: acquire around every CPython-touching bridge entry via a cleanup-attribute WITH_GIL macro (releases on all return paths). - Remove dead lean_types.py + manual m_rc helpers; route library.py through lean_dec. Replace magic IO.Error tag constants with lean_is_string. Clear stale worktree/autosave/pyc; fix README count. - stubgen: generate .pyi from the registry (mypy-clean). - packaging: vendor the dylib closure + lean.h into a py3-none wheel that loads with no toolchain present. - registry: TypeRepr drives both the stub annotation and a runtime predicate (matches/check); opt-in set_argument_typechecking. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix lint: ruff format, drop unused import, mypy None-guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Bump Lean toolchain v4.29.1 -> v4.34.1 - lean-toolchain (root, tests/lean, examples/*) -> v4.34.1 - Regex v4.29.0 -> v4.34.0-rc1; Pantograph dev -> 92d4818 - Kernel.declAxioms: use public Lean.collectAxioms (CollectAxioms.collect is now private) - Kernel.envUnpickle/goalUnpickle: re-enable initializer execution, since withImporting now clears the flag after each import - Z3 datatypes: compileDecls the inductive before mkCtorIdx etc. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Main's tree equals the old base (bump-lean-v4.34.1); conflicts in the toolchain and lake manifests take this branch's Lean 4.35 versions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lean 4.35 projects cannot use the current bridge: its toolchain differs, and
decidePropassumes the old inductive representation ofDecidable. This upgrades the toolchains, pins Pantograph's Lean 4.35 revision, and reads the new Boolean field when deciding propositions.The kernel example loads an existing project's compiled modules using its Lake search path. It supports declaration types and axiom inspection without linking the inspected project's native libraries or
Mathlib:static.This draft is stacked on #14. Regex has no compatible release yet: plain first
lake buildfails inSparseSet.Bijectionwith agrindpanic. The explicitscripts/prepare_lean435.pybootstrap checks the exact source SHA-256 and applies a proof-only workaround before building. It is idempotent, rejects unexpected source, and runs in CI. There is no automatic update hook. Remove this workaround when upstream provides a compatible revision.Validation on AWS Linux, Lean 4.35.0:
Classical.choice,Quot.sound, andpropext; a tactic goal also succeeds.macOS and sanitizer checks remain for CI. The six existing examples have updated toolchains/locks but were not individually rebuilt. Native evaluation of arbitrary imported projects may require their native libraries; declaration inspection does not.