Zulip Chat Archive

Stream: lean4

Topic: Priority for inner product notation


Tomas Skrivan (Dec 06 2021 at 19:57):

I have very little understanding how priorities work, what would be a good way to set up priority for 'inner product like' notation?

notation:100 "⟪" x:60 ", " y:61 "⟫" => Inner x y

but this does not work properly as function application does not work properly. Writing f ⟪x,x⟫ gives an error but f (⟪x,x⟫) works.

Tomas Skrivan (Dec 06 2021 at 19:59):

mwe:

def inner (x y : Nat) : Nat := x * y

notation:100 "⟪" x:60 ", " y:61 "⟫" => inner x y

#check (Nat.succ (1,1))   --- works
#check (Nat.succ 1,1)    --- error

Last updated: Dec 20 2023 at 11:08 UTC