Artificial intelligent assistant

When does $(A^{\mathsf{T}}A)^{-1} = A^{-1}(A^{\mathsf{T}})^{-1}$? $\newcommand{\trans}{^{\mathsf{T}}}$What is the necessary condition for $(A\trans A)^{-1} = A^{-1}(A\trans)^{-1}$? Specifically, if $(A\trans A)^{-1}$ is invertible, then does it imply $(A\trans A)^{-1} = A^{-1}(A\trans)^{-1}$? Why or why not?

In order for $A$ to be invertible, it must be square. It's a well known fact that $A^TA$ has the same rank as $A$ (can you prove it?), so a square matrix $A$ is invertible if and only if $A^TA$ is invertible.

(Note: $A$ is assumed to be a real matrix.)

Of course, in this case, $(A^TA)^{-1}=A^{-1}(A^T)^{-1}$, because also $A^T$ is invertible, having the same rank as $A$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 9d266bb7b4dcf0185c68ddc997adfca2