fix(Tactic/Lift): preserve abbreviated target types - #42356
fix(Tactic/Lift): preserve abbreviated target types#42356sankalpsthakur wants to merge 6 commits into
Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 49b60db482Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
lift n to MyNat using hnwhereMyNatis anabbrevcould produce a proof term whose displayed/elaborated type unfolds the abbreviation to its underlying type, losing the connection toMyNat-specific declarations (e.g. a subsequent call to aMyNat-namespaced lemma would fail to resolve).Wraps the synthesized proof term in an explicit
show ∃ _ : $t, _ from …ascription using the originally-written target syntaxt, so the abbreviation is preserved rather than unfolded.Motivated by #15865.
Validation
lake build Mathlib.Tactic.Liftandlake build MathlibTest.Tactic.Lift— both succeed, including the new regression test (lifting to anabbrev-definedMyNatand calling aMyNat-namespaced lemma on the result).liftis used in roughly 241 files across Mathlib. I verified the tactic's own implementation and its dedicated test suite build cleanly, but did not rebuild the full library to check every existing call site — the ascription should be semantically transparent (same term, explicit type), but I'm relying on CI for full-library confirmation rather than claiming that coverage myself.Closes #15865
AI/LLM disclosure
AI coding tools were used to help draft this change and PR description. I reviewed the complete change, understand the reasoning, and verified the build locally before submitting.