Splitting a semisimple representation into finitely many copies
Let $\Gamma$ be a group, $K$ a field, and $N,n\ge0$. Let $\rho:\Gamma\to\mathrm{GL}_N(K)$ and $r:\Gamma\to\mathrm{GL}_n(K)$ be semisimple representations. Suppose there are matrices $A\in\operatorname{Mat}_{N\times n}(K)$ and $B\in\operatorname{Mat}_{n\times N}(K)$ such that $BA=I_n$ and $\rho(g)A=Ar(g)$ for every $g$. Assume also that whenever $Z\in\operatorname{Mat}_N(K)$ satisfies $ZT=0$ for every matrix $T\in\operatorname{Mat}_{N\times n}(K)$ with $\rho(g)T=Tr(g)$ for every $g$, one has $Z=0$.
There are $k\ge0$ and matrices $T_j\in\operatorname{Mat}_{n\times N}(K)$, $T'_j\in\operatorname{Mat}_{N\times n}(K)$, for $1\le j\le k$, satisfying $$T_j\rho(g)=r(g)T_j,\qquad \rho(g)T'_j=T'_jr(g),\qquad \sum_{j=1}^kT'_jT_j=I_N.$$
This realizes the first representation as a direct summand of finitely many copies of the second in (Extracting a Galois subrepresentation from dense polynomial dataTheorem AGR.0088).