Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to Mathematica. When I do linear algebra, I wonder if I can have an inequality such as $\mathbf x^\prime\mathbf A\mathbf x > \mathbf x^\prime\mathbf x$, where $\mathbf x$ is a column vector and $\mathbf A$ is an $n\times n$ matrix, reduced to something like "$\mathbf I-(\mathbf A^\ast+\mathbf A)/2$ is positive definite".

share|improve this question
I don't think Mathematica has those kinds of concepts with respect to matrices as symbolic objects, but there is a function PositiveDefiniteMatrixQ if you have some particular matrix whose positive-definiteness you want to test. – Xerxes Feb 6 '13 at 6:54
up vote 1 down vote accepted

Here is something that might at least go in the right direction. It's not at the fully symbolic level you're looking for, because most matrix calculations require specifying an actual number for the dimension. So here I'll look at $2\times 2$ matrices only:

  {x1, x2}, 
  {x1, x2}.{{a11, a12}, {a21, a22}}.{x1, x2} >= {x1, x2}.{x1, x2}

==> (a12 | a21 | a22) \[Element] 
  Reals && ((a11 == 1 && a12 + a21 == 0 && a22 >= 1) || (a11 >= 1 && 
     a12 + a21 == 0 && 
     a22 >= 1 && -4 a11 - a12^2 - 2 a12 a21 - a21^2 - 4 a22 + 
       4 a11 a22 >= -4) || (a11 > 
      1 && -4 a11 - a12^2 - 2 a12 a21 - a21^2 - 4 a22 + 
       4 a11 a22 >= -4))

The answer gives the combination of conditions under which the expression holds, in terms of the four matrix elements individually.

share|improve this answer
Thank you, it helps, I wasn't aware of the function "ForAll", I think a lot of work has been done at the conceptual level, e.g. a computer science challenge given in 2005 is "Formalize and verify by computer Wiles's proof of Fermat's Last Theorem" – Lafix Feb 7 '13 at 5:50
Well, I think we're very far away from that in this question.... – Jens Feb 7 '13 at 6:20
Sorry, I mean it may be possible to symbolically manipulate matrices after all, I'm not sure if there are packages out there that can do this. I'll post it here if I find anything. – Lafix Feb 7 '13 at 7:40
It seems that V9 has added some new functionality. that could possibly help. – Lafix Feb 7 '13 at 8:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.