Zulip Chat Archive

Stream: Is there code for X?

Topic: naming help


Scott Morrison (Oct 14 2021 at 06:50):

From a PR: what is this lemma meant to be named?

lemma ??? {a b n : } (h : 2 * n + 1  a + b) : n + 1  a  n + 1  b :=

Yaël Dillies (Oct 14 2021 at 06:52):

two_pigeonhole_principle? two_pigeonhole_principle_nat?

Scott Morrison (Oct 14 2021 at 06:53):

nat.succ_le_or_succ_le?

Yaël Dillies (Oct 14 2021 at 06:54):

If you wrote it as

lemma ??? {a b n : α} (h : 2 * n < a + b) : n < a  n < b :=

then it would be more general.

Scott Morrison (Oct 14 2021 at 06:54):

Isn't that definitionally equal? :-)

Yaël Dillies (Oct 14 2021 at 06:55):

Of course! But your lemma above is only true for succ_orders.

Yaël Dillies (Oct 14 2021 at 06:55):

lt_or_lt_of_two_mul_lt_add?

Mario Carneiro (Oct 14 2021 at 07:11):

if you wrote it as

lemma ??? {a b m n : α} (h : m + n < a + b) : m < a  n < b :=

it would be even more general

Yaël Dillies (Oct 14 2021 at 07:15):

Damn! What about lt_or_lt_of_add_lt_add?

Eric Rodriguez (Dec 17 2021 at 17:35):

I feel like there was another naming help topic, but I can't find it; what do people think this lemma should be named?

Yury G. Kudryashov (Dec 17 2021 at 17:41):

exists_order_of_eq_pow_padic_val_nat_exponent? Or is it too long?

Eric Rodriguez (Dec 17 2021 at 17:42):

feels kinda long but on the other hand it does describe the lemma perfectly, so maybe i'll go with that, thanks!

Eric Rodriguez (Dec 17 2021 at 20:09):

What do you think of nat.prime.exists_order_of_eq_pow_padic_val_nat_exponent? Same length in practice + allows dot notation

Yury G. Kudryashov (Dec 17 2021 at 20:47):

I don't use this part of the library. Note: with alias, you can have both.


Last updated: Dec 20 2023 at 11:08 UTC