Given two $n\times m$ matrices $A$ and $B$ and an invertible $n\times n$ matrix $M$, do two other $n\times m$ matrices $C$ and $D$ exist such that the $m\times m$ matrix $X = A^T M^{-1} B$ (assumed to be invertible) is equal to $(C^TMD)^{-1}$ for $n>m$? (The case $n=m$ is obvious, if $A$ and $B$ are invertible, the solution would be $C^T=B^{-1}$ and $D^T=A^{-1}$)
So in brief, do $C$ and $D$ exist (and if so what are their values) such that
$$A^TM^{-1}B=(C^TMD)^{-1}$$
? I guess some minimal requirement would be a maximal rank of $A$ and $B$, but is that sufficient?
edit I am searching for a way to avoid the inversion of the big $n\times n$ matrix $M$ when the inversion of a smaller $m\times m$ matrix $C^TMD$ might be sufficient.
So in extension, if the above-mentioned $C$ and $D$ exist, are there solutions independent of $M$?
edit2 In the case I want to use this, $n$ is a multiple of $m$ such that, as p.s. suggested, using block-matrices might help. I suspect that the minimum requirement for $C$ and $D$ to exist is then that each $m\times m$ block of $A$ and $B$ must be invertible, I'll try to investigate upon that.
Clearly, this is equivalent to finding $C,D$ such that $C^TMD=(A^T M^{-1} B) ^{-1}$.
If $M$ is $n \times n$ and invertible and $n \ge m$ then for any $m \times m$ matrix $E$, there exist $n \times m$ matrices $C,D$ such that $C^TMD=E$. For example, take $C = F^T\left[ \begin{matrix} I\\0 \end{matrix} \right]$,and $D = (FM)^{-1}\left[ \begin{matrix} E\\0 \end{matrix} \right]$, where $F$ is any invertible $n \times n$ matrix. Note the decomposition is not unique.
So in the specific case $E = (A^T M^{-1} B) ^{-1}$, the only condition we need is that the matrix $(A^T M^{-1} B) ^{-1}$ actually exists. In other words:
$$ \mbox{rank}(A^T M^{-1} B) = m $$
This can be stated in several equivalent ways. However, I'd note that the condition $\mbox{rank}(A) = \mbox{rank}(B) = m$ is not sufficient to imply this unless $n = m$.