8000 feat: `let +generalize` by kmill · Pull Request #8935 · leanprover/lean4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: let +generalize #8935

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

Merged
merged 1 commit into from
Jun 23, 2025
Merged

feat: let +generalize #8935

merged 1 commit into from
Jun 23, 2025

Conversation

kmill
Copy link
Collaborator
@kmill kmill commented Jun 23, 2025

This PR adds the +generalize option to the let and have syntaxes. For example, have +generalize n := a + b; body replaces all instances of a + b in the expected type with n when elaborating body. This can be likened to a term version of the generalize tactic. One can combine this with eq in have +generalize (eq := h) n := a + b; body as an analogue of generalize h : n = a + b.

This PR adds the `+generalize` option to the `let` and `have` syntaxes. For example, `have +generalize n := a + b; body` replaces all instances of `a + b` in the expected type with `n` when elaborating `body`. This can be likened to a term version of the `generalize` tactic. One can combine this with `eq` in `have +generalize (eq := h) n := a + b; body` as an analogue to `generalize h : n = a + b`.
@kmill kmill added the changelog-language Language features, tactics, and metaprograms label Jun 23, 2025
@kmill kmill enabled auto-merge June 23, 2025 02:12
@kmill kmill added this pull request to the merge queue Jun 23, 2025
@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 Jun 23, 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 8f4b2909dec2762d44d87081c264d2bc49d91603 --onto db499e96aac8ad654c8ed5ab40c4e6885d38c9a1. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-23 02:39:13)

Merged via the queue into leanprover:master with commit 7b0a9bd Jun 23, 2025
19 checks passed
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
This PR adds the `+generalize` option to the `let` and `have` syntaxes.
For example, `have +generalize n := a + b; body` replaces all instances
of `a + b` in the expected type with `n` when elaborating `body`. This
can be likened to a term version of the `generalize` tactic. One can
combine this with `eq` in `have +generalize (eq := h) n := a + b; body`
as an analogue of `generalize h : n = a + b`.
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
0