Hi again raulastur.
Perhaps this would be repetitive, since Arina already post an answer to your question... but Ok, we learn by asymptotic approximation!
Modifications to your work
As usual, you have to declare the objects and properties
{\mu,\nu,\rho,\sigma,\kappa,\lambda,\eta,\chi#}::Indices(full, position=fixed, values={1,2,3,4}).
{A,B,C,D}::Indices(subspace, position=fixed, parent=full, values={2,3,4}).
{i,j, m,n,p,q,r,v#}::Indices(subspace2, position=fixed, parent=subspace, values={2,3}).
{s1,s2,s3}::Indices(subspace1, position=fixed, parent=subspace, values={4}).
\partial{#}::PartialDerivative.
g_{\mu\nu}::Metric.
g^{\mu\nu}::InverseMetric.
g_{\mu? \nu?}::Symmetric.
g^{\mu? \nu?}::Symmetric.
b_{i j}::Metric.
b^{i j}::InverseMetric.
{\delta^{\mu?}_{\nu?},\delta_{\mu?}^{\nu?}}::KroneckerDelta.
{b_{i j},b^{i j}}::Depends(\partial{#}).
I wanted to keep your definitions almost untouched.
I've added the dependence of the $b$ field on the partial derivative (although it is not important in the following code.
Then, I assume that the long sequence of substitutions would be applied to other expressions as well, so instead of your approach, I prefer to define a set of substitution rules
rl := { g_{1 m} -> 0, g_{1 4} -> 1, g_{m 1} -> 0, g_{m n} -> b_{m n}, g_{m 4} -> U_{m}, g^{4 1} -> 1,
g_{4 m} -> U_{m}, g_{4 4} -> f, g^{1 1} -> U_{m} b^{m n} U_{n} - f, g^{1 m} -> - U_{n} b^{n m}, g^{1 4} -> 1,
g^{m 1} -> - U_{n} b^{n m}, g^{m n} -> b^{n m}, g^{m 4} -> 0, g^{4 1} -> 1, g^{4 m} -> 0, g^{4 4} -> 0,
\partial_{1}{U_{m}} -> 0, \partial_{1 \mu?}{U_{m}} -> 0,
\partial_{\mu? 1}{U_{m}} -> 0, \partial_{\mu? 1}{b_{i j}} -> 0};
Above, I changed the substitutions that used double question marks, U??
or other.
Also include the Christoffel definition
Gtog:= \Gamma^{\lambda?}_{\mu? \nu?} = (1/2) * g^{\lambda? \kappa} (\partial_{\nu?}{ g_{\kappa \mu?}}
+ \partial_{\mu?}{g_{\kappa \nu?}} + \partial_{\kappa}{g_{\mu? \nu?} } );
Note that the summed index has to run over the full
space, while the other indices have the question mark (?
) to ensure that the rule could be applied to whatever type of index (like 4
).
Now, I define the expression to be manipulated,
Gamma4ij := \Gamma^{4}_{i j};
and expand the indices
substitute(Gamma4ij, Gtog)
split_index(Gamma4ij, $\mu, 1, A$, repeat=True)
split_index(Gamma4ij, $A, i, 4$, repeat=True);
Finally, I use the substitution rule rl
to obtain the result:
substitute(Gamma4ij, rl, repeat=True);
The result I obtain is $\partial1 b{i j}$.
Why?
When you used the double question mark notation, U??
, in the substitution rule, it would substitute not just the variable called U
, but any variable. Look at this example:
ex:=A_{m n} + B_{m n};
substitute(_, $A? + B? -> 0$ );
substitute(_, $M?? + N?? -> 0$ );
Hope this would help you.
Dox