Zulip Chat Archive

Stream: general

Topic: Binding power of `^ [n]`


Sebastien Gouezel (Nov 07 2021 at 11:21):

Some time ago, we noticed that - 2 ^ 3 was parsed as (-2)^3, and we fixed the priority of ^ to make it more reasonable. I was just bitten by the same issue but for iterates of a map: - f^[n] 0, which for me means - (f^[n] 0), is parsed as (-f)^[n] 0 (I am in a context where -fmakes sense). Is there a way to fix this in the same way it was done for powers? (Unfortunately for me, the notation is declared in core...)

Yury G. Kudryashov (Nov 07 2021 at 18:51):

And while we're at it, what about fixing binding power of supr/Union/infi/Inter so that it doesn't eat = in ⋃ i, s i = t?

Patrick Massot (Nov 07 2021 at 18:52):

Oh yes, that would be so nice!

Eric Wieser (Nov 07 2021 at 18:53):

Are those notations in core, @Yury G. Kudryashov?

Eric Wieser (Nov 07 2021 at 18:53):

I thought those were mathlib, making them much easier to fix than src#nat.iterate

Yury G. Kudryashov (Nov 07 2021 at 18:55):

sUnion is in the core (BTW, should we move it to mathlib?)

Kevin Buzzard (Nov 07 2021 at 18:56):

if we're complaining about standard notation, can I add to the list the fact that \union and \inter are left associative, whereas \and and \or are right associative.

Yury G. Kudryashov (Nov 07 2021 at 18:56):

The rest is in mathlib

Yury G. Kudryashov (Nov 07 2021 at 18:56):

@Kevin Buzzard Changing associativity means that lots of code will break.

Kevin Buzzard (Nov 07 2021 at 18:57):

I was just surprised about the asymmetry

Sebastien Gouezel (Nov 08 2021 at 15:52):

Did you know that, currently, (1 / (n : ℝ)) • f^[n] 0 is parsed as ((1 / (n : ℝ)) • f)^[n] 0? You can guess it took me some time to figure out what was going on :-)

Yury G. Kudryashov (Nov 08 2021 at 20:15):

^[n] eats a lot on the LHS. I don't remember if it eats =.


Last updated: Dec 20 2023 at 11:08 UTC