Zulip Chat Archive

Stream: lean4

Topic: Lower operator priority


Martin Dvořák (Oct 26 2024 at 11:56):

I defined an infix operator for Insert.insert and I would like it to have lower priority than { } for repeated inserts into a singleton.

import Mathlib

infixr:66 (priority := 1) " ᕃ " => Insert.insert

example (x y z : ) (s : Set ) (hs : s = {y, z}) : x  s = {x, y, z} := by
  sorry

Currently the goal is displayed as:

x  s = x  y  {z}

I want the goal to be displayed as:

x  s = {x, y, z}

What can I do?
I'm not sure whether priority is for that.

Eric Wieser (Oct 26 2024 at 12:10):

It sounds like you're talking about delaborator priority, not notation parsing priority

Eric Wieser (Oct 26 2024 at 12:10):

I don't know if the former notion exists

Martin Dvořák (Oct 26 2024 at 12:16):

Can it be worked around using app_unexpander or something?

Eric Wieser (Oct 26 2024 at 12:45):

Yes, you can use syntax instead of notation, and then write your own delaborator manually


Last updated: May 02 2025 at 03:31 UTC