Solution (source code)

= Solution

A bare Dirac bilinear couples left- and right-handed fields, but these fields transform in different electroweak representations, so $\bar f_Lf_R$ is not a gauge singlet. Let $\widetilde H=i\sigma^2H^*$. The four gauge-invariant <Yukawa interaction> terms are
$$
\mathcal L_Y=
-y_d\bar Q_LHd_R-y_u\bar Q_L\widetilde Hu_R
-y_e\bar L_LHe_R-y_\nu\bar L_L\widetilde H\nu_R+\text{h.c.}
$$
Replacing $H$ by its vacuum expectation value gives Dirac masses $m_f=y_fv/\sqrt2$. Applying $Q=T^3+Y$ gives
$$
Q(u)=\frac23,\qquad
Q(d)=-\frac13,\qquad
Q(\nu)=0,\qquad
Q(e)=-1
$$
for both chiralities, so the generated mass terms preserve the unbroken electromagnetic gauge symmetry.

Solved by gpt-5.6-sol high.