When can we embed field extensions into one another? I was recently informed of the following theorem:
Let $K$ be a field of characterisic $0$, and let $L$, $M$ be field extensions of $K$ such that
i) $L$ is algebraic over $K$,
ii) every irreducible polynomial $p(x) \in K[x]$ with a root in $L$ has a root in $M$,
then $L$ embeds over $K$ into $M$.
I was also told that this can also be shown by model theoretic compactness.
If $L/K$ is a finite extension, this immediately follows from the fact that finite extensions over fields of characteristic $0$ are simple. Could anyone outline an algebraic/ model-theoretic proof of this fact for the case L is not a finite extension of K?
 A: Consider the following two-sorted first order theory.  We have one sort for $L$ and one sort for $M$, and we have constant symbols for each element of $L$ and each element of $M$ and function symbols for the ring operations of $L$ and $M$.  We also have a symbol $f$ for a function from $L$ to $M$ (which will be our embedding).  We have axioms that say the constant symbols are all distinct elements, the ring structure behaves the way it should on all our constant symbols, and that $f$ is a ring homomorphism.  Finally, we have the following axioms.  Given $\alpha\in L$, let $p$ be the minimal polynomial of $\alpha$ over $K$.  Let $\beta_1,\dots,\beta_n$ be all the roots of $p$ in $M$.  We then have an axiom saying $f(\alpha)=\beta_1\vee\dots\vee f(\alpha)=\beta_n$, and we have an axiom like this for each $\alpha\in L$.
Suppose we have a model of this theory.  The final collection of axioms guarantees that $f$ maps all the constant elements from $L$ to constant elements from $M$ and fixes each element of $K$, so we get an embedding of $L$ into $M$ over $K$.
It thus remains to show that this theory has a model.  Suppose we take any finite subset of our axioms.  These axioms will involve only finitely many of our constant symbols from $L$; let $L_0$ be the subfield of $L$ that they generate.  Then using the primitive element theorem, we can embed $L_0$ into $M$.  This then gives a model of our finite subset of our axioms, where we just interpret all the constant symbols for elements of $L\setminus L_0$ as $0$ (which is fine since we don't have any axioms about those constant symbols).  Thus this theory is finitely satisfiable, and thus satisfiable by compactness.

Here's another way to think about it.  Let $S$ be the set of subfields of $L$ that are finite extensions of $K$, which we can consider as a directed set ordered by inclusion.  For each $s\in S$ let $E_s$ be the set of embeddings $s\to M$ over $K$.  Note that each $E_s$ is a finite nonempty set.  Also, if $s\subset t$, we have a restriction map $E_t\to E_s$, and so these finite sets $E_s$ form an inverse system.  Any inverse limit of finite nonempty sets is nonempty, so the inverse limit of this system is nonempty.  But an element of the inverse limit is exactly a compatible family of embeddings $s\to M$ for each $s\in S$, which we can then glue together to get an embedding of all of $L$.
A: Let me give you a few more proofs, to complement those given in Eric Wofsey's answer, and to show you a variety of ways that compactness arguments can be phrased.
Let's start with a proof that only works under the assumption that $[L:K]$ is countable.
Proof 1 (Kőnig's Lemma): Assume $[L:K]$ is countable. Write $L = \bigcup_{i\in  \mathbb{N}}L_i$, where $L_0 = K$ and each $L_{i+1}$ is a finite extension of $L_i$. Let $T$ be the set of all embeddings $L_i\to M$ over $K$ with $i\in \mathbb{N}$, ordered by function extension. Then $T$ is an infinite finitely branching tree. It is infinite because each $L_i$ is a finite extension of $K$, and hence embeds in $M$ over $K$, so $T$ contains at least one embedding $L_i\to M$ for each $i$. It is finitely branching because each $L_{i+1} = L_i(\alpha)$ is a finite extension of $L_i$ and hence has only finitely many embeddings into $M$ extending a given embedding $L_i\to M$. By Kőnig's Lemma, $T$ has an infinite branch. This is a cohering system of embeddings $L_i\to M$ for all $i$, so their union is an embedding $L\to M$ over $K$. $\square$
Here Kőnig's Lemma captures the following idea: if we have a sequence of choices to make, any particular choice has only finitely many options, and for any $n$, there is a way to make the first $n$ choices consistently, then there is a way to make all the choices consistently.
If we want to handle the general case, we need the following adjustment of that idea: if we have an arbitrary family of choices to make, any particular choice has only finitely many options, and for any finitely many choices, there is a way to make these choices consistently, then there is a way to make all the choices consistently.
This is what's going on in the proof in the last paragraph of Eric's answer, using the compactness principle "Any inverse limit of finite nonempty sets is nonempty." Here's another version of essentially the same argument, but using Tychonoff's Theorem.
Proof 2 (Tychonoff's Theorem): For each $\alpha\in L$, let $f_\alpha$ be the minimal polynomial of $\alpha$ over $K$, and let $X_\alpha$ be the finite (but non-empty) set of roots of $f_\alpha$ in $M$. Note that for $\alpha\in K$, $X_\alpha = \{\alpha\}$. Think of each $X_\alpha$ as a topological space with the discrete topology. Let $X = \prod_{\alpha\in L}X_\alpha$. By Tychonoff's Theorem, $X$ is compact. For all $\alpha,\beta\in L$, let $P_{\alpha,\beta} = \{(x_\gamma)\in X\mid x_\alpha + x_\beta = x_{\alpha+\beta}\}$, and let $T_{\alpha,\beta} = \{(x_\gamma)\in X\mid x_\alpha x_\beta = x_{\alpha\beta}\}$. Then $P_{\alpha,\beta}$ and $T_{\alpha,\beta}$ are closed sets in $X$, and an element of $\bigcap_{\alpha,\beta\in L} (P_{\alpha,\beta}\cap T_{\alpha,\beta})$ encodes a homomorphism $L\to M$ over $K$ by $\alpha\mapsto x_\alpha$. An intersection of finitely many of these sets is non-empty, since it enforces the homomorphism conditions only on a finitely generated subfield $L'\subseteq L$ which is a finite extension of $K$, and $L'$ can always be embedded in $M$ over $K$ (such an embedding always maps $\alpha\in L'$ to an element of $X_\alpha$, and values of $x_\gamma$ for $\gamma\notin L'$ can be chosen arbitrarily). By compactness, $\bigcap_{\alpha,\beta\in L} (P_{\alpha,\beta}\cap T_{\alpha,\beta})$ is non-empty, so we are done. $\square$
The previous proof can be rephrased to use the compactness theorem for propositional logic instead of topological compactness.
Proof 3 (Compactness of propositional logic): For each $\alpha\in L$, let $f_\alpha$ be the minimal polynomial of $\alpha$ over $K$, and let $X_\alpha$ be the finite (but non-empty) set of roots of $f_\alpha$ in $M$. Note that for $\alpha\in K$, $X_\alpha = \{\alpha\}$. For each $\alpha\in L$ and $m\in X_\alpha$, let $Q_{\alpha,m}$ be a propositional variable. For all $\alpha\in L$, let $\varphi_{\alpha}$ be the sentence asserting that exactly one of the finitely many variables $\{Q_{\alpha,m}\mid m\in X_\alpha\}$ is true. For all $\alpha,\beta\in L$, let $\pi_{\alpha,\beta}$ be the sentence $Q_{\alpha,m}\land Q_{\beta,n}\rightarrow Q_{\alpha+\beta,m+n}$ and let $\tau_{\alpha,\beta}$ be the sentence $Q_{\alpha,m}\land Q_{\beta,n}\rightarrow Q_{\alpha\beta,mn}$. Let $T = \{\varphi_\alpha\mid \alpha\in L\}\cup \{\pi_{\alpha,\beta},\tau_{\alpha,\beta}\mid \alpha,\beta\in L\}$. A truth assignment satisfying $T$ encodes a homomorphism $L\to M$ over $K$ mapping each $\alpha$ to the unique $m$ such that $Q_{\alpha,m}$ is true. Any finitely many sentences in $T$ is consistent, since it enforces the homomorphism conditions only on a finitely generated subfield $L'\subseteq L$ which is a finite extension of $K$, and $L'$ can always be embedded in $M$ over $K$ (such an embedding always maps $\alpha\in L'$ to an element of $X_\alpha$, and the $Q_{\gamma,m}$ for $\gamma\notin L'$ can be chosen arbitrarily). By compactness, $T$ is consistent, and we are done. $\square$
Finally, here's an alternative proof using the compactness theorem for first-order logic. First-order compactness in the language of fields is actually bit less efficient as a tool for the job, because in general it forces us to pass to an elementary extension of the field we're interested in. But as we'll see, this is not a problem in this case.
Proof 4 (Compactness of first-order logic): Consider the language of fields augmented with constant symbols $(c_l)_{l\in L}$ and $(d_m)_{m\in M}$. Let $T = \mathrm{EDiag}(M)\cup \mathrm{Diag}(L)\cup \{c_k = d_k\mid k\in K\}$. Here $\mathrm{EDiag}(M)$ is the set of all sentences $\varphi(d_{m_1},\dots,d_{m_n})$ such that $M\models \varphi(m_1,\dots,m_n)$, and $\mathrm{Diag}(L)$ is the set of all atomic and negated atomic sentences $\psi(c_{l_1},\dots,c_{l_n})$ such that $L\models \psi(l_1,\dots,l_n)$. A finite subset $T'\subseteq T$ only mentions constant symbols from $M$ and a subfield $L'\subseteq L$ such that $K\subseteq L'$ is a finite extension. We can embed $L'$ in $M$ over $K$, by $f\colon L'\to M$, so interpreting each constant symbol $c_{l}$ as $f(l)$ for $l\in L'$ (and the rest of the $c_{l}$ for $l\notin L'$ arbitrarily), $M\models T'$. By compactness, $T$ is consistent. Let $M'\models T$. Then $M'$ is an elementary extension of $M$ (identifying each $m\in M$ with the interpretation of $d_m$ in $M'$), and $L$ embeds in $M'$ over $K$ (by mapping each $l\in L$ to the interpretation of $c_l$ in $M'$). For each $l\in L$, let $f_l(x)$ be the minimal polynomial of $l$ over $K$. Since $M'$ is an elementary extension of $M$, it does not add any new roots of $f_l$ (if $m_1,\dots,m_{k_l}$ are the roots of $f_l$ in $M$, then $M\models \forall x\, (f_l(x) = 0\rightarrow \bigvee_{i=1}^{k_l} x = m_i)$, so this formula is also true in $M'$). Since the image of $l$ in $M'$ is a root of $f_l$, this image is in $M$. Thus the embedding $L\to M'$ actually lands in $M$. $\square$
