I would like to prove that the scalar action is dilatation invariant.
(m,n,p,q)::Indices(position=free).
\eta_{m n}::Metric.
\eta^{m n}::InverseMetric.
\eta^{m}_{n}::KroneckerDelta.
\eta_{n}^{m}::KroneckerDelta.
\partial{#}::PartialDerivative.
\phi::Depends(\partial{#}).
x^{m}::Depends(\partial{#}).
S := -1/2 \int{ \partial_{m}{\phi} \partial^{m}{\phi}}{x};
$$
S := -1/2 \int{ \partial_{m}{\phi} \partial^{m}{\phi}} \ {dx};
$$
\delta::Accent.
dil:= \delta{\phi}= \alpha x^{m} \partial_{m}{\phi} + \alpha \phi;
$$
\delta{\phi}= \alpha x^{m} \partial_{m}{\phi} + \alpha \phi;
$$
vary(S, \$ \phi -> \delta{\phi} \$).
substitute(S,dil).
distribute(S).
product_rule(S).
unwrap(S);
$$\begin{gathered} -1/2 \int\left(\left(\alpha \partial_{m}{x^{n}} \partial_{n}{\phi}+\alpha x^{n} \partial_{m n}{\phi}\right) \partial^{m}{\phi}\\ +\alpha \partial_{m}{\phi} \partial^{m}{\phi}+\partial_{m}{\phi} \left(\alpha \partial^{m}{x^{n}} \partial_{n}{\phi}+\alpha x^{n} \partial^{m}_{n}{\phi}\right)+\partial_{m}{\phi} \alpha \partial^{m}{\phi}\right)\, {\rm d}x
\end{gathered}
$$
Now how do I tell $\partial_{m} x_{n} = \eta_{m n}$ without exploiting free index structure.
Does Cadabra understand that?
I tried to force it using a relation, but later Cadabra fails to identify indices as free.