% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[postdot,style=index]{glossaries-extra}

\makeglossaries

\newcommand*{\mtx}[1]{\boldsymbol{#1}}
\newcommand*{\mtxinv}[1]{\mtx{#1}\sp{-1}}

\newglossaryentry{matrix}{%
  name={matrix},
  symbol={\ensuremath{\mtx{M}}},
  plural={matrices},
  user1={mtx},
  description={rectangular array of values}
}

\newglossaryentry{identitymatrix}{%
  name={identity matrix},
  symbol={\ensuremath{\mtx{I}}},
  plural={identity matrices},
  description={a diagonal matrix with all diagonal elements equal to
1 and all other elements equal to 0}
}

\newglossaryentry{matrixinv}{%
  name={matrix inverse},
  symbol={\ensuremath{\mtxinv{M}}},
  user1={mtxinv},
  description={a square \gls{matrix} such that 
   $\mtx{M}\mtxinv{M}=\glssymbol{identitymatrix}$}
}

\renewcommand{\GlsXtrFmtDefaultOptions}{hyper=false,noindex}

\begin{document}
A \gls{matrix} is denoted \glssymbol{matrix}.
The inverse is denoted \glssymbol{matrixinv}.

\newpage

\[
  \glsxtrfmt{matrix}{A}
  \glsxtrfmt{matrixinv}{A}
  =
  \glssymbol{identitymatrix}
\]

\newpage

\printglossaries
\end{document}
