Zulip Chat Archive

Stream: mathlib4

Topic: Local notation conflict


Anatole Dedecker (Dec 28 2022 at 17:25):

I'm having a small problem in mathlib4#1205: Order.Chain and Order.Antichain both declare local infixl:50 " ≺ " => ..., and I get an error in Mathlib.lean saying that it can't import Order.Chain because environment already contains '«term_≺__3»._closed_6._cstage2'. Note that it doesn't happen if any of the two files import the other, so I guess the problem is that both file come up with the same auto-generated name because they don't know about the other file, but that will be very annoying in the long run. Is there a known fix?

Mario Carneiro (Dec 28 2022 at 18:48):

name the notations

Sebastian Ullrich (Dec 28 2022 at 19:06):

But also that sounds kind of like a Lean 4 bug. I don't recall off the top of my head whether we should/can use more private there.

Heather Macbeth (Jan 01 2023 at 18:55):

I hit this problem (conflicts of supposedly local notation) again in mathlib4#1254. @Sebastian Ullrich You suggested before that this should be considered a Lean 4 bug; should I open an issue for it?

Reid Barton (Jan 01 2023 at 19:04):

Yes, I think so

Reid Barton (Jan 01 2023 at 19:05):

Also add a porting note with a link to the issue to whatever workaround you end up using

Anatole Dedecker (Jan 01 2023 at 20:17):

Naming the notation works fine, but I had a hard time finding the syntax for that :sweat_smile:

Heather Macbeth (Jan 01 2023 at 20:50):

https://github.com/leanprover/lean4/issues/2000

Heather Macbeth (Jan 01 2023 at 20:51):

I'll supplement mathlib4#1254 with porting notes referencing the issue in all the files mentioned in this thread.


Last updated: Dec 20 2023 at 11:08 UTC