Are two square matrices having the same eigenvalues and the same eigenspaces equal matrices? Does possessing the same eigenvalues and the same eigenspaces imply the equality of the matrices? If yes, then is the converse of this implication also true? I mean if the answer is yes, then is having the same eigenvalues and the same eigenspaces only a sufficient condition for the equality of the square matrices or is it the necessary and sufficient condition?
The matrices

$$\left[ \begin{array}{cccc} \lambda &amp; 1 &amp; 0 &amp; 0 \\
 0 &amp; \lambda &amp; 0 &amp; 0 \\
 0 &amp; 0 &amp; \lambda &amp; 1 \\
 0 &amp; 0 &amp; 0 &amp; \lambda \end{array} \right], \left[ \begin{array}{cccc} \lambda &amp; 0 &amp; 0 &amp; 1 \\
 0 &amp; \lambda &amp; 0 &amp; 0 \\
 0 &amp; 1 &amp; \lambda &amp; 0 \\
 0 &amp; 0 &amp; 0 &amp; \lambda \end{array} \right]$$

have the same eigenvalues and eigenspaces, but are different. They can be distinguished by their generalized eigenspaces.
This  would imply any diagonalisable matrix is diagonal, which is absurd, as similar matrices do have the same eigenvalues and the same eigenspaces.