Repository navigation
chore: rename notation3 to notation +delab - #45028
YaelDillies wants to merge 10 commits into
Conversation
This makes it extremely clear what `notation3` does on top of `notation`. For notations with precedence, the precedence comes before the `+delab`, e.g. `notation:25 +delab ...`. This rename isn't completely true to the purpose of the elaborator, which is instead to provide Lean 3's `notation` features. Indeed, `notation3` currently has a `(prettyPrint := false)` flag when a delaborator cannot/shouldn't be generated. I am removing this flag because `notation +delab (prettyPrint := false)` would read very weird: "Please generate a delaborator, but don't pretty-print!". Only three notations in mathlib used this flag, namely average notation `⨍⁻ x in s, f`, lexicographic pi type notation `Πₗ (i : ℕ), β i`, and cycle notation `c[...]`. The first two couldn't have a delaborator generated due to errors in the provided expansion. I have fixed them and removed the flag. The last one cannot have a a delaborator generated due to the use of `by decide` in the expansion. Although `notation +delab` could be fixed to generate a delaborator in this case even, I think it is reasonable to say that this rare use-case is unsupported. I have switched the notation to use `macro` directly instead. I am performing a few auxiliary changes too: * Update the docstring of `notation +delab` to clarify that it is not deprecated anymore. * Add a missing space in the `notation +delab` notation, so that `polishPP` needn't add it after the fact. * Rename the file from `Util.Notation3` to `Util.NotationDelab`. * Rename the trace option from `trace.otation3` to `trace.notationDelab`. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/345428-mathlib-reviewers/topic/status.20of.20.60notation3.60) Generated by Claude Sonnet/Opus in ~10 prompts, then reviewed line-by-line by myself. Assisted-by: Claude Sonnet 5.5, Claude Opus 5.5
PR summary 1eb6145069Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (strong) |
|---|---|---|
| 197 | -3 | documentation nolints entries |
Current commit 1eb6145069
Reference commit 1ebec2bd36
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
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
note: file MathlibTest/Linter/PrivateModule/Notation3.lean was removed.
Please create a follow-up pull request adding a module deprecation. Thanks!
note: file MathlibTest/Util/Notation3.lean` was renamed to `MathlibTest/Util/NotationDelab.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!
note: file Mathlib/Util/Notation3.lean` was renamed to `Mathlib/Util/NotationDelab.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!
|
This pull request has conflicts, please merge |
|
This PR/issue depends on:
|
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
Eric's confusion was clarified in the reviewer stream: |
This makes it extremely clear what
notation3does on top ofnotation.For notations with precedence, the precedence comes before the
+delab, e.g.notation:25 +delab ....This rename isn't completely true to the purpose of the elaborator, which is instead to provide Lean 3's
notationfeatures. Indeed,notation3currently has a(prettyPrint := false)flag when a delaborator cannot/shouldn't be generated. I am removing this flag becausenotation +delab (prettyPrint := false)would read very weird: "Please generate a delaborator, but don't pretty-print!". Only one notation in mathlib uses this flag, namely cycle notationc[...]. It cannot have a delaborator generated due to the use ofby decidein the expansion. Althoughnotation +delabcould be fixed to generate a delaborator in this case even (see #45042), I think it is reasonable to say that this rare use-case is unsupported.I am performing a few auxiliary changes too:
notation +delabto clarify that it is not deprecated anymore.notation +delabnotation, so thatpolishPPneedn't add it after the fact.Util.Notation3toUtil.NotationDelab.trace.notation3totrace.notationDelab.Zulip discussion
Generated by Claude Sonnet/Opus in ~10 prompts, then reviewed line-by-line by myself and hand-edited a bit further.
Assisted-by: Claude Sonnet 5.5, Claude Opus 5.5
notation3#45041