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: generate f.eq_unfold lemmas #5141

Merged
merged 5 commits into from
Aug 29, 2024
Merged

feat: generate f.eq_unfold lemmas #5141

merged 5 commits into from
Aug 29, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Aug 23, 2024

With this, lean produces the following zoo of rewrite rules:

Option.map.eq_1      : Option.map f none = none
Option.map.eq_2      : Option.map f (some x) = some (f x)
Option.map.eq_def    : Option.map f p = match o with | none => none | (some x) => some (f x)
Option.map.eq_unfold : Option.map = fun f p => match o with | none => none | (some x) => some (f x)

The f.eq_unfold variant is especially useful to rewrite with rw under
binders.

This implements and fixes #5110

With this, lean produces the following zoo of rewrite rules:
```
Option.map.eq_1   : Option.map f none = none
Option.map.eq_2   : Option.map f (some x) = some (f x)
Option.map.eq_def : Option.map f p = match o with | none => none | (some x) => some (f x)
Option.map.unfold : Option.map = fun f p => match o with | none => none | (some x) => some (f x)
```

The `f.unfold` variant is especially useful to rewrite with `rw` under
binders.

This implements and fixes #5110
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc August 23, 2024 08:44 Inactive
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc August 23, 2024 08:56 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 Aug 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Aug 23, 2024

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2024-08-23 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. (2024-08-23 09:11:05)
  • 💥 Mathlib branch lean-pr-testing-5141 build failed against this PR. (2024-08-24 10:47:27) View Log
  • ✅ Mathlib branch lean-pr-testing-5141 has successfully built against this PR. (2024-08-25 16:32:00) View Log

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Aug 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Aug 24, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc August 24, 2024 10:44 Inactive
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Aug 24, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc August 25, 2024 15:30 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Aug 25, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Aug 25, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Aug 25, 2024
@nomeata nomeata changed the title feat: generate f.unfold lemmas feat: generate f.eq_unfold lemmas Aug 26, 2024
@nomeata nomeata marked this pull request as ready for review August 26, 2024 07:47
@nomeata nomeata added this pull request to the merge queue Aug 29, 2024
Merged via the queue into master with commit a993934 Aug 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR 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.

RFC: f.eq_unfold lemmas
2 participants