Zulip Chat Archive

Stream: Is there code for X?

Topic: switching between % and |


Ryan Gold (May 17 2021 at 02:36):

Is there some lemma in the standard library I could call to show that iff (a % b = 0) then (a | b)? I've been having a lot of difficulty finding the right way to handle mod.

Mario Carneiro (May 17 2021 at 02:37):

I guess it would be called mod_eq_zero

Mario Carneiro (May 17 2021 at 02:40):

docs#nat.dvd_iff_mod_eq_zero, docs#int.dvd_iff_mod_eq_zero, docs#euclidean_domain.mod_eq_zero

Adam Topaz (May 17 2021 at 02:40):

Or the one to rule them all: docs#nat.div_add_mod

Adam Topaz (May 17 2021 at 02:41):

But you will need a few more characters of code to get to divisibility

Yaël Dillies (May 17 2021 at 07:17):

(deleted)


Last updated: Dec 20 2023 at 11:08 UTC