Dynamics on the torus It is well known that a $2-$torus foliated with lines of irrational slopes will produce dense curves on the torus. Likewise, rational slopes will lead to a periodic orbit. However, I am not seeing the connection between these two statements (which I think are equivalent, or at least lead to equivalent results):

*

*A rational slope gives rise to periodic orbits.


*For a rational slope, the leaves of the torus are diffeomorphic to $S^1.$
Can someone help me see the connection between these two statements?
 A: A rational slope of the orbit on the torus guarantees the orbit intersect and connect with itself, eventually.  Thus the orbit must be diffeomorphic to $S^1$.

Unwrap the blue orbit.  See how it is diffeomorphic to $S^1$?
A: Here is a more rigorous argument (with gaps to fill in, depending on one's disposition). Denote by $\mathbb{T}^d=\mathbb{R}^d/\mathbb{Z}^d$ the (standard) $d$-torus and by $\operatorname{Aff}(\mathbb{T}^d)$ the group of affine automorphisms of it; after Endomorphisms of the Torus and Example of a continuous affine group action we have that $\operatorname{Aff}(\mathbb{T}^d)\cong \mathbb{T}^d\rtimes \operatorname{GL}(d,\mathbb{Z})$; that is, any affine automorphism of $\mathbb{T}^d$ is of the form $p\mapsto Ap+b$, where $A$ is an invertible $d\times d$ matrix with integer entries with determinant $\pm 1$ and $b$ is an element of $\mathbb{T}^d$; note that in particular any affine automorphism is a $C^\infty$ diffeomorphism.
For any $\xi\in\mathbb{R}^d\setminus0$ define a flow $\phi^\xi_\bullet:\mathbb{R}\to \operatorname{Aff}(\mathbb{T}^d)$ by
$$t\mapsto [p\mapsto p+t\xi],$$
where addition is interpreted as modulo $\mathbb{Z}^d$. It's straightforward that for any $\xi\in\mathbb{R}^d\setminus0$, $\phi^\xi$ is a locally free (= each stabilizer is discrete) $C^\infty$ action and its orbit foliation is precisely the $1$-dimensional foliation in the direction of $\xi$ (note that $\phi^\xi$ is the flow of the constant vector field $\mathbb{T}^d\to \mathbb{R}^d, p\mapsto \xi$; see e.g. Constant vector field on the torus $\mathbb{T}^{2n}$ is symplectic and Regarding diffeomorphism on manifolds).
In particular, when $d=2$ and $\xi=(1,\sigma)$ for $\sigma\in\mathbb{R}_{\geq0}$, the orbits of $\phi^{(1,\sigma)}$ are exactly the affine subgroups ("subheaps" or "subgrouds"; see https://ncatlab.org/nlab/show/heap)  (i.e. "lines") of slope $\sigma$. Let us look into stabilizers of $\phi^{(1,\sigma)}$. If $\phi^{(1,\sigma)}_t(p)=p$ for $t\neq0$, then $t(1,\sigma)\in\mathbb{Z}^2$, i.e. $t\in\mathbb{Z}\setminus0$ and $\sigma\in \frac{1}{t}\mathbb{Z}\leq \mathbb{Q}$. Thus all stabilizers are trivial for irrational $\sigma$ and all stabilizers are isomorphic to $\mathbb{Z}$ for rational $\sigma$ (in this case if $\sigma=\frac{p}{q}$ is in reduced form each point will be $q$-periodic). In either case we have that the orbit maps $\phi^{(1,\sigma)}_\bullet(p):\mathbb{R}\to \mathcal{O}_p, t\mapsto p+t(1,\sigma)$ factor through $\mathbb{R}/\mathcal{S}_p$ and give $C^\infty$ injective immersions $\mathbb{R}/\mathcal{S}_p\hookrightarrow \mathbb{T}^2$ with images $\mathcal{O}_p$ (here $\mathcal{S}_p\leq\mathbb{R}$ is the stabilizer subgroup of $p$ and $\mathcal{O}_p\subseteq \mathbb{T}^2$ is the orbit of $p$). Thus the foliation consists of $C^\infty$ injectively immersed lines in the irrational $\sigma$ case (some further (standard) argument is needed here to verify that each such line is dense) and $C^\infty$ embedded circles in the rational $\sigma$ case.
In general for $\mathbb{T}^d$ an analogous argument can be produced. Again there is a dichotomy from the differential geometric point of view (either all leaves will be injectively immersed lines xor all leaves will be embedded circles); though from the dynamical point of view instead of a dichotomy there will be a $d$-chotomy. Concisely, define $\mathcal{R}(\xi)=\{z\in\mathbb{Z}^d\,|\, z\cdot \xi = 0\}$ to be the resonance set of $\xi$, where $z\cdot\xi=\sum_{i=1}^dz_i\xi_i$, and put $r(\xi)=\dim_{\mathbb{Z}}(\operatorname{span}_{\mathbb{Z}}(\mathcal{R}(\xi)))$ (one could use $\mathbb{Q}$ instead of $\mathbb{Z}$); so that $r(\xi)$ is the number of solutions $z$ of $z\cdot\xi=0$ linearly independent over integers (or rationals), and in particular $r(\xi)=0$ iff the entries of $\xi$ are linearly independent elements of $\mathbb{R}$ considered as a (n infinite dimensional) $\mathbb{Q}$-vector space (see e.g. What does "Consider R as an vector space over Q" mean?). Then each orbit of $\phi^\xi$ will be dense in an embedded $\mathbb{T}^{d-r(\xi)}\leq \mathbb{T}^d$ (and vice versa); in particular for $r(\xi)=d-1$, each orbit will be periodic. (For $d=3$ nice examples to think about and draw are: $\xi^1=(1,1,1),\xi^2=(1,1,\sqrt{2}),\xi^3=(1,\sqrt{2},\sqrt{8}),\xi^4=(1,\sqrt{2},\sqrt{3})$; observe that the leaf passing through the origin would give a good idea due to homogeneity.)
