Skip to content

fix: rcases: avoid inflating case names with single constructor names#9918

Merged
nomeata merged 1 commit intomasterfrom
joachim/issue6550
Aug 26, 2025
Merged

fix: rcases: avoid inflating case names with single constructor names#9918
nomeata merged 1 commit intomasterfrom
joachim/issue6550

Conversation

@nomeata
Copy link
Copy Markdown
Collaborator

@nomeata nomeata commented Aug 14, 2025

This PR prevents rcases and obtain from creating absurdly long case tag names when taking single constructor types (like Exists) apart. Fixes #6550

The change does not affect cases and induction, it seems (where the user might be surprised to not address the single goal with a name), because I make the change in Lean/Meta/Tactic/Induction.lean, not Lean/Elab/Tactic/Induction.lean. Yes, that's confusing.

This PR prevents `rcases` and `obtain` from creating absurdly long case tag
names when taking single constructor types (like `Exists`) apart.
Fixes #6550

The change does not affect `cases` and `induction`, it seems (where the
user might be surprised to not address the single goal with a name),
because I make the change in Lean/Meta/Tactic/Induction.lean, not
Lean/Elab/Tactic/Induction.lean. Yes, that's confusing.
@nomeata nomeata requested a review from leodemoura as a code owner August 14, 2025 15:25
@nomeata nomeata added awaiting-mathlib We should not merge this until we have a successful Mathlib build changelog-language Language features and metaprograms labels Aug 14, 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 Aug 14, 2025
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-08-11 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2025-08-14 16:28:23)

ghost pushed a commit to leanprover-community/batteries that referenced this pull request Aug 14, 2025
ghost pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Aug 14, 2025
@ghost ghost added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Aug 14, 2025
@ghost
Copy link
Copy Markdown

ghost commented Aug 14, 2025

@ghost ghost added builds-mathlib CI has verified that Mathlib builds against this PR and removed awaiting-mathlib We should not merge this until we have a successful Mathlib build breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Aug 14, 2025
@ghost
Copy link
Copy Markdown

ghost commented Aug 14, 2025

@nomeata
Copy link
Copy Markdown
Collaborator Author

nomeata commented Aug 15, 2025

(I’ll merge this in a few days in case someone takes offense with this change.)

@nomeata
Copy link
Copy Markdown
Collaborator Author

nomeata commented Aug 26, 2025

Oh, looks like I never pressed the merge button on this one. Sorry @b-mehta for letting you wait!

@nomeata nomeata added this pull request to the merge queue Aug 26, 2025
Merged via the queue into master with commit 37dd269 Aug 26, 2025
42 of 46 checks passed
@b-mehta
Copy link
Copy Markdown
Contributor

b-mehta commented Aug 26, 2025

No worries at all, thanks so much for fixing this!!

kim-em added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 2, 2025
* chore: bump to nightly-2025-08-14

* adaptation note about grind regression

* Update lean-toolchain for testing leanprover/lean4#9915

* fix tests

* fix

* Update lean-toolchain for testing leanprover/lean4#9918

* Update tests

* update test output

* feat: workflow for reporting `grind` regressions

This PR contains a (untested!) workflow that is supposed to build Mathlib with a few tactic analysis flags. It reports the results of these build steps to Zulip for the FRO (and in particular Kim).

* fix

* chore: bump to nightly-2025-08-16

* bump proofwidgets

* bump proofwidgets

* Update lean-toolchain for testing leanprover/lean4#9942

* fix: namespace linter should not care about private names

* chore: bump to nightly-2025-08-17

* chore: adaptations for nightly-2025-08-17

* Update lean-toolchain for leanprover/lean4#9942

* Update lean-toolchain for leanprover/lean4#9915

* Update lean-toolchain for leanprover/lean4#9942

* make `filter_upwards` more robust to side goals

* Update lean-toolchain for leanprover/lean4#9674

* simpler change to filter_upwards

* fix

* fix test

* chore: bump to nightly-2025-08-18

* Update lean-toolchain for leanprover/lean4#9915

* Apply suggestions from code review

* Use JS to generate uuid instead of uuidgen which appears not to be installed

* GH Problem Matcher wrapper doesn't like multiline arguments; wrap multiple steps instead.

* Hmm, maybe uuidgen exists and it was gh-problem-matcher that was the issue?

* Can we just `apt install` dependencies?

* Apparently Linux exposes uuids from the kernel. Nifty!

* Then we don't need to install uuidgen

* Try also implementing a docgen step for nightly testing

* Cut off the output after 9k bytes, otherwise Zulip complains

* Fixes

* chore: bump to nightly-2025-08-19

* Update lean-toolchain for leanprover/lean4#9915

* Filter out the build progress lines.

* Switch `doc-gen4` version to "main", otherwise it complains there is no nightly-testing release.

* Update lean-toolchain for leanprover/lean4#9915

* lake update

* cleanup imports

* Fix `git remote` complaining that `nightly-testing` already exists.

* Fix error message.

* Update lean-toolchain for leanprover/lean4#9915

* fix tests

* shake --fix

* fix says

* .

* says

* chore: `curl --retry-all-errors` in `cache get`

* remove says

* chore: bump to nightly-2025-08-20

* Drop more noise from the grind report.

* lake update

* fix

* fix tests

* manual shake

* chore: adaptations for nightly-2025-08-20

* chore: bump to nightly-2025-08-21

* chore: adaptations for nightly-2025-08-21

* feat: create `nightly-testing-daily` and `nightly-testing-green` branches

These two branches track the `nightly-testing-YYYY-MM-DD` tags and the latest successfully built `nightly-testing` commit, respectively. These can then be used for other CI actions such as tests that run every night.

* chore: bump to nightly-2025-08-22

* Switch the workflows over to nightly-testing-green branch

* chore: bump to nightly-2025-08-23

* chore: bump to nightly-2025-08-24

* satisfy actionlint

* shellcheck

* fix

* fix

* fix for nightly-2025-08-24 (#42)

* fix

* please rebuild yourself

* maybe that works?

* fix

* rat fixes

* fixes

* fixes

* fix

* .'

* fix

* not there yet

* comment out Int.shiftLeft_add'

* Revert "comment out Int.shiftLeft_add'"

This reverts commit b33c9d7.

* fix proof

* change Polynomial.eval signature

* workaround for initialization order issue

* fixes

* fix

* fix message

* Actually import the linters we want to run.

* chore: bump to nightly-2025-08-25

* remove upstream `Rat` material

* fix `sigmaProdDistrib`

* more `Rat` fixes

* `Rat.inv_def'` -> `Rat.inv_def`

* fixes

* comment out `rw_search` tests

* small test fix

* shake --fix

* Revert

* Move docgen reports to a different Zulip stream

* chore: adaptations for nightly-2025-08-25

* Fix `git checkout` not restoring the right version of the lakefile

* Fix name of mathlib dependency

* chore: bump to nightly-2025-08-26

* addSuggestionCore

* lake update

* chore: adapt `to_additive` to lean4#9966 (#45)

* lake update

* chore: Lean.Grind order structures replaced with Std versions

* ibid

* fixes

* comment out UInt theorems

* Bump batteries

* chore: adapt `hint` tactic to lean4#9966 (#46)

* chore: adapt Hint to lean4#9966

* space after emoji

* rework how `hint` finds try this suggestions

* fix tests

* docstring and formatting

* indentation

* chore: bump to nightly-2025-08-27

* TMToPartrec relies on a default value

oops

* lake update

* fix try this output in tests

* fix uint

* chore: adaptations for nightly-2025-08-27

* fix

* wrong toolchain??

* lake update

* fix merge

* fix merge

* revert sqrt changes

* ugh

* fix from nightly-testing

* fix test

* note about test

* .

---------

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com>
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
Co-authored-by: mathlib4-bot <github-mathlib4-bot@leanprover.zulipchat.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
Co-authored-by: Mac Malone <mac@lean-fro.org>
Co-authored-by: Rob23oba <152706811+Rob23oba@users.noreply.github.com>
Co-authored-by: Rob23oba <robin.arnez@web.de>
Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
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 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.

case name has unnecessary parts

3 participants