@@ -124,18 +124,17 @@ pos_iff_ne_zero.2 $ pow_ne_zero _ H.ne'
124
124
end canonically_ordered_comm_semiring
125
125
126
126
section ordered_semiring
127
- variable [ordered_semiring R]
127
+ variables [ordered_semiring R] {a x y : R} {n m : ℕ}
128
128
129
- @[simp] theorem pow_pos {a : R} (H : 0 < a) : ∀ (n : ℕ), 0 < a ^ n
129
+ @[simp] theorem pow_pos (H : 0 < a) : ∀ (n : ℕ), 0 < a ^ n
130
130
| 0 := by { nontriviality, rw pow_zero, exact zero_lt_one }
131
131
| (n+1 ) := by { rw pow_succ, exact mul_pos H (pow_pos _) }
132
132
133
- @[simp] theorem pow_nonneg {a : R} (H : 0 ≤ a) : ∀ (n : ℕ), 0 ≤ a ^ n
133
+ @[simp] theorem pow_nonneg (H : 0 ≤ a) : ∀ (n : ℕ), 0 ≤ a ^ n
134
134
| 0 := by { rw pow_zero, exact zero_le_one}
135
135
| (n+1 ) := by { rw pow_succ, exact mul_nonneg H (pow_nonneg _) }
136
136
137
- theorem pow_add_pow_le {x y : R} {n : ℕ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hn : n ≠ 0 ) :
138
- x ^ n + y ^ n ≤ (x + y) ^ n :=
137
+ theorem pow_add_pow_le (hx : 0 ≤ x) (hy : 0 ≤ y) (hn : n ≠ 0 ) : x ^ n + y ^ n ≤ (x + y) ^ n :=
139
138
begin
140
139
rcases nat.exists_eq_succ_of_ne_zero hn with ⟨k, rfl⟩,
141
140
induction k with k ih, { simp only [pow_one] },
@@ -152,7 +151,7 @@ begin
152
151
by { rw [pow_succ _ n], exact mul_le_mul_of_nonneg_left (ih (nat.succ_ne_zero k)) h2 }
153
152
end
154
153
155
- theorem pow_lt_pow_of_lt_left {x y : R} {n : ℕ} (Hxy : x < y) (Hxpos : 0 ≤ x) (Hnpos : 0 < n) :
154
+ theorem pow_lt_pow_of_lt_left (Hxy : x < y) (Hxpos : 0 ≤ x) (Hnpos : 0 < n) :
156
155
x ^ n < y ^ n :=
157
156
begin
158
157
cases lt_or_eq_of_le Hxpos,
@@ -163,42 +162,41 @@ begin
163
162
{ rw [←h, zero_pow Hnpos], apply pow_pos (by rwa ←h at Hxy : 0 < y),}
164
163
end
165
164
166
- lemma pow_lt_one {a : R} (h₀ : 0 ≤ a) (h₁ : a < 1 ) {n : ℕ} (hn : n ≠ 0 ) : a ^ n < 1 :=
165
+ lemma pow_lt_one (h₀ : 0 ≤ a) (h₁ : a < 1 ) {n : ℕ} (hn : n ≠ 0 ) : a ^ n < 1 :=
167
166
(one_pow n).subst (pow_lt_pow_of_lt_left h₁ h₀ (nat.pos_of_ne_zero hn))
168
167
169
- theorem strict_mono_on_pow {n : ℕ} (hn : 0 < n) :
170
- strict_mono_on (λ x : R, x ^ n) (set.Ici 0 ) :=
168
+ theorem strict_mono_on_pow (hn : 0 < n) : strict_mono_on (λ x : R, x ^ n) (set.Ici 0 ) :=
171
169
λ x hx y hy h, pow_lt_pow_of_lt_left h hx hn
172
170
173
- theorem one_le_pow_of_one_le {a : R} (H : 1 ≤ a) : ∀ (n : ℕ), 1 ≤ a ^ n
171
+ theorem one_le_pow_of_one_le (H : 1 ≤ a) : ∀ (n : ℕ), 1 ≤ a ^ n
174
172
| 0 := by rw [pow_zero]
175
173
| (n+1 ) := by { rw pow_succ, simpa only [mul_one] using mul_le_mul H (one_le_pow_of_one_le n)
176
174
zero_le_one (le_trans zero_le_one H) }
177
175
178
- lemma pow_mono {a : R} (h : 1 ≤ a) : monotone (λ n : ℕ, a ^ n) :=
176
+ lemma pow_mono (h : 1 ≤ a) : monotone (λ n : ℕ, a ^ n) :=
179
177
monotone_nat_of_le_succ $ λ n,
180
178
by { rw pow_succ, exact le_mul_of_one_le_left (pow_nonneg (zero_le_one.trans h) _) h }
181
179
182
- theorem pow_le_pow {a : R} {n m : ℕ} (ha : 1 ≤ a) (h : n ≤ m) : a ^ n ≤ a ^ m :=
180
+ theorem pow_le_pow (ha : 1 ≤ a) (h : n ≤ m) : a ^ n ≤ a ^ m :=
183
181
pow_mono ha h
184
182
185
- lemma strict_mono_pow {a : R} (h : 1 < a) : strict_mono (λ n : ℕ, a ^ n) :=
183
+ lemma strict_mono_pow (h : 1 < a) : strict_mono (λ n : ℕ, a ^ n) :=
186
184
have 0 < a := zero_le_one.trans_lt h,
187
185
strict_mono_nat_of_lt_succ $ λ n, by simpa only [one_mul, pow_succ]
188
186
using mul_lt_mul h (le_refl (a ^ n)) (pow_pos this _) this.le
189
187
190
- lemma pow_lt_pow {a : R} {n m : ℕ} (h : 1 < a) (h2 : n < m) : a ^ n < a ^ m :=
188
+ lemma pow_lt_pow (h : 1 < a) (h2 : n < m) : a ^ n < a ^ m :=
191
189
strict_mono_pow h h2
192
190
193
- lemma pow_lt_pow_iff {a : R} {n m : ℕ} (h : 1 < a) : a ^ n < a ^ m ↔ n < m :=
191
+ lemma pow_lt_pow_iff (h : 1 < a) : a ^ n < a ^ m ↔ n < m :=
194
192
(strict_mono_pow h).lt_iff_lt
195
193
196
194
@[mono] lemma pow_le_pow_of_le_left {a b : R} (ha : 0 ≤ a) (hab : a ≤ b) : ∀ i : ℕ, a^i ≤ b^i
197
195
| 0 := by simp
198
196
| (k+1 ) := by { rw [pow_succ, pow_succ],
199
197
exact mul_le_mul hab (pow_le_pow_of_le_left _) (pow_nonneg ha _) (le_trans ha hab) }
200
198
201
- lemma one_lt_pow {a : R} (ha : 1 < a) : ∀ {n : ℕ}, n ≠ 0 → 1 < a ^ n
199
+ lemma one_lt_pow (ha : 1 < a) : ∀ {n : ℕ}, n ≠ 0 → 1 < a ^ n
202
200
| 0 h := (h rfl).elim
203
201
| 1 h := (pow_one a).symm.subst ha
204
202
| (n + 2 ) h :=
@@ -208,12 +206,33 @@ lemma one_lt_pow {a : R} (ha : 1 < a) : ∀ {n : ℕ}, n ≠ 0 → 1 < a ^ n
208
206
exact mul_lt_mul ha (one_lt_pow (nat.succ_ne_zero _)).le zero_lt_one (zero_lt_one.trans ha).le,
209
207
end
210
208
211
- lemma pow_le_one {a : R} : ∀ (n : ℕ) (h₀ : 0 ≤ a) (h₁ : a ≤ 1 ), a ^ n ≤ 1
209
+ lemma pow_le_one : ∀ (n : ℕ) (h₀ : 0 ≤ a) (h₁ : a ≤ 1 ), a ^ n ≤ 1
212
210
| 0 h₀ h₁ := (pow_zero a).le
213
211
| (n + 1 ) h₀ h₁ := (pow_succ' a n).le.trans (mul_le_one (pow_le_one n h₀ h₁) h₀ h₁)
214
212
213
+ lemma sq_pos_of_pos (ha : 0 < a) : 0 < a ^ 2 := by { rw sq, exact mul_pos ha ha }
214
+
215
215
end ordered_semiring
216
216
217
+ section ordered_ring
218
+ variables [ordered_ring R] {a : R}
219
+
220
+ lemma sq_pos_of_neg (ha : a < 0 ) : 0 < a ^ 2 := by { rw sq, exact mul_pos_of_neg_of_neg ha ha }
221
+
222
+ lemma pow_bit0_pos_of_neg (ha : a < 0 ) (n : ℕ) : 0 < a ^ bit0 n :=
223
+ begin
224
+ rw pow_bit0',
225
+ exact pow_pos (mul_pos_of_neg_of_neg ha ha) _,
226
+ end
227
+
228
+ lemma pow_bit1_neg (ha : a < 0 ) (n : ℕ) : a ^ bit1 n < 0 :=
229
+ begin
230
+ rw [bit1, pow_succ],
231
+ exact mul_neg_of_neg_of_pos ha (pow_bit0_pos_of_neg ha n),
232
+ end
233
+
234
+ end ordered_ring
235
+
217
236
section linear_ordered_semiring
218
237
variable [linear_ordered_semiring R]
219
238
0 commit comments