An excercise about omitting types theorem I am studying the omitting types theorem, which I know in the following form (where we implicitly work inside a monster model of a complete theory without finite models)

Theorem (Omitting types) Assume $L(A)$ is countable. Then for every consistent type
$p(x) ⊆ L(A)$ the following are equivalent:

*

*All models containing $A$ realize $p(x)$ $\quad\quad\quad$

*$A$ isolates $p(x)$

Now, I am asked to proove the following:

Let $p(x) ⊆ L(B)$ and $p_n (x) ⊆ L(A)$, for $n < ω$, be consistent types such
that:
$$p(x) →\lor_{n<\omega}\ p_n(x)$$
Prove that there is an $n<ω$ and a formula $φ(x) ∈ L (A)$ consistent with $p(x)$ such
that
$$p(x) ∧ φ(x) → p_n (x) $$

Now, I know that it must hold that $p(x)\rightarrow p_m(x)$ for some $m$. And intuitively I would like to find some $\phi(x)\in L(A)$ which isolates something like $p(x)\rightarrow p_m(x)$, but I don't know how to go further, since I cannot translate this "implication" between types into a type itself, which moreover should be something over $A\cup B$
I am also asked to prove the following:

Let $A\subset B$ and $p(x)\subset L(A)$ suppose that for any solution $a$ of $p(x)$ the complete type over $B$, $tp(a/B)$ is isolated. Show that $p(x)$ is isolated.

Now, applying the theorem (with $B$) instead of $A$, I am able to conclude that any model containing $B$, contains also, for each solution $a$ of $p(x)$ an element which is in the same orbit (under automorphisms fixing $B$) of $a$. Then this will also be a solution of $p(x)$, since it is the image of $a$ through an automorphism which fixes $B$ and hence also $A$. But how to extend to models which contain $A$ but maybe not $B$ in order to apply the theorem again proving the claim?
Thanks in advance for any help
 A: First question:
Let's prove the contrapositive. Assume that for all $n$ and all $L(A)$-formulas $\varphi(x)$, $p(x)\cup \{\varphi(x)\}\not\models p_n(x)$. We want to prove that $p(x)\not\models \bigvee_{n\in\omega} p_n(x)$, i.e. we want to realize $p(x)$ by an element which does not satisfy any of the $p_n(x)$.
One way to go is to introduce a new constant symbol $c$, consider the theory $T\cup p(c)$, and use the omitting types theorem to omit all the $p_n(x)$. But this is a little messy, what with the changing of languages, and it's also overkill: you don't really have to omit all the types $p_n(x)$, just make sure that $c$ doesn't realize them.
So I would prefer to prove this result by redoing a small part of the proof of the omitting types theorem. Note that we don't have to assume the language is countable in this proof, which is a big advantage over using omitting types!
We build a sequence of $L(A)$-formulas $(\varphi_n(x))_{n\in \omega}$ by induction, ensuring as we go that for all $n$, $p(x)\cup \{\varphi_k(x)\mid k\leq n\}$ is consistent. To pick $\varphi_n(x)$, we let $\psi_n(x) = \bigwedge_{k<n}\varphi_k(x)$. By induction, $\psi_n(x)$ is consistent with $p(x)$. So by our assumption, $p(x)\cup \{\psi_n(x)\}\not\models p_n(x)$. Thus we can find some element $b$ satisfying $p(x)\cup \{\psi_n(x)\}$ but not satisfying $p_n(x)$. Let $\varphi_n(x)$ be some formula which is true of $b$, but whose negation is in $p_n(x)$. Then $p(x)\cup \{\varphi_k(x)\mid k\leq n\}$ is consistent, since it is realized by $b$.
Now let $q(x) = p(x)\cup \{\varphi_n(x)\mid n\in \omega\}$. By compactness, $q(x)$ is consistent. Let $c$ be some realization. Then $c$ realizes $p$, but $c$ does not realize any $p_n(x)$, since for any $n$, $c$ satisfies $\varphi_n(x)$, and $\lnot\varphi_n(x)\in p_n(x)$.
Second question:
To me, this question seems totally unrelated to the first question and the omitting types theorem... I would prove it like this:
Let $Q$ be the set of complete types $q(x)$ over $B$ with $p(x)\subseteq q(x)$. For each $q(x)\in Q$, $q(x)$ is isolated by an $L(B)$-formula $\varphi_q(x)$. So $p(x)\cup \{\lnot \varphi_q(x)\mid q\in Q\}$ is inconsistent. By compactness, there are finitely many types $q_1,\dots,q_n$ such that $p(x)\models \bigvee_{i=1}^n \varphi_{q_i}(x)$. Let's call this disjunction $\psi(x)$. Note that also $\psi(x)\models p(x)$, since if $\psi(a)$, then $a$ realizes $q_i(x)$ for some $i$, and  $p(x)\subseteq q_i(x)$. Thus we have shown that $p(x)$ is isolated by a formula over $B$.
The question as stated is a bit ambiguous, but I suppose the goal is to show that $p(x)$ is isolated by a formula over $A$.  But this follows from the above, since if a set definable over $B$ is invariant over $A\subseteq B$ (i.e. fixed by all automorphisms of the monster model which fix $A$ pointwise), then the set is actually definable over $A$. I'll leave that as an exercise for you.
