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: builtin as_aux_lemma tactic and tree_tac simp attribute #6823

Merged
merged 10 commits into from
Feb 3, 2025

Conversation

datokrat
Copy link
Contributor

@datokrat datokrat commented Jan 28, 2025

This PR adds a builtin tactic and a builtin attribute that are required for the tree map. The tactic, as_aux_lemma, can generally be used to wrap the proof term generated by a tactic sequence into a separate auxiliary lemma in order to keep the proof term small. This can, in rare cases, be necessary if the proof term will appear multiple times in the encompassing term. The new attribute, Std.Internal.tree_tac, is internal and should not be used outside of Std.

@datokrat datokrat added the changelog-no Do not include this PR in the release changelog label Jan 28, 2025
@datokrat datokrat force-pushed the paul/treemap-bootstrapping branch from 700085c to 3234792 Compare January 28, 2025 17:22
@github-actions github-actions bot added changes-stage0 Contains stage0 changes, merge manually using rebase and removed changes-stage0 Contains stage0 changes, merge manually using rebase labels Jan 28, 2025
@datokrat
Copy link
Contributor Author

Is it correct that such a purely internal change should not be part of the changelog?

@nomeata
Copy link
Collaborator

nomeata commented Jan 28, 2025

Is there a reason why as_aux_lemma isn’t a generally useful tactic for our users? Then it’s changelog-language

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 28, 2025 17:43 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 28, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 28, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 28, 2025
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Jan 28, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jan 28, 2025

Mathlib CI status (docs):

  • ❌ Mathlib branch lean-pr-testing-6823 built against this PR, but testing failed. (2025-01-28 18:32:55) View Log
  • ❌ Mathlib branch lean-pr-testing-6823 built against this PR, but testing failed. (2025-01-29 08:40:30) View Log
  • ✅ Mathlib branch lean-pr-testing-6823 has successfully built against this PR. (2025-01-30 09:13:47) View Log
  • ✅ Mathlib branch lean-pr-testing-6823 has successfully built against this PR. (2025-01-30 10:23:12) View Log
  • 🟡 Mathlib branch lean-pr-testing-6823 build against this PR was cancelled. (2025-01-31 08:55:30) View Log
  • ✅ Mathlib branch lean-pr-testing-6823 has successfully built against this PR. (2025-01-31 09:42:55) View Log
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 832d7c500d709deb5e7f0a5a6fd0f01865d1a303 --onto d68c2ce28bc11ec0271a97aa7a7316905f15a484. (2025-02-03 08:08:41)

src/Lean/Elab/Tactic/AsAuxLemma.lean Outdated Show resolved Hide resolved
src/Lean/Elab/Tactic/AsAuxLemma.lean Outdated Show resolved Hide resolved
@datokrat
Copy link
Contributor Author

I'm not sure yet whether the

Is there a reason why as_aux_lemma isn’t a generally useful tactic for our users? Then it’s changelog-language

@nomeata The reason I was hesitating to think of this as a tactic used outside lean itself is because using as_aux_lemma seems more like a hack that we hopefully might not need anymore in the future. On the other hand, if we find it helpful right now, why not other people struggling with large proof terms, too? So I think I'll still keep the syntax protected, in order not to pollute the global namespace with obscure tactics, but add this to the language changelog.

@datokrat datokrat added changelog-language Language features, tactics, and metaprograms and removed changelog-no Do not include this PR in the release changelog labels Jan 29, 2025
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 29, 2025 07:45 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 29, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 29, 2025
@leanprover-community-bot leanprover-community-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 Jan 30, 2025
@datokrat datokrat marked this pull request as ready for review January 30, 2025 09:16
@datokrat datokrat requested a review from kim-em as a code owner January 30, 2025 09:16
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 30, 2025 09:28 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 30, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 30, 2025
src/Init/Tactics.lean Outdated Show resolved Hide resolved
src/Lean/Elab/Tactic/AsAuxLemma.lean Show resolved Hide resolved
src/Lean/Elab/Tactic/AsAuxLemma.lean Outdated Show resolved Hide resolved
@datokrat datokrat added the awaiting-author Waiting for PR author to address issues label Jan 31, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 31, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 31, 2025
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 31, 2025 08:44 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 31, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 31, 2025
@datokrat datokrat removed the awaiting-author Waiting for PR author to address issues label Feb 3, 2025
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc February 3, 2025 07:59 Inactive
@datokrat datokrat added this pull request to the merge queue Feb 3, 2025
Merged via the queue into master with commit 6e7b76c Feb 3, 2025
18 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 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.

4 participants