@@ -3,11 +3,13 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Jeremy Avigad, Leonardo de Moura, Simon Hudon, Mario Carneiro
5
5
-/
6
- import Mathlib.Init.ZeroOne
7
6
import Mathlib.Init.Data.Int.Basic
8
- import Mathlib.Logic.Function.Basic
9
- import Mathlib.Tactic.Basic
10
7
import Mathlib.Init.ZeroOne
8
+ import Mathlib.Tactic.Lemma
9
+ import Mathlib.Tactic.TypeStar
10
+ import Mathlib.Tactic.Simps.Basic
11
+ import Mathlib.Tactic.ToAdditive
12
+ import Mathlib.Util.AssertExists
11
13
12
14
#align_import algebra.group.defs from "leanprover-community/mathlib" @"48fb5b5280e7c81672afc9524185ae994553ebf4"
13
15
@@ -221,27 +223,10 @@ theorem mul_left_cancel : a * b = a * c → b = c :=
221
223
222
224
@[to_additive]
223
225
theorem mul_left_cancel_iff : a * b = a * c ↔ b = c :=
224
- ⟨mul_left_cancel, congr_arg _⟩
226
+ ⟨mul_left_cancel, congrArg _⟩
225
227
#align mul_left_cancel_iff mul_left_cancel_iff
226
228
#align add_left_cancel_iff add_left_cancel_iff
227
229
228
- @[to_additive]
229
- theorem mul_right_injective (a : G) : Injective (a * ·) := fun _ _ ↦ mul_left_cancel
230
- #align mul_right_injective mul_right_injective
231
- #align add_right_injective add_right_injective
232
-
233
- @[to_additive (attr := simp)]
234
- theorem mul_right_inj (a : G) {b c : G} : a * b = a * c ↔ b = c :=
235
- (mul_right_injective a).eq_iff
236
- #align mul_right_inj mul_right_inj
237
- #align add_right_inj add_right_inj
238
-
239
- @[to_additive]
240
- theorem mul_ne_mul_right (a : G) {b c : G} : a * b ≠ a * c ↔ b ≠ c :=
241
- (mul_right_injective a).ne_iff
242
- #align mul_ne_mul_right mul_ne_mul_right
243
- #align add_ne_add_right add_ne_add_right
244
-
245
230
end IsLeftCancelMul
246
231
247
232
section IsRightCancelMul
@@ -256,27 +241,10 @@ theorem mul_right_cancel : a * b = c * b → a = c :=
256
241
257
242
@[to_additive]
258
243
theorem mul_right_cancel_iff : b * a = c * a ↔ b = c :=
259
- ⟨mul_right_cancel, congr_arg (· * a)⟩
244
+ ⟨mul_right_cancel, congrArg (· * a)⟩
260
245
#align mul_right_cancel_iff mul_right_cancel_iff
261
246
#align add_right_cancel_iff add_right_cancel_iff
262
247
263
- @[to_additive]
264
- theorem mul_left_injective (a : G) : Function.Injective (· * a) := fun _ _ ↦ mul_right_cancel
265
- #align mul_left_injective mul_left_injective
266
- #align add_left_injective add_left_injective
267
-
268
- @[to_additive (attr := simp)]
269
- theorem mul_left_inj (a : G) {b c : G} : b * a = c * a ↔ b = c :=
270
- (mul_left_injective a).eq_iff
271
- #align mul_left_inj mul_left_inj
272
- #align add_left_inj add_left_inj
273
-
274
- @[to_additive]
275
- theorem mul_ne_mul_left (a : G) {b c : G} : b * a ≠ c * a ↔ b ≠ c :=
276
- (mul_left_injective a).ne_iff
277
- #align mul_ne_mul_left mul_ne_mul_left
278
- #align add_ne_add_left add_ne_add_left
279
-
280
248
end IsRightCancelMul
281
249
282
250
end Mul
@@ -311,12 +279,6 @@ theorem mul_assoc : ∀ a b c : G, a * b * c = a * (b * c) :=
311
279
#align mul_assoc mul_assoc
312
280
#align add_assoc add_assoc
313
281
314
- @[to_additive]
315
- instance Semigroup.to_isAssociative : IsAssociative G (· * ·) :=
316
- ⟨mul_assoc⟩
317
- #align semigroup.to_is_associative Semigroup.to_isAssociative
318
- #align add_semigroup.to_is_associative AddSemigroup.to_isAssociative
319
-
320
282
end Semigroup
321
283
322
284
/-- A commutative addition is a type with an addition which commutes-/
@@ -359,11 +321,6 @@ theorem mul_comm : ∀ a b : G, a * b = b * a := CommMagma.mul_comm
359
321
#align mul_comm mul_comm
360
322
#align add_comm add_comm
361
323
362
- @[to_additive]
363
- instance CommMagma.to_isCommutative : IsCommutative G (· * ·) := ⟨mul_comm⟩
364
- #align comm_semigroup.to_is_commutative CommMagma.to_isCommutative
365
- #align add_comm_semigroup.to_is_commutative AddCommMagma.to_isCommutative
366
-
367
324
/-- Any `CommMagma G` that satisfies `IsRightCancelMul G` also satisfies `IsLeftCancelMul G`. -/
368
325
@[to_additive AddCommMagma.IsRightCancelAdd.toIsLeftCancelAdd "Any `AddCommMagma G` that satisfies
369
326
`IsRightCancelAdd G` also satisfies `IsLeftCancelAdd G`." ]
@@ -993,7 +950,7 @@ theorem zpow_ofNat (a : G) : ∀ n : ℕ, a ^ (n : ℤ) = a ^ n
993
950
| 0 => (zpow_zero _).trans (pow_zero _).symm
994
951
| n + 1 => calc
995
952
a ^ (↑(n + 1 ) : ℤ) = a * a ^ (n : ℤ) := DivInvMonoid.zpow_succ' _ _
996
- _ = a * a ^ n := congr_arg (a * ·) (zpow_ofNat a n)
953
+ _ = a * a ^ n := congrArg (a * ·) (zpow_ofNat a n)
997
954
_ = a ^ (n + 1 ) := (pow_succ _ _).symm
998
955
#align zpow_coe_nat zpow_ofNat
999
956
#align zpow_of_nat zpow_ofNat
@@ -1231,12 +1188,6 @@ instance (priority := 100) Group.toCancelMonoid : CancelMonoid G :=
1231
1188
1232
1189
end Group
1233
1190
1234
- @[to_additive]
1235
- theorem Group.toDivInvMonoid_injective {G : Type *} :
1236
- Function.Injective (@Group.toDivInvMonoid G) := by rintro ⟨⟩ ⟨⟩ ⟨⟩; rfl
1237
- #align group.to_div_inv_monoid_injective Group.toDivInvMonoid_injective
1238
- #align add_group.to_sub_neg_add_monoid_injective AddGroup.toSubNegAddMonoid_injective
1239
-
1240
1191
/-- An additive commutative group is an additive group with commutative `(+)`. -/
1241
1192
class AddCommGroup (G : Type u) extends AddGroup G, AddCommMonoid G
1242
1193
#align add_comm_group AddCommGroup
@@ -1248,12 +1199,6 @@ class CommGroup (G : Type u) extends Group G, CommMonoid G
1248
1199
1249
1200
attribute [to_additive existing] CommGroup.toCommMonoid
1250
1201
1251
- @[to_additive]
1252
- theorem CommGroup.toGroup_injective {G : Type u} : Function.Injective (@CommGroup.toGroup G) := by
1253
- rintro ⟨⟩ ⟨⟩ ⟨⟩; rfl
1254
- #align comm_group.to_group_injective CommGroup.toGroup_injective
1255
- #align add_comm_group.to_add_group_injective AddCommGroup.toAddGroup_injective
1256
-
1257
1202
section CommGroup
1258
1203
1259
1204
variable [CommGroup G]
@@ -1318,3 +1263,6 @@ initialize_simps_projections Group
1318
1263
initialize_simps_projections AddGroup
1319
1264
initialize_simps_projections CommGroup
1320
1265
initialize_simps_projections AddCommGroup
1266
+
1267
+ assert_not_exists Function.Injective
1268
+ assert_not_exists IsCommutative
0 commit comments