I recently came across the following characterization of unit regular elements of an endomorphism ring (Corollary to Theorem 1 in this article).
Let $M$ be a vector space over the division ring $D$, and let $R = \text{End}(M)$. If $a \in R$, then $a$ is unit regular if and only if $\text{dim}(\ker a) = \text{dim}(\text{coker}\, a)$
Is Ehrlich implicity assuming that the dimension of $M$ is countable and the dimensions of the kernel and cokernel are finite, or is there an example of a unit regular endomorphism with infinite kernel or cokernel?