Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
sagemanifolds
GitHub Repository: sagemanifolds/IntroToManifolds
Path: blob/main/08Manifold_Tangent_Vect.ipynb
Views: 82
Kernel: SageMath 9.6

8. Tangent spaces

This notebook is part of the Introduction to manifolds in SageMath by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland).

version()
'SageMath version 9.6, Release Date: 2022-05-15'

Let MM be a smooth manifold and pMp ∈ M. A tangent vector to MM at pp is a map Xp:C(M)RX_p : C^∞ (M ) → R such that

Xp(af+bg)=aXp(f)+bXp(g),Xp(fg)=f(p)Xp(g)+g(p)Xp(f),\begin{equation} \begin{matrix} X_p (a f + bg) = aX_p ( f ) + bX_p (g),\\ X_p(f g) = f (p)X_p(g) + g(p)X_p(f), \end{matrix} \tag{8.1} \end{equation}

for all f,gC(M)f, g ∈ C^\infty (M ) and a,bRa,b\in R.

Maps C(M)RC^∞ (M ) → R satisfying the last relation are also said to have a derivation property and are called derivations (into RR).

In the previous notebook we have checked that the tangent vectors to smooth curves are derivations. Later in this notebook we will show that all tangent vectors are in fact tangent vectors to some curve.

If we define addition and multiplication by a scalar on the set of derivations at pp by

(Xp+Yp)(f)=Xp(f)+Yp(f),(λXp)(f)=λXp(f),\begin{equation} \begin{matrix} (X_p+Y_p)(f)=X_p(f)+Y_p(f),\\ (\lambda X_p)(f)=\lambda X_p(f), \tag{8.2} \end{matrix} \end{equation}

for  fC(M)\ f ∈ C^\infty (M ) and λR\lambda\in R, then we obtain a vector space.

Tangent space TpMT_p M to a smooth manifold MM at a point pp is the vector space of all tangent vectors to MM at pp.


Local bases for tangent spaces


Let (U,φ)(U, φ) be a chart on M,M, with coordinates x1,...,xnx^1 , . . . , x^n and pUp ∈ U. The tangent vectors,xip \frac{∂}{∂ x^i}\Big|_p are defined by xip(f)=Di(fφ1)φ(p).\begin{equation} \frac{∂}{∂ x^i}\Big|_p(f) = D_i ( f ◦ φ^{−1} )|_{φ( p)}. \tag{8.3} \end{equation}

Here fC(M)f\in C^\infty(M) and DiD_i denotes the partial derivative in RnR^n, i.e.

Di(g)q=limh0g(q+hei)g(q)h,for gC(M), qM,\displaystyle D_i(g)|_q=\lim_{h\to 0}\frac{g(q+he_i)-g(q)}{h}, \quad \text{for}\ g\in C^\infty(M),\ q\in M,

where eie_i is the vector in RnR^n with ii-th component 1 and all other 0.

Using the Leibniz rule for DiD_i one can show that xip\frac{∂}{∂ x^i}\Big|_p satisfy (8.1), so they are tangent vectors to MM at pMp\in M.

Let us check how the tangent vectors  xip\ \frac{∂}{∂ x^i}\big|_p act on coordinate functions xjx^j. We have

xjϕ1(ϕ(p)+hei)xjϕ1(ϕ(p))={h,if i=j,0,if ij.x^j\circ\phi^{-1}(\phi(p)+he_i)-x^j\circ\phi^{-1}(\phi(p))= \left\{ \begin{array}{ll} h, & \mbox{if } i=j,\\ 0, & \mbox{if } i\not=j. \end{array}\right.

As a consequence we obtain

xip(xj)=δij={1,if i=j,0,if ij.\begin{equation} \frac{\partial}{\partial x^i}\Big|_p(x^j)=\delta^j_i= \Big\{ \begin{array}{ll} 1, & \mbox{if } i=j,\\ 0, & \mbox{if } i\not=j. \end{array} \tag{8.4} \end{equation}

The vectors   xip,  \ \ \displaystyle\frac{\partial}{\partial x^i}\Big|_p,\ \ i=1,,n  i=1,\ldots,n\ \ form a basis of TpMT_pM.

The linear independence follows from the fact that if i=1naixip=0TpM\sum_{i=1}^n a^i\frac{\partial}{\partial x^i}\Big|_p=0\in T_pM, then by (8.4) i=1naixip(xj)=i=1naiδij=aj=0.\sum_{i=1}^n a^i\frac{\partial}{\partial x^i}\Big|_p(x^j)=\sum_{i=1}^n a^i\delta^j_i=a^j=0.

To show that   xip,  \ \ \displaystyle\frac{\partial}{\partial x^i}\Big|_p,\ \ i=1,,n  i=1,\ldots,n\ \ span the tangent space  TpM \ T_pM\ we need to prove:

If ϕ=(x1,,xn):URn\phi=(x^1,\ldots,x^n): U\to R^n is a coordinate chart on a manifold MM and XpTpMX_p\in T_pM is a tangent vector at pUp\in U, then ParseError: KaTeX parse error: Undefined control sequence: \label at position 83: … x^i}\Big|_p. \̲l̲a̲b̲e̲l̲{}\tag{8.5} \e…

From now on, in all notebooks we use Einstein summation convention:
When an index variable appears twice in a single term and is not otherwise defined, it implies summation of that term over all the values of the index.

Using this convention, the last formula can be written as

Xp=Xp(xi)xip.X_p=X_p(x^i)\frac{\partial}{\partial x^i}\Big|_p.

To check (8.5) let fC(M)f\in C^\infty(M) and let F=fϕ1F=f\circ\phi^{-1}. If qUq\in U, then

f(q)=(fϕ1)(ϕ(q))=F(ϕ(q)).f(q)=(f\circ\phi^{-1})(\phi(q))=F(\phi(q)).

Analogously f(p)=F(φ(p)).  f ( p) = F (φ( p)).\ \ We shall use the following version of the mean value theorem.


For smooth function FF of nn real variables defined in a neighborhood of the segment joining ϕ(p)\phi(p) and ϕ(q)\phi(q) we have the equality

F(ϕ(q))=F(ϕ(p))+(xi(q)xi(p))gi(q),\begin{equation} \displaystyle F(\phi(q))=F(\phi(p))+(x^i(q)-x^i(p))g_i(q), \tag{8.6} \end{equation}

where gi(p)=DiFϕ(p)=Di(fϕ1)ϕ(p)g_i(p)=D_iF|_{\phi(p)}=D_i(f\circ\phi^{-1})|_{\phi(p)}.

If pp is fixed, then (8.6) leads to

f(q)=f(p)+[xi(q)xi(p)]gi(q).f (q) = f ( p) + [x^i (q) − x^i ( p) ]g_i (q).

Since qq is arbitrary point in a neighborhood of pp

f=f(p)+[xixi(p)]gi.\begin{equation} f = f ( p) + [x^i − x^i ( p)] g_i. \tag{8.7} \end{equation}

Note that for a constant cc we have Xp(c)=Xp(c1)=cXp(1)=cXp(11)X_p(c)=X_p(c\cdot 1)=cX_p(1)=cX_p(1\cdot 1) =c(1Xp(1)+1Xp(1))=2cXp(1)=2Xp(c), =c(1\cdot X_p(1)+1\cdot X_p(1))=2cX_p(1)=2X_p(c), so Xp(c)=0X_p(c)=0.

Using (8.1) and the fact that f(p)f(p) and xi(p)x^i(p) are constants (pp is fixed) we have

Xp(f)=Xp(f(p))+[xi(p)xi(p)]Xp(gi)+gi(p)Xp(xixi(p))=gi(p)Xp(xi).X_p ( f ) = X_p ( f ( p)) + [x^i ( p) − x^i ( p)] X_p (g_i ) + g_i ( p) X_p (x^i − x^i ( p)) = g_i ( p) X_p (x^i ).

Since gi(p)=Di(fϕ1)ϕ(p)=xip(f)g_i(p)=D_i(f\circ\phi^{-1})|_{\phi(p)}=\frac{\partial}{\partial x^i}\Big|_p(f), we have proved (8.5).


Tangent vectors in SageMath


In the sequel we shall use variables with upper indices in latex output


Example 8.1

Now let us define our first tangent vector, using variables with superscripts in Latex output.

%display latex M = Manifold(3, 'M') # Manifold M X = M.chart(r"x0:x^0 x1:x^1 x2:x^2") # chart (x^0,x^1,x^2) p = M.point((1,0,-2), name='p') # point in M Tp = M.tangent_space(p) # tangent space at p v = Tp((2,1,3), name='v') ; print(v) # tangent vector in Tp v.disp() # show v
Tangent vector v at Point p on the 3-dimensional differentiable manifold M

v=2x0+x1+3x2\displaystyle v = 2 \frac{\partial}{\partial {x^0} } +\frac{\partial}{\partial {x^1} } + 3 \frac{\partial}{\partial {x^2} }

If we would like subscripts instead, we should write

# Version with subscripts !!! M = Manifold(3, 'M') # Manifold X = M.chart(r"x0:x_0 x1:x_1 x2:x_2") # chart (x_0,x_1,x_2) p = M.point((1,0,-2), name='p') # point in M Tp = M.tangent_space(p) # tangent space at p v = Tp((2,1,3), name='v') ; print(v) # tangent vector in Tp v.disp() # show v
Tangent vector v at Point p on the 3-dimensional differentiable manifold M

v=2x0+x1+3x2\displaystyle v = 2 \frac{\partial}{\partial {x_0} } +\frac{\partial}{\partial {x_1} } + 3 \frac{\partial}{\partial {x_2} }


Example 8.2

Let us introduce a tangent vector with symbolic components, first with subscripts.

# version with subscripts %display latex M = Manifold(2, 'M') # Manifold X.<x0,x1> = M.chart() # chart (X0,X1) p = M.point((x0, x1), name='p') # generic point in M Tp = M.tangent_space(p) # tangent space at p var('v',n=2) # symbols v0,v1 v = Tp((v0,v1), name='v') # tan. vector in Tp v.disp() # show v

v=v0x0+v1x1\displaystyle v = v_{0} \frac{\partial}{\partial {x_0} } + v_{1} \frac{\partial}{\partial {x_1} }

Now the version with superscripts and manifold dimension specified by N:

%display latex N = 2 M = Manifold(N, 'M') # manifold M X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M p = M.point(X[:], name='p') # generic point of M Tp = M.tangent_space(p) # tangent space at p v = [var('v'+str(i),latex_name='v'+'^'+str(i)) for i in range(N)] # variables with superscripts V = Tp(v, name='V') # tangent vector at p V.disp() # show tangent vector

V=v0x0+v1x1\displaystyle V = {v^0} \frac{\partial}{\partial {x^{0}} } + {v^1} \frac{\partial}{\partial {x^{1}} }

Check that the tangent vector V maps a scalar function f to the real number v0fx0p+v1fx1p(=vifxip)v^0\left.\frac{\partial f}{\partial x^0}\right|_p+ v^1\left.\frac{\partial f}{\partial x^1}\right|_p\quad \big(=v^i\left.\frac{\partial f}{\partial x^i}\right|_p\big).

x0, x1 = X[:] # coordinates x^0 and x^1 of chart X as the Python variables x0 and x1 f = M.scalar_field(function('f')(x0, x1), name='f') # scalar function f V(f) # value of vect. field on f

v0x0f(x0,x1)+v1x1f(x0,x1)\displaystyle {v^0} \frac{\partial}{\partial {x^{0}}}f\left({x^{0}}, {x^{1}}\right) + {v^1} \frac{\partial}{\partial {x^{1}}}f\left({x^{0}}, {x^{1}}\right)

Let us check the derivation property:

# scalar function g: g = M.scalar_field(function('g')(x0, x1), name='g') # V is derivation? bool(V(f*g) == V(f)*g(p) + f(p)*V(g))

True\displaystyle \mathrm{True}


Differential of a smooth map


The definition of smooth maps (from notebook 1) is equivalent to the following. Let MM and NN be two smooth manifolds with some atlases {(Uα,φα)(U_α,φ_α )} and {(Vβ,ψβ)(V_β,ψ_β)}, respectively.
A continuous map F:MNF : M → N is a smooth (CC^\infty) map if for all αα and ββ with F1(Vβ)UαF^{−1}(V_β)∩ U_α \not= ∅, the composition ψβFφα1:φα(UαF1(Vβ))ψβ(Vβ)ψ_β ◦ F ◦ φ^{−1}_α : φ_α(U_α ∩ F^{-1}(V_β ))→ ψ_β (V_β ) is smooth (CC^∞ map on the open subset φα(UαF1(Vβ))φ_α(U_α ∩ F^{-1}(V_β )) of RnR^n).


A diffeomorphism of manifolds is a bijective CC^∞ map F:NMF : N → M whose inverse F1F^{−1} is also CC^∞.

If MM is a smooth manifold, then the coordinate maps ϕ:Uϕ(U)\phi: U\to \phi(U) are examples of diffeomorphisms of open subsets UU and ϕ(U)\phi(U).

In fact, ϕ:Uϕ(U)\phi: U\to \phi(U) is homeomorphic by definition. Take the atlas with a single chart {(U,ϕ)}\{(U,\phi)\} on UU and the atlas with a single chart {(ϕ(U),idϕ(U))}\{(\phi(U),id_{\phi(U)})\} on ϕ(U)\phi(U). To check the smoothness of ϕ\phi and ϕ1\phi^{-1} it suffices to note that idϕ(U)ϕϕ1id_{\phi(U)}\circ \phi \circ \phi^{-1} and ϕϕ1idϕ(U)\phi \circ \phi^{-1}\circ id_{\phi(U)} are identity maps ϕ(U)ϕ(U).  \phi(U)\to\phi(U).\ \ Note, that if V=ϕ(U)V=\phi(U), then ϕ(Uϕ1(V))=ϕ(U) \phi(U\cap\phi^{-1}(V))=\phi(U)\ and if ψ=idϕ(U) \psi=id_{\phi(U)}\ , then ψ(V)=ϕ(U)\psi(V)=\phi(U).


Every smooth map F:MN{\displaystyle F :M\to N} between smooth manifolds induces natural linear maps between their corresponding tangent spaces: dFp:TpMTF(p)N,pM.{\displaystyle {d} {F }_{p}:T_{p}M\to T_{F (p)}N,\quad p\in M.} This map is defined by [dFp(Xp)]f=Xp(fF),\begin{equation} {\displaystyle [ {d} {F }_{p}(X_p)]f\mathrel {\stackrel {\text{}}{=}} X_p(f\circ F ),} \tag{8.8} \end{equation} for XpTpMX_p\in T_pM and fC(M).f\in C^\infty(M).

The linear map dFp{\displaystyle {d} {F }_{p}} is called the differential of FF at pp, the derivative, or pushforward of F{\displaystyle F } at p {\displaystyle p}. It is frequently expressed using another notations, for example (F)p{(F _{*})_{p}} or TpFT_pF.


Chain Rule. If F:XYF : X → Y and H:YZH : Y → Z are smooth maps between smooth manifolds, then d(HF)p=dHF(p)dFpd(H ◦ F)_p = dH_{F(p)}◦dF_p for any point pXp ∈ X.

This is a consequence of

dHF(p)(dFp(Xp))f=(dFp(Xp)(fH)=Xp(fHF)=d(HF)pf.dH_{F(p)}(dF_p(X_p))f=(dF_p(X_p)(f\circ H)=X_p(f\circ H\circ F)=d(H\circ F)_pf.

If F:NMF : N → M is a diffeomorphism of manifolds and pNp ∈ N, then dFp:TpNTF(p)MdF_p : T_p N → T_{F(p)} M is an isomorphism of vector spaces and d(F1)F(p)=(dFp)1d(F^{-1})_{F(p)}=(dF_p)^{-1}.


The value of the differential of the coordinate map on the local basis



Let (U,ϕ)=(U,x1,,xn)(U,\phi)=(U,x^1,\ldots,x^n) be a coordinate chart at a point pp in a manifold MM. By the definition of the differential and the tangent vector xip\frac{\partial}{\partial x^i}\big|_p
dϕp(xip)f=xip(fϕ)=Diϕ(p)(fϕϕ1)=Diϕ(p)f\displaystyle d\phi_p\Big(\frac{\partial}{\partial x^i}\big|_p\Big)f=\frac{\partial}{\partial x^i}\Big|_p(f\circ\phi)=D_i\big|_{\phi(p)}(f\circ\phi\circ\phi^{-1})=D_i\big|_{\phi(p)}f. We have checked that dϕp(xip)=Diϕ(p).\displaystyle d\phi_p\Big(\frac{\partial}{\partial x^i}\big|_p\Big) =D_i\big|_{\phi(p)}. Thus the tangent vectors xip \displaystyle \frac{\partial}{\partial x^i}\big|_p\ , (pUp\in U) are inverse images with respect to dϕpd\phi_p of the tangent vectors corresponding to the partial derivatives Diϕ(p)D_i\big|_{\phi(p)} . Recall that Diϕ(p)D_i\big|_{\phi(p)} denote the usual partial derivatives in RnR^n (defined after (8.3)).

Matrix representation of the differential


For a smooth map F:MNF : M → N of manifolds and a point pMp ∈ M, let (U,x1,,xn)(U, x^1 , \ldots , x^n ) and (V,y1,,ym)(V, y^1 , \ldots , y^m ) be coordinate charts about pp in MM and F(p)F(p) in NN, respectively. Relative to the bases xjp\frac{ ∂ }{∂ x^j} |_p for TpMT_p M and yiF(p)\frac{ ∂ }{ ∂ y^i} |_{F(p)} for TF(p)NT_{F(p)} N, the differential dFp:TpMTF(p)NdF_p : T_p M → T_{F(p)} N is represented by the Jacobian matrix [Fixjp],\displaystyle \Big[ \frac{∂ F^i} { ∂ x^j}\big|_p\Big],

where Fi=yiFF^i = y^i ◦ F is the ii-th component of FF i.e.,

dFp(xjp)=FixjpyiF(p).dF_p\big(\frac{\partial}{\partial x_j}\big|_p\big) =\frac{∂ F^i} { ∂ x^j}\big|_p\frac{\partial}{\partial y^i}\big|_{F(p)}.

To check this formula, let us note, that as a linear map, the differential dFpdF_p is is determined by the matrix ajia^i_j such that dFp(xjp)=ajkykF(p),j=1,,n.dF_p\big(\frac{\partial}{\partial x^j}\big|_p\big) =a^k_j \frac{\partial}{\partial y^k}\big|_{F(p)},\quad j=1,\ldots,n. Applying both sides to yiy^i we obtain

aji=ajkδki=(ajkykF(p))yi=dFp(xjp)yi=xjp(yiF)=Fixjp.a^i_j=a^k_j\delta^i_k=\Big(a^k_j\frac{\partial}{\partial y^k}\big|_{F(p)}\Big)y^i=dF_p\Big( \frac{\partial}{\partial x^j}\big|_p\Big)y^i=\frac{\partial}{\partial x^j}\big|_p(y^i\circ F) =\frac{\partial F^i}{\partial x^j}\big|_p.

Example 8.3

Consider the map Φ:R2R3\Phi:R^2\to R^3 defined by

Φ(x,y)=(u,v,w)=(x,y,xy).\Phi(x,y)=(u,v,w)=(x,y,xy).

For p=(x,y)p=(x,y) compute the values   dΦp(xp)  \ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ and   dΦp(yp)\ \ d\Phi_p(\frac{\partial}{\partial y}\big|_p\big).

M = Manifold(2, 'M') # manifold M X.<x,y> = M.chart() # coordinates on M N = Manifold(3, 'N') # manifold N Y.<u,v,w> = N.chart() # coordinates on N # smooth map Phi: M->N: Phi=M.diff_map(N,{(X,Y):[x,y,x*y]},name='Phi',latex_name=r'\Phi') p = M.point((x,y), name='p') # point p on M dPhip = Phi.differential(p) # differential of Phi at p print(dPhip) # print info on the differential
Generic morphism: From: Tangent space at Point p on the 2-dimensional differentiable manifold M To: Tangent space at Point Phi(p) on the 3-dimensional differentiable manifold N
Tp=M.tangent_space(p) # tangent space at p b=Tp.default_basis();b # basis of Tp # index p is dropped

(x,y)\displaystyle \left(\frac{\partial}{\partial x },\frac{\partial}{\partial y }\right)

The values of dΦpd\Phi_p on the basis vectors:

[dPhip(b[0]).disp(),'_______',dPhip(b[1]).disp()]

[dΦp(x)=u+yw,_______,dΦp(y)=v+xw]\displaystyle \left[{\mathrm{d}\Phi}_{p}\left( \frac{\partial}{\partial x } \right) = \frac{\partial}{\partial u } + y \frac{\partial}{\partial w }, \verb|_______|, {\mathrm{d}\Phi}_{p}\left( \frac{\partial}{\partial y } \right) = \frac{\partial}{\partial v } + x \frac{\partial}{\partial w }\right]

The coefficients in the basis  u, v, w  \ \frac{\partial}{\partial u},\ \frac{\partial}{\partial v}, \ \frac{\partial}{\partial w}\ \ of the tangent vectors   dΦp(xp)  \ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ and   dΦp(yp)\ \ d\Phi_p(\frac{\partial}{\partial y}\big|_p\big) can be found in columns of the Jacobian:

dPhip.matrix() # matrix of dPhi at p

(1001yx)\displaystyle \left(\begin{array}{rr} 1 & 0 \\ 0 & 1 \\ y & x \end{array}\right)


Example 8.4

Let us show how the tangent vectors in R2R^2 are transformed by the map  Φ(x,y)=(x,y,1(x2+y2)/4).\ \Phi(x,y)=(x,y,1-(x^2+y^2)/4).

First we sketch a tangent vector vv in R2R^2:

# Tangent vector in R^2 R2 = Manifold(2,'R2') # manifold R2 ch1.<x,y>=R2.chart() # coordinates on R2 p = R2((4,-4), name='p') # p=(4,-4) "starting point" Tp = R2.tangent_space(p) # tangent space at p v = Tp((4, -2), name='v') # (4,-2) -vector coordinates p1 = v.plot(fontsize=18,label='$v$', # plot vector v arrowsize=2,label_offset=0.7,color='black') p2 = ch1.plot(color='black') # plot the coordinate lines (p1 + p2).show(figsize=[3,3]) # combine plots
Image in a Jupyter notebook

To obtain more information on plotting vectors use the command v.plot?:

# v.plot?

To show the corresponding tangent vector to the graph of Φ\Phi we have to define the ambient space R3R^3 which contains the graph. The corresponding tangent vector is equal to dΦp(v)d\Phi_p(v).

# Continuation, image of the previous manifold under the map # (x,y) --> (x,y,1-(x^2+y^2)/4) R3 = Manifold(3,'R3') # manifold R^3 ch2.<X,Y,Z> = R3.chart() # coordinates X,Y,Z Phi = R2.diff_map(R3,{(ch1,ch2):[x,y,1-(x^2+y^2)/4]}, name='Phi',latex_name=r'\Phi') # define Phi pl=ch1.plot(chart=ch2,mapping=Phi, thickness=1,number_values=9, label_axes=False,color='black') # image of coord. lines x,y pl1=parametric_plot3d([x,y, 1-0.25*(x^2+y^2)],(x,-8,8),(y,-8,8), color='lightgrey',opacity=0.9) # plot the image of Phi vpl=v.plot(ch2,mapping=Phi,scale=1,width=6,fontsize=24, label='V', color='black',label_offset=0.8) # plot vector V (pl+pl1+vpl).rotateZ(-pi/1.7).show(frame=False, aspect_ratio=[1,1,0.3]) # combine plots # the rotation allows for better view of the vector V

Let us compute the value of the differential dΦpd\Phi_p on the tangent vector vv.

dPhi = Phi.differential(p) # differential of Phi at p dPhi(v).disp() # show the differential

dΦp(v)=4X2Y12Z\displaystyle {\mathrm{d}\Phi}_{p}\left(v\right) = 4 \frac{\partial}{\partial X } -2 \frac{\partial}{\partial Y } -12 \frac{\partial}{\partial Z }

The coordinates (4,-2,-12) of dΦp(v)d\Phi_p(v) can be obtained as a result of multiplication of the Jacobian of Φ\Phi at pp by the vector of components of vv:

# jacobian in an arbitrary jac=Phi.jacobian_matrix() # point (x,y) # jacobian at the point p # with coordinates (4,-4): jac0=jac.apply_map(lambda u:u.subs({x:4,y:-4})) jac0

(100122)\displaystyle \left(\begin{array}{rr} 1 & 0 \\ 0 & 1 \\ -2 & 2 \end{array}\right)

jac0*vector([4,-2]) # jacobian at p times vector([4,-2])

(4,2,12)\displaystyle \left(4,\,-2,\,-12\right)


Example 8.5

Let us show a tangent vector in polar coordinates. This time we define the map by Φ(r,ϕ)=(rcos(ϕ),rsin(ϕ),1r2/2)\Phi(r,\phi)=(r\cos(\phi),r\sin(\phi), 1-r^2/2).

Its Jacobian is of the form jac= (Φ1/rΦ1/ϕΦ2/rΦ2/ϕΦ3/rΦ3/ϕ).\left(\begin{matrix} \partial\Phi_1/\partial r & \partial\Phi_1/\partial\phi\\ \partial\Phi_2/\partial r & \partial\Phi_2/\partial\phi\\ \partial\Phi_3/\partial r & \partial\Phi_3/\partial\phi \end{matrix} \right).

%display latex R2 = Manifold(2, 'R2') V = R2.open_subset('V') # disk in r,ph plane c_rph.<r,ph> = V.chart(r'r:(0,2) ph:(0,2*pi):\phi') # polar coord. R3 = Manifold(3, 'R^3') # ambient space R^3 c_cart.<x,y,z> = R3.chart() # Cartesian coord. on R^3 Phi = V.diff_map(R3, # define Phi: {(c_rph,c_cart):[r*cos(ph),r*sin(ph),1-r^2/2]}, name='Phi',latex_name=r'\Phi')
jac=Phi.jacobian_matrix();jac # Jacobian of Phi

(cos(ϕ)rsin(ϕ)sin(ϕ)rcos(ϕ)r0)\displaystyle \left(\begin{array}{rr} \cos\left({\phi}\right) & -r \sin\left({\phi}\right) \\ \sin\left({\phi}\right) & r \cos\left({\phi}\right) \\ -r & 0 \end{array}\right)

For the point pp in the r,ϕr,\phi plane with (r,ϕ)=(1,π/2)(r,\phi)=(1,\pi/2) we define jac0 as the value of jac in pp.

jac0=jac.apply_map(lambda x:x.subs({r:1,ph:pi/2})) jac0 # show Jacobian at p

(011010)\displaystyle \left(\begin{array}{rr} 0 & -1 \\ 1 & 0 \\ -1 & 0 \end{array}\right)

The image of the vector vv in the r,ϕr,\phi plane with components (0,1)(0,1) i.e. v=0r+1ϕ v=0\frac{\partial}{\partial r}+1\frac{\partial}{\partial\phi} is the vector dΦp(v)d\Phi|_p(v):

p = V((1,pi/2), name='p') # point p in V c_cart(Phi(p)) # coordinates of Phi at p dPhi=Phi.differential(p) # differential of Phi at p Tp = V.tangent_space(p) # tangent space at p v = Tp((0, 1), name='v') dPhi(v).disp()

dΦp(v)=x\displaystyle {\mathrm{d}\Phi}_{p}\left(v\right) = -\frac{\partial}{\partial x }

Components of this vector can be computed using the jacobian jac0.

jac0*vector([0,1]) # multiply matrix jac0 by the vector [0,1]

(1,0,0)\displaystyle \left(-1,\,0,\,0\right)

Since the points of the the tangent plane are of the form:
vector(c_cart(Phi(p)))+jac0*vector([r,ph]),
we can add the plot of the tangent plane to the surface.

# plot the image of coordinate lines r,ph under Phi: pl=c_rph.plot(chart=c_cart,mapping=Phi, thickness=2, number_values=20,label_axes=False,color='black') # plot the image of v under Phi vpl=v.plot(chart=c_cart,mapping=Phi,scale=1.4,width=2, fontsize=24, label='V', color='black',label_offset=0.4) # plot the graph of Phi pl1=parametric_plot3d((r*cos(ph),r*sin(ph), 1-0.5*r^2), (r,0,2),(ph,0,2*pi),color='darkgrey') # plot the tangent plane at p tpl=parametric_plot3d(vector(c_cart(Phi(p)))+ jac0*vector([r,ph])+jac0*vector([r,ph]), (r,-0.5,0.5),(ph,-pi/4,pi/4),opacity=0.7,color='lightgrey') # combine plots (pl+vpl+pl1+tpl).rotateZ(pi/8).show(aspect_ratio=[1,1,0.9], frame=False)

Tangent vectors to curves


For a smooth curve on a Manifold i.e., a smooth map γ:IM\gamma: I\to M we defined (cf. (7.6), notebook 7) the tangent vector to γ\gamma at t0It_0\in I to be

γt0(f)=ddt(γf)t0=ddt(fγ)t0.\begin{equation} \gamma'_{t_0}(f) =\frac{d}{dt}(\gamma^*f)\Big|_{t_0}= \frac{d}{dt}(f\circ\gamma)\Big|_{t_0}. \tag{8.9} \end{equation}

Tangent vectors to curves in local coordinates


Let γ:IM\gamma: I\to M be a smooth curve and (U,x1,,xn)(U,x^1,\ldots,x^n) be a coordinate chart about γ(t0)\gamma(t_0). Define γi=xiγ:IR\gamma^i=x^i\circ\gamma:I\to R. Then the tangent vector at t0t_0 to the curve γ\gamma is given by

γt0=d(xiγ)dtt0xiγ(t0)=dγidtt0xiγ(t0).\begin{equation} \gamma'_{t_0}=\frac{d(x^i\circ \gamma)}{dt}\Big|_{t_0}\frac{\partial}{\partial x^i}\Big|_{\gamma(t_0)}=\frac{d\gamma^i}{dt}\Big|_{t_0}\frac{\partial}{\partial x^i}\Big|_{\gamma(t_0)}. \tag{8.10} \end{equation}

To check this relation it suffices to recall, that by (8.5)   γt0=γt0(xi)xiγ(t0)\ \ \gamma'_{t_0}=\gamma'_{t_0}(x^i)\frac{\partial}{\partial x^i}\Big|_{\gamma(t_0)} and by (8.9)   γt0(xi)=d(xiγ)dtt0.\ \ \gamma'_{t_0}(x^i) = \frac{d(x^i ◦\gamma)}{dt}\Big|_{t_0} .


All tangent vectors are tangent to some curve


Let MM be a smooth manifold, pMp\in M. For any tangent vector XpTpMX_p\in T_pM, there is a curve γ:IM\gamma: I\to M ( II an open interval containing t0t_0) with γt0=p\gamma_{t_0}=p and γt0=Xp.\gamma'_{t_0}=X_p.

In fact if Xp=aixipX_p=a^i\frac{\partial}{\partial x^i}\Big|_p, define

γ(t)=ϕ1(ϕ(p)+(tt0)a),\gamma(t)=\phi^{-1}(\phi(p)+(t-t_0)a),

where a=(a1,,an)a=(a^1,\ldots,a^n). From this definition and the relation γ(t0)=p\gamma(t_0)=p it follows

ϕ(γ(t))=ϕ(p)+(tt0)a,\phi(\gamma(t))=\phi(p)+(t-t_0)a,

or equivalently

ϕ(γ(t))ϕ(p)=(tt0)a.\phi(\gamma(t))-\phi(p)=(t-t_0)a.

Equating ii-th components we obtain xi(γ(t))xi(γ(t0))=ai(tt0),x^i(\gamma(t))-x^i(\gamma(t_0))=a^i(t-t_0), so γt0(xi)=limtt0xi(γ(t))xi(γ(t0))tt0=ai.\gamma'_{t_0}(x^i)=\lim_{t\to t_0}\frac{x^i(\gamma(t))-x^i(\gamma(t_0))}{t-t_0}=a^i.

Thus the tangent vectors γt0\gamma'_{t_0} and XpX_p have the same components.


Computing differentials using curves


Observe that if in the definition of differential:   dFp(Xp)f=Xp(fF)  \ \ dF_p(X_p)f=X_p(f\circ F)\ \ we replace dFpdF_p by dγ0 d\gamma_0\ and  Xp \ X_p\ by  ddt0, \ \frac{d}{dt}\big|_0,\ then we obtain   dγ0(ddt0)f=ddt0(fγ)=γ0(f),\ \ d\gamma_0\big(\frac{d}{dt}\big|_0\big)f=\frac{d}{dt}\big|_0(f\circ\gamma)=\gamma'_0(f), so dγ0(ddt0)=γ0.d\gamma_0(\frac{d}{dt}\big|_0)=\gamma'_0.

The last two observations give us a useful way of computing differentials dFp:TpMTF(p)NdF_p : T_pM →T_{F(p)}N . By the first of them, for any vTpMv ∈ T_pM we can find a curve γ:IMγ : I → M with γ0=pγ_0 = p and γ0=vγ'_0 = v. Then, by the chain rule, dFp(v)=dFp(γ0)=dFp(dγ0(ddt0))=d(Fγ)0(ddt0)=(Fγ)0.dF_p(v) = dF_p(γ'_0) = dF_p (dγ_0(\frac{d}{dt}\big|_0)) = d(F◦γ)_0 (\frac{d}{dt}\big|_0 ) = (F◦γ)'_0.

Thus the tangent vector to the image of the curve γ\gamma under the map FF is the image of the tangent vector to γ\gamma under dFdF.


Example 8.6

Consider the map Φ(x,y)=(x,y,1(x2+y2)/4)\Phi(x,y)=(x,y,1-(x^2+y^2)/4) and two Cartesian coordinate lines, intersecting in a point pp with Cartesian coordinates (1,-1). Let vxv_x and vyv_y be the tangent vectors to the coordinate lines at pp.

# unit vectors in R^2 tangent to coordinates lines R2=Manifold(2,'R2') # manifold R2 ch1.<x,y>=R2.chart(r'x:(-2,2) y:(-2,2)') # coordinates on R2 p = R2((1,-1), name='p') # p=(1,-1) "starting point" Tp = R2.tangent_space(p) # tangent space at p vx = Tp((1, 0), name='v_x') ; # tangent vector vx at p vy = Tp((0, 1), name='v_y') ; # tangent vector vy at p px=vx.plot(fontsize=18,label_offset=0.2, # plot vx arrowsize=3,color='black')+ch1.plot(color='grey') py=vy.plot(fontsize=18,label_offset=0.2, # plot vy arrowsize=2,color='black')+ch1.plot(color='grey') (px+py).show(figsize=[3,3]) # combine plots
Image in a Jupyter notebook

Now let us show how the tangent vectors are transformed by dΦpd\Phi_p.

Remark. In 3-d plots in SageMath one can use unicode characters (we were not able to obtain latex symbols in 3-d plots).

# example how to obtain "\partial" symbol from sage.typeset.unicode_characters import * print(unicode_partial)
# continuation, image of the previous manifold under the map # (x,y) --> (x,y,1-(x^2+y^2)/4) R3=Manifold(3,'R3') # manifold R3 ch2.<X,Y,Z>=R3.chart() # coordinates in R3 Phi = R2.diff_map(R3,{(ch1,ch2):[x,y, 1 - (x^2+y^2)/4]}, name='Phi',latex_name=r'\Phi') # define Phi pl=ch1.plot(chart=ch2,mapping=Phi, thickness=1,number_values=9, label_axes=False,color='black') # plot image of coord. lines x,y pl1=parametric_plot3d([x,y, 1-0.25*(x^2+y^2)],(x,-2,2),(y,-2,2), color='lightgrey',opacity=0.9) # plot graph of Phi vplx=vx.plot(ch2,mapping=Phi,scale=1,width=1,fontsize=20, label=r'∂/∂X - 1/2 ∂/∂Z',color='black',label_offset=-0.3) # plot image of vx vply=vy.plot(ch2,mapping=Phi,scale=1,width=1,fontsize=20, label=r'∂/∂Y + 1/2 ∂/∂Z',color='black',label_offset=0.3) # plot image of vy (pl+pl1+vplx+vply).rotateZ(-pi/3).show(frame=False, aspect_ratio=[1,1,1]) # combine plots # images of tangent vectors are tangent # to transformed coordinate lines

Now let us do the corresponding calculations.

First recall all needed numbers.

# Coordinates in R^2 of p and components of vx, vy print(p.coord()," ",vx.comp()[:]," ",vy.comp()[:])
(1, -1) [1, 0] [0, 1]
Phi(p).coord() # coordinates of Phi(p)

(1,1,12)\displaystyle \left(1, -1, \frac{1}{2}\right)

jac=Phi.jacobian_matrix(); jac # Jacobian of dPhi

(100112x12y)\displaystyle \left(\begin{array}{rr} 1 & 0 \\ 0 & 1 \\ -\frac{1}{2} \, x & -\frac{1}{2} \, y \end{array}\right)

jac0=jac.apply_map(lambda u:u.subs({x:1,y:-1})) jac0 # Jacobian at p

(10011212)\displaystyle \left(\begin{array}{rr} 1 & 0 \\ 0 & 1 \\ -\frac{1}{2} & \frac{1}{2} \end{array}\right)

dPhi=Phi.differential(p) # differential of Phi at p dPhi(vx).disp() # value of dPhi(vx)

dΦp(vx)=X12Z\displaystyle {\mathrm{d}\Phi}_{p}\left(v_x\right) = \frac{\partial}{\partial X } -\frac{1}{2} \frac{\partial}{\partial Z }

dPhi(vy).disp() # value of dPhi(vy)

dΦp(vy)=Y+12Z\displaystyle {\mathrm{d}\Phi}_{p}\left(v_y\right) = \frac{\partial}{\partial Y } + \frac{1}{2} \frac{\partial}{\partial Z }

As we can see, the components in the basis  X, Y, Z  \ \frac{\partial}{\partial X},\ \frac{\partial}{\partial Y}, \ \frac{\partial}{\partial Z}\ \ of the tangent vectors   dΦp(xp)  \ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ and   dΦp(yp)\ \ d\Phi_p(\frac{\partial}{\partial y}\big|_p\big) can be found in columns of the Jacobian at pp.

They can be computed by multiplying the Jacobian at pp by the vectors of components of vxv_x and vyv_y.

jac0*vector([1,0])

(1,0,12)\displaystyle \left(1,\,0,\,-\frac{1}{2}\right)

jac0*vector([0,1])

(0,1,12)\displaystyle \left(0,\,1,\,\frac{1}{2}\right)


Family of tangents to a curve


If we are interested in tangents to a curve, an easy way to define them is to use the notion of the vector field along the curve (i.e. the map tγ(t)t\to \gamma'(t), tIt\in I). The more general notion of a vector field will be defined in later notebooks. In the figure below, we use the function tangent_vector_field which allows for defining tangent vectors in all points of curves. Here we restricted ourselves to a selected point of intersection of two curves c1,c2c_1, c_2 and tangent vectors to these curves at that point.


Example 8.7

Let us show how tangent_vector_field method can be used to plot tangent vectors to two curves at intersection point.

R2 = Manifold(2, 'R^2') # R^2 U = R2.open_subset('U') # unit disk in R^2 c_rph.<r,ph> = U.chart(r'r:(0,1) ph:(0,2*pi):\phi') # polar coordinates on U R3 = Manifold(3, 'R^3') # R^3 c_cart.<x,y,z> = R3.chart() # Cartesian coord. on R^3 Phi = U.diff_map(R3,{(c_rph,c_cart):[r*cos(ph),r*sin(ph), 1-r^2]}, # define Phi name='Phi', latex_name=r'\Phi') R.<t> = manifolds.RealLine() # real line c1 = U.curve([t+sqrt(2)/4,pi/4], (t, -oo, +oo), name="") # user defined curve #1 c2 = U.curve([sqrt(2)/4,t+pi/4], (t, -oo, +oo), name="") # user defined curve #2 pl=c_rph.plot(chart=c_cart,mapping=Phi, number_values={r:4,ph:2}, thickness=2,label_axes=False,color='darkgrey') # coordinate lines pl1=parametric_plot3d([r*cos(ph),r*sin(ph), 1-r^2],(r,0,1),(ph,0,2*pi), color='lightgrey',opacity=0.9) # surface plot cpl1=c1.plot(mapping=Phi, max_range=0.4,color='black', # plot curve #1 plot_points=200, thickness=3, label_axes=False) cpl2=c2.plot(mapping=Phi, max_range=0.6,color='black', # plot curve #2 plot_points=200, thickness=3, label_axes=False) v1 = c1.tangent_vector_field() # tangents to curve #1 v2 = c2.tangent_vector_field() # tangents to curve #2 vp1=v1.at(R(0)) # tangent to curve #1 at t=0 vp2=v2.at(R(0)) # tangent to curve #2 at t=0 pv1=vp1.plot(mapping=Phi,scale=0.5,color='black',arrowsize=1) # plot tang.vector #1 pv2=vp2.plot(mapping=Phi,scale=1.5,label_axes=False, color='black',arrowsize=1) # plot tangent vector #2 (pl+pl1+pv1+pv2+cpl1+cpl2).rotateZ(-pi/7).show(frame=False) # combine plots

What's next?

Take a look at the notebook Tensors on modules.