> 
> Show that in $M\_3(\mathbb{Z}\_7), \begin{pmatrix}3 & 0 & 0 \\
> 0 & 3 & 0\\
> 0 & 0 & 0\end{pmatrix} \cong \begin{pmatrix}1 & 0 & 0\\
> 0 & 1 & 0\\
> 0 & 0 & 0\end{pmatrix}$ but $\begin{pmatrix}3 & 0 & 0 \\
> 0 & 1 & 0\\
> 0 & 0 & 0\end{pmatrix} \not\cong \begin{pmatrix}1 & 0 & 0\\
> 0 & 1 & 0\\
> 0 & 0 & 0\end{pmatrix}.$
> 
> 
> 

I know that to show that two matrices $A$ and $B$ are congruent, it suffices to show that for some invertible matrix $P, A = P^T B P$. However, I am unable to find such an invertible matrix, so I was wondering if it was easier to arrive at a contradiction if I assume that no such matrix exists?

To show that the given two matrices are not congruent, one way (though obviously not very generalizable) is to show that no matrix $P = \begin{pmatrix}a & b & c\\
d & e & f\\
g & h & i\end{pmatrix} \in M\_3(\mathbb{Z}\_7)$ can satisfy that $P^T AP = B,$ where $A = \begin{pmatrix}3 & 0 & 0 \\
0 & 1 & 0\\
0 & 0 & 0\end{pmatrix}$ and $B = \begin{pmatrix}1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 0\end{pmatrix}$ (in this case this works, but it may be harder to show this if such a matrix exists, but it just isn't invertible). One can do so by manipulating a system of equations and showing that there is never a solution (e.g. one can fix a variable $d$ and consider when $d\in \{0,1,2,3,4,5,6\}$). So I was wondering if there was an easier approach for this?