Zulip Chat Archive

Stream: mathlib4

Topic: enthusiastic `push_cast`


Heather Macbeth (Mar 01 2023 at 03:42):

The following is resolved by push_cast in mathlib4, but not by push_cast in mathlib3. It would be convenient for me for teaching to have the mathlib3 behaviour, but before engaging in serious advocacy, I'd just like to understand it -- what is the reason for the difference?

example : (3:)  3 := by push_cast

Moritz Doll (Mar 01 2023 at 04:03):

Lean 4 is so fast that the tactics happily do more work:

example : (3 : )  (3 : ) := by
  simp only

Moritz Doll (Mar 01 2023 at 04:04):

push_cast is essentially a macro on top of simp

Heather Macbeth (Mar 01 2023 at 04:07):

Hmm, but simp only doesn't solve that in Lean 3 (where push_cast is also implemented on top of simp, IIRC).

I wonder if it's the decidability-checking feature of simp that is dealing with this? I'll try turning it off ...

Heather Macbeth (Mar 01 2023 at 04:08):

Yup!

push_cast (config := { decide := false })

has the mathlib3 behaviour.

Moritz Doll (Mar 01 2023 at 04:09):

ah that came up when Scott was using zify for linarith as well

Heather Macbeth (Mar 01 2023 at 04:12):

I even opened an issue for this (lean4#2068) after being surprised by it some other time.


Last updated: Dec 20 2023 at 11:08 UTC