;;;; % (use-ring Rational-ring) % (setq M (mat-make-initseq 2 2 '(3 0 0 -1))) [ 3 0 ] [ 0 -1 ] % (setq InvC (mat-make-random-detone 2 2)) [ -1 -2 ] [ 1 1 ] % (setq InvC (mat-make-initseq 2 2 '(-1 -2 1 1))) % (setq C (mat-inverse? InvC)) [ 1 2 ] [ -1 -1 ] % (setq G (mat-mul C m InvC)) [ -5 -8 ] [ 4 7 ] % (setq I (mat-eye 2)) [ 1 0 ] [ 0 1 ] % (setq Gm3I (mat-sub G (mat-scal-mult 3 I))) [ 4 4 ] [ -8 -8 ] % (scrutinize-matrix Gm3I) JK: Found 1 pivots before the second column. Matrix G, [ -8 -8 ] [ 4 4 ] has determinant 0. % InvC [ -1 -2 ] [ 1 1 ] % m [ 3 0 ] [ 0 -1 ] % C [ 1 2 ] [ -1 -1 ] % given [ -5 -8 ] [ 4 7 ] % :q % (setq G given) [ -5 -8 ] [ 4 7 ] % G [ -5 -8 ] [ 4 7 ] % (setq CharMatG (mat-CharMat given)) [ -1t(-5) -8 ] [ 4 -1t+7 ] % (setq charpoly (mat-CharPoly G)) 1t²(-2)t(-3) ;; This poly factors as ;; [t - 3][t - -1] ;; ;; so G's eigenvalues are 3 and -1. ;; The 3-G-eigenspace is at least 1-dim'al, and and ;; the [-1]-G-eigenspace is at least 1-dim'al, but the matrix is only 2x2. ;; So each eigenspace is EXACTLY 1-dim'al, and our G is ;; conjugate to (similar) a diagonal matrix Diag(3, -1). ;; Let's see how: ;; Let's get a basis for the 3-G-eigenspace. % (setq I (mat-eye 2)) [ 1 0 ] [ 0 1 ] % (setq G3 (mat-sub G (mat-scal-mult 3 I))) [ -8 -8 ] [ 4 4 ] % (scrutinize-matrix G3 ) JK: Found 1 pivots before the second column. Matrix G3, [ -8 -8 ] [ 4 4 ] has determinant 0 and consequently has no inverse-matrix. Multiplying G3 by its RowOp matrix [ -1/8 0 ] [ 1/2 1 ] produces R := RREF(G3) matrix [ 1 1 ] [ 0 0 ] with pivot columns 0, and free columns 1. A basis for LeftNull(G3) is [ -1 ] [ 1 ] A basis for ColSpn(G3) is [ -8 ] [ 4 ] A basis for RowSpn(G3) is [ 1 1 ] % (setq G[-1] (mat-sub G (mat-scal-mult -1 I))) [ -4 -8 ] [ 4 8 ] % (scrutinize-matrix G[-1]) JK: Found 1 pivots before the second column. Matrix G[-1], [ -4 -8 ] [ 4 8 ] has determinant 0 and consequently has no inverse-matrix. Multiplying G[-1] by its RowOp matrix [ -1/4 0 ] [ 1 1 ] produces R := RREF(G[-1]) matrix [ 1 2 ] [ 0 0 ] with pivot columns 0, and free columns 1. A basis for LeftNull(G[-1]) is [ -2 ] [ 1 ] A basis for ColSpn(G[-1]) is [ -4 ] [ 4 ] A basis for RowSpn(G[-1]) is [ 1 2 ] ;;;; Created a CoB matrix, from our (setq InvC (mat-make-initseq 2 2 '(-1 -2 1 1))) [ -1 -2 ] [ 1 1 ] % (setq C (mat-inverse? InvC)) [ 1 2 ] [ -1 -1 ] % (setq DiagonalizedG (mat-mul C G InvC)) [ 3 0 ] [ 0 -1 ] ==== ;; Attempting to diagonalize a 4x4 matrix. % (use-ring Rational-ring) % (setq G (mat-make-initseq 4 4 '(-1 -12 8 4 1 8 -4 -3 -2 -2 3 -2 1 3 -2 2))) [ -1 -12 8 4 ] [ 1 8 -4 -3 ] [ -2 -2 3 -2 ] [ 1 3 -2 2 ] % (setq f (mat-CharPoly G)) t^4 - 12t^3 + 54t^2 - 108t + 81 % (iter (for v from -4 to 4) (format t "~% f(~2D) = ~3D" v (poly-eval f v)) ) f(-4) = 2401 f(-3) = 1296 f(-2) = 625 f(-1) = 256 f( 0) = 81 f( 1) = 16 f( 2) = 1 f( 3) = 0 f( 4) = 1 % (setq I (mat-eye 4)) [ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ] % (setq G3 (mat-sub G (mat-scal-mult 3 I))) [ -4 -12 8 4 ] [ 1 5 -4 -3 ] [ -2 -2 0 -2 ] [ 1 3 -2 -1 ] % (scrutinize-matrix G3) JK: Found 2 pivots before the fourth column. Matrix G3, [ -4 -12 8 4 ] [ 1 5 -4 -3 ] [ -2 -2 0 -2 ] [ 1 3 -2 -1 ] has determinant 0 and consequently has no inverse-matrix. Multiplying G3 by its RowOp matrix [ -5/8 -3/2 0 0 ] [ 1/8 1/2 0 0 ] [ -1 -2 1 0 ] [ 1/4 0 0 1 ] produces R := RREF(G3) matrix [ 1 0 1 2 ] [ 0 1 -1 -1 ] [ 0 0 0 0 ] [ 0 0 0 0 ] with pivot columns 0, 1, and free columns 2, 3. A basis for LeftNull(G3) is [ -1 -2 ] [ 1 1 ] [ 1 0 ] [ 0 1 ] % (setq G3LNull (MTB-LNullBsis *Tab*)) [ -1 -2 ] [ 1 1 ] [ 1 0 ] [ 0 1 ] % (setq 4by2 (mat-make-optval 4 2 0)) [ 0 0 ] [ 0 0 ] [ 0 0 ] [ 0 0 ] % (setf (mat-E 4by2 2 0) 1) % (setf (mat-E 4by2 3 1) 1) % 4by2 [ 0 0 ] [ 0 0 ] [ 1 0 ] [ 0 1 ] % (setq InvD (mat-Horiz-concat G3LNull 4by2)) [ -1 -2 0 0 ] [ 1 1 0 0 ] [ 1 0 1 0 ] [ 0 1 0 1 ] % (setq D (mat-inverse? InvD)) [ 1 2 0 0 ] [ -1 -1 0 0 ] [ -1 -2 1 0 ] [ 1 1 0 1 ] % (setq GDiagABit (mat-mul D G InvD)) [ 3 0 0 -2 ] [ 0 3 -4 -1 ] [ 0 0 3 0 ] [ 0 0 2 3 ] % f ;; Made by (setq f (mat-CharPoly G)) t^4 - 12t^3 + 54t^2 - 108t + 81 t⁴-12t³+54t²-108t+81 ;;Why doesn't this display correctly? % (setq g (poly-build 1 -3)) t-3 % (setq DoubleRoot3 (poly-mult-two g g)) t^2 - 6t + 9 % (poly-divide f DoubleRoot3) (t^2 - 6t + 9 ) ;; Quotient. Remainder. % G [ -1 -12 8 4 ] [ 1 8 -4 -3 ] [ -2 -2 3 -2 ] [ 1 3 -2 2 ] ;; ================ ;; Example 7 of Section 5.1 (P.252). ;; Let \V be the VS of 3-topped polya ;; Ax^2 + Bx + C. ;; ;; LinTrn T carries poly f to ;; x |-> f(x) + [x+1]*f'(x) . ;; ;; Our goal is to determine if T is diagonalizable. ;; ;;; Soln: W.r.t basis {1, x, x^2}, our T has matrix % M [ 1 1 0 ] [ 0 2 2 ] [ 0 0 3 ] % (setq MCharPly (mat-CharPoly M) f MCharPly) -t^3 + 6t^2 -11t + 6 % (iter (for j below 5) (format t "~% f(~D) = ~D" j (poly-eval f j))) f(0) = 6 f(1) = 0 f(2) = 0 f(3) = 0 f(4) = -6 ;; So f(t) = [1 - t][2 - t][3 - t] . % (setq I (mat-eye 3)) [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ] % (setq M1 (mat-sub M I)) [ 0 1 0 ] [ 0 1 2 ] [ 0 0 2 ] % (setq M2 (mat-sub M (mat-scal-mult 2 I))) [ -1 1 0 ] [ 0 0 2 ] [ 0 0 1 ] % (setq M3 (mat-sub M (mat-scal-mult 3 I))) [ -2 1 0 ] [ 0 -1 2 ] [ 0 0 0 ] % (scrutinize-matrix M1) A basis for LeftNull(M1) is [ 1 ] [ 0 ] [ 0 ] % (scrutinize-matrix M2) A basis for LeftNull(M2) is [ 1 ] [ 1 ] [ 0 ] % M [ 1 1 0 ] [ 0 2 2 ] [ 0 0 3 ] % (scrutinize-matrix M3) A basis for LeftNull(M3) is [ 1 ] [ 2 ] [ 1 ] ;; We set C-inverse % InvC [ 1 1 1 ] [ 0 1 2 ] [ 0 0 1 ] % (setq C (mat-inverse? InvC)) [ 1 -1 1 ] [ 0 1 -2 ] [ 0 0 1 ] % (mat-mul C M InvC) [ 1 0 0 ] [ 0 2 0 ] [ 0 0 3 ] ;; We've diagonalized T, the map ;; ;; f |-> [ x |-> f(x) + [x+1]*f'(x) ]