Zulip Chat Archive

Stream: mathlib4

Topic: Similar theorems in different files with same name


Maxwell Thum (Jan 14 2023 at 05:40):

In Algebra.GCDMonoid.Basic, there is a theorem

@[simp]
theorem lcm_eq_zero_iff [GCDMonoid α] (a b : α) : lcm a b = 0  a = 0  b = 0

In Algebra.GCDMonoid.Multiset, there is a generalization of that theorem

@[simp]
theorem lcm_eq_zero_iff [Nontrivial α] (s : Multiset α) : s.lcm = 0  (0 : α)  s

whose proof uses the aforementioned lcm_eq_zero_iff.

Maxwell Thum (Jan 14 2023 at 05:42):

My issue is that when I try to simp using the first lcm_eq_zero_iff in the proof of the second, Lean thinks I'm referring to the second one (which I'm trying to prove!)

Maxwell Thum (Jan 14 2023 at 05:47):

And I can't figure out how to make Lean refer to the correct one

Johan Commelin (Jan 14 2023 at 05:48):

@Maxwell Thum Either add nonrec before the theorem keyword, or use _root_.lcm_eq_zero_iff.

Maxwell Thum (Jan 14 2023 at 05:49):

Johan Commelin said:

Maxwell Thum Either add nonrec before the theorem keyword, or use _root_.lcm_eq_zero_iff.

I think that works; thanks!


Last updated: Dec 20 2023 at 11:08 UTC