Are there interesting examples of linear binary codes that are closed under the operation of removing the first bit of the codeword and appending the complement of that bit to the end of the codeword?



Codes with a twisted cyclic action
*This is an extended comment that may be too long for the comment section.*


If I understand your question correctly, the linear codes you described are automatically trivial.


Define $\pi\_{c}$ to be the map that takes any $n$-dimensional vector $\boldsymbol{v} = (v\_0, v\_1, \dots, v\_{n-1}) \in \mathbb{F}\_2^n$ over the finite field $\mathbb{F}\_2$ of order $2$ to its complement shift $\pi\_c(\boldsymbol{v}) = (v\_{n-1} + 1, v\_0, v\_1, \dots, v\_{n-2})$. If I understand your question right, the codes you are thinking of are those that are closed under $\pi\_c$ (or the equivalent thing under the shift in the opposite direction).


To see why they are all trivial, let $\mathcal{B} \subseteq \mathbb{F}\_2^n$ be a binary linear code of length $n$ closed under $\pi\_c$. Because $\mathcal{B}$ is a linear space, it contains the zero vector $\boldsymbol{0} = (0,\dots,0)$, which implies that $\pi\_c(\boldsymbol{0}) = (1,0,0,\dots,0) \in \mathcal{B}$. Similarly, because $\mathcal{B}$ is a linear space closed under $\pi\_c$, we have \begin{align\*}\pi\_c(\pi\_c(\boldsymbol{0})) + \pi\_c(\boldsymbol{0}) &= (1,1,0,\dots,0)
 + (1,0,0,\dots,0)\\
&= (0,1,0,0,\dots,0)\\
&\in \mathcal{B}.\end{align\*}
By the same token, applying $\pi\_c$ and taking the sum with $\pi\_c(\boldsymbol{0})$ recursively shows that $\mathcal{B}$ contains all binary vectors of weight $1$, which form the basis of $\mathbb{F}\_2^n$.


I am not sure if this is of any help, but there are nontirival, nonbinary codes that are closed under a map that is very similar to what you described. Let $n$ be a positive integer and $\lambda$ a nonzero element of the finite field $\mathbb{F}\_q$ of order $q$. A linear code $\mathcal{C} \in \mathbb{F}\_q^n$ of length $n$ over $\mathbb{F}\_q$ is $\lambda$-*constacyclic* if for any codeword $\boldsymbol{c} = (c\_0, c\_1, \dots, c\_{n-1}) \in \mathcal{C}$, its $\lambda$-cyclic shift $(\lambda c\_{n-1}, c\_0, c\_1, \dots, c\_{n-2})$ is also a codeword. When $\lambda = -1$, the codes are called *negacyclic*. Just like the standard cyclic codes, it is known that the constacyclic codes can be identified by certain ideals of polynomial rings. There are many papers on constacyclic codes and the like (e.g., <https://arxiv.org/pdf/1301.0369.pdf>), so if this kind of code is of interest to you, looking up constacyclic or negacyclic codes in the literature may help.


