I was working more on the topic on my previous question when I have to know whether the following statement is true to circumvent the "exception" caused by division by singular matrices; again, long story short, the statement follows:


If two singular matrices $A, B$ exist s.t. the determinant of $EA-B$ is identically zero for all real matrices $E$, then either $A=YB$ or $B=ZA$, $Y$ and $Z$ being undetermined matrices.


Is it true (vacuously or not) in general?



Singularity of matrix pencil-like expression
No.


The first condition is satisfied if (and only if) there is some vector in the kernel of $A$ that is also in the kernel of $B$.


The second condition is satisfied (if and) only if the kernel of $A$ is contained in the kernel of $B$ or the kernel of $B$ is contained in the kernel of $A$.


To make a counterexample, we choose any two subspaces with nonempty intersection but neither contained in the other, and choose matrices with those kernels. This first occurs in dimension 3, with two 2-dimensional subspaces, giving [Federico Poloni's answer](https://mathoverflow.net/a/440447/18060).


