A scalar is an eigenvalue of an matrix if there is a nonzero vector such thatAny such vector is an eigenvector corresponding to . The requirement that an eigenvector be nonzero is essential: the zero vector would satisfy the equation for every scalar and would convey no information.
The determinant is unchanged by matrix transposition, soThus has a nontrivial null space, givingThe same argument with shows that a matrix and its transpose have the same characteristic polynomial. It does not say that they have the same eigenvectors: here .
For a real matrix , the row space is the linear span of its rows in . The column space is the linear span of its columns in , equivalently . The null space isThe matrix rank is the dimension of the column space, which equals the dimension of the row space. In particular,The last equality is the rank-nullity theorem.
Let be the original columns. The first three are linearly independent: restricting them to rows 2, 3 and 4 gives the triangular matrixwhose determinant is one. Also , so a basis for the column space isThese are columns of the original matrix. Taking columns of its reduced row echelon form would generally give the wrong column space.
No. Take the one-by-one matrices , . Both column spaces are , whereas has column space . More generally, taking cancels any nonzero column space. One always has , because each sum column lies in the vector subspace , but equality can fail through cancellation.
For square matrices of the same size,For an upper or lower triangular matrix , its determinant is the product of its diagonal entries:These formulas include singular matrices and zero diagonal entries.
Write the determinant in its Leibniz formula for determinants, where is the set of permutations of :The permutation sign is justified by the given row-interchange property: a permutation matrix is obtained from the identity matrix by row interchanges, and every interchange changes its determinant by a factor . Reversing a sequence of interchanges constructs the inverse permutation with the same number of interchanges. Consequently . The Leibniz formula for determinants can itself be obtained by expanding the rows multilinearly in the standard basis: repeated selected coordinate rows contribute zero, and the remaining terms are precisely these signed permutation matrices.
Since , the same formula givesReindex the product with and reindex the sum with . Both reindexings are bijections, soThus for every real square matrix, including singular matrices. This proof does not assume the analogous column-operation rules in order to establish the transpose identity.
An eigenvalue and eigenvector pair for a square matrix satisfiesThe scalar and the coordinates of belong to the chosen field, usually or . The nonzero condition is essential: the zero vector satisfies the equation for every and therefore cannot define an eigenvalue.
Interpret “distinct eigenvalues” as pairwise distinct eigenvalues in the chosen field. Select a nonzero eigenvector for each. A single nonzero vector is linearly independent. Suppose inductively that are linearly independent. If adding made the set linearly dependent, its nontrivial relation would have a nonzero coefficient of , since otherwise it would contradict the induction hypothesis. Solving for would place it in the linear span of the first eigenvectors.
Part (c) would then force for some , contradicting pairwise distinctness. Mathematical induction therefore proves that all selected eigenvectors are linearly independent, forming a basis. If the field is , the assertion requires real eigenvalues; a real matrix can instead have nonreal eigenvalues and a eigenvector basis over the complex numbers.
For , the triangular matrix formula gives the characteristic polynomialThe three eigenvalues are distinct, so part (d) already proves the existence of an eigenvector basis. Explicit choices, ordered by eigenvalues , areTheir column matrix has determinant one, and direct multiplication gives respectively one, three and two times the indicated vector.
For , expansion along the last row givesAgain the three eigenvalues are distinct. An explicit eigenvector basis, ordered by eigenvalues , isIts column matrix has determinant . In particular, 's diagonal entries are not its eigenvalues: it is not a triangular matrix.
Finally , so every nonzero vector is an eigenvector with eigenvalue one. Choose the standard basis . These are linearly independent even though their eigenvalues coincide. Distinct eigenvalues are sufficient for an eigenvector basis, and are not necessary.
Use the source's The outer list comprehension pairs corresponding rows; the inner one pairs corresponding entries. Checking both dimensions before using
type Matrix a = [[a]]. For its nonempty rectangular matrices, the number of rows and the first row's length determine the dimensions:dimensions :: Matrix a -> (Int,Int)
dimensions rows = (length rows, length (head rows))
addMat :: Num a => Matrix a -> Matrix a -> Matrix a
addMat a b
| dimensions a /= dimensions b = error "addMat: incompatible sizes"
| otherwise = [[x + y | (x,y) <- zip r s]
| (r,s) <- zip a b]zip prevents silent truncation. Thus the result has entries , the definition of matrix addition. The Num constraint supplies the addition operation.A recursive transpose removes the first column, then transposes the remaining columns:The internal recursive calls eventually reach rows of length zero, even though the original input has positive dimensions; the second equation handles this terminating case. Rectangularity ensures that the rows become empty together, so no
transpose :: Matrix a -> Matrix a
transpose [] = []
transpose ([] : _) = []
transpose rows = map head rows : transpose (map tail rows)head or tail is applied to an empty row in the third equation. The output is an matrix with entry . The element type is unrestricted.Accumulate the product of the matrices from left to right, which matches forward linked list traversal.The four-value assignment is simultaneous, as permitted by the source. With , the loop invariant after reading the prefix iswith the empty product initialized to the identity matrix. Multiplication on the right by produces exactly the four assignments above. The associativity of matrix multiplication allows this left-to-right accumulation even though the recursive conversion groups operations from the right.
PROCEDURE cf2rat(f: fraction; VAR n, d: INTEGER);
VAR p: fraction; a, b, c, e, x: INTEGER;
BEGIN
a := 1; b := 0; c := 0; e := 1;
p := f;
WHILE p # NIL DO
x := p.head;
a, b, c, e := a*x+b, a, c*x+e, c;
p := p.tail
END;
n := a; d := c
END cf2rat;At completion, the first column is the numerator/denominator pair for the whole continued fraction: the last factor sends to , and each earlier factor applies the recurrence from part (d). The vector is an algebraic device, not a finite input ratio requiring division by zero. For a nonempty list the resulting is positive; for a singleton it is . The product has determinant , so its first-column entries are coprime. Return in linear node-processing time and auxiliary space, without changing the list.
expand :: Matrix [a] -> [Matrix a]
expand = cp . map cpThe inner Cartesian product converts one row of cell choices into its possible rows; the outer product combines those rows into whole matrices. Every assignment is represented exactly once when each cell's alternatives are distinct. Empty cell domains yield no grids, and an empty matrix yields the singleton list containing the empty matrix.
The product is , so multiplying it by the matrix gives an matrix. The product is , so multiplying it on the left by the matrix also gives an matrix. Both multiplications have matching inner dimensions.
Consequently for every . Taking successively as the standard basis vectors shows that every column of this difference is zero. Hence . Equality on one selected vector would not suffice; here it holds on all vectors.
Using the unit length of ,Then ordinary matrix expansion gives . Both and its complementary matrix are projectors. The second calculation in fact holds for every idempotent matrix, without requiring the matrix to equal its transpose.
For a sum of mutually orthogonal projectors, orthonormality gives for and one for . Therefore equals zero for different indices and for equal indices. Expanding the finite sum yieldsThus every stated partial sum is a projector. Its image of a linear map is the span of the first orthonormal set of vectors; arbitrary sums of idempotent matrices would not have this conclusion.
The iteration matrix has eigenvalues : expanding its characteristic polynomial down the first column leaves the triangular two-by-two block with diagonal entries . The distinct eigenvalues ensure diagonalizability. Thus its spectral radius is .
The previous bound gives , so the Gauss-Seidel iteration converges for every initial guess under the stated diagonalization. Its limit is the exact solution . Since , a fixed matrix also sends this transformed error to zero; its operator norm can account for any amplification in the original coordinates.
The independent-column representation gives . Thus a vector lies in the kernel of a linear map represented by this matrix precisely when and . Writing the two free coordinates separately givesThe two displayed vectors are linearly independent, so they form a basis of the kernel. Its dimension two also agrees with the rank-nullity theorem, .