Let $A,B\in M_n(R)$ matrices over commutative ring. We say that $A\sim B \Leftrightarrow B=PAQ$ where $P,Q$ are invertible.
Denote by $\Delta_k(A)$ the ideal in $R$ which is generated by all the minors of size $k\times k$. I have already proved that if $B=PA$ then $\Delta_k(B)\subseteq\Delta_k(A)$.
I am now trying to prove that if $A\sim B$ then $\Delta_k(A)=\Delta_k(B)$.
I proved the case $k=n$, in that case $\Delta_n(A)=R\cdot\det(A)$ and the same goes for $B$. then
$$\Delta_n(B)=\Delta_n(PAQ)\subseteq\Delta_n(AQ)=R\cdot\det(AQ)$$
notice that $$\det(AQ)=\alpha\det(A)\in R\cdot\det(A)$$ so $$R\cdot\det(AQ)\subseteq R\cdot\det(A)=\Delta_n(A)$$ which implies $\Delta_n(B)\subseteq\Delta_n(A)$ with similar process, the other direction can pe proved, so in total $\Delta_n(B)=\Delta_n(A)$.
I also proved the case where $k=1$. How can I prove the general case?
Let $e_1, \ldots, e_n$ denote the standard basis vectors for $R^n$. Then the $k$th exterior power $\bigwedge^k(R^n)$ is also a free module with basis $\{ e_{i_1} \wedge \ldots \wedge e_{i_k} \mid 1 \leq i_1 < \ldots < i_k \leq n\}$. The entries of the matrix of the linear map $\bigwedge^k(A) : \bigwedge^k(R^n) \to \bigwedge^k(R^n)$ with respect to this basis are exactly the $k \times k$ minors of $A$. Let us also call this matrix $\bigwedge^k(A)$. Then $\Delta_k(A)$ is the ideal generated by the entries of $\bigwedge^k(A)$.
By functoriality of $\bigwedge^k$ (and functoriality of ''taking matrices with respect to a fixed basis''), we have $\bigwedge^k(P A Q) = \bigwedge^k(P)\bigwedge^k(A)\bigwedge^k(Q)$, hence the entries of $\bigwedge^k(P A Q)$ are $R$-linear combinations of the entries of $\bigwedge^k(A)$, which implies $\Delta_k(PAQ) \subseteq \Delta_k(A)$. Since $P$ and $Q$ are invertible, the same result shows that $\Delta_k(A) = \Delta_k(P^{-1}PAQQ^{-1}) \subseteq \Delta_k(PAQ)$.