Jordan with Parameters from Frobenius Form with Parameters

Robert M. Corless, Marc Moreno Maza, and Steven E. Thornton

ORCCA, University of Western Ontario, London, Ontario, Canada Motivation Parametric Computations in CAS

Computer algebra systems generally give generic answers for computations on matrices with parameters.

1 Example

Jordan canonical form of:   α 0 1       0 α − 3 0  with α ∈ C   0 0 −2

Maple Mathematica SymPy Sage

         −2   −2   α − 3     −2               α     α   α     −3 + α        α − 3 α − 3 −2 α 2 Example

Jordan canonical form of:     α 0 1   −2 0 1        α = −2    0 α − 3 0  −−−−→  0 −5 0      0 0 −2 0 0 −2

Maple Mathematica SymPy Sage          −5   −5   −5   −5                   −2 1   −2 1   −2 1   −2 1          −2 −2 −2 −2 3 Prior Work

• Arnol’d, V.I.: On matrices depending on parameters. Russian Mathematical Surveys 26(2) (1971) 29–43 • Chen, G.: Computing the normal forms of matrices depending on parameters. In: Proceedings of ISSAC 1989, ACM (1989) 242–249

4 Prior Work

• Ballarin, C., Kauers, M.: Solving parametric linear systems. ACM SIGSAM Bulletin 38(2) (2004) 33–46 • Broadbery, P.A., Gómez-Díaz, T., Watt, S.M.: On the implementation of dynamic evaluation. In: Proceedings of ISSAC 1995, ACM (1995) 77–84 • Diaz-Toca, G.M., Gonzalez-Vega, L., Lombardi, H.: Generalizing Cramer’s rule. SIAM Journal on and Applications. 27(3) (2005) 621–63 • Kapur, D.: An approach for solving systems of parametric polynomial equations. Principles and Practices of Constraint Programming (1995) 217–244 • Sit, W.Y.: An algorithm for solving parametric linear systems. Journal of Symbolic Computation. 13(4) (1992) 353–394

5 Regular Chain Theory Notation

• Let K be a field,

• Let X1 < ··· < Xs be s ≥ 1 ordered variables,

• K[X1,..., Xs] = K[X] is the ring of polynomials in X = X1,..., Xs • For a non-constant p ∈ K[X], mvar(p) denotes the greatest variable in p • The leading coefficient of p w.r.t. mvar(p) is called the initial denoted init(p)

6 Regular Chain

Triangular Set A set T of non-constant polynomials in K[X] is called a triangular set if for all p, q ∈ T with p ≠ q, mvar(p) ≠ mvar(q) .

Saturated Ideal ⟨ ⟩ ∞ The saturated ideal, sat(T) of T is the ideal T : hT , where hT is the product of the initials of the polynomials in T

Regular Chain T is a regular chain if T = ∅ or T = T′ ∪ {t} for t ∈ T with mvar(t) maximum such that

• T′ is a regular chain • init(t) is regular modulo sat(T′) 7 Regular Chain

Solution Set s For a set of polynomials F ⊂ K[X1,..., Xs], V(F) ⊆ K consists of all common roots of the polynomials in F

Quasi-component

The quasi-component of a triangular set is defined as W(T) = V(T) \ V(hT) where hT is the product of the initials of T.

8 Regular System

Regular System Given a regular chain T ⊂ K[X] and a set of polynomials H ⊂ K[X], the pair [T, H] is a regular system if each polynomial h ∈ H is regular modulo sat(T). The zero set of [T, H] is denoted Z(T, H) = W(T) \ V(H).

9 Square-free Factorization over a Regular System

The function1 Squarefree_RC(p, T, H) computes a set of triples (( ,..., ), , ) ≤ ≤ [ , ],..., [ , ] bi,1 bi,ℓi Ti Hi with 1 i e such that T1 H1 Te He are regular systems forming a triangular decomposition of Z(T, H). For all 1 ≤ i ≤ e:

1. b ,..., b are polynomials with the same main variable v = mvar(p) such i,1 ∏i,ℓi ≡ ℓi j ( ) that p j=1 bi,j mod sat Ti ,

2. All discriminants disc(bi,j, v) are regular modulo sat(Ti) 3. All resultants res(b , b , v) are regular modulo sat(T ) ∏ i,j i,k i ℓi j 4. j=1 bi,j is a square-free factorization of p modulo sat(Ti)

1Chen, C., Moreno Maza, M.: Algorithms for computing triangular decomposition of polynomial systems. Journal of Symbolic Computation, 47(6) (2012) 610–642

10 Theory

n n−1 Let ψ(x) = x + an−1x + ··· + a1x + a0. The Frobenius companion matrix of ψ(x) is   0 0 ··· 0 −a  0   ··· −  1 0 0 a1   ··· −  C(ψ(x)) = 0 1 0 a2   . . . . .   ...... 

0 0 ··· 1 −an−1

11 Frobenius Form

A matrix F ∈ Kn×n is in Frobenius form if   C(ψ (x))  1     C(ψ2(x))  F =  .   .. 

C(ψm(x)) | − and ψi+1 ψi for i = 1,..., m 1.

12 Properties of Frobenius Form

• The polynomials ψi are called the invariant factors of F. • ψ is the minimal polynomial of F ∏1 m • i=1 ψi is the characteristic polynomial of F • There exists a non-singular matrix Q such that F = Q−1AQ is in Frobenius form • The geometric multiplicity of a eigenvalue λ of F is the number of invariant factors it is a solution of.

13 Computing the Frobenius Form

• Ozello, P. (1987). Calcul exact des formes de Jordan et de Frobenius d’une matrice (Doctoral dissertation, Université Joseph-Fourier-Grenoble I). • Storjohann, A. An O(n3) algorithm for the . In Proceedings of ISSAC 1998, ACM (1998) 101–105.

14 Jordan

A Jordan block is a matrix of the form   λ 1    λ   1   . .  JBMm(λ) =  .. ..     λ 1 λ

• JBMm(λ) has a single eigenvalue λ • λ has geometric multiplicity 1

15 Jordan Canonical Form

A matrix in Jordan canonical form is of the form  

JBMm1 (λ1)  .   .. 

JBMmℓ (λℓ)

16 Frobenius Form to Jordan Form

  C(ψ (x))  1     C(ψ2(x))  F =  .   .. 

C(ψm(x))

The Jordan canonical form of F is   JCF(C(ψ (x)))  1     JCF(C(ψ2(x)))   .   .. 

JCF(C(ψm(x)))

17 Jordan Form of a Companion Matrix

The JCF of a companion matrix C(ψ(x)) is   JBM (λ )  m1 1   (λ )   JBMm2 2  JCF(C(ψ(x))) =  .   .. 

JBMmℓ (λℓ) where

∏ℓ − mi ψ(x) = (x λi) i=1 ̸ ̸ with λi = λj for i = j. 18 JCF Over a Splitting Example

Consider the companion matrix   0 0 −1   A = 1 0 3  0 1 1

Maple computes the JCF as  √ √  3 −1/3 26 + 6 33 + 8/3 √ 1 √ + 1/3 0 0  3   26+6 33 ( )   √ √ √ √ √   3 3  − √ 1 √ − − − √ 1 √ JCF(A) =  0 1/6 26 + 6 33 4/3 3 + 1/3 i/2 3 1/3 26 + 6 33 8/3 3 0   26+6 33 26+6 33   ( )   √ √ √ √ √  3 3 − √ 1 √ − − √ 1 √ 0 0 1/6 26 + 6 33 4/3 3 + 1/3 + i/2 3 1/3 26 + 6 33 8/3 3 26+6 33 26+6 33

19 Example

  1 − y − y 0 0  2 1  JCF(A) =  0 y1 0  0 0 y2

where (y1, y2) is any point in the zero set V(T) of   2 2 y + (y2 − 1)y1 + y − y2 + 3 T = 1 2  3 − 2 y2 y2 + 3y2 + 1

20 Objective

Given a monic polynomial ψ(x) ∈ K[x], and its companion matrix C(ψ(x)) ∈ Kn×n,

find a regular chain T ⊂ K[y1,..., ys] such that the JCF of C(ψ(x)) can be computed over the splitting field2 generated by T. i.e. any point p ∈ V(T) defines the splitting field of T: L = K(p).

2Landau, S. (1985). Factoring polynomials over algebraic number fields. SIAM Journal on Computing, 14(1), 184-195.

21 Algorithm

Input: A square-free polynomial p ∈ K[x] Algorithm: L K {} P {} F { } 1. Initialize i := 1, yi := x, := , T := , = and := p . 2. While F is not empty do ∈ F L a. Pick a polynomial f(yi) over , b. Let αi be a root of f(yi) L L c. Replace by (αi) ∪ { } d. Replace T by T ti(y1,..., yi) where ti(y1,..., yi) is obtained from f(yi) after replacing the algebraic numbers α1, . . . , αi−1 with the variables y1,..., yi−1 P P ∪ { − } e. Replace by x yi

22 Algorithm

L f. Factor f(yi) into irreducible factors over (Trager, Algebraic factoring and rational function integration) P • Add the degree 1 factors to after replacing α1, . . . , αi−1 with y1,..., yi−1 F • Add the degree greater than 1 factors to , replace yi with yi+1 g. If F is not empty, i := i + 1

After this algorithm has terminated, T is a regular chain in K[y1,..., ys] such that K[y1,..., ys] \⟨T⟩ is isomorphic to the splitting field K(p).

23 JCF of a Matrix with Parameters Parametric Frobenius Form

Frobenius Form

• Storjohann, A. An O(n3) algorithm for the Frobenius normal form. In Proceedings of ISSAC 1998, ACM (1998) 101–105. • Corless, R. M., Maza, M. M., & Thornton, S. E. (2015). Zigzag Form over Families of Parametric Matrices. ACM Communications in Computer Algebra, 48(3/4), 109-112.

Smith Form The invariant factors of A are the non-constant polynomials on the diagonal of the Smith form of xI − A.

• Kaltofen, E., Krishnamoorthy, M., Saunders, B.D.: Fast parallel algorithms for similarity of matrices. In: Proceedings of the fifth ACM Symposium on Symbolic and Algebraic Computation, ACM (1986) 65–70

24 Objective

Given a monic univariate parametric polynomial ψ(x; α1, . . . , αs) ∈ K[α1, . . . , αs][x], n×n and its companion matrix C(ψ) ∈ K [α1, . . . , αs], find a partition (S1,..., SM) of Ks { } and a set of matrices J1,..., JM , such that Ji is continuously the JCF of ∗ ∗ ∈ C(ψ(x; α )) for all points α Si.

25 Square-free Factorization

Let ∏ℓ i p(x; α) = bi(x; α) i=1 be a square-free factorization of p(x; α). Specializes Well ∗ s b1,..., bℓ specializes well at a point α ∈ K if

∗ 1. The degree of bi(x; α ) is the same as the degree of bi(x; α) in x, ∗ 2. bi(x; α ) is square-free, ∗ ∗ ̸ 3. The GCD of bi(x; α ) and bj(x; α ) has degree zero for all i = j.

26 Specializes Well

b1,..., bℓ specializes well at all points in the complement of { } { } i∪=ℓ ∪ ∪ Proviso(b1,..., bℓ) = V(∆i) V(Ri,j) i=1 1≤i≤j≤ℓ

where

• ∆i is the discriminant of bi in x

• Ri,j is the resultant of bi and bj w.r.t. x

27 JCF in Complement of Proviso

λ , . . . , λ ≤ ≤ ℓ α • Let i,1 i,ni be the roots (in x) of bi (1 i ) as functions of ,

• The JCF of C(ψ(x)) in the complement of Proviso(b1,..., bℓ) is

⊕ℓ ⊕ni JBMi(λi,j) i=1 j=1

28 JCF in Proviso

• Let [T1, H1],..., [Te, He] be a triangular decomposition of Proviso(b1,..., bℓ) into regular systems, ≤ ≤ • For each regular system [Ti, Hi] (1 i e): (( ,..., ), , ) • Let bj,1 bj,ℓj Ti,j Hi,j be the output of Squarefree_RC(ψ(x; α), Ti, Hi), • For each j: λ , . . . , λ ≤ ≤ ℓ ,..., • Let 1,k n,k (1 k j) be the roots (in x) of bj,1 bj,ℓj as functions of α, ∗ ∈ • The JCF of C(ψ(x)) for all points α Z(Ti,j, Hi,j) is

⊕ℓj ⊕n JBMk(λi,k) k=1 i=1

29 Example

Consider the Jacobian matrix of a dynamical system3 at equilibrium   0 2ρ 0   A = a 2β 2v b −2v 2β The JCF of A can take each of the 5 possible Jordan structures for a 3 × 3 matrix. We find 46 cases. For example, the JCF of A is     2 2β 0 0 2ρa + β = 0     0 β 1 with v = 0  0 0 β a ≠ 0, ρ ≠ 0, β ≠ 0

3Van Gils, S., Krupa, M., Langford, W.F.: Hopf bifurcation with non-semisimple 1:1 resonance. Nonlinearity 3(3) (1990) 825

30 Future Work Improvements to the JCF Computation

• Improved Frobenius form/Smith form implementation • Real valued parameters • Similarity • Complexity estimate

31 A Maple Package for Parametric Matrix Computations

The ParametricMatrixTools package contains methods for computing:

• Smith form • Frobenius form • • Minimal polynomial • Jordan form • Weyr form4

4K. O’Meara, J. Clark, and C. I. Vinsonhaler. Advanced Topics in Linear Algebra: Weaving Matrix Problems through the Weyr Form. Oxford, USA, 2011.

32 Code & Examples

The ParametricMatrixTools package is available at github.com/steventhornton/ParametricMatrixTools Information on the RegularChains package of Maple is available at RegularChains.org

33