Tightly coupled to the theory of valuations is the concept of completion, one of the few parts of algebraic number theory that’s properly analytic.
I don’t want to get too much into analysis here, but the idea here is one of convergent sequences. In, say, R, we say a sequence a(i) converges to x if for each e > 0, we can find some N such that |x – a(n)| < e whenever n >= N (equivalently, we say |x – a(n)| < e for all sufficiently large n). For example, fairly obviously, the sequence a(n) = 1/n converges to 0, and so does every sequence with 0 <= a(n) <= 1/n.
There are several equivalent definitions of what it means to be dense. To take one, Q is dense in R because every real number is the limit of a rational sequence. For proof, write x as an infinite decimal expansion, say 1.41421356… = SQRT(2), and let a1 = 1, a2 = 1.4, a3 = 1.41, etc.; |x – a(n)| <= 10^(1-n) which converges to 0, so a(n) converges to x.
Also, R is called complete because there is no field with valuation K (or any metric space even without a field structure) that R is dense in except for R itself; the proof of that relies on taking a broader class of sequences – namely, those for which for m, n > N, |a(n) – a(m)| < e. Straightforwardly, every sequence in a field with valuation K that converges, even if it’s only in some bigger field L, satisfies that condition, in which case it’s called Cauchy. Whenever the converse holds, K is complete, because if x in L has a sequence in K converging to it, then the sequence is Cauchy, so it converges in K and x is in K.
The reason R is complete is that, basically, we can take e = 0.1, e = 0.01, e = 0.001, etc., and construct a limit from the infinite decimal expansion. For example, if we can bound a sequence between 0.47 and 0.48 for all sufficiently large n then the limit’s first two decimal digits will be .47; if we can only bound it between 0.46 and 0.48 but never 0.46 and 0.47 or 0.47 and 0.48, it can be shown it must converge to 0.47.
Since R is a complete valued field that Q is dense in, we say it’s the completion of Q with respect to the normal absolute value. Given that formulation, it’s a good idea to look for the completions of Q with respect to the p-adic valuations. There’s a definition based on Cauchy sequences, but it’s not especially enlightening. A better one is to define elements of the completion Q(p) as infinite expansions in base p, only going to the left instead of to the right.
In R, numbers can go infinitely to the right but not to the left: 3.14159265… In Q(p), they can go infinitely to the left but not to the right: …21216213.0 (that’s the square root of 2 in Q(7)). This tweak changes a lot of intuitive properties. For a start, the valuation in question is p-adic: |a – b| is equal to 1/p to the power of the index of the first digit where a and b disagree, where the first before the dot has index 0 and the first after it has index 1. In Q(7), the sequence 1, 7, 49, 343… then converges to 0 because |a(n) – 0| = |7^n| = 1/7^n –> 0. With minor tweaks, the same proof of completeness as in R works for Q(p).
You might ask yourself whether it makes any difference if there are numbers to the right of the dot or not. In fact, in some way there is. The set of numbers in Q(p) whose p-adic expansions have no nonzero numbers to the right of the dot forms a ring denoted Z(p)*, which is the completion of Z with the p-adic valuation; in contrast, with respect to the normal absolute value, Z is complete. Z(p) is a local PID whose unique maximal ideal is (p), the set of all numbers in Z(p) whose units digit is 0.
You can of course do a similar thing to number fields other than Q. Unfortunately, in that case the characterization as a p-adic expansion stops working, unless the ideal P has prime norm (which, it can be shown, fails to hold for infinitely many prime ideals of every number field except Q). In that case, the best way to construct K(P) is to first construct O(K)(P), i.e. the equivalent of Z(p), by giving for each x its residue class modulo P, its residue class modulo P^2, etc. The equivalent in Z(p) is as representing a number by giving its first digit, then its first two digits, then its first three, etc. Every such assignment of residue classes subject to the common sense constraint that the class mod P^n is compatible with the class mod P^(n-1) gives an element of O(K)(P).
Like Z(p), O(K)(P) is a local PID whose unique maximal ideal is P. This is true every if O(K) is not a PID. To see why, note that O(K)(P) inherits the P-adic valuation from O(K), so the valuation is multiplicative, and further, every element of valuation 1 is a unit, because then its class mod P is not 0, so its class mod P^n is not divisible by P, so that it’s a unit. The sequence (r1, r2, r3…) then has inverse (1/r1, 1/r2, 1/r3…), and the residue classes are compatible because otherwise, 1/r^n != 1/r^(n-1) mod P^(n-1), so by the compatibility of r^i, 1 = r^n/r^n != r^(n-1)/r^(n-1) = 1 mod P^(n-1), which is a contradiction. So defining K(P) to be the fraction field of O(K)(P), we get that if |a| = 1/N(P), then for every b in (P), b/a in K(P) has valuation at most 1, so that it’s in O(K)(P) and b = ac for some c in O(K)(P).
The main advantage of using P-adic completions is that they permit looking at extensions of number fields one prime at a time. Fields similar to the P-adic fields K(P) are called local fields, because of their local nature – the ring O(K)(P) intersects Q in the localization of O(K) at the prime ideal (P). The reason O(K)(P) is used rather than just the localization at P is that the ability to freely choose residue classes mod each P^n allows solving many more polynomials. Analogously to how every positive real number has a square root, every unit of Z(p) whose residue class mod p is a qth-power residue has a qth root in Z(p), unless p = q (proof later).
* People who don’t have to ASCIIfy math write Z(p) as Z with a subscript p. Z with a subscript (p) is a different ring, the localization of Z at the ideal (p), which is dense in Z(p).