This is a question related to Smith Normal form I guess but I couldn't do the proof by my own using elementary row and column operation. So here is the problem:
Suppose $$(a_{ij})=
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots\\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{pmatrix}
$$
It is given that $a_{ij} \in \Bbb Z$(or any euclidean domain) $a_1=gcd(a_{11}, a_{12} , \cdots , a_{mn})$.
Then prove that after elementary row and column operation we get $$(a_{ij}) \rightarrow \begin{pmatrix}
a_{1} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots\\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{pmatrix}
$$ where $a_1|a_{ij}$
Now I was trying in this way that let us take $m=2$ and $n=3$ $a_1=\gcd(a_{11}, a_{12} , \cdots , a_{23})$, so $a_1=b_{11}a_{11}+\cdots+b_{23}a_{23}$ and the matrix is
$$
\begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
\end{pmatrix} \rightarrow^{b_{11}R_1+b_{21}R_2} \begin{pmatrix}
b_{11}a_{11}+b_{21}a_{21} & b_{11}a_{12}+b_{21}a_{22} & b_{11}a_{13}+b_{21}a_{23} \\
a_{21} & a_{22} & a_{23} \\
\end{pmatrix} \rightarrow^{C_1+\frac{b_{12}}{b_{11}}C_2+\frac{b_{13}}{b_{11}}C_3} \begin{pmatrix}
b_{11}a_{11}+b_{21}a_{21}+b_{12}a_{12}+\frac{b_{12}b_{21}}{b_{11}}a_{22}+b_{13}a_{13}+\frac{b_{21}b_{13}}{b_{11}} a_{23}& b_{11}a_{12}+b_{21}a_{22} & b_{11}a_{13}+b_{21}a_{23} \\
a_{21} & a_{22} & a_{23} \\
\end{pmatrix}
$$
1.Now how can we fix $\frac{b_{12}b_{21}}{b_{11}}a_{22}+\frac{b_{21}b_{13}}{b_{11}} a_{23}$?
- After explaining with simple matrix, can you give me some hint about the general case? (I think that my way of thinking is not proper here as well)
Best Answer
A possibility is to do it in several stages. A key observation is that if the entries on some row have $\gcd=d$, say $d=\gcd(a_{i1},a_{i2},\ldots,a_{in})$, then we can perform a sequence of column operations to make $d$ appear on that row:
Similarly, by performing a sequence of row operations, we can make the gcd of entries on a column to appear in that column.
This leads to the following pseudocode/algorithm:
The algorithm terminates because we can find a proper divisor of a non-zero integer only finitely many times. So after some number of iterations we can exit in step 3.
A numerical example $$ A=\left(\begin{array}{ccc}18&12&24\\51&33&60\\15&-3&22\end{array}\right). $$ We see that the gcd of the top row is $6$. We can arrange it to appear at position $(1,1)$ simply by subtracting the second column from the first $$ \to\left(\begin{array}{ccc}6&12&24\\18&33&60\\18&-3&22\end{array}\right). $$ Then we create those zeros: $$ \to\left(\begin{array}{ccc}6&0&0\\18&-3&12\\18&-39&-50\end{array}\right). $$ The entry at $(2,2)$ is not divisible by six but the entry $(2,1)$ is, so we "fix" this by adding the second column to the first. Might as well add it multiplied by $5$ to create a smaller entry: $$ \to\left(\begin{array}{ccc}6&0&0\\3&-3&12\\-177&-39&-50\end{array}\right). $$ It is our lucky day in that $\gcd(a_{11},a_{12})=\gcd(6,3)=3$ already appears at $(2,1)$, so we simply swap the two rows: $$ \to\left(\begin{array}{ccc}3&-3&12\\ 6&0&0\\-177&-39&-50\end{array}\right). $$ We are back in step 1 with $a_{new}=3$ having replaced $a_{old}=6$. Again, we are lucky, and $3$ is the gcd of the top row. Let's just create those zeros again: $$ \to\left(\begin{array}{ccc}3&0&0\\ 6&6&-24\\-177&-216&-758\end{array}\right). $$ We see that the entry $a_{33}=-758$ is the only entry not divisibly by $a_{current}=3$. We use it to make the entry $a_{31}$ not divisible by three by adding the last colum to the first: $$ \to\left(\begin{array}{ccc}3&0&0\\ -18&6&-24\\-935&-216&-758\end{array}\right). $$ We then produce $\gcd(3,-758)=1$ to the first column simply by adding a multiple of the top row to the third: $$ \to\left(\begin{array}{ccc}3&0&0\\ -18&6&-24\\1&-216&-758\end{array}\right). $$ Then we swap the 1st and 3rd rows and we are done: $$ \to\left(\begin{array}{ccc}1&-216&-758\\ -18&6&-24\\ 3&0&0\end{array}\right). $$
Many obviously unnecessary steps here. Different combos of operations will surely make it cleaner. My numerical example was crafted to make the Euclidean algorithms calculating the gcd of two integers extremely simple. In general you may need to do several row/column operations while calculating the gcd of two chosen entries.