I asked this [question](https://math.stackexchange.com/questions/3788580/the-rank-of-a-linear-combination-of-operators) a few days ago in MathExchange and received no satisfatory answer. I hope it is well suited for MathOverflow.


Suppose I have two linear operators $X,\,Y$ on $\mathbb{C}^n$. Now let $a,b\in\mathbb{C}$ and consider $Z\_{a,b}:=aX+bY$. When we look at their images we clearly have $$im\,Z\_{a,b}\subseteq \,im\,X+im\,Y,$$ but in general this inclusion is strict. At the beginning I asked myself if it would be true that the equality holds whenever we take $a,b\in\mathbb{C}$ sufficiently general. Someone then pointed out that this is false: just take


$$
X = \pmatrix{1&0\\0&0}, \quad Y = \pmatrix{0&0\\1&0}.
$$


Then I moved to the case where we know that $X,Y$ commute. In this case it is known that $X,\,Y$ are simultaneously upper triangularizable. Even with this simplification I could not find a proof or counter-example. I think this would follow from some sort of rank semicontinuity in Zariski topology but not sure how to prove this.


Stating questions explicitly:


**1 - If $XY=YX$, is it true that $im\,Z\_{a,b}=\,im\,X+im\,Y$ for $(a:b)$ a general point of $\mathbb{P}^1$?**


An obvious generalization of the first question:


**2 - Given a family of $X\_0,\ldots,X\_{m}$ of commuting operators in $\mathbb{C}^n$ is it true that $Z\_{a\_0,\ldots,a\_{m}}:=\sum\_i\,a\_i X\_i$ satisfies $im(Z\_{a\_0,\ldots,a\_{m}})=\sum\_i\,im(X\_i)$ for a general $(a\_0:\ldots:a\_m)\in\mathbb{P}^m$?**



Rank of a linear combination of linear operators
I think one can cook a similar counter-example to that you mention. Consider the matrices: $X = \begin{pmatrix} 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}$ and $\ Y = \begin{pmatrix} 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{pmatrix}$.


Then we have : $XY = YX = 0$, for any $a,b \in \mathbb{C}^2, \ \mathrm{rk}(aX + bY) \leq 2$, but $\dim (\mathrm{Im}(X) + \mathrm{Im}(Y)) = 3$.


