Solve for vector $r$ in an equation involving sum of the square elements of $r$ and the sum of the square elements of $Mr$ where $M$ is a known matrix Hello stackexchange community.
I have a system of equations where the aim is finding two vectors $r$ and $c$ of lengths $t$ and $m$ respectively. There is a known matrix $M$ of shape $m\times t$ and these are the two equations:

*

*$c=\frac{1}{||r||^2}Mr$


*$r=\frac{1}{||c||^2}M^Tc$
where $M^T$ is the transpose of the matrix $M$, and $||v||^2$ is the square of the Euclidean norm of the vector $v$ (or the sum of the square of each entry of $v$).
Now I have boiled down the system to the following $2$ equations, but I can't go beyond what I've reached:

*

*$r=\frac{||r||^2}{||Mr||^2}M^TMr$

*$c=\frac{||c||^2}{||M^Tc||^2}MM^Tc$
Some info that might be necessary:

*

*$m$ i.e. length of $r$, and $t$ i.e. length of $c$ may or may not be equal.

*Subsequently the matrix $M$ may or may not have an inverse.

I have not been able to find any mathematical solutions on how to approach this problem.
I thought of going ahead with using sympy (which is a computer programming tool meant for solving equations using the coding language python) but I wanted to get a mathematical solution before resorting to computing.
Thanks a ton and any feedback is appreciated.
Thanks for your time.
 A: You have
$ c = \dfrac{1}{\| r \|^2 } M r $
and
$ r = \dfrac{1}{\| c \|^2 } M^T c $
Premultiply the first equation by $M^T$ and the second equation by $M$ and use the other equation, respectively, you get
$ \| c \|^2 r = \dfrac{1}{\| r \| ^2 } M^T M r $
and
$ \| r \|^2 c = \dfrac{1}{\| c \|^2 } M M^T c $
Hence,
$ (  \| r \|^2 \| c \|^2 I - M^T M ) r = 0 $
and
$ (  \| r \|^2 \| c \|^2 I - M M^T) c = 0 $
The last two equations imply that non-zero $r$ is an eigenvector of $M^T M$ associated with the eigenvalue ($\lambda = \| r \|^2 \| c \|^2$).  Similarly, $c$ is an eigenvector of $M M^T$ associated with the same eigenvalue.
Now $M^TM$ and $M M^T$ share the same eigenvalues and for the bigger matrix, the additional eigenvalues are zeroes.  So to solve for $r$ and $c$, take a non-zero eigenvalue $\lambda$ of $M^T M $ (which is also an eigenvalue of $M M^T$ ), and select $\| r \|$ and $\| c \|$ anyway you wish such that they're both positive and the product of their squares is equal to $\lambda$.
Next find the unit eigenvector associated with $\lambda$ for the matrix $M^T M$, and scale it by $\| r \| $ that you choose earlier, and this will give you the vector $r$.
Similarly, find the unit eigenvector associated with $\lambda$ for the matrix $M M^T$ and scale it $\| c \|$, and this will give you the vector $c$.
You can do this over all the non-zero eigenvalues of $M^T M$ (or $M M^T$ ).
EDIT:
The method outlined above gives the correct $r$ and $c$ up to a sign, so after finding $r$ and $c$, check the equality of the first equation.  If the left hand side is the negative of the right hand side, then just flip one of the two vectors ($r$ or $c$).  With this, both equations will be satisfied.  Or better still, after finding $r$, just use the first equation to calculate $c$ directly.
