Character-sum cancellation lemma (source code)

= Character-sum cancellation lemma

For a <linear character> $\chi$ of a <finite group> $K$,
$$
\sum_{k\in K}\chi(k)=\begin{cases}|K|,&\chi=1,\\0,&\chi\ne1.\end{cases}
$$
Indeed, if $\chi(h)\ne1$, the <bijection> $k\mapsto hk$ gives $\sum_k\chi(k)=\chi(h)\sum_k\chi(k)$, forcing the sum to vanish. The trivial character gives $|K|$ directly. The same argument applies to the restriction of a <linear character> of a larger group to a <subgroup>.