@@ -16,62 +16,62 @@ integer power. More specialised results are provided in the case of a linearly o
16
16
17
17
universe u
18
18
19
- @[simp] lemma ring_hom.map_fpow {K L : Type *} [division_ring K] [division_ring L] (f : K →+* L) :
19
+ @[simp] lemma ring_hom.map_zpow {K L : Type *} [division_ring K] [division_ring L] (f : K →+* L) :
20
20
∀ (a : K) (n : ℤ), f (a ^ n) = f a ^ n :=
21
- f.to_monoid_with_zero_hom.map_fpow
21
+ f.to_monoid_with_zero_hom.map_zpow
22
22
23
- @[simp] lemma ring_equiv.map_fpow {K L : Type *} [division_ring K] [division_ring L] (f : K ≃+* L) :
23
+ @[simp] lemma ring_equiv.map_zpow {K L : Type *} [division_ring K] [division_ring L] (f : K ≃+* L) :
24
24
∀ (a : K) (n : ℤ), f (a ^ n) = f a ^ n :=
25
- f.to_ring_hom.map_fpow
25
+ f.to_ring_hom.map_zpow
26
26
27
- @[simp] lemma fpow_bit0_neg {K : Type *} [division_ring K] (x : K) (n : ℤ) :
27
+ @[simp] lemma zpow_bit0_neg {K : Type *} [division_ring K] (x : K) (n : ℤ) :
28
28
(-x) ^ (bit0 n) = x ^ bit0 n :=
29
- by rw [fpow_bit0 ', fpow_bit0 ', neg_mul_neg]
29
+ by rw [zpow_bit0 ', zpow_bit0 ', neg_mul_neg]
30
30
31
- lemma even.fpow_neg {K : Type *} [division_ring K] {n : ℤ} (h : even n) (a : K) :
31
+ lemma even.zpow_neg {K : Type *} [division_ring K] {n : ℤ} (h : even n) (a : K) :
32
32
(-a) ^ n = a ^ n :=
33
33
begin
34
34
obtain ⟨k, rfl⟩ := h,
35
- rw [←bit0_eq_two_mul, fpow_bit0_neg ],
35
+ rw [←bit0_eq_two_mul, zpow_bit0_neg ],
36
36
end
37
37
38
- @[simp] lemma fpow_bit1_neg {K : Type *} [division_ring K] (x : K) (n : ℤ) :
38
+ @[simp] lemma zpow_bit1_neg {K : Type *} [division_ring K] (x : K) (n : ℤ) :
39
39
(-x) ^ (bit1 n) = - x ^ bit1 n :=
40
- by rw [fpow_bit1 ', fpow_bit1 ', neg_mul_neg, neg_mul_eq_mul_neg]
40
+ by rw [zpow_bit1 ', zpow_bit1 ', neg_mul_neg, neg_mul_eq_mul_neg]
41
41
42
42
section ordered_field_power
43
43
open int
44
44
45
45
variables {K : Type u} [linear_ordered_field K] {a : K} {n : ℤ}
46
46
47
- lemma fpow_eq_zero_iff (hn : 0 < n) :
47
+ lemma zpow_eq_zero_iff (hn : 0 < n) :
48
48
a ^ n = 0 ↔ a = 0 :=
49
49
begin
50
- refine ⟨fpow_eq_zero , _⟩,
50
+ refine ⟨zpow_eq_zero , _⟩,
51
51
rintros rfl,
52
- exact zero_fpow _ hn.ne'
52
+ exact zero_zpow _ hn.ne'
53
53
end
54
54
55
- lemma fpow_nonneg {a : K} (ha : 0 ≤ a) : ∀ (z : ℤ), 0 ≤ a ^ z
56
- | (n : ℕ) := by { rw gpow_coe_nat , exact pow_nonneg ha _ }
57
- | -[1 +n] := by { rw gpow_neg_succ_of_nat , exact inv_nonneg.2 (pow_nonneg ha _) }
55
+ lemma zpow_nonneg {a : K} (ha : 0 ≤ a) : ∀ (z : ℤ), 0 ≤ a ^ z
56
+ | (n : ℕ) := by { rw zpow_coe_nat , exact pow_nonneg ha _ }
57
+ | -[1 +n] := by { rw zpow_neg_succ_of_nat , exact inv_nonneg.2 (pow_nonneg ha _) }
58
58
59
- lemma fpow_pos_of_pos {a : K} (ha : 0 < a) : ∀ (z : ℤ), 0 < a ^ z
60
- | (n : ℕ) := by { rw gpow_coe_nat , exact pow_pos ha _ }
61
- | -[1 +n] := by { rw gpow_neg_succ_of_nat , exact inv_pos.2 (pow_pos ha _) }
59
+ lemma zpow_pos_of_pos {a : K} (ha : 0 < a) : ∀ (z : ℤ), 0 < a ^ z
60
+ | (n : ℕ) := by { rw zpow_coe_nat , exact pow_pos ha _ }
61
+ | -[1 +n] := by { rw zpow_neg_succ_of_nat , exact inv_pos.2 (pow_pos ha _) }
62
62
63
- lemma fpow_le_of_le {x : K} (hx : 1 ≤ x) {a b : ℤ} (h : a ≤ b) : x ^ a ≤ x ^ b :=
63
+ lemma zpow_le_of_le {x : K} (hx : 1 ≤ x) {a b : ℤ} (h : a ≤ b) : x ^ a ≤ x ^ b :=
64
64
begin
65
65
induction a with a a; induction b with b b,
66
- { simp only [of_nat_eq_coe, gpow_coe_nat ],
66
+ { simp only [of_nat_eq_coe, zpow_coe_nat ],
67
67
apply pow_le_pow hx,
68
68
apply le_of_coe_nat_le_coe_nat h },
69
69
{ apply absurd h,
70
70
apply not_le_of_gt,
71
71
exact lt_of_lt_of_le (neg_succ_lt_zero _) (of_nat_nonneg _) },
72
- { simp only [gpow_neg_succ_of_nat , one_div, of_nat_eq_coe, gpow_coe_nat ],
72
+ { simp only [zpow_neg_succ_of_nat , one_div, of_nat_eq_coe, zpow_coe_nat ],
73
73
apply le_trans (inv_le_one _); apply one_le_pow_of_one_le hx },
74
- { simp only [gpow_neg_succ_of_nat ],
74
+ { simp only [zpow_neg_succ_of_nat ],
75
75
apply (inv_le_inv _ _).2 ,
76
76
{ apply pow_le_pow hx,
77
77
have : -(↑(a+1 ) : ℤ) ≤ -(↑(b+1 ) : ℤ), from h,
@@ -85,133 +85,133 @@ lemma pow_le_max_of_min_le {x : K} (hx : 1 ≤ x) {a b c : ℤ} (h : min a b ≤
85
85
begin
86
86
wlog hle : a ≤ b,
87
87
have hnle : -b ≤ -a, from neg_le_neg hle,
88
- have hfle : x ^ (-b) ≤ x ^ (-a), from fpow_le_of_le hx hnle,
88
+ have hfle : x ^ (-b) ≤ x ^ (-a), from zpow_le_of_le hx hnle,
89
89
have : x ^ (-c) ≤ x ^ (-a),
90
- { apply fpow_le_of_le hx,
90
+ { apply zpow_le_of_le hx,
91
91
simpa only [min_eq_left hle, neg_le_neg_iff] using h },
92
92
simpa only [max_eq_left hfle]
93
93
end
94
94
95
- lemma fpow_le_one_of_nonpos {p : K} (hp : 1 ≤ p) {z : ℤ} (hz : z ≤ 0 ) : p ^ z ≤ 1 :=
96
- calc p ^ z ≤ p ^ 0 : fpow_le_of_le hp hz
95
+ lemma zpow_le_one_of_nonpos {p : K} (hp : 1 ≤ p) {z : ℤ} (hz : z ≤ 0 ) : p ^ z ≤ 1 :=
96
+ calc p ^ z ≤ p ^ 0 : zpow_le_of_le hp hz
97
97
... = 1 : by simp
98
98
99
- lemma one_le_fpow_of_nonneg {p : K} (hp : 1 ≤ p) {z : ℤ} (hz : 0 ≤ z) : 1 ≤ p ^ z :=
100
- calc p ^ z ≥ p ^ 0 : fpow_le_of_le hp hz
99
+ lemma one_le_zpow_of_nonneg {p : K} (hp : 1 ≤ p) {z : ℤ} (hz : 0 ≤ z) : 1 ≤ p ^ z :=
100
+ calc p ^ z ≥ p ^ 0 : zpow_le_of_le hp hz
101
101
... = 1 : by simp
102
102
103
- theorem fpow_bit0_nonneg (a : K) (n : ℤ) : 0 ≤ a ^ bit0 n :=
104
- by { rw fpow_bit0 , exact mul_self_nonneg _ }
103
+ theorem zpow_bit0_nonneg (a : K) (n : ℤ) : 0 ≤ a ^ bit0 n :=
104
+ by { rw zpow_bit0₀ , exact mul_self_nonneg _ }
105
105
106
- theorem fpow_two_nonneg (a : K) : 0 ≤ a ^ 2 :=
106
+ theorem zpow_two_nonneg (a : K) : 0 ≤ a ^ 2 :=
107
107
pow_bit0_nonneg a 1
108
108
109
- theorem fpow_bit0_pos {a : K} (h : a ≠ 0 ) (n : ℤ) : 0 < a ^ bit0 n :=
110
- (fpow_bit0_nonneg a n).lt_of_ne (fpow_ne_zero _ h).symm
109
+ theorem zpow_bit0_pos {a : K} (h : a ≠ 0 ) (n : ℤ) : 0 < a ^ bit0 n :=
110
+ (zpow_bit0_nonneg a n).lt_of_ne (zpow_ne_zero _ h).symm
111
111
112
- theorem fpow_two_pos_of_ne_zero (a : K) (h : a ≠ 0 ) : 0 < a ^ 2 :=
112
+ theorem zpow_two_pos_of_ne_zero (a : K) (h : a ≠ 0 ) : 0 < a ^ 2 :=
113
113
pow_bit0_pos h 1
114
114
115
- @[simp] theorem fpow_bit1_neg_iff : a ^ bit1 n < 0 ↔ a < 0 :=
116
- ⟨λ h, not_le.1 $ λ h', not_le.2 h $ fpow_nonneg h' _,
117
- λ h, by rw [bit1, fpow_add_one h.ne]; exact mul_neg_of_pos_of_neg (fpow_bit0_pos h.ne _) h⟩
115
+ @[simp] theorem zpow_bit1_neg_iff : a ^ bit1 n < 0 ↔ a < 0 :=
116
+ ⟨λ h, not_le.1 $ λ h', not_le.2 h $ zpow_nonneg h' _,
117
+ λ h, by rw [bit1, zpow_add_one₀ h.ne]; exact mul_neg_of_pos_of_neg (zpow_bit0_pos h.ne _) h⟩
118
118
119
- @[simp] theorem fpow_bit1_nonneg_iff : 0 ≤ a ^ bit1 n ↔ 0 ≤ a :=
120
- le_iff_le_iff_lt_iff_lt.2 fpow_bit1_neg_iff
119
+ @[simp] theorem zpow_bit1_nonneg_iff : 0 ≤ a ^ bit1 n ↔ 0 ≤ a :=
120
+ le_iff_le_iff_lt_iff_lt.2 zpow_bit1_neg_iff
121
121
122
- @[simp] theorem fpow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 :=
122
+ @[simp] theorem zpow_bit1_nonpos_iff : a ^ bit1 n ≤ 0 ↔ a ≤ 0 :=
123
123
begin
124
- rw [le_iff_lt_or_eq, fpow_bit1_neg_iff ],
124
+ rw [le_iff_lt_or_eq, zpow_bit1_neg_iff ],
125
125
split,
126
126
{ rintro (h | h),
127
127
{ exact h.le },
128
- { exact (fpow_eq_zero h).le } },
128
+ { exact (zpow_eq_zero h).le } },
129
129
{ intro h,
130
130
rcases eq_or_lt_of_le h with rfl|h,
131
- { exact or.inr (zero_fpow _ (bit1_ne_zero n)) },
131
+ { exact or.inr (zero_zpow _ (bit1_ne_zero n)) },
132
132
{ exact or.inl h } }
133
133
end
134
134
135
- @[simp] theorem fpow_bit1_pos_iff : 0 < a ^ bit1 n ↔ 0 < a :=
136
- lt_iff_lt_of_le_iff_le fpow_bit1_nonpos_iff
135
+ @[simp] theorem zpow_bit1_pos_iff : 0 < a ^ bit1 n ↔ 0 < a :=
136
+ lt_iff_lt_of_le_iff_le zpow_bit1_nonpos_iff
137
137
138
- lemma even.fpow_nonneg {n : ℤ} (hn : even n) (a : K) :
138
+ lemma even.zpow_nonneg {n : ℤ} (hn : even n) (a : K) :
139
139
0 ≤ a ^ n :=
140
140
begin
141
141
cases le_or_lt 0 a with h h,
142
- { exact fpow_nonneg h _ },
143
- { exact (hn.fpow_neg a).subst (fpow_nonneg (neg_nonneg_of_nonpos h.le) _) }
142
+ { exact zpow_nonneg h _ },
143
+ { exact (hn.zpow_neg a).subst (zpow_nonneg (neg_nonneg_of_nonpos h.le) _) }
144
144
end
145
145
146
- theorem even.fpow_pos (hn : even n) (ha : a ≠ 0 ) : 0 < a ^ n :=
147
- by cases hn with k hk; simpa only [hk, two_mul] using fpow_bit0_pos ha k
146
+ theorem even.zpow_pos (hn : even n) (ha : a ≠ 0 ) : 0 < a ^ n :=
147
+ by cases hn with k hk; simpa only [hk, two_mul] using zpow_bit0_pos ha k
148
148
149
- theorem odd.fpow_nonneg (hn : odd n) (ha : 0 ≤ a) : 0 ≤ a ^ n :=
150
- by cases hn with k hk; simpa only [hk, two_mul] using fpow_bit1_nonneg_iff .mpr ha
149
+ theorem odd.zpow_nonneg (hn : odd n) (ha : 0 ≤ a) : 0 ≤ a ^ n :=
150
+ by cases hn with k hk; simpa only [hk, two_mul] using zpow_bit1_nonneg_iff .mpr ha
151
151
152
- theorem odd.fpow_pos (hn : odd n) (ha : 0 < a) : 0 < a ^ n :=
153
- by cases hn with k hk; simpa only [hk, two_mul] using fpow_bit1_pos_iff .mpr ha
152
+ theorem odd.zpow_pos (hn : odd n) (ha : 0 < a) : 0 < a ^ n :=
153
+ by cases hn with k hk; simpa only [hk, two_mul] using zpow_bit1_pos_iff .mpr ha
154
154
155
- theorem odd.fpow_nonpos (hn : odd n) (ha : a ≤ 0 ) : a ^ n ≤ 0 :=
156
- by cases hn with k hk; simpa only [hk, two_mul] using fpow_bit1_nonpos_iff .mpr ha
155
+ theorem odd.zpow_nonpos (hn : odd n) (ha : a ≤ 0 ) : a ^ n ≤ 0 :=
156
+ by cases hn with k hk; simpa only [hk, two_mul] using zpow_bit1_nonpos_iff .mpr ha
157
157
158
- theorem odd.fpow_neg (hn : odd n) (ha : a < 0 ) : a ^ n < 0 :=
159
- by cases hn with k hk; simpa only [hk, two_mul] using fpow_bit1_neg_iff .mpr ha
158
+ theorem odd.zpow_neg (hn : odd n) (ha : a < 0 ) : a ^ n < 0 :=
159
+ by cases hn with k hk; simpa only [hk, two_mul] using zpow_bit1_neg_iff .mpr ha
160
160
161
- lemma even.fpow_abs {p : ℤ} (hp : even p) (a : K) : |a| ^ p = a ^ p :=
161
+ lemma even.zpow_abs {p : ℤ} (hp : even p) (a : K) : |a| ^ p = a ^ p :=
162
162
begin
163
163
cases abs_choice a with h h;
164
- simp only [h, hp.fpow_neg _],
164
+ simp only [h, hp.zpow_neg _],
165
165
end
166
166
167
- @[simp] lemma fpow_bit0_abs (a : K) (p : ℤ) : |a| ^ bit0 p = a ^ bit0 p :=
168
- (even_bit0 _).fpow_abs _
167
+ @[simp] lemma zpow_bit0_abs (a : K) (p : ℤ) : |a| ^ bit0 p = a ^ bit0 p :=
168
+ (even_bit0 _).zpow_abs _
169
169
170
- lemma even.abs_fpow {p : ℤ} (hp : even p) (a : K) : |a ^ p| = a ^ p :=
170
+ lemma even.abs_zpow {p : ℤ} (hp : even p) (a : K) : |a ^ p| = a ^ p :=
171
171
begin
172
172
rw [abs_eq_self],
173
- exact hp.fpow_nonneg _
173
+ exact hp.zpow_nonneg _
174
174
end
175
175
176
- @[simp] lemma abs_fpow_bit0 (a : K) (p : ℤ) :
176
+ @[simp] lemma abs_zpow_bit0 (a : K) (p : ℤ) :
177
177
|a ^ bit0 p| = a ^ bit0 p :=
178
- (even_bit0 _).abs_fpow _
178
+ (even_bit0 _).abs_zpow _
179
179
180
180
end ordered_field_power
181
181
182
- lemma one_lt_fpow {K} [linear_ordered_field K] {p : K} (hp : 1 < p) :
182
+ lemma one_lt_zpow {K} [linear_ordered_field K] {p : K} (hp : 1 < p) :
183
183
∀ z : ℤ, 0 < z → 1 < p ^ z
184
- | (n : ℕ) h := (gpow_coe_nat p n).symm.subst (one_lt_pow hp $ int.coe_nat_ne_zero.mp h.ne')
184
+ | (n : ℕ) h := (zpow_coe_nat p n).symm.subst (one_lt_pow hp $ int.coe_nat_ne_zero.mp h.ne')
185
185
| -[1 + n] h := ((int.neg_succ_not_pos _).mp h).elim
186
186
187
187
section ordered
188
188
variables {K : Type *} [linear_ordered_field K]
189
189
190
- lemma nat.fpow_pos_of_pos {p : ℕ} (h : 0 < p) (n:ℤ) : 0 < (p:K)^n :=
191
- by { apply fpow_pos_of_pos , exact_mod_cast h }
190
+ lemma nat.zpow_pos_of_pos {p : ℕ} (h : 0 < p) (n:ℤ) : 0 < (p:K)^n :=
191
+ by { apply zpow_pos_of_pos , exact_mod_cast h }
192
192
193
- lemma nat.fpow_ne_zero_of_pos {p : ℕ} (h : 0 < p) (n:ℤ) : (p:K)^n ≠ 0 :=
194
- ne_of_gt (nat.fpow_pos_of_pos h n)
193
+ lemma nat.zpow_ne_zero_of_pos {p : ℕ} (h : 0 < p) (n:ℤ) : (p:K)^n ≠ 0 :=
194
+ ne_of_gt (nat.zpow_pos_of_pos h n)
195
195
196
- lemma fpow_strict_mono {x : K} (hx : 1 < x) :
196
+ lemma zpow_strict_mono {x : K} (hx : 1 < x) :
197
197
strict_mono (λ n:ℤ, x ^ n) :=
198
198
λ m n h, show x ^ m < x ^ n,
199
199
begin
200
200
have xpos : 0 < x := zero_lt_one.trans hx,
201
201
have h₀ : x ≠ 0 := xpos.ne',
202
- have hxm : 0 < x^m := fpow_pos_of_pos xpos m,
203
- have h : 1 < x ^ (n - m) := one_lt_fpow hx _ (sub_pos_of_lt h),
202
+ have hxm : 0 < x^m := zpow_pos_of_pos xpos m,
203
+ have h : 1 < x ^ (n - m) := one_lt_zpow hx _ (sub_pos_of_lt h),
204
204
replace h := mul_lt_mul_of_pos_right h hxm,
205
- rwa [sub_eq_add_neg, fpow_add h₀, mul_assoc, fpow_neg_mul_fpow_self _ h₀, one_mul, mul_one] at h,
205
+ rwa [sub_eq_add_neg, zpow_add₀ h₀, mul_assoc, zpow_neg_mul_zpow_self _ h₀, one_mul, mul_one] at h,
206
206
end
207
207
208
- @[simp] lemma fpow_lt_iff_lt {x : K} (hx : 1 < x) {m n : ℤ} :
208
+ @[simp] lemma zpow_lt_iff_lt {x : K} (hx : 1 < x) {m n : ℤ} :
209
209
x ^ m < x ^ n ↔ m < n :=
210
- (fpow_strict_mono hx).lt_iff_lt
210
+ (zpow_strict_mono hx).lt_iff_lt
211
211
212
- @[simp] lemma fpow_le_iff_le {x : K} (hx : 1 < x) {m n : ℤ} :
212
+ @[simp] lemma zpow_le_iff_le {x : K} (hx : 1 < x) {m n : ℤ} :
213
213
x ^ m ≤ x ^ n ↔ m ≤ n :=
214
- (fpow_strict_mono hx).le_iff_le
214
+ (zpow_strict_mono hx).le_iff_le
215
215
216
216
@[simp] lemma pos_div_pow_pos {a b : K} (ha : 0 < a) (hb : 0 < b) (k : ℕ) : 0 < a/b^k :=
217
217
div_pos ha (pow_pos hb k)
@@ -221,29 +221,29 @@ div_pos ha (pow_pos hb k)
221
221
(calc a = a * 1 : (mul_one a).symm
222
222
... ≤ a*b^k : (mul_le_mul_left ha).mpr $ one_le_pow_of_one_le hb _)
223
223
224
- lemma fpow_injective {x : K} (h₀ : 0 < x) (h₁ : x ≠ 1 ) :
224
+ lemma zpow_injective {x : K} (h₀ : 0 < x) (h₁ : x ≠ 1 ) :
225
225
function.injective ((^) x : ℤ → K) :=
226
226
begin
227
227
intros m n h,
228
228
rcases h₁.lt_or_lt with H|H,
229
- { apply (fpow_strict_mono (one_lt_inv h₀ H)).injective,
229
+ { apply (zpow_strict_mono (one_lt_inv h₀ H)).injective,
230
230
show x⁻¹ ^ m = x⁻¹ ^ n,
231
- rw [← fpow_neg_one , ← fpow_mul , ← fpow_mul , mul_comm _ m, mul_comm _ n, fpow_mul, fpow_mul ,
231
+ rw [← zpow_neg_one₀ , ← zpow_mul₀ , ← zpow_mul₀ , mul_comm _ m, mul_comm _ n, zpow_mul₀, zpow_mul₀ ,
232
232
h], },
233
- { exact (fpow_strict_mono H).injective h, },
233
+ { exact (zpow_strict_mono H).injective h, },
234
234
end
235
235
236
- @[simp] lemma fpow_inj {x : K} (h₀ : 0 < x) (h₁ : x ≠ 1 ) {m n : ℤ} :
236
+ @[simp] lemma zpow_inj {x : K} (h₀ : 0 < x) (h₁ : x ≠ 1 ) {m n : ℤ} :
237
237
x ^ m = x ^ n ↔ m = n :=
238
- (fpow_injective h₀ h₁).eq_iff
238
+ (zpow_injective h₀ h₁).eq_iff
239
239
240
240
end ordered
241
241
242
242
section
243
243
variables {K : Type *} [field K]
244
244
245
- @[simp, norm_cast] theorem rat.cast_fpow [char_zero K] (q : ℚ) (n : ℤ) :
245
+ @[simp, norm_cast] theorem rat.cast_zpow [char_zero K] (q : ℚ) (n : ℤ) :
246
246
((q ^ n : ℚ) : K) = q ^ n :=
247
- (rat.cast_hom K).map_fpow q n
247
+ (rat.cast_hom K).map_zpow q n
248
248
249
249
end
0 commit comments