# p-adic numbers #

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 of p-adic numbers
• padicNormE : the rational valued p-adic norm on ℚ_[p]
• Padic.addValuation : the additive p-adic valuation on ℚ_[p], with values in WithTop ℤ

## 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.

padicNormE is the rational-valued p-adic norm on ℚ_[p]. To instantiate ℚ_[p] as a normed field, we must cast this into an ℝ-valued norm. The ℝ-valued norm, using notation ‖ ‖ from normed spaces, is the canonical representation of this norm.

simp prefers padicNorm to padicNormE when possible. Since padicNormE 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.

## Tags #

@[reducible, inline]
abbrev PadicSeq (p : ) :

The type of Cauchy sequences of rationals with respect to the p-adic norm.

Equations
Instances For
theorem PadicSeq.stationary {p : } [Fact ()] {f : CauSeq ()} (hf : ¬f 0) :
∃ (N : ), ∀ (m n : ), N mN npadicNorm p (f n) = padicNorm p (f m)

The p-adic norm of the entries of a nonzero Cauchy sequence of rationals is eventually constant.

def PadicSeq.stationaryPoint {p : } [Fact ()] {f : } (hf : ¬f 0) :

For all n ≥ stationaryPoint f hf, the p-adic norm of f n is the same.

Equations
Instances For
theorem PadicSeq.stationaryPoint_spec {p : } [Fact ()] {f : } (hf : ¬f 0) {m : } {n : } :
padicNorm p (f n) = padicNorm p (f m)
def PadicSeq.norm {p : } [Fact ()] (f : ) :

Since the norm of the entries of a Cauchy sequence is eventually stationary, we can lift the norm to sequences.

Equations
Instances For
theorem PadicSeq.norm_zero_iff {p : } [Fact ()] (f : ) :
f.norm = 0 f 0
theorem PadicSeq.equiv_zero_of_val_eq_of_equiv_zero {p : } [Fact ()] {f : } {g : } (h : ∀ (k : ), padicNorm p (f k) = padicNorm p (g k)) (hf : f 0) :
g 0
theorem PadicSeq.norm_nonzero_of_not_equiv_zero {p : } [Fact ()] {f : } (hf : ¬f 0) :
f.norm 0
theorem PadicSeq.norm_eq_norm_app_of_nonzero {p : } [Fact ()] {f : } (hf : ¬f 0) :
∃ (k : ), f.norm = k 0
theorem PadicSeq.not_limZero_const_of_nonzero {p : } [Fact ()] {q : } (hq : q 0) :
¬().LimZero
theorem PadicSeq.not_equiv_zero_const_of_nonzero {p : } [Fact ()] {q : } (hq : q 0) :
theorem PadicSeq.norm_nonneg {p : } [Fact ()] (f : ) :
0 f.norm
theorem PadicSeq.lift_index_left_left {p : } [Fact ()] {f : } (hf : ¬f 0) (v2 : ) (v3 : ) :
padicNorm p (f ) = padicNorm p (f (max (max v2 v3)))

An auxiliary lemma for manipulating sequence indices.

theorem PadicSeq.lift_index_left {p : } [Fact ()] {f : } (hf : ¬f 0) (v1 : ) (v3 : ) :
padicNorm p (f ) = padicNorm p (f (max v1 (max v3)))

An auxiliary lemma for manipulating sequence indices.

theorem PadicSeq.lift_index_right {p : } [Fact ()] {f : } (hf : ¬f 0) (v1 : ) (v2 : ) :
padicNorm p (f ) = padicNorm p (f (max v1 (max v2 )))

An auxiliary lemma for manipulating sequence indices.

### Valuation on PadicSeq#

def PadicSeq.valuation {p : } [Fact ()] (f : ) :

The p-adic valuation on ℚ lifts to PadicSeq p. Valuation f is defined to be the valuation of the (ℚ-valued) stationary point of f.

Equations
Instances For
theorem PadicSeq.norm_eq_pow_val {p : } [Fact ()] {f : } (hf : ¬f 0) :
f.norm = p ^ (-f.valuation)
theorem PadicSeq.val_eq_iff_norm_eq {p : } [Fact ()] {f : } {g : } (hf : ¬f 0) (hg : ¬g 0) :
f.valuation = g.valuation f.norm = g.norm
theorem PadicSeq.norm_mul {p : } [hp : Fact ()] (f : ) (g : ) :
(f * g).norm = f.norm * g.norm
theorem PadicSeq.eq_zero_iff_equiv_zero {p : } [hp : Fact ()] (f : ) :
f 0
theorem PadicSeq.ne_zero_iff_nequiv_zero {p : } [hp : Fact ()] (f : ) :
¬f 0
theorem PadicSeq.norm_const {p : } [hp : Fact ()] (q : ) :
theorem PadicSeq.norm_values_discrete {p : } [hp : Fact ()] (a : ) (ha : ¬a 0) :
∃ (z : ), a.norm = p ^ (-z)
theorem PadicSeq.norm_one {p : } [hp : Fact ()] :
theorem PadicSeq.norm_equiv {p : } [hp : Fact ()] {f : } {g : } (hfg : f g) :
f.norm = g.norm
theorem PadicSeq.norm_nonarchimedean {p : } [hp : Fact ()] (f : ) (g : ) :
(f + g).norm max f.norm g.norm
theorem PadicSeq.norm_eq {p : } [hp : Fact ()] {f : } {g : } (h : ∀ (k : ), padicNorm p (f k) = padicNorm p (g k)) :
f.norm = g.norm
theorem PadicSeq.norm_neg {p : } [hp : Fact ()] (a : ) :
(-a).norm = a.norm
theorem PadicSeq.norm_eq_of_add_equiv_zero {p : } [hp : Fact ()] {f : } {g : } (h : f + g 0) :
f.norm = g.norm
theorem PadicSeq.add_eq_max_of_ne {p : } [hp : Fact ()] {f : } {g : } (hfgne : f.norm g.norm) :
(f + g).norm = max f.norm g.norm
def Padic (p : ) [Fact ()] :

The p-adic numbers ℚ_[p] are the Cauchy completion of ℚ with respect to the p-adic norm.

Equations
Instances For

notation for p-padic rationals

Equations
• One or more equations did not get rendered due to their size.
Instances For
instance Padic.field {p : } [Fact ()] :
Equations
• Padic.field = CauSeq.Completion.Cauchy.field
instance Padic.instInhabited {p : } [Fact ()] :
Equations
• Padic.instInhabited = { default := 0 }
instance Padic.instCommRing {p : } [Fact ()] :
Equations
• Padic.instCommRing = CauSeq.Completion.Cauchy.commRing
instance Padic.instRing {p : } [Fact ()] :
Equations
• Padic.instRing = CauSeq.Completion.Cauchy.ring
instance Padic.instZero {p : } [Fact ()] :
Equations
• Padic.instZero = inferInstance
instance Padic.instOne {p : } [Fact ()] :
Equations
• Padic.instOne = inferInstance
instance Padic.instAdd {p : } [Fact ()] :
Equations
instance Padic.instMul {p : } [Fact ()] :
Equations
• Padic.instMul = inferInstance
instance Padic.instSub {p : } [Fact ()] :
Equations
• Padic.instSub = inferInstance
instance Padic.instNeg {p : } [Fact ()] :
Equations
• Padic.instNeg = inferInstance
instance Padic.instDiv {p : } [Fact ()] :
Equations
• Padic.instDiv = inferInstance
instance Padic.instAddCommGroup {p : } [Fact ()] :
Equations
def Padic.mk {p : } [Fact ()] :
ℚ_[p]

Builds the equivalence class of a Cauchy sequence of rationals.

Equations
• Padic.mk = Quotient.mk'
Instances For
theorem Padic.zero_def (p : ) [Fact ()] :
0 = 0
theorem Padic.mk_eq (p : ) [Fact ()] {f : } {g : } :
f g
theorem Padic.const_equiv (p : ) [Fact ()] {q : } {r : } :
q = r
theorem Padic.coe_inj (p : ) [Fact ()] {q : } {r : } :
q = r q = r
instance Padic.instCharZero (p : ) [Fact ()] :
Equations
• =
theorem Padic.coe_add (p : ) [Fact ()] {x : } {y : } :
(x + y) = x + y
theorem Padic.coe_neg (p : ) [Fact ()] {x : } :
(-x) = -x
theorem Padic.coe_mul (p : ) [Fact ()] {x : } {y : } :
(x * y) = x * y
theorem Padic.coe_sub (p : ) [Fact ()] {x : } {y : } :
(x - y) = x - y
theorem Padic.coe_div (p : ) [Fact ()] {x : } {y : } :
(x / y) = x / y
theorem Padic.coe_one (p : ) [Fact ()] :
1 = 1
theorem Padic.coe_zero (p : ) [Fact ()] :
0 = 0
def padicNormE {p : } [hp : Fact ()] :

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
• padicNormE = { toFun := Quotient.lift PadicSeq.norm , map_mul' := , nonneg' := , eq_zero' := , add_le' := }
Instances For
theorem padicNormE.defn {p : } [Fact ()] (f : ) {ε : } (hε : 0 < ε) :
∃ (N : ), iN, padicNormE ( - (f i)) < ε
theorem padicNormE.nonarchimedean' {p : } [Fact ()] (q : ℚ_[p]) (r : ℚ_[p]) :

Theorems about padicNormE are named with a ' so the names do not conflict with the equivalent theorems about norm (‖ ‖).

theorem padicNormE.add_eq_max_of_ne' {p : } [Fact ()] {q : ℚ_[p]} {r : ℚ_[p]} :

Theorems about padicNormE are named with a ' so the names do not conflict with the equivalent theorems about norm (‖ ‖).

@[simp]
theorem padicNormE.eq_padic_norm' {p : } [Fact ()] (q : ) :
theorem padicNormE.image' {p : } [Fact ()] {q : ℚ_[p]} :
q 0∃ (n : ), padicNormE q = p ^ (-n)
theorem Padic.rat_dense' {p : } [Fact ()] (q : ℚ_[p]) {ε : } (hε : 0 < ε) :
∃ (r : ), padicNormE (q - r) < ε
def Padic.limSeq {p : } [Fact ()] (f : CauSeq ℚ_[p] padicNormE) :

limSeq f, for f a Cauchy sequence of p-adic numbers, is a sequence of rationals with the same limit point as f.

Equations
Instances For
theorem Padic.exi_rat_seq_conv {p : } [Fact ()] (f : CauSeq ℚ_[p] padicNormE) {ε : } (hε : 0 < ε) :
∃ (N : ), iN, padicNormE (f i - ()) < ε
theorem Padic.exi_rat_seq_conv_cauchy {p : } [Fact ()] (f : CauSeq ℚ_[p] padicNormE) :
IsCauSeq () ()
theorem Padic.complete' {p : } [Fact ()] (f : CauSeq ℚ_[p] padicNormE) :
∃ (q : ℚ_[p]), ε > 0, ∃ (N : ), iN, padicNormE (q - f i) < ε
theorem Padic.complete'' {p : } [Fact ()] (f : CauSeq ℚ_[p] padicNormE) :
∃ (q : ℚ_[p]), ε > 0, ∃ (N : ), iN, padicNormE (f i - q) < ε
instance Padic.instDist (p : ) [Fact ()] :
Equations
• = { dist := fun (x y : ℚ_[p]) => (padicNormE (x - y)) }
instance Padic.instIsUltrametricDist (p : ) [Fact ()] :
Equations
• =
instance Padic.metricSpace (p : ) [Fact ()] :
Equations
instance Padic.instNorm (p : ) [Fact ()] :
Equations
• = { norm := fun (x : ℚ_[p]) => (padicNormE x) }
instance Padic.normedField (p : ) [Fact ()] :
Equations
• = let __src := Padic.field; let __src_1 := ;
instance Padic.isAbsoluteValue (p : ) [Fact ()] :
Equations
• =
theorem Padic.rat_dense (p : ) [Fact ()] (q : ℚ_[p]) {ε : } (hε : 0 < ε) :
∃ (r : ), q - r < ε
@[simp]
theorem padicNormE.mul {p : } [hp : Fact ()] (q : ℚ_[p]) (r : ℚ_[p]) :
theorem padicNormE.is_norm {p : } [hp : Fact ()] (q : ℚ_[p]) :
(padicNormE q) = q
theorem padicNormE.nonarchimedean {p : } [hp : Fact ()] (q : ℚ_[p]) (r : ℚ_[p]) :
theorem padicNormE.add_eq_max_of_ne {p : } [hp : Fact ()] {q : ℚ_[p]} {r : ℚ_[p]} (h : q r) :
@[simp]
theorem padicNormE.eq_padicNorm {p : } [hp : Fact ()] (q : ) :
q = ()
@[simp]
theorem padicNormE.norm_p {p : } [hp : Fact ()] :
p = (p)⁻¹
theorem padicNormE.norm_p_lt_one {p : } [hp : Fact ()] :
p < 1
@[simp]
theorem padicNormE.norm_p_zpow {p : } [hp : Fact ()] (n : ) :
p ^ n = p ^ (-n)
@[simp]
theorem padicNormE.norm_p_pow {p : } [hp : Fact ()] (n : ) :
p ^ n = p ^ (-n)
Equations
• padicNormE.instNontriviallyNormedFieldPadic = let __src := ;
theorem padicNormE.image {p : } [hp : Fact ()] {q : ℚ_[p]} :
q 0∃ (n : ), q = (p ^ (-n))
theorem padicNormE.is_rat {p : } [hp : Fact ()] (q : ℚ_[p]) :
∃ (q' : ), q = q'
def padicNormE.ratNorm {p : } [hp : Fact ()] (q : ℚ_[p]) :

ratNorm q, for a p-adic number q is the p-adic norm of q, as rational number.

The lemma padicNormE.eq_ratNorm asserts ‖q‖ = ratNorm q.

Equations
Instances For
theorem padicNormE.eq_ratNorm {p : } [hp : Fact ()] (q : ℚ_[p]) :
q =
theorem padicNormE.norm_rat_le_one {p : } [hp : Fact ()] {q : } :
¬p q.denq 1
theorem padicNormE.norm_int_le_one {p : } [hp : Fact ()] (z : ) :
z 1
theorem padicNormE.norm_int_lt_one_iff_dvd {p : } [hp : Fact ()] (k : ) :
k < 1 p k
theorem padicNormE.norm_int_le_pow_iff_dvd {p : } [hp : Fact ()] (k : ) (n : ) :
k p ^ (-n) p ^ n k
theorem padicNormE.eq_of_norm_add_lt_right {p : } [hp : Fact ()] {z1 : ℚ_[p]} {z2 : ℚ_[p]} (h : z1 + z2 < z2) :
theorem padicNormE.eq_of_norm_add_lt_left {p : } [hp : Fact ()] {z1 : ℚ_[p]} {z2 : ℚ_[p]} (h : z1 + z2 < z1) :
instance Padic.complete {p : } [hp : Fact ()] :
Equations
• =
theorem Padic.padicNormE_lim_le {p : } [hp : Fact ()] {f : CauSeq ℚ_[p] norm} {a : } (ha : 0 < a) (hf : ∀ (i : ), f i a) :
f.lim a
instance Padic.instCompleteSpace {p : } [hp : Fact ()] :
Equations
• =

### Valuation on ℚ_[p]#

def Padic.valuation {p : } [hp : Fact ()] :
ℚ_[p]

Padic.valuation lifts the p-adic valuation on rationals to ℚ_[p].

Equations
Instances For
@[simp]
theorem Padic.valuation_zero {p : } [hp : Fact ()] :
@[simp]
theorem Padic.valuation_one {p : } [hp : Fact ()] :
theorem Padic.norm_eq_pow_val {p : } [hp : Fact ()] {x : ℚ_[p]} :
x 0x = p ^ (-x.valuation)
@[simp]
theorem Padic.valuation_p {p : } [hp : Fact ()] :
(p).valuation = 1
theorem Padic.valuation_map_add {p : } [hp : Fact ()] {x : ℚ_[p]} {y : ℚ_[p]} (hxy : x + y 0) :
min x.valuation y.valuation (x + y).valuation
@[simp]
theorem Padic.valuation_map_mul {p : } [hp : Fact ()] {x : ℚ_[p]} {y : ℚ_[p]} (hx : x 0) (hy : y 0) :
(x * y).valuation = x.valuation + y.valuation
def Padic.addValuationDef {p : } [hp : Fact ()] :
ℚ_[p]

The additive p-adic valuation on ℚ_[p], with values in WithTop ℤ.

Equations
• x.addValuationDef = if x = 0 then else x.valuation
Instances For
@[simp]
theorem Padic.AddValuation.map_zero {p : } [hp : Fact ()] :
@[simp]
theorem Padic.AddValuation.map_one {p : } [hp : Fact ()] :
theorem Padic.AddValuation.map_mul {p : } [hp : Fact ()] (x : ℚ_[p]) (y : ℚ_[p]) :
theorem Padic.AddValuation.map_add {p : } [hp : Fact ()] (x : ℚ_[p]) (y : ℚ_[p]) :
def Padic.addValuation {p : } [hp : Fact ()] :

The additive p-adic valuation on ℚ_[p], as an addValuation.

Equations
Instances For
@[simp]
theorem Padic.addValuation.apply {p : } [hp : Fact ()] {x : ℚ_[p]} (hx : x 0) :