# Problem verifying expression with 3D vectors

I am unable to verify that my vector expressions are equivalent. I want it to say true or false.

 Remove["Global*"]

$$Assumptions = e ∈ Vectors[3, Reals]$$Assumptions = a ∈ Vectors[3, Reals]
$Assumptions = p ∈ Vectors[3, Reals] p = a - (a.e) e TensorExpand[p.p] == (a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e)) (a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e)) == ((a - \ (a.e) e).(a - (a.e) e)) TensorExpand[p.p] == Norm[a]^2 - (a.e)^2 (*e has length 1*)  What I ultimately want is to find (using mathematica) is the angle between vectors a and b. I'm given the lengths of a and b as 156 and Dot[a,e]== Dot[b,e]==90. vectors p and q are the projections of a and b onto a plane. Angle between p and q is 120. Now I have this code that is no good. $Assumptions = (a | e) \[Element] Vectors[3, Reals] && e.e == 1 &&
a.e == b.e == 90  && Sqrt[a.a] == 156 == Sqrt[b.b];
p = a - (a.e) e;
q = b - Dot[b, e] e;
Simplify[TensorExpand[a.b], Sqrt[a.a] == 156 == Sqrt[b.b]]


You can prove using TensorExpand

TensorExpand[p.p] == (a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e))
(* True *)

• why is p vector's colour black while a and e are blue? How can I get the absolute value of a vector as Abs[] function is for reals or complex not vector? – Megamatics Nov 7 '18 at 12:13

You need to define $Assumptions just once, instead of 3 different times. In your code, the only assumption Mathematica uses is p ∈ Vectors[3, Reals]. Also, use a.a instead of Norm[a]^2. Finally, you also need to include your condition that e.e == 1. So: $Assumptions = (a | e) ∈ Vectors[3, Reals];
p = a - (a.e) e;
Simplify[
TensorExpand[p.p == a.a - (a.e)^2],
e.e == 1
]


True

To address the OP question about assumptions, you can combine assumptions using And (&&):
$Assumptions = (a | e) ∈ Vectors[3,Reals] && e.e == 1; p = a-(a.e) e; Simplify @ TensorExpand[p.p==a.a-(a.e)^2]  True TensorExpand will not use the e.e == 1 assumption, so you will need to include Simplify` to take account of that assumption. As for an angle assumption, do you have an example? • Is it possible to combine within the same$Assumption statement the attributes that a is a 3-D vector with its Euclidean length? I don't know how to specify that a vector has a particular length other than through its dot product in Mathematica. Can the known angle between two vectors in the same plane also be given as a general assumption? – Megamatics Nov 9 '18 at 12:35