Common vector spaces
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 vtop, vtom
Let $\mathcal{P}_d$ be the set of all polynomials of degree at most $d$ (with real coefficients).
Let $+$ and $\cdot$ be the regular polynomial addition and scalr multiplication, respectively.
Then $(\mathcal{P}_d, +, \cdot)$ is a vector space, usually denoted as just $\mathcal{P}_d$.
It is known that $\beta = \{1, x, \ldots, x^d\}$ is a basis of $\mathcal{P}_d$, so $\dim(\mathcal{P}_d) = d + 1$.
The zero vector in $\mathcal{P}_d$ is $0 = 0 + 0x + \cdots + 0x^d$.
We usually call $\beta$ the standard basis of $\mathcal{P}_d$.
It is easy to see that essentially every polynomial stores $d+1$ coefficients, and its behavior is very similar to a vector in $\mathbb{R}^{d+1}$.
When $p = a_0 + a_1x + \cdots + a_dx^d$, we define $\operatorname{ptov}(p) = (a_0,\ldots,a_d)$.
Let $\mathcal{M}_{m,n}$ be the set of all $m\times n$ matrices (over $\mathbb{R}$).
Let $+$ and $\cdot$ be the regular matrix addition and scalr multiplication, respectively.
Then $(\mathcal{M}_{m,n}, +, \cdot)$ is a vector space, usually denoted as just $\mathcal{M}_{m,n}$.
Let $E_{ij}$ be the matrix whose $ij$-entry is $1$ while other entries are $0$.
It is known that $\beta = \{E_{11}, \ldots, E_{1n}, \ldots, E_{m1}, \ldots1, E_{mn}\}$ is a basis of $\mathcal{M}_{m,n}$, so $\dim(\mathcal{M}_{m,n}) = mn$.
The zero vector in $\mathcal{M}_{m,n}$ is $O_{m,n}$, the $m\times n$ zero matrix.
We usually call $\beta$ the standard basis of $\mathcal{M}_{m,n}$.
Again, every $m\times n$ matrix stores $mn$ coefficients, and behaves almost the same as a vector in $\mathbb{R}^{mn}$.
When $M = \begin{bmatrix} a_{ij} \end{bmatrix}$, we define $\operatorname{mtov}(M) = (a_{11},\ldots,a_{1n},\ldots,a_{m1},\ldots,a_{mn})$.
### code
set_random_seed(0)
print_ans = False
m,n = 4,3
A = matrix(m, random_int_list(m*n))
v = vector(random_int_list(n))
b = A * v
print("A =")
show(A)
print("v = (c1, c2, c3) =", v)
print("b =", b)
print("p1 =", vtop(A.transpose()[0]))
print("p2 =", vtop(A.transpose()[1]))
print("p3 =", vtop(A.transpose()[2]))
print("M1, M2, M3 =")
pretty_print(vtom(A.transpose()[0],2,2), ", ",
vtom(A.transpose()[1],2,2), ", ",
vtom(A.transpose()[2],2,2)
)
if print_ans:
print("c1p1 + c2p2 + c3p3 =", vtop(b))
print("c1M1 + c2M2 + c3M3 =")
show(vtom(b,2,2))
令 $U$ 為 $\mathcal{P}_3$ 中所有 $p_1 = (x+1)(x+2)$ 的倍式、
$V$ 為 $\mathcal{P}_3$ 中所有 $p_2 = (x+1)(x+3)$ 的倍式。
Let $U$ be the subset of $\mathcal{P}_3$ consisting of all polynomials that is a multiple of $p_1 = (x+1)(x+2)$. Let $V$ be the subset of $\mathcal{P}_3$ consisting of all polynomials that is a multiple of $p_2 = (x+1)(x+3)$.
說明 $U$ 和 $V$ 都是 $\mathcal{P}_3$ 的子空間、
並判斷它們的維度。
Show that both $U$ and $V$ are subspaces of $\mathcal{P}_3$ and determine their dimensions.
令 $A$ 為一個 $4\times 2$ 矩陣其各行向量為 $\operatorname{ptov}(p_1)$ 和 $\operatorname{ptov}(xp_1)$、
$B$ 為一個 $4\times 2$ 矩陣其各行向量為 $\operatorname{ptov}(p_2)$ 和 $\operatorname{ptov}(xp_2)$。
令 $\bb = (1,1,0,0)$。
求 $\begin{bmatrix} A & B \end{bmatrix}\bx = \bb$ 中 $\bx$ 的一個解﹐
並找到兩個一次以下的多項式 $a$ 和 $b$
使得 $ap_1 + bp_2 = 1 + x$。
Let $A$ be the $4\times 2$ matrix whose columns are $\operatorname{ptov}(p_1)$ and $\operatorname{ptov}(xp_1)$. Let $B$ be the $4\times 2$ matrix whose columns are $\operatorname{ptov}(p_2)$ and $\operatorname{ptov}(xp_2)$. Let $\bb = (1,1,0,0)$. Find a solution of $\bx$ to $\begin{bmatrix} A & B \end{bmatrix}\bx = \bb$ and use it two find two polynomials $a$ and $b$ in $\mathcal{P}_1$ such that $ap_1 + bp_2 = 1 + x$.
找出一個 $\mathcal{P}_3$ 中的多項式 $q$
使得它無法利用 $a,b\in\mathcal{P}_1$ 寫成 $q = ap_1 + bp_2$ 的形式。
Find a polynomial $q\in\mathcal{P}_3$ such that it cannot be written as $q = ap_1 + bq_2$ for some $a, b\in\mathcal{P}_1$.
令 $A$ 為 $3\times 3$ 的全 $1$ 矩陣。
令
Let $A$ be a $3\times 3$ all-ones matrix. Let
$$ V = \{ X\in\mathcal{M}_{3,3} : AX = O \}. $$說明 $V$ 是 $\mathcal{M}_{3,3}$ 的子空間、
並判斷它的維度。
Show that $V$ is a subspace of $\mathcal{M}_{3,3}$ and determine its dimension.
把 $X$ 寫成
$$ X = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}. $$找出一個 $9\times 9$ 的矩陣 $\Psi$
使得 $AX = O$ is equivalent to $\Psi\operatorname{mtov}(X) = \bzero$。
Write $X$ as
$$ X = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}. $$Find a $9\times 9$ matrix $\Psi$ such that $AX = O$ is equivalent to $\Psi\operatorname{mtov}(X) = \bzero$.
令 $V = \{ A \in \mathcal{M}_{n,n} : A\trans = A \}$
為所有對稱矩陣所形成的集合。
驗證 $V$ 為 $\mathcal{M}_{n,n}$ 的一個子空間、
並求出它的維度。
Let $V = \{ A \in \mathcal{M}_{n,n} : A\trans = A \}$ be the set of all symmetric matrices. Show that $V$ is a subspace of $\mathcal{M}_{n,n}$ and determine its dimension.
令 $V = \{ A \in \mathcal{M}_{n,n} : A\trans = -A \}$
為所有反對稱矩陣所形成的集合。
驗證 $V$ 為 $\mathcal{M}_{n,n}$ 的一個子空間、
並求出它的維度。
Let $V = \{ A \in \mathcal{M}_{n,n} : A\trans = -A \}$ be the set of all skew-symmetric matrices. Show that $V$ is a subspace of $\mathcal{M}_{n,n}$ and determine its dimension.
考慮向量空間 $\mathcal{P}_4$。
令
Consider the vector space $\mathcal{P}_4$ and let
$$ D = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 3 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix}. $$令 $p$ 為 $\mathcal{P}_4$ 中的一個多項式
而 $p'$ 為其微分。
驗證 $\operatorname{ptov}(p') = D\operatorname{ptov}(p)$。
Let $p$ be a polynomial in $\mathcal{P}_4$ and $p'$ its derivative. Show that $\operatorname{ptov}(p') = D\operatorname{ptov}(p)$.
求 $\mathcal{P}_4$ 中所有 $p' = 0$ 的 $p$。
Find all $p\in\mathcal{P}_4$ such that $p' = 0$.
求 $\mathcal{P}_4$ 中所有 $p' = x$ 的 $p$。
Find all $p\in\mathcal{P}_4$ such that $p' = x$.