{ "cells": [ { "cell_type": "markdown", "id": "3d78e68b", "metadata": {}, "source": [ "# Riemann Curvature Tensor of $S^2$\n", "\n", "A round 2-sphere of radius $r$ has constant sectional curvature\n", "$1/r^2$. This notebook builds its metric, Levi-Civita connection, Riemann\n", "tensor, Ricci tensor, and scalar curvature in indexed Egison notation.\n", "\n", "We use the convention\n", "\n", "$$\n", "R^i{}_{jkl}\n", " = \\partial_k\\Gamma^i{}_{jl}\n", " - \\partial_l\\Gamma^i{}_{jk}\n", " + \\Gamma^m{}_{jl}\\Gamma^i{}_{mk}\n", " - \\Gamma^m{}_{jk}\\Gamma^i{}_{ml}.\n", "$$\n" ] }, { "cell_type": "markdown", "id": "af8035b4", "metadata": {}, "source": [ "## Hyperspherical chart\n", "\n", "The coordinates are $x=(\\theta, \\phi)$. The standard embedding\n", "$X:S^2\\hookrightarrow\\mathbb{R}^3$ is built by\n", "successively multiplying by sines: $X_1=r\\cos \\theta$,\n", "$X_2=r\\sin \\theta\\cos \\phi$, and so on. It makes\n", "$X\\mathbin{\\cdot}X=r^2$ manifest.\n", "\n", "The chart excludes the usual coordinate poles; those singularities are\n", "features of hyperspherical coordinates, not of the round geometry.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "23b9c2a4", "metadata": {}, "outputs": [], "source": [ "declare symbol r, θ, φ: MathValue\n", "\n", "def x : Vector MathValue := [| θ, φ |]\n", "\n", "def X : Vector MathValue := [| r * cos θ, r * sin θ * cos φ, r * sin θ * sin φ |]\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "7d2a6cf4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} \\cos(θ) r \\\\ \\cos(φ) \\sin(θ) r \\\\ \\sin(θ) \\sin(φ) r\\\\ \\end{pmatrix}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "X\n" ] }, { "cell_type": "markdown", "id": "c8099fc5", "metadata": {}, "source": [ "## Metric and inverse metric\n", "\n", "Differentiating the embedding gives an orthogonal coordinate basis. Its\n", "line element is\n", "\n", "$$\n", "ds^2=r^2\\left(d\\theta^2 + \\sin^2 \\theta d\\phi^2\\right).\n", "$$\n", "\n", "Egison differentiates the embedding to obtain the coordinate tangent\n", "vectors and constructs every component as their dot product,\n", "$g_{ij}=\\partial_iX\\mathbin{\\cdot}\\partial_jX$. The inverse metric is\n", "then computed from that induced metric.\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "bd14a06b", "metadata": {}, "outputs": [], "source": [ "def e_i_j : Matrix MathValue := ∂/∂ X_j x~i\n", "\n", "def g_i_j : Matrix MathValue :=\n", " generateTensor (\\[a, b] -> V.* e_a_# e_b_#) [2, 2]\n", "\n", "def g~i~j : Matrix MathValue := M.inverse g_#_#\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "724b9b5a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} r^{2} & 0 \\\\ 0 & \\sin(θ)^{2} r^{2} \\\\ \\end{pmatrix}_{\\#\\#}^{\\;\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "g_#_#\n" ] }, { "cell_type": "code", "execution_count": 5, "id": "6ea491b1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} r^{-2} & 0 \\\\ 0 & \\sin(θ)^{-2} r^{-2} \\\\ \\end{pmatrix}_{\\;\\;}^{\\#\\#}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "g~#~#\n" ] }, { "cell_type": "markdown", "id": "500f0f62", "metadata": {}, "source": [ "## Levi-Civita connection\n", "\n", "The Christoffel symbols of the first kind and second kind are\n", "\n", "$$\n", "\\Gamma_{ijk}=\\frac12\n", "(\\partial_jg_{ik}+\\partial_kg_{ij}-\\partial_ig_{jk}),\n", "\\qquad\n", "\\Gamma^i{}_{jk}=g^{im}\\Gamma_{mjk}.\n", "$$\n", "\n", "Repeated symbolic indices are contracted by `.`. The `withSymbols`\n", "block makes the dummy index local to the definition.\n" ] }, { "cell_type": "code", "execution_count": 6, "id": "127e1d6a", "metadata": {}, "outputs": [], "source": [ "def Γ_i_j_k : Tensor MathValue :=\n", " (1 / 2) * (∂/∂ g_i_k x~j + ∂/∂ g_i_j x~k - ∂/∂ g_j_k x~i)\n", "\n", "def Γ~i_j_k : Tensor MathValue := withSymbols [m]\n", " g~i~m . Γ_m_j_k\n" ] }, { "cell_type": "code", "execution_count": 7, "id": "ab070c18", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 0 & 0 \\\\ 0 & -\\cos(θ) \\sin(θ) \\\\ \\end{pmatrix}_{\\#\\#}^{\\;\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Γ~1_#_#\n" ] }, { "cell_type": "code", "execution_count": 8, "id": "6d5daa58", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 0 & \\cos(θ) \\sin(θ)^{-1} \\\\ \\cos(θ) \\sin(θ)^{-1} & 0 \\\\ \\end{pmatrix}_{\\#\\#}^{\\;\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Γ~2_#_#\n" ] }, { "cell_type": "markdown", "id": "1181d4e0", "metadata": {}, "source": [ "## Riemann tensor\n", "\n", "The following definition is a direct transcription of the stated\n", "convention. The two output cells sample the same coordinate\n", "two-plane with the first two tensor slots exchanged; their different\n", "coordinate factors are exactly what one expects in a non-orthonormal\n", "coordinate basis.\n" ] }, { "cell_type": "code", "execution_count": 9, "id": "a5f77aaa", "metadata": {}, "outputs": [], "source": [ "def R~i_j_k_l : Tensor MathValue := withSymbols [m]\n", " ∂/∂ Γ~i_j_l x~k - ∂/∂ Γ~i_j_k x~l\n", " + Γ~m_j_l . Γ~i_m_k - Γ~m_j_k . Γ~i_m_l\n" ] }, { "cell_type": "code", "execution_count": 10, "id": "b2818c73", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 0 & \\sin(θ)^{2} \\\\ -1 & 0 \\\\ \\end{pmatrix}_{\\;\\#}^{\\#\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "R~#_#_1_2\n" ] }, { "cell_type": "code", "execution_count": 11, "id": "3a090945", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 0 & -\\sin(θ)^{2} \\\\ 1 & 0 \\\\ \\end{pmatrix}_{\\;\\#}^{\\#\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "R~#_#_2_1\n" ] }, { "cell_type": "markdown", "id": "93667b51", "metadata": {}, "source": [ "## Ricci and scalar curvature\n", "\n", "Contracting the first and third Riemann indices gives\n", "\n", "$$\n", "\\operatorname{Ric}_{ij}=R^m{}_{imj},\n", "\\qquad\n", "\\mathcal{R}=g^{ij}\\operatorname{Ric}_{ij}.\n", "$$\n", "\n", "For a round $S^2$ the coordinate-free prediction is\n", "\n", "$$\n", "\\operatorname{Ric}=\\frac{1}{r^2}g,\n", "\\qquad\n", "\\mathcal{R}=\\frac{2}{r^2}.\n", "$$\n" ] }, { "cell_type": "code", "execution_count": 12, "id": "4aef76d3", "metadata": {}, "outputs": [], "source": [ "def Ric_i_j : Matrix MathValue := withSymbols [m]\n", " sum (contract R~m_i_m_j)\n", "\n", "def scalarCurvature : MathValue := withSymbols [i, j]\n", " g~i~j . Ric_i_j\n" ] }, { "cell_type": "code", "execution_count": 13, "id": "75cc2d9c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 1 & 0 \\\\ 0 & \\sin(θ)^{2} \\\\ \\end{pmatrix}_{\\#\\#}^{\\;\\;}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Ric_#_#\n" ] }, { "cell_type": "code", "execution_count": 14, "id": "bf107b95", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$2 r^{-2}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "scalarCurvature\n" ] }, { "cell_type": "markdown", "id": "6831c61b", "metadata": {}, "source": [ "## Interpretation\n", "\n", "The sampled components are coordinate dependent, but their contractions\n", "recover the invariant statement: every tangent two-plane has sectional\n", "curvature $1/r^2$, the metric is Einstein, and the scalar curvature is\n", "$2/r^2$. Factors such as $\\sin \\theta$ vanish\n", "at chart poles because the coordinate frame degenerates there; the\n", "curvature itself remains smooth.\n" ] } ], "metadata": { "kernelspec": { "display_name": "Egison", "language": "egison", "name": "egison" }, "language_info": { "codemirror_mode": "egison", "file_extension": ".egi", "mimetype": "text/x-egison", "name": "egison" } }, "nbformat": 4, "nbformat_minor": 5 }