Maximal abelian extension unramified outside a set of primes Let $S$ be a set of prime numbers and $K$ be a number field. What is the definition of maximal abelian extension over $K$ unramified outside $S$? Why does it exist and why if $S=\{p\}$, where $p$ is a prime number, it is equal to $$\bigcup_{n\ge 1}K_{p^n}$$
where $K_{q^n}$ is the ray class field modulo $q^n\mathcal{O}_K$?
Thanks.
 A: Here are some answers to your questions. Throughout, fix a number field K and a finite S of primes of K (one could also take infinite sets of primes by inductively enlarging finite S ’s, but this is a detail).
1) For short, a finite extension L/K is called S-ramified if it is unramified outside S. The composite of two such extensions is again S-ramified, so it makes sense to consider the composite $K_S$ of all the finite S-ramified extensions of K. Because of maximality, $K_S/K$ is obviously Galois ;  its Galois group $G_S (K)$ is profinite. The quotient $G_S (K)^{ab}$ of $G_S (K)$ modulo the closure of its commutator subgroup fixes the maximal S-ramified abelian extension $K_S^{ab}$ of K. This $K_S^{ab}$ can also obviously be defined as the composite of all the finite abelian S-ramified extensions of K. For more details on ramification in infinite Galois theory (although there is no mystery), see e.g. §2 of the appendix of Washington’s « Introduction to cyclotomic fields ».
2) Actually, class field theory (CFT) also takes into account the ramification at infinite primes (i.e. embeddings into an algebraic closure) in a finite extension L/K : by definition, a complex prime is always unramified ; a real prime of K is ramified iff it becomes complex in L. A « K-modulus » M is a formal product of an integral ideal of K and a finite number of distinct real embeddings. The classical formulation of CFT in terms of ideals and modulii is not very suggestive at first sight. Let us refer for this to the excellent survey by D. Garbannati, « CFT summarized », Rocky Mountain J. of Math., 11, 2 (1981), 195-225. Then the ray class field modulo M over $K$ is the largest finite abelian M-ramified extension of K. If $S = S_p$ := the set of primes of $K$ above an odd prime $p$ (to avoid petty details on ramification at  infinite primes), indeed $K_S^{ab}$ is the direct limit of the ray class fields mod $p^n$ as you suspected.
3) The nowadays prevailing formulation of CFT in terms of idèles is well-adapted to the machinery of Galois cohomology and Poitou-Tate duality. But even so, the description of  $G_S (K)^{ab}$ is explicit in particular cases (if $K = \mathbf Q$ , see the Kronecker-Weber theorem), but not in general. Actually many deep conjectures on the determination of $G_S (K)^{ab}$ and far reaching applications remain unsolved to this day. Let us for instance take the p-adic point of view and study the maximal pro-p-quotient $X_S (K)$ of $G_S (K)^{ab}$ . If S contains $S_p$, CFT tells us that $X_S (K)$  is a $\mathbf  Z_p$-module of finite type, hence it is a priori of the form $T_S (K)$ x $\mathbf Z_p^{1+c+d}$, where $T_S (K)$ is a finite abelian p-group, $2c$ is the number of complex primes of $K$ and $d$ is a natural integer. The celebrated Leopoldt conjecture (up to now proved only for abelian $K$) predicts the nullity of $d$. If $K$ is totally real, then $T_S (K)$ contains, in a precise sense, the theory of $p$-adic $L$-functions : this is the « Iwasawa main conjecture », proved by Mazur-Wiles and Wiles. If $S$ does not contain $S_p$, much less is known ./.
