Skip to content

Commit fa9f767

Browse files
committed
chore(Topology/Algebra/Valued/NormedValued): rely on TC IsUltrametricDist instead of explicit arg (#17561)
Before, we had ``` [hK : NormedField K] (h : IsNonarchimedean (norm : K → ℝ)) ``` Now we use `[hK : NormedField K] [IsUltrametricDist K]` to convert between ultrametrically normed fields and valued fields. This allows the instance to be a scoped instance instead of a def, since `IsUltrametricDist` is a class on the type, as opposed to a plain prop about the norm of the type. The instance is scoped because otherwise, one gets a TC loop.
1 parent cbf4f22 commit fa9f767

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

Mathlib/Topology/Algebra/Valued/NormedValued.lean

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: María Inés de Frutos-Fernández
55
-/
66
import Mathlib.Analysis.Normed.Field.Basic
7-
import Mathlib.Analysis.Normed.Group.Uniform
7+
import Mathlib.Analysis.Normed.Group.Ultra
88
import Mathlib.RingTheory.Valuation.RankOne
99
import Mathlib.Topology.Algebra.Valued.ValuationTopology
1010

@@ -30,7 +30,9 @@ open Filter Set Valuation
3030

3131
open scoped NNReal
3232

33-
variable {K : Type*} [hK : NormedField K] (h : IsNonarchimedean (norm : K → ℝ))
33+
section
34+
35+
variable {K : Type*} [hK : NormedField K] [IsUltrametricDist K]
3436

3537
namespace NormedField
3638

@@ -40,24 +42,35 @@ def valuation : Valuation K ℝ≥0 where
4042
map_zero' := nnnorm_zero
4143
map_one' := nnnorm_one
4244
map_mul' := nnnorm_mul
43-
map_add_le_max' := h
45+
map_add_le_max' := IsUltrametricDist.norm_add_le_max
4446

45-
theorem valuation_apply (x : K) : valuation h x = ‖x‖₊ := rfl
47+
@[simp]
48+
theorem valuation_apply (x : K) : valuation x = ‖x‖₊ := rfl
4649

4750
/-- The valued field structure on a nonarchimedean normed field `K`, determined by the norm. -/
4851
def toValued : Valued K ℝ≥0 :=
4952
{ hK.toUniformSpace,
5053
@NonUnitalNormedRing.toNormedAddCommGroup K _ with
51-
v := valuation h
54+
v := valuation
5255
is_topological_valuation := fun U => by
5356
rw [Metric.mem_nhds_iff]
5457
exact ⟨fun ⟨ε, hε, h⟩ =>
5558
⟨Units.mk0 ⟨ε, le_of_lt hε⟩ (ne_of_gt hε), fun x hx ↦ h (mem_ball_zero_iff.mpr hx)⟩,
5659
fun ⟨ε, hε⟩ => ⟨(ε : ℝ), NNReal.coe_pos.mpr (Units.zero_lt _),
5760
fun x hx ↦ hε (mem_ball_zero_iff.mp hx)⟩⟩ }
5861

62+
instance {K : Type*} [NontriviallyNormedField K] [IsUltrametricDist K] :
63+
Valuation.RankOne (valuation (K := K)) where
64+
hom := .id _
65+
strictMono' := strictMono_id
66+
nontrivial' := (exists_one_lt_norm K).imp fun x h ↦ by
67+
have h' : x ≠ 0 := norm_eq_zero.not.mp (h.gt.trans' (by simp)).ne'
68+
simp [valuation_apply, ← NNReal.coe_inj, h.ne', h']
69+
5970
end NormedField
6071

72+
end
73+
6174
namespace Valued
6275

6376
variable {L : Type*} [Field L] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀]
@@ -126,4 +139,25 @@ def toNormedField : NormedField L :=
126139
exact ⟨fun a b hab => lt_of_lt_of_le hab (min_le_left _ _), fun a b hab =>
127140
lt_of_lt_of_le hab (min_le_right _ _)⟩ }
128141

142+
-- When a field is valued, one inherits a `NormedField`.
143+
-- Scoped instance to avoid a typeclass loop or non-defeq topology or norms.
144+
scoped[Valued] attribute [instance] Valued.toNormedField
145+
scoped[NormedField] attribute [instance] NormedField.toValued
146+
147+
section NormedField
148+
149+
open scoped Valued
150+
151+
protected lemma isNonarchimedean_norm : IsNonarchimedean ((‖·‖): L → ℝ) := Valued.norm_add_le
152+
153+
instance : IsUltrametricDist L :=
154+
fun x y z ↦ by
155+
refine (Valued.norm_add_le (x - y) (y - z)).trans_eq' ?_
156+
simp only [sub_add_sub_cancel]
157+
rfl ⟩
158+
159+
lemma coe_valuation_eq_rankOne_hom_comp_valuation : ⇑NormedField.valuation = hv.hom ∘ val.v := rfl
160+
161+
end NormedField
162+
129163
end Valued

0 commit comments

Comments
 (0)