Skip to content

chore: use scoped omit commands - #45016

Open
kim-em wants to merge 7 commits into
leanprover-community:masterfrom
kim-em:cleanup-plain-omit
Open

kim-em wants to merge 7 commits into
leanprover-community:masterfrom
kim-em:cleanup-plain-omit

Conversation

@kim-em

@kim-em kim-em commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Replace the 51 persistent omit commands in 45 Mathlib files, plus the remaining occurrence in Archive, with omit ... in on individual declarations. One ineffective omission immediately before end is deleted.

Declaration order, proofs, and variables are unchanged. Redundant section wrappers are removed. Per-declaration option settings retain their scope, and local wrappers preserve explicitly named measurable spaces and intended instance parameters where needed.

This is the cleanup prerequisite for the linter proposal. The policy remains under discussion, including an exception for plain omit at the beginning of a section or namespace. Please wait for that discussion to converge before merging.

The omit ... in section grouping has been removed: this syntax relies on surprising scope behaviour and fails with named sections. The library sources are exactly the same as the previously validated per-declaration version at 252adfe7222.


Validation of that version: all 45 affected Mathlib modules and their dependencies build successfully (8,246 jobs), and all 5,214 compiled declaration-type fingerprints match the baseline, including implicit parameter order. Proofs and declaration order are unchanged. Text-style lint and git diff --check pass. The restored version also rebuilds successfully (8,246 jobs); full downstream checks remain for CI.

🤖 prepared with Codex

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR summary a90cb660da

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 a90cb66).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit a90cb660da
Reference commit 5b040b83e2

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).

@kim-em

kim-em commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar

leanprover-radar commented Oct 19, 2026 •

Copy link
Copy Markdown

Benchmark results for b1e3067 against 5b040b8 are in. No significant results found. @kim-em

  • 🟥 build//instructions: +3.5G (+0.00%)

Small changes (2✅, 16🟥)

  • ✅ build/module/Mathlib.Algebra.Category.Grp.Biproducts//instructions: -18.0M (-0.35%)
  • 🟥 build/module/Mathlib.Algebra.Order.BigOperators.GroupWithZero.List//instructions: +13.4M (+0.44%)
  • 🟥 build/module/Mathlib.Algebra.Order.BigOperators.GroupWithZero.Multiset//instructions: +13.0M (+0.43%)
  • 🟥 build/module/Mathlib.CategoryTheory.Monoidal.DayConvolution//instructions: +326.6M (+0.31%)
  • 🟥 build/module/Mathlib.CategoryTheory.Triangulated.Pretriangulated//instructions: +67.4M (+0.28%)
  • 🟥 build/module/Mathlib.Combinatorics.SimpleGraph.Finite//instructions: +94.6M (+0.47%)
  • 🟥 build/module/Mathlib.Data.Opposite//instructions: +7.8M (+0.67%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Mathlib.LinearAlgebra.AffineSpace.Ordered//instructions: +120.9M (+0.68%)
  • 🟥 build/module/Mathlib.LinearAlgebra.RootSystem.Chain//instructions: +399.9M (+1.30%) (reduced significance based on *//lines)
  • 🟥 build/module/Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations//instructions: +96.9M (+0.21%)
  • 🟥 build/module/Mathlib.LinearAlgebra.RootSystem.Reduced//instructions: +253.3M (+1.85%) (reduced significance based on *//lines)
  • 🟥 build/module/Mathlib.RingTheory.Algebraic.Basic//instructions: +658.4M (+2.58%) (reduced significance based on *//lines)
  • 🟥 build/module/Mathlib.RingTheory.AlgebraicIndependent.AlgebraicClosure//instructions: +93.1M (+0.56%)
  • 🟥 build/module/Mathlib.RingTheory.IntegralClosure.IntegralRestrict//instructions: +258.1M (+0.35%)
  • 🟥 build/module/Mathlib.RingTheory.LocalRing.ResidueField.Basic//instructions: +167.4M (+1.24%)
  • 🟥 build/module/Mathlib.RingTheory.TensorProduct.MonoidAlgebra//instructions: +82.6M (+0.39%)
  • ✅ build/module/Mathlib.Tactic.Linarith.Oracle.SimplexAlgorithm.PositiveVector//instructions: -18.3M (-0.94%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Mathlib.Topology.Algebra.Group.Matrix//instructions: +44.9M (+0.56%)

@kim-em
kim-em marked this pull request as ready for review October 19, 2026 03:56
@@ -183,12 +183,11 @@ attribute [aesop safe forward (rule_sets := [CStarAlgebra])] PosDef.isStrictlyPo

section kronecker

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example of the kind of situation where I think scope-initial omit should be allowed – I think the proposed change here is slightly regressive, making the code epsilon harder to read than it was before.


end IsCyclotomicExtension

section CyclotomicField

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? This seems unintentional.

(hf.isQuotientCoveringMap_of_properlyDiscontinuousSMul hfG).isLocalHomeomorph

omit hf hfG
omit hf hfG in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's been discussion on Zulip about using omit ... in section at all. Let's wait for that to converge first.

@grunweg

grunweg commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

I like the general idea, but a few details need to be discussed further. (One example: do we want omit ... in section at all?) Let's wait for the Zulip thread https://leanprover.zulipchat.com/#narrow/channel/345428-mathlib-reviewers/topic/proposal.3A.20lint.20against.20.60omit.20.2E.2E.2E.60.2C.20requiring.20.60omit.20.2E.2E.2E.20in.60/with/632941751 to converge first.

@grunweg grunweg added the awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there label Oct 19, 2026
@grunweg grunweg added LLM-generated PRs with substantial input from LLMs - review accordingly awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Oct 26, 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 Oct 26, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

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

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there LLM-generated PRs with substantial input from LLMs - review accordingly merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants