ClearAll["Global`*"]
SetAttributes[Rs,Constant]
$Assumptions=Rs>0;
Coordinates={t,r,θ,ϕ};
dim=Length[Coordinates];

MetricTensorLL={{(1-Rs/r),0,0,0},{0,-(1-Rs/r)^-1,0,0},{0,0,-r^2,0},{0,0,0,-r^2 Sin[θ]^2}};

MetricTensorUU:=MetricTensorUU=Simplify[Inverse[MetricTensorLL]];

ChristoffelSymbolsULL:=ChristoffelSymbolsULL=Simplify@Array[1/2 Sum[MetricTensorUU[[#1,λ]] (D[MetricTensorLL[[#3,λ]],Coordinates[[#2]]]+D[MetricTensorLL[[λ,#2]],Coordinates[[#3]]]-D[MetricTensorLL[[#2,#3]],Coordinates[[λ]]]),{λ,dim}]&,{dim,dim,dim}];

ChristoffelSymbolsLLL:=ChristoffelSymbolsLLL=Simplify@Array[1/2 (D[MetricTensorLL[[#1,#2]],Coordinates[[#3]]]+D[MetricTensorLL[[#1,#3]],Coordinates[[#2]]]-D[MetricTensorLL[[#2,#3]],Coordinates[[#1]]])&,{dim,dim,dim}];

RiemannCurvatureTensorULLL:=RiemannCurvatureTensorULLL=Simplify@Array[D[ChristoffelSymbolsULL[[#1,#2,#4]],Coordinates[[#3]]]-D[ChristoffelSymbolsULL[[#1,#2,#3]],Coordinates[[#4]]]+Sum[ChristoffelSymbolsULL[[#1,#3,ϵ]] ChristoffelSymbolsULL[[ϵ,#2,#4]],{ϵ,dim}]-Sum[ChristoffelSymbolsULL[[#1,#4,ϵ]] ChristoffelSymbolsULL[[ϵ,#2,#3]],{ϵ,dim}]&,{dim,dim,dim,dim}];

RiemannCurvatureTensorLLLL:=RiemannCurvatureTensorLLLL=Simplify@Array[Sum[MetricTensorLL[[#1,τ]] RiemannCurvatureTensorULLL[[τ,#2,#3,#4]],{τ,dim}]&,{dim,dim,dim,dim}];

RiemannCurvatureTensorUUUU:=RiemannCurvatureTensorUUUU=Simplify@Array[Sum[MetricTensorUU[[#2,α]] MetricTensorUU[[#3,β]] MetricTensorUU[[#4,γ]] RiemannCurvatureTensorULLL[[#1,α,β,γ]],{α,dim},{β,dim},{γ,dim}]&,{dim,dim,dim,dim}];

RiemannCurvatureTensorLL:=RiemannCurvatureTensorLL=Simplify@Array[Sum[RiemannCurvatureTensorULLL[[λ,#1,λ,#2]],{λ,dim}]&,{dim,dim}];

RiemannCurvatureTensorUL:=RiemannCurvatureTensorUL=Simplify@Array[Sum[MetricTensorUU[[#1,λ]] RiemannCurvatureTensorLL[[λ,#2]],{λ,dim}]&,{dim,dim}];

ScalarCurvature:=ScalarCurvature=Tr[RiemannCurvatureTensorUL];

KretschmannScalar:=KretschmannScalar=Simplify@Sum[RiemannCurvatureTensorLLLL[[α,β,γ,δ]] RiemannCurvatureTensorUUUU[[α,β,γ,δ]],{α,dim},{β,dim},{γ,dim},{δ,dim}];

WeylCurvatureTensorLLLL:=WeylCurvatureTensorLLLL=Simplify@Array[If[dim>3,RiemannCurvatureTensorLLLL[[#1,#2,#3,#4]]-1/(dim-2) (MetricTensorLL[[#1,#3]] RiemannCurvatureTensorLL[[#4,#2]]+MetricTensorLL[[#2,#4]] RiemannCurvatureTensorLL[[#3,#1]]-MetricTensorLL[[#1,#4]] RiemannCurvatureTensorLL[[#3,#2]]-MetricTensorLL[[#2,#3]] RiemannCurvatureTensorLL[[#4,#1]])+ScalarCurvature/((dim-1) (dim-2)) (MetricTensorLL[[#1,#3]] MetricTensorLL[[#4,#2]]-MetricTensorLL[[#1,#4]] MetricTensorLL[[#3,#2]]),0]&,{dim,dim,dim,dim}];

EinsteinTensor:=EinsteinTensor=Simplify[RiemannCurvatureTensorLL-1/2 MetricTensorLL ScalarCurvature];

ConformallyFlatSpaceQ:=ConformallyFlatSpaceQ=Simplify[Equal[Sequence@@Flatten@WeylCurvatureTensorLLLL,0]];

MaximallySymmetricSpaceQ:=MaximallySymmetricSpaceQ=Simplify[And@@Flatten@Map[#==0&,RiemannCurvatureTensorLLLL-Array[ScalarCurvature/(dim (dim-1)) (MetricTensorLL[[#1,#3]] MetricTensorLL[[#2,#4]]-MetricTensorLL[[#1,#4]] MetricTensorLL[[#2,#3]])&,{dim,dim,dim,dim}],{4}]];

ArrayRules[RiemannCurvatureTensorULLL]