Solution (source code)

= Solution

Let $d=[L:K]$, with normalized <discrete valuations> $v_K,v_L$. Suppose first that $L/K$ is <totally ramified>, so $e(L/K)=d$. Choose a <uniformizer> $x$ of $L$. The elements $1,x,\ldots,x^{d-1}$ are linearly independent over $K$: the nonzero terms $c_jx^j$ in any proposed relation have <valuations> $d\,v_K(c_j)+j$, distinct modulo $d$, and a sum with a unique least valuation cannot vanish by the <ultrametric inequality>. Hence $[K(x):K]\geq d$, proving $L=K(x)$.

Extend $v_K$ to an <algebraic closure> with values in $\mathbb Q$. Every conjugate of $x$ has valuation $1/d$, by uniqueness of the extended <valuation> on finite extensions of the complete field $K$. In its monic <minimal polynomial of an algebraic element> $g(T)=T^d+a_{d-1}T^{d-1}+\cdots+a_0$, the coefficient $a_{d-j}$ is a sum of products of $j$ conjugates, counted with multiplicity. Thus $v_K(a_{d-j})\geq j/d>0$ for $j\geq1$, so every nonleading coefficient is in $\mathfrak m_K$. The constant coefficient is the product of all $d$ conjugates, so has valuation exactly one. This proves that $g$ is an <Eisenstein polynomial>. This argument also works for inseparable finite extensions, since the conjugates can be counted with their multiplicities.

Conversely let $g$ be an <Eisenstein polynomial> of degree $d$, with root $x$ and $L=K(x)$. The <Eisenstein criterion> proves irreducibility. For completeness, monic factors would have integral coefficients; their reductions would be positive-degree powers of $T$, so both constant coefficients would be divisible by the <uniformizer> of $K$, contradicting $v_K(g(0))=1$. To determine the root valuation, put $t=v_K(x)$ in the extended valuation. If $t<0$, the leading term is the unique term of least valuation; if $t=0$, the leading term again has uniquely least valuation zero. Both are impossible. If $t>0$, every nonconstant lower term has valuation at least $1+jt>1$. Cancellation in $g(x)=0$ therefore requires the leading term and constant term to have equal valuation:
$$
dt=1.
$$
Since $t=v_L(x)/e(L/K)$ and $v_L(x)$ is a positive integer, $e(L/K)=d\,v_L(x)\geq d$. The opposite inequality follows from $[L:K]=e(L/K)f(L/K)=d$. Hence $e=d$, $f=1$, and $v_L(x)=1$. We have proved both the equivalence and the uniformizer assertion:
$$
\boxed{L/K\text{ is totally ramified}\iff L=K(x)\text{ with }g_x\text{ Eisenstein};\quad v_L(x)=1.}
$$

Now take $q=p^a$ with $a\geq1$ and $\zeta=\zeta_{p^a}$. The translated <cyclotomic polynomial> is
$$
\Phi_{p^a}(1+T)=\sum_{j=0}^{p-1}(1+T)^{jp^{a-1}}.
$$
In characteristic $p$, putting $U=T^{p^{a-1}}$ reduces this to $\sum_{j=0}^{p-1}(1+U)^j=U^{p-1}=T^{p^{a-1}(p-1)}$. Its constant coefficient over the integers is $p$. It is therefore Eisenstein at $p$, of degree $d=p^{a-1}(p-1)$. Consequently \b[$\mathbb Q_p(\zeta_{p^a})/\mathbb Q_p$ is totally ramified of degree $d$, with uniformizer $\zeta_{p^a}-1$.] If $q=1$, the field is simply $\mathbb Q_p$, a trivial totally ramified extension.

For a general positive integer $n=p^a m$ with $p\nmid m$, the field generated by the prime-to-$p$ <root of unity> $\zeta_m$ is unramified. Indeed $T^m-1$ has distinct roots modulo $p$. In a finite unramified field whose <residue field> contains those roots, <Hensel lemma> lifts all of them uniquely. Reduction preserves their orders: a prime-to-$p$ root reducing to one must itself be one, by Hensel uniqueness at the root one of $T^m-1$. The <arithmetic Frobenius> therefore acts as $\zeta_m\mapsto\zeta_m^p$, and the extension degree is the multiplicative order of $p$ modulo $m$, with degree one when $m=1$.

The identity
$$
\mathbb Q_p(\zeta_n)=\mathbb Q_p(\zeta_{p^a},\zeta_m)
$$
follows by taking powers of a primitive nth <root of unity> and using the coprimality of $p^a,m$ in the opposite direction. The prime-to-$p$ field is <unramified> and the $p$-power field is <totally ramified>; <unramified base change preserves total ramification> proves that their compositum has the same <residue degree> as the prime-to-$p$ field. Thus the <total ramification criterion for local cyclotomic extensions> gives the full classification:
$$
\boxed{\mathbb Q_p(\zeta_n)/\mathbb Q_p\text{ is totally ramified}\iff n=p^a m,\quad a\geq0,\quad m\mid p-1.}
$$
This includes trivial extensions when $a=0$. For $p=2$ only $m=1$ is possible.

For a finite totally ramified <Galois extension> $L/K$ with <Galois group> $G$, define its <lower ramification numbering> by
$$
G_{-1}=G,\qquad G_i=\{\sigma\in G:v_L(\sigma(b)-b)\geq i+1\text{ for every }b\in\mathcal O_L\}\quad(i\geq0).
$$
Here $G_0$ is the <inertia group>, which equals $G$, and $G_1$ is the <wild inertia group>. For a <uniformizer> $\pi$ the condition is equivalent to $v_L(\sigma(\pi)-\pi)\geq i+1$. To justify this <uniformizer criterion for lower ramification groups>, expand every $b\in\mathcal O_L$ as a convergent series $\sum_{j\geq0}c_j\pi^j$ with the coefficients $c_j$ chosen from representatives of $k_K$ in $\mathcal O_K$. Such an expansion is obtained by successive subtraction of a residue representative and division by $\pi$, since total ramification gives $k_L=k_K$. The automorphism fixes each $c_j$, and $\sigma(\pi)^j-\pi^j$ is divisible by $\sigma(\pi)-\pi$. Thus the required valuation bound for $\pi$ implies it for every $b$, including the limit by <completeness>.

For $L=\mathbb Q_p(\zeta_{p^a})$, all primitive conjugates lie in $L$ and the Eisenstein degree is $\varphi(p^a)$. Hence
$$
G\simeq(\mathbb Z/p^a\mathbb Z)^\times,\qquad \sigma_b(\zeta)=\zeta^b.
$$
If $\sigma_b\ne1$, put $s=v_p(b-1)$, so $0\leq s<a$. The element $\zeta^{b-1}$ is a primitive $p^{a-s}$th <root of unity>. Applying the already proved uniformizer result to its field, and multiplying its valuation by the <ramification index> of $L$ over that field, gives
$$
v_L\bigl(\sigma_b(\zeta-1)-(\zeta-1)\bigr)=v_L(\zeta^{b-1}-1)
=\frac{\varphi(p^a)}{\varphi(p^{a-s})}=p^s.
$$
The identity automorphism has infinite valuation. Therefore the <lower ramification filtration of a prime-power cyclotomic extension> is explicitly
$$
\boxed{\begin{aligned}
G_{-1}=G_0&=(\mathbb Z/p^a\mathbb Z)^\times,\\
G_i&=\{b:b\equiv1\pmod{p^j}\},&&p^{j-1}\leq i\leq p^j-1,\quad1\leq j<a,\\
G_i&=\{1\},&&i\geq p^{a-1}.
\end{aligned}}
$$
The order of the middle group is $p^{a-j}$. At odd $p$, $G_0/G_1$ has order $p-1$; at $p=2$, the condition $b\equiv1\pmod2$ is automatic, so $G_0=G_1$ when $a\geq2$. The case $p=2,a=1$ has trivial <Galois group>, and the displayed formula remains valid. For $a=0$ all groups are trivial. The valuation calculation also provides the <upper ramification numbering>, if desired, by integrating the reciprocal indices with the <Herbrand function>; no change of numbering is implicit in the displayed answer.