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.