{ "cells": [ { "cell_type": "markdown", "id": "0d970590", "metadata": {}, "source": [ "# 外微分と $d^2=0$\n", "\n", "外微分は $k$ 形式を $(k+1)$ 形式へ写します。スカラー関数に作用させると、\n", "勾配を表す1形式\n", "\n", "$$df=\\frac{\\partial f}{\\partial x^i},dx^i,$$\n", "\n", "となり、任意の微分形式に対して基本恒等式 $d^2=0$ を満たします。\n" ] }, { "cell_type": "markdown", "id": "f5c4b7c9", "metadata": {}, "source": [ "## 座標の選び方に依存しない実装パターン\n", "\n", "Egisonのテンソル微分を使うと、偏微分演算子を座標ベクトルの各成分へ適用できます。\n", "以下の多相的な定義は、スカラー値の式にもテンソル値の式にも利用できます。\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": [ "$f=x^2+y^2+z^2$ の1回目の外微分は、動径方向の勾配1形式\n", "$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": [ "テンソル微分をもう一度適用すると、まず正規化前のヘッセ行列が得られます。\n", "この中間結果は、まだ微分形式の交代部分へ射影されていません。\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": [ "滑らかなスカラー関数のヘッセ行列は対称である一方、2形式は反対称です。\n", "したがって、その交代部分への射影はゼロになります。\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": [ "この計算は $d^2f=0$ を座標で表したものです。混合偏微分は反対称化によって\n", "二つずつ相殺されます。ヘッセ行列とその正規化後の形を並べることで、通常の\n", "テンソル微分と幾何学的な外微分の違いが明確になります。\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 }