Cosmology derivation

Section 1: Setup the metric

(* Defining coordinate system *)
coord={r,θ,ϕ};
(* Set these variable for coordinate, hopefully mathematica will be smarter when we Simplify *)
(* Noted that e is an expansions parameter *)
$Assumptions=t∈Reals&&r∈Reals&&θ∈Reals&&ϕ∈Reals&&e∈Reals;
(* Defining the metric*)

metric = DiagonalMatrix[{((R[t])^2) ((f[r])^2),((R[t])^2)(r^2),((R[t])^2)(r Sin[θ])^2}];
metricsign=1;

metric //MatrixForm

(* Load the package from the folder which you put diffgeo.m*)
SetDirectory["C:\Users\15-P240TX\Documents"]
<<diffgeo.m

Section 2 : The equation of motion, typical Einstein equation + cosmological constant

?Einstein

?Riemann

display[Riemann]//FullSimplify

RicciScalar//FullSimplify

DSolve[-((2 (-f[r]+((f[r])^3)+2 r f'[r]))/((r^2) ((f[r])^3) ))==-C,f,r]//FullSimplify

(1/(Sqrt[1-(C/6) (r^2)+ ((C[1])/r)]))

?Christoffel

display[Christoffel]