Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Mathlib/NumberTheory/Padics/PadicNumbers.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,19 @@ lemma norm_eq_zpow_log_mulValuation {x : ℚ_[p]} (hx : x ≠ 0) :
‖x‖ = (p : ℝ) ^ (log (mulValuation x)) := by
simp [norm_eq_zpow_neg_valuation, hx]

lemma norm_lt_zpow_iff_mulValuation_lt_exp {x : ℚ_[p]} {m : ℤ} :
‖x‖ < (p : ℝ) ^ m ↔ mulValuation x < exp m := by
have h1p : (1 : ℝ) < p := mod_cast hp.out.one_lt
by_cases hx : x = 0
· simpa [hx] using zpow_pos (by positivity) m
· rw [norm_eq_zpow_neg_valuation hx, zpow_lt_zpow_iff_right₀ h1p, mulValuation_toFun,
ite_eq_right hx, exp_lt_exp]

lemma norm_lt_norm_iff_mulValuation_lt {x y : ℚ_[p]} (hy : y ≠ 0) :
‖x‖ < ‖y‖ ↔ mulValuation x < mulValuation y := by
rw [norm_eq_zpow_log_mulValuation hy, norm_lt_zpow_iff_mulValuation_lt_exp,
exp_log (mulValuation.ne_zero_iff.mpr hy)]

/-- The additive `p`-adic valuation on `ℚ_[p]`, as an `addValuation`. -/
def addValuation : AddValuation ℚ_[p] (WithTop ℤ) :=
AddValuation.of addValuationDef AddValuation.map_zero AddValuation.map_one AddValuation.map_add
Expand Down
23 changes: 22 additions & 1 deletion Mathlib/NumberTheory/Padics/ValuativeRel.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module

public import Mathlib.NumberTheory.Padics.PadicNumbers
public import Mathlib.RingTheory.Valuation.RankOne
public import Mathlib.Topology.Algebra.ValuativeRel.ValuativeTopology

/-!
# p-adic numbers with a valuative relation
Expand All @@ -21,7 +22,7 @@ public section
variable {p : ℕ} [hp : Fact p.Prime] {Γ₀ : Type*} [LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation ℚ_[p] Γ₀)

open ValuativeRel WithZero
open ValuativeRel WithZero Valuation MonoidWithZeroHom.ValueGroup₀

namespace Padic

Expand All @@ -44,4 +45,24 @@ instance : IsNontrivial ℚ_[p] where

instance : IsRankLeOne ℚ_[p] := .of_compatible_mulArchimedean mulValuation

instance : IsValuativeTopology ℚ_[p] := by
refine IsValuativeTopology.of_mem_nhds_zero_iff_vle (mulValuation (p := p)) fun {s} ↦ ?_
rw [Metric.mem_nhds_iff]
have h1p : (1 : ℝ) < p := mod_cast hp.out.one_lt
constructor
· -- A metric ball `‖·‖ < ε` contains the valuation ball of radius `v (p ^ n)` for large `n`.
intro ⟨ε, hε, hball⟩
obtain ⟨n, hn⟩ := exists_pow_lt_of_lt_one hε (inv_lt_one_of_one_lt₀ h1p)
have ha0 : (p : ℚ_[p]) ^ n ≠ 0 := pow_ne_zero _ (Nat.cast_ne_zero.mpr hp.out.ne_zero)
have hnorm : ‖(p : ℚ_[p]) ^ n‖ < ε := by simpa [norm_pow, norm_p] using hn
refine ⟨Units.mk0 (mulValuation.restrict (p ^ n)) (by simpa using ha0),
fun z hz ↦ hball (mem_ball_zero_iff.mpr ?_)⟩
simp only [Set.mem_ofPred_eq, Units.val_mk0, restrict_lt_iff] at hz
exact ((norm_lt_norm_iff_mulValuation_lt ha0).mpr hz).trans hnorm
· -- Conversely, a valuation ball `v · < γ` is the metric ball of radius `p ^ log γ`.
intro ⟨γ, hγ⟩
refine ⟨p ^ log (embedding γ.val), zpow_pos (by positivity) _, fun _ hz ↦ hγ ?_⟩
rw [mem_ball_zero_iff, norm_lt_zpow_iff_mulValuation_lt_exp, exp_log (by simp)] at hz
simpa [restrict_lt_iff_lt_embedding] using hz

end Padic
Loading