Zulip Chat Archive

Stream: new members

Topic: Notation already defined


Kevin Sullivan (Jan 19 2023 at 17:10):

In an old Lean3 file, I'm getting an error, "invalid notation: notation already declared. Consider using 'notation (name := ...)." The use case is super simple, just using /\ to mean "and" in a simple implementation of a simple logic. Has something in the syntax changed lately? Thanks.

notation e1  e2 :=  pAnd e1 e2

Kyle Miller (Jan 19 2023 at 17:42):

Yes, it was changed a few months ago to help with the mathport effort. What you can do is

notation (name := something_unique_anything_is_fine) e1  e2 := pAnd e1 e2

Kyle Miller (Jan 19 2023 at 17:43):

The name just needs to be different from any other notation that might conflict.

Kyle Miller (Jan 19 2023 at 17:43):

If there are no such conflicting notations, you can omit the (name := ...)

Kevin Sullivan (Jan 19 2023 at 17:48):

Kyle Miller said:

If there are no such conflicting notations, you can omit the (name := ...)

So "something_unique" is just a string? Identifier?

Kyle Miller (Jan 19 2023 at 17:49):

I think it's any identifier. I think the line I gave you should work as-is

Kyle Miller (Jan 19 2023 at 17:49):

You could do pAnd too if you want to be more principled about it.

Kevin Sullivan (Jan 19 2023 at 17:51):

Kyle Miller said:

You could do pAnd too if you want to be more principled about it.

Yep, thank you so much. Works. --Kevin


Last updated: Dec 20 2023 at 11:08 UTC