[proofplan]
The proof reduces to a tail-of-a-convergent-series argument. By definition, $f \in H^s(\mathbb{T}^n)$ means the weighted square-sum $\sum_k (1+|k|^2)^s |\hat{f}(k)|^2$ converges. The squared $H^s$-distance from $f$ to its partial sum $S_N f$ is exactly the tail of this convergent sum over indices $|k|_\infty > N$, which therefore tends to zero. Since each $S_N f$ is a trigonometric polynomial in $\mathcal{T}(\mathbb{T}^n)$, this proves both that $\mathcal{T}(\mathbb{T}^n) \subseteq H^s(\mathbb{T}^n)$ is dense and the explicit convergence statement for partial Fourier sums.
[/proofplan]
[step:Identify $S_N f$ as an element of $H^s(\mathbb{T}^n)$ and compute its Fourier coefficients]
For $N \in \mathbb{N}$, the partial Fourier sum
\begin{align*}
S_N: H^s(\mathbb{T}^n) &\to \mathcal{T}(\mathbb{T}^n) \subset H^s(\mathbb{T}^n) \\
f &\mapsto \sum_{|k|_\infty \le N} \hat{f}(k)\, e^{i k \cdot x}
\end{align*}
is a finite linear combination of trigonometric monomials, where $|k|_\infty := \max_{1 \le i \le n} |k_i|$ for $k = (k_1, \dots, k_n) \in \mathbb{Z}^n$, and $\mathcal{T}(\mathbb{T}^n)$ denotes the space of finite linear combinations $\sum_{|k|_\infty \le M} c_k\, e^{i k \cdot x}$ with $c_k \in \mathbb{C}$. Throughout the proof we also use the Euclidean norm $|k| := (k_1^2 + \cdots + k_n^2)^{1/2}$ on $\mathbb{Z}^n$, which appears in the weight $(1+|k|^2)^s$ defining the $H^s$-norm. Each trigonometric monomial $e^{i k \cdot x}$ is smooth on $\mathbb{T}^n$, hence lies in $H^s(\mathbb{T}^n)$ for every $s \in \mathbb{R}$. Finite linear combinations of $H^s$-elements remain in $H^s$, so $S_N f \in \mathcal{T}(\mathbb{T}^n) \subseteq H^s(\mathbb{T}^n)$.
The Fourier coefficients of $S_N f$ are
\begin{align*}
\hat{S_N f}(k) = \begin{cases} \hat{f}(k) & |k|_\infty \le N, \\ 0 & |k|_\infty > N. \end{cases}
\end{align*}
This follows because $e^{i j \cdot x}$ has Fourier coefficient $\delta_{j, k}$ at index $k$ (Kronecker delta), so the linearity of the Fourier coefficient map gives the indicated coefficients.
[/step]
[step:Compute the squared $H^s$-distance as the tail of the defining series]
By Step 1, the difference $f - S_N f$ has Fourier coefficients
\begin{align*}
\hat{(f - S_N f)}(k) = \begin{cases} 0 & |k|_\infty \le N, \\ \hat{f}(k) & |k|_\infty > N. \end{cases}
\end{align*}
Therefore, by the definition of the $H^s$-norm in terms of weighted Fourier coefficients,
\begin{align*}
\|f - S_N f\|_{H^s(\mathbb{T}^n)}^2 &= \sum_{k \in \mathbb{Z}^n} (1 + |k|^2)^s\, |\hat{(f - S_N f)}(k)|^2 \\
&= \sum_{|k|_\infty > N} (1 + |k|^2)^s\, |\hat{f}(k)|^2.
\end{align*}
[/step]
[step:Show the tail tends to zero]
Define the increasing sequence of finite truncations
\begin{align*}
T_N := \sum_{|k|_\infty \le N} (1 + |k|^2)^s\, |\hat{f}(k)|^2, \qquad N \in \mathbb{N},
\end{align*}
and the limit
\begin{align*}
T := \sum_{k \in \mathbb{Z}^n} (1 + |k|^2)^s\, |\hat{f}(k)|^2 = \|f\|_{H^s(\mathbb{T}^n)}^2.
\end{align*}
Since $f \in H^s(\mathbb{T}^n)$, we have $T < \infty$. Observe that $T_N \le T_{N+1} \le T$ for all $N$, and the sets $\{k : |k|_\infty \le N\}$ exhaust $\mathbb{Z}^n$ as $N \to \infty$:
\begin{align*}
\bigcup_{N=1}^\infty \{k \in \mathbb{Z}^n : |k|_\infty \le N\} = \mathbb{Z}^n.
\end{align*}
By the monotone convergence theorem for series with non-negative terms (equivalently, the monotone convergence theorem applied to counting measure on $\mathbb{Z}^n$), $T_N \to T$ as $N \to \infty$.
Hence
\begin{align*}
\|f - S_N f\|_{H^s(\mathbb{T}^n)}^2 = T - T_N \to 0 \qquad \text{as } N \to \infty.
\end{align*}
Taking square roots, $\|f - S_N f\|_{H^s(\mathbb{T}^n)} \to 0$.
[guided]
The argument is the universal "tail-of-convergent-series" trick: a non-negative series with a finite total has vanishing tails along any exhausting sequence of finite subsets. We make this rigorous via the monotone convergence theorem.
Set $a_k := (1 + |k|^2)^s\, |\hat{f}(k)|^2$ for $k \in \mathbb{Z}^n$. Since $(1 + |k|^2)^s > 0$ and $|\hat{f}(k)|^2 \ge 0$, we have $a_k \ge 0$ for every $k$. By the hypothesis $f \in H^s(\mathbb{T}^n)$,
\begin{align*}
T := \sum_{k \in \mathbb{Z}^n} a_k = \|f\|_{H^s(\mathbb{T}^n)}^2 < \infty.
\end{align*}
This unrestricted sum over $\mathbb{Z}^n$ is well-defined as the supremum of the partial sums $\sum_{k \in F} a_k$ over finite subsets $F \subset \mathbb{Z}^n$, since the summands are non-negative and the order of summation is irrelevant for non-negative series.
We choose the exhausting sequence $E_N := \{k \in \mathbb{Z}^n : |k|_\infty \le N\}$ for $N \in \mathbb{N}$. Three properties hold: (i) each $E_N$ is finite, with cardinality $(2N+1)^n$; (ii) they are nested, $E_N \subseteq E_{N+1}$, since $|k|_\infty \le N$ implies $|k|_\infty \le N+1$; (iii) they exhaust $\mathbb{Z}^n$, because for any $k \in \mathbb{Z}^n$ the integer $|k|_\infty$ is finite, so $k \in E_N$ for all $N \ge |k|_\infty$. The partial sums
\begin{align*}
T_N := \sum_{k \in E_N} a_k
\end{align*}
are therefore well-defined finite sums, and the nesting $E_N \subseteq E_{N+1}$ combined with $a_k \ge 0$ gives $T_N \le T_{N+1}$. Each $T_N$ is bounded above by $T$ since $E_N \subseteq \mathbb{Z}^n$ and $a_k \ge 0$.
We now apply the monotone convergence theorem in the form most natural here: integration against counting measure $\#$ on $\mathbb{Z}^n$. Define the simple non-negative functions
\begin{align*}
g_N: \mathbb{Z}^n &\to [0, \infty) \\
k &\mapsto a_k\, \mathbb{1}_{E_N}(k),
\end{align*}
and the pointwise limit $g(k) := a_k$. By construction $0 \le g_N(k) \le g_{N+1}(k)$ for every $k$ (because $\mathbb{1}_{E_N} \le \mathbb{1}_{E_{N+1}}$), and $g_N(k) \uparrow g(k)$ pointwise as $N \to \infty$ (since each $k$ eventually belongs to all $E_N$ with $N \ge |k|_\infty$). The hypotheses of the monotone convergence theorem are satisfied: the functions $g_N$ are measurable (every function on the discrete space $\mathbb{Z}^n$ is measurable with respect to the power-set $\sigma$-algebra), non-negative, and monotone increasing to $g$. The conclusion of MCT is
\begin{align*}
\lim_{N \to \infty} \int_{\mathbb{Z}^n} g_N\, d\# = \int_{\mathbb{Z}^n} g\, d\#.
\end{align*}
Translating integrals against counting measure into series, $\int_{\mathbb{Z}^n} g_N\, d\# = \sum_{k \in \mathbb{Z}^n} g_N(k) = T_N$ and $\int_{\mathbb{Z}^n} g\, d\# = T$, so $T_N \to T$.
Equivalently, one can invoke the rearrangement theorem for non-negative series: for $a_k \ge 0$, the unrestricted sum $\sum_{k \in \mathbb{Z}^n} a_k$ equals the limit of partial sums over any exhausting sequence of finite subsets of $\mathbb{Z}^n$. Both formulations require only non-negativity of the summands and exhaustion of the index set — exactly the conditions we verified.
The squared distance $\|f - S_N f\|_{H^s}^2$ is exactly the tail $T - T_N$ because the Fourier coefficients of $f - S_N f$ vanish on $E_N$ and equal $\hat{f}(k)$ off $E_N$; the weighted square-sum therefore picks up exactly the complementary indices $\{|k|_\infty > N\}$. From $T_N \to T$ we conclude $T - T_N \to 0$, hence
\begin{align*}
\|f - S_N f\|_{H^s(\mathbb{T}^n)}^2 = T - T_N \to 0,
\end{align*}
and taking square roots, $\|f - S_N f\|_{H^s(\mathbb{T}^n)} \to 0$.
Why does this argument work uniformly in $s \in \mathbb{R}$? Because the only thing that matters is that the full weighted sum is finite (membership in $H^s$). The sign or magnitude of $s$ affects the relative weighting of high vs low frequencies, but does not affect the existence of the limit of monotone partial sums of non-negative terms.
[/guided]
[/step]
[step:Conclude density of $\mathcal{T}(\mathbb{T}^n)$ in $H^s(\mathbb{T}^n)$]
Let $f \in H^s(\mathbb{T}^n)$ and $\varepsilon > 0$. By Step 3, there exists $N \in \mathbb{N}$ such that $\|f - S_N f\|_{H^s(\mathbb{T}^n)} < \varepsilon$. Since $S_N f \in \mathcal{T}(\mathbb{T}^n)$ by Step 1, we have produced an element of $\mathcal{T}(\mathbb{T}^n)$ within $\varepsilon$ of $f$. Therefore $\mathcal{T}(\mathbb{T}^n)$ is dense in $H^s(\mathbb{T}^n)$, and the partial Fourier sums $(S_N f)_{N \in \mathbb{N}}$ furnish an explicit sequence of trigonometric polynomials with $\|S_N f - f\|_{H^s(\mathbb{T}^n)} \to 0$.
[/step]