Documentation

Mathlib.NumberTheory.Padics.PadicNumbers

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 #

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.

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.

References #

Tags #

p-adic, p adic, padic, norm, valuation, cauchy, completion, p-adic completion

The p-adic valuation on rationals, sending p to (exp (-1) : ℤᵐ⁰)

Equations
Instances For

    The p-adic valuation on integers, sending p to (exp (-1) : ℤᵐ⁰)

    Equations
    Instances For
      @[simp]
      theorem Int.padicValuation_eq_zero_iff {p : } [Fact (Nat.Prime p)] {x : } :
      (padicValuation p) x = 0 x = 0
      @[simp]
      @[simp]
      theorem Int.padicValuation_lt_one_iff {p : } [Fact (Nat.Prime p)] {x : } :
      (padicValuation p) x < 1 p x
      @[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 (Nat.Prime p)] {f : CauSeq (padicNorm p)} (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 (Nat.Prime p)] {f : PadicSeq p} (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 (Nat.Prime p)] {f : PadicSeq p} (hf : ¬f 0) {m n : } :
          stationaryPoint hf mstationaryPoint hf npadicNorm p (f n) = padicNorm p (f m)
          def PadicSeq.norm {p : } [Fact (Nat.Prime p)] (f : PadicSeq p) :

          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 (Nat.Prime p)] (f : PadicSeq p) :
            f.norm = 0 f 0
            theorem PadicSeq.equiv_zero_of_val_eq_of_equiv_zero {p : } [Fact (Nat.Prime p)] {f g : PadicSeq p} (h : ∀ (k : ), padicNorm p (f k) = padicNorm p (g k)) (hf : f 0) :
            g 0
            theorem PadicSeq.norm_eq_norm_app_of_nonzero {p : } [Fact (Nat.Prime p)] {f : PadicSeq p} (hf : ¬f 0) :
            ∃ (k : ), f.norm = padicNorm p k k 0
            theorem PadicSeq.norm_nonneg {p : } [Fact (Nat.Prime p)] (f : PadicSeq p) :
            0 f.norm
            theorem PadicSeq.lift_index_left_left {p : } [Fact (Nat.Prime p)] {f : PadicSeq p} (hf : ¬f 0) (v2 v3 : ) :
            padicNorm p (f (stationaryPoint hf)) = padicNorm p (f (max (stationaryPoint hf) (max v2 v3)))

            An auxiliary lemma for manipulating sequence indices.

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

            An auxiliary lemma for manipulating sequence indices.

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

            An auxiliary lemma for manipulating sequence indices.

            Valuation on PadicSeq #

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

            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_zpow_neg_valuation {p : } [Fact (Nat.Prime p)] {f : PadicSeq p} (hf : ¬f 0) :
              f.norm = p ^ (-f.valuation)
              theorem PadicSeq.val_eq_iff_norm_eq {p : } [Fact (Nat.Prime p)] {f g : PadicSeq p} (hf : ¬f 0) (hg : ¬g 0) :
              theorem PadicSeq.norm_mul {p : } [hp : Fact (Nat.Prime p)] (f g : PadicSeq p) :
              (f * g).norm = f.norm * g.norm
              theorem PadicSeq.norm_const {p : } [hp : Fact (Nat.Prime p)] (q : ) :
              theorem PadicSeq.norm_values_discrete {p : } [hp : Fact (Nat.Prime p)] (a : PadicSeq p) (ha : ¬a 0) :
              ∃ (z : ), a.norm = p ^ (-z)
              theorem PadicSeq.norm_one {p : } [hp : Fact (Nat.Prime p)] :
              norm 1 = 1
              theorem PadicSeq.norm_equiv {p : } [hp : Fact (Nat.Prime p)] {f g : PadicSeq p} (hfg : f g) :
              f.norm = g.norm
              theorem PadicSeq.norm_nonarchimedean {p : } [hp : Fact (Nat.Prime p)] (f g : PadicSeq p) :
              (f + g).norm max f.norm g.norm
              theorem PadicSeq.norm_eq {p : } [hp : Fact (Nat.Prime p)] {f g : PadicSeq p} (h : ∀ (k : ), padicNorm p (f k) = padicNorm p (g k)) :
              f.norm = g.norm
              theorem PadicSeq.norm_neg {p : } [hp : Fact (Nat.Prime p)] (a : PadicSeq p) :
              (-a).norm = a.norm
              theorem PadicSeq.norm_eq_of_add_equiv_zero {p : } [hp : Fact (Nat.Prime p)] {f g : PadicSeq p} (h : f + g 0) :
              f.norm = g.norm
              theorem PadicSeq.add_eq_max_of_ne {p : } [hp : Fact (Nat.Prime p)] {f g : PadicSeq p} (hfgne : f.norm g.norm) :
              (f + g).norm = max f.norm g.norm
              def Padic (p : ) [Fact (Nat.Prime p)] :

              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
                  Equations
                  def Padic.mk {p : } [Fact (Nat.Prime p)] :

                  Builds the equivalence class of a Cauchy sequence of rationals.

                  Equations
                  Instances For
                    theorem Padic.zero_def (p : ) [Fact (Nat.Prime p)] :
                    theorem Padic.mk_eq (p : ) [Fact (Nat.Prime p)] {f g : PadicSeq p} :
                    mk f = mk g f g
                    theorem Padic.coe_inj (p : ) [Fact (Nat.Prime p)] {q r : } :
                    q = r q = r
                    theorem Padic.coe_add (p : ) [Fact (Nat.Prime p)] {x y : } :
                    ↑(x + y) = x + y
                    theorem Padic.coe_neg (p : ) [Fact (Nat.Prime p)] {x : } :
                    ↑(-x) = -x
                    theorem Padic.coe_mul (p : ) [Fact (Nat.Prime p)] {x y : } :
                    ↑(x * y) = x * y
                    theorem Padic.coe_sub (p : ) [Fact (Nat.Prime p)] {x y : } :
                    ↑(x - y) = x - y
                    theorem Padic.coe_div (p : ) [Fact (Nat.Prime p)] {x y : } :
                    ↑(x / y) = x / y
                    theorem Padic.coe_one (p : ) [Fact (Nat.Prime p)] :
                    1 = 1
                    theorem Padic.coe_zero (p : ) [Fact (Nat.Prime p)] :
                    0 = 0

                    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
                    Instances For
                      theorem padicNormE.defn {p : } [Fact (Nat.Prime p)] (f : PadicSeq p) {ε : } ( : 0 < ε) :
                      ∃ (N : ), iN, padicNormE (Padic.mk f - (f i)) < ε

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

                      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 (Nat.Prime p)] (q : ) :
                      theorem padicNormE.image' {p : } [Fact (Nat.Prime p)] {q : ℚ_[p]} :
                      q 0∃ (n : ), padicNormE q = p ^ (-n)
                      theorem Padic.rat_dense' {p : } [Fact (Nat.Prime p)] (q : ℚ_[p]) {ε : } ( : 0 < ε) :
                      ∃ (r : ), padicNormE (q - r) < ε
                      def Padic.limSeq {p : } [Fact (Nat.Prime p)] (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 (Nat.Prime p)] (f : CauSeq ℚ_[p] padicNormE) {ε : } ( : 0 < ε) :
                        ∃ (N : ), iN, padicNormE (f i - (limSeq f i)) < ε
                        theorem Padic.complete' {p : } [Fact (Nat.Prime p)] (f : CauSeq ℚ_[p] padicNormE) :
                        ∃ (q : ℚ_[p]), ε > 0, ∃ (N : ), iN, padicNormE (q - f i) < ε
                        theorem Padic.complete'' {p : } [Fact (Nat.Prime p)] (f : CauSeq ℚ_[p] padicNormE) :
                        ∃ (q : ℚ_[p]), ε > 0, ∃ (N : ), iN, padicNormE (f i - q) < ε
                        instance Padic.instDist (p : ) [Fact (Nat.Prime p)] :
                        Equations
                        Equations
                        • One or more equations did not get rendered due to their size.
                        instance Padic.instNorm (p : ) [Fact (Nat.Prime p)] :
                        Equations
                        Equations
                        theorem Padic.rat_dense (p : ) [Fact (Nat.Prime p)] (q : ℚ_[p]) {ε : } ( : 0 < ε) :
                        ∃ (r : ), q - r < ε
                        theorem Padic.padicNormE.mul {p : } [hp : Fact (Nat.Prime p)] (q r : ℚ_[p]) :
                        theorem Padic.padicNormE.is_norm {p : } [hp : Fact (Nat.Prime p)] (q : ℚ_[p]) :
                        theorem Padic.nonarchimedean {p : } [hp : Fact (Nat.Prime p)] (q r : ℚ_[p]) :
                        theorem Padic.add_eq_max_of_ne {p : } [hp : Fact (Nat.Prime p)] {q r : ℚ_[p]} (h : q r) :
                        @[simp]
                        theorem Padic.eq_padicNorm {p : } [hp : Fact (Nat.Prime p)] (q : ) :
                        q = (padicNorm p q)
                        @[simp]
                        theorem Padic.norm_p {p : } [hp : Fact (Nat.Prime p)] :
                        p = (↑p)⁻¹
                        theorem Padic.norm_p_lt_one {p : } [hp : Fact (Nat.Prime p)] :
                        p < 1
                        @[simp]
                        theorem Padic.norm_p_zpow {p : } [hp : Fact (Nat.Prime p)] (n : ) :
                        p ^ n = p ^ (-n)
                        @[simp]
                        theorem Padic.norm_p_pow {p : } [hp : Fact (Nat.Prime p)] (n : ) :
                        p ^ n = p ^ (-n)
                        theorem Padic.padicNormE.image {p : } [hp : Fact (Nat.Prime p)] {q : ℚ_[p]} :
                        q 0∃ (n : ), q = ↑(p ^ (-n))
                        theorem Padic.padicNormE.is_rat {p : } [hp : Fact (Nat.Prime p)] (q : ℚ_[p]) :
                        ∃ (q' : ), q = q'
                        def Padic.ratNorm {p : } [hp : Fact (Nat.Prime p)] (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 Padic.eq_ratNorm {p : } [hp : Fact (Nat.Prime p)] (q : ℚ_[p]) :
                          theorem Padic.norm_rat_le_one {p : } [hp : Fact (Nat.Prime p)] {q : } :
                          ¬p q.denq 1
                          theorem Padic.norm_int_le_one {p : } [hp : Fact (Nat.Prime p)] (z : ) :
                          z 1
                          @[simp]
                          theorem Padic.norm_intCast_lt_one_iff {p : } [hp : Fact (Nat.Prime p)] {k : } :
                          k < 1 p k
                          @[deprecated Padic.norm_intCast_lt_one_iff (since := "2025-08-15")]
                          theorem Padic.norm_int_lt_one_iff_dvd {p : } [hp : Fact (Nat.Prime p)] {k : } :
                          k < 1 p k

                          Alias of Padic.norm_intCast_lt_one_iff.

                          @[simp]
                          theorem Padic.norm_natCast_lt_one_iff {p : } [hp : Fact (Nat.Prime p)] {n : } :
                          n < 1 p n
                          @[simp]
                          theorem Padic.norm_intCast_eq_one_iff {p : } [hp : Fact (Nat.Prime p)] {z : } :
                          z = 1 IsCoprime z p
                          @[simp]
                          theorem Padic.norm_natCast_eq_one_iff {p : } [hp : Fact (Nat.Prime p)] {n : } :
                          n = 1 p.Coprime n
                          theorem Padic.norm_int_le_pow_iff_dvd {p : } [hp : Fact (Nat.Prime p)] (k : ) (n : ) :
                          k p ^ (-n) p ^ n k
                          theorem Padic.eq_of_norm_add_lt_right {p : } [hp : Fact (Nat.Prime p)] {z1 z2 : ℚ_[p]} (h : z1 + z2 < z2) :
                          theorem Padic.eq_of_norm_add_lt_left {p : } [hp : Fact (Nat.Prime p)] {z1 z2 : ℚ_[p]} (h : z1 + z2 < z1) :
                          theorem Padic.padicNormE_lim_le {p : } [hp : Fact (Nat.Prime p)] {f : CauSeq ℚ_[p] norm} {a : } (ha : 0 < a) (hf : ∀ (i : ), f i a) :

                          Valuation on ℚ_[p] #

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

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

                          Equations
                          Instances For
                            @[simp]
                            theorem Padic.valuation_zero {p : } [hp : Fact (Nat.Prime p)] :
                            theorem Padic.norm_eq_zpow_neg_valuation {p : } [hp : Fact (Nat.Prime p)] {x : ℚ_[p]} :
                            x 0x = p ^ (-x.valuation)
                            @[simp]
                            theorem Padic.valuation_ratCast {p : } [hp : Fact (Nat.Prime p)] (q : ) :
                            @[simp]
                            theorem Padic.valuation_intCast {p : } [hp : Fact (Nat.Prime p)] (n : ) :
                            (↑n).valuation = (padicValInt p n)
                            @[simp]
                            theorem Padic.valuation_natCast {p : } [hp : Fact (Nat.Prime p)] (n : ) :
                            (↑n).valuation = (padicValNat p n)
                            @[simp]
                            theorem Padic.valuation_ofNat {p : } [hp : Fact (Nat.Prime p)] (n : ) [n.AtLeastTwo] :
                            @[simp]
                            theorem Padic.valuation_one {p : } [hp : Fact (Nat.Prime p)] :
                            theorem Padic.valuation_p {p : } [hp : Fact (Nat.Prime p)] :
                            (↑p).valuation = 1
                            theorem Padic.le_valuation_add {p : } [hp : Fact (Nat.Prime p)] {x y : ℚ_[p]} (hxy : x + y 0) :
                            @[simp]
                            theorem Padic.valuation_mul {p : } [hp : Fact (Nat.Prime p)] {x y : ℚ_[p]} (hx : x 0) (hy : y 0) :
                            @[simp]
                            theorem Padic.valuation_inv {p : } [hp : Fact (Nat.Prime p)] (x : ℚ_[p]) :
                            @[simp]
                            theorem Padic.valuation_pow {p : } [hp : Fact (Nat.Prime p)] (x : ℚ_[p]) (n : ) :
                            (x ^ n).valuation = n * x.valuation
                            @[simp]
                            theorem Padic.valuation_zpow {p : } [hp : Fact (Nat.Prime p)] (x : ℚ_[p]) (n : ) :
                            (x ^ n).valuation = n * x.valuation

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

                            Equations
                            Instances For
                              @[simp]

                              The p-adic valuation on ℚ_[p], as a Valuation, bundled Padic.valuation.

                              Equations
                              Instances For
                                theorem Padic.norm_eq_zpow_log_mulValuation {p : } [hp : Fact (Nat.Prime p)] {x : ℚ_[p]} (hx : x 0) :

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

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

                                  Various characterizations of open unit balls #

                                  theorem Padic.norm_le_pow_iff_norm_lt_pow_add_one {p : } [hp : Fact (Nat.Prime p)] (x : ℚ_[p]) (n : ) :
                                  x p ^ n x < p ^ (n + 1)
                                  theorem Padic.norm_lt_pow_iff_norm_le_pow_sub_one {p : } [hp : Fact (Nat.Prime p)] (x : ℚ_[p]) (n : ) :
                                  x < p ^ n x p ^ (n - 1)