@@ -53,7 +53,7 @@ structure add_units (α : Type u) [add_monoid α] :=
53
53
(val_neg : val + neg = 0 )
54
54
(neg_val : neg + val = 0 )
55
55
56
- attribute [to_additive add_units ] units
56
+ attribute [to_additive] units
57
57
58
58
section has_elem
59
59
@@ -278,12 +278,12 @@ variables {M : Type*} {N : Type*}
278
278
/-- An element `a : M` of a monoid is a unit if it has a two-sided inverse.
279
279
The actual definition says that `a` is equal to some `u : Mˣ`, where
280
280
`Mˣ` is a bundled version of `is_unit`. -/
281
- @[to_additive is_add_unit " An element `a : M` of an add_monoid is an `add_unit` if it has
281
+ @[to_additive " An element `a : M` of an add_monoid is an `add_unit` if it has
282
282
a two-sided additive inverse. The actual definition says that `a` is equal to some
283
283
`u : add_units M`, where `add_units M` is a bundled version of `is_add_unit`." ]
284
284
def is_unit [monoid M] (a : M) : Prop := ∃ u : Mˣ, (u : M) = a
285
285
286
- @[nontriviality, to_additive is_add_unit_of_subsingleton ]
286
+ @[nontriviality, to_additive]
287
287
lemma is_unit_of_subsingleton [monoid M] [subsingleton M] (a : M) : is_unit a :=
288
288
⟨⟨a, a, subsingleton.elim _ _, subsingleton.elim _ _⟩, rfl⟩
289
289
@@ -301,10 +301,10 @@ attribute [nontriviality] is_add_unit_of_subsingleton
301
301
@[simp, to_additive is_add_unit_add_unit]
302
302
protected lemma units.is_unit [monoid M] (u : Mˣ) : is_unit (u : M) := ⟨u, rfl⟩
303
303
304
- @[simp, to_additive is_add_unit_zero ]
304
+ @[simp, to_additive]
305
305
theorem is_unit_one [monoid M] : is_unit (1 :M) := ⟨1 , rfl⟩
306
306
307
- @[to_additive is_add_unit_of_add_eq_zero ] theorem is_unit_of_mul_eq_one [comm_monoid M]
307
+ @[to_additive] theorem is_unit_of_mul_eq_one [comm_monoid M]
308
308
(a b : M) (h : a * b = 1 ) : is_unit a :=
309
309
⟨units.mk_of_mul_eq_one a b h, rfl⟩
310
310
@@ -316,12 +316,12 @@ by { rcases h with ⟨⟨a, b, hab, _⟩, rfl⟩, exact ⟨b, hab⟩ }
316
316
{a : M} (h : is_unit a) : ∃ b, b * a = 1 :=
317
317
by { rcases h with ⟨⟨a, b, _, hba⟩, rfl⟩, exact ⟨b, hba⟩ }
318
318
319
- @[to_additive is_add_unit_iff_exists_neg ] theorem is_unit_iff_exists_inv [comm_monoid M]
319
+ @[to_additive] theorem is_unit_iff_exists_inv [comm_monoid M]
320
320
{a : M} : is_unit a ↔ ∃ b, a * b = 1 :=
321
321
⟨λ h, h.exists_right_inv,
322
322
λ ⟨b, hab⟩, is_unit_of_mul_eq_one _ b hab⟩
323
323
324
- @[to_additive is_add_unit_iff_exists_neg' ] theorem is_unit_iff_exists_inv' [comm_monoid M]
324
+ @[to_additive] theorem is_unit_iff_exists_inv' [comm_monoid M]
325
325
{a : M} : is_unit a ↔ ∃ b, b * a = 1 :=
326
326
by simp [is_unit_iff_exists_inv, mul_comm]
327
327
@@ -330,7 +330,7 @@ lemma is_unit.mul [monoid M] {x y : M} : is_unit x → is_unit y → is_unit (x
330
330
by { rintros ⟨x, rfl⟩ ⟨y, rfl⟩, exact ⟨x * y, units.coe_mul _ _⟩ }
331
331
332
332
/-- Multiplication by a `u : Mˣ` on the right doesn't affect `is_unit`. -/
333
- @[simp, to_additive is_add_unit_add_add_units " Addition of a `u : add_units M` on the right doesn't
333
+ @[simp, to_additive " Addition of a `u : add_units M` on the right doesn't
334
334
affect `is_add_unit`." ]
335
335
theorem units.is_unit_mul_units [monoid M] (a : M) (u : Mˣ) :
336
336
is_unit (a * u) ↔ is_unit a :=
@@ -341,8 +341,7 @@ iff.intro
341
341
(λ v, v.mul u.is_unit)
342
342
343
343
/-- Multiplication by a `u : Mˣ` on the left doesn't affect `is_unit`. -/
344
- @[simp, to_additive is_add_unit_add_units_add " Addition of a `u : add_units M` on the left doesn't
345
- affect `is_add_unit`." ]
344
+ @[simp, to_additive " Addition of a `u : add_units M` on the left doesn't affect `is_add_unit`." ]
346
345
theorem units.is_unit_units_mul {M : Type *} [monoid M] (u : Mˣ) (a : M) :
347
346
is_unit (↑u * a) ↔ is_unit a :=
348
347
iff.intro
@@ -351,7 +350,7 @@ iff.intro
351
350
by rwa [←mul_assoc, units.inv_mul, one_mul] at this )
352
351
u.is_unit.mul
353
352
354
- @[to_additive is_add_unit_of_add_is_add_unit_left ]
353
+ @[to_additive]
355
354
theorem is_unit_of_mul_is_unit_left [comm_monoid M] {x y : M}
356
355
(hu : is_unit (x * y)) : is_unit x :=
357
356
let ⟨z, hz⟩ := is_unit_iff_exists_inv.1 hu in
0 commit comments