Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(Tactic/{Positivity,NormNum}): remove support for non-canonical spellings #10344

Closed
wants to merge 3 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Feb 7, 2024

Mul.mul or Nat.mul etc should not ever appear in a goal, so there is little reason for these tactics to support them.
If these are in your goal, then something has already gone wrong and norm_num isn't responsible for saving you; that's simp or dsimp's job.

Zulip thread


Open in Gitpod

…spellings

`Mul.mul` or `Nat.mul` etc should not ever appear in a goal, so these tactics should not support them.
@eric-wieser eric-wieser added WIP Work in progress t-meta Tactics, attributes or user commands awaiting-CI labels Feb 7, 2024
eric-wieser referenced this pull request Feb 8, 2024
Implements #1899!



Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 8, 2024
Comment on lines -524 to -535
section Transparency

example : Add.add 10 2 = 12 := by norm_num1
example : Nat.sub 10 1 = 9 := by norm_num1
example : Nat.mod 10 5 = 0 := by norm_num1
example : Sub.sub 10 1 = 9 := by norm_num1
example : Sub.sub 10 (-2) = 12 := by norm_num1
example : Mul.mul 10 1 = 10 := by norm_num1
example : (Div.div 10 1 : ℚ) = 10 := by norm_num1

end Transparency

Copy link
Member Author

Choose a reason for hiding this comment

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

These were added without explanation in 60790d4#r138404530

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have a feeling they came up during testing and they thought it'd just be easy to support them.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible that refactors elsewhere made this behavior no longer necessary

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 8, 2024
@ericrbg
Copy link
Collaborator

ericrbg commented Feb 8, 2024

I wonder if some of what I'm doing in #10293 counts for this.

@eric-wieser eric-wieser added awaiting-review t-algebra Algebra (groups, rings, fields etc) t-order Order theory and removed WIP Work in progress labels Feb 8, 2024
Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

The fact that everything still builds after this change shows we don't need the looser matching functionality. I only added the Mod.mod and Int.emod matching to the evalIntMod functionality because I cargo-culted this together. So I am a bit hesitant of breaking usage downstream, but in summary I think this is the right way to go.

bors r+

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Feb 12, 2024
@eric-wieser
Copy link
Member Author

The fact that everything still builds after this change shows we don't need the looser matching functionality. I only added the Mod.mod and Int.emod matching to the evalIntMod functionality because I cargo-culted this together. So I am a bit hesitant of breaking usage downstream, but in summary I think this is the right way to go.

bors r+

Note that I left Int.emod and similar behind, as there is possibility for contention there over which operator is "the" modulus operator; downstream code might genuinely use those prefixed definitions to avoid ambiguity.

@Vierkantor
Copy link
Contributor

Indeed, I recall the dispute between mathlib and core lean about dividing by negative numbers :)

mathlib-bors bot pushed a commit that referenced this pull request Feb 12, 2024
…spellings (#10344)

`Mul.mul` or `Nat.mul` etc should not ever appear in a goal, so there is little reason for these tactics to support them.
If these are in your goal, then something has already gone wrong and `norm_num` isn't responsible for saving you; that's `simp` or `dsimp`'s job.


[Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2310344.20removing.20norm_num.20support.20for.20Nat.2Esub.2C.20Sub.2Esub.2C.20etc/near/420507739)
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 12, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Tactic/{Positivity,NormNum}): remove support for non-canonical spellings [Merged by Bors] - chore(Tactic/{Positivity,NormNum}): remove support for non-canonical spellings Feb 12, 2024
@mathlib-bors mathlib-bors bot closed this Feb 12, 2024
@mathlib-bors mathlib-bors bot deleted the eric-wieser/positivity-no-unfolding branch February 12, 2024 11:39
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…spellings (#10344)

`Mul.mul` or `Nat.mul` etc should not ever appear in a goal, so there is little reason for these tactics to support them.
If these are in your goal, then something has already gone wrong and `norm_num` isn't responsible for saving you; that's `simp` or `dsimp`'s job.


[Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2310344.20removing.20norm_num.20support.20for.20Nat.2Esub.2C.20Sub.2Esub.2C.20etc/near/420507739)
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-algebra Algebra (groups, rings, fields etc) t-meta Tactics, attributes or user commands t-order Order theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants