Skip to content

Commit 7789cdd

Browse files
committed
Begin raising a valuation to a pnat power
1 parent 2c62cea commit 7789cdd

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

src/examples/valuations.lean

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/-
2+
Stuff in this file should eventually go to the valuation folder,
3+
but keeping it here is faster at this point.
4+
-/
5+
6+
import valuation.basic
7+
8+
local attribute [instance, priority 0] classical.decidable_linear_order
9+
10+
section
11+
@[elab_as_eliminator] protected lemma pnat.induction_on {p : ℕ+ → Prop}
12+
(i : ℕ+) (hz : p 1) (hp : ∀j : ℕ+, p j → p (j + 1)) : p i :=
13+
begin
14+
sorry
15+
end
16+
17+
variables (Γ₀ : Type*) [linear_ordered_comm_group_with_zero Γ₀]
18+
open linear_ordered_structure
19+
20+
lemma linear_ordered_comm_monoid.pow_strict_mono (n : ℕ+) : strict_mono (λ x : Γ₀, x^(n : ℕ)) :=
21+
begin
22+
intros x y h,
23+
induction n using pnat.induction_on with n ih,
24+
{ simpa },
25+
{ simp only [] at *,
26+
rw [pnat.add_coe, pnat.one_coe, pow_succ, pow_succ], -- here we miss some norm_cast attribute
27+
by_cases hx : x = 0,
28+
{ simp [hx] at *,
29+
30+
sorry },
31+
{ -- do x * ih (using that x ≠ 0) and then h * y^n (using 0 < x^n < y^n)
32+
sorry } }
33+
end
34+
35+
lemma linear_ordered_comm_monoid.pow_mono (n : ℕ+) : monotone (λ x : Γ₀, x^(n : ℕ)) :=
36+
(linear_ordered_comm_monoid.pow_strict_mono Γ₀ n).monotone
37+
38+
variables {Γ₀}
39+
lemma linear_ordered_comm_monoid.pow_le_pow {x y : Γ₀} {n : ℕ+} : x^(n : ℕ) ≤ y^(n : ℕ) ↔ x ≤ y :=
40+
strict_mono.le_iff_le (linear_ordered_comm_monoid.pow_strict_mono Γ₀ n)
41+
42+
end
43+
44+
variables {R : Type*} [ring R]
45+
46+
variables {Γ₀ : Type*} [linear_ordered_comm_group_with_zero Γ₀]
47+
48+
instance valuation.pow : has_pow (valuation R Γ₀) ℕ+ :=
49+
⟨λ v n, { to_fun := λ r, (v r)^n.val,
50+
map_one' := by rw [v.map_one, one_pow],
51+
map_mul' := λ x y, by rw [v.map_mul, mul_pow],
52+
map_zero' := by rw [valuation.map_zero, ← nat.succ_pred_eq_of_pos n.2, pow_succ, zero_mul],
53+
map_add' := begin
54+
intros x y,
55+
wlog vyx : v y ≤ v x using x y,
56+
{ have : (v y)^n.val ≤ (v x)^n.val, by apply linear_ordered_comm_monoid.pow_mono ; assumption,
57+
rw max_eq_left this,
58+
apply linear_ordered_comm_monoid.pow_mono,
59+
convert v.map_add x y,
60+
rw max_eq_left vyx },
61+
{ rwa [add_comm, max_comm] },
62+
end }⟩

0 commit comments

Comments
 (0)