English
The p-adic valuation on PadicInt p is defined by taking the valuation of its image in the field of p-adic numbers and then taking the natural value.
Русский
Падиковская ценность на ℤ_p определяется как ценность изображения элемента в поле p-адических чисел, затем переводится вNat.
LaTeX
$$\operatorname{valuation}(x) = ((x : \mathbb{Q}_{p}).valuation).toNat$$
Lean4
/-- `PadicInt.valuation` lifts the `p`-adic valuation on `ℚ` to `ℤ_[p]`. -/
def valuation (x : ℤ_[p]) : ℕ :=
(x : ℚ_[p]).valuation.toNat