owned this note
owned this note
Published
Linked with GitHub
# 基本矩陣與列超平行體
Elementary matrix acts on rows

This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
$\newcommand{\trans}{^\top}
\newcommand{\adj}{^{\rm adj}}
\newcommand{\cof}{^{\rm cof}}
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\dunion}{\mathbin{\dot\cup}}
\newcommand{\bzero}{\mathbf{0}}
\newcommand{\bone}{\mathbf{1}}
\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bd}{\mathbf{d}}
\newcommand{\be}{\mathbf{e}}
\newcommand{\bh}{\mathbf{h}}
\newcommand{\bp}{\mathbf{p}}
\newcommand{\bq}{\mathbf{q}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}
\newcommand{\bw}{\mathbf{w}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\nul}{\operatorname{null}}
\newcommand{\rank}{\operatorname{rank}}
%\newcommand{\ker}{\operatorname{ker}}
\newcommand{\range}{\operatorname{range}}
\newcommand{\Col}{\operatorname{Col}}
\newcommand{\Row}{\operatorname{Row}}
\newcommand{\spec}{\operatorname{spec}}
\newcommand{\vspan}{\operatorname{span}}
\newcommand{\Vol}{\operatorname{Vol}}
\newcommand{\sgn}{\operatorname{sgn}}
\newcommand{\idmap}{\operatorname{id}}
\newcommand{\am}{\operatorname{am}}
\newcommand{\gm}{\operatorname{gm}}
\newcommand{\mult}{\operatorname{mult}}
\newcommand{\iner}{\operatorname{iner}}$
```python
from lingeo import random_int_list, row_operation_process
```
## Main idea
Each $n\times n$ matrix can be viewed as a list of row vectors $\{\br_1,\ldots, \br_n\}$.
We define the **row parallelotope** of $A$ as the polytope
$$
\{c_1\br_1 + \cdots + c_n\br_n : c_i\in [0,1] \text{ for all }i = 1,\ldots, n\}
$$
spanned by the rows $\{\br_1,\ldots, \br_n\}$ of $A$.
Let $\Vol_R(A)$ be the **signed volume** of the row parallelotope.
Then $\Vol_R(A)$ can be defined through the following rules.
- $\Vol_R(I_n) = 1$.
- If $E$ is the elementary matrix of $\rho_i\leftrightarrow\rho_j$, then $E$ **swaps** the $i$-th and $j$-th rows of $A$.
Thus, $\Vol_R(EA) = -\Vol_R(A)$ and we define $\Vol_R(E) = -1$.
- If $E$ is the elementary matrix of $\rho_i:\times k$, then $E$ **rescales** the $i$-th row of $A$.
Thus, $\Vol_R(EA) = k\Vol_R(A)$ and we define $\Vol_R(E) = k$.
(Note that this statement still holds even when $k = 0$.)
- If $E$ is the elementary matrix of $\rho_i:+k\rho_j$, then $E$ **slants** the $i$-th row of $A$ to the direction of $j$-th row.
Thus, $\Vol_R(EA) = \Vol_R(A)$ and we define $\Vol_R(E) = 1$.
As a consequence, if a matrix $A$ is invertible and
can be written as the product a sequence of elementary matrices $F_1\cdots F_k$,
then $\Vol_R(A) = \Vol_R(F_1)\cdots\Vol_R(F_k)\Vol_R(I_n) = \Vol_R(F_1)\cdots\Vol_R(F_k)$.
In contrast, if $A$ is not invertible,
then row parallelotope collapses and is flat $\Vol_R(A) = 0$.
From this point of view,
the value of $\Vol_R(A)$ can be both
the signed volume and
the **scaling factor** changing $\Vol_R(B)$ to $\Vol_R(AB)$ for any $B$.
## Side stories
- operations on spanning vectors
## Experiments
##### Exercise 1
執行以下程式碼。
已知 $A = F_1\cdots F_k$ 是一群單位矩陣的乘積。
<!-- eng start -->
Run the code below. Suppose we know $A = F_1\cdots F_k$ is the product of some elementary matrices.
<!-- eng end -->
```python
### code
set_random_seed(0)
print_ans = False
n = 2
while True:
A = matrix(n, random_int_list(n^2, 3))
if A.det() != 0:
break
elems = row_operation_process(A, inv=True)
pretty_print(A, LatexExpr("="), *elems)
R = identity_matrix(n)
k = 1
vols = [1]
for elem in elems[::-1]:
R = elem * R
vols.append(R.det())
vecs = R.rows()
P = polytopes.parallelotope(vecs).plot(
xmin=-3,
xmax=3,
ymin=-3,
ymax=3,
wireframe="black",
fill="lightgreen"
)
for v in vecs:
P += text("%s"%v, v + vector([0,0.5]), fontweight=1000).plot()
show(P, title="$V_{%s}$"%k)
k += 1
if print_ans:
for k,vol in enumerate(vols):
print("The signed volumn (area) of V%s is"%k, vol)
```
By `set_random_seed(0)`,
we can get
$\begin{bmatrix}-3&3\\1&2\end{bmatrix}=
\begin{bmatrix}-3&0\\0&1\end{bmatrix}
\begin{bmatrix}1&0\\1&1\end{bmatrix}
\begin{bmatrix}1&0\\0&3\end{bmatrix}
\begin{bmatrix}1&-1\\0&1\end{bmatrix}.$
---
##### Exercise 1(a)
令 $V_0$ 為單位矩陣的列超平行體。
說明如何從 $V_0$ 得到 $V_1$ 並求出 $V_1$ 的面積。
<!-- eng start -->
Let $V_0$ be the row parallelotope for the identity matrix. Explain how to obtain $V_1$ from $V_0$ and find the volume of $V_1$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
$V_1=\begin{bmatrix}1&-1\\0&1\end{bmatrix}
=\begin{bmatrix}1&-1\\0&1\end{bmatrix}
\begin{bmatrix}1&0\\0&1\end{bmatrix},$
which means that we can slant one side of $V_0$ to obtain $V_1.$
Since it just slants one side, the volume will not change, and $\Vol_R(V_0)=1=\Vol_R(V_1).$
:::warning
Nice! :thumbsup:
- [x] Space after a comma.
:::
---
##### Exercise 1(b)
依序說明如何從 $V_i$ 得到 $V_{i+1}$,
並求出 $V_2,\ldots, V_k$ 的面積。
<!-- eng start -->
Explain how to obtain $V_{i+1}$ from $V_i$ and find the volume of $V_{i+1}$ for each $i$. Then find the volume for each of $V_2,\ldots, V_k$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
$V_2=\begin{bmatrix}1&-1\\0&3\end{bmatrix}
=\begin{bmatrix}1&0\\0&3\end{bmatrix}
\begin{bmatrix}1&-1\\0&1\end{bmatrix}.$
We can rescale one side of $V_1$ by $3$ to obtain $V_2,$
and the volume will multiply by $3$, and $\Vol_R(V_2)=3\Vol_R(V_1)=3$
$V_3=\begin{bmatrix}1&-1\\1&2\end{bmatrix}
=\begin{bmatrix}1&0\\1&1\end{bmatrix}
\begin{bmatrix}1&-1\\0&3\end{bmatrix}.$
We can slant one side of $V_2$ to obtain $V_3,$
the volume will not change, and
$\Vol_R(V_3)=\Vol_R(V_2)=3.$
$V_4=\begin{bmatrix}-3&3\\1&2\end{bmatrix}
=\begin{bmatrix}-3&0\\0&1\end{bmatrix}
\begin{bmatrix}1&-1\\1&2\end{bmatrix}.$
We can rescale one side of $V_3$ by $-3$,
the volume will multiply by $-3,$ and $\Vol_R(V_4)=-3\Vol_R(V_3)=-9.$
---
:::info
What do the experiments try to tell you? (open answer)
We think the experiments tell us how elementary matrix affect the determinant and the value.
:::
:::success
Jephian: Exactly!
:::
---
## Exercises
##### Exercise 2
對以下矩陣 $A$,
用文字描述它的列平行體,並用求出它的有向體積。
<!-- eng start -->
For each of the following matrices $A$, use a few sentences to decribe its row parallelotope. Then find its signed volumn.
<!-- eng end -->
##### Exercise 2(a)
$$
A = \begin{bmatrix}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 0 & 3
\end{bmatrix}.
$$
##### <font color="#f00">**Answer:**</font>
The matrix $A$ represents a linear transformation that stretches
the $\bx$-axis by a factor of $1$,
the $\by$-axis by a factor of $2$,
and the $\bz$-axis by a factor of $3$.
The row parallelotope of this matrix is a parallelepiped with sides parallel to the coordinate axes.
Its volume is given by the absolute value of the determinant of the matrix $A$, which is $\vert A \vert = 1 \times 2 \times 3 = 6$.
Since the signed volume is positive, the signed volume of the row parallelotope of $A$ is $6$.
:::success
Good.
:::
---
##### Exercise 2(b)
$$
A = \begin{bmatrix}
0 & 1 & 0 \\
2 & 0 & 0 \\
0 & 0 & 3
\end{bmatrix}.
$$
##### <font color="#f00">**Answer:**</font>
This row parallelotope is composed of the three vectors
$(0,1,0),(2,0,0),(0,0,3)$ .
By doing some row operation,
(i)$\space$$\space$ $\rho_1 \leftrightarrow \rho_2$
(ii)$\space$ $\rho_1: \times \frac{1}{2}$
(iii) $\rho_2: \times 2$
we will get a matrix $B$, which is exactly same as the matrix in Exercise 2(a).
By the definition of $\Vol_R$ and the comparison of 2(a) and 2(b),
we know that
$$
\Vol_R(A) = -\Vol_R(B) \times \frac{1}{2} \times 2 = -6.
$$
In other words, the signed volumn of $A$ is $-6$.
:::success
Good.
:::
---
##### Exercise 2(c)
$$
A = \begin{bmatrix}
1 & 1 & 1 \\
1 & 2 & 3 \\
0 & 0 & 0
\end{bmatrix}.
$$
##### <font color="#f00">**Answer:**</font>
From the matrix $A$, we are able to notice that the row parallelotope of matrix $A$ is composed of $3$ row vectors, $(1, 1, 1), (1, 2, 3), (0, 0, 0)$. Since one of the row vector is $(0, 0, 0)$, we can know that this matrix is not invertible and the row parallelotope collapse(※ basically, it is a parallelogram).
Therefore,
$$
\Vol_R(A) = 0.
$$
※_i.e._ the signed volumn of $A$ is $0$.
:::success
Excellent.
Note: You should use _i.e._ to make the text italic, instead of $i.e.$
:::
---
##### Exercise 2(d)
$$
A = \begin{bmatrix}
1 & 1 & 0 \\
1 & 2 & 0 \\
1 & 3 & 0
\end{bmatrix}.
$$
##### <font color="#f00">**Answer:**</font>
From the matrix $A$, we are able to notice that the row parallelotope of matrix $A$ is composed of $3$ row vectors, $(1, 1, 0), (1, 2, 0), (1, 3, 0)$. By doing some row operation,
(i)$\space$$\space$ $\rho_2: - \rho_1$
(ii)$\space$ $\rho_3: - \rho_1$
(iii) $\rho_1: - \rho_2$
(iv)$\space$ $\rho_1: - 2 \rho_2$
we will get a matrix $B$,
$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 0
\end{bmatrix}.$
Then, by the same reason of 2(c), the signed volumn of $A$ is $0$ and the parallelotope is flat.
:::success
Good.
In fact, the reason could be a bit different from 2(c).
2(c): One side of the parallelepiped has length $0$.
2(d): The parallelepiped is collaped on the $x,y$-plane.
:::
---
##### Exercise 2(e)
$$
A = \begin{bmatrix}
1 & 2 & 0 \\
3 & 4 & 0 \\
0 & 0 & 5
\end{bmatrix}.
$$
##### <font color="#f00">**Answer:**</font>
From the matrix $A$, we are able to notice that the row parallelotope of matrix $A$ is composed of $3$ row vectors, $(1, 2, 0), (3, 4, 0), (0, 0, 5)$. By doing some row operation,
(i)$\space$$\space$ $\rho_2: -3 \rho_1$
(ii)$\space$ $\rho_1: + \rho_2$
we will get a matrix $B$,
$\begin{bmatrix}
1 & 0 & 0 \\
0 & - 2 & 0 \\
0 & 0 & 5
\end{bmatrix}.$
By rule 3, the rule of slant,
$\Vol_R(A)=
\Vol_R(B)=
\det(B)=
1\times
-2\times
5 = -10.$
:::success
Good.
:::
---
##### Exercise 3
在 $\Vol_R$ 的定義中,假設我們已經接受了
- If $E$ is the elementary matrix of $\rho_i:\times k$, then $E$ **rescales** the $i$-th row of $A$.
- If $E$ is the elementary matrix of $\rho_i:+k\rho_j$, then $E$ **slants** the $i$-th row of $A$ to the direction of $j$-th row.
說明為什麼
- If $E$ is the elementary matrix of $\rho_i\leftrightarrow\rho_j$, then $E$ **swaps** the $i$-th and $j$-th rows of $A$.
中的 $-1$ 是合理的。
<!-- eng start -->
In the definition of $\Vol_R$, suppose we already accept the following rules.
- If $E$ is the elementary matrix of $\rho_i:\times k$, then $E$ **rescales** the $i$-th row of $A$.
- If $E$ is the elementary matrix of $\rho_i:+k\rho_j$, then $E$ **slants** the $i$-th row of $A$ to the direction of $j$-th row.
Explain the $-1$ in the rule below is reasonable.
- If $E$ is the elementary matrix of $\rho_i\leftrightarrow\rho_j$, then $E$ **swaps** the $i$-th and $j$-th rows of $A$.
<!-- eng end -->
**[由鄭宗祐提供]**
##### <font color="#f00">**Answer:**</font>
Assume we have a matrix $A=\begin{bmatrix}1&0\\0&1\end{bmatrix}.$ And $\det(A)=1.$
If we change the rows of $A$, then we get a new matrix $B=\begin{bmatrix}0&1\\1&0\end{bmatrix}.$
And we can obtain $B$ from $A$ by doing some row operation:
$1.$ plus one times of second row to first row, we can get $\begin{bmatrix}1&1\\0&1\end{bmatrix},$ and by definition, the determinant will not change.
$2.$ minus one times of first row to second row, we can get $\begin{bmatrix}1&1\\-1&0\end{bmatrix},$ and by definition, the determinant will not change.
$3.$ plus one times of second row to first row, we can get $\begin{bmatrix}0&1\\-1&0\end{bmatrix},$ and by definition, the determinant will not change.
$4.$ multiply-1 to second row, we can get $B=\begin{bmatrix}0&1\\1&0\end{bmatrix},$ and by definition $\det(B)=-1\times 1=-1=-1\times\det(A).$
##### Exercise 4
利用 $\Vol_R$ 定義中的四條準則,說明以下性質。
<!-- eng start -->
Use the four rules in the definition of $\Vol_R$ to explain the following properties.
<!-- eng end -->
##### Exercise 4(a)
若 $A$ 中有一列為零向量,說明 $\Vol_R(A) = 0$。
<!-- eng start -->
If $A$ has a zero row, then $\Vol_R(A) = 0$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Let an arbitrary row in the matrix be a zero row. Then apply the row operation of $\rho_i:\times k$ on that row, and we will get a new matrix, $B.$
Since any number multiplied by $0$ equals $0,$ $A=B$.
And by the definition of $\Vol_R(A),$ we can know $\Vol_R(B)=k\Vol_R(A).$
Since $A=B,$ we can know $\Vol_R(A)=\Vol_R(B),$ then $\Vol_R(A)=\Vol_R(B)=k\Vol_R(A).$
We may choose a vakue $k \neq 1.$
Thus, we can know $\Vol_R(A)=0.$
:::warning
- [x] No space before a comma.
- [x] Let ... . Then ... .
- [x] Before the last sentence, add: We may choose a vakue $k \neq 1.$
:::
---
##### Exercise 4(b)
若 $A$ 中有兩列向量相等,說明 $\Vol_R(A) = 0$。
<!-- eng start -->
If $A$ has two rows in common, then $\Vol_R(A) = 0$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Let $2$ arbitrary row of $A$ be the same, then apply the row operation of $\rho_i:+k\rho_j,$ $k=-1.$
Then we will get a new matrix $B$, who has a zero row in the matrix, and by the fact of 4(a), we can know $\Vol_R(A)=0.$
:::success
Good.
:::
---
##### Exercise 4(c)
若 $A$ 中的列向量集合線性相依,說明 $\Vol_R(A) = 0$。
<!-- eng start -->
If some rows of $A$ form a linearly dependent set, then $\Vol_R(A) = 0$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
If some rows of $A$ are linearly dependent, then we can do some row operations to make at least one row turn into zero rows. The determinant of a matrix with some zero row is zero, so by rule 3 of the definition of $\Vol_R$, $\Vol_R(A) = 0$.
:::warning
- [x] to make some rows turn into zero rows --> to make at least one row turn into a zero row
:::
---
##### Exercise 5
令
$$
A = \begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}\\
\end{bmatrix}.
$$
<!-- eng start -->
Let
$$
A = \begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}\\
\end{bmatrix}.
$$
<!-- eng end -->
##### Exercise 5(a)
已知 $A$ 的列向量彼此互相垂直
且長度皆為 $1$。
以直觀的方式猜測 $\Vol_R(A)$。
真的計算看看你的猜測是否正確。
<!-- eng start -->
We know the rows of $A$ are mutually orthogonal and of length $1$. Guess what is $\Vol_R(A)$ by intuition. Then check if your intuition is correct by definition.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Since the three rows are orthogonal and their length are all equal to one.
By intution, I am convinced that $\Vol_R(A) = 1$, for all length of rows are $1$.
By doing lots of $\rho_i:+k\rho_j$, we get a new matrix, $B$,
$\begin{bmatrix}
\frac{1}{\sqrt{3}} & 0 & 0\\
0 & \frac{2}{\sqrt{2}} &0\\
0 & 0 & \frac{3}{\sqrt{6}}\\
\end{bmatrix}.$
By rule 3, the rule of slant,
$\Vol_R(A)=
\Vol_R(B)=
\det(B)=
\frac{1}{\sqrt{3}}\times
\frac{2}{\sqrt{2}}\times
\frac{3}{\sqrt{6}}=1.$
Thus, we know the intution is correct.
:::success
Exactly.
:::
---
##### Exercise 5(b)
將 $A$ 矩陣的
第一個列向量伸縮為原來的 $3$ 倍,
第二個列向量伸縮為原來的 $4$ 倍,
第三個列向量伸縮為原來的 $5$ 倍,
並得到 $B$ 矩陣。
以直觀的方式猜測 $\Vol_R(B)$。
真的計算看看你的猜測是否正確。
<!-- eng start -->
Construct a new matrix $B$ from $A$ by rescaling the first row by $3$, the second row by $4$, and the third row by $5$. Guess what is $\Vol_R(A)$ by intuition. Then check if your intuition is correct by definition.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
By intution, I suppose the volume would be $1\times3\times4\times5=60.$
By doing lots of $\rho_i:\times k$ and $\rho_i:+k\rho_j,$ we get a new matrix $B$,
$\begin{bmatrix}
\frac{3}{\sqrt{3}}& 0 & 0\\
0 &\frac{8}{\sqrt{2}}& 0\\
0 & 0 & \frac{15}{\sqrt{6}}\\
\end{bmatrix}.$
By rule 2 and 3, the rule of rescaling and slant,
$\Vol_R(B)=
\det(B)=
\frac{3}{\sqrt{3}}\times
\frac{8}{\sqrt{2}}\times
\frac{15}{\sqrt{6}}=60.$
Thus, we know the intution is correct.
:::success
Good.
:::
---
##### Exercise 6
令 $\bx$、$\by$、及 $\bz$ 為 $\mathbb{R}^3$ 中的向量。
令 $V_1$ 為 $\bx, \by, \bz$ 所張出來的平行六面體,
而 $V_2$ 為 $\bx + \by, \by + \bz, \bz + \bx$ 所張出來的平行六面體。
問 $V_2$ 的有向體積是 $V_1$ 的有向體積的幾倍?
<!-- eng start -->
Let $\bx$, $\by$, and $\bz$ be vectors in $\mathbb{R}^3$. Let $V_1$ be the parallelotope spanned by $\bx, \by, \bz$. Let $V_2$ be the parallelotope spanned by $\bx + \by, \by + \bz, \bz + \bx$. What is the ratio between the volumn of $V_2$ and the volumn of $V_1$?
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Let $A = \begin{bmatrix}
-&\bx& -\\
-&\by&-\\
-&\bz&-\\
\end{bmatrix},\space$
$B =\begin{bmatrix}
-&\bx+\by& -\\
-&\by+\bz&-\\
-&\bz+\bx&-\\
\end{bmatrix}.$
Then, from $A$, by doing some row operations,
(i)$\space$$\space$ $\rho_1: + \rho_2$
(ii)$\space$ $\rho_2: + \rho_3$
(iii) $\rho_3: \times2$
(iv)$\space$ $\rho_3: + \rho_1$
(v)$\space$$\space$ $\rho_3: - \rho_2$
we get $B$.
Therefore, by definition, we know that
$\frac{\Vol_R(B)}{\Vol_R(A)}=\frac{2}{1}.$
:::success
Beautiful answer!
:::
:::info
collaboration: 1
4 problems: 4
* 2a ~ d
extra: 3.5
* 2e, 4a ~ c, 5a~b, 6
moderator: 1
qc: 1
:::