@@ -191,6 +191,11 @@ theorem dvd_antisymm_of_normalize_eq {a b : α} (ha : normalize a = a) (hb : nor
191
191
ha ▸ hb ▸ normalize_eq_normalize hab hba
192
192
#align dvd_antisymm_of_normalize_eq dvd_antisymm_of_normalize_eq
193
193
194
+ theorem Associated.eq_of_normalized
195
+ {a b : α} (h : Associated a b) (ha : normalize a = a) (hb : normalize b = b) :
196
+ a = b :=
197
+ dvd_antisymm_of_normalize_eq ha hb h.dvd h.dvd'
198
+
194
199
--can be proven by simp
195
200
theorem dvd_normalize_iff {a b : α} : a ∣ normalize b ↔ a ∣ b :=
196
201
Units.dvd_mul_right
@@ -435,6 +440,11 @@ theorem gcd_dvd_gcd [GCDMonoid α] {a b c d : α} (hab : a ∣ b) (hcd : c ∣ d
435
440
dvd_gcd ((gcd_dvd_left _ _).trans hab) ((gcd_dvd_right _ _).trans hcd)
436
441
#align gcd_dvd_gcd gcd_dvd_gcd
437
442
443
+ protected theorem Associated.gcd [GCDMonoid α]
444
+ {a₁ a₂ b₁ b₂ : α} (ha : Associated a₁ a₂) (hb : Associated b₁ b₂) :
445
+ Associated (gcd a₁ b₁) (gcd a₂ b₂) :=
446
+ associated_of_dvd_dvd (gcd_dvd_gcd ha.dvd hb.dvd) (gcd_dvd_gcd ha.dvd' hb.dvd')
447
+
438
448
@[simp]
439
449
theorem gcd_same [NormalizedGCDMonoid α] (a : α) : gcd a a = normalize a :=
440
450
gcd_eq_normalize (gcd_dvd_left _ _) (dvd_gcd (dvd_refl a) (dvd_refl a))
@@ -714,6 +724,24 @@ theorem Irreducible.gcd_eq_one_iff [NormalizedGCDMonoid α] {x y : α} (hx : Irr
714
724
gcd x y = 1 ↔ ¬(x ∣ y) := by
715
725
rw [← hx.isUnit_gcd_iff, ← normalize_eq_one, NormalizedGCDMonoid.normalize_gcd]
716
726
727
+ section Neg
728
+
729
+ variable [HasDistribNeg α]
730
+
731
+ lemma gcd_neg' [GCDMonoid α] {a b : α} : Associated (gcd a (-b)) (gcd a b) :=
732
+ Associated.gcd .rfl (.neg_left .rfl)
733
+
734
+ lemma gcd_neg [NormalizedGCDMonoid α] {a b : α} : gcd a (-b) = gcd a b :=
735
+ gcd_neg'.eq_of_normalized (normalize_gcd _ _) (normalize_gcd _ _)
736
+
737
+ lemma neg_gcd' [GCDMonoid α] {a b : α} : Associated (gcd (-a) b) (gcd a b) :=
738
+ Associated.gcd (.neg_left .rfl) .rfl
739
+
740
+ lemma neg_gcd [NormalizedGCDMonoid α] {a b : α} : gcd (-a) b = gcd a b :=
741
+ neg_gcd'.eq_of_normalized (normalize_gcd _ _) (normalize_gcd _ _)
742
+
743
+ end Neg
744
+
717
745
end GCD
718
746
719
747
section LCM
@@ -799,6 +827,11 @@ theorem lcm_dvd_lcm [GCDMonoid α] {a b c d : α} (hab : a ∣ b) (hcd : c ∣ d
799
827
lcm_dvd (hab.trans (dvd_lcm_left _ _)) (hcd.trans (dvd_lcm_right _ _))
800
828
#align lcm_dvd_lcm lcm_dvd_lcm
801
829
830
+ protected theorem Associated.lcm [GCDMonoid α]
831
+ {a₁ a₂ b₁ b₂ : α} (ha : Associated a₁ a₂) (hb : Associated b₁ b₂) :
832
+ Associated (lcm a₁ b₁) (lcm a₂ b₂) :=
833
+ associated_of_dvd_dvd (lcm_dvd_lcm ha.dvd hb.dvd) (lcm_dvd_lcm ha.dvd' hb.dvd')
834
+
802
835
@[simp]
803
836
theorem lcm_units_coe_left [NormalizedGCDMonoid α] (u : αˣ) (a : α) : lcm (↑u) a = normalize a :=
804
837
lcm_eq_normalize (lcm_dvd Units.coe_dvd dvd_rfl) (dvd_lcm_right _ _)
@@ -1424,16 +1457,6 @@ theorem normalize_eq_one {a : G₀} (h0 : a ≠ 0) : normalize a = 1 := by simp
1424
1457
1425
1458
end CommGroupWithZero
1426
1459
1427
- theorem Associated.gcd [CancelCommMonoidWithZero α] [GCDMonoid α]
1428
- {a₁ a₂ b₁ b₂ : α} (ha : Associated a₁ a₂) (hb : Associated b₁ b₂) :
1429
- Associated (gcd a₁ b₁) (gcd a₂ b₂) :=
1430
- associated_of_dvd_dvd (gcd_dvd_gcd ha.dvd hb.dvd) (gcd_dvd_gcd ha.symm.dvd hb.symm.dvd)
1431
-
1432
- theorem Associated.lcm [CancelCommMonoidWithZero α] [GCDMonoid α]
1433
- {a₁ a₂ b₁ b₂ : α} (ha : Associated a₁ a₂) (hb : Associated b₁ b₂) :
1434
- Associated (lcm a₁ b₁) (lcm a₂ b₂) :=
1435
- associated_of_dvd_dvd (lcm_dvd_lcm ha.dvd hb.dvd) (lcm_dvd_lcm ha.symm.dvd hb.symm.dvd)
1436
-
1437
1460
namespace Associates
1438
1461
1439
1462
variable [CancelCommMonoidWithZero α] [GCDMonoid α]
0 commit comments