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: add [grind ←=] attribute #6702

Merged
merged 1 commit into from
Jan 20, 2025
Merged

feat: add [grind ←=] attribute #6702

merged 1 commit into from
Jan 20, 2025

Conversation

leodemoura
Copy link
Member

This PR adds support for equality backward reasoning to grind. We can illustrate the new feature with the following example. Suppose we have a theorem:

theorem inv_eq {a b : α} (w : a * b = 1) : inv a = b

and we want to instantiate the theorem whenever we are tying to prove inv t = s for some terms t and s
The attribute [grind ←] is not applicable in this case because, by default, = is not eligible for E-matching. The new attribute [grind ←=] instructs grind to use the equality and consider disequalities in the grind proof state as candidates for E-matching.

This PR adds support for equality backward reasoning to `grind`.
We can illustrate the new feature with the following example. Suppose we have a theorem:
```lean
theorem inv_eq {a b : α} (w : a * b = 1) : inv a = b
```
and we want to instantiate the theorem whenever we are tying to prove
`inv t = s` for some terms `t` and `s`
The attribute `[grind ←]` is not applicable in this case because, by default,
`=` is not eligible for E-matching. The new attribute `[grind ←=]` instructs
`grind` to use the equality and consider disequalities in the `grind`
proof state as candidates for E-matching.
@leodemoura leodemoura added the changelog-language Language features, tactics, and metaprograms label Jan 20, 2025
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 20, 2025 00:14 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jan 20, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase a062eea204a9c982e318c0c98cd6af63e9f61050 --onto 74bd40d34d1a969da65007939960c2fefd461f08. (2025-01-20 00:29:10)

@leodemoura leodemoura added this pull request to the merge queue Jan 20, 2025
Merged via the queue into master with commit 9b7bd58 Jan 20, 2025
17 of 18 checks passed
luisacicolini pushed a commit to opencompl/lean4 that referenced this pull request Jan 21, 2025
This PR adds support for equality backward reasoning to `grind`. We can
illustrate the new feature with the following example. Suppose we have a
theorem:
```lean
theorem inv_eq {a b : α} (w : a * b = 1) : inv a = b
```
and we want to instantiate the theorem whenever we are tying to prove
`inv t = s` for some terms `t` and `s`
The attribute `[grind ←]` is not applicable in this case because, by
default, `=` is not eligible for E-matching. The new attribute `[grind
←=]` instructs `grind` to use the equality and consider disequalities in
the `grind` proof state as candidates for E-matching.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants