= Solution
A <cyclic code> of length $n$ over $\mathbb F_q$ is a <linear code> invariant under $(c_0,\ldots,c_{n-1})\mapsto(c_{n-1},c_0,\ldots,c_{n-2})$. Associate the word with $c(T)=\sum_{i=0}^{n-1}c_iT^i$. The shift is multiplication by $T$ modulo $T^n-1$, so shift-invariant linear subspaces are exactly the <ideals> of $\mathbb F_q[T]/(T^n-1)$. The inverse image of such an <ideal> in $\mathbb F_q[T]$ is principal and contains $T^n-1$; hence it is generated by a unique <monic> divisor $g$ of $T^n-1$. The code has <basis> $g,Tg,\ldots,T^{n-\deg g-1}g$, and <dimension> $n-\deg g$.
The <defining zeros of a cyclic code> are the roots of its generator $g$ in a <splitting field>. Since $g\mid T^n-1$, each is a <root of unity over a finite field>. Every <codeword> vanishes at each such root. If the characteristic divides $n$, root multiplicities must additionally be retained; in the Hamming construction below the modulus has no repeated roots.
\b[The unrestricted ternary cyclic-equivalence assertion is false.] At $s=2$ it would give a cyclic $[4,2,3]_3$ code. But
$$
T^4-1=(T-1)(T+1)(T^2+1)
$$
over $\mathbb F_3$, with the quadratic irreducible. A dimension-two <cyclic code> needs a degree-two generator, so its only possibilities are $T^2-1$ and $T^2+1$. Each is a weight-two <codeword>. Therefore neither has minimum distance three, and no code equivalent to the ternary $[4,2,3]$ Hamming code can be cyclic. A valid general version of the asserted construction assumes \b[odd $s$]. The usual distance-three Hamming parameters also require $s\geq2$; when $s=1$ the code is the length-one zero code.
Here is the construction with its precise qualification. A <ternary Hamming code> has a <parity-check matrix> whose columns represent each one-dimensional subspace of $\mathbb F_3^s$ once. There are $n=(3^s-1)/2$ such subspaces. Its <rank> is $s$, because the coordinate lines are included. Its minimum distance is at least three, because no column is zero and no two are proportional. For $s\geq2$, two independent vectors and their sum determine three distinct columns, and, after adjusting their nonzero representative scalars, give a weight-three linear relation. Thus its parameters are $[n,n-s,3]_3$. Permuting columns and changing their nonzero representatives produces a <monomial equivalence of linear codes>.
Take odd $s\geq3$ and choose $\alpha\in\mathbb F_{3^s}^{\times}$ of order $n$. Since $n$ is odd, $-1$ is not in the cyclic subgroup generated by $\alpha$. Hence $1,\alpha,\ldots,\alpha^{n-1}$ lie in distinct one-dimensional $\mathbb F_3$-subspaces: a proportional pair would have ratio $1$ or $-1$, neither possible for two distinct powers in this list. By their number they represent all <projective points>. Consequently
$$
C=\{c\in\mathbb F_3^n:\sum_{i=0}^{n-1}c_i\alpha^i=0\}
$$
is monomially equivalent to the <ternary Hamming code>. Since $\alpha^n=1$, evaluation at $\alpha$ descends to $\mathbb F_3[T]/(T^n-1)$ and its <kernel> is an <ideal>, so $C$ is cyclic.
The degree of $\alpha$ over $\mathbb F_3$ is $s$. If it were $d<s$, its generated <field> would have $3^d$ elements and its element order would give
$$
n\leq3^d-1\leq3^{s-1}-1<\frac{3^s-1}{2}=n,
$$
a contradiction. Its <minimal polynomial of an algebraic element> therefore has degree $s$. Applying Frobenius to a <polynomial> relation shows that $\alpha,\alpha^3,\ldots,\alpha^{3^{s-1}}$ are its roots; they are distinct by the same field-degree argument. Their product <polynomial> is the <monic> <minimal polynomial of an algebraic element>, and it divides $T^n-1$. Thus
$$
\boxed{g(T)=\prod_{j=0}^{s-1}(T-\alpha^{3^j}),\qquad Z(C)=\{\alpha^{3^j}:0\leq j<s\}.}
$$
This identifies all the defining zeros. For $s=3$, $n=13$, the defining exponents are $1,3,9$ modulo $13$.
There is also a uniform construction for all $s\geq2$, explaining the missing qualification. Let $\beta$ generate $\mathbb F_{3^s}^{\times}$, which has order $2n$. The powers $1,\beta,\ldots,\beta^{n-1}$ represent all <projective points>, since proportional powers differ by exponent $0$ or $n$ modulo $2n$. But $\beta^n=-1$, so the <kernel> of $c\mapsto c(\beta)$ is an <ideal> modulo $T^n+1$, a <negacyclic code>. Multiplication by $T$ gives $(-c_{n-1},c_0,\ldots,c_{n-2})$, preserving its <kernel>. This code is always equivalent to the <ternary Hamming code>. If $s$ is odd, $n$ is odd too, and the substitution $T\mapsto-T$, or coordinate scaling $c_i\mapsto(-1)^ic_i$, changes this negacyclic construction into the cyclic one. In fact $\alpha=-\beta$ then has order $n$. These explicit constructions prove the qualified assertion rather than relying on a theorem name.
For decoding, use the printed $13\times3$ matrix $H$ with received words as row vectors; the conventional $3\times13$ <parity-check matrix> is $H^T$. The received word's <syndrome> is
$$
s=rH=(2,0,2)\quad\text{in }\mathbb F_3^3.
$$
A single-symbol error of value $a$ at position $i$ has <syndrome> $a h_i$, where $h_i$ is row $i$ of the printed matrix. Here
$$
(2,0,2)=2(1,0,1)=2h_6.
$$
Therefore subtract $2$ at the sixth coordinate, changing its received value $1$ to $2$ modulo three. The decoded <codeword> is
$$
\boxed{(2,1,2,0,1,2,0,0,2,1,1,2,0).}
$$
Its <syndrome> is zero. The thirteen projective rows and the two nonzero scalars give all $26$ nonzero <syndromes> exactly once, so this is the unique <codeword> at distance one. It is the transmitted word under the usual assumption of at most one symbol error. If positions $1,2,5$ are designated check positions, their independent unit rows make the other ten symbols systematic data, namely $(2,0,2,0,0,2,1,1,2,0)$.
Back to article page