Zulip Chat Archive

Stream: general

Topic: prime in `ring_theory/associated.lean`


Scott Morrison (Nov 23 2018 at 00:32):

ring_theory/associated.lean defines

/-- prime element of a semiring -/
def prime [comm_semiring α] (p : α) : Prop :=
p ≠ 0 ∧ ¬ is_unit p ∧ (∀a b, p ∣ a * b → p ∣ a ∨ p ∣ b)

in the root namespace, which then causes clashes with nat.prime if you have nat open.

Scott Morrison (Nov 23 2018 at 00:33):

Could we rename or namespace this? @Johannes Hölzl introduced it here.

Chris Hughes (Nov 23 2018 at 00:35):

We could just get rid of nat prime as well.

Kenny Lau (Nov 23 2018 at 00:36):

wat @_@

Scott Morrison (Nov 23 2018 at 00:43):

What do you mean, @Chris Hughes?

Chris Hughes (Nov 23 2018 at 00:45):

Just get rid of nat.prime and use prime in its place. I just realized that currently nat.prime is basically irreducible , so this would be a non trivial redactor.

Scott Morrison (Nov 23 2018 at 00:48):

Oh, I see! That sounds both a good idea and ambitious. :-)

Scott Morrison (Nov 23 2018 at 00:48):

Is there a good fix in the meantime?

Johan Commelin (Nov 23 2018 at 05:12):

I would just call this one ring.prime

Mario Carneiro (Nov 23 2018 at 05:18):

I'm okay with ring.prime if the kill nat.prime thing doesn't work

Mario Carneiro (Nov 23 2018 at 05:19):

although I've already fixed some bugs caused by this in the library (adding nat.prime when nat was open), maybe they should be re-ambiguated if it lands?


Last updated: Dec 20 2023 at 11:08 UTC