Solution (source code)

= Solution

Expand $L$ to $L(M)$ by a constant $c_m$ for each $m\in M$. The <diagram of a structure> $\operatorname{Diag}(M)$ contains all atomic and negated atomic $L(M)$-sentences true in $M$. The elementary diagram $\operatorname{ElDiag}(M)$ contains every $L(M)$-sentence true in $M$.

The <method of diagrams> combines one of these sets with another theory and applies the <compactness theorem>. A model of $\operatorname{Diag}(M)$ yields an embedding of $M$ by $m\mapsto c_m$, while a model of $\operatorname{ElDiag}(M)$ yields an <elementary embedding>.