Number of orbits of $M_n(K)$ under the action of $\mathbb{GL}_n(K)$ It's easy to prove that given two nxn matrices X,Y with coefficient in a field K,with same rank, there are $A,B \in \mathbb{GL}_n({K})$ such that $AXB=Y$. But clearly it's not true if we just search A such that $AX=Y$, and this because there are other invariants:the rank of the matrices obtained exctracting any subset of columns. But indeed this set of $2^n-1$ invariants should characterize the equivalence class of the matrix(by the left action of $\mathbb{GL}_n(K)$). So there is a finite number of classes corresponding to the compatible sets of rank given to each subsets. So my question is: what is this number? And moreovere what is this number when the first invariant is fixed, namely the rank? 
Edit: sorry i realized reading the post down that the problem i've in mind is different from the one i've written. What i was thinking about is: given a matrix for every subset of columns attach the rank of them. So now you have a function from the subset of $\{1,...,n\}$ to $\{1,...,n\}$. How many function arises in this way? this is my real question
 A: You consider the action of $Gl_n$ on $M_n$ by $A.X = A \times X$. It is a standard result that the orbits for this action are of the form 
$$
S_E = \{A \in M_n: ker(A) = E\}.
$$
And of course, $E$ can be any subset of $\mathbb{K}^n$. So there are an infinite number of orbits (unless $\mathbb{K}$ itself is finite).
One can prove this in the following way: it is clear that matrices in an orbit have the same kernel. Conversely, suppose that $X$ and $Y$ share the same kernel $E$. Choose a supplementary $F$ of $E$ in $\mathbb{K}^n$ and let $(f_i)$ be a basis of $F$.
The $Xf_i$ give a basis of $Im(X)$. We define $A$ on $Im(X)$ by $A(Xf_i) = Yf_i$. Extend $A$ as you want on the whole $\mathbb{K}^n$. Then $A$ satisfies $Y = AX$.
Remark: you can also show that the orbits for the action of $Gl_n$ by right multiplication are the matrices having the same image.
Edit: Concerning your second question, your function $f$ is defined from $\mathcal{P}({1,\dots,n})$ to $\{0,\dots,n\}$. There are obvious restrictions: $f(A) \leq |A|$, $f$ is increasing (for the inclusion in $\mathcal{P}({1,\dots,n})$ and the natural order in $\{0,\dots,n\}$) and $f(A \cup B) \leq f(A) + f(B)$.
My intuition is that there are no other restrictions on $f$ (if the field is infinite) (but since I have added restrictions two times, I might be wrong), I'll try to give a proof later. Then you have to count the set of such functions, which is a purely combinatorial problem, which seems difficult to me.
