# Are variables always assumed to be real in Jordan Decomposition?

If you give the following input in Mathematica 9.0 (Student Edition):

JordanDecomposition /@ ({{1, #}, {#, -1}} & /@ {i, I})


Mathematica gives you two completely different results. Shouldn't there be several cases for the decomposition in case that the eigenvalues are undefined or coincide?

• Symbolic linear algebra in Mathematica assumes generic values for symbols. No error here (other than in the flagging of the question). May 3, 2015 at 20:38
• @DanielLichtblau yeah but there is no tag like "mathematica behaves different to what i expect" :) May 4, 2015 at 13:46
• An "Unexpected result" tag could indeed be useful. Though I expect it might get used to the point of not retaining much meaning. May 4, 2015 at 13:52

To settle this once and for all:

Consider the Jordan decomposition of a symbolic generalization of your matrix:

jd[x_, y_] = JordanDecomposition[{{1, x + I y}, {x + I y, -1}}]


whose explicit expression is

   {{{(1 - Sqrt[1 + x^2 + 2 I x y - y^2])/(x + I y),
(1 + Sqrt[1 + x^2 + 2 I x y - y^2])/(x + I y)}, {1, 1}},
{{-Sqrt[1 + x^2 + 2 I x y - y^2], 0}, {0, Sqrt[1 + x^2 + 2 I x y - y^2]}}}


Of note in this result is that the second element is a diagonal matrix, thus showing that JordanDecomposition[] tacitly assumes diagonalizability. We also note that one of the eigenvalues is the negative of the other; we can thus expect failure if these eigenvalues both become equal; that is:

Reduce[1 + x^2 + 2 I x y - y^2 == 0 && x ∈ Reals && y ∈ Reals]
(y == -1 && x == 0) || (y == 1 && x == 0)


Or put another way,

x + I y /. {ToRules[%]}
{-I, I}


These are our problem points. Check:

jd[0, -1]
{{{I, I}, {1, 1}}, {{0, 0}, {0, 0}}}

jd[0, 1]
{{{-I, -I}, {1, 1}}, {{0, 0}, {0, 0}}}


and we see that the results here are not what they should be:

JordanDecomposition[{{1, -I}, {-I, -1}}]
{{{I, I}, {1, 0}}, {{0, 1}, {0, 0}}}

JordanDecomposition[{{1, -I}, {-I, -1}}]
{{{-I, -I}, {1, 0}}, {{0, 1}, {0, 0}}}


Ah, there's that Jordan block!

In summary, per Daniel's comment:

Symbolic linear algebra in Mathematica assumes generic values for symbols.

In other words: JordanDecomposition[] won't assume your matrix is defective unless it actually is.

From the tutorial on Advanced Matrix Operations,

"Jordan decomposition in general writes any square matrix in the form as s.j.s^-1."

It does not state that the form is unique.

m1 = {{1, i}, {i, -1}};

{s1, j1} = JordanDecomposition[m1]


{{{(1 - Sqrt[1 + i^2])/i, (1 + Sqrt[1 + i^2])/i}, {1, 1}}, {{-Sqrt[1 + i^2], 0}, {0, Sqrt[1 + i^2]}}}

m1 == s1.j1.Inverse[s1] // Simplify


True

m2 = m1 /. i -> I;

{s2, j2} = JordanDecomposition[m2]


{{{-I, -I}, {1, 0}}, {{0, 1}, {0, 0}}}

m2 == s2.j2.Inverse[s2]


True

Consequently, both are valid Jordan decompositions and neither assumes or requires that matrix values be real.

• But the form is unique up to Permutation of the blocks, here one time we have a diagonal Matrix and one time, we don't have, that is impossible May 3, 2015 at 15:14