Proof of Maschke’s theorem: Why is $\hat{p}$ again a projection? 
Question: In the proof of Maschke’s theorem we construct for every subrepresentation $U \subseteq V$ a $G$-equivariant projection onto $U$.
  How can we abstractly see that for any $k$-linear projection $p \colon V \to V$ onto $U$, the resulting $G$-equivariant map $\hat{p} = \frac{1}{|G|} \sum_{g \in G} (g.\!p) \colon V \to V$ must again be a projection onto $U$?


Setup:
Let $G$ be a finite group and $k$ a field with $\operatorname{char} k \nmid |G|$.
Then for every representation $V$ of $G$ the map
$$
          V
  \to     V
  \quad   v
  \mapsto \hat{v}
  :=      \frac{1}{|G|} \sum_{g \in G} g.\!v
$$
is a projection onto the subspace $V^G \subseteq V$ of $G$-invariants.
We will refer to this as the projection onto invariants.
This is famously used in (one of) the proofs of Maschke’s theorem:
Let $V$ be a representation of $G$ over $k$ and let $U \subseteq V$ be a subrepresentation.
Starting off with any $k$-linear projection $p \colon V \to V$ onto $U$, one can apply the projection onto invariants to the representation $\operatorname{Hom}_k(V,V)$ to get a new map
$$
    \hat{p}
\in \operatorname{Hom}_k(V,V)^G
=   \operatorname{Hom}_G(V,V) \,.
$$
One can then check that this $G$-endomorphism $\hat{p}$ is again a projection onto $U$, e.g. by checking that $\operatorname{im} \hat{p} \subseteq U$ and that $\hat{p}(u) = u$ for every $u \in U$.
While the projection onto invariants nicely explains how to translate the $k$-linear projection $p$ into a $G$-endomorphism $V \to V$, I have not yet found an explanation for why $\hat{p}$ will again be a projection onto $U$.
(“Checking on elements” proves that it works, but doesn’t explain why it works.)

How can we abstractly see that by applying the projection onto invariants to $p$, the resulting $G$-endomorphism $\hat{p}$ must again be a projection onto $U$?


This is what I tried/figured out so far:


*

*Suppose that $W \subseteq V$ is a $k$-linear subspace which is not a subrepresentation, and let $q \colon V \to V$ be a projection onto $W$.


*

*Then $\hat{q} \colon V \to V$ doesn’t have image $W$ since $\hat{q}$ is $G$-equivariant and $\operatorname{im} \hat{q}$ is therefore a subrepresentation of $V$.
But $\operatorname{im} \hat{q}$ is contained in the subrepresentation generated by $W$.

*$\hat{q}$ is not necessarily a projection.
(Example:
Let $\mathbb{Z}/4$ acts on $V = \mathbb{R}^2$, let $W$ be the $x$-axis and $q$ the orthogonal projection.
Then $\hat{q}(x) = x/2$ for every $x \in W$, so that $\hat{q}^2 \neq \hat{q}$.)


So it seems pretty important for $U$ to be a subrepresentation of $V$.

*For every $G$-homomorphism $f \colon V \to W$ one has that $f(\hat{v}) = \widehat{f(v)}$.
In fancy language we may regard $\widehat{(-)}$ as a natural transformation from the identity functor to the taking-invariants functor $(-)^G$.
Since $\widehat{(-)}_V$ is a projection for every representation $V$, this generalizes to a natural decomposition $V = V^G \oplus V^{\text{non-triv}}$.

*Given $k$-linear maps $f \colon U \to V$, $g \colon V \to W$ the first point shows that it does not always hold that $\widehat{f \circ g} = \hat{f} \circ \hat{g}$ (otherwise $\hat{q}$ would again be a projection).
But it follows from the second point that
$$
  \widehat{\hat{f} \circ g}
= \hat{f} \circ \hat{g}
= \widehat{f \circ \hat{g}}
  $$
since $\operatorname{Hom}_k(U,V) \to \operatorname{Hom}_k(U,W)$, $h \mapsto \hat{g} \circ h$ and $\operatorname{Hom}_k(V,W) \to \operatorname{Hom}_k(U,W)$, $h \mapsto h \circ \hat{f}$ are $G$-homomorphisms (which holds because $\hat{g}$ and $\hat{f}$ are $G$-homomorphisms).

*One can use the projection onto invariants to give different, more abstract proofs of Maschke’s theorem (e.g. section 3.2 here, which uses the natural decomposition from the second point).
But I have not yet found such an abstract proof which better explains the “classical” proof.
Any help is appreciated.
 A: The following approach is based on section 5 of Tobias Kildetoft’s notes about the representation theory of finite groups.


*

*Note that for every $g \in G$ the map $g.\!p = gpg^{-1}$ results from $p$ by conjugating with $g$.
Since $p$ is a projection onto the linear subspace $U$ it follows that $g.\!p$ is a projection onto the conjugated linear subspace $g.\!U$.

*Because $U$ is a subrepresentation we have that $g.\!U= U$.
Hence every summand $g.\!p$ is itself already a projection onto $U$.

*For every finite collection of projections $q_1, \dotsc, q_n$ on $U $, their average $\hat{q} := \frac{1}{n} \sum_{i=1}^n q_i$ is again a projection onto $U$ (where we assume that that $\operatorname{char} k \nmid n$).
This can be seen in at least the following two ways:
a.  The conditions that $q(u) = u$ for every $u \in U$ and that $q(v) \in U$ for every $v \in V$ are both preserved by taking averages.
b.  For every two projections $q_i, q_j$ onto $U$ we have that $q_i q_j = q_j$, so that
    \begin{align*}
        \hat{q}^2
      = \frac{1}{n^2} \sum_{i,j=1}^n q_i q_j
      = \frac{1}{n^2} \sum_{i,j=1}^n q_j
      = \frac{1}{n} \sum_{j=1}^n q_j
      = \hat{q}.
    \end{align*}
Note that this approach shows that all of the maps $V \to V$ appearing in the proof of Maschke’s theorem are already projections onto $U$.
So we never lose the property of “being a projection onto $U$” throughout the proof, resulting in $\hat{p}$ also being a projection onto $U$.

One can probably further enhance/abstract the above observations:
Note for example that 3.a. actually argues that the subset $A \subseteq \operatorname{Hom}_k(V,V)$ of projections onto $U$ is closed under affine combinations, and is therefore an affine subspace, and that 1. and 2. explain why $A$ is closed under the action of $G$.
As the process of averaging already makes sense in the affine subspace $A$ it follows that the average $\hat{p}$ lies again in $A$.
(So maybe we should look into affine actions?)
