-
Notifications
You must be signed in to change notification settings - Fork 450
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: change_matching ... with
tactic
#6018
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
This feels similar to the Also, will there be Or am I derailing this, if this is less about rewriting and more about changing defeq terms? |
@nomeata This one's just for defeq replacement. If it weren't for that, it would be like using Now's a good time to think about whether this Lean 3 era syntax could be improved, but I haven't thought of anything better. Maybe |
Not sure, As we discuss this I wonder if a better UX design would be to have similar tactics for the defeq and the rewriting case, and they differ in their suffix. A user likely has a certain aim (goal should be X), and that's what's on their mind first. So they write So maybe same with (All not fully throught through, at this time of week :-)) |
Oh, and I keep writing |
@nomeata
|
Do we have a strong reason to stick to what we had in lean 3 or can we polish it a bit. For example these sound better to me
All of these could support an optional proof with I'm not sure if And if we had that I think there is room for (I snuck in a |
I'm not attached to I wanted to say that Regarding the |
What do you think of non-keywords keywords here ( |
It doesn't work as is, because the non-reserved symbol follows an expression here, and it will mix up the pseudo-keyword with an application to a similarly named identifier. You might be able to get it to parse as desired using |
This PR implements the `change ... with` tactic. Doing `change p with r` is essentially equivalent to `rewrite [show p = r by rfl]`. Closes leanprover#5116
change ... with
tacticchange_matching ... with
tactic
I'd like to avoid non-reserved keywords — I find them to feel a bit hacky (though please feel free to experiment to see if it can work well here). What do you think about |
Started a Zulip discussion |
This PR implements the
change_matching p with r
tactic, which replaces eachp
in the target withr
ifp
andr
are definitionally equal. This is likerewrite [show p = r by rfl]
, but the replacement does not depend on their being a type-correct motive. The tactic is comparable to the Lean 3change p with r
tactic.Closes #5116