Suppose we have a matrix $A$ with $m$ rows and $n$ columns satisfying the condition $m<n$. Suppose further that $m$ rows are linearly independent, and $n$ columns are linearly independent as well. The article from Wikipedia says:
In linear algebra, the rank of a matrix $A$ is the dimension of the vector space generated (or spanned) by its columns. This corresponds to the maximal number of linearly independent columns of $A$. This, in turn, is identical to the dimension of the space spanned by its rows.
Definitely, from the exmaple above we have $rank(A)=m$. But from another hand, the dimension of the space spanned by rows are equal to $n$, since $n$ linearly independent equations. If my reasoning is correct, I see a contradiction between the following property $rank(A)=min(m,n).$ Please guide me what part of my reasoning is incorrect.
You assumed that it was possible for all the $n$ columns to be linearly independent. If each column only has $m$ entries and $m<n$, then that's impossible (you can't, for instance, have three linearly independent $2\times 1$ columns).
In fact, it turns out that the largest size of a set of linearly independent columns you can get from a given matrix is equal to the largest size of aset of linearly independent rows you can get. This number is what is called the rank of that matrix.