For every prime number p, the p-adic numbers form an extension of the rational numbers first described by Kurt Hensel in 1897. They have been used to solve several problems in number theory, many of them using Helmut Hasse's local-global principle, which roughly states that an equation can be solved over the rational numbers if it can be solved over the real numbers and over the p-adic numbers for every prime p.

If p is a fixed prime number, then any integer can be written as a p-adic expansion in the form

```       n
±  ∑  aipi
i=0
```

where the ai are integers in {0,...,p-1}. For example, the 2-adic or binary expansion of 35 is 1*25 + 0*24 + 0*23 + 0*22 + 1*21 + 1*20, often written in the shorthand notation 1000112.

If we extend this set by allowing infinite sums of the form

```       ∞
±  ∑  aipi
i=0
```

we obtain the p-adic integers. Intuitively, these are numbers whose p-adic expansion to the left never stops. The main technical problem is to define a proper notion of infinite sum which makes these expressions meaningful; two different but equivalent solutions to this problem will be presented below.

The p-adic integers form a ring, and by taking quotients of two p-adic integers, we obtain the field Qp of p-adic numbers. These numbers can be visualized as p-adic expansions which to the left never stop, and which have finitely many p-adic digits to the right of the "decimal" point. Qp which has the nice topological property of completeness. This allows the development of p-adic analysis akin to real analysis.

### Construction

#### Analytic approach

The real numbers can be defined as equivalence classes of Cauchy sequences of rational numbers. However, the definition of a Cauchy sequence relies on the metric chosen and, by choosing a different norm, numbers other than the real numbers can be constructed. The usual metric is called the Euclidean metric.

For a given prime p > 1, we define the p-adic metric in Q as follows: for a non-zero rational number x, write x = pny where neither the numerator and denominator of y have the factor p (notice that n is uniquely specified by this requirement); now define |x|p = p-n. We also define |0|p = 0. It can be proved that all norms on Q are equivalent to either the Euclidean norm or one of the p-adic norms for some prime p. The p-adic norm defines a metric on Q by setting dp(x,y) = |x - y|p.

The field Qp of p-adic numbers can then be defined as the completion of the metric space (Q,dp); its elements are equivalence classes of Cauchy sequences, where two sequences are called equivalent if their difference converges to zero. In this way, we obtain a complete metric space which is also a field and contains Q.

#### Algebraic approach

In the algebraic approach, we first define the ring of p-adic integers, and then construct the field of quotients of this ring to get the field of p-adic numbers.

We start with the inverse limit of the rings Zpn (see modular arithmetic): a p-adic integer is then a sequence (an) such that an is in Zpn, and if n<m, an = am (mod pn). Note that addition and multiplication of such sequences is well defined, since addition and multiplication commute with the mod operator, see modular arithmetic.

Every natural number, m defines such a sequence (m mod pn), and can therefore be regarded as a p-adic integer.

Note that every sequence (an) where the first element is not 0 has an inverse: since in that case, for every n, an and p are relatively prime (their greatest common divisor is a1), and so an and pn are relatively prime. Therefore, an has an inverse mod pn, and the sequence of inverses, (bn), is the sought inverse of (an).

The ring of p-adic integers has no zero divisors, so we can take the quotient field to get the field Qp of p-adic numbers. Note that in the quotient field, every number can be written as p-na with an element a in the ring and n a natural number.

### Properties

The p-adic numbers contain the rational numbers Q and form a field of characteristic 0. This field cannot be turned into an ordered field.

The topology of the set of p-adic integers is that of a Cantor set; the topology of the set of p-adic numbers is that of a Cantor set minus a point (which would naturally be called infinity).

As metric spaces, both the p-adic integers and the p-adic numbers are complete.

The real numbers have only a single algebraic extension, the complex numbers; in other words, a quadratic extension is already algebraically closed. The necessary algebraic extension to the field of p-adic numbers that makes it algebraically closed has infinite degree; and for any given p, there exist infinitely many inequivalent algebraic extensions.
{"ft_lang_label":"__label__en","ft_lang_prob":0.920896,"math_prob":0.9935533,"size":4625,"snap":"2020-45-2020-50","text_gpt3_token_len":1087,"char_repetition_ratio":0.154512,"word_repetition_ratio":0.014723927,"special_character_ratio":0.22486487,"punctuation_ratio":0.09371672,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.998782,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-27T09:37:32Z\",\"WARC-Record-ID\":\"<urn:uuid:ef9cac99-b174-42ea-bdcb-c5e0f05d30fb>\",\"Content-Length\":\"26622\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f276226c-fd5c-45cd-bec6-2699d371dc8c>\",\"WARC-Concurrent-To\":\"<urn:uuid:431ae531-c555-459d-90a1-2cd70f8be2bd>\",\"WARC-IP-Address\":\"208.80.154.224\",\"WARC-Target-URI\":\"https://nostalgia.wikipedia.org/wiki/P-adic_numbers\",\"WARC-Payload-Digest\":\"sha1:7WINASGA4I2MDGKMJFMP2WXM3O24FEES\",\"WARC-Block-Digest\":\"sha1:IYKTNA5NAU2KPTLJWXVJG5MFJVPF3SPG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141191511.46_warc_CC-MAIN-20201127073750-20201127103750-00582.warc.gz\"}"}