Inner Product
⟨ x , y ⟩ = x ⋅ y = x T y = ∑ i = 1 n x i y i \langle x, y \rangle = x \cdot y = x^T y = \sum_{i=1}^{n} x_i y_i ⟨ x , y ⟩ = x ⋅ y = x T y = i = 1 ∑ n x i y i
An inner product ⟨ ⋅ , ⋅ ⟩ \langle \cdot, \cdot \rangle ⟨ ⋅ , ⋅ ⟩ is more general than the dot product. In R n \mathbb{R}^n R n , the dot product is usually used as the inner product as it induces the Euclidean norm. If x ⋅ y = 0 x \cdot y = 0 x ⋅ y = 0 then x , y x, y x , y are orthogonal .
∥ x ∥ 2 = ∑ i = 1 n ∣ x i ∣ 2 = ⟨ x , x ⟩ = x ⋅ x = x T x \|x\|_2 = \sqrt{\sum_{i=1}^{n} |x_i|^2} = \sqrt{\langle x, x \rangle} = \sqrt{x \cdot x} = \sqrt{x^T x} ∥ x ∥ 2 = i = 1 ∑ n ∣ x i ∣ 2 = ⟨ x , x ⟩ = x ⋅ x = x T x
∥ x ∥ 1 = ∑ i = 1 n ∣ x i ∣ \|x\|_1 = \sum_{i=1}^{n} |x_i| ∥ x ∥ 1 = i = 1 ∑ n ∣ x i ∣
∥ x ∥ \|x\| ∥ x ∥ usually means ∥ x ∥ 2 \|x\|_2 ∥ x ∥ 2 .
The projection of x x x on y y y is
x ⋅ y ∥ y ∥ 2 y \frac{x \cdot y}{\|y\|^2} \, y ∥ y ∥ 2 x ⋅ y y
and the cosine similarity of x x x and y y y is
x ⋅ y ∥ x ∥ ⋅ ∥ y ∥ \frac{x \cdot y}{\|x\| \cdot \|y\|} ∥ x ∥ ⋅ ∥ y ∥ x ⋅ y
Square Matrices
For square matrices A , B ∈ R n × n A, B \in \mathbb{R}^{n \times n} A , B ∈ R n × n and a scalar c ∈ R c \in \mathbb{R} c ∈ R , assume A − 1 , B − 1 A^{-1}, B^{-1} A − 1 , B − 1 exist.
A A A is invertible ⟺ \iff ⟺ det ( A ) ≠ 0 \det(A) \neq 0 det ( A ) = 0 ⟺ \iff ⟺ A A A is full-rank ⟺ \iff ⟺ columns of A A A are linearly independent
( A T ) − 1 = ( A − 1 ) T (A^T)^{-1} = (A^{-1})^T ( A T ) − 1 = ( A − 1 ) T
( A B ) − 1 = B − 1 A − 1 (AB)^{-1} = B^{-1}A^{-1} ( A B ) − 1 = B − 1 A − 1
det ( A B ) = det A ⋅ det B \det(AB) = \det A \cdot \det B det ( A B ) = det A ⋅ det B
det ( A − 1 ) = 1 det A \det(A^{-1}) = \frac{1}{\det A} det ( A − 1 ) = d e t A 1
det ( c A ) = c n det ( A ) \det(cA) = c^n \det(A) det ( c A ) = c n det ( A )
A A A is orthogonal if A T A = I ⟺ A − 1 = A T A^T A = I \iff A^{-1} = A^T A T A = I ⟺ A − 1 = A T
t r ( A ) = ∑ i = 1 n A i i = ∑ i = 1 n λ i \mathrm{tr}(A) = \sum_{i=1}^{n} A_{ii} = \sum_{i=1}^{n} \lambda_i tr ( A ) = ∑ i = 1 n A ii = ∑ i = 1 n λ i for eigenvalues λ i \lambda_i λ i
A A A is symmetric if A T = A A^T = A A T = A
General Matrices
More generally, for matrices of compatible shapes,
( A B ) T = B T A T (AB)^T = B^T A^T ( A B ) T = B T A T
( A + B ) T = A T + B T (A + B)^T = A^T + B^T ( A + B ) T = A T + B T
t r ( A B ) = t r ( B A ) \mathrm{tr}(AB) = \mathrm{tr}(BA) tr ( A B ) = tr ( B A ) for A ∈ R n × m A \in \mathbb{R}^{n \times m} A ∈ R n × m , B ∈ R m × n B \in \mathbb{R}^{m \times n} B ∈ R m × n
A B ≠ B A AB \neq BA A B = B A necessarily, matrix multiplication is not commutative
Positive and Negative Semi-Definiteness
For a symmetric A ∈ R n × n A \in \mathbb{R}^{n \times n} A ∈ R n × n ,
A A A is positive semi-definite when x T A x ≥ 0 x^T A x \ge 0 x T A x ≥ 0 for all x ∈ R n x \in \mathbb{R}^n x ∈ R n ⟺ \iff ⟺ all eigenvalues of A A A are ≥ 0 \ge 0 ≥ 0
A A A is negative semi-definite when x T A x ≤ 0 x^T A x \le 0 x T A x ≤ 0 for all x ∈ R n x \in \mathbb{R}^n x ∈ R n ⟺ \iff ⟺ all eigenvalues of A A A are ≤ 0 \le 0 ≤ 0
Positive (negative) definite is the same with strict inequalities for x ≠ 0 x \neq 0 x = 0 .