Skip to content

Bump Lean toolchain v4.29.1 -> v4.34.1 - #14

Open
kiranandcode wants to merge 3 commits into
mainfrom
bump-lean-v4.34.1
Open

kiranandcode wants to merge 3 commits into
mainfrom
bump-lean-v4.34.1

Conversation

@kiranandcode

Copy link
Copy Markdown
Collaborator

Bumps lean.py to Lean v4.34.1, the latest stable release.

Dependencies

  • lean-toolchain → leanprover/lean4:v4.34.1 in the root, tests/lean and all six examples/*/lean projects (manifests refreshed).
  • Regex v4.29.0 → v4.34.0-rc1 (its newest tag; no stable v4.34 tag yet).
  • Pantograph dev → 92d4818. Upstream targets Lean v4.33.1 but compiles cleanly on 4.34.1.

Fixes for 4.34 breakage

The C bridge and Python bindings needed no changes. No public Python API changed.

  1. Kernel.declAxioms: CollectAxioms.collect is now private, so this uses the public Lean.collectAxioms. Output is unchanged.
  2. Kernel.envUnpickle / goalUnpickle: withImporting now clears the initializer-execution flag after each import, so unpickling (which re-imports) failed. Both now call enableInitializersExecution first.
  3. Z3.lean datatypes: inductives must be compiled before mkCtorIdx etc., so compileDecls #[tName] now runs after addDecl, matching Lean's own inductive elaborator.

Verification (macOS, local)

  • lake build (root) and lake build TestLib:shared pass; examples 01 and 02 build.
  • pytest tests: 1325 passed, 0 skipped (with sympy and numpy installed).
  • ruff format --check, ruff check, mypy lean_py/ clean.
  • tests/leaks_check.sh: 0 leaks.

Not run locally: the Linux CI jobs (including valgrind), and builds of examples 03 to 06.

Known gap (not fixed here)

ManagedProject pins batteries/aesop/mathlib to the exact toolchain tag. mathlib has v4.34.1; batteries and aesop only have v4.34.0.

🤖 Generated with Claude Code

kiranandcode and others added 3 commits August 10, 2026 18:40
- 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>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 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>

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