2

I'd like to copy someone's notation for elementary matrices. Recall

Definition. An $n\times n$ elementary matrix is a matrix obtained by performing an elementary operation on $I_n$.

Here the three elementary operations are swap rows/columns, multiply row/column by a nonzero scalar, and add any scalar multiple of a row/column to another row/column.

Now consider the below image, where $A$ is an arbitrary $m\times n$ matrix and the first matrix is an elementary matrix of type 1, 2 and 3 respectively. Let ${u_1,u_2,\ldots,u_m}$ be the row vectors of $A$. Is this notation clear to you? Generally I like it and I'd like to replicate it, but without knowing how. I have two remarks though:

  • the first elementary matrix that multiplies $A$, call it $E$, is a bit unclear I think. I don't know how else one would write it. It's supposed to be the identity matrix with 1s on the diagonal except at $E_{ii}$ and $E_{jj}$ where it is 0. Also $E_{ij}=E_{ji}=1$.
  • I'd remove the dash from $i$-th and instead just write $i$th or simply $i$. Also, in a separate equation, I'd like to maybe write the exact same thing except for $A$ multiplied from the right by an elementary matrix and indicate the $i$th and $j$th column of the elementary matrix as done below for the rows.

Elementary matrices

Below is an unsatisfactory attempt at trying to copy the first elementary matrix. The row indications in \begin{matrix} don't properly align with the rows in \begin{pmatrix}. Appreciate any help on this.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\begin{matrix}
\\
i\text{-th} \\
\\
j\text{-th} \\
\end{matrix}
\begin{pmatrix}
\ddots & & & & \\
& & & 1 & \\
& & \ddots & & \\
& 1 & & & \\
& & & & \ddots
\end{pmatrix}$$
\end{document}

2 Answers 2

5

Using a single bordermatrix:

\[
\bordermatrix{
            &                 \cr   
            & \ddots & & & &  \cr
i\text{-th} & & & & 1  &      \cr
            & & & \ddots & &  \cr
j\text{-th} & & 1 & & &       \cr
            & & & & & \ddots  \cr
  }
\]

enter image description here

Alternatively, if you want to stick to your original matrix/pmatrix pair, you can use phantom rows in the first matrix to match the second one:

    \[\begin{matrix}
        \phantom{\ddots}\\ 
        i\text{-th}     \\
        \phantom{\ddots}\\
        j\text{-th}     \\
        \phantom{\ddots}
    \end{matrix}
    \begin{pmatrix}
        \ddots & & & & \\
        & & & 1 &      \\
        & & \ddots & & \\
        & 1 & & &      \\
        & & & & \ddots
    \end{pmatrix}
    \]

enter image description here

In any case, do replace the $$ $$ pair with \[ \].

2

Here is a suggestion.

\documentclass{article}
\usepackage{nicematrix,tikz}

\begin{document}

\setcounter{MaxMatrixCols}{12}

\[\begin{pNiceMatrix}[last-row,first-col,nullify-dots,xdots/line-style=dashed]
& 1& & & \Vdots & & & & \Vdots \\
& & \Ddots[line-style=standard] \\
& & & 1 \\
i \to & \Cdots & & & 0 & \Cdots & & & 1 & & & \Cdots \\
& & & & & 1 \\
& & & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\
& & & & & & & 1 \\
j \to & \Cdots & & & 1 & \Cdots & & \Cdots & 0 & & & \Cdots \\
& & & & & & & & & 1 \\
& & & & & & & & & & \Ddots[line-style=standard] \\
& & & & \Vdots & & & & \Vdots & & & 1 \\
& & & & \overset{\uparrow}{i} & & & & \overset{\uparrow}{j} \\
\end{pNiceMatrix}
A
=
\begin{pNiceMatrix}[last-row]
\\
\\
\\
\smash{\colorbox{gray!15}{\makebox[5cm]{\strut $u_j$}}} \\
\\
\\
\\
\smash{\colorbox{gray!15}{\makebox[5cm]{\strut $u_i$}}} \\
\\
\\
\\
\\
\end{pNiceMatrix}\]

\end{document}

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.