Physlib

Physlib.Mathematics.SchurTriangulation

Schur triangulation

Schur triangulation is more commonly known as Schur decomposition or Schur triangularization, but "triangulation" makes the API more readable. It states that a square matrix over an algebraically closed field, e.g., `ℂ`, is unitarily similar to an upper triangular matrix.

Main definitions

- `Matrix.schur_triangulation` : a matrix `A : Matrix n n 𝕜` with `𝕜` being algebraically closed can be decomposed as `A = U * T * star U` where `U` is unitary and `T` is upper triangular. - `Matrix.schurTriangulationUnitary` : the unitary matrix `U` as previously stated. - `Matrix.schurTriangulation` : the upper triangular matrix `T` as previously stated. - Some auxiliary definitions are not meant to be used directly, but `LinearMap.SchurTriangulationAux.of` contains the main algorithm for the triangulation procedure.

Schur's recursive triangulation procedure

Given a linear endomorphism `f` on a non-trivial finite-dimensional vector space `E` over an algebraically closed field `𝕜`, one can always pick an eigenvalue `μ` of `f` whose corresponding eigenspace `V` is non-trivial. Given that `E` is also an inner product space, let `bV` and `bW` be orthonormal bases for `V` and `Vᗮ` respectively. Then, the collection of vectors in `bV` and `bW` forms an orthonormal basis `bE` for `E`, as the direct sum of `V` and `Vᗮ` is an internal decomposition of `E`. The matrix representation of `f` with respect to `bE` satisfies \[ \sideset{_\mathrm{bE}}{_\mathrm{bE}}{[f]} = \begin{bmatrix} \sideset{_\mathrm{bV}}{_\mathrm{bV}}{[f]} & \sideset{_\mathrm{bW}}{_\mathrm{bV}}{[f]} \\ \sideset{_\mathrm{bV}}{_\mathrm{bW}}{[f]} & \sideset{_\mathrm{bW}}{_\mathrm{bW}}{[f]} \end{bmatrix} = \begin{bmatrix} \mu I & □ \\ 0 & \sideset{_\mathrm{bW}}{_\mathrm{bW}}{[f]} \end{bmatrix}, \] which is upper triangular as long as $\sideset{_\mathrm{bW}}{_\mathrm{bW}}{[f]}$ is. Finally, one observes that the recursion from $\sideset{_\mathrm{bE}}{_\mathrm{bE}}{[f]}$ to $\sideset{_\mathrm{bW}}{_\mathrm{bW}}{[f]}$ is well-founded, as the dimension of `bW` is smaller than that of `bE` because `bV` is non-trivial.

However, in order to leverage `DirectSum.IsInternal.collectedOrthonormalBasis`, the type `Σ b, cond b (Fin m) (Fin n)` has to be used instead of the more natural `Fin m ⊕ Fin n` while their equivalence is propositionally established by `Equiv.sumEquivSigmalCond`.

15 declarations

definition

imi - m for iFin(m+n)i \in \text{Fin}(m + n) such that imi \ge m

Given a finite index i{0,1,,m+n1}i \in \{0, 1, \dots, m + n - 1\} and a proof hh that imi \geq m, this function returns the value imi - m as an element of the set {0,1,,n1}\{0, 1, \dots, n - 1\}.

definition

Fin mFin nbBoolcond(b,Fin m,Fin n)\text{Fin } m \oplus \text{Fin } n \simeq \sum_{b \in \text{Bool}} \text{cond}(b, \text{Fin } m, \text{Fin } n)

The equivalence defines a bijection between the disjoint union of two finite sets Fin mFin n\text{Fin } m \oplus \text{Fin } n and the dependent sum b{true, false}Sb\sum_{b \in \{\text{true, false}\}} S_b, where Strue=Fin mS_{\text{true}} = \text{Fin } m and Sfalse=Fin nS_{\text{false}} = \text{Fin } n. Here, Fin k\text{Fin } k denotes the set of natural numbers {0,1,,k1}\{0, 1, \dots, k-1\}, and the mapping uses the conditional operator cond(b,Fin m,Fin n)\text{cond}(b, \text{Fin } m, \text{Fin } n) to select the appropriate set based on the boolean index bb.

definition

Fin(m+n)bBoolcond(b,Fin m,Fin n)\text{Fin}(m + n) \simeq \sum_{b \in \text{Bool}} \text{cond}(b, \text{Fin } m, \text{Fin } n)

The equivalence defines a bijection between the set of indices Fin(m+n)={0,1,,m+n1}\text{Fin}(m + n) = \{0, 1, \dots, m + n - 1\} and the dependent sum b{true, false}Sb\sum_{b \in \{\text{true, false}\}} S_b, where Strue=Fin mS_{\text{true}} = \text{Fin } m and Sfalse=Fin nS_{\text{false}} = \text{Fin } n. For an index iFin(m+n)i \in \text{Fin}(m + n), the mapping is defined such that if i<mi < m, it corresponds to (true,i)Strue(\text{true}, i) \in S_{\text{true}}, and if imi \ge m, it corresponds to (false,im)Sfalse(\text{false}, i - m) \in S_{\text{false}}. This construction is used to partition basis indices during the recursive step of Schur triangulation.

theorem

finAddEquivSigmaCond\text{finAddEquivSigmaCond} maps i<mi < m to the true branch

Let mm and nn be natural numbers. For any index iFin(m+n)i \in \text{Fin}(m + n), if i<mi < m, then the equivalence finAddEquivSigmaCond\text{finAddEquivSigmaCond} maps ii to the element true,i,h\langle \text{true}, i, h \rangle in the dependent sum bBoolcond(b,Fin m,Fin n)\sum_{b \in \text{Bool}} \text{cond}(b, \text{Fin } m, \text{Fin } n), where hh is the proof that i<mi < m. In other words, indices less than mm are mapped to the first component (the "true" branch) of the partition.

theorem

finAddEquivSigmaCond\text{finAddEquivSigmaCond} maps imi \ge m to the false branch

Let mm and nn be natural numbers. For any index iFin(m+n)i \in \text{Fin}(m + n), if imi \ge m, then the equivalence finAddEquivSigmaCond\text{finAddEquivSigmaCond} maps ii to the element false,im\langle \text{false}, i - m \rangle in the dependent sum bBoolcond(b,Fin m,Fin n)\sum_{b \in \text{Bool}} \text{cond}(b, \text{Fin } m, \text{Fin } n). In this context, imi - m is treated as an element of Fin n\text{Fin } n, and the "false" branch corresponds to the second component of the partition.

instance

Finiteness of the type cond(b,m,n)\text{cond}(b, m, n)

Given two finite types mm and nn, for any boolean value bb, the type defined by the conditional cond(b,m,n)\text{cond}(b, m, n) (which is mm if bb is true\text{true} and nn if bb is false\text{false}) is also a finite type.

instance

Decidable equality for the disjoint union bBoolcond(b,m,n)\sum_{b \in \text{Bool}} \text{cond}(b, m, n)

Given two types mm and nn that both possess decidable equality, the dependent sum type b{true,false}cond(b,m,n)\sum_{b \in \{\text{true}, \text{false}\}} \text{cond}(b, m, n) also possesses decidable equality. Here, cond(b,m,n)\text{cond}(b, m, n) evaluates to mm if bb is true and nn if bb is false, effectively representing the disjoint union mnm \sqcup n. Two elements b1,x1\langle b_1, x_1 \rangle and b2,x2\langle b_2, x_2 \rangle in this type are equal if and only if b1=b2b_1 = b_2 and x1=x2x_1 = x_2.

abbrev

Matrix AA is upper triangular

Let nn be a type equipped with a less-than relation << and RR be a commutative ring. A square matrix AA with entries in RR and indexed by nn is upper triangular if for all i,jni, j \in n, the entry Ai,j=0A_{i,j} = 0 whenever i>ji > j.

abbrev

Subtype of upper triangular matrices

For a type nn equipped with a less-than relation << and a commutative ring RR, `Matrix.UpperTriangular n R` is the subtype consisting of all square matrices AA of size n×nn \times n with entries in RR that are upper triangular. A matrix AA is upper triangular if its entries Ai,jA_{i,j} satisfy Ai,j=0A_{i,j} = 0 for all i,jni, j \in n such that i>ji > j.

definition

Schur triangulation of a linear map ff

Given a linear endomorphism f:EEf: E \to E on a finite-dimensional inner product space EE over an algebraically closed field k\mathbb{k}, this definition implements the recursive algorithm for Schur triangulation (also known as Schur decomposition). It constructs an orthonormal basis B\mathcal{B} for EE such that the matrix representation [f]B[f]_{\mathcal{B}} of the operator is upper triangular. The algorithm proceeds as follows: 1. If EE is trivial, it returns an empty basis. 2. If EE is non-trivial, it selects an eigenvalue μ\mu and its corresponding eigenspace VEV \subseteq E. 3. It considers the orthogonal complement W=VW = V^\perp and recursively applies the algorithm to the map g:WWg: W \to W defined by g=PWfWg = P_W \circ f|_W, where PWP_W is the orthogonal projection onto WW. 4. The final orthonormal basis B\mathcal{B} is formed by joining an orthonormal basis for VV with the orthonormal basis of WW obtained from the recursion.

definition

Orthonormal basis and upper triangular matrix pair for the Schur triangulation of AA

Given a square matrix AA of size n×nn \times n over an algebraically closed field k\mathbb{k}, this definition provides a pair (B,T)(\mathcal{B}, T) consisting of an orthonormal basis B\mathcal{B} for the Euclidean space kn\mathbb{k}^n and an upper triangular matrix TT. The matrix TT is the matrix representation of the linear endomorphism xAxx \mapsto Ax with respect to the basis B\mathcal{B}. The construction is obtained by adapting the recursive Schur triangulation algorithm for linear maps to the specific case of matrices acting on Euclidean space.

definition

Orthonormal basis for the Schur triangulation of AA

Given a square matrix AA of size n×nn \times n over an algebraically closed field k\mathbb{k}, this definition provides the orthonormal basis B\mathcal{B} of the Euclidean space kn\mathbb{k}^n such that the matrix representation of the linear operator xAxx \mapsto Ax with respect to B\mathcal{B} is upper triangular. It is defined as the first component of the pair (B,T)(\mathcal{B}, T) generated by the Schur triangulation algorithm `Matrix.schurTriangulationAux`.

definition

Unitary matrix in the Schur decomposition of AA

Given a square matrix AA of size n×nn \times n over an algebraically closed field k\mathbb{k} (such as the complex numbers C\mathbb{C}), this definition provides the unitary matrix UU(n,k)U \in \mathrm{U}(n, \mathbb{k}) such that A=UTUA = U T U^*, where TT is an upper triangular matrix and UU^* is the conjugate transpose of UU. Specifically, UU is the change-of-basis matrix from the standard basis of the Euclidean space kn\mathbb{k}^n to the orthonormal basis B\mathcal{B} (the Schur basis) derived during the triangulation procedure, meaning the columns of UU are the vectors of B\mathcal{B}.

definition

Upper triangular matrix in the Schur decomposition of AA

Given a square matrix AA of size n×nn \times n over an algebraically closed field k\mathbb{k} (such as the complex numbers C\mathbb{C}), this definition returns the upper triangular matrix TT that is unitarily similar to AA. Specifically, TT is the matrix such that A=UTUA = U T U^* for some unitary matrix UU, where Ti,j=0T_{i,j} = 0 for all indices i,ji, j such that i>ji > j. This matrix is the second component of the auxiliary Schur triangulation result, representing the linear map xAxx \mapsto Ax with respect to the orthonormal basis derived during the triangulation procedure.

theorem

Schur decomposition A=UTUA = U T U^*

For any square matrix AA over an algebraically closed field k\mathbb{k}, the matrix AA can be decomposed as A=UTUA = U T U^*, where UU is the unitary matrix provided by `schurTriangulationUnitary`, TT is the upper triangular matrix provided by `schurTriangulation`, and UU^* denotes the conjugate transpose of UU.