ring_theory.euclidean_domain
⟷
Mathlib.RingTheory.EuclideanDomain
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
@@ -29,14 +29,12 @@ open euclidean_domain set ideal
section gcd_monoid
-variables {R : Type*} [euclidean_domain R] [gcd_monoid R]
+variables {R : Type*} [euclidean_domain R] [gcd_monoid R] {p q : R}
-lemma gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) :
- gcd_monoid.gcd p q ≠ 0 :=
+lemma gcd_ne_zero_of_left (hp : p ≠ 0) : gcd_monoid.gcd p q ≠ 0 :=
λ h, hp $ eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
-lemma gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) :
- gcd_monoid.gcd p q ≠ 0 :=
+lemma gcd_ne_zero_of_right (hp : q ≠ 0) : gcd_monoid.gcd p q ≠ 0 :=
λ h, hp $ eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
lemma left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) :
@@ -57,6 +55,13 @@ begin
exact r0,
end
+lemma is_coprime_div_gcd_div_gcd (hq : q ≠ 0) :
+ is_coprime (p / gcd_monoid.gcd p q) (q / gcd_monoid.gcd p q) :=
+(gcd_is_unit_iff _ _).1 $ is_unit_gcd_of_eq_mul_gcd
+ (euclidean_domain.mul_div_cancel' (gcd_ne_zero_of_right hq) $ gcd_dvd_left _ _).symm
+ (euclidean_domain.mul_div_cancel' (gcd_ne_zero_of_right hq) $ gcd_dvd_right _ _).symm $
+ gcd_ne_zero_of_right hq
+
end gcd_monoid
namespace euclidean_domain
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
-/
-import Algebra.GcdMonoid.Basic
+import Algebra.GCDMonoid.Basic
import Algebra.EuclideanDomain.Basic
import RingTheory.Ideal.Basic
import RingTheory.PrincipalIdealDomain
@@ -54,7 +54,7 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
by
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_left p q
obtain ⟨pq0, r0⟩ : GCDMonoid.gcd p q ≠ 0 ∧ r ≠ 0 := mul_ne_zero_iff.mp (hr ▸ hp)
- rw [hr, mul_comm, mul_div_cancel _ pq0]
+ rw [hr, mul_comm, mul_div_cancel_right₀ _ pq0]
exact r0
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
-/
@@ -65,7 +65,7 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
by
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_right p q
obtain ⟨pq0, r0⟩ : GCDMonoid.gcd p q ≠ 0 ∧ r ≠ 0 := mul_ne_zero_iff.mp (hr ▸ hq)
- rw [hr, mul_comm, mul_div_cancel _ pq0]
+ rw [hr, mul_comm, mul_div_cancel_right₀ _ pq0]
exact r0
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
-/
-import Mathbin.Algebra.GcdMonoid.Basic
-import Mathbin.Algebra.EuclideanDomain.Basic
-import Mathbin.RingTheory.Ideal.Basic
-import Mathbin.RingTheory.PrincipalIdealDomain
+import Algebra.GcdMonoid.Basic
+import Algebra.EuclideanDomain.Basic
+import RingTheory.Ideal.Basic
+import RingTheory.PrincipalIdealDomain
#align_import ring_theory.euclidean_domain from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6"
@@ -48,7 +48,7 @@ theorem gcd_ne_zero_of_right (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
-/
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
#print left_div_gcd_ne_zero /-
theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0 :=
by
@@ -59,7 +59,7 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
-/
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
#print right_div_gcd_ne_zero /-
theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q ≠ 0 :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -94,7 +94,7 @@ def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R
gcd_dvd_left := gcd_dvd_left
gcd_dvd_right := gcd_dvd_right
dvd_gcd a b c := dvd_gcd
- gcd_mul_lcm a b := by rw [EuclideanDomain.gcd_mul_lcm]
+ gcd_hMul_lcm a b := by rw [EuclideanDomain.gcd_mul_lcm]
lcm_zero_left := lcm_zero_left
lcm_zero_right := lcm_zero_right
#align euclidean_domain.gcd_monoid EuclideanDomain.gcdMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
-
-! This file was ported from Lean 3 source module ring_theory.euclidean_domain
-! leanprover-community/mathlib commit bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.GcdMonoid.Basic
import Mathbin.Algebra.EuclideanDomain.Basic
import Mathbin.RingTheory.Ideal.Basic
import Mathbin.RingTheory.PrincipalIdealDomain
+#align_import ring_theory.euclidean_domain from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6"
+
/-!
# Lemmas about Euclidean domains
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -73,6 +73,7 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
-/
+#print isCoprime_div_gcd_div_gcd /-
theorem isCoprime_div_gcd_div_gcd (hq : q ≠ 0) :
IsCoprime (p / GCDMonoid.gcd p q) (q / GCDMonoid.gcd p q) :=
(gcd_isUnit_iff _ _).1 <|
@@ -81,6 +82,7 @@ theorem isCoprime_div_gcd_div_gcd (hq : q ≠ 0) :
(EuclideanDomain.mul_div_cancel' (gcd_ne_zero_of_right hq) <| gcd_dvd_right _ _).symm <|
gcd_ne_zero_of_right hq
#align is_coprime_div_gcd_div_gcd isCoprime_div_gcd_div_gcd
+-/
end GCDMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
! This file was ported from Lean 3 source module ring_theory.euclidean_domain
-! leanprover-community/mathlib commit c085f3044fe585c575e322bfab45b3633c48d820
+! leanprover-community/mathlib commit bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -37,16 +37,16 @@ open EuclideanDomain Set Ideal
section GCDMonoid
-variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
+variable {R : Type _} [EuclideanDomain R] [GCDMonoid R] {p q : R}
#print gcd_ne_zero_of_left /-
-theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
+theorem gcd_ne_zero_of_left (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
#align gcd_ne_zero_of_left gcd_ne_zero_of_left
-/
#print gcd_ne_zero_of_right /-
-theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
+theorem gcd_ne_zero_of_right (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
-/
@@ -73,6 +73,15 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
-/
+theorem isCoprime_div_gcd_div_gcd (hq : q ≠ 0) :
+ IsCoprime (p / GCDMonoid.gcd p q) (q / GCDMonoid.gcd p q) :=
+ (gcd_isUnit_iff _ _).1 <|
+ isUnit_gcd_of_eq_mul_gcd
+ (EuclideanDomain.mul_div_cancel' (gcd_ne_zero_of_right hq) <| gcd_dvd_left _ _).symm
+ (EuclideanDomain.mul_div_cancel' (gcd_ne_zero_of_right hq) <| gcd_dvd_right _ _).symm <|
+ gcd_ne_zero_of_right hq
+#align is_coprime_div_gcd_div_gcd isCoprime_div_gcd_div_gcd
+
end GCDMonoid
namespace EuclideanDomain
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -39,15 +39,20 @@ section GCDMonoid
variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
+#print gcd_ne_zero_of_left /-
theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
#align gcd_ne_zero_of_left gcd_ne_zero_of_left
+-/
+#print gcd_ne_zero_of_right /-
theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
+-/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
+#print left_div_gcd_ne_zero /-
theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0 :=
by
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_left p q
@@ -55,8 +60,10 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
rw [hr, mul_comm, mul_div_cancel _ pq0]
exact r0
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
+-/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
+#print right_div_gcd_ne_zero /-
theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q ≠ 0 :=
by
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_right p q
@@ -64,6 +71,7 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
rw [hr, mul_comm, mul_div_cancel _ pq0]
exact r0
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
+-/
end GCDMonoid
@@ -94,24 +102,30 @@ theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
#align euclidean_domain.span_gcd EuclideanDomain.span_gcd
-/
+#print EuclideanDomain.gcd_isUnit_iff /-
theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
+-/
+#print EuclideanDomain.isCoprime_of_dvd /-
-- this should be proved for UFDs surely?
theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
(H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
isCoprime_of_dvd x y nonzero H
#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvd
+-/
+#print EuclideanDomain.dvd_or_coprime /-
-- this should be proved for UFDs surely?
theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x) :
x ∣ y ∨ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
dvd_or_coprime x y h
#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprime
+-/
end EuclideanDomain
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -31,7 +31,7 @@ euclidean domain
noncomputable section
-open Classical
+open scoped Classical
open EuclideanDomain Set Ideal
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -39,32 +39,14 @@ section GCDMonoid
variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
-/- warning: gcd_ne_zero_of_left -> gcd_ne_zero_of_left is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
-Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_left gcd_ne_zero_of_leftₓ'. -/
theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
#align gcd_ne_zero_of_left gcd_ne_zero_of_left
-/- warning: gcd_ne_zero_of_right -> gcd_ne_zero_of_right is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
-Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_right gcd_ne_zero_of_rightₓ'. -/
theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
-/- warning: left_div_gcd_ne_zero -> left_div_gcd_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
-Case conversion may be inaccurate. Consider using '#align left_div_gcd_ne_zero left_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0 :=
by
@@ -74,12 +56,6 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
exact r0
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
-/- warning: right_div_gcd_ne_zero -> right_div_gcd_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
-Case conversion may be inaccurate. Consider using '#align right_div_gcd_ne_zero right_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q ≠ 0 :=
by
@@ -118,23 +94,11 @@ theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
#align euclidean_domain.span_gcd EuclideanDomain.span_gcd
-/
-/- warning: euclidean_domain.gcd_is_unit_iff -> EuclideanDomain.gcd_isUnit_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
-Case conversion may be inaccurate. Consider using '#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iffₓ'. -/
theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
-/- warning: euclidean_domain.is_coprime_of_dvd -> EuclideanDomain.isCoprime_of_dvd is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))))) -> (forall (z : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) z (nonunits.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) -> (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))))) -> (forall (z : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) z (nonunits.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))) -> (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
-Case conversion may be inaccurate. Consider using '#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvdₓ'. -/
-- this should be proved for UFDs surely?
theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
(H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y :=
@@ -142,12 +106,6 @@ theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x =
isCoprime_of_dvd x y nonzero H
#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvd
-/- warning: euclidean_domain.dvd_or_coprime -> EuclideanDomain.dvd_or_coprime is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) x) -> (Or (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) x) -> (Or (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
-Case conversion may be inaccurate. Consider using '#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprimeₓ'. -/
-- this should be proved for UFDs surely?
theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x) :
x ∣ y ∨ IsCoprime x y :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/08e1d8d4d989df3a6df86f385e9053ec8a372cc1
@@ -43,7 +43,7 @@ variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
lean 3 declaration is
forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_left gcd_ne_zero_of_leftₓ'. -/
theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
@@ -53,7 +53,7 @@ theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 :
lean 3 declaration is
forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_right gcd_ne_zero_of_rightₓ'. -/
theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
@@ -63,7 +63,7 @@ theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0
lean 3 declaration is
forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align left_div_gcd_ne_zero left_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0 :=
@@ -78,7 +78,7 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
lean 3 declaration is
forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} R _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align right_div_gcd_ne_zero right_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q ≠ 0 :=
@@ -122,7 +122,7 @@ theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
Case conversion may be inaccurate. Consider using '#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iffₓ'. -/
theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
@@ -133,7 +133,7 @@ theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))))) -> (forall (z : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) z (nonunits.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) -> (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))))) -> (forall (z : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) z (nonunits.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))) -> (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))))) -> (forall (z : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) z (nonunits.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToCommSemiringToCommRing.{u1} α _inst_3))))))) -> (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
Case conversion may be inaccurate. Consider using '#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvdₓ'. -/
-- this should be proved for UFDs surely?
theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
@@ -146,7 +146,7 @@ theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x =
lean 3 declaration is
forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) x) -> (Or (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
but is expected to have type
- forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) x) -> (Or (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) x) -> (Or (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalCommSemiring.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalCommSemiring.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
Case conversion may be inaccurate. Consider using '#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprimeₓ'. -/
-- this should be proved for UFDs surely?
theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/57e09a1296bfb4330ddf6624f1028ba186117d82
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
! This file was ported from Lean 3 source module ring_theory.euclidean_domain
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! leanprover-community/mathlib commit c085f3044fe585c575e322bfab45b3633c48d820
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -16,6 +16,9 @@ import Mathbin.RingTheory.PrincipalIdealDomain
/-!
# Lemmas about Euclidean domains
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
Various about Euclidean domains are proved; all of them seem to be true
more generally for principal ideal domains, so these lemmas should
probably be reproved in more generality and this file perhaps removed?
mathlib commit https://github.com/leanprover-community/mathlib/commit/290a7ba01fbcab1b64757bdaa270d28f4dcede35
@@ -36,14 +36,32 @@ section GCDMonoid
variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
+/- warning: gcd_ne_zero_of_left -> gcd_ne_zero_of_left is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_left gcd_ne_zero_of_leftₓ'. -/
theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
#align gcd_ne_zero_of_left gcd_ne_zero_of_left
+/- warning: gcd_ne_zero_of_right -> gcd_ne_zero_of_right is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] (p : R) (q : R), (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+Case conversion may be inaccurate. Consider using '#align gcd_ne_zero_of_right gcd_ne_zero_of_rightₓ'. -/
theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
+/- warning: left_div_gcd_ne_zero -> left_div_gcd_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R p (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) p (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+Case conversion may be inaccurate. Consider using '#align left_div_gcd_ne_zero left_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0 :=
by
@@ -53,6 +71,12 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
exact r0
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
+/- warning: right_div_gcd_ne_zero -> right_div_gcd_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1))))))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.hasDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.isDomain.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)))))))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : EuclideanDomain.{u1} R] [_inst_2 : GCDMonoid.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))] {p : R} {q : R}, (Ne.{succ u1} R q (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1))))))) -> (Ne.{succ u1} R (HDiv.hDiv.{u1, u1, u1} R R R (instHDiv.{u1} R (EuclideanDomain.instDiv.{u1} R _inst_1)) q (GCDMonoid.gcd.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)) _inst_2 p q)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R (IsDomain.toCancelCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R (EuclideanDomain.toCommRing.{u1} R _inst_1)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} R _inst_1)))))))
+Case conversion may be inaccurate. Consider using '#align right_div_gcd_ne_zero right_div_gcd_ne_zeroₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([1]) } -/
theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q ≠ 0 :=
by
@@ -66,6 +90,7 @@ end GCDMonoid
namespace EuclideanDomain
+#print EuclideanDomain.gcdMonoid /-
/-- Create a `gcd_monoid` whose `gcd_monoid.gcd` matches `euclidean_domain.gcd`. -/
def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R
where
@@ -78,20 +103,35 @@ def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R
lcm_zero_left := lcm_zero_left
lcm_zero_right := lcm_zero_right
#align euclidean_domain.gcd_monoid EuclideanDomain.gcdMonoid
+-/
variable {α : Type _} [EuclideanDomain α] [DecidableEq α]
+#print EuclideanDomain.span_gcd /-
theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
span ({gcd x y} : Set α) = span ({x, y} : Set α) :=
letI := EuclideanDomain.gcdMonoid α
span_gcd x y
#align euclidean_domain.span_gcd EuclideanDomain.span_gcd
+-/
+/- warning: euclidean_domain.gcd_is_unit_iff -> EuclideanDomain.gcd_isUnit_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, Iff (IsUnit.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) (EuclideanDomain.gcd.{u1} α _inst_3 (fun (a : α) (b : α) => Classical.propDecidable (Eq.{succ u1} α a b)) x y)) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+Case conversion may be inaccurate. Consider using '#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iffₓ'. -/
theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
+/- warning: euclidean_domain.is_coprime_of_dvd -> EuclideanDomain.isCoprime_of_dvd is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))))) -> (forall (z : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) z (nonunits.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))))))) -> (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] {x : α} {y : α}, (Not (And (Eq.{succ u1} α x (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))) (Eq.{succ u1} α y (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))))) -> (forall (z : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) z (nonunits.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) -> (Ne.{succ u1} α z (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (CommMonoidWithZero.toZero.{u1} α (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} α (IsDomain.toCancelCommMonoidWithZero.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) (EuclideanDomain.instIsDomainToSemiringToRingToCommRing.{u1} α _inst_3))))))) -> (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z x) -> (Not (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) z y))) -> (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y)
+Case conversion may be inaccurate. Consider using '#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvdₓ'. -/
-- this should be proved for UFDs surely?
theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
(H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y :=
@@ -99,6 +139,12 @@ theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x =
isCoprime_of_dvd x y nonzero H
#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvd
+/- warning: euclidean_domain.dvd_or_coprime -> EuclideanDomain.dvd_or_coprime is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))) x) -> (Or (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_3 : EuclideanDomain.{u1} α] (x : α) (y : α), (Irreducible.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))) x) -> (Or (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (SemigroupWithZero.toSemigroup.{u1} α (NonUnitalSemiring.toSemigroupWithZero.{u1} α (NonUnitalRing.toNonUnitalSemiring.{u1} α (NonUnitalCommRing.toNonUnitalRing.{u1} α (CommRing.toNonUnitalCommRing.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3))))))) x y) (IsCoprime.{u1} α (CommRing.toCommSemiring.{u1} α (EuclideanDomain.toCommRing.{u1} α _inst_3)) x y))
+Case conversion may be inaccurate. Consider using '#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprimeₓ'. -/
-- this should be proved for UFDs surely?
theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x) :
x ∣ y ∨ IsCoprime x y :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
b ≠ 0 → a * b / b = a
(#12424)
This lets us unify a few lemmas between GroupWithZero
and EuclideanDomain
and two lemmas that were previously proved separately for Nat
, Int
, Polynomial
.
@@ -43,7 +43,7 @@ theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_left p q
obtain ⟨pq0, r0⟩ : GCDMonoid.gcd p q ≠ 0 ∧ r ≠ 0 := mul_ne_zero_iff.mp (hr ▸ hp)
nth_rw 1 [hr]
- rw [mul_comm, EuclideanDomain.mul_div_cancel _ pq0]
+ rw [mul_comm, mul_div_cancel_right₀ _ pq0]
exact r0
#align left_div_gcd_ne_zero left_div_gcd_ne_zero
@@ -51,7 +51,7 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
obtain ⟨r, hr⟩ := GCDMonoid.gcd_dvd_right p q
obtain ⟨pq0, r0⟩ : GCDMonoid.gcd p q ≠ 0 ∧ r ≠ 0 := mul_ne_zero_iff.mp (hr ▸ hq)
nth_rw 1 [hr]
- rw [mul_comm, EuclideanDomain.mul_div_cancel _ pq0]
+ rw [mul_comm, mul_div_cancel_right₀ _ pq0]
exact r0
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -69,7 +69,7 @@ end GCDMonoid
namespace EuclideanDomain
/-- Create a `GCDMonoid` whose `GCDMonoid.gcd` matches `EuclideanDomain.gcd`. -/
--- porting note: added `DecidableEq R`
+-- Porting note: added `DecidableEq R`
def gcdMonoid (R) [EuclideanDomain R] [DecidableEq R] : GCDMonoid R where
gcd := gcd
lcm := lcm
@@ -81,15 +81,15 @@ def gcdMonoid (R) [EuclideanDomain R] [DecidableEq R] : GCDMonoid R where
lcm_zero_right := lcm_zero_right
#align euclidean_domain.gcd_monoid EuclideanDomain.gcdMonoid
-variable {α : Type*} [EuclideanDomain α] [DecidableEq α]
+variable {α : Type*} [EuclideanDomain α]
-theorem span_gcd (x y : α) :
+theorem span_gcd [DecidableEq α] (x y : α) :
span ({gcd x y} : Set α) = span ({x, y} : Set α) :=
letI := EuclideanDomain.gcdMonoid α
_root_.span_gcd x y
#align euclidean_domain.span_gcd EuclideanDomain.span_gcd
-theorem gcd_isUnit_iff {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
+theorem gcd_isUnit_iff [DecidableEq α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
_root_.gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
@@ -97,6 +97,7 @@ theorem gcd_isUnit_iff {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
-- this should be proved for UFDs surely?
theorem isCoprime_of_dvd {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
(H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y :=
+ letI := Classical.decEq α
letI := EuclideanDomain.gcdMonoid α
_root_.isCoprime_of_dvd x y nonzero H
#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvd
@@ -104,6 +105,7 @@ theorem isCoprime_of_dvd {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
-- this should be proved for UFDs surely?
theorem dvd_or_coprime (x y : α) (h : Irreducible x) :
x ∣ y ∨ IsCoprime x y :=
+ letI := Classical.decEq α
letI := EuclideanDomain.gcdMonoid α
_root_.dvd_or_coprime x y h
#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprime
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -29,7 +29,7 @@ open EuclideanDomain Set Ideal
section GCDMonoid
-variable {R : Type _} [EuclideanDomain R] [GCDMonoid R] {p q : R}
+variable {R : Type*} [EuclideanDomain R] [GCDMonoid R] {p q : R}
theorem gcd_ne_zero_of_left (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
@@ -81,7 +81,7 @@ def gcdMonoid (R) [EuclideanDomain R] [DecidableEq R] : GCDMonoid R where
lcm_zero_right := lcm_zero_right
#align euclidean_domain.gcd_monoid EuclideanDomain.gcdMonoid
-variable {α : Type _} [EuclideanDomain α] [DecidableEq α]
+variable {α : Type*} [EuclideanDomain α] [DecidableEq α]
theorem span_gcd (x y : α) :
span ({gcd x y} : Set α) = span ({x, y} : Set α) :=
This of course still works non-computably in the presence of Classical.decEq
, but the caller now has the option.
@@ -23,9 +23,7 @@ euclidean domain
-/
-noncomputable section
-
-open Classical
+section
open EuclideanDomain Set Ideal
@@ -71,7 +69,8 @@ end GCDMonoid
namespace EuclideanDomain
/-- Create a `GCDMonoid` whose `GCDMonoid.gcd` matches `EuclideanDomain.gcd`. -/
-def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R where
+-- porting note: added `DecidableEq R`
+def gcdMonoid (R) [EuclideanDomain R] [DecidableEq R] : GCDMonoid R where
gcd := gcd
lcm := lcm
gcd_dvd_left := gcd_dvd_left
@@ -84,26 +83,26 @@ def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R where
variable {α : Type _} [EuclideanDomain α] [DecidableEq α]
-theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
+theorem span_gcd (x y : α) :
span ({gcd x y} : Set α) = span ({x, y} : Set α) :=
letI := EuclideanDomain.gcdMonoid α
_root_.span_gcd x y
#align euclidean_domain.span_gcd EuclideanDomain.span_gcd
-theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
+theorem gcd_isUnit_iff {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
_root_.gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
-- this should be proved for UFDs surely?
-theorem isCoprime_of_dvd {α} [EuclideanDomain α] {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
+theorem isCoprime_of_dvd {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
(H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
_root_.isCoprime_of_dvd x y nonzero H
#align euclidean_domain.is_coprime_of_dvd EuclideanDomain.isCoprime_of_dvd
-- this should be proved for UFDs surely?
-theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x) :
+theorem dvd_or_coprime (x y : α) (h : Irreducible x) :
x ∣ y ∨ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
_root_.dvd_or_coprime x y h
@@ -2,17 +2,14 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
-
-! This file was ported from Lean 3 source module ring_theory.euclidean_domain
-! leanprover-community/mathlib commit bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.GCDMonoid.Basic
import Mathlib.Algebra.EuclideanDomain.Basic
import Mathlib.RingTheory.Ideal.Basic
import Mathlib.RingTheory.PrincipalIdealDomain
+#align_import ring_theory.euclidean_domain from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6"
+
/-!
# Lemmas about Euclidean domains
Match https://github.com/leanprover-community/mathlib/pull/18652
Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Chris Hughes
! This file was ported from Lean 3 source module ring_theory.euclidean_domain
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! leanprover-community/mathlib commit bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -34,13 +34,13 @@ open EuclideanDomain Set Ideal
section GCDMonoid
-variable {R : Type _} [EuclideanDomain R] [GCDMonoid R]
+variable {R : Type _} [EuclideanDomain R] [GCDMonoid R] {p q : R}
-theorem gcd_ne_zero_of_left (p q : R) (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
+theorem gcd_ne_zero_of_left (hp : p ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_left p q)
#align gcd_ne_zero_of_left gcd_ne_zero_of_left
-theorem gcd_ne_zero_of_right (p q : R) (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
+theorem gcd_ne_zero_of_right (hp : q ≠ 0) : GCDMonoid.gcd p q ≠ 0 := fun h =>
hp <| eq_zero_of_zero_dvd (h ▸ gcd_dvd_right p q)
#align gcd_ne_zero_of_right gcd_ne_zero_of_right
@@ -60,6 +60,15 @@ theorem right_div_gcd_ne_zero {p q : R} (hq : q ≠ 0) : q / GCDMonoid.gcd p q
exact r0
#align right_div_gcd_ne_zero right_div_gcd_ne_zero
+theorem isCoprime_div_gcd_div_gcd (hq : q ≠ 0) :
+ IsCoprime (p / GCDMonoid.gcd p q) (q / GCDMonoid.gcd p q) :=
+ (gcd_isUnit_iff _ _).1 <|
+ isUnit_gcd_of_eq_mul_gcd
+ (EuclideanDomain.mul_div_cancel' (gcd_ne_zero_of_right hq) <| gcd_dvd_left _ _).symm
+ (EuclideanDomain.mul_div_cancel' (gcd_ne_zero_of_right hq) <| gcd_dvd_right _ _).symm <|
+ gcd_ne_zero_of_right hq
+#align is_coprime_div_gcd_div_gcd isCoprime_div_gcd_div_gcd
+
end GCDMonoid
namespace EuclideanDomain
@@ -64,7 +64,7 @@ end GCDMonoid
namespace EuclideanDomain
-/-- Create a `GCDMonoid` whose `gcd_monoid.gcd` matches `EuclideanDomain.gcd`. -/
+/-- Create a `GCDMonoid` whose `GCDMonoid.gcd` matches `EuclideanDomain.gcd`. -/
def gcdMonoid (R) [EuclideanDomain R] : GCDMonoid R where
gcd := gcd
lcm := lcm
@@ -86,7 +86,7 @@ theorem span_gcd {α} [EuclideanDomain α] (x y : α) :
theorem gcd_isUnit_iff {α} [EuclideanDomain α] {x y : α} : IsUnit (gcd x y) ↔ IsCoprime x y :=
letI := EuclideanDomain.gcdMonoid α
- _root_.gcd_isUnit_iff x y
+ _root_.gcd_isUnit_iff x y
#align euclidean_domain.gcd_is_unit_iff EuclideanDomain.gcd_isUnit_iff
-- this should be proved for UFDs surely?
@@ -104,4 +104,3 @@ theorem dvd_or_coprime {α} [EuclideanDomain α] (x y : α) (h : Irreducible x)
#align euclidean_domain.dvd_or_coprime EuclideanDomain.dvd_or_coprime
end EuclideanDomain
-
The unported dependencies are