I'm trying to solve Exercise 2.5.10 in Marker's Model Theory: An Introduction.
It goes:
Let T be an $\mathcal L$-theory and $T_\forall$ be all of the universal sentences $\phi$ such that $T \models \phi$. Show that $\mathcal A \models T_\forall$ if and only if there is $\mathcal M \models T$ with $\mathcal A \subseteq \mathcal M$.
WLOG we may assume that $T$ is consistent and that $T$ is closed under $\models$. $T_\forall$ is then just the set of universal (aka $\forall_1$ or $\Pi_1$) sentences in $T$. Now "only if" part is easy. I try to show the "if" part by resorting to Diagram Lemma: i.e., by showing that the union of the diagram of $\mathcal A$ and $T$ is consistent. Assume not and let a quantifier-free formula $\phi(\vec x)$ be such that $T \models \neg \phi(\vec a)$ and $\mathcal A \models \phi(\vec a)$, where $\vec a \in \mathcal A$. ...
This is where I'm stuck. I'm trying to replace the use of parameter with a quantifier but with no luck. What can I do? Is it possible to provide me with a clue?
Let $a$ be an (infinite) tuple enumerating ${\mathcal A}$. Let $p(x)=\textrm{qf-tp}_{\mathcal A}(a)$, that is, the set of quantifier-free formulas $\varphi(x)$ such that ${\mathcal A}\vDash\varphi(a)$.
I claim that $T\cup p(x)$ is consistent. If not, $T\vdash\neg\exists x\,\varphi(x)$ for some $\varphi(x)\in p$. Hence $\neg\exists x\,\varphi(x)\in T_{\forall}$. This contradicts ${\mathcal A}\vDash\exists x\,\varphi(x)$.
By compactness there is a model ${\mathcal M}\vDash T$ and a tuple $b$ such that ${\mathcal M}\vDash p(b)$. The map $a\mapsto b$ is an immersion of ${\mathcal A}$ in ${\mathcal M}$. So, up to isomorphism we can assume that $\mathcal A \subseteq \mathcal M$