# Why is zero times vector of reals not zero?

Using the following global assumptions

\$Assumptions = Element[n, Integers] && Element[a, Vectors[n, Reals]] && b == 0 && Element[c, Reals]

I assumed that Refine[a.b]

returns 0. Instead, it returns [a.0], which again according to my knowledge should be a vector of n zeros.

Refine[b*c]

works as expected and returns zero.

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey May 8 '15 at 21:43

You've used the dot product operator (.) instead of the times operator (*). In some languages like Matlab, * is the dot operator, but in Mathematica they are different.

{1,2,3} * 0 == {0,0,0}
{1,2,3} * {0,0,0} == {0,0,0}
{1,2,3} . {0,0,0} == 0


Since you are refining a vector dotted with 0, Mathematica doesn't know how to simplify this, so it simply returns the expression a.0.

Curiously,

Refine[a*0, Assumptions -> Element[a, Vectors[n, Reals]]]


and

Refine[a*b, Assumptions -> {Element[a, Vectors[n, Reals]], b==0}]


both yield 0 as well, even if n is replaced by a number like 10; I suspect that this is due to a shortcut Mathematica takes in seeing a*0 passed to Refine, but I'm not sure why this particular instance yields 0.

• TensorExpand[Refine[a.b]] – chuy May 8 '15 at 22:05