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

feat(Tactic): erw tries rw first and warns if that succeeds #17638

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Oct 18, 2024

  1. feat(Tactic): erw tries rw first and warns if that succeeds

    This PR adds a macro rule to the `erw` tactic that first tries `rw` at reducible transparency, and displays a "Try this:" if that succeeded. This should help us get rid of uselessly slow `erw`s.
    
    This is a relatively simple implementation that does not verify if `erw` and `rw` would have resulted in the same exact rewrite. So it is possible that `erw` and `rw` both succeed but rewrite different occurrences, and there would be a suggestion to replace `erw` with `rw` in that case. I think the complication of running both at the same time and checking the goal state afterwards doesn't weigh up to accepting that this happens and adding an explanation to the warning generated by `erw`.
    
    I import the `erw` extension in `Tactic.Common`: it might be nice to migrate this up even earlier in the import hierarchy but `Mathlib.Tactic.TryThis` is a somewhat heavy import to put in `Mathlib.Tactic.Core`.
    Vierkantor committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    109e158 View commit details
    Browse the repository at this point in the history
  2. Fixes from the erw linter

    Vierkantor committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    af3c28c View commit details
    Browse the repository at this point in the history