Vector representation in a vector space
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_int_list
from linspace import ptov, vtop
Let $V$ be a vector space.
Let $\beta = \{ \bu_1, \ldots, \bu_n \}$ be a basis of $V$.
Every vector $\bv\in V$ has a unique way to be written as a linear combination
$$\bv = c_1\bu_1 + \cdots + c_n\bu_n.$$
We call the vector $(c_1,\ldots, c_n)\in\mathbb{R}^n$ the vector representation of $\bv$ with respect to the basis $\beta$, denoted as $[\bv]_\beta$.
Let $\mathcal{P}_d$ be the vector space of all polynomials of degree at most $d$.
Let $\beta = \{1, x, \ldots, x^d\}$ be the standard basis of $\mathcal{P}_d$.
Then $[p]_\beta = \operatorname{ptov}(p)$ is simply writing down the coefficients of $p$ into a vector in $\mathbb{R}^{d+1}$.
Let $\mathcal{M}_{m.n}$ be the vector space of all $m\times n$ matrices.
Let $\beta = \{E_{11}, \ldots, E_{1n}, \ldots, E_{m1}, \ldots, E_{mn}\}$ be the standard basis of $\mathcal{M}_{m,n}$.
Then $[A]_\beta = \operatorname{mtov}(A)$ is simply writing down the entries of $A$ into a vector in $\mathbb{R}^{mn}$ in the row-major order.
執行以下程式碼。
令 $\mathcal{P}_2$ 為所有次數小於等於 $2$ 的多項式所形成的向量空間。
令 $\alpha = \{1, x, x^2\}$ 為 $\mathcal{P}_2$ 的標準基底。
令 $\beta = \{1, (1+x), (1+x)^2\}$ 為 $\mathcal{P}_2$ 的另一組基底。
Run the code below. Let $\mathcal{P}_2$ be the vector space of all polynomials of degree at most $2$. Let $\alpha = \{1, x, x^2\}$ be the standard basis of $\mathcal{P}_2$. Let $\beta = \{1, (1+x), (1+x)^2\}$ be another basis of $\mathcal{P}_2$.
### code
set_random_seed(0)
print_ans = False
d = 2
p1,p2,p3 = 1, 1+x, (1+x)^2
p = vtop(vector(random_int_list(d+1)))
print("p =", p)
if print_ans:
A = matrix([ptov(p1, d), ptov(p2, d), ptov(p3, d)]).transpose()
p_alpha = ptov(p, d)
p_beta = A.inverse() * p_alpha
print("[p]_alpha =", ptov(p, d))
print("[p]_beta =", p_beta)
print("A =")
show(A)
令 $p_1, \ldots, p_3$ 為 $\beta$ 中的各多項式。
寫出 $3\times 3$ 矩陣 $A$
其各行向量為 $[p_1]_\alpha, \ldots, [p_3]_\alpha$。
Let $p_1, \ldots, p_3$ be the polynomials in $\beta$. Find the $3\times 3$ matrix $A$ whose columns are $[p_1]_\alpha, \ldots, [p_3]_\alpha$.
令 $\mathcal{P}_2$ 為所有次數小於等於 $2$ 的多項式所形成的向量空間。
令 $p = 2 + 3x + 4x^2$。
Let $\mathcal{P}_2$ be the vector space of all polynomials of degree at most $2$. Let $p = 2 + 3x + 4x^2$.
令 $\beta = \{1,x,x^2\}$ 為 $\mathcal{P}_2$ 的一組基底。
求 $[p]_\beta$。
Let $\beta = \{1,x,x^2\}$ be a basis of $\mathcal{P}_2$. Find $[p]_\beta$.
令 $\beta = \{1,(1-x),(1-x)^2\}$ 為 $\mathcal{P}_2$ 的一組基底。
求 $[p]_\beta$。
Let $\beta = \{1,(1-x),(1-x)^2\}$ be a basis of $\mathcal{P}_2$. Find $[p]_\beta$.
令 $\beta = \{1,x,x(x-1)\}$ 為 $\mathcal{P}_2$ 的一組基底。
求 $[p]_\beta$。
Let $\beta = \{1,x,x(x-1)\}$ be a basis of $\mathcal{P}_2$. Find $[p]_\beta$.
令
$$ \begin{aligned} p_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ p_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ p_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$令 $\beta = \{p_1, p_2, p_3\}$ 為 $\mathcal{P}_2$ 的一組基底。
求 $[p]_\beta$。
Let
$$ \begin{aligned} p_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ p_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ p_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$Let $\beta = \{p_1, p_2, p_3\}$ be a basis of $\mathcal{P}_2$. Find $[p]_\beta$.
令 $\mathcal{M}_{2,3}$ 為所有 $2\times 3$ 矩陣所形成的向量空間。
令
Let $\mathcal{M}_{2,3}$ be the vector space of all $2\times 3$ matrices.
Let
$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ \end{bmatrix}. $$令 $\beta = \{E_{11}, E_{12}, E_{13}, E_{21}, E_{22}, E_{23}\}$ 為 $\mathcal{M}_{2,3}$ 的標準基底。
求 $[A]_\beta$。
Let $\beta = \{E_{11}, E_{12}, E_{13}, E_{21}, E_{22}, E_{23}\}$ be the standard basis of $\mathcal{M}_{2,3}$. Find $[A]_\beta$.
令
$$ M_1 = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_2 = \begin{bmatrix} 0 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_3 = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, $$$$ M_4 = \begin{bmatrix} 0 & 0 & 0 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_5 = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 1 \\ \end{bmatrix}, M_6 = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}. $$令 $\beta = \{M_1, M_2, M_3, M_4, M_5, M_6\}$ 為 $\mathcal{M}_{2,3}$ 的一組基底。
求 $[A]_\beta$。
Let
$$ M_1 = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_2 = \begin{bmatrix} 0 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_3 = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}, $$$$ M_4 = \begin{bmatrix} 0 & 0 & 0 \\ 1 & 1 & 1 \\ \end{bmatrix}, M_5 = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 1 \\ \end{bmatrix}, M_6 = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}. $$Let $\beta = \{M_1, M_2, M_3, M_4, M_5, M_6\}$ be a basis of $\mathcal{M}_{2,3}$. Find $[A]_\beta$.
以下例子說明一些向量空間的內積
其實就是某個表示法下的 $\mathbb{R}^n$ 標準內積。
(實際上所有有限維度空間中的內積
都可以寫成某個表示法下的 $\mathbb{R}^n$ 標準內積。
但證明須要用到一些對角化的工具。)
In the following examples, we will see that some inner product of abstract vectors can be written as the standard inner product of their vector representations in $\mathbb{R}^n$. Indeed, any inner product on a finite-dimentional vector space can be written as the standard inner product of vector representations in $\mathbb{R}^n$.
令 $\mathcal{M}_{m,n}$ 為所有 $m\times n$ 矩陣所形成的向量空間。
我們曾經驗證過 $\inp{A}{B} = \tr(B\trans A)$ 是一種合法的內積。
說明其實 $\tr(B\trans A) = \inp{[A]_\beta}{[B]_\beta}$,
其中 $\beta$ 是 $\mathcal{M}_{m,n}$ 的標準基底。
Let $\mathcal{M}_{m,n}$ be the vector space of all $m\times n$ matrices. In 213-5, We have verified that $\inp{A}{B} = \tr(B\trans A)$ is indeed an inner product.
Verify and give some intuition to $\tr(B\trans A) = \inp{[A]_\beta}{[B]_\beta}$, where $\beta$ is the standard basis of $\mathcal{M}_{m,n}$.
令 $\mathcal{P}_3$ 為所有次數小於等於 $3$ 的多項式所形成的向量空間。
我們曾經驗證過 $\inp{p_1}{p_2} = a_0b_0 + a_1b_1 + a_2b_2 + a_3b_3$ 是一種合法的內積,其中
說明其實 $\inp{p_1}{p_2} = \inp{[p_1]_\beta}{[p_2]_\beta}$,
其中 $\beta$ 是 $\mathcal{P}_3$ 的標準基底。
Let $\mathcal{P}_3$ be the vector space of all polynomials of degree at most $3$. In 213-5, We have verified that $\inp{p_1}{p_2} = a_0b_0 + a_1b_1 + a_2b_2 + a_3b_3$ is indeed an inner product, where
$$ \begin{aligned} p_1 &= a_0 + a_1x + a_2x^2 + a_3x^3, \\ p_2 &= b_0 + b_1x + b_2x^2 + b_3x^3. \\ \end{aligned} $$Verify and give some intuition to $\inp{p_1}{p_2} = \inp{[p_1]_\beta}{[p_2]_\beta}$, where $\beta$ is the standard basis of $\mathcal{P}_3$.
令 $\mathcal{P}_3$ 為所有次數小於等於 $3$ 的多項式所形成的向量空間。
我們曾經驗證過 $\inp{p_1}{p_2} = p_1(1)p_2(1) + p_1(2)p_2(2) + p_1(3)p_2(3) + p_1(4)p_2(4)$ 是一種合法的內積。
令
說明其實 $\inp{p_1}{p_2} = \inp{[p_1]_\beta}{[p_2]_\beta}$,
其中 $\beta = \{f_1, f_2, f_3, f_4\}$ 是 $\mathcal{P}_3$ 的一組基底。
Let $\mathcal{P}_3$ be the vector space of all polynomials of degree at most $3$. In 213-5, We have verified that $\inp{p_1}{p_2} = p_1(1)p_2(1) + p_1(2)p_2(2) + p_1(3)p_2(3) + p_1(4)p_2(4)$ is indeed an inner product.
Let
$$ \begin{aligned} f_1(x) &= \frac{(x-2)(x-3)(x-4)}{(1-2)(1-3)(1-4)}, \\ f_2(x) &= \frac{(x-1)(x-3)(x-4)}{(2-1)(2-3)(2-4)}, \\ f_3(x) &= \frac{(x-1)(x-2)(x-4)}{(3-1)(3-2)(3-4)}, \\ f_4(x) &= \frac{(x-1)(x-2)(x-3)}{(4-1)(4-2)(4-3)}. \\ \end{aligned} $$Verify and give some intuition to $\inp{p_1}{p_2} = \inp{[p_1]_\beta}{[p_2]_\beta}$, where $\beta = \{f_1, f_2, f_3, f_4\}$ 是 $\mathcal{P}_3$ is the standard basis of $\mathcal{P}_3$.