Basic Definition
Norm : A measure of size (of vectors, matrices, etc.)
For vector, denote ∥ v ∥ \|v\| ∥ v ∥ as the norm of v v v
Can be defined in many ways
Vector Norm Definition
A vector norm (∥ ⋅ ∥ \|\cdot\| ∥ ⋅ ∥ ) is a function mapping R n \mathbb{R}^n R n to R \mathbb{R} R .
∥ ⋅ ∥ \|\cdot\| ∥ ⋅ ∥ is a norm if:
∥ x ∥ ≥ 0 \|x\| \geq 0 ∥ x ∥ ≥ 0 for all x ∈ R n x \in \mathbb{R}^n x ∈ R n . ∥ x ∥ = 0 \|x\| = 0 ∥ x ∥ = 0 if and only if x = 0 x = 0 x = 0 — ไม่ติดลบ + ศูนย์เฉพาะที่ศูนย์
If α \alpha α is a scalar: ∥ α x ∥ = ∣ α ∣ ⋅ ∥ x ∥ \|\alpha x\| = |\alpha| \cdot \|x\| ∥ α x ∥ = ∣ α ∣ ⋅ ∥ x ∥ — ยืด-หดตามสเกล
For all x , y ∈ R n x, y \in \mathbb{R}^n x , y ∈ R n : ∥ x + y ∥ ≤ ∥ x ∥ + ∥ y ∥ \|x + y\| \leq \|x\| + \|y\| ∥ x + y ∥ ≤ ∥ x ∥ + ∥ y ∥ ("triangular inequality") — อสมการสามเหลี่ยม
Commonly-used Vector Norms
1. 2-norm (Euclidean norm):
∥ x ∥ 2 = ∑ i = 1 n x i 2 = x T x \boxed{\|x\|_2 = \sqrt{\sum_{i=1}^n x_i^2} = \sqrt{x^T x}} ∥ x ∥ 2 = i = 1 ∑ n x i 2 = x T x
ตัวอย่าง: ( 3 , 4 ) (3,4) ( 3 , 4 ) → 3 2 + 4 2 = 5 \sqrt{3^2 + 4^2} = 5 3 2 + 4 2 = 5 (ระยะทางจริงในระนาบ)
Proof:
x T x = [ x 1 x 2 ⋯ x n ] ⋅ [ x 1 x 2 ⋮ x n ] = x 1 2 + x 2 2 + ⋯ + x n 2 = ∥ x ∥ 2 \sqrt{x^T x} = \sqrt{\begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \cdot \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}} = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2} = \|x\|_2 x T x = [ x 1 x 2 ⋯ x n ] ⋅ x 1 x 2 ⋮ x n = x 1 2 + x 2 2 + ⋯ + x n 2 = ∥ x ∥ 2
2. 1-norm:
∥ x ∥ 1 = ∑ i = 1 n ∣ x i ∣ \boxed{\|x\|_1 = \sum_{i=1}^n |x_i|} ∥ x ∥ 1 = i = 1 ∑ n ∣ x i ∣
ตัวอย่าง: ( 3 , 4 ) (3,4) ( 3 , 4 ) → ∣ 3 ∣ + ∣ 4 ∣ = 7 |3|+|4|=7 ∣3∣ + ∣4∣ = 7 (เหมือนเดิน 3 บล็อกไปขวา แล้ว 4 บล็อกขึ้น)
เหมือน เดินเป็นเส้นตรงแนวแกน
3. ∞-norm:
∥ x ∥ ∞ = max i = 1 n { ∣ x i ∣ } \boxed{\|x\|_\infty = \max_{i=1}^n \{|x_i|\}} ∥ x ∥ ∞ = i = 1 max n { ∣ x i ∣ }
ความหมาย: สนใจเฉพาะ “ตัวที่ใหญ่ที่สุด” ในเวกเตอร์
ใช้ใน worst-case analysis หรือเวลาสนใจ error ที่แย่ที่สุด
ตัวอย่าง: ( 3 , 4 ) (3,4) ( 3 , 4 ) → max ( 3 , 4 ) = 4 \max(3,4)=4 max ( 3 , 4 ) = 4
4. p-norm:
∥ x ∥ p = ( ∣ x 1 ∣ p + ∣ x 2 ∣ p + … + ∣ x n ∣ p ) 1 p , p ≥ 1 \boxed{\|x\|_p = \left(|x_1|^p + |x_2|^p + \ldots + |x_n|^p\right)^{\frac{1}{p}}, \quad p \geq 1} ∥ x ∥ p = ( ∣ x 1 ∣ p + ∣ x 2 ∣ p + … + ∣ x n ∣ p ) p 1 , p ≥ 1
The 1-, 2-, and ∞-norms are actually p-norms
เป็นการ “ปรับน้ำหนัก” ว่าเราจะให้ความสำคัญกับค่ามาก ๆ แค่ไหน
p p p เล็ก → ใส่ใจกับทุกค่าแบบพอ ๆ กัน
p p p ใหญ่ → เน้นค่าที่ใหญ่ ๆ มากขึ้นเรื่อย ๆ
p → ∞ p \to \infty p → ∞ → เหลือแต่ค่าที่ใหญ่ที่สุด (∞-norm)
Example 1
Let y = [ 1 − 2 0 4 ] y = \begin{bmatrix} 1 \\ -2 \\ 0 \\ 4 \end{bmatrix} y = 1 − 2 0 4 . Find ∥ y ∥ 2 \|y\|_2 ∥ y ∥ 2 , ∥ y ∥ 1 \|y\|_1 ∥ y ∥ 1 , and ∥ y ∥ ∞ \|y\|_\infty ∥ y ∥ ∞ .
Solution:
∥ y ∥ 2 = 1 2 + ( − 2 ) 2 + 0 2 + 4 2 = 1 + 4 + 0 + 16 = 21 \|y\|_2 = \sqrt{1^2 + (-2)^2 + 0^2 + 4^2} = \sqrt{1 + 4 + 0 + 16} = \sqrt{21} ∥ y ∥ 2 = 1 2 + ( − 2 ) 2 + 0 2 + 4 2 = 1 + 4 + 0 + 16 = 21
∥ y ∥ 1 = ∣ 1 ∣ + ∣ − 2 ∣ + ∣ 0 ∣ + ∣ 4 ∣ = 7 \|y\|_1 = |1| + |-2| + |0| + |4| = 7 ∥ y ∥ 1 = ∣1∣ + ∣ − 2∣ + ∣0∣ + ∣4∣ = 7
∥ y ∥ ∞ = max { ∣ 1 ∣ , ∣ − 2 ∣ , ∣ 0 ∣ , ∣ 4 ∣ } = 4 \|y\|_\infty = \max\{|1|, |-2|, |0|, |4|\} = 4 ∥ y ∥ ∞ = max { ∣1∣ , ∣ − 2∣ , ∣0∣ , ∣4∣ } = 4
Exercise 2
Let x = [ 3 − 4 ] x = \begin{bmatrix} 3 \\ -4 \end{bmatrix} x = [ 3 − 4 ] . Compute ∥ x ∥ 1 \|x\|_1 ∥ x ∥ 1 , ∥ x ∥ 2 \|x\|_2 ∥ x ∥ 2 , and ∥ x ∥ ∞ \|x\|_\infty ∥ x ∥ ∞ .
Solution:
∥ x ∥ 1 = ∣ 3 ∣ + ∣ − 4 ∣ = 7 \|x\|_1 = |3| + |-4| = 7 ∥ x ∥ 1 = ∣3∣ + ∣ − 4∣ = 7
∥ x ∥ 2 = 3 2 + ( − 4 ) 2 = 9 + 16 = 25 = 5 \|x\|_2 = \sqrt{3^2 + (-4)^2} = \sqrt{9 + 16} = \sqrt{25} = 5 ∥ x ∥ 2 = 3 2 + ( − 4 ) 2 = 9 + 16 = 25 = 5
∥ x ∥ ∞ = 4 \|x\|_\infty = 4 ∥ x ∥ ∞ = 4
Vector Norm in MATLAB
norm(x); % 2-norm
norm(x, 2 ); % 2-norm
norm(x, 1 ); % 1-norm
norm(x,p); % p-norm
norm(x, inf ); % Infinity-norm
Some Vector Norm Properties
∥ x ∥ 1 ≥ ∥ x ∥ 2 ≥ ∥ x ∥ ∞ \|x\|_1 \geq \|x\|_2 \geq \|x\|_\infty ∥ x ∥ 1 ≥ ∥ x ∥ 2 ≥ ∥ x ∥ ∞
บอกว่า ขนาดที่ได้จาก norm แต่ละแบบ มีลำดับแน่นอน
ทำให้เราสามารถ ประมาณกันได้ เช่น ถ้าเรารู้ ∣ x ∣ ∞ |x|_\infty ∣ x ∣ ∞ อยู่ในกรอบ ก็รู้เลยว่า ∣ x ∣ 2 |x|_2 ∣ x ∣ 2 และ ∣ x ∣ 1 |x|_1 ∣ x ∣ 1 ก็ต้องไม่ต่ำกว่านี้
Hölder inequality:
∣ x T y ∣ ≤ ∥ x ∥ p ∥ y ∥ q , 1 p + 1 q = 1 \left|x^T y\right| \leq \|x\|_p \|y\|_q, \quad \frac{1}{p} + \frac{1}{q} = 1 x T y ≤ ∥ x ∥ p ∥ y ∥ q , p 1 + q 1 = 1
คิดง่าย ๆ ว่า ถ้า x x x ใหญ่มาก และ y y y ใหญ่มาก การคูณรวมกันก็จะ “ไม่เกินกว่า” ผลคูณของความใหญ่ตาม norm ที่เลือก
"Cauchy-Schwarz inequality":
∣ x T y ∣ ≤ ∥ x ∥ 2 ∥ y ∥ 2 \left|x^T y\right| \leq \|x\|_2 \|y\|_2 x T y ≤ ∥ x ∥ 2 ∥ y ∥ 2
dot product ของสองเวกเตอร์ ไม่เคยใหญ่เกินกว่าผลคูณของความยาวจริง ๆ
Orthogonal Matrix Property
Suppose Q ∈ R n × n Q \in \mathbb{R}^{n \times n} Q ∈ R n × n is an orthogonal matrix (which means Q T Q = Q Q T = I Q^T Q = QQ^T = I Q T Q = Q Q T = I by definition).
∥ Q x ∥ 2 = ∥ x ∥ 2 \boxed{\|Qx\|_2 = \|x\|_2} ∥ Q x ∥ 2 = ∥ x ∥ 2
Proof:
Recall ∥ y ∥ 2 = y T y \|y\|_2 = \sqrt{y^T y} ∥ y ∥ 2 = y T y .
∥ Q x ∥ 2 = ( Q x ) T Q x = x T Q T Q x = x T x = ∥ x ∥ 2 \|Qx\|_2 = \sqrt{(Qx)^T Qx} = \sqrt{x^T Q^T Qx} = \sqrt{x^T x} = \|x\|_2 ∥ Q x ∥ 2 = ( Q x ) T Q x = x T Q T Q x = x T x = ∥ x ∥ 2
Theorem (The Equivalence of Norms)
For any two norms ∥ ⋅ ∥ a \|\cdot\|_a ∥ ⋅ ∥ a and ∥ ⋅ ∥ b \|\cdot\|_b ∥ ⋅ ∥ b , there exists a pair of real numbers 0 < C 1 ≤ C 2 0 < C_1 \leq C_2 0 < C 1 ≤ C 2 such that, for all x x x :
C 1 ∥ x ∥ b ≤ ∥ x ∥ a ≤ C 2 ∥ x ∥ b \boxed{C_1 \|x\|_b \leq \|x\|_a \leq C_2 \|x\|_b} C 1 ∥ x ∥ b ≤ ∥ x ∥ a ≤ C 2 ∥ x ∥ b
Interpretation: If a vector x x x is small under one norm, it is small under any other norm.
Matrix Norm
Define on matrix A ∈ R m × n A \in \mathbb{R}^{m \times n} A ∈ R m × n
Same three properties of norms must hold for matrix norms (อยู่ข้างบนแล้วเด้อ)
The equivalence of norms also applies to matrix norms
Matrix Norm คือ การวัดว่าเมทริกซ์นี้ทำให้เวกเตอร์ใหญ่ขึ้นได้มากสุดแค่ไหน
Useful Matrix Norms
A ∈ R m × n A \in \mathbb{R}^{m \times n} A ∈ R m × n
1. Frobenius norm:
∥ A ∥ F = ( ∑ i = 1 m ∑ j = 1 n a i j 2 ) 1 2 \boxed{\|A\|_F = \left(\sum_{i=1}^m \sum_{j=1}^n a_{ij}^2\right)^{\frac{1}{2}}} ∥ A ∥ F = ( i = 1 ∑ m j = 1 ∑ n a ij 2 ) 2 1
สูตร: เอาทุกตัวในเมทริกซ์มายกกำลังสอง บวกกันหมด แล้วรูท
ความหมาย: วัดเหมือนว่าเอา entries ทั้งหมดมาต่อเป็นเวกเตอร์ยาว ๆ แล้ววัด 2-norm
2. Induced p-norms:
∥ A ∥ p = max x ≠ 0 ∥ A x ∥ p ∥ x ∥ p = max ∥ x ∥ p = 1 ∥ A x ∥ p \boxed{\|A\|_p = \max_{x \neq 0} \frac{\|Ax\|_p}{\|x\|_p} = \max_{\|x\|_p = 1} \|Ax\|_p} ∥ A ∥ p = x = 0 max ∥ x ∥ p ∥ A x ∥ p = ∥ x ∥ p = 1 max ∥ A x ∥ p
Following from the definition of p-norm:
1-norm (Maximum absolute column sum):
คิดว่า "คอลัมน์ไหนรวมค่ามากที่สุด"
∥ A ∥ 1 = max j = 1 , … , n ∑ i = 1 m ∣ a i j ∣ \boxed{\|A\|_1 = \max_{j=1,\ldots,n} \sum_{i=1}^m |a_{ij}|} ∥ A ∥ 1 = j = 1 , … , n max i = 1 ∑ m ∣ a ij ∣
∞-norm (Maximum absolute row sum):
คิดว่า "แถวไหนรวมค่ามากที่สุด"
∥ A ∥ ∞ = max i = 1 , … , m ∑ j = 1 n ∣ a i j ∣ \boxed{\|A\|_\infty = \max_{i=1,\ldots,m} \sum_{j=1}^n |a_{ij}|} ∥ A ∥ ∞ = i = 1 , … , m max j = 1 ∑ n ∣ a ij ∣
2-norm: (Will see later)
Example 3
Let B = [ − 2 0 2 3 ] B = \begin{bmatrix} -2 & 0 \\ 2 & 3 \end{bmatrix} B = [ − 2 2 0 3 ] . Find ∥ B ∥ F \|B\|_F ∥ B ∥ F , ∥ B ∥ 1 \|B\|_1 ∥ B ∥ 1 , and ∥ B ∥ ∞ \|B\|_\infty ∥ B ∥ ∞ .
Solution:
∥ B ∥ F = ( − 2 ) 2 + 0 2 + 2 2 + 3 2 = 17 \|B\|_F = \sqrt{(-2)^2 + 0^2 + 2^2 + 3^2} = \sqrt{17} ∥ B ∥ F = ( − 2 ) 2 + 0 2 + 2 2 + 3 2 = 17
∥ B ∥ 1 = max { ∣ − 2 ∣ + ∣ 2 ∣ , ∣ 0 ∣ + ∣ 3 ∣ } = max { 4 , 3 } = 4 \|B\|_1 = \max\{|-2| + |2|, |0| + |3|\} = \max\{4, 3\} = 4 ∥ B ∥ 1 = max { ∣ − 2∣ + ∣2∣ , ∣0∣ + ∣3∣ } = max { 4 , 3 } = 4
∥ B ∥ ∞ = max { ∣ − 2 ∣ + ∣ 0 ∣ , ∣ 2 ∣ + ∣ 3 ∣ } = max { 2 , 5 } = 5 \|B\|_\infty = \max\{|-2| + |0|, |2| + |3|\} = \max\{2, 5\} = 5 ∥ B ∥ ∞ = max { ∣ − 2∣ + ∣0∣ , ∣2∣ + ∣3∣ } = max { 2 , 5 } = 5
Exercise 4
Let A = [ 1 − 1 2 1 2 0 ] A = \begin{bmatrix} 1 & -1 & 2 \\ 1 & 2 & 0 \end{bmatrix} A = [ 1 1 − 1 2 2 0 ]
Solution:
∥ A ∥ F = 1 2 + ( − 1 ) 2 + 2 2 + 1 2 + 2 2 + 0 2 = 11 \|A\|_F = \sqrt{1^2 + (-1)^2 + 2^2 + 1^2 + 2^2 + 0^2} = \sqrt{11} ∥ A ∥ F = 1 2 + ( − 1 ) 2 + 2 2 + 1 2 + 2 2 + 0 2 = 11
∥ A ∥ 1 = max { ∣ 1 ∣ + ∣ 1 ∣ , ∣ − 1 ∣ + ∣ 2 ∣ , ∣ 2 ∣ + ∣ 0 ∣ } = max { 2 , 3 , 2 } = 3 \|A\|_1 = \max\{|1| + |1|, |-1| + |2|, |2| + |0|\} = \max\{2, 3, 2\} = 3 ∥ A ∥ 1 = max { ∣1∣ + ∣1∣ , ∣ − 1∣ + ∣2∣ , ∣2∣ + ∣0∣ } = max { 2 , 3 , 2 } = 3
∥ A ∥ ∞ = max { ∣ 1 ∣ + ∣ − 1 ∣ + ∣ 2 ∣ , ∣ 1 ∣ + ∣ 2 ∣ + ∣ 0 ∣ } = max { 4 , 3 } = 4 \|A\|_\infty = \max\{|1| + |-1| + |2|, |1| + |2| + |0|\} = \max\{4, 3\} = 4 ∥ A ∥ ∞ = max { ∣1∣ + ∣ − 1∣ + ∣2∣ , ∣1∣ + ∣2∣ + ∣0∣ } = max { 4 , 3 } = 4
Let C = [ 0 1 − 1 − 2 3 1 ] C = \begin{bmatrix} 0 & 1 \\ -1 & -2 \\ 3 & 1 \end{bmatrix} C = 0 − 1 3 1 − 2 1
Solution:
∥ C ∥ F = 0 2 + 1 2 + ( − 1 ) 2 + ( − 2 ) 2 + 3 2 + 1 2 = 16 = 4 \|C\|_F = \sqrt{0^2 + 1^2 + (-1)^2 + (-2)^2 + 3^2 + 1^2} = \sqrt{16} = 4 ∥ C ∥ F = 0 2 + 1 2 + ( − 1 ) 2 + ( − 2 ) 2 + 3 2 + 1 2 = 16 = 4
∥ C ∥ 1 = max { ∣ 0 ∣ + ∣ − 1 ∣ + ∣ 3 ∣ , ∣ 1 ∣ + ∣ − 2 ∣ + ∣ 1 ∣ } = max { 4 , 4 } = 4 \|C\|_1 = \max\{|0| + |-1| + |3|, |1| + |-2| + |1|\} = \max\{4, 4\} = 4 ∥ C ∥ 1 = max { ∣0∣ + ∣ − 1∣ + ∣3∣ , ∣1∣ + ∣ − 2∣ + ∣1∣ } = max { 4 , 4 } = 4
∥ C ∥ ∞ = max { ∣ 0 ∣ + ∣ 1 ∣ , ∣ − 1 ∣ + ∣ − 2 ∣ , ∣ 3 ∣ + ∣ 1 ∣ } = max { 1 , 3 , 4 } = 4 \|C\|_\infty = \max\{|0| + |1|, |-1| + |-2|, |3| + |1|\} = \max\{1, 3, 4\} = 4 ∥ C ∥ ∞ = max { ∣0∣ + ∣1∣ , ∣ − 1∣ + ∣ − 2∣ , ∣3∣ + ∣1∣ } = max { 1 , 3 , 4 } = 4
Matrix Norm in MATLAB
norm(A); % 2-norm
norm(A, 2 ); % 2-norm
norm(A, 1 ); % 1-norm
norm(A, inf ); % Infinity-norm
norm(A, "fro" ); % Frobenius-norm
norm(A, 'fro' ); % Frobenius-norm
Note: Other matrix induced p-norms are not implemented in the norm() function. Only p = 1 , 2 , ∞ p = 1, 2, \infty p = 1 , 2 , ∞ are provided.
Some Matrix Norm Properties
สองทฤษฎีที่ต้องรู้ (แต่ไม่ต้องท่องแห้ง ๆ เพราะมันมีความหมาย) เริ่ด
Theorem (Subordination)
For any vector p-norm and induced matrix p-norm:
∥ A x ∥ p ≤ ∥ A ∥ p ⋅ ∥ x ∥ p \boxed{\|Ax\|_p \leq \|A\|_p \cdot \|x\|_p} ∥ A x ∥ p ≤ ∥ A ∥ p ⋅ ∥ x ∥ p
where A ∈ R m × n A \in \mathbb{R}^{m \times n} A ∈ R m × n and x ∈ R n x \in \mathbb{R}^n x ∈ R n . This is called subordination .
Proof:
∥ A ∥ p = max y ≠ 0 ∥ A y ∥ p ∥ y ∥ p ≥ ∥ A x ∥ p ∥ x ∥ p , for any x \|A\|_p = \max_{y \neq 0} \frac{\|Ay\|_p}{\|y\|_p} \geq \frac{\|Ax\|_p}{\|x\|_p}, \text{ for any } x ∥ A ∥ p = max y = 0 ∥ y ∥ p ∥ A y ∥ p ≥ ∥ x ∥ p ∥ A x ∥ p , for any x
Therefore: ∥ A ∥ p ⋅ ∥ x ∥ p ≥ ∥ A x ∥ p \|A\|_p \cdot \|x\|_p \geq \|Ax\|_p ∥ A ∥ p ⋅ ∥ x ∥ p ≥ ∥ A x ∥ p
คิดเหมือนเครื่องขยายเสียง: ต่อให้เปิดไมค์ดังแค่ไหน มันก็ไม่ดังเกินกว่าความสามารถของแอมป์
Theorem (Submultiplicativity)
∥ A B ∥ p ≤ ∥ A ∥ p ⋅ ∥ B ∥ p \boxed{\|AB\|_p \leq \|A\|_p \cdot \|B\|_p} ∥ A B ∥ p ≤ ∥ A ∥ p ⋅ ∥ B ∥ p
for any p-norm, where A ∈ R m × n A \in \mathbb{R}^{m \times n} A ∈ R m × n and B ∈ R n × l B \in \mathbb{R}^{n \times l} B ∈ R n × l .
คิดว่า B B B เป็นการยืดครั้งแรก, A A A เป็นการยืดครั้งที่สอง → ผลรวมการยืด “ไม่มีวันเกิน” คูณกันตรง ๆ
Proof:
∥ A B ∥ p = max ∥ x ∥ p = 1 ∥ A B x ∥ p = ∥ A B x max ∥ p \|AB\|_p = \max_{\|x\|_p = 1} \|ABx\|_p = \|ABx_{\max}\|_p ∥ A B ∥ p = max ∥ x ∥ p = 1 ∥ A B x ∥ p = ∥ A B x m a x ∥ p
≤ ∥ A ∥ p ⋅ ∥ B x max ∥ p (by subordination) \leq \|A\|_p \cdot \|Bx_{\max}\|_p \quad \text{(by subordination)} ≤ ∥ A ∥ p ⋅ ∥ B x m a x ∥ p (by subordination)
≤ ∥ A ∥ p ⋅ max ∥ x ∥ p = 1 ∥ B x ∥ p (since ∥ x max ∥ p = 1 ) \leq \|A\|_p \cdot \max_{\|x\|_p = 1} \|Bx\|_p \quad \text{(since } \|x_{\max}\|_p = 1\text{)} ≤ ∥ A ∥ p ⋅ max ∥ x ∥ p = 1 ∥ B x ∥ p (since ∥ x m a x ∥ p = 1 )
= ∥ A ∥ p ⋅ ∥ B ∥ p = \|A\|_p \cdot \|B\|_p = ∥ A ∥ p ⋅ ∥ B ∥ p