Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit f57c0cd

Browse files
committed
chore(algebra/{group_power,order}): split off field lemmas (#14849)
I want to refer to the rational numbers in the definition of a field, meaning we can't have `algebra.field.basic` in the transitive imports of `data.rat.basic`. This is half of rearranging those imports: remove the definition of a field from the dependencies of basic lemmas about `nsmul`, `npow`, `zsmul` and `zpow`. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
1 parent d939b0e commit f57c0cd

File tree

5 files changed

+46
-30
lines changed

5 files changed

+46
-30
lines changed

src/algebra/group_power/lemmas.lean

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,6 @@ by simpa only [add_sub_cancel'_right] using one_add_mul_le_pow this n
519519

520520
end linear_ordered_ring
521521

522-
/-- Bernoulli's inequality reformulated to estimate `(n : K)`. -/
523-
theorem nat.cast_le_pow_sub_div_sub {K : Type*} [linear_ordered_field K] {a : K} (H : 1 < a)
524-
(n : ℕ) :
525-
(n : K) ≤ (a ^ n - 1) / (a - 1) :=
526-
(le_div_iff (sub_pos.2 H)).2 $ le_sub_left_of_add_le $
527-
one_add_mul_sub_le_pow ((neg_le_self zero_le_one).trans H.le) _
528-
529-
/-- For any `a > 1` and a natural `n` we have `n ≤ a ^ n / (a - 1)`. See also
530-
`nat.cast_le_pow_sub_div_sub` for a stronger inequality with `a ^ n - 1` in the numerator. -/
531-
theorem nat.cast_le_pow_div_sub {K : Type*} [linear_ordered_field K] {a : K} (H : 1 < a) (n : ℕ) :
532-
(n : K) ≤ a ^ n / (a - 1) :=
533-
(n.cast_le_pow_sub_div_sub H).trans $ div_le_div_of_le (sub_nonneg.2 H.le)
534-
(sub_le_self _ zero_le_one)
535-
536522
namespace int
537523

538524
alias int.units_sq ← int.units_pow_two

src/algebra/group_with_zero/power.lean

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,3 @@ lemma monoid_with_zero_hom.map_zpow {G₀ G₀' : Type*} [group_with_zero G₀]
204204
rw [zpow_neg_succ_of_nat, zpow_neg_succ_of_nat],
205205
exact ((f.map_inv _).trans $ congr_arg _ $ f.to_monoid_hom.map_pow x _)
206206
end
207-
208-
-- I haven't been able to find a better home for this:
209-
-- it belongs with other lemmas on `linear_ordered_field`, but
210-
-- we need to wait until `zpow` has been defined in this file.
211-
section
212-
variables {R : Type*} [linear_ordered_field R] {a : R}
213-
214-
lemma pow_minus_two_nonneg : 0 ≤ a^(-2 : ℤ) :=
215-
begin
216-
simp only [inv_nonneg, zpow_neg],
217-
change 0 ≤ a ^ ((2 : ℕ) : ℤ),
218-
rw zpow_coe_nat,
219-
apply sq_nonneg,
220-
end
221-
222-
end

src/algebra/order/field_pow.lean

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/-
2+
Copyright (c) 2020 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury Kudryashov, Scott Morrison
5+
-/
6+
import algebra.group_power.lemmas
7+
import data.nat.cast
8+
import algebra.group_with_zero.power
9+
import algebra.order.field
10+
/-!
11+
# Powers of elements of linear ordered fields
12+
13+
Some results on integer powers of elements of a linear ordered field.
14+
These results are in their own file because they depend both on
15+
`linear_ordered_field` and on the API for `zpow`; neither should be obviously
16+
an ancestor of the other.
17+
-/
18+
19+
section
20+
variables {R : Type*} [linear_ordered_field R] {a : R}
21+
22+
lemma pow_minus_two_nonneg : 0 ≤ a^(-2 : ℤ) :=
23+
begin
24+
simp only [inv_nonneg, zpow_neg],
25+
change 0 ≤ a ^ ((2 : ℕ) : ℤ),
26+
rw zpow_coe_nat,
27+
apply sq_nonneg,
28+
end
29+
30+
/-- Bernoulli's inequality reformulated to estimate `(n : K)`. -/
31+
theorem nat.cast_le_pow_sub_div_sub {K : Type*} [linear_ordered_field K] {a : K} (H : 1 < a)
32+
(n : ℕ) :
33+
(n : K) ≤ (a ^ n - 1) / (a - 1) :=
34+
(le_div_iff (sub_pos.2 H)).2 $ le_sub_left_of_add_le $
35+
one_add_mul_sub_le_pow ((neg_le_self zero_le_one).trans H.le) _
36+
37+
/-- For any `a > 1` and a natural `n` we have `n ≤ a ^ n / (a - 1)`. See also
38+
`nat.cast_le_pow_sub_div_sub` for a stronger inequality with `a ^ n - 1` in the numerator. -/
39+
theorem nat.cast_le_pow_div_sub {K : Type*} [linear_ordered_field K] {a : K} (H : 1 < a) (n : ℕ) :
40+
(n : K) ≤ a ^ n / (a - 1) :=
41+
(n.cast_le_pow_sub_div_sub H).trans $ div_le_div_of_le (sub_nonneg.2 H.le)
42+
(sub_le_self _ zero_le_one)
43+
44+
end

src/analysis/special_functions/bernstein.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison
55
-/
6+
import algebra.order.field_pow
67
import ring_theory.polynomial.bernstein
78
import topology.continuous_function.polynomial
89

src/analysis/specific_limits/normed.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2020 Sébastien Gouëzel. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Anatole Dedecker, Sébastien Gouëzel, Yury G. Kudryashov, Dylan MacKenzie, Patrick Massot
55
-/
6+
import algebra.order.field_pow
67
import analysis.asymptotics.asymptotics
78
import analysis.specific_limits.basic
89

0 commit comments

Comments
 (0)