Physlib

Physlib.Mathematics.SchurTriangulation

15 declarations

definition

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

#subNat'

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)

#sumEquivSigmalCond

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)

#finAddEquivSigmaCond

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

#finAddEquivSigmaCond_true

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

#finAddEquivSigmaCond_false

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)

#instFintypeCond_physlib

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)

#instDecidableEqSigmaBoolCond_physlib

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

#IsUpperTriangular

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

#UpperTriangular

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

#of

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

#schurTriangulationAux

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

#schurTriangulationBasis

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

#schurTriangulationUnitary

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

#schurTriangulation

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^*

#schur_triangulation

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.