Zulip Chat Archive
Stream: new members
Topic: le_gcd
Iocta (Mar 01 2025 at 05:18):
Is there a statement similar to this?
lemma le_gcd (n r b : Int) (hr : n ∣ r) (hb : n ∣ b ) : n ≤ gcd r b := by
Riccardo Brasca (Mar 01 2025 at 06:19):
You can use exact?
to find the statement that n
divides the gcd
. From there it should be immediate m
Daniel Weber (Mar 01 2025 at 06:32):
As stated this isn't true for r = b = 0
suhr (Mar 01 2025 at 06:43):
Yes:
Int.dvd_gcd {i j k : ℤ} (h1 : k ∣ i) (h2 : k ∣ j) : k ∣ ↑(i.gcd j)
You can compose it with Int.le_of_dvd {a b : ℤ} (bpos : 0 < b) (H : a ∣ b) : a ≤ b
to get the function you need.
Last updated: May 02 2025 at 03:31 UTC