Solution (source code)

= Solution

Use $Q=T_3+Y$ and $T_a=\tau_a/2$. For each generation $r=e,\mu,\tau$, the <leptons> are
$$
L_r=\binom{\nu_{rL}}{\ell_{rL}}:\ (\mathbf2,-\tfrac12),\qquad R_r=\ell_{rR}:\ (\mathbf1,-1).
$$
Both are color singlets. The conjugate antilepton fields transform in the conjugate representations and have opposite <hypercharge>; they are already included by the conjugate fields in the Lagrangian. The two components of $L_r$ have <electric charges> $0,-1$, and $R_r$ has charge $-1$. There is no right-handed <neutrino> <representation> in this field content. These assignments use the <electroweak representation and hypercharge table> in the same <hypercharge> normalization as the <scalar> doublet.

For a doublet of <hypercharge> $Y$, define
$$
D_\mu=\partial_\mu-ig\frac{\tau_a}{2}A_{a\mu}-ig'YB_\mu.
$$
The $SU(2)$ term is absent for a singlet. Under the local transformation $\psi\mapsto e^{iY\omega}U\psi$, the <gauge fields> transform so that $D_\mu\psi\mapsto e^{iY\omega}U D_\mu\psi$. Consequently the required <gauge-covariant kinetic terms> are
$$
\mathcal L_{\rm kin}=\sum_r\bigl(i\bar L_r\gamma^\mu D_\mu L_r+i\bar R_r\gamma^\mu D_\mu R_r\bigr)+(D_\mu\phi)^\dagger D^\mu\phi.
$$
The fields of definite <chirality> are defined with $P_{L,R}=(1\mp\gamma_5)/2$. Since $\bar L$ has <hypercharge> $+1/2$, the <Yukawa interaction>
$$
\mathcal L_Y=-\sum_{r,s}\bar L_r\phi\,(Y_\ell)_{rs}R_s+\mathrm{h.c.}
$$
is invariant: its <hypercharges> add to zero, and $\bar L\phi$ contracts the two doublet indices. A bare charged-lepton <mass> violates these assignments. No renormalizable <neutrino> Yukawa term is available without a right-handed <neutrino>. A <gauge-invariant> <scalar potential> depending on $\phi^\dagger\phi$ can select the nonzero vacuum, without altering these kinetic and Yukawa constructions.

There is an explicit local <unitary gauge> transformation whenever $r_\phi=(|\phi_1|^2+|\phi_2|^2)^{1/2}\ne0$:
$$
U_\phi=\frac1{r_\phi}\begin{pmatrix}\phi_2&-\phi_1\\\phi_1^*&\phi_2^*\end{pmatrix},\qquad U_\phi^\dagger U_\phi=I,\qquad\det U_\phi=1,\qquad U_\phi\phi=\binom0{r_\phi}.
$$
Thus, with the real field $\rho=\sqrt2r_\phi-v$,
$$
\boxed{\phi=\frac{v+\rho}{\sqrt2}\binom01.}
$$
This proves the <polar coordinates for the electroweak Higgs doublet> constructively. The gauge choice is local about the nonzero vacuum; it need not be nonsingular at zeros of the doublet.

The three identical-generation <kinetic terms> permit unitary flavor changes. A <singular value decomposition> gives $U_L^\dagger Y_\ell U_R=\operatorname{diag}(y_e,y_\mu,y_\tau)$ with $y_r\ge0$. Rotate both components of each left doublet together, and the right singlets independently. In this basis,
$$
\boxed{\mathcal L_Y=-\sum_r m_r\left(1+\frac\rho v\right)\bar\ell_r\ell_r,\qquad m_r=\frac{y_rv}{\sqrt2}.}
$$
The left/right cross terms combine into this <Dirac mass>. Since the <neutrinos> have no <mass> <matrix>, their simultaneous left rotation preserves a diagonal <charged current>. This is <charged-lepton Yukawa matrix diagonalization>; the <neutrinos> remain massless in the stated renormalizable model.

The <scalar> <kinetic term> gives
$$
(D_\mu\phi)^\dagger D^\mu\phi=\frac12(\partial_\mu\rho)^2+\frac{(v+\rho)^2}{8}\bigl[g^2(A_{1\mu}A_1^\mu+A_{2\mu}A_2^\mu)+(gA_{3\mu}-g'B_\mu)^2\bigr].
$$
Introduce $s_W=g'/\sqrt{g^2+g'^2}$ and $c_W=g/\sqrt{g^2+g'^2}$. The combinations $W^+=(A_1-iA_2)/\sqrt2$, $W^-=(W^+)^*$, $Z=c_WA_3-s_WB$ and $A_\gamma=s_WA_3+c_WB$ therefore diagonalize the quadratic terms:
$$
\mathcal L_{\rm mass}=M_W^2W_\mu^+W^{-\mu}+\frac12M_Z^2Z_\mu Z^\mu,\qquad\boxed{M_W=\frac{gv}{2},\quad M_Z=\frac{v\sqrt{g^2+g'^2}}2=\frac{M_W}{c_W},\quad M_\gamma=0.}
$$
The factor $1/2$ applies to the real neutral field, not to the complex charged field. The massless <photon> corresponds to the unbroken generator $T_3+Y$, which annihilates the vacuum. This gives the <electroweak doublet gauge-boson mass matrix> and its diagonal spectrum.