I am having confusion with two statements:
A least-squares solution $\hat x$ of an inconsistent system $Ax=y$ is a solution of the normal equations $A^TA x = A^Ty$, $\hat x$ can be found by reducing $[A^TA \ A^Ty]$ to the reduced echelon form.
An inconsistent system $Ax= b$ has a unique least-squares solution $\hat x$ if and only if the columns of $A$ are linearly independent and, in this case, $\hat x = (A^TA)^{-1} A^T b$.
I know that the second statement is true, but confused with the first one.
First statement: If $A$ is not full column rank, there exists infinite solutions, which you can not solve by $(A^TA)^{-1}A^Ty$ because the inverse doesn't exist. Instead, you would solve the system using row echelon form.
Second statement: If $A$ is full column rank, then $(A^TA)^{-1}A^Ty$ is the unique solution.
So second statement is false because the system has a unique solution and therefore can not be inconsistent.