# Symmetry of a Dot with functions with arguments

Seemingly an easy question, but I'm trying to avoid using a straight replacement rule.

As an example, I could take a term like

p[i].p[j]-p[j].p[i]


where this dot product is symmetric, and so should evaluate to zero.

I'm trying to avoid using a replacement rule, since I'm trying to generalise. I have tried using Signature and Sort to try and automatically swap the latter term by canonical sorting, but to no avail.

Any suggestions would be welcome!

EDIT: I think I will extend my question to get the exact answer I am searching for. I'm using a recursion relation to generate a load of terms, which involve these dot products.

I am looking to basically express any dot product which is has a signature of -1 from canonical order as the reversed order, to lead to some nice cancellations:

For any choice of i,j, I'm looking to get something like:

If[Signature[p[i_].p[j_]]==-1, Return[p[j].p[i]]]


Can this be easily achieved?

EDIT2: I think the answer lies in ConditionalReplace. Let me try muddling.

You could use TensorReduce:

TensorReduce[
p[i].p[j] - p[j].p[i],
Assumptions -> (p[i] | p[j]) ∈ Vectors[d]
]


0

• I like the look of that. Could you explain why it works? Could I not assume vectors in the original dot product somehow?
//.{p[b_].p[a_]:> p[a].[b]}

p[a_].p[b_]/;Signature[p[a].p[b]]==-1:>p[b].p[a]