Lemma 14.2.5   Let be a positive integer. Then for any nonzero rational number  there exists a unique and integers , with positive, such that with , , and .

Proof. Write with and . First suppose  is exactly divisible by a power of , so for some  we have but . Then

If is the largest power of that divides , then , , satisfy the conclusion of the lemma.

By unique factorization of integers, there is a smallest multiple  of  such that is exactly divisible by . Now apply the above argument with  and  replaced by and .

Definition 14.2.6 (-adic valuation)   Let  be a positive integer. For any positive , the -adic valuation of  is , where  is as in Lemma 14.2.5. The -adic valuation of 0 is .

We denote the -adic valuation of by . (Note: Here we are using valuation'' in a different way than in the rest of the text. This valuation is not an absolute value, but the logarithm of one.)

We let , since .

For example, are close in the -adic metric if their difference is divisible by a large power of . E.g., if then and are close because their difference is , which is divisible by a large power of .

Proposition 14.2.8   The distance on  defined above is a metric. Moreover, for all we have

(This is the nonarchimedean'' triangle inequality.)

Proof. The first two properties of Definition 14.2.1 are immediate. For the third, we first prove that if then

Assume, without loss, that and that both and are nonzero. Using Lemma 14.2.5 write and with  or  possibly negative. Then

Since it follows that . Now suppose . Then

so

hence .

We can finally define the -adic numbers.

Definition 14.2.9 (The -adic Numbers)   The set of -adic numbers, denoted , is the completion of  with respect to the metric .

The set is a ring, but it need not be a field as you will show in Exercises 11 and 12. It is a field if and only if is prime. Also, has a bizarre'' topology, as we will see in Section 14.2.3.

William Stein 2012-09-24