invertible matrix is a square matrix

If an $m \times n$ matrix $A$ has both left inverse and right inverse, then the given matrix is square and invertible. I am done with $A$ is invertible but how to prove that $A$ is a square matrix?

• only square matrices are called invertible(en.wikipedia.org/wiki/Invertible_matrix) – Nick Aug 11 '16 at 17:34
• but here A is not square i need to prove m = n, but how? – Amanda Aug 11 '16 at 17:36
• Note that in the case that $m\neq n$ then $rank(A)\leq \min(m,n)<\max(m,n)$ – JMoravitz Aug 11 '16 at 17:36

If an $m\times n$ matrix has more rows than columns, i.e. $m>n$, then all the rows are in the same $n$-dimensional space, so no more than $n$ of them can be linearly independent. But there are more than $n$ of them. Thus the row of $n$ zeros can be written as a linear combination of them in more than one way. Those two different linear combinations that evaluate to zero are two vectors getting mapped to the same image; hence that mapping is not invertible.
Let $B\in M_{n,m}(\Bbb F)$ and $C\in M_{n,m}(\Bbb F)$ are the left and right inverse of $A$ respectively. Then
$$C=(BA)C=B(AC)=B$$ so $I_n=BA=AB=I_m$ and then $m=n$.