<<xAct`xTensor`

<<xAct`ShowTime1`

$PrePrint=ScreenDollarIndices;

$DefInfoQ=False;

DefManifold[M,4,{a,b,c,d,e,g,h,i,j,k,l,m,o,p,q,r,s,t,u,w,x,y,z}];
DefMetric[-1,gm[-a,-b],CD,PrintAs->"g"];
SetOptions[ContractMetric,AllowUpperDerivatives->True];

DefTensor[n[a],M];
AutomaticRules[n,MakeRule[{n[a]n[-a],-1}]];
AutomaticRules[n,MakeRule[{gm[-a,-b]n[a]n[b],-1}]];
$ExtrinsicKSign=-1;
$AccelerationSign=-1;
DefMetric[1,hm[-a,-b],sd,{"|","D"},InducedFrom->{gm,n},PrintAs->"h"];

EqToRule[expr_]:=MakeRule[Evaluate[List@@expr],MetricOn->All,ContractMetrics->True]

CD[Dir[n[a]]][n[a]]

%==ToCanonical@GradNormalToExtrinsicK@SeparateDir@%

AutomaticRules[n,EqToRule@%]

DefTensor[f[],M]

DefInertHead[Deltat,PrintAs->"Δt"];

DeltatRule=Deltat[expr_]:> ToCanonical@GradNormalToExtrinsicK[LieD[n[a],CD][LieD[n[b],CD][expr]]];

DefInertHead[Deltax,PrintAs->"Δx"];

DeltaxRule=Deltax[expr_]:>Module[{r,s},ToCanonical@GradNormalToExtrinsicK@ContractMetric@ProjectorToMetric[hm[r,s]ProjectWith[hm][CD[-r]@(ToCanonical@GradNormalToExtrinsicK@ContractMetric@ProjectorToMetric[ProjectWith[hm][CD[-s]@expr],hm])],hm]];

Dtfeq=Deltat[f[]]==(Deltat[f[]]/.DeltatRule)

Deltax/@Dtfeq

piece11eq=%[[1]]==(%[[2]]/.DeltaxRule)

Deltat/@piece11eq;

DtDxDtf=%[[1]]==(%[[2]]/.DeltatRule);

Deltax/@DtDxDtf;

one=%[[1]]==(%[[2]]/.DeltaxRule);

Length@one[[2]]