@@ -28,14 +28,14 @@ is_unit_iff_dvd_one.2 $ xy.trans $ is_unit_iff_dvd_one.1 hu
28
28
lemma is_unit_of_dvd_one [comm_monoid α] : ∀a ∣ 1 , is_unit (a:α)
29
29
| a ⟨b, eq⟩ := ⟨units.mk_of_mul_eq_one a b eq.symm, rfl⟩
30
30
31
- lemma dvd_and_not_dvd_iff [comm_cancel_monoid_with_zero α] {x y : α} :
31
+ lemma dvd_and_not_dvd_iff [cancel_comm_monoid_with_zero α] {x y : α} :
32
32
x ∣ y ∧ ¬y ∣ x ↔ dvd_not_unit x y :=
33
33
⟨λ ⟨⟨d, hd⟩, hyx⟩, ⟨λ hx0, by simpa [hx0] using hyx, ⟨d,
34
34
mt is_unit_iff_dvd_one.1 (λ ⟨e, he⟩, hyx ⟨e, by rw [hd, mul_assoc, ← he, mul_one]⟩), hd⟩⟩,
35
35
λ ⟨hx0, d, hdu, hdx⟩, ⟨⟨d, hdx⟩, λ ⟨e, he⟩, hdu (is_unit_of_dvd_one _
36
36
⟨e, mul_left_cancel₀ hx0 $ by conv {to_lhs, rw [he, hdx]};simp [mul_assoc]⟩)⟩⟩
37
37
38
- lemma pow_dvd_pow_iff [comm_cancel_monoid_with_zero α]
38
+ lemma pow_dvd_pow_iff [cancel_comm_monoid_with_zero α]
39
39
{x : α} {n m : ℕ} (h0 : x ≠ 0 ) (h1 : ¬ is_unit x) :
40
40
x ^ n ∣ x ^ m ↔ n ≤ m :=
41
41
begin
@@ -117,7 +117,7 @@ end prime
117
117
118
118
end prime
119
119
120
- lemma prime.left_dvd_or_dvd_right_of_dvd_mul [comm_cancel_monoid_with_zero α] {p : α}
120
+ lemma prime.left_dvd_or_dvd_right_of_dvd_mul [cancel_comm_monoid_with_zero α] {p : α}
121
121
(hp : prime p) {a b : α} : a ∣ p * b → p ∣ a ∨ a ∣ b :=
122
122
begin
123
123
rintro ⟨c, hc⟩,
@@ -176,7 +176,7 @@ begin
176
176
exact H _ o.1 _ o.2 h.symm
177
177
end
178
178
179
- protected lemma prime.irreducible [comm_cancel_monoid_with_zero α] {p : α} (hp : prime p) :
179
+ protected lemma prime.irreducible [cancel_comm_monoid_with_zero α] {p : α} (hp : prime p) :
180
180
irreducible p :=
181
181
⟨hp.not_unit, λ a b hab,
182
182
(show a * b ∣ a ∨ a * b ∣ b, from hab ▸ hp.dvd_or_dvd (hab ▸ dvd_rfl)).elim
@@ -187,7 +187,7 @@ protected lemma prime.irreducible [comm_cancel_monoid_with_zero α] {p : α} (hp
187
187
⟨x, mul_right_cancel₀ (show b ≠ 0 , from λ h, by simp [*, prime] at *)
188
188
$ by conv {to_lhs, rw hx}; simp [mul_comm, mul_assoc, mul_left_comm]⟩))⟩
189
189
190
- lemma succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul [comm_cancel_monoid_with_zero α]
190
+ lemma succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul [cancel_comm_monoid_with_zero α]
191
191
{p : α} (hp : prime p) {a b : α} {k l : ℕ} :
192
192
p ^ k ∣ a → p ^ l ∣ b → p ^ ((k + l) + 1 ) ∣ a * b → p ^ (k + 1 ) ∣ a ∨ p ^ (l + 1 ) ∣ b :=
193
193
λ ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩,
318
318
theorem dvd_dvd_iff_associated [cancel_monoid_with_zero α] {a b : α} : a ∣ b ∧ b ∣ a ↔ a ~ᵤ b :=
319
319
⟨λ ⟨h1, h2⟩, associated_of_dvd_dvd h1 h2, associated.dvd_dvd⟩
320
320
321
- lemma exists_associated_mem_of_dvd_prod [comm_cancel_monoid_with_zero α] {p : α}
321
+ lemma exists_associated_mem_of_dvd_prod [cancel_comm_monoid_with_zero α] {p : α}
322
322
(hp : prime p) {s : multiset α} : (∀ r ∈ s, prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q :=
323
323
multiset.induction_on s (by simp [mt is_unit_iff_dvd_one.2 hp.not_unit])
324
324
(λ a s ih hs hps, begin
@@ -362,11 +362,11 @@ lemma irreducible.dvd_irreducible_iff_associated [cancel_monoid_with_zero α]
362
362
p ∣ q ↔ associated p q :=
363
363
⟨irreducible.associated_of_dvd pp qp, associated.dvd⟩
364
364
365
- lemma prime.associated_of_dvd [comm_cancel_monoid_with_zero α] {p q : α}
365
+ lemma prime.associated_of_dvd [cancel_comm_monoid_with_zero α] {p q : α}
366
366
(p_prime : prime p) (q_prime : prime q) (dvd : p ∣ q) : associated p q :=
367
367
p_prime.irreducible.associated_of_dvd q_prime.irreducible dvd
368
368
369
- theorem prime.dvd_prime_iff_associated [comm_cancel_monoid_with_zero α]
369
+ theorem prime.dvd_prime_iff_associated [cancel_comm_monoid_with_zero α]
370
370
{p q : α} (pp : prime p) (qp : prime q) :
371
371
p ∣ q ↔ associated p q :=
372
372
pp.irreducible.dvd_irreducible_iff_associated qp.irreducible
@@ -393,7 +393,7 @@ protected lemma associated.irreducible_iff [monoid α] {p q : α} (h : p ~ᵤ q)
393
393
irreducible p ↔ irreducible q :=
394
394
⟨h.irreducible, h.symm.irreducible⟩
395
395
396
- lemma associated.of_mul_left [comm_cancel_monoid_with_zero α] {a b c d : α}
396
+ lemma associated.of_mul_left [cancel_comm_monoid_with_zero α] {a b c d : α}
397
397
(h : a * b ~ᵤ c * d) (h₁ : a ~ᵤ c) (ha : a ≠ 0 ) : b ~ᵤ d :=
398
398
let ⟨u, hu⟩ := h in let ⟨v, hv⟩ := associated.symm h₁ in
399
399
⟨u * (v : units α), mul_left_cancel₀ ha
@@ -402,7 +402,7 @@ let ⟨u, hu⟩ := h in let ⟨v, hv⟩ := associated.symm h₁ in
402
402
simp [hv.symm, mul_assoc, mul_comm, mul_left_comm]
403
403
end ⟩
404
404
405
- lemma associated.of_mul_right [comm_cancel_monoid_with_zero α] {a b c d : α} :
405
+ lemma associated.of_mul_right [cancel_comm_monoid_with_zero α] {a b c d : α} :
406
406
a * b ~ᵤ c * d → b ~ᵤ d → b ≠ 0 → a ~ᵤ c :=
407
407
by rw [mul_comm a, mul_comm c]; exact associated.of_mul_left
408
408
715
715
716
716
end comm_monoid_with_zero
717
717
718
- section comm_cancel_monoid_with_zero
719
- variable [comm_cancel_monoid_with_zero α]
718
+ section cancel_comm_monoid_with_zero
719
+ variable [cancel_comm_monoid_with_zero α]
720
720
721
721
instance : partial_order (associates α) :=
722
722
{ le_antisymm := λ a' b', quotient.induction_on₂ a' b' (λ a b hab hba,
@@ -770,7 +770,7 @@ match h m d dvd_rfl with
770
770
or.inl $ bot_unique $ associates.le_of_mul_le_mul_left d m 1 ‹d ≠ 0 › this
771
771
end
772
772
773
- instance : comm_cancel_monoid_with_zero (associates α) :=
773
+ instance : cancel_comm_monoid_with_zero (associates α) :=
774
774
{ mul_left_cancel_of_ne_zero := eq_of_mul_eq_mul_left,
775
775
mul_right_cancel_of_ne_zero := eq_of_mul_eq_mul_right,
776
776
.. (infer_instance : comm_monoid_with_zero (associates α)) }
@@ -779,13 +779,13 @@ theorem dvd_not_unit_iff_lt {a b : associates α} :
779
779
dvd_not_unit a b ↔ a < b :=
780
780
dvd_and_not_dvd_iff.symm
781
781
782
- end comm_cancel_monoid_with_zero
782
+ end cancel_comm_monoid_with_zero
783
783
784
784
end associates
785
785
786
786
namespace multiset
787
787
788
- lemma prod_ne_zero_of_prime [comm_cancel_monoid_with_zero α] [nontrivial α]
788
+ lemma prod_ne_zero_of_prime [cancel_comm_monoid_with_zero α] [nontrivial α]
789
789
(s : multiset α) (h : ∀ x ∈ s, prime x) : s.prod ≠ 0 :=
790
790
multiset.prod_ne_zero (λ h0, prime.ne_zero (h 0 h0) rfl)
791
791
0 commit comments