Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 0b87b0a

Browse files
committed
chore(algebra/group_with_zero/defs: Rename comm_cancel_monoid_with_zero to cancel_comm_monoid_with_zero (#10669)
We currently have `cancel_comm_monoid` but `comm_cancel_monoid_with_zero`. This renames the latter to follow the former. Replaced `comm_cancel_` by `cancel_comm_` everywhere.
1 parent 52c2f74 commit 0b87b0a

File tree

15 files changed

+75
-75
lines changed

15 files changed

+75
-75
lines changed

src/algebra/associated.lean

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ is_unit_iff_dvd_one.2 $ xy.trans $ is_unit_iff_dvd_one.1 hu
2828
lemma is_unit_of_dvd_one [comm_monoid α] : ∀a ∣ 1, is_unit (a:α)
2929
| a ⟨b, eq⟩ := ⟨units.mk_of_mul_eq_one a b eq.symm, rfl⟩
3030

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 : α} :
3232
x ∣ y ∧ ¬y ∣ x ↔ dvd_not_unit x y :=
3333
⟨λ ⟨⟨d, hd⟩, hyx⟩, ⟨λ hx0, by simpa [hx0] using hyx, ⟨d,
3434
mt is_unit_iff_dvd_one.1 (λ ⟨e, he⟩, hyx ⟨e, by rw [hd, mul_assoc, ← he, mul_one]⟩), hd⟩⟩,
3535
λ ⟨hx0, d, hdu, hdx⟩, ⟨⟨d, hdx⟩, λ ⟨e, he⟩, hdu (is_unit_of_dvd_one _
3636
⟨e, mul_left_cancel₀ hx0 $ by conv {to_lhs, rw [he, hdx]};simp [mul_assoc]⟩)⟩⟩
3737

38-
lemma pow_dvd_pow_iff [comm_cancel_monoid_with_zero α]
38+
lemma pow_dvd_pow_iff [cancel_comm_monoid_with_zero α]
3939
{x : α} {n m : ℕ} (h0 : x ≠ 0) (h1 : ¬ is_unit x) :
4040
x ^ n ∣ x ^ m ↔ n ≤ m :=
4141
begin
@@ -117,7 +117,7 @@ end prime
117117

118118
end prime
119119

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 : α}
121121
(hp : prime p) {a b : α} : a ∣ p * b → p ∣ a ∨ a ∣ b :=
122122
begin
123123
rintro ⟨c, hc⟩,
@@ -176,7 +176,7 @@ begin
176176
exact H _ o.1 _ o.2 h.symm
177177
end
178178

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) :
180180
irreducible p :=
181181
⟨hp.not_unit, λ a b hab,
182182
(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
187187
⟨x, mul_right_cancel₀ (show b ≠ 0, from λ h, by simp [*, prime] at *)
188188
$ by conv {to_lhs, rw hx}; simp [mul_comm, mul_assoc, mul_left_comm]⟩))⟩
189189

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 α]
191191
{p : α} (hp : prime p) {a b : α} {k l : ℕ} :
192192
p ^ k ∣ a → p ^ l ∣ b → p ^ ((k + l) + 1) ∣ a * b → p ^ (k + 1) ∣ a ∨ p ^ (l + 1) ∣ b :=
193193
λ ⟨x, hx⟩ ⟨y, hy⟩ ⟨z, hz⟩,
@@ -318,7 +318,7 @@ end
318318
theorem dvd_dvd_iff_associated [cancel_monoid_with_zero α] {a b : α} : a ∣ b ∧ b ∣ a ↔ a ~ᵤ b :=
319319
⟨λ ⟨h1, h2⟩, associated_of_dvd_dvd h1 h2, associated.dvd_dvd⟩
320320

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 : α}
322322
(hp : prime p) {s : multiset α} : (∀ r ∈ s, prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q :=
323323
multiset.induction_on s (by simp [mt is_unit_iff_dvd_one.2 hp.not_unit])
324324
(λ a s ih hs hps, begin
@@ -362,11 +362,11 @@ lemma irreducible.dvd_irreducible_iff_associated [cancel_monoid_with_zero α]
362362
p ∣ q ↔ associated p q :=
363363
⟨irreducible.associated_of_dvd pp qp, associated.dvd⟩
364364

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 : α}
366366
(p_prime : prime p) (q_prime : prime q) (dvd : p ∣ q) : associated p q :=
367367
p_prime.irreducible.associated_of_dvd q_prime.irreducible dvd
368368

369-
theorem prime.dvd_prime_iff_associated [comm_cancel_monoid_with_zero α]
369+
theorem prime.dvd_prime_iff_associated [cancel_comm_monoid_with_zero α]
370370
{p q : α} (pp : prime p) (qp : prime q) :
371371
p ∣ q ↔ associated p q :=
372372
pp.irreducible.dvd_irreducible_iff_associated qp.irreducible
@@ -393,7 +393,7 @@ protected lemma associated.irreducible_iff [monoid α] {p q : α} (h : p ~ᵤ q)
393393
irreducible p ↔ irreducible q :=
394394
⟨h.irreducible, h.symm.irreducible⟩
395395

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 : α}
397397
(h : a * b ~ᵤ c * d) (h₁ : a ~ᵤ c) (ha : a ≠ 0) : b ~ᵤ d :=
398398
let ⟨u, hu⟩ := h in let ⟨v, hv⟩ := associated.symm h₁ in
399399
⟨u * (v : units α), mul_left_cancel₀ ha
@@ -402,7 +402,7 @@ let ⟨u, hu⟩ := h in let ⟨v, hv⟩ := associated.symm h₁ in
402402
simp [hv.symm, mul_assoc, mul_comm, mul_left_comm]
403403
end
404404

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 : α} :
406406
a * b ~ᵤ c * d → b ~ᵤ d → b ≠ 0 → a ~ᵤ c :=
407407
by rw [mul_comm a, mul_comm c]; exact associated.of_mul_left
408408

@@ -715,8 +715,8 @@ end
715715

716716
end comm_monoid_with_zero
717717

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 α]
720720

721721
instance : partial_order (associates α) :=
722722
{ le_antisymm := λ a' b', quotient.induction_on₂ a' b' (λ a b hab hba,
@@ -770,7 +770,7 @@ match h m d dvd_rfl with
770770
or.inl $ bot_unique $ associates.le_of_mul_le_mul_left d m 1 ‹d ≠ 0this
771771
end
772772

773-
instance : comm_cancel_monoid_with_zero (associates α) :=
773+
instance : cancel_comm_monoid_with_zero (associates α) :=
774774
{ mul_left_cancel_of_ne_zero := eq_of_mul_eq_mul_left,
775775
mul_right_cancel_of_ne_zero := eq_of_mul_eq_mul_right,
776776
.. (infer_instance : comm_monoid_with_zero (associates α)) }
@@ -779,13 +779,13 @@ theorem dvd_not_unit_iff_lt {a b : associates α} :
779779
dvd_not_unit a b ↔ a < b :=
780780
dvd_and_not_dvd_iff.symm
781781

782-
end comm_cancel_monoid_with_zero
782+
end cancel_comm_monoid_with_zero
783783

784784
end associates
785785

786786
namespace multiset
787787

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 α]
789789
(s : multiset α) (h : ∀ x ∈ s, prime x) : s.prod ≠ 0 :=
790790
multiset.prod_ne_zero (λ h0, prime.ne_zero (h 0 h0) rfl)
791791

src/algebra/divisibility.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ exists_congr $ λ d, by rw [mul_assoc, mul_right_inj' ha]
160160

161161
/-- Given two elements `a`, `b` of a commutative `cancel_monoid_with_zero` and a nonzero
162162
element `c`, `a*c` divides `b*c` iff `a` divides `b`. -/
163-
theorem mul_dvd_mul_iff_right [comm_cancel_monoid_with_zero α] {a b c : α} (hc : c ≠ 0) :
163+
theorem mul_dvd_mul_iff_right [cancel_comm_monoid_with_zero α] {a b c : α} (hc : c ≠ 0) :
164164
a * c ∣ b * c ↔ a ∣ b :=
165165
exists_congr $ λ d, by rw [mul_right_comm, mul_left_inj' hc]
166166

src/algebra/gcd_monoid/basic.lean

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import algebra.group_power.lemmas
1010
/-!
1111
# Monoids with normalization functions, `gcd`, and `lcm`
1212
13-
This file defines extra structures on `comm_cancel_monoid_with_zero`s, including `is_domain`s.
13+
This file defines extra structures on `cancel_comm_monoid_with_zero`s, including `is_domain`s.
1414
1515
## Main Definitions
1616
@@ -69,7 +69,7 @@ variables {α : Type*}
6969
/-- Normalization monoid: multiplying with `norm_unit` gives a normal form for associated
7070
elements. -/
7171
@[protect_proj] class normalization_monoid (α : Type*)
72-
[comm_cancel_monoid_with_zero α] :=
72+
[cancel_comm_monoid_with_zero α] :=
7373
(norm_unit : α → units α)
7474
(norm_unit_zero : norm_unit 0 = 1)
7575
(norm_unit_mul : ∀{a b}, a ≠ 0 → b ≠ 0 → norm_unit (a * b) = norm_unit a * norm_unit b)
@@ -80,7 +80,7 @@ export normalization_monoid (norm_unit norm_unit_zero norm_unit_mul norm_unit_co
8080
attribute [simp] norm_unit_coe_units norm_unit_zero norm_unit_mul
8181

8282
section normalization_monoid
83-
variables [comm_cancel_monoid_with_zero α] [normalization_monoid α]
83+
variables [cancel_comm_monoid_with_zero α] [normalization_monoid α]
8484

8585
@[simp] theorem norm_unit_one : norm_unit (1:α) = 1 :=
8686
norm_unit_coe_units 1
@@ -162,7 +162,7 @@ units.mul_right_dvd
162162
end normalization_monoid
163163

164164
namespace associates
165-
variables [comm_cancel_monoid_with_zero α] [normalization_monoid α]
165+
variables [cancel_comm_monoid_with_zero α] [normalization_monoid α]
166166

167167
local attribute [instance] associated.setoid
168168

@@ -202,11 +202,11 @@ function.left_inverse.injective mk_out
202202

203203
end associates
204204

205-
/-- GCD monoid: a `comm_cancel_monoid_with_zero` with `gcd` (greatest common divisor) and
205+
/-- GCD monoid: a `cancel_comm_monoid_with_zero` with `gcd` (greatest common divisor) and
206206
`lcm` (least common multiple) operations, determined up to a unit. The type class focuses on `gcd`
207207
and we derive the corresponding `lcm` facts from `gcd`.
208208
-/
209-
@[protect_proj] class gcd_monoid (α : Type*) [comm_cancel_monoid_with_zero α] :=
209+
@[protect_proj] class gcd_monoid (α : Type*) [cancel_comm_monoid_with_zero α] :=
210210
(gcd : α → α → α)
211211
(lcm : α → α → α)
212212
(gcd_dvd_left : ∀a b, gcd a b ∣ a)
@@ -216,13 +216,13 @@ and we derive the corresponding `lcm` facts from `gcd`.
216216
(lcm_zero_left : ∀a, lcm 0 a = 0)
217217
(lcm_zero_right : ∀a, lcm a 0 = 0)
218218

219-
/-- Normalized GCD monoid: a `comm_cancel_monoid_with_zero` with normalization and `gcd`
219+
/-- Normalized GCD monoid: a `cancel_comm_monoid_with_zero` with normalization and `gcd`
220220
(greatest common divisor) and `lcm` (least common multiple) operations. In this setting `gcd` and
221221
`lcm` form a bounded lattice on the associated elements where `gcd` is the infimum, `lcm` is the
222222
supremum, `1` is bottom, and `0` is top. The type class focuses on `gcd` and we derive the
223223
corresponding `lcm` facts from `gcd`.
224224
-/
225-
class normalized_gcd_monoid (α : Type*) [comm_cancel_monoid_with_zero α]
225+
class normalized_gcd_monoid (α : Type*) [cancel_comm_monoid_with_zero α]
226226
extends normalization_monoid α, gcd_monoid α :=
227227
(normalize_gcd : ∀a b, normalize (gcd a b) = gcd a b)
228228
(normalize_lcm : ∀a b, normalize (lcm a b) = lcm a b)
@@ -233,7 +233,7 @@ export gcd_monoid (gcd lcm gcd_dvd_left gcd_dvd_right dvd_gcd lcm_zero_left lcm
233233
attribute [simp] lcm_zero_left lcm_zero_right
234234

235235
section gcd_monoid
236-
variables [comm_cancel_monoid_with_zero α]
236+
variables [cancel_comm_monoid_with_zero α]
237237

238238
@[simp] theorem normalize_gcd [normalized_gcd_monoid α] : ∀a b:α, normalize (gcd a b) = gcd a b :=
239239
normalized_gcd_monoid.normalize_gcd
@@ -700,7 +700,7 @@ end gcd_monoid
700700

701701
section unique_unit
702702

703-
variables [comm_cancel_monoid_with_zero α] [unique (units α)]
703+
variables [cancel_comm_monoid_with_zero α] [unique (units α)]
704704

705705
@[priority 100] -- see Note [lower instance priority]
706706
instance normalization_monoid_of_unique_units : normalization_monoid α :=
@@ -754,7 +754,7 @@ noncomputable theory
754754

755755
open associates
756756

757-
variables [comm_cancel_monoid_with_zero α]
757+
variables [cancel_comm_monoid_with_zero α]
758758

759759
private lemma map_mk_unit_aux [decidable_eq α] {f : associates α →* α}
760760
(hinv : function.right_inverse f associates.mk) (a : α) :

src/algebra/gcd_monoid/finset.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ variables {α β γ : Type*}
3131
namespace finset
3232
open multiset
3333

34-
variables [comm_cancel_monoid_with_zero α] [normalized_gcd_monoid α]
34+
variables [cancel_comm_monoid_with_zero α] [normalized_gcd_monoid α]
3535

3636
/-! ### lcm -/
3737
section lcm

src/algebra/gcd_monoid/multiset.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ multiset, gcd
2424
-/
2525

2626
namespace multiset
27-
variables {α : Type*} [comm_cancel_monoid_with_zero α] [normalized_gcd_monoid α]
27+
variables {α : Type*} [cancel_comm_monoid_with_zero α] [normalized_gcd_monoid α]
2828

2929
/-! ### lcm -/
3030
section lcm

src/algebra/group_with_zero/basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,22 +470,22 @@ classical.by_contradiction $ λ ha, h₁ $ mul_right_cancel₀ ha $ h₂.symm
470470

471471
end cancel_monoid_with_zero
472472

473-
section comm_cancel_monoid_with_zero
473+
section cancel_comm_monoid_with_zero
474474

475-
variables [comm_cancel_monoid_with_zero M₀] {a b c : M₀}
475+
variables [cancel_comm_monoid_with_zero M₀] {a b c : M₀}
476476

477-
/-- Pullback a `comm_cancel_monoid_with_zero` class along an injective function.
477+
/-- Pullback a `cancel_comm_monoid_with_zero` class along an injective function.
478478
See note [reducible non-instances]. -/
479479
@[reducible]
480-
protected def function.injective.comm_cancel_monoid_with_zero
480+
protected def function.injective.cancel_comm_monoid_with_zero
481481
[has_zero M₀'] [has_mul M₀'] [has_one M₀']
482482
(f : M₀' → M₀) (hf : injective f) (zero : f 0 = 0) (one : f 1 = 1)
483483
(mul : ∀ x y, f (x * y) = f x * f y) :
484-
comm_cancel_monoid_with_zero M₀' :=
484+
cancel_comm_monoid_with_zero M₀' :=
485485
{ .. hf.comm_monoid_with_zero f zero one mul,
486486
.. hf.cancel_monoid_with_zero f zero one mul }
487487

488-
end comm_cancel_monoid_with_zero
488+
end cancel_comm_monoid_with_zero
489489

490490
section group_with_zero
491491
variables [group_with_zero G₀] {a b c g h x : G₀}
@@ -931,7 +931,7 @@ section comm_group_with_zero -- comm
931931
variables [comm_group_with_zero G₀] {a b c : G₀}
932932

933933
@[priority 10] -- see Note [lower instance priority]
934-
instance comm_group_with_zero.comm_cancel_monoid_with_zero : comm_cancel_monoid_with_zero G₀ :=
934+
instance comm_group_with_zero.cancel_comm_monoid_with_zero : cancel_comm_monoid_with_zero G₀ :=
935935
{ ..group_with_zero.cancel_monoid_with_zero, ..comm_group_with_zero.to_comm_monoid_with_zero G₀ }
936936

937937
/-- Pullback a `comm_group_with_zero` class along an injective function.

src/algebra/group_with_zero/defs.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ element, and `0` is left and right absorbing. -/
101101
@[protect_proj]
102102
class comm_monoid_with_zero (M₀ : Type*) extends comm_monoid M₀, monoid_with_zero M₀.
103103

104-
/-- A type `M` is a `comm_cancel_monoid_with_zero` if it is a commutative monoid with zero element,
104+
/-- A type `M` is a `cancel_comm_monoid_with_zero` if it is a commutative monoid with zero element,
105105
`0` is left and right absorbing,
106106
and left/right multiplication by a non-zero element is injective. -/
107-
@[protect_proj] class comm_cancel_monoid_with_zero (M₀ : Type*) extends
107+
@[protect_proj] class cancel_comm_monoid_with_zero (M₀ : Type*) extends
108108
comm_monoid_with_zero M₀, cancel_monoid_with_zero M₀.
109109

110110
/-- A type `G₀` is a “group with zero” if it is a monoid with zero element (distinct from `1`)

src/algebra/punit_instances.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ by refine
4444
.. };
4545
intros; exact subsingleton.elim _ _
4646

47-
instance : comm_cancel_monoid_with_zero punit :=
47+
instance : cancel_comm_monoid_with_zero punit :=
4848
by refine
4949
{ .. punit.comm_ring,
5050
.. };

src/algebra/ring/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ section comm_ring
10221022
variables [comm_ring α] [is_domain α]
10231023

10241024
@[priority 100] -- see Note [lower instance priority]
1025-
instance is_domain.to_comm_cancel_monoid_with_zero : comm_cancel_monoid_with_zero α :=
1025+
instance is_domain.to_cancel_comm_monoid_with_zero : cancel_comm_monoid_with_zero α :=
10261026
{ ..comm_semiring.to_comm_monoid_with_zero, ..is_domain.to_cancel_monoid_with_zero }
10271027

10281028
lemma mul_self_eq_mul_self_iff {a b : α} : a * a = b * b ↔ a = b ∨ a = -b :=

src/algebra/squarefree.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ begin
6161
end
6262

6363
@[simp]
64-
lemma prime.squarefree [comm_cancel_monoid_with_zero R] {x : R} (h : prime x) :
64+
lemma prime.squarefree [cancel_comm_monoid_with_zero R] {x : R} (h : prime x) :
6565
squarefree x :=
6666
h.irreducible.squarefree
6767

@@ -86,7 +86,7 @@ end
8686
end multiplicity
8787

8888
namespace unique_factorization_monoid
89-
variables [comm_cancel_monoid_with_zero R] [nontrivial R] [unique_factorization_monoid R]
89+
variables [cancel_comm_monoid_with_zero R] [nontrivial R] [unique_factorization_monoid R]
9090
variables [normalization_monoid R]
9191

9292
lemma squarefree_iff_nodup_normalized_factors [decidable_eq R] {x : R} (x0 : x ≠ 0) :

0 commit comments

Comments
 (0)