Repository navigation
Conversation
PR summary ca31f024eeImport changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diffNo declarations were harmed in the making of this PR! 🐙 You can run this locally as follows## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.This script lives in the
|
|
The last commit was generated with |
|
!bench |
|
Benchmark results for c584f13 against ca31f02 are in. No significant results found. @grunweg
Small changes (2✅)
|
|
The last commit adds another batch, auto-generated in the following way.
|
|
!bench |
|
Benchmark results for c584f13 against ca31f02 are in. (These commits have already been benchmarked in a previous command.) No significant results found. @jcommelin
Small changes (2✅)
|
|
What's the benefit of doing this? |
|
My understanding is that
I have added the essence of the above to the PR description. |
I think this PR in some sense doesn't do anything, because since no def was there none could be exposed (this also why there is zero change in the build time). I think I tend to agree with the idea that definitions should not be exposed by default (hence files shouldn't start with the expose attribute on a section) and should have a well defined interface (in that file) that restricts what we can do with that object. |
|
Closing: merged with #38480. |
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Inverse of `privateModule` linter: detects modules where `@[expose] public section` is superfluous because no decl in the file would benefit from exposure downstream. Suggested by PR leanprover-community#38477 as the long-term mechanism to prevent regressions of the kind that leanprover-community#38480 and related PRs cleaned up manually. A decl 'benefits from exposure' iff it's a public, non-internal `def` or `inductive` that is: - not private / reserved / internal-detail-named, - not an auxiliary recursor / projection / matcher, - not a notation/syntax-generated name, - not a meta-namespace declaration, - not an instance (incl. local/scoped/auto-named), - not an abbrev / @[irreducible] / @[implicit_reducible]... wait, implicit_reducible DOES benefit, - not a structure/class (those go through `inductInfo` but have special projection handling). Includes 11 test files covering positive (theorem-only, class-only, abbrev-only, irreducible-def-only, local-instance, scoped-instance, notation, recursors) and negative (plain def, to_additive-derived, inductive) cases. Known limitations the linter currently misses (would block in error): - Tactic macros from `scoped macro (name := X) ...` - `simproc_decl` (creates def whose body is a simprocedure) - `alias`es with non-trivial bodies (technically real defs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
All these files contain no single definition or instance: similar to #33581 and friends.
During mathlib's migration to the module system,
@[expose] public sectionwas added at the beginningof each file. In the medium-term, we would like to be more conscious about mathlib's use of the module
system. This PR helps by clarifying how many definitions' status need to actually be checked.
Zulip thread
A future PR may make the
privateModulelinter also lint about files with@[expose] sectionand no definitions; this would avoid regressions.