In [1]:
%display latex
viewer3D = 'tachyon'

We say that a subset $l\subset \mathbb{R}^2$ is a non-vertical affine line if there exists constants $a_l,b_l\in\mathbb{R}$ such that $$ l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\}.$$ Similarly, we say that a subset $l\subset \mathbb{R}^2$ is a non-horizontal affine line if there exists constants $c_l,d_l\in\mathbb{R}$ such that $$ l=\{(x,y)\in \mathbb{R}^2\mid x=c_ly+d_l\}. $$ A subset $l\subset\mathbb{R}^2$ is simply called an affine line if it can be described in either of the above ways.

Suppose that $l\subset\mathbb{R}^2$ is an affine line, we say that a point $(x_0,y_0)\in\mathbb{R}^2$ is on $l$ if $(x_0,y_0)\in l$. For example, if $l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\}$ is non-vertical, $(x_0,y_0)$ is on $l$ if and only if $y_0=a_lx_0+b_l$.

Let $$M=\{\big(l,(x_l,y_l)\big)\mid l\subset \mathbb{R}^2\text{ is an affine line, and } (x_l,y_l)\in l \text{ is a point on that line}\}.$$

In [2]:
M=Manifold(dim=3,name='M',latex_name='M')

Consider the charts $\{(U,\phi),(V,\psi)\}$ for $M$ given by $$ \begin{array}{rl} U&:=\big\{\big(l,(x_l,y_l)\big)\in M\big\lvert l \text{ is a non-horizontal affine line}\big.\big\}\\ \phi:U&\to \mathbb{R}^3,\quad\quad\phi\big(l,(x_l,y_l)\big)=(c_l,d_l,y_l),\\ &\quad\text{ where }l=\{(x,y)\in \mathbb{R}^2\mid x=c_ly+d_l\}\\\\ V&:=\big\{\big(l,(x_l,y_l)\big)\in M\big\lvert l \text{ is a non-vertical affine line}\big.\big\}\\ \psi:V&\to \mathbb{R}^3,\quad\quad\psi\big(l,(x_l,y_l)\big)=(a_l,b_l,x_l),\\ &\quad\text{ where }l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\} \end{array} $$

In [3]:
U=M.open_subset('U')
phiU.<cl,dl,yl>=U.chart(r"cl:c_l dl:d_l yl:y_l")
phiU
Out[3]:
In [4]:
V=M.open_subset('V')
psiV.<al,bl,xl>=V.chart(r"al:a_l bl:b_l xl:x_l")
psiV
Out[4]:

To compute the transition map, let's first compute $\psi^{-1}$ and $\phi^{-1}$. If $\psi((l,(x_l,y_l)))=(a_l,b_l,x_l)$, then we must have $l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\}$; and since $(x_l,y_l)\in l$, we must have $y_l=a_lx_l+b_l$. So $$\psi^{-1}(a_l,b_l,x_l)=\big(l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\},(x_l,y_l=a_lx_l+b_l)\big)$$

Now if $l=\{(x,y)\in \mathbb{R}^2\mid y=a_lx+b_l\}$ is non-horizontal, then $a_l\neq0$ so $$y=a_lx+b_l \Leftrightarrow x=y/a_l-b_l/a_l.$$ In particular we can write $l=\{(x,y)\in \mathbb{R}^2\mid x=c_ly+d_l\}$ for $c_l=1/a_l$ and $d_l=-b_l/a_l$. Therefore $$\phi\circ\psi^{-1}(a_l,b_l,x_l)=\phi\big(l=\{(x,y)\in \mathbb{R}^2\mid x=y/a_l-b_l/a_l\},(x_l,y_l=a_lx_l+b_l)\big)\\ =(c_l=1/a_l,\quad d_l=-b_l/a_l,\quad y_l=a_lx_l+b_l)$$ More concisely: $$\phi\circ\psi^{-1}(a_l,b_l,x_l)=(c_l=1/a_l,\quad d_l=-b_l/a_l,\quad y_l=a_lx_l+b_l),\quad\text{ for }a_l\neq 0$$

Since $a_l\neq 0$, and rational functions are smooth away from their poles (i.e. whenever their denominators do not vanish), this implies the the transition map $$\phi\circ\psi^{-1}:\psi(V\cap U)\to \phi(V\cap U)$$ is smooth.

In [5]:
psiV_to_phiU=psiV.transition_map(phiU,(1/al,-bl/al,al*xl+bl),restrictions1=(al!=0))
psiV_to_phiU.display()
Out[5]:

To compute the transtion map in the other direction, one follows a similar flow of logic, and arrives at the formulas $$\psi\circ\phi^{-1}(c_l,d_l,y_l)=(a_l=1/c_l,\quad b_l=-c_l/d_l,\quad x_l=c_ly_l+d_l)\quad\text{ for }c_l\neq 0$$ But let's use Sage to compute this:

In [6]:
phiU_to_psiV=psiV_to_phiU.inverse()
phiU_to_psiV.display()
Out[6]:

Since $a_l\neq 0$, and rational functions are smooth away from their poles (i.e. whenever their denominators do not vanish), this implies the the transition map $$\phi\circ\psi^{-1}:\psi(V\cap U)\to \phi(V\cap U)$$ is smooth.

Let's display the atlas:

In [7]:
M.atlas()
Out[7]:

Let $U\cap V=W$

In [8]:
W = U.intersection(V)
W
Out[8]:

Let's display the transition map. First, we restrict $psi$ to $W$:

In [9]:
psiV_W = psiV.restrict(W)
psiV_W
Out[9]:
In [10]:
graph1=psiV_W.plot(phiU,ranges={al:[.1,6.],bl:[-6.,6.],xl:[-6.,6.]},color='red')
graph2=psiV_W.plot(phiU,ranges={al:[-6.,-.1],bl:[-6.,6.],xl:[-6.,6.]},color='blue')
show(graph1+graph2,xmin=-6,xmax=6,ymin=-6,ymax=6,zmin=-6,zmax=6,viewer=viewer3D)

Consider the map $$P:\mathbb{R}^3\to M$$ which sends a triple $(x,y,\theta)\in \mathbb{R}^3$ to $(l_\theta,(x,y))$, where $l_\theta$ is the line through $(x,y)$ which makes an angle of $\theta$ with the positive $x$-axis.

We now give a formula for $P$ with respect to each of the charts $\{(U,\phi),(V,\psi)\}$ for $M$:

Suppose first that $\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\}$. If $l_\theta$ is at angle $\theta$ to the positive real axis, then $l_\theta$ must be given by an equation of the form $$y=\tan(\theta)x+b\quad\text{ if }\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\},$$ where $b$ is some real number. Solving this equation for $b$ yields $b=y-\tan(\theta)x$. If $\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\},$ then this line is non-vertical, so $$\psi\circ P(x,y,\theta)=(a_l=\tan(\theta),\quad b_l=y-\tan(\theta)x,\quad x_l=x),\quad\text{ for }\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\}$$

Let's use Sage to visualize this map.

In [11]:
R3=Manifold(3, 'R^3', r'\mathbb{R}^3', start_index=1)
cart.<X,Y,theta> = R3.chart(r"X:X Y:Y theta:\theta")
# we define two charts PU, identified with P^{-1}(U):
PU=R3.open_subset(name='PU',latex_name='P^{-1}(U)')
cart_U.<XU,YU,thetaU> = PU.chart(r"XU:X_U YU:Y_U thetaU:\theta_U")
cart_U.add_restrictions(sin(thetaU)!=0)
cart_U_to_cart=cart_U.transition_map(cart,(XU,YU,thetaU))
# and PV, identified with P^{-1}(V):
PV=R3.open_subset(name='PV',latex_name='P^{-1}(V)')
cart_V.<XV,YV,thetaV> = PV.chart(r"XV:X_V YV:Y_V thetaV:\theta_V")
cart_V.add_restrictions(cos(thetaV)!=0)
cart_V_to_cart=cart_U.transition_map(cart,(XV,YV,thetaV))
cart_V_to_cartU=cart_U.transition_map(cart,(XV,YV,thetaV),restrictions1=cos(thetaV)!=0)
In [12]:
Proj = R3.diff_map(M,{(cart_V,psiV):[tan(thetaV),YV-tan(thetaV)*XV,XV],
                      (cart_U,phiU):[cot(thetaU),XU-cot(thetaU)*YU,YU]},
                name='Proj',latex_name=r'P')
Proj.display()
Out[12]:

Let's plot $\psi\circ P$ to see what it looks like:

In [13]:
psiP_plot = cart_V.plot(chart=psiV,mapping=Proj,ranges={XV:(-5,5),YV:(-5,5),thetaV:(-1.6,1.6)})
show(psiP_plot, viewer=viewer3D)

Reasoning as above, if $\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\}$. If $l_\theta$ is at angle $\theta$ to the positive real axis, then $l_\theta$ must be given by an equation of the form $$x=\cot(\theta)y+d\quad\text{ if }\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\},$$ where $d$ is some real number. Solving this equation for $d$ yields $d=x-\cot(\theta)y$. If $\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\},$ then this line is non-vertical, so $$\phi\circ P(x,y,\theta)=(c_l=\cot(\theta),\quad d_l=c-\cot(\theta)y,\quad y_l=y),\quad\text{ for }\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\}$$

To show that $P:\mathbb{R}^3\to M$ is smooth, we must show that each of these maps $\psi\circ P$ and $\phi\circ P$ are smooth. But $\tan(\theta)$ is a smooth function of $\theta$ whenever $\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\}$; hence $$\psi\circ P(x,y,\theta)=(a_l=\tan(\theta),\quad b_l=y-\tan(\theta)x,\quad x_l=x),\quad\text{ for }\theta\not\in\{\dots,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},\dots\}$$ is smooth. Similarly, $\cot(\theta)$ is a smooth function of $\theta$ whenever $\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\}$, so $$\phi\circ P(x,y,\theta)=(c_l=\cot(\theta),\quad d_l=c-\cot(\theta)y,\quad y_l=y),\quad\text{ for }\theta\not\in\{\dots,-2\pi,-\pi,0,\pi,2\pi,\dots\}$$ is smooth.

However $P:\mathbb{R}^3\to M$ is not injective: we have $\psi\circ P(x,y,0)=\psi\circ P(x,y,\pi)$, for example. So $P:\mathbb{R}^3\to M$ is not a diffeomorphism.

However, $P$ is closely related to a diffeomorphism: consider the manifold $\mathbb{R}^2\times \mathbb{R}P^1$ with charts $$O_i=\{(x,y,[z^0:z^1]\mid z_i\neq 0\},\quad\kappa_i:O_i\to \mathbb{R}^3$$ where $$\kappa_0(x,y,[z^0:z^1])=(x,y,z^1/z^0),\quad \kappa_1(x,y,[z^0:z^1])=(x,y,z^0/z^1),$$ and the transition map is $\kappa_i\circ \kappa_j^{-1}(x,y,z)=(x,y,1/z)$ (for $i\neq j$).

In [14]:
R2RP1 = Manifold(3,'R^3RP^1',latex_name=r'\mathbb{R}^2\times \mathbb{R}P^1',start_index=1)
O0 = R2RP1.open_subset(name='O0',latex_name=r'O_0')
O1 = R2RP1.open_subset(name='O1',latex_name=r'O_1')
k0.<X0,Y0,Z0> = O0.chart(r"X0:x_0 Y0:y_0 Z0:z0")
k1.<X1,Y1,Z1> = O1.chart(r"X1:x_1 Y1:y_1 Z1:z1")
k0_to_k1 = k0.transition_map(k1,[X0,Y0,1/Z0],restrictions1=Z0!=0)
k1_to_k0 = k1.transition_map(k0,[X1,Y1,1/Z1],restrictions1=Z1!=0)

We have a map $P':\mathbb{R}^2\times \mathbb{R}P^1\to M$ defined as follows: an element of $\mathbb{R}^2\times \mathbb{R}P^1$ consists of a point in the plane, together with an line through the origin; which gets sent to the parallel line which contains that point. It is defined on $O0$ by $$\psi\circ P'\circ\kappa_0^{-1}(x,y,z)=(a_l=z,\quad b_l=y-zx,\quad x_l=x)$$ and on $O1$ by $$\phi\circ P'\circ\kappa_0^{-1}(x,y,z)=(c_l=z,\quad d_l=x-zy,\quad y_l=y)$$

In [15]:
Projp = R2RP1.diffeomorphism(M,{(k0,psiV):[Z0,Y0-Z0*X0,X0],(k1,phiU):[Z1,X1-Z1*Y1,Y1]},name='Projp',latex_name=r"P'")
Projp.display()
Out[15]:

Let's plot $\psi\circ P'\circ \kappa_0^{-1}$ to see what it looks like.

In [16]:
psiPpkinv_plot = k0.plot(chart=psiV,mapping=Projp)
show(psiPpkinv_plot, viewer=viewer3D)

It's easy to check that $P'$ is a diffeomorphism, but let's use Sage to compute it's inverse:

In [17]:
(Projp^(-1)).display()
Out[17]:

And of course we have a smooth map $Q:\mathbb{R}^3\to \mathbb{R}^2\times \mathbb{R}P^1$ defined by $$Q(x,y,\theta)=(x,y,[\cos(\theta):\sin(\theta)]),$$ so that $P=P'\circ Q$.

In [18]:
Q = R3.diff_map(R2RP1,{(cart_V,k0):[XV,YV,tan(thetaV)],(cart_U,k1):[XU,YU,cot(thetaU)]})
Q.display()
Out[18]:
In [ ]: