Confused on a proof that $\langle X,1-Y\rangle$ is not principal in $\mathbb{Q}[X,Y]/\langle 1-X^2-Y^2\rangle$ I'm getting stuck on a passage in my notes. 

The claim is that the ideal $P=\langle X,1-Y\rangle$ is not principal in $\mathbb{Q}[X,Y]/\langle 1-X^2-Y^2\rangle$. 

This follows since $P^2=\langle X^2,X-XY,1-2Y+Y^2\rangle$. Then $X^2=1-Y^2\in P^2$, and $2-2Y\in P^2$. Since $2$ is invertible, $1-Y\in P^2$. But 
$$X^2=1-Y^2=(1-Y)(1+Y),\quad X-XY=X(1-Y),\quad 1-2Y+Y^2=(1-Y)^2$$ 
so $P^2=\langle 1-Y\rangle$.
I have two confusions. Why is $2-2Y\in P^2$? At best since $1-Y^2\in P^2$, $(1-2Y+Y^2)-(1-Y^2)=-2Y+2Y^2\in P^2$.
Also, why does $P^2=\langle 1-Y\rangle$ imply $P$ is not principal? If  $P=\langle f(X,Y)\rangle$, for some $f$, then you get $\langle f^2\rangle=\langle 1-Y\rangle$. In a polynomial ring, this would be obviously not true, but the relation $X^2+Y^2=1$ in the quotient ring makes it less immediate. 
If $\langle f^2\rangle=\langle 1-Y\rangle$, then this implies $f(X,Y)^2g(X,Y)=1-Y$ for some $g$. Plugging in the point $(3/5,4/5)$ on the circle, this implies $f(3/5,4/5)^2g(3/5,4/5)=1/5$ but with that $g(3/5,4/5)$, I don't see a contradiction. Is there a way to get rid of the $g$?
 A: *

*$2-2Y=X^2 + (1-2Y+ Y^2)+(1-X^2-Y^2)$

*Suppose $\langle f^2\rangle = \langle 1-Y\rangle$. Then $f(X,Y)^2=u(1-Y)$ for some $u\in\mathbb Q$. Note that elements of our ring are well-defined as functions on the unit circle, since $1-X^2-Y^2$ vanishes on it. Evaluating at $(3/5,4/5)$ gives $f(3/5,4/5)^2=u/5$, and evaluating at $(5/13,12/13)$ gives $f(5/13,12/13)^2=u/13$. Thus
$$\left(\frac{f(5/13,12/13)}{f(3/5,4/5)}\right)^2=\frac{13}{5}$$
but the LHS is a square in $\mathbb Q$ while the RHS is not, a contradiction.
Edit: To see that the unit $u$ must be constant, we determine the units of the larger ring $\mathbb C[X,Y]/\langle 1-X^2-Y^2\rangle$ and show that the only ones with rational coefficients are in $\mathbb Q$. Note that
$$\frac{\mathbb C[X,Y]}{\langle 1-X^2-Y^2\rangle}\cong \mathbb C[\cos \theta,\sin \theta]\cong \mathbb C[e^{i\theta},e^{-i\theta}]\cong \mathbb C[t,t^{-1}]$$
via the maps
$$X\mapsto \cos\theta\mapsto \frac{e^{i\theta}+e^{-i\theta}}{2}\mapsto \frac{t+t^{-1}}{2}$$
$$Y\mapsto \sin\theta\mapsto \frac{-ie^{i\theta}+ie^{-i\theta}}{2}\mapsto \frac{-it+it^{-1}}{2}$$
 and if $f(t,t^{-1})g(t,t^{-1})=1$ then we have some $n,m\ge 0$ such that
$t^nf(t,t^{-1}),t^mg(t,t^{-1})$ are polynomials in $t$ and equal $t^{n+m}$, so by unique factorization we have that $f(t,t^{-1})=at^k$ for some nonzero $a\in\mathbb Q$ and WLOG $k\ge 0$ (as if $k<0$ for $f$ then $k>0$ for $g$). Thus we have $f(X,Y)=a(2(X+iY))^k$, which has non-real hence irrational coefficients when $k\ne 0$.
