On the Lyapunov equation, coinvariant subspaces and some problems related to spectral factorizations