Basis
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.
$\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}}$
from lingeo import random_good_matrix
Let $V$ be a subspace in $\mathbb{R}^n$ and $S$ a set of vectors.
The set $S$ is a spanning set of $V$ if $V = \vspan(S)$.
The set $S$ is a basis of $V$ if
In other words, $S$ is a basis of $V$ if every vector in $V$ can be written as a linear combination of $S$ and the representation is unique.
Let $\mathcal{E}_n = \{ \be_1, \ldots, \be_n \}$ be the columns of $I_n$.
Then $\beta$ is a basis of $\mathbb{R}^n$.
We call $\mathcal{E}_n$ as the standard basis of $\mathbb{R}^n$.
Let $S$ and $T$ be two sets of vectors in $\mathbb{R}^n$.
If $T\subseteq\vspan(S)$, then $\vspan(T)\subseteq\vspan(S)$.
Suppose the sets $S$ and $T$ are finite.
Let $A_S$ and $A_T$ be the matrices whose columns are vectors in $S$ and in $T$, respectively.
Let $\left[\begin{array}{c|c} R_S & R_T \end{array}\right]$ be the reduced echelon form of $\left[\begin{array}{c|c} A_S & A_T \end{array}\right]$.
Then the following are equivalent:
Let $A$ be an $m\times n$ matrix.
Then the set of columns of $A$ is a basis of $\Col(A)$ if $\ker(A) = \{\bzero\}$.
In particular, if $m = n$ and $A$ is invertible, then the set of columns of $A$ is a basis of $\mathbb{R}^n$.
執行下方程式碼。
令 $S$ 和 $T$ 為 $A_S$ 和 $A_T$ 的各行向量。
已知 $\left[\begin{array}{c|c} A_S & A_T \end{array}\right]$ 的最簡階梯形式矩陣為 $\left[\begin{array}{c|c} R_S & R_T \end{array}\right]$﹐
而 $\left[\begin{array}{c|c} A_T & A_S \end{array}\right]$ 的最簡階梯形式矩陣為 $\left[\begin{array}{c|c} Q_T & Q_S \end{array}\right]$。
Run the code below. Let $S$ and $T$ be the columns of $A_S$ and $A_T$. Suppose $\left[\begin{array}{c|c} R_S & R_T \end{array}\right]$ is the reduced echelon form of $\left[\begin{array}{c|c} A_S & A_T \end{array}\right]$, while $\left[\begin{array}{c|c} Q_T & Q_S \end{array}\right]$ is the reduced echelon form of $\left[\begin{array}{c|c} A_T & A_S \end{array}\right]$.
### code
set_random_seed(0)
print_ans = False
m,n,r = 5,4,4
A = random_good_matrix(m,n,r)
ES = random_good_matrix(3,3,3)
ET = random_good_matrix(3,3,3)
SinT = choice([True, False])
TinS = choice([True, False])
if SinT and TinS:
AS,AT = A[:,:3],A[:,:3]
if SinT and not TinS:
AS,AT = A[:,[0,1,1]],A[:,:3]
if not SinT and TinS:
AS,AT = A[:,:3],A[:,[0,1,1]]
if not SinT and not TinS:
AS,AT = A[:,:3],A[:,1:]
AS = AS * ES
AT = AT * ET
ST = AS.augment(AT, subdivide=True)
RST = ST.rref()
TS = AT.augment(AS, subdivide=True)
QTS = TS.rref()
print("[ A_S | A_T ] =")
show(ST)
print("[ R_S | R_T ] =")
show(RST)
print("[ Q_T | Q_S ] =")
show(QTS)
if print_ans:
print("span(S) in span(T)?", SinT)
print("span(T) in span(S)?", TinS)
執行以下程式碼。
其中 $R$ 是 $A$ 的最簡階梯形式矩陣。
說明 $A$ 的行向量所成的集合
是 $A$ 的行空間的基底。
Run the code below. Suppose $R$ is the reduced echelon form of $A$. Explain why the columns of $A$ form a basis of the column space of $A$.
### code
set_random_seed(0)
# print_ans = False
m,n,r = 5,3,3
A = random_good_matrix(m,n,r)
print("A =")
show(A)
R = A.rref()
print("R =")
show(R)
執行以下程式碼。
其中 $R$ 是 $A$ 的最簡階梯形式矩陣。
說明 $A$ 的行向量所成的集合
是 $\mathbb{R}^4$ 的基底。
Run the code below. Suppose $R$ is the reduced echelon form of $A$. Explain why the columns of $A$ form a basis of $\mathbb{R}^4$.
### code
set_random_seed(0)
# print_ans = False
m,n,r = 4,4,4
A = random_good_matrix(m,n,r)
print("A =")
show(A)
R = A.rref()
print("R =")
show(R)
令
$$ \beta = \left\{ \begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ -1 \end{bmatrix} \right\} $$且
$$ V = \{ \bx\in\mathbb{R}^3 : \inp{\bone}{\bx} = 0 \}. $$其中 $\bone$ 是 $\mathbb{R}^3$ 中的全 $1$ 向量。
證明 $\beta$ 是 $V$ 的一組基底。
Let
$$ \beta = \left\{ \begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ -1 \end{bmatrix} \right\} $$and
$$ V = \{ \bx\in\mathbb{R}^3 : \inp{\bone}{\bx} = 0 \}. $$Here $\bone$ is the all-ones vector in $\mathbb{R}^3$. Show that $\beta$ is a basis of $V$.
以下的例子說明了多項式也有類似地基底的性質:
每一個多項式都可以被某些多項式組合出來、
而且「表示法唯一」。
The following examples demonstrate that polynomials have the similar behavior as the basis: Every polynomial can represented as the linear combination of some polynomials, and the representation is unique.
證明每一個二次多項式 $f(x)$ 都可以寫成 $c_0 + c_1(x-1) + c_2(x-1)^2$ 的樣子﹐
而且 $c_0,c_1,c_2$ 的選擇唯一。
Show that every polynomial $f(x)$ of degree at most $2$ can be written as $c_0 + c_1(x-1) + c_2(x-1)^2$, and the choice of $c_0, c_1, c_2$ is unqiue.
令
$$ \begin{aligned} f_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ f_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ f_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$證明每一個二次多項式 $f(x)$ 都可以寫成 $c_1f_1(x) + c_2f_2(x) + c_3f_3(x)$ 的樣子﹐
而且 $c_1,c_2,c_3$ 的選擇唯一。
Let
$$ \begin{aligned} f_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ f_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ f_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$Show that every polynomial $f(x)$ of degree at most $2$ can be written as $c_1f_1(x) + c_2f_2(x) + c_3f_3(x)$, and the choice of $c_1, c_2, c_3$ is unqiue.
執行以下程式碼。
其中 $B$ 為 $A$ 的反矩陣。
令 $S = \{\bu_1,\bu_2,\bu_3\}$ 為 $A$ 的各行向量。
因為 $A$ 可逆﹐所以 $S$ 為 $\mathbb{R}^3$ 的一組基底。
也就是說﹐每一個 $\mathbb{R}^3$ 中的向量都可以用 $S$ 中的向量組合出來﹐而且組合方法唯一。
Run the code below. Let $B$ be the inverse of $A$ and $S = \{\bu_1,\bu_2,\bu_3\}$ the columns of $A$. Since $A$ is invertible, so $S$ is a basis of $\mathbb{R}^3$. That is, every vector in $\mathbb{R}^3$ can be written as a linear combination of $S$, and the representation is unique.
### code
set_random_seed(0)
A = random_good_matrix(3,3,3)
B = A.inverse()
print("A =")
show(A)
print("B =")
show(B)
令 $\be_1,\be_2,\be_3$ 分別為 $I_3$ 的三個行向量。
對每一個 $i = 1,2,3$﹐求出 $\be_i$ 寫成 $S$ 的線性組合的表示法。
Let $\be_1, \be_2, \be_3$ be the columns of $I_3$. For each $i = 1, 2, 3$, write $\be_i$ as a linear combination of $S$.
令 $\bb = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}$。
求出 $\bb$ 寫成 $S$ 的線性組合的表示法。
Let $\bb = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}$. Write $\bb$ as a linear combination of $S$.