Completing Algebraic Integers into Squares Let $L/K$ be an extension of number fields with Galois closure $E$, and let $\theta \in \mathcal{O}_L \setminus \{0\}$. Let $\Sigma_E$ be the set of primes of $E$, let $S' \subset \Sigma_E$ be a finite set containing all of the ramified primes, and let $$S = \{ \mathfrak{p} \in \Sigma_E \setminus S' :  v_{\mathfrak{p}}(\theta) \not\equiv 0 \pmod{2}\}.$$ Notice that $S$ is finite, and let $T$ be the finite set of primes of $K$ lying below the primes in $S$. Suppose for each $p \in T$ that there exists $r_p \in K_p^\times$ such that $v_{\mathfrak{p}}(r_{p} \cdot \theta) \equiv 0 \pmod{2}$ for each $\mathfrak{p} \mid p$.
Question: Does there exist $r \in K^\times$ such that $v_{\mathfrak{p}}(r\cdot \theta) \equiv 0 \pmod{2}$ for all primes $\mathfrak{p} \in \Sigma_E \setminus S'$?
 A: I think the following remarks more or less answer the question to the extent I was looking for.


*

*The result is obvious when $L = K$, because one can simply take $r = \theta$.

*Suppose that $L \neq K$. Each $r_p$ can always be taken to be equal to a $p$-adic uniformizer. When $K$ has class number $1$, these uniformizers can be taken to be prime elements of $K$, so $r = \prod_{p \in T} r_p$ does the job.

*Suppose that $L \neq K$ and $[L : K]$ is odd, and let's factorize $\theta$ into primes of $E$ as follows:
$$\theta = \left[\prod_{\mathfrak{p} \in S} \mathfrak{p}\right] \cdot \left[\prod_{\mathfrak{p} \in \Sigma_E \setminus S'} \mathfrak{p}^{e_{\mathfrak{p}}}\right]^2 \cdot \theta',$$
where $\theta' \in L^\times$ is a product of primes in $S'$.
(In the first displayed product above, I'm isolating exactly one copy of each prime in $S$, and the second displayed product above contains all remaining prime factors not from $S'$). Observe that the existence of the $r_{p}$'s implies that $\prod_{\mathfrak{p} \in S} \mathfrak{p} = \prod_{p \in T} p$. Letting $r = \operatorname{N}_{L/K}(\theta)$, we have that
$$r = \left[\prod_{p \in T} \operatorname{N}_{L/K}(p)\right] \cdot \left[\operatorname{N}_{L/K}\left(\prod_{\mathfrak{p} \in \Sigma_E \setminus S'} \mathfrak{p}^{e_{\mathfrak{p}}}\right)\right]^2 \cdot \operatorname{N}_{L/K}(\theta'),$$ 
so since $\operatorname{N}_{L/K}(p) = p^{[L: K]}$, we deduce that
$$r \cdot \theta = \left[\prod_{p \in T} p^{[L : K] + 1}\right] \cdot \left[\left(\prod_{\mathfrak{p} \in \Sigma_E \setminus S'} \mathfrak{p}^{e_{\mathfrak{p}}}\right) \cdot \operatorname{N}_{L/K}\left(\prod_{\mathfrak{p} \in \Sigma_E \setminus S'} \mathfrak{p}^{e_{\mathfrak{p}}}\right)\right]^2 \cdot \operatorname{N}_{L/K}(\theta')$$
It is evident from the above expansion that $r \cdot \theta$ has the desired property.

*Suppose that $L \neq K$ and $[L : K]$ is even. Then the answer to the question is not necessarily. For a counterexample, let $K = \mathbb{Q}(\sqrt{-5})$, and recall that the class group $\operatorname{Cl}(K)$ of $K$ is isomorphic to $\mathbb{Z}/2\mathbb{Z}$ and is generated by the prime ideal $(1 + \sqrt{-5}, 1 - \sqrt{-5})$. Let $L$ be the Hilbert class field (maximal unramified abelian extension) of $K$, which is a quadratic extension of $K$ because the class number of $K$ is $2$. Recall that every ideal of $\mathcal{O}_K$ becomes principal in $\mathcal{O}_L$, so there is some $\theta \in \mathcal{O}_L$ such that $(\theta) = (1 + \sqrt{-5}, 1 - \sqrt{-5})$. Note that for any $r \in K^\times$, the class of the product ideal $I = (r) \cdot (1 + \sqrt{-5}, 1 - \sqrt{-5})$ in $\operatorname{Cl}(K)/2\operatorname{Cl}(K)$ is nontrivial, so the multiplicity of $(1 + \sqrt{-5}, 1 - \sqrt{-5})$ in $I$ cannot be even. [Thanks to James Tao for this observation.]

