Skip to content

Commit 412e7b8

Browse files
committed
feat(RingTheory/Coprime/Lemmas): Add Int.isCoprime_gcdA/B (leanprover-community#32369)
Adds Int.isCoprime_gcdA and Int.isCoprime_gcdB
1 parent a8519e1 commit 412e7b8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Mathlib/RingTheory/Coprime/Lemmas.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ theorem Nat.Coprime.cast {R : Type*} [CommRing R] {a b : ℕ} (h : Nat.Coprime a
6262
theorem Rat.isCoprime_num_den (x : ℚ) : IsCoprime x.num x.den :=
6363
x.reduced.cast.of_isCoprime_of_dvd_left Int.dvd_natAbs_self
6464

65+
theorem Int.isCoprime_gcdA {x y : ℤ} (h : IsCoprime x y) : IsCoprime (x.gcdA y) y := by
66+
use x, x.gcdB y
67+
rwa [mul_comm _ y, ← Int.gcd_eq_gcd_ab, Nat.cast_eq_one, ← Int.isCoprime_iff_gcd_eq_one]
68+
69+
theorem Int.isCoprime_gcdB {x y : ℤ} (h : IsCoprime x y) : IsCoprime (x.gcdB y) x := by
70+
use y, x.gcdA y
71+
rwa [add_comm, mul_comm , ← Int.gcd_eq_gcd_ab, Nat.cast_eq_one, ← Int.isCoprime_iff_gcd_eq_one]
72+
6573
theorem ne_zero_or_ne_zero_of_nat_coprime {A : Type u} [CommRing A] [Nontrivial A] {a b : ℕ}
6674
(h : Nat.Coprime a b) : (a : A) ≠ 0 ∨ (b : A) ≠ 0 :=
6775
IsCoprime.ne_zero_or_ne_zero (R := A) <| by

0 commit comments

Comments
 (0)