p-adic Valuation #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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 padic_norm.lean.
Notations #
This file uses the local notation /.
for rat.mk
.
Implementation notes #
Much, but not all, of this file assumes that p
is prime. This assumption is inferred automatically
by taking [fact p.prime]
as a type class argument.
References #
- F. Q. Gouvêa, p-adic numbers
- R. Y. Lewis, A formal proof of Hensel's lemma over the p-adic integers
- https://en.wikipedia.org/wiki/P-adic_number
Tags #
p-adic, p adic, padic, norm, valuation
For p ≠ 1
, the p
-adic valuation of a natural n ≠ 0
is the largest natural number k
such
that p^k
divides z
. If n = 0
or p = 1
, then padic_val_nat p q
defaults to 0
.
padic_val_nat p 0
is 0
for any p
.
padic_val_nat p 1
is 0
for any p
.
If p ≠ 0
and p ≠ 1
, then padic_val_rat p p
is 1
.
For p ≠ 1
, the p
-adic valuation of an integer z ≠ 0
is the largest natural number k
such
that p^k
divides z
. If x = 0
or p = 1
, then padic_val_int p q
defaults to 0
.
Equations
- padic_val_int p z = padic_val_nat p z.nat_abs
padic_val_int p 0
is 0
for any p
.
padic_val_int p 1
is 0
for any p
.
The p
-adic value of a natural is its p
-adic value as an integer.
If p ≠ 0
and p ≠ 1
, then padic_val_int p p
is 1
.
padic_val_rat
defines the valuation of a rational q
to be the valuation of q.num
minus the
valuation of q.denom
. If q = 0
or p = 1
, then padic_val_rat p q
defaults to 0
.
Equations
- padic_val_rat p q = ↑(padic_val_int p q.num) - ↑(padic_val_nat p q.denom)
padic_val_rat p q
is symmetric in q
.
padic_val_rat p 0
is 0
for any p
.
padic_val_rat p 1
is 0
for any p
.
The p
-adic value of an integer z ≠ 0
is its p
-adic_value as a rational.
The p
-adic value of an integer z ≠ 0
is the multiplicity of p
in z
.
The p
-adic value of an integer z ≠ 0
is its p
-adic value as a rational.
If p ≠ 0
and p ≠ 1
, then padic_val_rat p p
is 1
.
padic_val_rat
coincides with padic_val_nat
.
A simplification of padic_val_nat
when one input is prime, by analogy with
padic_val_rat_def
.
The multiplicity of p : ℕ
in a : ℤ
is finite exactly when a ≠ 0
.
A rewrite lemma for padic_val_rat p q
when q
is expressed in terms of rat.mk
.
A rewrite lemma for padic_val_rat p (q * r)
with conditions q ≠ 0
, r ≠ 0
.
A rewrite lemma for padic_val_rat p (q^k)
with condition q ≠ 0
.
A rewrite lemma for padic_val_rat p (q⁻¹)
with condition q ≠ 0
.
A rewrite lemma for padic_val_rat p (q / r)
with conditions q ≠ 0
, r ≠ 0
.
A condition for padic_val_rat p (n₁ / d₁) ≤ padic_val_rat p (n₂ / d₂)
, in terms of
divisibility by p^n
.
Sufficient conditions to show that the p
-adic valuation of q
is less than or equal to the
p
-adic valuation of q + r
.
The minimum of the valuations of q
and r
is at most the valuation of q + r
.
A finite sum of rationals with positive p
-adic valuation has positive p
-adic valuation
(if the sum is non-zero).
A rewrite lemma for padic_val_nat p (a * b)
with conditions a ≠ 0
, b ≠ 0
.
Dividing out by a prime factor reduces the padic_val_nat
by 1
.
A version of padic_val_rat.pow
for padic_val_nat
.