Skip to main content

Linear Algebra

Scalar, Vectors, Matrix and Tensor

  • A scalar is a single number sRs \in \mathbb{R}. It can be regarded as a vector with the unit length or dimension.
  • A vector is an array of numbers vRdv \in \mathbb{R}^d. The dd is called dimension or length. A vector can be regarded as a m×1m\times 1 matrix.
  • A matrix is a two-dimensional array MRm×nM \in\mathbb{R}^{m\times n}. A matrix can be regarded as a special tensor.
  • A tensor is an nn-dimensional array TRm1×m2×T \in\mathbb{R}^{m_1\times m_2\times\cdots }. Tensor is the most generic way to denote data.

Operations

Products

We can define inner product, or known as dot product on vectors.

Determinant

  • det(AT)=det(A)\text{det}(A^T)=\text{det}(A).
  • det(AB)=det(A)det(B)\text{det}(AB)=\text{det}(A)\text{det}(B).

Inversion

A matrix ARn×nA\in\mathbb{R}^{n\times n} is called invertible if there is A1Rn×nA^{-1}\in\mathbb{R}^{n\times n} such that AA1=A1A=IAA^{-1}=A^{-1}A=I.

  • AA is invertible if and only if rows of AA are linearly independent.
  • AA is invertible if and only if det(A)=A0\text{det}(A)=|A|\neq 0.
  • If AA is invertible, then Ax=bAx=b has solution x=A1bx=A^{-1}b.

Properties of Matrix

  • Symmetric Matrix: A matrix is called symmetric if A=ATA=A^T.
  • Diagonal Matrix: A matrix is called diagonal if Ai,j=0,ijA_{i,j}=0, i\neq j.
  • Identity Matrix: The identity matrix InI_n is the n×nn\times n diagonal matrix where Ii,i=1I_{i,i}=1.
  • Unitary Matrix: A complex matrix is called unitary if UU=IUU^* =I where UU^* is the conjugate transpose of UU.

More concepts

  • A set of vectors v1,,vnv_1,\cdots, v_n is said to be linearly independent if aivi=0    ai=0\sum a_iv_i=0 \iff a_i=0. In another word, aiR{0}\nexists a_i\in\mathbb{R}-\{0 \} such that aivi=0\sum a_iv_i=0.

  • The span of v1,,vnv_1,\cdots,v_n for a vector space VV is the set of all vectors that can be expressed as a linear combination of them. Formally, we have span{v1,v2,,vn}={vV:a1,,ansuch thata1v1++anvn=v}\text{span}\{v_1,v_2,\cdots,v_n\}=\{v\in V:\exists a_1,\cdots,a_n\:\text{such that}\:a_1v_1+\cdots+a_nv_n=v\}.

Eigenvalues and Eigenvectors

Definition: vRnv\in\mathbb{R}^n is an eigenvector of ARn×nA\in\mathbb{R}^{n\times n} with eigenvalue λR\lambda\in\mathbb{R} if Av=λvAv=\lambda v.

If ARn×nA\in\mathbb{R}^{n\times n} has eigenvalues λ1,,λn\lambda_1,\cdots,\lambda_n, then the determinant of AA is det(A)=A=λi\text{det}(A)=|A|=\prod \lambda_i.

Steps to compute the eigenvalues and eigenvectors

  • Computer the determinant of AλInA-\lambda I_n. With λ\lambda subtracted along the diagonal, this determinant is a polynomial of degree nn, starts with (λ)n(-\lambda)^n.
  • Find the roots of this polynomial. The nn roots are the eigenvalues of AA.
  • For each eigenvalue λ\lambda solve the equation (AλI)x=0(A-\lambda I)x=0. The solution x0x\neq 0 is the eigenvector corresponding to λ\lambda.

Definite Matrix

A symmetric matrix AA is:

  • Positive semi-definite (PSD) if for all xRnx\in\mathbb{R}^n, there is xTAx0x^TAx\geq 0.
  • Positive definite (PD) if for all non-zero xRnx\in\mathbb{R}^n, there is xTAx>0x^TAx>0.

We can induce this property by using the eigenvalues:

  • If all eigenvalues are strictly positive, then matrix AA is PD. Furthermore, since the determinant is non-zero, the matrix is invertible.
  • Similarly, if all eigenvalues are nonnegative, then the matrix AA is PSD.

We can similarly define negative semi-definite and negative definite.

Rayleigh Quotient

R(M,v)=vTMvvTvR(M,v)=\frac{v^TMv}{v^Tv}

For PSD MM,

  • The max value of R(M,v)R(M,v) is the largest eigenvalue of MM.
  • This is attained for vv being the corresponding eigenvector.

Singular Value Decomposition

We can decompose a matrix XX into UVTU\sum V^T where XRN×DX\in\mathbb{R}^{N\times D}.

  • RN×D\sum\in\mathbb{R}^{N\times D} is diagonal with singular values σ1σ2σD0\sigma_1\geq\sigma_2\cdots\geq\sigma_D\geq0.
  • VRD×DV\in\mathbb{R}^{D\times D} is orthonormal matrix with right singular vectors.
  • URN×NU\in\mathbb{R}^{N\times N} is orthonormal matrix with left singular vectors.