Skip to content

chore: unexpose public sections with no defs - #41564

Open
felixpernegger wants to merge 5 commits into
leanprover-community:masterfrom
felixpernegger:unusedexposed
Open

felixpernegger wants to merge 5 commits into
leanprover-community:masterfrom
felixpernegger:unusedexposed

Conversation

@felixpernegger

Copy link
Copy Markdown
Contributor

This PR remove @[expose] from public sections when there are no (irredcible_)def's inside the section anyways, so there is no reason to expose the section (does not make a difference).


Open in Gitpod

@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

PR summary a17b215f84

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit a17b215).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.

Decrease in weak tech debt: (relative, absolute) = (20.00, 0.00)
Current number Change Type (weak)
5138 -20 exposed public sections

Current commit a17b215f84
Reference commit 02a839bc62

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@themathqueen

Copy link
Copy Markdown
Member

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

@felixpernegger

Copy link
Copy Markdown
Contributor Author

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

I thought its discouraged since its tracked as weak tech debt?

@grunweg

grunweg commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

For files with definitions, I agree it's author's choice. I'm not so convinced for files without definitions...
but then files without definitions may gain some in the future. Hm.

@themathqueen

themathqueen commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

To be fair, most files with @[expose] public section were added when we transferred to the module system. So the authors didn't really have a say in it

So, I guess removing them is just as fair play? Maybe?

@felixpernegger

Copy link
Copy Markdown
Contributor Author

I guess the larger issue at hand why we have so many exposed public sections, is because in 95% of definitions in math you want to know whats underneath.

@JovanGerb

Copy link
Copy Markdown
Contributor

Thanks, I think this is a good change. Though it's a bit hard to verify that the PR does indeed not cause anything to be no_exposed

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 17, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 17, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 31, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 22, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 30, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 29, 2026

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

tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants