Skip to content

[Merged by Bors] - feat: add dsimp% elaborator#36043

Closed
robin-carlier wants to merge 10 commits intoleanprover-community:masterfrom
robin-carlier:dsimp_percent
Closed

[Merged by Bors] - feat: add dsimp% elaborator#36043
robin-carlier wants to merge 10 commits intoleanprover-community:masterfrom
robin-carlier:dsimp_percent

Conversation

@robin-carlier
Copy link
Copy Markdown
Contributor

@robin-carlier robin-carlier commented Mar 3, 2026

This PR adds a dsimp% elaborators that puts a given term in dsimp-normal form. This is useful as a way to avoid the
have foo := …; dsimp at foo; rw [foo] pattern.

From SymmMonCoherence


The main possible extension for this (of which I would be grateful to have some level of help in doing) would be to also add a syntax for dsimp% […] to also specify some dsimprocs that should be dsimped in the dsimp call. Now done, thanks a lot @JovanGerb !

Open in Gitpod

@robin-carlier robin-carlier added the t-meta Tactics, attributes or user commands label Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

PR summary 32af1e5dd5

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Tactic.Common 247 249 +2 (+0.81%)
Mathlib.Tactic 2972 2974 +2 (+0.07%)
Import changes for all files
Files Import difference
There are 6716 files with changed transitive imports taking up over 298525 characters: this is too many to display!
You can run ci-tools/scripts/pr_summary/import_trans_difference.sh all locally to see the whole output.

Declarations diff

+ dsimpPercentElaborator
+ f
+ f_apply
+ g
+ g_apply

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 scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh 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).

@JovanGerb
Copy link
Copy Markdown
Contributor

JovanGerb commented Mar 4, 2026

Oh and maybe capitalize the S in the file names: DSimpPercent.

@JovanGerb
Copy link
Copy Markdown
Contributor

You can import this in Mathlib.Tactic.Common, so that it will be available in most places in mathlib.

@JovanGerb
Copy link
Copy Markdown
Contributor

Thanks!

maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

🚀 Pull request has been placed on the maintainer queue by JovanGerb.

@mathlib-triage mathlib-triage bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Mar 4, 2026
@joelriou
Copy link
Copy Markdown
Contributor

joelriou commented Mar 5, 2026

Thanks!

bors merge

@mathlib-triage mathlib-triage bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Mar 5, 2026
mathlib-bors bot pushed a commit that referenced this pull request Mar 5, 2026
This PR adds a `dsimp%` elaborators that puts a given term in `dsimp`-normal form. This is useful as a way to avoid the
`have foo := …; dsimp at foo; rw [foo]` pattern.

From [SymmMonCoherence](https://github.com/robin-carlier/SymmMonCoherence)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 5, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add dsimp% elaborator [Merged by Bors] - feat: add dsimp% elaborator Mar 5, 2026
@mathlib-bors mathlib-bors bot closed this Mar 5, 2026
seewoo5 pushed a commit to seewoo5/mathlib4 that referenced this pull request Mar 9, 2026
This PR adds a `dsimp%` elaborators that puts a given term in `dsimp`-normal form. This is useful as a way to avoid the
`have foo := …; dsimp at foo; rw [foo]` pattern.

From [SymmMonCoherence](https://github.com/robin-carlier/SymmMonCoherence)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request Mar 10, 2026
This PR adds a `dsimp%` elaborators that puts a given term in `dsimp`-normal form. This is useful as a way to avoid the
`have foo := …; dsimp at foo; rw [foo]` pattern.

From [SymmMonCoherence](https://github.com/robin-carlier/SymmMonCoherence)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants