#!/usr/bin/env python # coding: utf-8 # # 16. Exterior derivative # # This notebook is part of the [Introduction to manifolds in SageMath](https://sagemanifolds.obspm.fr/intro_to_manifolds.html) by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland). # In[1]: version() # If $(x^1,\ldots,x^n)$ are local coordinates on a smooth manifold $M$, then from (14.9) we know that for any differential $k$-form on $M$ # # $$\omega=\sum_{1\leq i_1<\ldots # # **Example 16.1** # # Take a 1-form and compute its exterior derivative. # In[2]: get_ipython().run_line_magic('display', 'latex') dim = 3 # dimension of manifold N N = Manifold(dim, 'N') # manifold N X = N.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(dim)])) # chart on N al = N.diff_form(1, name=r'\alpha') # 1-form alpha def astr(i): return 'a_'+str(i) # names of components af = [N.scalar_field(function(astr(i))(*X), name=astr(i)) for i in range(dim)] # component functions al[:] = af # define all components al.disp() # show al # Use the method `exterior_derivative()` to compute the result: # In[3]: dal = al.exterior_derivative() dal.disp() # Let us apply the definition (16.1) for comparison: # In[4]: # continuation dx = X.coframe() # (dx0,dx1,dx2) # apply the formula (16.1): s = sum([(af[i]).differential().wedge(dx[i]) for i in range(dim)]) # SageMath automatically displays the wedge products # with increasing indices of variables s.disp() # show the result # Note that for example (since $dx^i\wedge dx^i=0$) # # $$da_0\wedge dx^0=(\frac{\partial a_0}{\partial x^0}dx^0+\frac{\partial a_0}{\partial x^1}dx^1+\frac{\partial a_0}{\partial x^2}dx^2)\wedge dx^0\\ # =\frac{\partial a_0}{\partial x^1}dx^1\wedge dx^0+ # \frac{\partial a_0}{\partial x^2}dx^2\wedge dx^0 # =-\frac{\partial a_0}{\partial x^1}dx^0\wedge dx^1 # -\frac{\partial a_0}{\partial x^2}dx^0\wedge dx^2, # $$ # # and analogously for the remaining terms (in $\ \ da_2\wedge dx^2\ \ $ there is no need of reordering the terms). # #
# # **Example 16.2** # # Consider now a 2-form and its exterior differential. # In[5]: get_ipython().run_line_magic('display', 'latex') N=3 # dimension of the manifold M M = Manifold(N, 'M') # manifold M X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M a = M.diff_form(2, name='a') # 2-form a # components of the 2-form a: x0, x1, x2 = X[:] # coordinates x^0, x^1, x^2 of chart X as the Python variables x0, x1, x2 a01 = M.scalar_field(function('a01')(x0,x1,x2), name='a01') a02 = M.scalar_field(function('a02')(x0,x1,x2), name='a02') a12 = M.scalar_field(function('a12')(x0,x1,x2), name='a12') a[0,1] = a01; a[0,2] = a02 # define components of a a[1,2] = a12 # (up.triangle of comp.matr.) a.disp() # show a # The exterior derivative: # In[6]: a.exterior_derivative().disp() # In this case for each differential $da_{ij}$ only one term of the form $\frac{\partial a_{ij}}{\partial x^i}dx^i$ (no summation) gives a nonzero contribution to the final result. For example, for the second term of $a$ we have # # $$da_{02}\wedge dx^0\wedge dx^2=\Big(\frac{\partial a_{02}}{\partial x^0}dx^0+\frac{\partial a_{02}}{\partial x^1}dx^1+\frac{\partial a_{02}}{\partial x^2}dx^2\Big)dx^0\wedge dx^2\\ # =\frac{\partial a_{02}}{\partial x^1}dx^1\wedge dx^0\wedge dx^2 # =-\frac{\partial a_{02}}{\partial x^1}dx^0\wedge dx^1\wedge dx^2. # $$ # # The calculations for the remaining terms are analogous. #
# # ### Exterior derivative is antiderivation # #
# # \begin{equation} # d(ω ∧ η) = dω ∧ η + (−1)^k ω ∧ dη, # \label{}\tag{16.2} # \end{equation} # # for $\omega\in\Omega^k(M)$ and $\eta \in\Omega^m(M)$. # # # Using the linearity of the operation $d$, it is enough to prove the antiderivation property for single terms # $ω = ω_{i_1 ...i_k} dx^{i_1} ∧ · · · ∧ dx^{i_k}$ and # $η = η_{j_1 ... j_m }dx^{j_1} ∧· · · ∧ dx^{j_m}$ (no summation here). From (16.1) and (13.4) we obtain # # $$ # d(ω ∧ η) = d( ω_{i_1 ...i_k} η_{j_1 ... j_m} dx^{i_1} ∧ · · · ∧ dx^{i_k} ∧ dx^{j_1} ∧ · · · ∧ dx^{j_m})\\ # = d(ω_{i_1 ...i_k} η_{j_1 ... j_m} ) ∧ dx^{i_1} ∧ · · · ∧ dx^{i_k} ∧ dx^{j_1} ∧ · · · ∧ dx^{j_m}\\ # =[(dω_{i_1 ...i_k} )η_{j_1 ... j_m} + ω_{i_1 ...i_k} dη_{j_1 ... j_m}] ∧ dx^{i_1} ∧ · · · ∧ dx^{i_k} ∧ dx^{j_1} ∧ · · · ∧ dx^{j_m}\\ # =(dω_{i_1 ...i_k} ∧ dx^{i_1} ∧ · · · ∧ dx^{i_k} ) ∧ (η_{j_1 ... j_m} dx^{j_1} ∧ · · · ∧ dx^{j_m} )\\ # +(−1)^k (ω_{i_1 ...i_k} dx^{i_1} ∧ · · · ∧ dx^{i_k} ) ∧ (dη_{j_1 ... j_m} ∧ dx^{j_1} ∧ · · · ∧ dx^{j_m}) \\ # = dω ∧ η + (−1)^k ω ∧ dη. # $$ # We have proved (16.2). # #
# # ### Exterior derivative is nilpotent # #
# # \begin{equation} # d^2\eta=d(d\eta)=0. # \label{}\tag{16.3} # \end{equation} # # Again, it is enough to consider forms # $\eta= η_{i_1 ...i_m} ∧ dx^{i_1} ∧ · · · ∧ dx^{i_m}$ (no summation here). # If $ω = dη$ with $η ∈ \Omega^m (M)$, we have # $$ω = dη_{i_1 ...i_m} ∧ dx^{i_1} ∧ · · · ∧ dx^{i_m} = # \Big(\frac{\partial}{\partial x^j}η_{i_1 ...i_m}\Big)dx^j ∧ dx^{i_1} ∧ · · · ∧ dx^{i_m}.$$ #
# Computing the exterior derivative of $\omega$ we obtain # $$d\omega=d\Big(\frac{\partial}{\partial x^j}η_{i_1 ...i_m}\Big)dx^j ∧ dx^{i_1} ∧ · · · ∧ dx^{i_m}\\ # =\Big(\frac{\partial}{\partial x^p}\frac{\partial}{\partial x^j}η_{i_1 ...i_m}\Big)dx^p\wedge dx^j ∧ dx^{i_1} ∧ · · · ∧ dx^{i_m}. # $$ # In the last sum if $p = j$, then $dx^p ∧ dx^j = 0,$ if $p\not= j$, then $\frac{∂^2 f }{ ∂ x^p ∂ x^j}$ is symmetric in $p$ # and $j$, but $dx^p ∧ dx^j$ is alternating in $p$ and $j$, so the terms with $p \not= j$ pair up and cancel # each other. For example # $$\frac{∂^2 \eta_{...} }{ ∂ x^1 ∂ x^2}dx^1\wedge dx^2 # +\frac{∂^2 \eta_{...} }{ ∂ x^2 ∂ x^1}dx^2\wedge dx^1\\ # =\frac{∂^2 \eta_{...} }{ ∂ x^1 ∂ x^2}dx^1\wedge dx^2+ # \frac{∂^2 \eta_{...} }{ ∂ x^1 ∂ x^2}(-dx^1\wedge dx^2)=0.$$ # #
# # ### Pullback and wedge product # #
# # \begin{equation} # ψ^∗ (ω ∧ η) = (ψ^∗ ω) ∧ (ψ^∗ η), # \label{}\tag{16.4} # \end{equation} # # for $\omega\in\Omega^k(N),\ \eta\in\Omega^m(N)$ and a smooth map $\psi:M\to N.$ # # In fact, we have # # $$\psi^*(\omega\wedge\eta)(v_1,\ldots,v_{k+m})= # \omega\wedge\eta(d\psi(v_1),\ldots,d\psi(v_{k+m}))\\ # =\frac{(k+m)!}{k!m!}\mathrm{Alt}(\omega\otimes\eta)(d\psi(v_1),\ldots,d\psi(v_{k+m}))\\ # =\frac{1}{k!m!}\sum_{\sigma\in S_{k+m}}\mathrm{sign}\,\sigma\, # \omega(d\psi(v_{\sigma(1)},\ldots,d\psi(v_{\sigma(k)})\eta(d\psi(v_{\sigma(k+1)}),\ldots,d\psi(v_{\sigma(k+m)}))\\ # =\frac{1}{k!m!}\sum_{\sigma\in S_{k+m}}\mathrm{sign}\,\sigma\, # \psi^*\omega(v_{\sigma(1)},\ldots,v_{\sigma(k)}\psi^*\eta(v_{\sigma(k+1)},\ldots,v_{\sigma(k+m)})\\ # =\frac{(k+m)!}{k!m!}\mathrm{Alt}((\psi^*\omega)\otimes(\psi^*\eta))(v_1,\ldots,v_{k+m})\\ # =(\psi^*(\omega))\wedge(\psi^*(\eta))(v_1,\ldots,v_{k+m}). # $$ # # We have checked (16.4). # #
# # ### Pullback and exterior derivative # #
# # Using the relation between the differential of a scalar function and the pullback (cf. (15.2)) one can check that for $\omega\in\Omega^k(N)$ of the special form $\ \omega=ω_{i_1 ...i_k}dy^{i_1}\wedge\ldots\wedge dy^{i_k}\ $ (no summation) and a smooth map $\psi:M\to N$ # # $$ # ψ^∗ (dω) = # \psi^*(d\omega_{i_1...i_k}\wedge dy^{i_1}\wedge ...dy^{i_k})\\ # =\psi^*(d\omega_{i_1...i_k})\wedge \psi^*(dy^{i_1})... # \wedge\psi^*(dy^{i_k})\\ # =d(ψ^∗ ω_{i_1 ...i_k} ) ∧ d(ψ^∗ y^{i_1} ) ∧ · · · ∧d(ψ^*y^{ i_k} )\\ # = d [(ψ^∗ ω_{i_1 ...i_k} ) d(ψ^∗ y^{i_1} ) ∧ · · · ∧ d(ψ^∗ y^{i_k} )]\\ # = d[ (ψ^∗ ω_{i_1 ...i_k} )ψ^∗ (dy^{i_1} ) ∧ · · · ∧ ψ^∗ (dy^{i_k} )]\\ # = d [ψ^∗ (ω_{ i_1 ...i_k} dy^{i_1} ∧ · · · ∧ dy^{i_k} )] # = d(ψ^∗ ω). # $$ # # Due to linearity, we have proved # \begin{equation} # ψ^∗ (dω) = d(ψ^∗ ω),\quad # \mathrm{for}\quad ω ∈ \Omega^k (N ). # \label{}\tag{16.5} # \end{equation} # #
# # **Example 16.3** # # Compute the pullback of $\ \alpha=dx\wedge dy\ \ $ under the map # $\Phi: R_{r,\phi}\to R^2_{x,y},$ $\Phi(r,\phi)=(r\cos\phi,r\sin\phi)$. # In[7]: get_ipython().run_line_magic('display', 'latex') M = Manifold(2, 'R^2') # manifold M c_xy. = M.chart() # Cartesian coordinates on M N = Manifold(2, 'R^2p') # manifold N c_rp.=N.chart() # polar coordinates on N Phi = N.diff_map(M, (r*cos(phi), r*sin(phi)), name=r'\Phi') # N-> M alpha = M.diff_form(2,r'\alpha') # 2-form alpha on M alpha[0,1] = 1 # only one nonzero comp. of alpha alpha.disp() # show alpha # Pullback of $\alpha$: # In[8]: plb = Phi.pullback(alpha) # pullback of alpha plb.display() # show pullback # # According to the remark after formula (15.6) one can check that if we replace $ \ x\ $ by $\ \ r\cos\phi\ \ $ and $\ \ y\ \ $ by $\ \ r\sin\phi\ \ $ in $dx\wedge dy\ \ $ and compute the differentials (w.r.t $(r,\phi)$) of the obtained functions, then we get # # $$d(r\cos\phi)\wedge d(r\sin\phi)=(\frac{\partial (r\cos\phi)}{\partial r}dr+ # \frac{\partial (r\cos\phi)}{\partial \phi}d\phi)\wedge # (\frac{\partial (r\sin\phi)}{\partial r}dr+ # \frac{\partial (r\sin\phi)}{\partial \phi}d\phi)\\ # =(\cos\phi dr-r\sin\phi d\phi)\wedge # (\sin\phi dr+r\cos\phi d\phi)=\\\\ # r\cos^2\phi dr\wedge d\phi -r\sin^2\phi d\phi\wedge dr # = # r(\cos^2\phi+\sin^2\phi)dr\wedge d\phi =rdr\wedge d\phi.$$ #
# # **Example 16.4** # # Compute the pullback of $\ \alpha=dx\wedge dy\wedge dz\ \ $ under the map $\Phi: R^3_{r,\phi,\theta}\to R^3_{x,y,z}$, # $\ \ \Phi(r,\phi,\theta)=(r\cos\phi\sin\theta,r\sin\phi\sin\theta,r\cos\theta).$ # In[9]: get_ipython().run_line_magic('display', 'latex') M = Manifold(3, 'R^3') # manifold M=R^3 (Cart. coord.) c_xyz. = M.chart() # Cartesian coordinates on M N = Manifold(3, 'R^3p') # manifold N=R^3 (spher.coord.) c_rpt.=N.chart() # spherical coordinates on N Phi = N.diff_map(M, (r*cos(phi)*sin(theta), # Phi N -> M r*sin(phi)*sin(theta), r*cos(theta)),name=r'\Phi') alpha = M.diff_form(3,r'\alpha') # 3-form alpha on M alpha[0,1,2] = 1 # only one nonzero comp. of alpha alpha.disp() # show alpha # Pullback of $\alpha$ under $\Phi$: # In[10]: plb = Phi.pullback(alpha) # pullback of alpha plb.display() # show pullback # #
# # **Example 16.5** # # Compute $\Phi^*\alpha\ \ $ for $\Phi:R\to R^2,\ \ \Phi(t)=(\cos(t),\sin(t))\ $ and $ \ \alpha= # \frac{-y}{x^2+y^2}dx+\frac{x}{x^2+y^2}dy$. # In[11]: M = Manifold(2, 'R^2') # manifold M= R^2 c_xy. = M.chart() # Cartesian coordinates on M N = Manifold(1, 'R^1') # manifold N=R^1 c_t. = N.chart() # coordinate t Phi = N.diff_map(M, (cos(t), sin(t)), name=r'\Phi') # Phi: N -> M alpha = M.diff_form(1,r'\alpha') # 1-form alpha on M alpha[:] = -y/(x^2+y^2), x/(x^2+y^2) # components of alpha alpha.disp() # show alpha # Pullback $\ \Phi^*\alpha\ \ $ # In[12]: plb = Phi.pullback(alpha) # pullback Phi^*alpha plb.apply_map(factor) # factor all components plb.display() # show the result #
# # **Example 16.6** # # Compute the pullback of $\ \ \alpha=a_0(x,y)dx+a_1(x,y)dy\ \ $ under the map $\ \psi:R^2_{u,v}\to R^2_{x,y},$ # $\ \psi(u,v)=(\psi_1(u,v),\psi_2(u,v)).$ # In[13]: get_ipython().run_line_magic('display', 'latex') M = Manifold(2, r'R^2_{uv}') # manifold M=R^2_uv c_uv.=M.chart() # coordinates u,v N = Manifold(2, r'R^2_{xy}') # manifold N=R^2_xy c_xy. = N.chart() # Cartesian coord. on N psi1 = M.scalar_field(function('psi1')(u,v), name=r'\psi1') # first comp. of psi psi2 = M.scalar_field(function('psi2')(u,v), name=r'\psi2') # second comp. of psi psi = M.diff_map(N,(psi1.expr(),psi2.expr()), name=r'\psi') # psi: M -> N al = N.diff_form(1,name=r'\alpha') # 1-form on N astr = ['a'+str(i) for i in range(2)] # names of components of al # component functions: af = [N.scalar_field(function(astr[i])(x,y), name=astr[i]) for i in range(2)] al[:] = af # define all components al.disp() # show al # Pullback $\ \ \psi^*\alpha$: # In[14]: alplb = psi.pullback(al) # pullback of al alplb.disp() # show pullback #
# # **Example 16.7** # # For $\ \psi\ \ $ as above compute $\ \ \psi^*(dx\wedge dy)$. # In[15]: # continuation beta = N.diff_form(2, r'\beta') # 2-form beta on N beta[0,1] = 1 # only one nonzero component beta.disp() # show beta # $\ \ \psi^*(dx\wedge dy)$: # In[16]: betaplb = psi.pullback(beta) # pullback psi^*beta betaplb.disp() # show pullback # Note that the unique component of the obtained pullback is the determinant of the Jacobian matrix # $ # \left(\begin{matrix} # \frac{\partial \psi_1}{\partial u} & \frac{\partial \psi_1}{\partial v}\\ # \frac{\partial \psi_2}{\partial u} & \frac{\partial \psi_2}{\partial v} # \end{matrix} # \right). # $ #
# # **Example 16.8** # # For the map $\psi:R^3_{u,v,w}\to R^3_{x,y,z}$, defined by $\ \psi(u,v,w)=(\psi_1(u,v,w),\psi_2(u,v,w),\psi_3(u,v,w))\ \ $ compute # $\ \psi^*(dx\wedge dy\wedge dz).$ # In[17]: get_ipython().run_line_magic('display', 'latex') M = Manifold(3, r'R^3_{uvw}') # manifold M=R^3_uvw c_uvw.=M.chart() # coordinates on M N = Manifold(3, r'R^3_{xyz}') # manifold N=R^3_xyz c_xy. = N.chart() # Cartesian coord on N psi1 = M.scalar_field(function('psi1')(u,v,w), name=r'\psi1') # first component of psi psi2 = M.scalar_field(function('psi2')(u,v,w), name=r'\psi2') # second component of psi psi3 = M.scalar_field(function('psi3')(u,v,w), name=r'\psi3') # third component of psi psi = M.diff_map(N,(psi1.expr(),psi2.expr(),psi3.expr()) ,name=r'\psi') # psi: M->N beta = N.diff_form(3,r'\beta') # 3-form beta on N beta[0,1,2] = 1 # only one nonzero component of beta beta.disp() # show beta # In[18]: betaplb=psi.pullback(beta) # pullback psi*beta betaplb.disp() # show pullback # The unique component of the pullback is the Laplace expansion of the determinant of the Jacobian matrix # $$ # \left(\begin{matrix} # \frac{\partial \psi_1}{\partial u} & \frac{\partial \psi_1}{\partial v} & \frac{\partial \psi_1}{\partial w} \\ # \frac{\partial \psi_2}{\partial u} & \frac{\partial \psi_2}{\partial v} & \frac{\partial \psi_2}{\partial w} \\ # \frac{\partial \psi_3}{\partial u} & \frac{\partial \psi_3}{\partial v} & \frac{\partial \psi_3}{\partial w} # \end{matrix} # \right). # $$ #
# # ### Global formula for exterior differentials of 1-forms # #
# # # For smooth differential 1-form $\ \alpha\ $ and smooth vector fields $\ v,w\ $ on the manifold $M$ we have # # \begin{equation} # dα(v, w) = v\,α(w) − w\,α(v) − α ([v, w]). # \tag{16.6} # \end{equation} # #
# # Both sides of this equation are linear in the sense that if # $\alpha =\sum f_idx^i$, then # # $$d(\sum f_idx^i)(v,w)=\sum d(f_idx^i)(v,w),\\ # v[(\sum f_idx^i)(w)]=\sum v[f_idx^i(w)],\\ # w[(\sum f_idx^i)(v)]=\sum w[f_idx^i(v)],\\ # (\sum f_idx^i)([v,w])=\sum(f_idx^i)([v,w]), # $$ # # therefore we only need to prove the equation for a single term # $f dx^i$. # For the left hand side of (16.6) we obtain # # $$ # dα(v, w) = d(f dx^i)(v, w) # = (df ∧ dx^i )(v, w)\\ # = df (v)dx^i(w) − df (w)dx^i(v) # = v(f)\,w(x^i) − w(f)\,v(x^i). # $$ # # For the first term on the right hand side we have # # $$ # v\,α(w) = v (f dx^i) (w) # = v (f dx^i(w))\\ # = v (f · w(x^i)) # = v(f)w(x^i) + f\,v(w(x^i)), # $$ # # and similarly # # $$w\,α(v) = w(f)v(x^i) + f\, w(v(x^i)).$$ # # Since $[v, w] = vw − wv$ # # $$ # α ([v, w]) = (f dx^i) ([v, w]) # = f · [v, w](x^i)\\ # = f ·( vw − wv)(x^i) # = f\, v(w(x^i)) − f \,w(v(x^i)). # $$ # # Combining the obtained equalities we have # # $$ # vα(w) − wα(v) − α ([v, w])\\ # = v(f)w(x^i) + f\,v(w(x^i)\\ # − w(f)v(x^i) -f\, w(v(x^i))\\ # − f\, v(w(x^i)) + f \,w(v(x^i))\\ # = v(f)w(x^i) − w(f)v(x^i) # = dα(v, w). # $$ # # #
# # **Example 16.9** # # Check (16.6) on selected $\alpha, v, w$ # In[19]: get_ipython().run_line_magic('display', 'latex') dim=2 # dimension of manifold N N = Manifold(dim, 'N') # manifold N X = N.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(dim)])) # chart on N x0, x1 = X[:] # coordinates x^0, x^1 of chart X as the Python variables x0, x1 al = N.diff_form(1, name=r'\alpha') # 1-form alpha def astr(i): return 'a_'+str(i) # names of components af = [N.scalar_field(function(astr(i))(x0, x1), name=astr(i)) for i in range(dim)] # component functions al[:] = af # define all components v = N.vector_field(x0, x1) # vector field v w = N.vector_field(x1, x0) # vector field w L = al.exterior_derivative()(v, w) # Left hand side of (16.6) R = v(al(w)) - w(al(v)) - al(v.bracket(w)) # Right hand side of (16.6) L == R # check (16.6) # ## What's next? # # Take a look at the notebook [One-parameter groups of transformations](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/17Manifold_One_Parameter.ipynb).