I have the following matrix equation
$(A x - y)^T \cdot A = 0_n^T$
Whereby $x \in \mathbb{R}^n$, $y \in \mathbb{R}^d$, $A \in \mathbb{R}^{d \times n}$. A is not invertible, but $A^TA$ is invertible and the task is to solve for $x$.
$0_n$ is a $n$-dim vector of 0s, $(0,0,\dots,0)^T$ and $^T$ is the transpose of a matrix.
In order to solve it I transformed the equations in the following way:
\begin{align*} (Ax - y)^T \cdot A &= 0_n^T\\ (x^TA^T-y^T) \cdot A &= 0_n^T\\ x^TA^T \cdot A - y^T A &= 0_n^T\\ x^TA^T \cdot A &= y^T A\\ x^T &= (y^T \cdot A) \cdot (A^TA)^{-1}\\ x &= ((y^T \cdot A) \cdot (A^TA)^{-1})^T\\ x &= A^T \cdot y \cdot ((A^TA)^{-1})^T \end{align*}
Is this legal or have I missed something?