{ "cells": [ { "cell_type": "markdown", "id": "0d970590", "metadata": {}, "source": [ "# Exterior Derivative and $d^2=0$\n", "\n", "The exterior derivative sends a $k$-form to a $(k+1)$-form. On a\n", "scalar function it is the gradient one-form,\n", "\n", "$$df=\\frac{\\partial f}{\\partial x^i},dx^i,$$\n", "\n", "and on all differential forms it satisfies the fundamental identity\n", "$d^2=0$.\n" ] }, { "cell_type": "markdown", "id": "f5c4b7c9", "metadata": {}, "source": [ "## A coordinate-free implementation pattern\n", "\n", "Egison's tensor derivative can map the partial-derivative operator\n", "across the coordinate vector. The polymorphic definition below works\n", "for a scalar or a tensor-valued expression.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "72085ad7", "metadata": {}, "outputs": [], "source": [ "declare symbol x, y, z : MathValue\n", "\n", "def params : Vector MathValue := [| x, y, z |]\n", "\n", "def d {a} (X : a) : DiffForm a := !(flip ∂/∂) params X\n", "\n", "def f : MathValue := x ^ 2 + y ^ 2 + z ^ 2\n" ] }, { "cell_type": "markdown", "id": "49250bca", "metadata": {}, "source": [ "For $f=x^2+y^2+z^2$, the first exterior derivative is the radial\n", "gradient one-form $2x\\,dx+2y\\,dy+2z\\,dz$.\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "aae6d940", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 2 x \\\\ 2 y \\\\ 2 z\\\\ \\end{pmatrix}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "d f\n" ] }, { "cell_type": "markdown", "id": "e6bcc4b2", "metadata": {}, "source": [ "Applying the tensor derivative a second time first produces the raw\n", "Hessian. This intermediate object has not yet been projected onto its\n", "alternating differential-form part.\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "a695fd86", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 2 & 0 & 0 \\\\ 0 & 2 & 0 \\\\ 0 & 0 & 2 \\\\ \\end{pmatrix}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "d (d f)\n" ] }, { "cell_type": "markdown", "id": "cd2ec05c", "metadata": {}, "source": [ "The Hessian of a smooth scalar is symmetric, while a two-form is\n", "antisymmetric. Their alternating projection therefore vanishes.\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "c9b3e356", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\begin{pmatrix} 0 & 0 & 0 \\\\ 0 & 0 & 0 \\\\ 0 & 0 & 0 \\\\ \\end{pmatrix}$" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dfNormalize (d (d f))\n" ] }, { "cell_type": "markdown", "id": "c6ed78ee", "metadata": {}, "source": [ "This computation is the coordinate expression of $d^2f=0$: mixed\n", "partial derivatives cancel pairwise after antisymmetrization. Showing\n", "both the Hessian and its normalized form separates ordinary tensor\n", "differentiation from the geometric exterior derivative.\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 }