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 $M$ be a smooth manifold and $p ∈ M$. A tangent vector to $M$ at $p$ is a map $X_p : C^∞ (M ) → R$ such that
\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, g ∈ C^\infty (M )$ and $a,b\in R$.
Maps $C^∞ (M ) → R$ satisfying the last relation are also said to have a derivation property and are called
derivations (into $R$).
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 $p$ by
for $\ f ∈ C^\infty (M )$ and $\lambda\in R$, then we obtain a vector space.
Tangent space $T_p M$ to a smooth manifold $M$ at a point $p$ is the vector space of all tangent vectors to $M$ at $p$.
Let $(U, φ)$ be a chart on $M,$ with coordinates $x^1 , . . . , x^n$ and $p ∈ U$. The tangent vectors,$ \frac{∂}{∂ x^i}\Big|_p$ are defined by \begin{equation} \frac{∂}{∂ x^i}\Big|_p(f) = D_i ( f ◦ φ^{−1} )|_{φ( p)}. \tag{8.3} \end{equation}
Here $f\in C^\infty(M)$ and $D_i$ denotes the partial derivative in $R^n$, i.e.
$$\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 $e_i$ is the vector in $R^n$ with $i$-th component 1 and all other 0.
Using the Leibniz rule for $D_i$ one can show that $\frac{∂}{∂ x^i}\Big|_p$ satisfy (8.1), so they are tangent vectors to $M$ at $p\in M$.
Let us check how the tangent vectors $\ \frac{∂}{∂ x^i}\big|_p$ act on coordinate functions $x^j$. We have
$$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
The vectors $\ \ \displaystyle\frac{\partial}{\partial x^i}\Big|_p,\ \ $ $i=1,\ldots,n\ \ $ form a basis of $T_pM$.
The linear independence follows from the fact that if $\sum_{i=1}^n a^i\frac{\partial}{\partial x^i}\Big|_p=0\in T_pM$, then by (8.4) $$\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 $\ \ \displaystyle\frac{\partial}{\partial x^i}\Big|_p,\ \ $ $i=1,\ldots,n\ \ $ span the tangent space $\ T_pM\ $ we need to prove:
If $\phi=(x^1,\ldots,x^n): U\to R^n$ is a coordinate chart on a manifold $M$ and $X_p\in T_pM$ is a tangent vector at $p\in U$, then \begin{equation} X_p=\sum_{i=1}^n X_p(x^i)\frac{\partial}{\partial x^i}\Big|_p. \label{}\tag{8.5} \end{equation}
Using this convention, the last formula can be written as
$$X_p=X_p(x^i)\frac{\partial}{\partial x^i}\Big|_p.$$To check (8.5) let $f\in C^\infty(M)$ and let $F=f\circ\phi^{-1}$. If $q\in U$, then
$$f(q)=(f\circ\phi^{-1})(\phi(q))=F(\phi(q)).$$Analogously $f ( p) = F (φ( p)).\ \ $ We shall use the following version of the mean value theorem.
If $p$ is fixed, then (8.6) leads to
$$f (q) = f ( p) + [x^i (q) − x^i ( p) ]g_i (q).$$Since $q$ is arbitrary point in a neighborhood of $p$
\begin{equation} f = f ( p) + [x^i − x^i ( p)] g_i. \tag{8.7} \end{equation}Using (8.1) and the fact that $f(p)$ and $x^i(p)$ are constants ($p$ is fixed) we have
$$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 $g_i(p)=D_i(f\circ\phi^{-1})|_{\phi(p)}=\frac{\partial}{\partial x^i}\Big|_p(f)$, we have proved (8.5).
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
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
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
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
Check that the tangent vector V
maps a scalar function f
to the real number
$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
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))
The definition of smooth maps (from notebook 1) is equivalent to the following. Let $M$ and $N$ be two smooth manifolds with some atlases {$(U_α,φ_α )$} and
{$(V_β,ψ_β)$}, respectively.
A continuous map $F : M → N$ is a smooth ($C^\infty$) map if for all $α$ and $β$ with
$F^{−1}(V_β)∩ U_α \not= ∅$,
the composition
$ψ_β ◦ F ◦ φ^{−1}_α : φ_α(U_α ∩ F^{-1}(V_β ))→ ψ_β (V_β )$
is smooth ($C^∞$ map on the open subset $φ_α(U_α ∩ F^{-1}(V_β ))$ of $R^n$).
A diffeomorphism of manifolds is a bijective $C^∞$ map $F : N → M$ whose inverse $F^{−1}$ is also $C^∞$.
If $M$ is a smooth manifold, then the coordinate maps $\phi: U\to \phi(U)$ are examples of diffeomorphisms of open subsets $U$ and $\phi(U)$.
In fact, $\phi: U\to \phi(U)$ is homeomorphic by definition. Take the atlas with a single chart $\{(U,\phi)\}$ on $U$ and the atlas with a single chart $\{(\phi(U),id_{\phi(U)})\}$ on $\phi(U)$. To check the smoothness of $\phi$ and $\phi^{-1}$ it suffices to note that $id_{\phi(U)}\circ \phi \circ \phi^{-1}$ and $\phi \circ \phi^{-1}\circ id_{\phi(U)}$ are identity maps $\phi(U)\to\phi(U).\ \ $ Note, that if $V=\phi(U)$, then $\phi(U\cap\phi^{-1}(V))=\phi(U)\ $ and if $\psi=id_{\phi(U)}\ $, then $\psi(V)=\phi(U)$.
Every smooth map ${\displaystyle F :M\to N}$ between smooth manifolds induces natural linear maps between their corresponding tangent spaces: $${\displaystyle {d} {F }_{p}:T_{p}M\to T_{F (p)}N,\quad p\in M.}$$ This map is defined by \begin{equation} {\displaystyle [ {d} {F }_{p}(X_p)]f\mathrel {\stackrel {\text{}}{=}} X_p(f\circ F ),} \tag{8.8} \end{equation} for $X_p\in T_pM$ and $f\in C^\infty(M).$
The linear map ${\displaystyle {d} {F }_{p}}$ is called the differential of $F$ at $p$, the derivative, or pushforward of ${\displaystyle F }$ at $ {\displaystyle p}$. It is frequently expressed using another notations, for example ${(F _{*})_{p}}$ or $T_pF$.
Chain Rule. If $F : X → Y$ and $H : Y → Z$ are smooth maps between smooth manifolds, then $d(H ◦ F)_p = dH_{F(p)}◦dF_p$ for any point $p ∈ X$.
This is a consequence of
$$ 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 : N → M$ is a diffeomorphism of manifolds and $p ∈ N$, then $dF_p : T_p N → T_{F(p)} M$ is an isomorphism of vector spaces and $d(F^{-1})_{F(p)}=(dF_p)^{-1}$.
For a smooth map $F : M → N$ of manifolds and a point $p ∈ M$, let $(U, x^1 , \ldots , x^n )$ and $(V, y^1 , \ldots , y^m )$ be coordinate charts about $p$ in $M$ and $F(p)$ in $N$, respectively. Relative to the bases $\frac{ ∂ }{∂ x^j} |_p $ for $T_p M$ and $\frac{ ∂ }{ ∂ y^i} |_{F(p)} $ for $T_{F(p)} N$, the differential $dF_p : T_p M → T_{F(p)} N$ is represented by the Jacobian matrix $$\displaystyle \Big[ \frac{∂ F^i} { ∂ x^j}\big|_p\Big],$$
where $F^i = y^i ◦ F $ is the $i$-th component of $F$ i.e.,
$$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 $dF_p$ is is determined by the matrix $a^i_j$ such that $$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 $y^i$ we obtain
$$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 $\Phi:R^2\to R^3$ defined by
$$\Phi(x,y)=(u,v,w)=(x,y,xy).$$For $p=(x,y)$ compute the values $\ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ $ and $\ \ 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
The values of $d\Phi_p$ on the basis vectors:
[dPhip(b[0]).disp(),'_______',dPhip(b[1]).disp()]
The coefficients in the basis $\ \frac{\partial}{\partial u},\ \frac{\partial}{\partial v}, \ \frac{\partial}{\partial w}\ \ $ of the tangent vectors $\ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ $ and $\ \ 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
Example 8.4
Let us show how the tangent vectors in $R^2$ are transformed by the map $\ \Phi(x,y)=(x,y,1-(x^2+y^2)/4).$
First we sketch a tangent vector $v$ in $R^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
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 $R^3$ which contains the graph. The corresponding tangent vector is equal to $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\Phi_p$ on the tangent vector $v$.
dPhi = Phi.differential(p) # differential of Phi at p
dPhi(v).disp() # show the differential
The coordinates (4,-2,-12) of $d\Phi_p(v)$ can be obtained as a result of multiplication of the Jacobian of $\Phi$ at $p$ by the vector of components of $v$:
# 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
jac0*vector([4,-2]) # jacobian at p times vector([4,-2])
Example 8.5
Let us show a tangent vector in polar coordinates. This time we define the map by $\Phi(r,\phi)=(r\cos(\phi),r\sin(\phi), 1-r^2/2)$.
Its Jacobian is of the form jac= $\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
For the point $p$ in the $r,\phi$ plane with $(r,\phi)=(1,\pi/2)$
we define jac0 as the value of jac in $p$.
jac0=jac.apply_map(lambda x:x.subs({r:1,ph:pi/2}))
jac0 # show Jacobian at p
The image of the vector $v$ in the $r,\phi$ plane with components $(0,1)$ i.e. $ v=0\frac{\partial}{\partial r}+1\frac{\partial}{\partial\phi}$ is the vector $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()
Components of this vector can be computed using the jacobian jac0.
jac0*vector([0,1]) # multiply matrix jac0 by the vector [0,1]
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)
For a smooth curve on a Manifold i.e., a smooth map $\gamma: I\to M$ we defined (cf. (7.6), notebook 7) the tangent vector to $\gamma$ at $t_0\in I$ to be
\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}Let $\gamma: I\to M$ be a smooth curve and $(U,x^1,\ldots,x^n)$ be a coordinate chart about $\gamma(t_0)$. Define $\gamma^i=x^i\circ\gamma:I\to R$. Then the tangent vector at $t_0$ to the curve $\gamma$ is given by
\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) $\ \ \gamma'_{t_0}=\gamma'_{t_0}(x^i)\frac{\partial}{\partial x^i}\Big|_{\gamma(t_0)}$ and by (8.9) $\ \ \gamma'_{t_0}(x^i) = \frac{d(x^i ◦\gamma)}{dt}\Big|_{t_0} .$
Let $M$ be a smooth manifold, $p\in M$. For any tangent vector $X_p\in T_pM$, there is a curve $\gamma: I\to M$ ( $I$ an open interval containing $t_0$) with $\gamma_{t_0}=p $ and $\gamma'_{t_0}=X_p.$
In fact if $X_p=a^i\frac{\partial}{\partial x^i}\Big|_p$, define
$$\gamma(t)=\phi^{-1}(\phi(p)+(t-t_0)a),$$where $a=(a^1,\ldots,a^n)$. From this definition and the relation $\gamma(t_0)=p$ it follows
$$\phi(\gamma(t))=\phi(p)+(t-t_0)a, $$or equivalently
$$\phi(\gamma(t))-\phi(p)=(t-t_0)a.$$Equating $i$-th components we obtain $$x^i(\gamma(t))-x^i(\gamma(t_0))=a^i(t-t_0),$$ so $$\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 $\gamma'_{t_0}$ and $X_p$ have the same components.
Observe that if in the definition of differential: $\ \ dF_p(X_p)f=X_p(f\circ F)\ \ $ we replace $dF_p$ by $d\gamma_0\ $ and $\ X_p\ $ by $\ \frac{d}{dt}\big|_0,\ $ then we obtain $\ \ d\gamma_0\big(\frac{d}{dt}\big|_0\big)f=\frac{d}{dt}\big|_0(f\circ\gamma)=\gamma'_0(f),$ so $$d\gamma_0(\frac{d}{dt}\big|_0)=\gamma'_0.$$
The last two observations give us a useful way of computing differentials $dF_p : T_pM →T_{F(p)}N $. By the first of them, for any $v ∈ T_pM$ we can find a curve $γ : I → M$ with $γ_0 = p$ and $γ'_0 = v$. Then, by the chain rule, $$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 $F$ is the image of the tangent vector to $\gamma$ under $dF$.
Example 8.6
Consider the map $\Phi(x,y)=(x,y,1-(x^2+y^2)/4)$ and two Cartesian coordinate lines, intersecting in a point $p$ with Cartesian coordinates (1,-1). Let $v_x$ and $v_y$ be the tangent vectors to the coordinate lines at $p$.
# 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
Now let us show how the tangent vectors are transformed by $d\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)
jac=Phi.jacobian_matrix(); jac # Jacobian of dPhi
jac0=jac.apply_map(lambda u:u.subs({x:1,y:-1}))
jac0 # Jacobian at p
dPhi=Phi.differential(p) # differential of Phi at p
dPhi(vx).disp() # value of dPhi(vx)
dPhi(vy).disp() # value of dPhi(vy)
As we can see, the components in the basis $\ \frac{\partial}{\partial X},\ \frac{\partial}{\partial Y}, \ \frac{\partial}{\partial Z}\ \ $ of the tangent vectors $\ \ d\Phi_p(\frac{\partial}{\partial x}\big|_p\big)\ \ $ and $\ \ d\Phi_p(\frac{\partial}{\partial y}\big|_p\big)$ can be found in columns of the Jacobian at $p$.
They can be computed by multiplying the Jacobian at $p$ by the vectors of components of $v_x$ and $v_y$.
jac0*vector([1,0])
jac0*vector([0,1])
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\to \gamma'(t)$, $t\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 $c_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
Take a look at the notebook Tensors on modules.