Zulip Chat Archive

Stream: general

Topic: nat.prime


Johan Commelin (Dec 10 2021 at 09:46):

We have docs#nat.prime and docs#prime. Should we redefine nat.prime in terms of _root_.prime?

Johan Commelin (Dec 10 2021 at 09:47):

cc @Stuart Presnell , because you've been working with nat.prime a lot recently.

Eric Wieser (Dec 10 2021 at 09:48):

Do we even have the statement that the two notions are equivalent?

Mario Carneiro (Dec 10 2021 at 09:48):

pretty sure

Mario Carneiro (Dec 10 2021 at 09:49):

docs#nat.prime_iff

Mario Carneiro (Dec 10 2021 at 09:50):

Although, there is both irreducible and prime and neither one is a clear winner for the definition of nat.prime

Mario Carneiro (Dec 10 2021 at 09:52):

I worry about dependency bloat, of course. It would be nice to make these kinds of things quantitative, for example, calculating the sum of the depths of all files before and after

Anne Baanen (Dec 10 2021 at 09:56):

If we can split off the big_operators dependency from algebra.associated, the remainder is low-level definitions such as group_with_zero and units. So I'm in favour of unifying nat.prime with _root_.prime after such a split.

Johan Commelin (Dec 10 2021 at 09:58):

Right, clearly big_ops shouldn't be a dependency.

Johan Commelin (Dec 10 2021 at 09:58):

But otherwise, I think it's quite mild.

Eric Wieser (Dec 10 2021 at 10:05):

Mario Carneiro said:

I worry about dependency bloat, of course. It would be nice to make these kinds of things quantitative, for example, calculating the sum of the depths of all files before and after

Do the stats at https://eric-wieser.github.io/mathlib-import-graph/?highlight=mathlib%3Aring_theory.int.basic help? If you hover over the highlighted node, it tells you that 31285 declarations appear before that file, and 248 files consume it.

Ruben Van de Velde (Dec 10 2021 at 10:05):

Oh, I think I broke that dependency at some point, but then didn't land that? It's just exists_mem_finset_dvd that needs it

Ruben Van de Velde (Dec 10 2021 at 10:06):

That was in #9606 - that lemma isn't even used in mathlib

Floris van Doorn (Dec 15 2021 at 17:58):

I am strongly in favor of removing nat.prime and just using prime everywhere.

Kevin Buzzard (Dec 15 2021 at 22:30):

I guess p.prime is no shorter than prime p.

Johan Commelin (Dec 16 2021 at 06:20):

That's not the point. The point is deduplicating all the lemmas.

Anne Baanen (Dec 16 2021 at 18:06):

Step 1: #10848

Ruben Van de Velde (Dec 22 2021 at 12:58):

I started looking into this at branch#nat-prime-irreducible - I tried with prime, but it seems like the nat.prime <-> prime equivalence requires a fair amount of material. irreducible is essentially the current definition, so that seems to work better to build up the api.

(Code is still a mess at this point)

Johan Commelin (Dec 22 2021 at 13:22):

Thanks for taking this up!

Ruben Van de Velde (Dec 22 2021 at 20:27):

To my surprise, I seem to have made it back to a compiling mathlib with +108-105 changes

Ruben Van de Velde (Dec 24 2021 at 11:18):

#11031

Johan Commelin (Dec 24 2021 at 11:53):

Thanks!

Johan Commelin (Dec 24 2021 at 12:04):

@Mario Carneiro Are you happy with this new state of affairs? It looks good to me

Mario Carneiro (Dec 24 2021 at 18:17):

Looks good, it looks like imports weren't affected too much

Johan Commelin (Aug 23 2022 at 02:48):

I think it is confusing that nat.min_fac_prime does not make progress on prime (nat.min_fac N).


Last updated: Dec 20 2023 at 11:08 UTC