Lets do the easy one first. TrueQ[x^2 == x*x]
returns True
since x*x
is converted to x^2
automatically before the test is even done. If you type x*x
you'll see the FE returns x^2. Hence now both the left and right side are exactly the same When the kernel gets hold of them. a==a
which is Equal[a,a]
automatically converted to True
for any a
. So it becomes TrueQ[True]
which returns True
For the other examples, the argument to TrueQ
was is not explicitly True
, hence TrueQ
returned False
. The argument to TrueQ
has to be an explicit True
for TrueQ
to return True
.
You need to use SameQ
for the other 2 examples
SameQ[(m^2 - n^2)^2 + (2 m*n)^2 == (m^2 + n^2)^2]
gives True
. This is because SameQ[Equal[a,b]]
return True
if Equal[a,b]
itself returns True
, which it does in this case.
Simplify@Equal[(m^2 - n^2)^2 + (2 m*n)^2, (m^2 + n^2)^2]
gives True
. So SameQ[True]
is True
The bottom line is this: TrueQ[expression]
is the same as SameQ[Equal[expression]]