Zulip Chat Archive
Stream: mathlib4
Topic: Rename `norm_cast` to `pull_cast`?
Jovan Gerbscheid (Oct 16 2025 at 14:06):
I was looking at the tactic cheat sheet, and it says:
push/pull: move the given constant inwards/outwards
norm_cast: simplify the expression by moving casts outwards
push_cast: push casts inwards
This makes me wonder if norm_cast should be called pull_cast. I'm not saying that it should, but I'd be curious to hear what others think.
Kenny Lau (Oct 16 2025 at 14:07):
agreed
Yury G. Kudryashov (Oct 16 2025 at 14:32):
This is a Mathlib tactic, so I'm going to move this thread to #mathlib4 .
Notification Bot (Oct 16 2025 at 14:32):
This topic was moved here from #lean4 > Rename `norm_cast` to `pull_cast`? by Yury G. Kudryashov.
Anne Baanen (Oct 16 2025 at 14:34):
I am weakly in favour. Apart from the pain of renaming/deprecating everywhere, I can see the objection being that norm_cast defines a normal form (which also helps with knowing how to phrase declarations), while pull_cast would not.
Anne Baanen (Oct 16 2025 at 14:34):
That would not be a strong enough objection for me to block the change though.
Jovan Gerbscheid (Oct 16 2025 at 14:35):
norm_cast is a Lean core tactic, it was upstreamed in 2024: lean4#3322
Yury G. Kudryashov (Oct 16 2025 at 14:53):
Should I move it back?
Floris van Doorn (Oct 16 2025 at 15:37):
norm_cast also does some simplification , e.g. normalizing ↑n < ↑m to n < m. You can view that as "pulling the cast outside <, which just happens to make it go away", but I think the name norm_cast is also fine, given this "extra" normalization step.
Floris van Doorn (Oct 16 2025 at 15:38):
I'm not against the rename, but personally I don't think it's worth the effort, since I also like the current name.
Ruben Van de Velde (Oct 16 2025 at 16:07):
Yeah, I see the goal of norm_cast mostly as removing casts rather than pulling them
Aaron Liu (Oct 16 2025 at 17:07):
I think of removing casts and pulling casts as mostly the same thing
Jovan Gerbscheid (Oct 16 2025 at 17:17):
Note that the goal of push_neg is often just to remove a negation rather than pushing it.
Ruben Van de Velde (Oct 16 2025 at 17:22):
So should it be norm_neg?
Jovan Gerbscheid (Oct 16 2025 at 17:45):
Well, it is a macro for push ¬ _...
Floris van Doorn (Oct 16 2025 at 21:55):
it's funny to contrast the duality that pushing negations in allows you to cancel them and that pulling casts out allows you to cancel them.
Jovan Gerbscheid (Oct 16 2025 at 22:18):
If you push the cast in ↑(Fin.mk n ...) with push_cast it cancels the cast. So it isn't just norm_cast doing that.
Last updated: Dec 20 2025 at 21:32 UTC