Skip to content

[Merged by Bors] - chore(ContDiffSupportedIn): use simps to auto-generate basic API - #30659

Closed
grunweg wants to merge 1 commit into
leanprover-community:masterfrom
grunweg:simps-followup
Closed

grunweg wants to merge 1 commit into
leanprover-community:masterfrom
grunweg:simps-followup

Conversation

@grunweg

@grunweg grunweg commented Oct 18, 2025 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the t-analysis Analysis (normed *, calculus) label Oct 18, 2025
@github-actions

github-actions Bot commented Oct 18, 2025 •

Copy link
Copy Markdown

PR summary 3666308594

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Simps.coe
- Simps.apply
- coe_add
- coe_neg
- coe_smul
- coe_sub
- coe_zero

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

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

@fpvandoorn fpvandoorn added the WIP Work in progress label Oct 19, 2025
@grunweg

grunweg commented Oct 19, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the help! I had not realised that we usually want either the coe or the apply lemma. Is there a general mathlib rule about which one we prefer?

If I had to make one up, I'd say "when you're fine with either, go for coe" on the grounds that

  • replacing the function itself is more powerful, so yields an even simpler result in general
  • in some cases, you want to leave the function untouched (so other simp lemmas could apply) --- but still want to simplify an application of the function, in that case use apply

How close is this to the mathlib conventions? (Where would I search for them, if this is documented anywhere?)

@grunweg

grunweg commented Oct 19, 2025 •

Copy link
Copy Markdown
Contributor Author

I can certainly ask on zulip, if this question is complicated/has a long history.
(Loogling for similar examples, there is certainly not an utterly obvious picture to me.)

@fpvandoorn

Copy link
Copy Markdown
Member

Yeah, I think that different conventions are used in different parts of the library. In some cases these differences might actually make sense: maybe in some part of the library you work with the unapplied functions a lot more. But in many cases I think it's mostly arbitrary which one we use.

I agree with the rule "when you're fine with either, go for coe".

@grunweg grunweg changed the title POC: simps question about #30198 chore(ContDiffSupportedIn): use simps to auto-generate basic API Oct 30, 2025
@grunweg grunweg removed the WIP Work in progress label Oct 30, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Oct 30, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Oct 30, 2025
@mathlib4-dependent-issues-bot

Copy link
Copy Markdown

@grunweg
grunweg requested a review from fpvandoorn October 30, 2025 21:48
@fpvandoorn

Copy link
Copy Markdown
Member

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Oct 31, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Oct 31, 2025
@mathlib-bors

mathlib-bors Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(ContDiffSupportedIn): use simps to auto-generate basic API [Merged by Bors] - chore(ContDiffSupportedIn): use simps to auto-generate basic API Oct 31, 2025
@mathlib-bors mathlib-bors Bot closed this Oct 31, 2025
@grunweg
grunweg deleted the simps-followup branch October 31, 2025 16:12
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-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants