Skip to content

[Merged by Bors] - chore: Remove nonterminal simp at#7795

Closed
BoltonBailey wants to merge 34 commits intomasterfrom
BoltonBailey/nonterminal-simp-at-removal-squad
Closed

[Merged by Bors] - chore: Remove nonterminal simp at#7795
BoltonBailey wants to merge 34 commits intomasterfrom
BoltonBailey/nonterminal-simp-at-removal-squad

Conversation

@BoltonBailey
Copy link
Copy Markdown
Collaborator

@BoltonBailey BoltonBailey commented Oct 20, 2023

Removes nonterminal uses of simp at. Replaces most of these with instances of simp? ... says.


Open in Gitpod

@digama0
Copy link
Copy Markdown
Member

digama0 commented Oct 21, 2023

Note: I have pushed an update to the lean toolchain because this PR was on a buggy version of the toolchain. WARNING: checking out old commits of this PR using v4.2.0-rc2 or v4.2.0-rc3 can cause lake clean to delete your mathlib folder! If you need to do so, make sure to delete lakefile.olean manually before running any lake commands.

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

I'm not sure what the value of such a PR is. On one hand, you make the proofs less likely to break due to the addition of a lemma in the simp set. On the other hand, proofs now refer explicitly to more lemmas that are susceptible to change in ways that a fancy tactic call wouldn't have noticed.

@BoltonBailey
Copy link
Copy Markdown
Collaborator Author

I'm not sure what the value of such a PR is. On one hand, you make the proofs less likely to break due to the addition of a lemma in the simp set. On the other hand, proofs now refer explicitly to more lemmas that are susceptible to change in ways that a fancy tactic call wouldn't have noticed.

I am sympathetic to this argument. However, I think most maintainers are on the side of "nonterminal simps are bad". I have gotten reviews before telling me to remove nonterminal simps. The point of this PR is to make way for #7496 so that reviewers hopefully don't have to do this as often.

I will revert the things you suggest and also make the style PR more lax so that they don't conflict.

@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Dec 14, 2023
@BoltonBailey BoltonBailey added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Dec 14, 2023
@YaelDillies YaelDillies changed the title chore: nonterminal simp at removal chore: Remove nonterminal simp at Dec 14, 2023
@BoltonBailey
Copy link
Copy Markdown
Collaborator Author

BoltonBailey commented Dec 14, 2023

Not sure what this error means.

Error: ./././Mathlib/Algebra/FreeAlgebra.lean:577:2: error: Failed to parse tactic output: simp only [AlgHom.ext_iff, AlgHom.coe_id, id_eq, AlgHom.coe_comp, Subalgebra.coe_val, Function.comp_apply] at
of_id 

What I currently have is

  simp? [AlgHom.ext_iff] at of_id says
    simp only [AlgHom.ext_iff, AlgHom.coe_id, id_eq, AlgHom.coe_comp, Subalgebra.coe_val,
      Function.comp_apply] at of_id

Annoyingly, my file builds this just fine in the IDE, but CI is saying it's broken. If I delete what's after the says

  simp? [AlgHom.ext_iff] at of_id says

Then the IDE gives the suggestion, but also the same error as CI.

  simp? [AlgHom.ext_iff] at of_id

Is fine, but not what I am trying to do.

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 14, 2023

You should be able to reproduce the additional testing that says does in CI using lake build -KCI Mathlib.X.Y.Z. Or put set_option says.verify true in the failing files.

I've improved the error message in CI in #9061.

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Dec 14, 2023

I merged master, and then looked at the first two errors: both were resolved by replacing the current RHS with what says is now suggesting.

I'll hand it back over to you to look at the remainder?

@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Dec 15, 2023
@joelriou
Copy link
Copy Markdown
Contributor

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Dec 16, 2023
mathlib-bors bot pushed a commit that referenced this pull request Dec 16, 2023
Removes nonterminal uses of `simp at`. Replaces most of these with instances of `simp? ... says`.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Dec 16, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: Remove nonterminal simp at [Merged by Bors] - chore: Remove nonterminal simp at Dec 16, 2023
@mathlib-bors mathlib-bors bot closed this Dec 16, 2023
@mathlib-bors mathlib-bors bot deleted the BoltonBailey/nonterminal-simp-at-removal-squad branch December 16, 2023 09:58
JADekker added a commit that referenced this pull request Dec 16, 2023
Removes nonterminal uses of `simp at`. Replaces most of these with instances of `simp? ... says`.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
awueth pushed a commit that referenced this pull request Dec 19, 2023
Removes nonterminal uses of `simp at`. Replaces most of these with instances of `simp? ... says`.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants