p
-adic Valuation #
This file defines the p
-adic valuation on ℕ
, ℤ
, and ℚ
.
The p
-adic valuation on ℚ
is the difference of the multiplicities of p
in the numerator and
denominator of q
. This function obeys the standard properties of a valuation, with the appropriate
assumptions on p
. The p
-adic valuations on ℕ
and ℤ
agree with that on ℚ
.
The valuation induces a norm on ℚ
. This norm is defined in padicNorm.lean.
For p ≠ 1
, the p
-adic valuation of a natural n ≠ 0
is the largest natural number k
such
that p^k
divides n
. If n = 0
or p = 1
, then padicValNat p q
defaults to 0
.
Instances For
theorem
padicValNat_def
{p : ℕ}
[hp : Fact (Nat.Prime p)]
{n : ℕ}
(hn : 0 < n)
:
padicValNat p n = multiplicity p n
A simplification of padicValNat
when one input is prime, by analogy with
padicValRat_def
.
theorem
padicValNat_eq_emultiplicity
{p : ℕ}
[hp : Fact (Nat.Prime p)]
{n : ℕ}
(hn : 0 < n)
:
↑(padicValNat p n) = emultiplicity p n
A simplification of padicValNat
when one input is prime, by analogy with
padicValRat_def
.
theorem
le_emultiplicity_iff_replicate_subperm_primeFactorsList
{a b n : ℕ}
(ha : Nat.Prime a)
(hb : b ≠ 0)
:
↑n ≤ emultiplicity a b ↔ (List.replicate n a).Subperm b.primeFactorsList
theorem
le_padicValNat_iff_replicate_subperm_primeFactorsList
{a b n : ℕ}
(ha : Nat.Prime a)
(hb : b ≠ 0)
:
n ≤ padicValNat a b ↔ (List.replicate n a).Subperm b.primeFactorsList