
>>> A3 = u3 @ np.diag(s3) @ vT3
>>> np.allclose(A3, A.toarray())
True

The singular values match the expected singular values, and the singular
vectors are as expected up to a difference in sign.

>>> (np.allclose(s3, s) and
...  np.allclose(np.abs(u3), np.abs(u.toarray())) and
...  np.allclose(np.abs(vT3), np.abs(vT.toarray())))
True

The singular vectors are also orthogonal.

>>> (np.allclose(u3.T @ u3, np.eye(5)) and
...  np.allclose(vT3 @ vT3.T, np.eye(5)))
True
NŠ