Zulip Chat Archive
Stream: mathlib4
Topic: Removing unnecessary `@[expose]`
Kim Morrison (Jan 05 2026 at 03:25):
When we switched Mathlib to the module system, we added @[expose] public section at the top of every file.
These PRs remove the @[expose] from those files without defs or instances:
Yury G. Kudryashov (Jan 05 2026 at 03:47):
I think that we can also remove @[expose] from files with Prop-valued instances only, right?
Yury G. Kudryashov (Jan 05 2026 at 03:48):
BTW, did Claude prepare the whole PRs, or did it write a metaprogram that identifies these files?
Yury G. Kudryashov (Jan 05 2026 at 03:51):
Let me post numbers in separate messages, so that we can see the status here.
Yury G. Kudryashov (Jan 05 2026 at 03:51):
Analysis/Calculus #33565
Yury G. Kudryashov (Jan 05 2026 at 03:51):
Analysis/SpecialFunctions #33567
Yury G. Kudryashov (Jan 05 2026 at 03:51):
Analysis/Normed #33568
Yury G. Kudryashov (Jan 05 2026 at 03:51):
Analysis/Complex #33569
Yury G. Kudryashov (Jan 05 2026 at 03:52):
Algebra/Order #33570
Yury G. Kudryashov (Jan 05 2026 at 03:52):
Algebra/Group #33571
Yury G. Kudryashov (Jan 05 2026 at 03:52):
Algebra/rest #33572
Yury G. Kudryashov (Jan 05 2026 at 03:52):
RingTheory #33573
Yury G. Kudryashov (Jan 05 2026 at 03:52):
Data #33574
Yury G. Kudryashov (Jan 05 2026 at 03:52):
Topology #33575
Yury G. Kudryashov (Jan 05 2026 at 03:52):
MeasureTheory #33576
Yury G. Kudryashov (Jan 05 2026 at 03:53):
CategoryTheory #33577
Yury G. Kudryashov (Jan 05 2026 at 03:53):
NumberTheory #33578
Yury G. Kudryashov (Jan 05 2026 at 03:53):
LinearAlgebra+Order #33579
Yury G. Kudryashov (Jan 05 2026 at 03:53):
Probability+Geometry #33580
Yury G. Kudryashov (Jan 05 2026 at 03:53):
Misc #33581
Yury G. Kudryashov (Jan 05 2026 at 03:55):
At least some of these PRs fail CI
Yury G. Kudryashov (Jan 05 2026 at 03:55):
E.g., the measure theory one.
Kim Morrison (Jan 05 2026 at 04:54):
Yury G. Kudryashov said:
BTW, did Claude prepare the whole PRs, or did it write a metaprogram that identifies these files?
It wrote a script (just some grepping, no Lean metaprogramming)
Kim Morrison (Jan 05 2026 at 08:40):
The remaining PRs all pass CI.
Yaël Dillies (Jan 05 2026 at 08:42):
Yury G. Kudryashov said:
I think that we can also remove
@[expose]from files withProp-valued instances only, right?
I can't find the info in the reference manual anymore (looks like the module system section has been entirely reworked), but I thought instances always exposed their body?
Johan Commelin (Jan 05 2026 at 08:55):
I'm running
$ git diff --word-diff upstream/master... | rg "\[[-+]" | rg -v "^\[-@\[expose\]-\]public section$"
on these locally, to double check that Claude has not been naughty.
Last updated: Feb 28 2026 at 14:05 UTC