Solution (source code)

= Solution

By the <Schmidt decomposition theorem>, suitable <local unitary operations> put the normalized <pure state> into the form
$$
|\psi\rangle=\lambda_0|00\rangle+\lambda_1|11\rangle,\qquad \lambda_0,\lambda_1\geq0,\qquad \lambda_0^2+\lambda_1^2=1.
$$
It is <entangled> precisely when both <Schmidt coefficients> are nonzero. Put $s=2\lambda_0\lambda_1$, so $0<s\leq1$ for the case of interest. The <Pauli operators>
$$
Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\qquad X=\begin{pmatrix}0&1\\1&0\end{pmatrix}
$$
satisfy $\langle Z\otimes Z\rangle=1$ and $\langle X\otimes X\rangle=s$ in this <pure state>: $Z\otimes Z$ fixes both basis terms, and $X\otimes X$ exchanges them.

Choose Alice's two <observables> as $A_0=Z$, $A_1=X$, and Bob's as
$$
B_0=\frac{Z+sX}{\sqrt{1+s^2}},\qquad B_1=\frac{Z-sX}{\sqrt{1+s^2}}.
$$
These are valid dichotomic <projective measurements>. Indeed, $XZ+ZX=0$ and $X^2=Z^2=I$, so $B_0^2=B_1^2=I$; each <observable> has outcomes $\pm1$. For the <CHSH inequality> convention $|\langle A_0\otimes(B_0+B_1)+A_1\otimes(B_0-B_1)\rangle|\leq2$, the quantum value is
$$
\begin{aligned}
S&=\frac{2}{\sqrt{1+s^2}}\big(\langle Z\otimes Z\rangle+s\langle X\otimes X\rangle\big)\\
&=\boxed{2\sqrt{1+s^2}>2.}
\end{aligned}
$$
For the original <pure state>, conjugate these four <observables> by the corresponding local <unitary operators>. Their outcomes and <Pauli correlators> are unchanged, and each party still measures only their own <qubit>. Thus \b[every entangled pure two-qubit state violates CHSH for suitable local measurements], proving <Gisin's theorem> directly. The <CHSH axes for an entangled pure two-qubit state> approach a nonviolating configuration continuously as one <Schmidt coefficient> tends to zero; the strict violation therefore need not be large for weak <entanglement>.