Zulip Chat Archive
Stream: mathlib4
Topic: Log.Base and Zmod.Basic conflicting with each other (?)
Rahul Saha (Aug 13 2023 at 19:53):
Hey guys, I am using the latest mathlib4 commit for a project and have the following two imports:
import Mathlib.Analysis.SpecialFunctions.Log.Base
import Mathlib.Data.Zmod.Basic
Individually, each of these imports work fine. But when put together as above, it gives the following error:
import Mathlib.Data.Zmod.Basic failed, environment already contains 'Int.castAddHom._at.ZMod.lift._spec_1._cstage2' from Mathlib.Data.ZMod.Basic
I am not sure how to parse this, perhaps there is some circular import happening somewhere? Some help would be appreciated, thank you!
Anatole Dedecker (Aug 13 2023 at 19:55):
Ah we've had this a few days ago! It's Mathlib.Data.ZMod.Basic
with a capital M
.
Anatole Dedecker (Aug 13 2023 at 19:55):
Let me guess, you're on MacOS?
Rahul Saha (Aug 13 2023 at 19:55):
yep MacOS
Rahul Saha (Aug 13 2023 at 19:56):
and thanks that worked!
Anatole Dedecker (Aug 13 2023 at 19:56):
An explanation of what goes wrong: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/EReal.20instance/near/383550857
Anatole Dedecker (Aug 13 2023 at 19:58):
Basically: you import the Zmod
file (which does not exist), but MacOS is """nice""" enough to give the ZMod
file to Lean instead. But the problem is that another file imports ZMod
, and Lean has no idea that these files are actually the same!
Rahul Saha (Aug 13 2023 at 19:59):
oh wow, that's quite silly behavior from the os, thanks for the explanation.
Yury G. Kudryashov (Aug 13 2023 at 20:37):
AFAIR, Windows has case-insensitive filesystem too.
Kevin Buzzard (Aug 13 2023 at 22:32):
I think it's case-insensitive in a different way! Read the extensive discussion in the linked thread :-)
Last updated: Dec 20 2023 at 11:08 UTC