Private proof materializes a public equation theorem
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
A case where changing only the proof of a private theorem changes the exported .olean.
Context
Steps to Reproduce
module
@[expose] public def f : Nat → Nat
| n => n
-- version 1
private theorem privateProof : f 0 = 0 := by rfl
-- version 2
private theorem privateProof : f 0 = 0 := by simp [f]
Expected behavior: [Clear and concise description of what you expect to happen]
Two versions give the same .olean file.
Actual behavior: [Clear and concise description of what actually happens]
The generated .olean files are different.
Versions
Tested on Lean 4.35.0-nightly-2026-09-01 and Lean 4.33.1.
Additional Information
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal Lean reproducer in the issue and compare the generated .olean files for the two private theorem proofs. Trace how the public equation theorem is materialized during compilation; done when changing only that private proof produces identical exported .olean files.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100