@@ -41,6 +41,19 @@ First we prove some facts about `semiconj_by` and `commute`. They do not require
41
41
`pow` and/or `nsmul` and will be useful later in this file.
42
42
-/
43
43
44
+ section has_pow
45
+ variables [has_pow M ℕ]
46
+
47
+ @[simp] lemma pow_ite (P : Prop ) [decidable P] (a : M) (b c : ℕ) :
48
+ a ^ (if P then b else c) = if P then a ^ b else a ^ c :=
49
+ by split_ifs; refl
50
+
51
+ @[simp] lemma ite_pow (P : Prop ) [decidable P] (a b : M) (c : ℕ) :
52
+ (if P then a else b) ^ c = if P then a ^ c else b ^ c :=
53
+ by split_ifs; refl
54
+
55
+ end has_pow
56
+
44
57
section monoid
45
58
variables [monoid M] [monoid N] [add_monoid A] [add_monoid B]
46
59
@@ -63,14 +76,6 @@ theorem pow_add (a : M) (m n : ℕ) : a^(m + n) = a^m * a^n :=
63
76
by induction n with n ih; [rw [nat.add_zero, pow_zero, mul_one],
64
77
rw [pow_succ', ← mul_assoc, ← ih, ← pow_succ', nat.add_assoc]]
65
78
66
- @[simp] lemma pow_ite (P : Prop ) [decidable P] (a : M) (b c : ℕ) :
67
- a ^ (if P then b else c) = if P then a ^ b else a ^ c :=
68
- by split_ifs; refl
69
-
70
- @[simp] lemma ite_pow (P : Prop ) [decidable P] (a b : M) (c : ℕ) :
71
- (if P then a else b) ^ c = if P then a ^ c else b ^ c :=
72
- by split_ifs; refl
73
-
74
79
@[simp] lemma pow_boole (P : Prop ) [decidable P] (a : M) :
75
80
a ^ (if P then 1 else 0 ) = if P then a else 1 :=
76
81
by simp
@@ -127,6 +132,16 @@ by rw [pow_bit0, (commute.refl a).mul_pow]
127
132
theorem pow_bit1' (a : M) (n : ℕ) : a ^ bit1 n = (a * a) ^ n * a :=
128
133
by rw [bit1, pow_succ', pow_bit0']
129
134
135
+ lemma dvd_pow {x y : M} (hxy : x ∣ y) :
136
+ ∀ {n : ℕ} (hn : n ≠ 0 ), x ∣ y^n
137
+ | 0 hn := (hn rfl).elim
138
+ | (n + 1 ) hn := by { rw pow_succ, exact hxy.mul_right _ }
139
+
140
+ alias dvd_pow ← has_dvd.dvd.pow
141
+
142
+ lemma dvd_pow_self (a : M) {n : ℕ} (hn : n ≠ 0 ) : a ∣ a^n :=
143
+ dvd_rfl.pow hn
144
+
130
145
end monoid
131
146
132
147
/-!
@@ -153,16 +168,6 @@ def pow_monoid_hom (n : ℕ) : M →* M :=
153
168
-- the below line causes the linter to complain :-/
154
169
-- attribute [ simps ] pow_monoid_hom nsmul_add_monoid_hom
155
170
156
- lemma dvd_pow {x y : M} (hxy : x ∣ y) :
157
- ∀ {n : ℕ} (hn : n ≠ 0 ), x ∣ y^n
158
- | 0 hn := (hn rfl).elim
159
- | (n + 1 ) hn := by { rw pow_succ, exact hxy.mul_right _ }
160
-
161
- alias dvd_pow ← has_dvd.dvd.pow
162
-
163
- lemma dvd_pow_self (a : M) {n : ℕ} (hn : n ≠ 0 ) : a ∣ a^n :=
164
- dvd_rfl.pow hn
165
-
166
171
end comm_monoid
167
172
168
173
section div_inv_monoid
@@ -407,7 +412,8 @@ by rw [sq, sq, mul_self_sub_mul_self]
407
412
408
413
alias sq_sub_sq ← pow_two_sub_pow_two
409
414
410
- lemma eq_or_eq_neg_of_sq_eq_sq [is_domain R] (a b : R) (h : a ^ 2 = b ^ 2 ) : a = b ∨ a = -b :=
415
+ lemma eq_or_eq_neg_of_sq_eq_sq [no_zero_divisors R] (a b : R) (h : a ^ 2 = b ^ 2 ) :
416
+ a = b ∨ a = -b :=
411
417
by rwa [← add_eq_zero_iff_eq_neg, ← sub_eq_zero, or_comm, ← mul_eq_zero,
412
418
← sq_sub_sq a b, sub_eq_zero]
413
419
@@ -419,7 +425,8 @@ alias sub_sq ← sub_pow_two
419
425
/- Copies of the above comm_ring lemmas for `units R`. -/
420
426
namespace units
421
427
422
- lemma eq_or_eq_neg_of_sq_eq_sq [is_domain R] (a b : Rˣ) (h : a ^ 2 = b ^ 2 ) : a = b ∨ a = -b :=
428
+ lemma eq_or_eq_neg_of_sq_eq_sq [no_zero_divisors R] (a b : Rˣ) (h : a ^ 2 = b ^ 2 ) :
429
+ a = b ∨ a = -b :=
423
430
begin
424
431
refine (eq_or_eq_neg_of_sq_eq_sq _ _ _).imp (λ h, units.ext h) (λ h, units.ext h),
425
432
replace h := congr_arg (coe : Rˣ → R) h,
@@ -433,13 +440,14 @@ end comm_ring
433
440
lemma of_add_nsmul [add_monoid A] (x : A) (n : ℕ) :
434
441
multiplicative.of_add (n • x) = (multiplicative.of_add x)^n := rfl
435
442
436
- lemma of_add_zsmul [add_group A] (x : A) (n : ℤ) :
443
+ lemma of_add_zsmul [sub_neg_monoid A] (x : A) (n : ℤ) :
437
444
multiplicative.of_add (n • x) = (multiplicative.of_add x)^n := rfl
438
445
439
446
lemma of_mul_pow [monoid A] (x : A) (n : ℕ) :
440
447
additive.of_mul (x ^ n) = n • (additive.of_mul x) := rfl
441
448
442
- lemma of_mul_zpow [group G] (x : G) (n : ℤ) : additive.of_mul (x ^ n) = n • additive.of_mul x :=
449
+ lemma of_mul_zpow [div_inv_monoid G] (x : G) (n : ℤ) :
450
+ additive.of_mul (x ^ n) = n • additive.of_mul x :=
443
451
rfl
444
452
445
453
@[simp] lemma semiconj_by.zpow_right [group G] {a x y : G} (h : semiconj_by a x y) :
0 commit comments