p-adic numbers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the p
-adic numbers (rationals) ℚ_[p]
as
the completion of ℚ
with respect to the p
-adic norm.
We show that the p
-adic norm on ℚ
extends to ℚ_[p]
, that ℚ
is embedded in ℚ_[p]
,
and that ℚ_[p]
is Cauchy complete.
Important definitions #
padic
: the type ofp
-adic numberspadic_norm_e
: the rational valuedp
-adic norm onℚ_[p]
padic.add_valuation
: the additivep
-adic valuation onℚ_[p]
, with values inwith_top ℤ
Notation #
We introduce the notation ℚ_[p]
for the p
-adic numbers.
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.
We use the same concrete Cauchy sequence construction that is used to construct ℝ
.
ℚ_[p]
inherits a field structure from this construction.
The extension of the norm on ℚ
to ℚ_[p]
is not analogous to extending the absolute value to
ℝ
and hence the proof that ℚ_[p]
is complete is different from the proof that ℝ is complete.
A small special-purpose simplification tactic, padic_index_simp
, is used to manipulate sequence
indices in the proof that the norm extends.
padic_norm_e
is the rational-valued p
-adic norm on ℚ_[p]
.
To instantiate ℚ_[p]
as a normed field, we must cast this into a ℝ
-valued norm.
The ℝ
-valued norm, using notation ‖ ‖
from normed spaces,
is the canonical representation of this norm.
simp
prefers padic_norm
to padic_norm_e
when possible.
Since padic_norm_e
and ‖ ‖
have different types, simp
does not rewrite one to the other.
Coercions from ℚ
to ℚ_[p]
are set up to work with the norm_cast
tactic.
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, cauchy, completion, p-adic completion
Since the norm of the entries of a Cauchy sequence is eventually stationary, we can lift the norm to sequences.
Equations
- f.norm = dite (f ≈ 0) (λ (hf : f ≈ 0), 0) (λ (hf : ¬f ≈ 0), padic_norm p (⇑f (padic_seq.stationary_point hf)))
An auxiliary lemma for manipulating sequence indices.
An auxiliary lemma for manipulating sequence indices.
An auxiliary lemma for manipulating sequence indices.
The p
-adic numbers ℚ_[p]
are the Cauchy completion of ℚ
with respect to the p
-adic norm.
Equations
Instances for padic
- padic.field
- padic.inhabited
- padic.comm_ring
- padic.ring
- padic.has_zero
- padic.has_one
- padic.has_add
- padic.has_mul
- padic.has_sub
- padic.has_neg
- padic.has_div
- padic.add_comm_group
- padic.char_zero
- padic.has_dist
- padic.metric_space
- padic.has_norm
- padic.normed_field
- padic_norm_e.padic.nontrivially_normed_field
- padic.complete
- padic.complete_space
- padic_int.padic.has_coe
- padic_int.algebra
- padic_int.is_fraction_ring
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
The rational-valued p
-adic norm on ℚ_[p]
is lifted from the norm on Cauchy sequences. The
canonical form of this function is the normed space instance, with notation ‖ ‖
.
Equations
- padic_norm_e = {to_mul_hom := {to_fun := quotient.lift padic_seq.norm padic_seq.norm_equiv, map_mul' := _}, nonneg' := _, eq_zero' := _, add_le' := _}
Theorems about padic_norm_e
are named with a '
so the names do not conflict with the
equivalent theorems about norm
(‖ ‖
).
Theorems about padic_norm_e
are named with a '
so the names do not conflict with the
equivalent theorems about norm
(‖ ‖
).
lim_seq f
, for f
a Cauchy sequence of p
-adic numbers, is a sequence of rationals with the
same limit point as f
.
Equations
- padic.lim_seq f = λ (n : ℕ), classical.some _
Equations
- padic.metric_space p = {to_pseudo_metric_space := {to_has_dist := {dist := has_dist.dist (padic.has_dist p)}, dist_self := _, dist_comm := _, dist_triangle := _, edist := λ (x y : ℚ_[p]), ↑⟨has_dist.dist x y, _⟩, edist_dist := _, to_uniform_space := uniform_space_of_dist has_dist.dist _ _ _, uniformity_dist := _, to_bornology := bornology.of_dist has_dist.dist _ _ _, cobounded_sets := _}, eq_of_dist_eq_zero := _}
Equations
- padic.normed_field p = {to_has_norm := {norm := has_norm.norm (padic.has_norm p)}, to_field := {add := field.add padic.field, add_assoc := _, zero := field.zero padic.field, zero_add := _, add_zero := _, nsmul := field.nsmul padic.field, nsmul_zero' := _, nsmul_succ' := _, neg := field.neg padic.field, sub := field.sub padic.field, sub_eq_add_neg := _, zsmul := field.zsmul padic.field, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := field.int_cast padic.field, nat_cast := field.nat_cast padic.field, one := field.one padic.field, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := field.mul padic.field, mul_assoc := _, one_mul := _, mul_one := _, npow := field.npow padic.field, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _, inv := field.inv padic.field, div := field.div padic.field, div_eq_mul_inv := _, zpow := field.zpow padic.field, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, rat_cast := field.rat_cast padic.field, mul_inv_cancel := _, inv_zero := _, rat_cast_mk := _, qsmul := field.qsmul padic.field, qsmul_eq_mul' := _}, to_metric_space := {to_pseudo_metric_space := metric_space.to_pseudo_metric_space (padic.metric_space p), eq_of_dist_eq_zero := _}, dist_eq := _, norm_mul' := _}
Equations
- padic_norm_e.padic.nontrivially_normed_field = {to_normed_field := {to_has_norm := normed_field.to_has_norm (padic.normed_field p), to_field := normed_field.to_field (padic.normed_field p), to_metric_space := normed_field.to_metric_space (padic.normed_field p), dist_eq := _, norm_mul' := _}, non_trivial := _}
rat_norm q
, for a p
-adic number q
is the p
-adic norm of q
, as rational number.
The lemma padic_norm_e.eq_rat_norm
asserts ‖q‖ = rat_norm q
.
Equations
Valuation on ℚ_[p]
#
padic.valuation
lifts the p
-adic valuation on rationals to ℚ_[p]
.
Equations
- padic.valuation = quotient.lift padic_seq.valuation padic.valuation._proof_1
The additive p
-adic valuation on ℚ_[p]
, as an add_valuation
.