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: better support for inductive predicates in grind #6854

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

leodemoura
Copy link
Member

This PR adds a convenience for inductive predicates in grind. Now, give an inductive predicate C, grind [C] marks C terms as case-split candidates and C constructors as E-matching theorems. Here is an example:

example {B S T s t} (hcond : B s) : (ifThenElse B S T, s) ==> t → (S, s) ==> t := by
  grind [BigStep]

Users can still use grind [cases BigStep] to only mark C as a case split candidate.

@leodemoura leodemoura added the changelog-language Language features, tactics, and metaprograms label Jan 29, 2025
@leodemoura leodemoura requested a review from kim-em as a code owner January 29, 2025 16:50
@leodemoura leodemoura enabled auto-merge January 29, 2025 16:50
@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 29, 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 2c00f8fe2fc530962afe1eba2b16933a801c67b5 --onto 20c616503abe5ce4253c56dbcd7766a91c675ba0. (2025-01-29 17:13:24)

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 29, 2025 18:07 Inactive
@leodemoura leodemoura added this pull request to the merge queue Jan 29, 2025
Merged via the queue into master with commit 5075153 Jan 29, 2025
15 checks passed
luisacicolini pushed a commit to opencompl/lean4 that referenced this pull request Feb 24, 2025
…6854)

This PR adds a convenience for inductive predicates in `grind`. Now,
give an inductive predicate `C`, `grind [C]` marks `C` terms as
case-split candidates **and** `C` constructors as E-matching theorems.
Here is an example:
```lean
example {B S T s t} (hcond : B s) : (ifThenElse B S T, s) ==> t → (S, s) ==> t := by
  grind [BigStep]
```
Users can still use `grind [cases BigStep]` to only mark `C` as a case
split candidate.
luisacicolini pushed a commit to opencompl/lean4 that referenced this pull request Feb 25, 2025
…6854)

This PR adds a convenience for inductive predicates in `grind`. Now,
give an inductive predicate `C`, `grind [C]` marks `C` terms as
case-split candidates **and** `C` constructors as E-matching theorems.
Here is an example:
```lean
example {B S T s t} (hcond : B s) : (ifThenElse B S T, s) ==> t → (S, s) ==> t := by
  grind [BigStep]
```
Users can still use `grind [cases BigStep]` to only mark `C` as a case
split candidate.
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