feat: change_matching ... with tactic - #6018
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 removes the unused `change ... with` tactic syntax. It's been asked about a number of times recently, but it was never implemented. In PR #6018 we decided it was a Lean-3-ism.
This PR removes the unused `change ... with` tactic syntax. It's been asked about a number of times recently, but it was never implemented. In PR #6018 we decided it was a Lean-3-ism.
|
This hasn't been touched in over a year, and has a merge conflict. I'm closing now; please re-open if you think appropriate. |
This PR implements the
change_matching p with rtactic, which replaces eachpin the target withrifpandrare 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 rtactic.Closes #5116