<figure><img src="image_1.png" /></figure>

HAL
open science

# Codes over the Dickson Near-Field of Order Nine

Altaf Alshuhail, Maryam Fahd A Alshammari, Patrick Solé

► To cite this version:

Altaf Alshuhail, Maryam Fahd A Alshammari, Patrick Solé. Codes over the Dickson Near-Field of Order Nine. Mathematics, 2026, 14 (2), pp.228. 10.3390/math14020228. hal-05447628

HAL Id: hal-05447628

https://hal.science/hal-05447628v1

Submitted on 8 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
Article

# Codes over the Dickson Near-Field of Order Nine

Altaf Alshuhail <fnref n="1" />*, Maryam Fahd A. Alshammari <fnref n="1" /> and Patrick Solé <fnref n="2" />

## Abstract

A near-field is an algebraic structure akin to a division ring where distributivity is relaxed on one side. The smallest such object is the Dickson near-field of order nine. We lay the foundations of linear codes over that near-field. This includes a systematic form for their generator matrices based on a one-sided Gauss pivot algorithm. Dual codes are defined and a formula is given for the parity check matrix. LCD codes are characterized by a direct sum property. Self-orthogonal codes are classified in short lengths.

**Keywords:** Dickson near-field; near-vector space; Gauss pivot; generator matrix; dual code; LCD codes

**MSC:** Primary 94B05; Secondary 16Y30; 94B60

## 1. Introduction

At the inception of Coding Theory in 1948, linear codes alphabets were finite fields [1]. In the 1990s, it was discovered that certain nonlinear binary codes had a natural module structure over the cyclic ring of order four [2] that could explain the formal duality of certain of them. This surprising discovery induced a paradigm shift, and codes over rings were considered more and more [3]. In the last few years, codes over non-unitary rings (i.e., rings without a multiplicative identity) have attracted increasing attention [4–8].

Another way of weakening the algebraic structure is to assume distributivity on one side only. This kind of structure is called a near-ring. When, in addition, there is a multiplicative inverse, it is called a nearfield. The smallest such object is the Dickson near-field of order nine, denoted here by NF(9) [9–11]. It was an important tool in the coordinatization of certain non-Desarguesian projective planes [12].

In the present paper, continuing the evolution in the structure of alphabets exposed in the previous paragraph, we introduce linear codes over NF(9). We study fundamental problems like a systematic form for the generator matrix based on a one-sided Gauss pivot algorithm. This canonical form leads to a generator matrix for the dual code. We define and study self-orthogonal codes over NF(9). We generalize the class of Linear Complementary Dual (LCD for short) introduced by Massey over finite fields [13]. We classify self-orthogonal codes in length at most eight, and dimension at most two.

The material is organized as follows. Section 2 collects background material on Dickson near fields. Section 3 lays down the theory of linear codes over that nearfield. Section 4 defines and studies duality notions like self-dual codes, and self-orthogonal codes. Section 5 focuses on LCD codes. Section 6 classifies self-orthogonal and self-dual codes in lengths at most eight, and dimension at most two, giving their weight enumerators,

<figure><img src="image_3.png" /></figure>

Check for updates

Academic Editor: Antanas Cenys

Received: 14 December 2025

Revised: 5 January 2026

Accepted: 6 January 2026

Published: 7 January 2026

**Copyright:** © 2026 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the [Creative Commons](https://creativecommons.org/licenses/by/4.0/) Attribution (CC BY) license.

<footnote n="1">¹ Department of Mathematics, College of Science, University of Ha'il, Ha'il 2440, Saudi Arabia; m.alsammry@uoh.edu.sa</footnote>

<footnote n="2">² Lab I2M (CNRS, Aix Marseille University), 13009 Marseilles, France; sole@enst.fr</footnote>

<footnote>* Correspondence: ad.alshuhail@uoh.edu.sa</footnote>
and their permutation groups. Finally, Section 7 collects conclusions and directions for further work.

## 2. Dickson Near-Field on $\mathbb{F}_9$

Let $\mathbb{F}_9 = \{a+b\gamma : a,b \in \mathbb{F}_3, \gamma^2 = 2\}$ with componentwise addition

$$(a+b\gamma) + (c+d\gamma) = (a+c) + (b+d)\gamma.$$

Let $\varphi : \mathbb{F}_9 \to \mathbb{F}_9$ be the Frobenius automorphism $\varphi(t) = t^3$. Fix the index-2 subgroup of the multiplicative group

$$H_0 = \langle \gamma \rangle = \{1,2,\gamma,2\gamma\} \subset \mathbb{F}_9^\times, \quad \sigma_y = \begin{cases} \text{id}, & y \in H_0, \\ \varphi, & y \notin H_0. \end{cases}$$

Following [9], define the Dickson (right) product on $\mathbb{F}_9$ by

$$x \circ y = \begin{cases} \sigma_y(x)y, & y \neq 0, \\ 0, & y = 0. \end{cases} \qquad (1)$$

We denote $\text{NF}(9) = (\mathbb{F}_9, +, \circ)$; see Table 1.

<table><caption>**Table 1.** Multiplication table for $\circ$ on $\mathbb{F}_9$.</caption><thead><tr><th>○</th><th>0</th><th>1</th><th>2</th><th>γ</th><th>1 + γ</th><th>2 + γ</th><th>2γ</th><th>1 + 2γ</th><th>2 + 2γ</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><th>1</th><td>0</td><td>1</td><td>2</td><td>γ</td><td>1 + γ</td><td>2 + γ</td><td>2γ</td><td>1 + 2γ</td><td>2 + 2γ</td></tr><tr><th>2</th><td>0</td><td>2</td><td>1</td><td>2γ</td><td>2 + 2γ</td><td>1 + 2γ</td><td>γ</td><td>2 + γ</td><td>1 + γ</td></tr><tr><th>γ</th><td>0</td><td>γ</td><td>2γ</td><td>2</td><td>1 + 2γ</td><td>1 + γ</td><td>1</td><td>2 + 2γ</td><td>2 + γ</td></tr><tr><th>1 + γ</th><td>0</td><td>1 + γ</td><td>2 + 2γ</td><td>2 + γ</td><td>2</td><td>2γ</td><td>1 + 2γ</td><td>γ</td><td>1</td></tr><tr><th>2 + γ</th><td>0</td><td>2 + γ</td><td>1 + 2γ</td><td>2 + 2γ</td><td>γ</td><td>2</td><td>1 + γ</td><td>1</td><td>2γ</td></tr><tr><th>2γ</th><td>0</td><td>2γ</td><td>γ</td><td>1</td><td>2 + γ</td><td>2 + 2γ</td><td>2</td><td>1 + γ</td><td>1 + 2γ</td></tr><tr><th>1 + 2γ</th><td>0</td><td>1 + 2γ</td><td>2 + γ</td><td>1 + γ</td><td>2γ</td><td>1</td><td>2 + 2γ</td><td>2</td><td>γ</td></tr><tr><th>2 + 2γ</th><td>0</td><td>2 + 2γ</td><td>1 + γ</td><td>1 + 2γ</td><td>1</td><td>γ</td><td>2 + γ</td><td>2γ</td><td>2</td></tr></tbody></table>

**Proposition 1 ([9]).** The Dickson product $\circ$ is associative on $\mathbb{F}_9$.

**Lemma 1.** For all $x,y,z \in \mathbb{F}_9$:

(a) $(x+z) \circ y = (x \circ y) + (z \circ y)$.

(b) $x \circ 1 = x$ and $1 \circ y = y$.

(c) If $y \neq 0$, then $y$ has a unique two-sided inverse for $\circ$, namely $u = \sigma_y(y^{-1})$, and it satisfies $u \circ y = 1$ and $y \circ u = 1$.

**Proof.** (a) If $y = 0$, both sides are 0 by definition. If $y \neq 0$, then

$$(x+z) \circ y = \sigma_y(x+z) y = (\sigma_y x + \sigma_y z) y = \sigma_y x y + \sigma_y z y = (x \circ y) + (z \circ y),$$

since $\sigma_y \in \{\text{id}, \varphi\}$ is $\mathbb{F}_3$-linear.

(b) Since $1 \in H_0$, we have $\sigma_1 = \text{id}$, hence $x \circ 1 = x \cdot 1 = x$. Also $1 \circ y = \sigma_y(1) y = 1 \cdot y = y$.

(c) Let $y \neq 0$ and set $u = \sigma_y(y^{-1})$, where $y^{-1}$ is the inverse of $y$ in the field $\mathbb{F}_9^\times$. Then

$$u \circ y = \sigma_y(u) y = \sigma_y(\sigma_y(y^{-1})) y = y^{-1}y = 1,$$

because $\sigma_y^2 = \text{id}$. If $v \circ y = 1$, then $\sigma_y(v) y = 1$, so $\sigma_y(v) = y^{-1}$ and hence $v = \sigma_y(y^{-1}) = u$ by bijectivity of $\sigma_y$. Thus the left inverse is unique.
To obtain a right inverse, consider the map $R_y : \mathrm{NF}(9) \to \mathrm{NF}(9)$ given by $R_y(x) = y \circ x$. If $y \circ x_1 = y \circ x_2$, then by associativity in Proposition 1 and $u \circ y = 1$ we get

$$x_1 = 1 \circ x_1 = (u \circ y) \circ x_1 = u \circ (y \circ x_1) = u \circ (y \circ x_2) = (u \circ y) \circ x_2 = 1 \circ x_2 = x_2.$$

Hence $R_y$ is injective. Since $\mathrm{NF}(9)$ is finite, $R_y$ is surjective, so there exists $w \in \mathrm{NF}(9)$ with $w \circ y = 1$.

Then

$$u = u \circ 1 = u \circ (y \circ w) = (u \circ y) \circ w = 1 \circ w = w,$$

so $y \circ u = 1$ as well. Uniqueness of the right inverse follows immediately: if $y \circ w = 1$ then $w = u$. □

Left distributivity need not hold in $\mathrm{NF}(9)$. For instance, with $x = \gamma$, $y = \gamma$, and $z = 1$ we have

$$x \circ (y + z) = \gamma \circ (1 + \gamma) = \sigma_{1+\gamma}(\gamma) (1 + \gamma) = 1 + 2\gamma \neq \gamma^2 + \gamma = 2 + \gamma = x \circ y + x \circ z.$$

Consequently $\mathrm{NF}(9)$ is a right near-field but not a field.

For $n \geq 1$ set $\mathcal{V} = \mathrm{NF}(9)^n$. Extend $\circ$ coordinatewise left and right:

$$(v_1, \dots, v_n) \circ a := (v_1 \circ a, \dots, v_n \circ a), \quad a \circ (v_1, \dots, v_n) := (a \circ v_1, \dots, a \circ v_n).$$

A subset $C \subseteq \mathcal{V}$ is a right near-subspace if $(C, +)$ is a subgroup of $(\mathcal{V}, +)$ and $v \circ a \in C$ for all $v \in C$, $a \in \mathrm{NF}(9)$. Unlike the coordinatewise right action $v \mapsto v \circ a$, the map $v \mapsto a \circ v$ is generally not additive; see the next example.

**Example 1.** Take $n = 1$. Let $a = \gamma$, $u = 1$, and $v = \gamma$ in $\mathbb{F}_9$. Then

$$a \circ (u + v) = \gamma \circ (1 + \gamma) = \sigma_{1+\gamma}(\gamma) (1 + \gamma) = \varphi(\gamma) (1 + \gamma) = (2\gamma)(1 + \gamma) = 1 + 2\gamma.$$

However,

$$a \circ u + a \circ v = (\gamma \circ 1) + (\gamma \circ \gamma) = \gamma + \gamma^2 = \gamma + 2 = 2 + \gamma.$$

Because $1 + 2\gamma \neq 2 + \gamma$, the map $x \mapsto a \circ x$ is not additive.

When a right near-subspace $C \subseteq \mathrm{NF}(9)^n$ does satisfy $a \circ v \in C$ for all $a \in \mathrm{NF}(9)$ and $v \in C$, we say it is left-stable.

**Lemma 2.**

(a) For all $x \in \mathbb{F}_9^\times$ and all $c \in H_0$, one has $\sigma_{cx} = \sigma_x$.

(b) For any $c \in \mathbb{F}_3$ and all $a, u \in \mathrm{NF}(9)$,

$$a \circ (c \circ u) = c \circ (a \circ u).$$

(c) If $a, c \in H_0$, then for all $u \in \mathrm{NF}(9)$,

$$a \circ (c \circ u) = c \circ (a \circ u).$$

**Proof.**

(a) Fix $x \in \mathbb{F}_9^\times$ and $c \in H_0$. Since $H_0 \subseteq \mathbb{F}_9^\times$, we have $x \in H_0$ if and only if $cx \in H_0$. Indeed, if $x \in H_0$ then $cx \in H_0$ by closure; conversely, if $cx \in H_0$ then $x = c^{-1}(cx) \in H_0$ because $c^{-1} \in H_0$. Hence, by the definition of $\sigma_y$, we obtain $\sigma_{cx} = \sigma_x$.

(b) If $c = 0$, then $c \circ u = 0$ and both sides are 0 for all $a, u$. If $u = 0$, both sides are clearly 0 as well. Assume now that $c \in \{1, 2\} \subset H_0$ and $u \neq 0$. Using part (a) and the fact that $c \in H_0$, we get

$$a \circ (c \circ u) = a \circ (cu) = \sigma_{cu}(a) cu = \sigma_u(a) c u = c \sigma_u(a) u,$$
where we also used the commutativity of the field multiplication in $\mathbb{F}_9$. On the other hand, since the Frobenius automorphism fixes $\mathbb{F}_3$, we have $\sigma_y(c) = c$ for all $y \in \mathbb{F}_9$. Thus

$$c \circ (a \circ u) = c \circ (\sigma_u(a) u) = \sigma_{\sigma_u(a)u}(c) \sigma_u(a) u = c \sigma_u(a) u,$$

so the two sides agree.

(c) If $a, c \in H_0$, then $\sigma_a = \sigma_c = \text{id}$, hence

$$a \circ c = \sigma_c(a) c = ac = ca = \sigma_a(c) a = c \circ a.$$

Using the associativity of $\circ$,

$$a \circ (c \circ u) = (a \circ c) \circ u = (c \circ a) \circ u = c \circ (a \circ u)$$

for all $u \in \text{NF}(9)$, as claimed.

<figure><img src="image_4.png" /></figure>

### 3. Linear Codes over NF(9)

Fix $n \ge 1$ and write $\mathcal{V} = \text{NF}(9)^n$, endowed with the coordinatewise right action. A **linear code** over $\text{NF}(9)$ of length $n$ is a right near-subspace $\mathcal{C} \subseteq \mathcal{V}$. The **right dimension** $\text{dim}_R(\mathcal{C})$ is the least integer $k$ for which there exist vectors $\mathbf{g}_1, \dots, \mathbf{g}_k \in \mathcal{V}$ such that, writing

$$G = \begin{bmatrix} \mathbf{g}_1 \\ \vdots \\ \mathbf{g}_k \end{bmatrix} \in \text{NF}(9)^{k \times n},$$

the code generated by $G$ is

$$\mathcal{C} = \langle G \rangle := \left\{ \sum_{i=1}^{k} \mathbf{g}_i \circ b_i : b_i \in \text{NF}(9) \right\}.$$

We refer to $G$ as a **generator matrix** of $\mathcal{C}$.

For $\mathbf{x} = (x_1, \dots, x_n) \in \mathcal{V}$, the **Hamming weight** is

$$w_H(\mathbf{x}) = |\{i : x_i \neq 0\}|,$$

and for vectors $\mathbf{x}, \mathbf{y}$ of the same length, the **Hamming distance** is

$$d_H(\mathbf{x}, \mathbf{y}) = w_H(\mathbf{x} - \mathbf{y}).$$

**Minimum distance** of a linear code $\mathcal{C}$ is

$$d_H(\mathcal{C}) = \min\{w_H(\mathbf{c}) : \mathbf{c} \in \mathcal{C} \setminus \{0\}\}.$$

A code of length $n$, dimension $k$, and minimum distance $d_H$ is denoted by $[n, k, d_H]$. We use the Magma [14] notation

$$[<0, 1>, \dots, <i, A_i>, \dots, <n, A_n>]$$

for the **weight distribution** of a linear code $\mathcal{C}$ over $\text{NF}(9)$, where $A_i$ is the number of codewords of Hamming weight $i$.

Two codes $\mathcal{C}_1, \mathcal{C}_2 \subseteq \mathcal{V}$ are **permutation equivalent** if there exists $\pi \in S_n$ such that

$$\mathcal{C}_2 = \pi(\mathcal{C}_1) = \{ (x_{\pi^{-1}(1)}, \dots, x_{\pi^{-1}(n)}) : (x_1, \dots, x_n) \in \mathcal{C}_1 \}.$$

The **automorphism group** of a code $\mathcal{C}$ is the subgroup
$$ \mathrm{Aut}(\mathcal{C}) := \{ \pi \in S_n : \pi(\mathcal{C}) = \mathcal{C} \}. $$

Permutation equivalent codes clearly have the same parameters $[n, k, d_H]$.

**Lemma 3.** If $\mathcal{C}$ is a linear code over NF(9), then

$$ d_H(\mathcal{C}) = \min\{d_H(\mathbf{x}, \mathbf{y}) : \mathbf{x} \neq \mathbf{y} \in \mathcal{C}\} = \min\{w_H(\mathbf{c}) : \mathbf{c} \in \mathcal{C} \setminus \{\mathbf{0}\}\}. $$

**Proof.** Because $\mathcal{C}$ is additively closed, for any $\mathbf{x} \neq \mathbf{y} \in \mathcal{C}$ we have $\mathbf{x} - \mathbf{y} \in \mathcal{C}$. By translation invariance of the Hamming distance, $d_H(\mathbf{x}, \mathbf{y}) = w_H(\mathbf{x} - \mathbf{y})$. Minimizing over all distinct pairs is thus the same as minimizing $w_H(\mathbf{c})$ over $\mathbf{0} \neq \mathbf{c} \in \mathcal{C}$. $\square$

Analogous to the classical field setting [1], Gaussian elimination using right elementary row operations, together with a suitable coordinate permutation, brings any code over NF(9) to a systematic form (see Theorem 1). Moreover, once an information set is fixed, the systematic right block is determined up to a permutation of the redundancy coordinates (Proposition 2).

**Theorem 1.** Every linear code $\mathcal{C}$ over NF(9) with parameters $[n, k, d_H]$ is permutation equivalent to one with generator matrix $G = [I_k \ A]$, where $A \in \mathrm{NF}(9)^{k \times (n-k)}$.

**Proof.** Let $G_0 \in \mathrm{NF}(9)^{k \times n}$ be any generator matrix of $\mathcal{C}$ (with $k = \dim_R(\mathcal{C})$). Here and below, for a nonzero $x \in \mathrm{NF}(9)$ we write $x^{-1}$ for the inverse of $x$ with respect to the Dickson product on $\mathrm{NF}(9)^\times = \mathrm{NF}(9) \setminus \{\mathbf{0}\}$; that is, $x \circ x^{-1} = 1 = x^{-1} \circ x$.

The following right elementary row operations preserve the right row space

$$ \langle G_0 \rangle = \left\{ \sum_{i=1}^{k} R_i \circ b_i : b_i \in \mathrm{NF}(9) \right\}, $$

where $R_i$ denotes the $i$-th row of $G_0$:

(i) Swap two rows;

(ii) Right-scale a row by a unit $u \in \mathrm{NF}(9)^\times$, i.e., $R_i \leftarrow R_i \circ u$;

(iii) Replace $R_i$ by $R_i + R_j \circ a$ with $a \in \mathrm{NF}(9)$.

Indeed, (i) is trivial. In (ii), the map $b \mapsto b \circ u$ is bijective on NF(9) since $u$ has a $\circ$-inverse, so right-scaling does not change the set of right linear combinations of the rows. In (iii), right distributivity of $\circ$ in each coordinate implies that any right linear combination of the new rows is still a right linear combination of the original rows, and conversely.

We now perform Gaussian elimination using only (i)–(iii). In any nonzero column, choose a nonzero entry $p$ and swap its row into the pivot position. Since $p \neq 0$, there exists a nonzero $v = p^{-1} \in \mathrm{NF}(9)$ with $p \circ v = 1$; right-scale the pivot row by $v$ so that the pivot becomes 1.

For any other row having entry $e$ in the pivot column, replace that row by

$$ R_{\mathrm{new}} = R_{\mathrm{old}} + R_{\mathrm{pivot}} \circ (-e). $$

In the pivot column, the new entry is

$$ e + (1 \circ (-e)) = e + \sigma_{-e}(1)(-e) = e + (-e) = 0, $$

since $\sigma_y(1) = 1$ for all $y \in \mathrm{NF}(9)$. Iterating down the columns yields a row-echelon form with $k$ pivot columns and pivots equal to 1.
Finally, permute columns so that the pivot columns come first, obtaining a systematic generator matrix $[I_k \ A]$. This column permutation corresponds to permutation equivalence, so the resulting code is permutation equivalent to $C$. □

**Example 2.** Consider a linear code over $\text{NF}(9)$ of length $n = 4$ and right dimension $k = 2$, with generator matrix

$$G = \begin{bmatrix} 1 & 0 & \gamma & 1+\gamma \\ 2 & 1 & 1 & \gamma \end{bmatrix}.$$

Using the right elementary row operation $R_2 \leftarrow R_2 + R_1$, we have $R_1 \circ 1 = R_1$, and hence

$$R_2 = (2, 1, 1, \gamma) + (1, 0, \gamma, 1+\gamma) = (0, 1, 1+\gamma, \gamma+1+\gamma) = (0, 1, 1+\gamma, 1+2\gamma).$$

Since the first two columns are already pivot columns, a systematic form of $G$ is

$$G = \begin{bmatrix} 1 & 0 & \gamma & 1+\gamma \\ 0 & 1 & 1+\gamma & 1+2\gamma \end{bmatrix} = [I_2 \ A], \quad A = \begin{bmatrix} \gamma & 1+\gamma \\ 1+\gamma & 1+2\gamma \end{bmatrix}.$$

**Corollary 1.** Let $C \subseteq \text{NF}(9)^n$ be a linear code over $\text{NF}(9)$ with parameters $[n, k, d_H]$. Then

$$|C| = 9^k.$$

**Proof.** By Theorem 1, $C$ is permutation equivalent to a code $C'$ with a systematic generator matrix $G = [I_k \ A]$, where $A \in \text{NF}(9)^{k \times (n-k)}$. Permutation equivalence is given by a bijection on $\text{NF}(9)^n$, hence preserves cardinality, so $|C| = |C'|$. Let $r_1, \dots, r_k$ denote the rows of $G$. Define

$$\phi : \text{NF}(9)^k \to C', \quad \phi(b_1, \dots, b_k) = \sum_{i=1}^{k} r_i \circ b_i.$$

By definition of the code generated by $G$, the map $\phi$ is surjective. Moreover, since $G$ is systematic, the first $k$ coordinates of $\phi(b_1, \dots, b_k)$ are exactly $(b_1, \dots, b_k)$; indeed, in the $j$-th coordinate with $1 \le j \le k$ we have

$$\sum_{i=1}^{k} (r_i)_j \circ b_i = 1 \circ b_j = b_j,$$

because the $j$-th column of $I_k$ is the $j$-th standard basis vector and $1 \circ b_j = b_j$. Hence, if $\phi(b) = \phi(b')$ then $b = b'$ by comparing the first $k$ coordinates, so $\phi$ is injective. Therefore $\phi$ is a bijection and

$$|C'| = |\text{NF}(9)|^k = 9^k,$$

since $|\text{NF}(9)| = 9$. Consequently $|C| = |C'| = 9^k$. □

**Proposition 2.** Let $G = [I_k \ A]$ and $G' = [I_k \ A']$ in $\text{NF}(9)^{k \times n}$ be two systematic generator matrices with the same information set $\{1, \dots, k\}$. Then $A' = AP$ for some permutation matrix $P \in \{0, 1\}^{(n-k) \times (n-k)}$ if and only if the codes $C = \langle G \rangle$ and $C' = \langle G' \rangle$ are permutation equivalent.

**Proof.** We let $S_n$ act on $\mathcal{V}$ by $(\pi x)_j = x_{\pi^{-1}(j)}$, and write $\Pi$ for the $n \times n$ permutation matrix of $\pi$ acting by right column permutation on generator matrices.

(⇒) Assume $A' = AP$ with a permutation $P \in \{0, 1\}^{(n-k) \times (n-k)}$ and set $\Pi = \text{diag}(I_k, P)$. Then $\Pi = [I_k \ AP] = G'$, so $\langle G' \rangle = \pi(\langle G \rangle)$ and the codes are permutation equivalent.
(↔) Suppose $C' = \pi(C)$ for some $\pi \in S_n$ with matrix $\Pi$. Then $\Pi$ is a generator matrix of $C'$. Since both $\Pi$ and $G'$ are systematic with the same information set $\{1, \dots, k\}$, $\Pi$ must be block diagonal:

$$ \Pi = \operatorname{diag}(P_1, P_2), \quad P_1 \in \{0,1\}^{k \times k}, \quad P_2 \in \{0,1\}^{(n-k) \times (n-k)}. $$

Right row-space invariance under right elementary row operations allows us to left-multiply by $P_1^{-1}$ to restore the identity in the first $k$ columns:

$$ P_1^{-1}(\Pi) = [I_k (P_1^{-1}A)P_2]. $$

However, $G'$ is also systematic with the same information set, so its right block must match that of $P_1^{-1}(\Pi)$. Renaming $P := P_2$, we obtain $A' = AP$, as required.

<figure><img src="image_5.png" /></figure>

As in the classical setting of linear codes over finite fields, linear codes over $\text{NF}(9)$ satisfy the Singleton bound its proof is the usual argument; the only extra observation in our context is that a code of right dimension $k$ over $\text{NF}(9)$ has cardinality $9^k$ Corollary 1.

**Theorem 2.** Let $C$ be a linear code of right dimension $k$. Then its Hamming distance satisfies

$$ d_H(C) \le n-k+1. $$

**Theorem 3.** Let $C$ be a linear code with systematic generator matrix $G = [I_k A]$, where $A \in \mathbb{F}_3^{k \times (n-k)}$. Assume that each column of $A$ has at most one nonzero entry. Then $C$ is left-stable.

**Proof.** Let $a \in \text{NF}(9)$ and $b = (b_1, \dots, b_k)^\top \in \text{NF}(9)^k$. By the definition of the left-applied right action on $\text{NF}(9)^n$,

$$ a \circ (b, Ab) = (a \circ b, a \circ (Ab)). $$

Therefore, it suffices to show that $a \circ (Ab) = A(a \circ b)$, where matrix-vector multiplication is defined using the Dickson product entrywise, i.e.,

$$ (Ab)_j = \sum_{i=1}^{k} A_{ij} \circ b_i, \quad (A(a \circ b))_j = \sum_{i=1}^{k} A_{ij} \circ (a \circ b_i). $$

Fix $j \in \{1, \dots, n-k\}$. Since each column of $A$ has at most one nonzero entry, we are in one of the following two cases.

(i) The $j$-th column of $A$ is zero. Then $(Ab)_j = 0$, hence

$$ a \circ (Ab)_j = a \circ 0 = 0 = (A(a \circ b))_j. $$

(ii) There is a unique index $i_j \in \{1, \dots, k\}$ with $A_{ij} \neq 0$. In this case

$$ (Ab)_j = A_{ij} \circ b_i. $$

Because $A \in \mathbb{F}_3^{k \times (n-k)}$, all entries of $A$ lie in $\mathbb{F}_3 = \{0, 1, 2\}$, and any nonzero entry satisfies $A_{ij} \in \{1, 2\} \subset H_0$. Thus we may apply Lemma 2(b) with $c = A_{ij}$, and obtain

$$ a \circ (Ab)_j = a \circ (A_{ij} \circ b_i) = A_{ij} \circ (a \circ b_i) = (A(a \circ b))_j. $$

In either case we have $a \circ (Ab)_j = (A(a \circ b))_j$, so $a \circ (Ab) = A(a \circ b)$ coordinatewise. Therefore

$$ a \circ (b, Ab) = (a \circ b, A(a \circ b)) \in C, $$
since $\mathcal{C} = \{(b', Ab') : b' \in \text{NF}(9)^k\}$. This shows that $a \circ v \in \mathcal{C}$ for all $a \in \text{NF}(9)$ and $v \in \mathcal{C}$, and completes the proof. $\square$

**Example 3.** Let $\mathcal{C}_{\text{rep}} = \{(t, \dots, t) \in \text{NF}(9)^n : t \in \text{NF}(9)\}$, with generator matrix

$$G = \underbrace{[1 \quad \dots \quad 1]}_{n-1}, \quad A = (1, \dots, 1) \in \mathbb{F}_3^{1 \times (n-1)}.$$

Therefore, $\mathcal{C}_{\text{rep}}$ is a linear code over $\text{NF}(9)$. Moreover, $\mathcal{C}_{\text{rep}}$ is left-stable.

## 4. Dickson Inner Product and Dual Code

Throughout this section, we fix $\mathcal{V} = \text{NF}(9)^n$ and a linear code $\mathcal{C} \subseteq \mathcal{V}$ of length $n$ with a systematic generator matrix $G = [I_k A]$, where $A \in \text{NF}(9)^{k \times (n-k)}$. We assume that $\mathcal{C}$ is left-stable.

For $\mathbf{x} = (x_1, \dots, x_n)$ and $\mathbf{y} = (y_1, \dots, y_n)$ in $\mathcal{V}$, we define the **Dickson inner product** by

$$\langle \mathbf{x}, \mathbf{y} \rangle = \sum_{i=1}^{n} x_i \circ y_i = x_1 \circ y_1 + x_2 \circ y_2 + \dots + x_n \circ y_n.$$

The **Dickson (right) dual** of $\mathcal{C}$ is

$$\mathcal{C}^{\perp_R} := \{ \mathbf{y} \in \text{NF}(9)^n : \langle \mathbf{y}, \mathbf{x} \rangle = 0 \text{ for all } \mathbf{x} \in \mathcal{C} \}.$$

A code $\mathcal{C}$ is **self-orthogonal** if $\mathcal{C} \subseteq \mathcal{C}^{\perp_R}$, and **self-dual** if $\mathcal{C} = \mathcal{C}^{\perp_R}$.

The next lemma collects basic properties of $\langle \cdot, \cdot \rangle$ on $\mathcal{V}$.

**Lemma 4.** For $\mathbf{x}, \mathbf{x}', \mathbf{y} \in \mathcal{V}$ and $a \in \text{NF}(9)$ we have

(a) $\langle \mathbf{x} + \mathbf{x}', \mathbf{y} \rangle = \langle \mathbf{x}, \mathbf{y} \rangle + \langle \mathbf{x}', \mathbf{y} \rangle$.

(b) $\langle \mathbf{x}, \mathbf{y} \circ a \rangle = \langle \mathbf{x}, \mathbf{y} \rangle \circ a$.

(c) $\langle \mathbf{y} \circ a, \mathbf{x} \rangle = \langle \mathbf{y}, a \circ \mathbf{x} \rangle$.

**Proof.**

(a) Using coordinatewise addition on $\mathcal{V}$ and right distributivity of $\circ$ we obtain

$$\begin{aligned} \langle \mathbf{x} + \mathbf{x}', \mathbf{y} \rangle &= \sum_{i=1}^{n} (x_i + x_i') \circ y_i \\ &= \sum_{i=1}^{n} (x_i \circ y_i + x_i' \circ y_i) \\ &= \sum_{i=1}^{n} x_i \circ y_i + \sum_{i=1}^{n} x_i' \circ y_i \\ &= \langle \mathbf{x}, \mathbf{y} \rangle + \langle \mathbf{x}', \mathbf{y} \rangle. \end{aligned}$$

(b) By associativity of $\circ$ on $\text{NF}(9)$ we have $x_i \circ (y_i \circ a) = (x_i \circ y_i) \circ a$ for each $i$. Hence

$$\langle \mathbf{x}, \mathbf{y} \circ a \rangle = \sum_{i=1}^{n} x_i \circ (y_i \circ a) = \sum_{i=1}^{n} (x_i \circ y_i) \circ a.$$

Using right distributivity of $\circ$ over finite sums applied to the elements $u_i = x_i \circ y_i$,

$$\sum_{i=1}^{n} (x_i \circ y_i) \circ a = \left( \sum_{i=1}^{n} x_i \circ y_i \right) \circ a = \langle \mathbf{x}, \mathbf{y} \rangle \circ a.$$
This proves (b).

(c) Again, by associativity of ◦ on each coordinate we have $(y_i ◦ a) ◦ x_i = y_i ◦ (a ◦ x_i)$ for each $i$. Therefore

$$ \langle \mathbf{y} \circ a, \mathbf{x} \rangle = \sum_{i=1}^{n} (y_i \circ a) \circ x_i = \sum_{i=1}^{n} y_i \circ (a \circ x_i) = \langle \mathbf{y}, a \circ \mathbf{x} \rangle, $$

which is (c).

<figure><img src="image_6.png" /></figure>

**Lemma 5.** For $\mathbf{x}, \mathbf{y} \in \mathcal{V}$ we have

(a) If $\langle \mathbf{x}, \mathbf{y} \rangle = 0$ for all $\mathbf{x} \in \mathcal{V}$, then $\mathbf{y} = \mathbf{0}$.

(b) If $\langle \mathbf{x}, \mathbf{y} \rangle = 0$ for all $\mathbf{y} \in \mathcal{V}$, then $\mathbf{x} = \mathbf{0}$.

**Proof.**

(a) Suppose $\mathbf{y} \neq \mathbf{0}$ and pick an index $j$ with $y_j \neq 0$. Let $\mathbf{x} \in \mathcal{V}$ be the vector with $x_j = 1$ and $x_i = 0$ for all $i \neq j$. Then

$$ \langle \mathbf{x}, \mathbf{y} \rangle = \sum_{i=1}^{n} x_i \circ y_i = x_j \circ y_j = 1 \circ y_j = y_j \neq 0, $$

using Lemma 1(b), which states $1 \circ y = y$ for all $y \in \text{NF}(9)$. This contradicts the assumption that $\langle \mathbf{x}, \mathbf{y} \rangle = 0$ for all $\mathbf{x} \in \mathcal{V}$. Hence $\mathbf{y} = \mathbf{0}$.

(b) Suppose $\mathbf{x} \neq \mathbf{0}$ and pick an index $j$ with $x_j \neq 0$. Let $\mathbf{y} \in \mathcal{V}$ be the vector with $y_j = 1$ and $y_i = 0$ for all $i \neq j$. Then

$$ \langle \mathbf{x}, \mathbf{y} \rangle = \sum_{i=1}^{n} x_i \circ y_i = x_j \circ y_j = x_j \circ 1 = x_j \neq 0, $$

again by Lemma 1(b), which gives $x \circ 1 = x$ for all $x \in \text{NF}(9)$. This contradicts the assumption that $\langle \mathbf{x}, \mathbf{y} \rangle = 0$ for all $\mathbf{y} \in \mathcal{V}$. Thus $\mathbf{x} = \mathbf{0}$.

<figure><img src="image_7.png" /></figure>

**Lemma 6.** For any permutation $\pi \in S_n$ and any $\mathbf{x}, \mathbf{y} \in \mathcal{V}$ we have

$$ \langle \pi(\mathbf{x}), \pi(\mathbf{y}) \rangle = \langle \mathbf{x}, \mathbf{y} \rangle. $$

Consequently, for any linear code $C \subseteq \mathcal{V}$ and any $\pi \in S_n$ one has

$$ \pi(C^{\perp R}) = \pi(C)^{\perp R}. $$

**Proof.** We have

$$ \langle \pi(\mathbf{x}), \pi(\mathbf{y}) \rangle = \sum_{i=1}^{n} x_{\pi^{-1}(i)} \circ y_{\pi^{-1}(i)} = \sum_{j=1}^{n} x_j \circ y_j = \langle \mathbf{x}, \mathbf{y} \rangle, $$

since the index relabeling $i \mapsto \pi^{-1}(i)$ is a bijection on $\{1, \dots, n\}$ and addition in $\text{NF}(9)$ is commutative.

For the consequence, let $\mathbf{z} \in \pi(C^{\perp R})$. Then $\mathbf{z} = \pi(\mathbf{y})$ for some $\mathbf{y} \in C^{\perp R}$, so $\langle \mathbf{y}, \mathbf{x} \rangle = 0$ for all $\mathbf{x} \in C$. For any $\mathbf{u} \in \pi(C)$ we can write $\mathbf{u} = \pi(\mathbf{x})$ with $\mathbf{x} \in C$, and hence

$$ \langle \mathbf{z}, \mathbf{u} \rangle = \langle \pi(\mathbf{y}), \pi(\mathbf{x}) \rangle = \langle \mathbf{y}, \mathbf{x} \rangle = 0. $$
Therefore, $\mathbf{z} \in \pi(C)^{\perp_R}$, which shows $\pi(C^{\perp_R}) \subseteq \pi(C)^{\perp_R}$. The reverse inclusion follows by applying the same argument to $\pi^{-1}$ in place of $\pi$, hence $\pi(C^{\perp_R}) = \pi(C)^{\perp_R}$. $\square$

Next we give a constructive description of $C^{\perp_R}$, a natural parity-check matrix, and the corresponding dimension relation.

**Theorem 4.** Let $C$ be a linear code with systematic generator matrix $G = [I_k A]$, where $A \in \text{NF}(9)^{k \times (n-k)}$, and assume that $C$ is left-stable. Then

(i) $C^{\perp_R}$ is a linear code of length $n$ over $\text{NF}(9)$.

(ii) A parity-check matrix of $C$ is $H = [-A^\top \ I_{n-k}]$, and $C^{\perp_R} = \langle H \rangle$.

(iii) $\dim_R(C) + \dim_R(C^{\perp_R}) = n$.

**Proof.**

(i) Let $\mathbf{y}, \mathbf{y}' \in C^{\perp_R}$ and $\mathbf{x} \in C$. By Lemma 4 (a),

$$ \langle \mathbf{y} + \mathbf{y}', \mathbf{x} \rangle = \langle \mathbf{y}, \mathbf{x} \rangle + \langle \mathbf{y}', \mathbf{x} \rangle = 0 + 0 = 0, $$

so $\mathbf{y} + \mathbf{y}' \in C^{\perp_R}$ and $C^{\perp_R}$ is additively closed.

Next, let $a \in \text{NF}(9)$ and $\mathbf{y} \in C^{\perp_R}$. For any $\mathbf{x} \in C$, Lemma 4 (c) gives

$$ \langle \mathbf{y} \circ a, \mathbf{x} \rangle = \langle \mathbf{y}, a \circ \mathbf{x} \rangle. $$

Because $C$ is left-stable, we have $a \circ \mathbf{x} \in C$, and hence the right-hand side is zero by definition of $C^{\perp_R}$. Thus $\langle \mathbf{y} \circ a, \mathbf{x} \rangle = 0$ for all $\mathbf{x} \in C$, so $\mathbf{y} \circ a \in C^{\perp_R}$. Therefore $C^{\perp_R}$ is a linear code over $\text{NF}(9)$ of length $n$.

(ii) Let $H = [-A^\top \ I_{n-k}]$ and denote its rows by $h_1, \dots, h_{n-k} \in \text{NF}(9)^n$. Every codeword of $C$ can be written as $\mathbf{c} = (b, Ab)$ with $b \in \text{NF}(9)^k$. For $j = 1, \dots, n-k$ we have

$$ \langle h_j, \mathbf{c} \rangle = \sum_{i=1}^{k} ((-A_{ij}) \circ b_i) + (Ab)_j. $$

Because $(-A_{ij}) \circ b_i = -(A_{ij} \circ b_i)$ by right distributivity and $((Ab)_j = \sum_{i=1}^k A_{ij} \circ b_i)$, we obtain

$$ \langle h_j, \mathbf{c} \rangle = - \sum_{i=1}^{k} A_{ij} \circ b_i + \sum_{i=1}^{k} A_{ij} \circ b_i = 0. $$

Therefore, each $h_j$ is orthogonal to every codeword of $C$, so $h_j \in C^{\perp_R}$ for all $j$. As in part (i), Lemma 4 (a),(c) and the left-applied right stability of $C$ imply that any right linear combination of the $h_j$'s is still orthogonal to every codeword. Hence

$$ \langle H \rangle = \{ \sum_{j=1}^{n-k} h_j \circ b_j : b_j \in \text{NF}(9) \} \subseteq C^{\perp_R}. $$

Conversely, let $\mathbf{y} = (\mathbf{u}, \mathbf{v}) \in C^{\perp_R}$, with $\mathbf{u} \in \text{NF}(9)^k$ and $\mathbf{v} \in \text{NF}(9)^{n-k}$. Let $g_i = (e_i, A_{i*})$ denote the $i$-th row of $G = [I_k A]$. Since $\mathbf{y} \in C^{\perp_R}$, we have

$$ 0 = \langle \mathbf{y}, g_i \rangle = u_i \circ 1 + \sum_{j=1}^{n-k} v_j \circ A_{ij} = u_i + \sum_{j=1}^{n-k} v_j \circ A_{ij}, $$

where we used $u_i \circ 1 = u_i$ from Lemma 1 (b). Thus

$$ u_i = - \sum_{j=1}^{n-k} v_j \circ A_{ij} \quad (i = 1, \dots, k). $$
Observe that the j-th row of H is $h_j = (-A_{*j}, e_j)$, so

$$ \sum_{j=1}^{n-k} h_j \circ v_j = \sum_{j=1}^{n-k} (-A_{*j}, e_j) \circ v_j = \left( -\sum_{j=1}^{n-k} A_{*j} \circ v_j, \sum_{j=1}^{n-k} e_j \circ v_j \right) = (\mathbf{u}, \mathbf{v}) = \mathbf{y}. $$

Therefore, $\mathbf{y} \in \langle H \rangle$, and we obtain $C^{\perp R} \subseteq \langle H \rangle$. Combining both inclusions yields $C^{\perp R} = \langle H \rangle$, and H is a parity-check matrix of C.

(iii) From (ii) we know that $C^{\perp R}$ has generator matrix $H = [-A^{\top} I_{n-k}]$ with $n-k$ rows. The rows of H are right linearly independent: indeed, if $\sum_{j=1}^{n-k} h_j \circ b_j = 0$, then looking at the last $n-k$ coordinates we get $(b_1, \dots, b_{n-k}) = 0$, since the j-th row $h_j$ has $e_j$ in the last block and $1 \circ b_j = b_j$. Thus $b_j = 0$ for all j, and the only right linear relation among the rows is the trivial one. Therefore $\dim_R(C^{\perp R}) = n-k$. Since $\dim_R(C) = k$ by assumption, we conclude that

$$ \dim_R(C) + \dim_R(C^{\perp R}) = k + (n-k) = n. \quad \square $$

A linear code $C \subseteq \text{NF}(9)^n$ is called **nice** if $|C| |C^{\perp R}| = 9^n$.

**Corollary 2.** Under the hypotheses of Theorem 4 we have

$$ |C^{\perp R}| = 9^{n-k}. $$

Therefore, C is nice.

**Proof.** By part (iii) of Theorem 4 and Corollary 1, we have

$$ |C| = 9^k \quad \text{and} \quad |C^{\perp R}| = 9^{n-k}. $$

Therefore

$$ |C| |C^{\perp R}| = 9^k \cdot 9^{n-k} = 9^n, $$

as claimed. $\square$

**Lemma 7.** If $C \subseteq C'$, then $(C')^{\perp R} \subseteq C^{\perp R}$.

**Proof.** Assume $C \subseteq C'$, and let $\mathbf{y} \in (C')^{\perp R}$. Then $\langle \mathbf{y}, \mathbf{x}' \rangle = 0$ for all $\mathbf{x}' \in C'$. In particular, this holds for every $\mathbf{x} \in C$ since $C \subseteq C'$, so $\langle \mathbf{y}, \mathbf{x} \rangle = 0$ for all $\mathbf{x} \in C$, i.e., $\mathbf{y} \in C^{\perp R}$. Hence $(C')^{\perp R} \subseteq C^{\perp R}$, as claimed. $\square$

**Theorem 5.** We have

$$ (C^{\perp R})^{\perp R} = C. $$

**Proof.** For any $\mathbf{x} \in C$ and any $\mathbf{y} \in C^{\perp R}$ we have $\langle \mathbf{y}, \mathbf{x} \rangle = 0$ by the definition of $C^{\perp R}$. Thus $\mathbf{x} \in (C^{\perp R})^{\perp R}$ for every $\mathbf{x} \in C$, and hence

$$ C \subseteq (C^{\perp R})^{\perp R}. $$

By Theorem 4 (iii) applied to C we obtain

$$ \dim_R(C) + \dim_R(C^{\perp R}) = n. $$

Moreover, by Theorem 4 (i) and (ii), the dual $C^{\perp R}$ is itself a linear code over NF(9) admitting a systematic generator matrix, and it is left-stable. Therefore, Theorem 4 (iii) also applies to $C^{\perp R}$, giving
$$ \dim_R ((C^{\perp R})^{\perp R}) = n - \dim_R (C^{\perp R}) = \dim_R (C). $$

By combining this dimension equality with the inclusion $C \subseteq (C^{\perp R})^{\perp R}$, we obtain

$$ (C^{\perp R})^{\perp R} = C. $$

<figure><img src="image_8.png" /></figure>

**Theorem 6.**

(i) If $C$ is self-orthogonal, then $\dim_R(C) \le n/2$.

(ii) If $C$ is self-dual, then $n$ is even and $\dim_R(C) = n/2$.

**Proof.** By Theorem 4(iii) we have $\dim_R(C) + \dim_R(C^{\perp R}) = n$.

(i) Assume that $C$ is self-orthogonal, so $C \subseteq C^{\perp R}$. Hence any right generating set of $C$ can be extended to a right generating set of $C^{\perp R}$, and therefore

$$ \dim_R(C) \le \dim_R(C^{\perp R}). $$

By combining this with the identity above, we obtain $\dim_R(C) \le \frac{1}{2}n$.

(ii) If $C$ is self-dual, then $C = C^{\perp R}$, so $\dim_R(C) = \dim_R(C^{\perp R})$. Substituting into $\dim_R(C) + \dim_R(C^{\perp R}) = n$ gives $2 \dim_R(C) = n$, that is, $\dim_R(C) = n/2$, which in particular forces $n$ to be even.

<figure><img src="image_9.png" /></figure>

**Corollary 3.** If $C$ is self-dual, then

$$ d_H(C) \le \frac{n}{2} + 1. $$

**Proof.** By Theorem 6(ii), a self-dual code $C$ has right dimension $\dim_R(C) = n/2$. Applying the Singleton bound in Theorem 2 with $k = n/2$ gives

$$ d_H(C) \le n - \frac{n}{2} + 1 = \frac{n}{2} + 1. $$

<figure><img src="image_10.png" /></figure>

**Theorem 7.** Let $C_1$ and $C_2$ be linear codes of lengths $n_1$ and $n_2$, respectively, over NF(9). Consider their direct sum

$$ C_1 \oplus C_2 = \{ (\mathbf{x}, \mathbf{y}) \in \mathrm{NF}(9)^{n_1+n_2} : \mathbf{x} \in C_1, \mathbf{y} \in C_2 \}. $$

Then, the right dual satisfies

$$ (C_1 \oplus C_2)^{\perp R} = C_1^{\perp R} \oplus C_2^{\perp R}. $$

**Proof.** Write vectors in NF(9)$^{n_1+n_2}$ as pairs $(\mathbf{x}, \mathbf{y})$ with $\mathbf{x} \in \mathrm{NF}(9)^{n_1}$ and $\mathbf{y} \in \mathrm{NF}(9)^{n_2}$. By definition of the Dickson inner product on the product space, for $(\mathbf{x}, \mathbf{y})$, $(\mathbf{u}, \mathbf{v}) \in \mathrm{NF}(9)^{n_1+n_2}$ we have

$$ \langle (\mathbf{x}, \mathbf{y}), (\mathbf{u}, \mathbf{v}) \rangle = \langle \mathbf{x}, \mathbf{u} \rangle + \langle \mathbf{y}, \mathbf{v} \rangle, $$

where the inner products on the right are taken in NF(9)$^{n_1}$ and NF(9)$^{n_2}$, respectively.

First, let $(\mathbf{u}, \mathbf{v}) \in C_1^{\perp R} \oplus C_2^{\perp R}$. Then $\mathbf{u} \in C_1^{\perp R}$ and $\mathbf{v} \in C_2^{\perp R}$, so for every $(\mathbf{x}, \mathbf{y}) \in C_1 \oplus C_2$ we get

$$ \langle (\mathbf{u}, \mathbf{v}), (\mathbf{x}, \mathbf{y}) \rangle = \langle \mathbf{u}, \mathbf{x} \rangle + \langle \mathbf{v}, \mathbf{y} \rangle = 0 + 0 = 0. $$
Therefore, $(\mathbf{u}, \mathbf{v}) \in (C_1 \oplus C_2)^{\perp_R}$, and so

$$C_1^{\perp_R} \oplus C_2^{\perp_R} \subseteq (C_1 \oplus C_2)^{\perp_R}.$$

Conversely, let $(\mathbf{u}, \mathbf{v}) \in (C_1 \oplus C_2)^{\perp_R}$. Then for every $\mathbf{x} \in C_1$ we may take $(\mathbf{x}, \mathbf{0}) \in C_1 \oplus C_2$, so

$$0 = \langle (\mathbf{u}, \mathbf{v}), (\mathbf{x}, \mathbf{0}) \rangle = \langle \mathbf{u}, \mathbf{x} \rangle + \langle \mathbf{v}, \mathbf{0} \rangle = \langle \mathbf{u}, \mathbf{x} \rangle.$$

Therefore, $\mathbf{u} \in C_1^{\perp_R}$. Similarly, taking $(\mathbf{0}, \mathbf{y})$ with $\mathbf{y} \in C_2$ gives

$$0 = \langle (\mathbf{u}, \mathbf{v}), (\mathbf{0}, \mathbf{y}) \rangle = \langle \mathbf{u}, \mathbf{0} \rangle + \langle \mathbf{v}, \mathbf{y} \rangle = \langle \mathbf{v}, \mathbf{y} \rangle,$$

so $\mathbf{v} \in C_2^{\perp_R}$. Hence $(\mathbf{u}, \mathbf{v}) \in C_1^{\perp_R} \oplus C_2^{\perp_R}$, proving the reverse inclusion

$$(C_1 \oplus C_2)^{\perp_R} \subseteq C_1^{\perp_R} \oplus C_2^{\perp_R}.$$

Combining both inclusions yields the stated equality. □

**Theorem 8.** Let $C \subseteq \text{NF}(9)^n$ be a linear code that is left-stable, with systematic generator matrix

$$G = [I_k A], \quad A \in \text{NF}(9)^{k \times (n-k)}.$$

Define

$$H = [-A^{\top} \ I_{n-k}] \in \text{NF}(9)^{(n-k) \times n}.$$

be the parity-check matrix of $C$ as in Theorem 4. Denote by $h^{(1)}, \dots, h^{(n)}$ the columns of $H$. Then the minimum Hamming distance of $C$ is given by

$$d_H(C) = \min\{t : \text{ there exist distinct indices } j_1, \dots, j_t \text{ and coefficients } c_1, \dots, c_t \in \text{NF}(9), \\ \text{ not all zero, such that } h^{(j_1)} \circ c_1 + \dots + h^{(j_t)} \circ c_t = 0 \}.$$

Equivalently, $d_H(C)$ is the smallest number of columns of $H$ that are right-linearly dependent over $(\text{NF}(9), \circ)$.

**Proof.** First, recall from Theorem 4 and Theorem 5 that

$$C = \{ x \in \text{NF}(9)^n : \langle h_r, x \rangle = 0 \text{ for all rows } h_r \text{ of } H \},$$

and that this is equivalent to the matrix condition

$$H \circ x^{\top} = 0,$$

where $(H \circ x^{\top})_r = \sum_{j=1}^n H_{rj} \circ x_j$ is the Dickson matrix-vector product.

*Upper bound.* Suppose there is a right-linear dependence among $t$ columns of $H$, say

$$h^{(j_1)} \circ c_1 + \dots + h^{(j_t)} \circ c_t = 0,$$

with $c_1, \dots, c_t \in \text{NF}(9)$ not all zero. Define $x \in \text{NF}(9)^n$ by

$$x_{j_s} = c_s \quad (s = 1, \dots, t), \quad x_j = 0 \text{ for } j \notin \{j_1, \dots, j_t\}.$$

Consequently,

$$H \circ x^{\top} = \sum_{j=1}^{n} h^{(j)} \circ x_j = \sum_{s=1}^{t} h^{(j_s)} \circ c_s = 0,$$

so $x \in C$. Its support is exactly $\{j_1, \dots, j_t\}$, hence $w_H(x) = t$, and therefore
$$d_H(C) \leq t.$$

Taking the minimum over all such right-linear dependencies gives

$$d_H(C) \leq \min\{t : \text{there is a right-linear dependence among } t \text{ columns of } H\}.$$

Lower bound. Conversely, let $0 \neq x = (x_1, \dots, x_n) \in C$ and let

$$S = \{j : x_j \neq 0\}$$

so that $|S| = w_H(x)$. Since $x \in C$ we have $H \circ x^\top = 0$, i.e.,

$$\sum_{j=1}^{n} h^{(j)} \circ x_j = 0.$$

By restricting to the indices in S, we obtain

$$\sum_{j \in S} h^{(j)} \circ x_j = 0,$$

which is a nontrivial right-linear relation among the columns $\{h^{(j)} : j \in S\}$, since not all $x_j$ for $j \in S$ are zero. Thus we obtain a right-linear dependence among $|S| = w_H(x)$ columns of $H$.

Since $x$ was an arbitrary nonzero codeword, this shows that every nonzero codeword of $C$ determines a right-linearly dependent set of columns whose cardinality equals its Hamming weight. Hence

$$\min\{t : \text{there is a right-linear dependence among } t \text{ columns of } H\} \leq d_H(C).$$

By combining the upper and lower bounds, we obtain the claimed equality.

<figure><img src="image_11.png" /></figure>

**Corollary 4.** Under the hypotheses of Theorem 8, the minimum Hamming distance of the dual code $C^{\perp_R}$ satisfies

$$d_H(C^{\perp_R}) = \min\{t : \text{ there exist distinct indices } j_1, \dots, j_t \text{ and coefficients } c_1, \dots, c_t \in \text{NF}(9), \\ \text{ not all zero, such that } g^{(j_1)} \circ c_1 + \dots + g^{(j_t)} \circ c_t = 0 \},$$

where

$g^{(1)}, \dots, g^{(n)}$ denote the columns of the generator matrix of $C$.

**Example 4.** If $C$ is self-orthogonal, then $G \circ G^\top = 0$. However, the converse need not hold. Let $n = 2$ and take generator rows

$$g_1 = (1, \gamma), \quad g_2 = (2, 2\gamma).$$

Because $1, 2, \gamma, 2\gamma \in H_0$, these $\circ$-products are ordinary field products. Hence

$$\langle g_1, g_1 \rangle = 1 + \gamma^2 = 1 + 2 = 0, \quad \langle g_2, g_2 \rangle = 2^2 + (2\gamma)^2 = 1 + 2 = 0,$$

$$\langle g_1, g_2 \rangle = 2 + 2\gamma^2 = 2 + 1 = 0,$$
so $G \circ G^\top = 0$. Now let $a = 1 + \gamma$. Then

$$g_1 \circ a = (1 \circ a, \gamma \circ a) = (a, \varphi(\gamma)a) = (1 + \gamma, 2\gamma(1 + \gamma)) = (1 + \gamma, 1 + 2\gamma),$$

since $2\gamma(1 + \gamma) = 2\gamma + 2\gamma^2 = 2\gamma + 2 \cdot 2 = 2\gamma + 4 \equiv 2\gamma + 1 = 1 + 2\gamma$ in $\mathbb{F}_3$. Set $x := g_1 \circ a$ and $y := g_2$. Then

$$\begin{aligned}
\langle x, y \rangle &= (1 + \gamma) \circ 2 + (1 + 2\gamma) \circ (2\gamma) \\
&= (1 + \gamma) \cdot 2 + (1 + 2\gamma) \cdot (2\gamma) \\
&= (2 + 2\gamma) + (2\gamma + 4\gamma^2) \\
&= (2 + 2\gamma) + (2\gamma + 8) \\
&= (2 + 2\gamma) + (2 + 2\gamma) \\
&= 4 + 4\gamma \equiv 1 + \gamma \neq 0.
\end{aligned}$$

Therefore, there exist $x, y \in C$ with $\langle x, y \rangle \neq 0$, so $C$ is not self-orthogonal despite $G \circ G^\top = 0$.

In the special case where the systematic generator matrix $G = [I_k A]$ satisfies $A \in (H_0 \cup \{0\})^{k \times (n-k)}$, all entries of $G$ and of the associated parity-check matrix $H = [-A^\top I_{n-k}]$ lie in $H_0 \cup \{0\}$. In this situation, the Dickson product coincides with the usual field multiplication whenever the right factor belongs to $H_0 \cup \{0\}$.

**Lemma 8.** Let $G = [I_k A]$ with $A \in (H_0 \cup \{0\})^{k \times (n-k)}$ and $H = [-A^\top I_{n-k}]$. Since $x \circ y = xy$ for every $y \in H_0 \cup \{0\}$, we have

$$G \circ G^\top = GG^\top, \quad H \circ H^\top = HH^\top.$$

**Proposition 3.** Let $C$ be a linear code with generator matrix $G \in \text{NF}(9)^{k \times n}$, and let $g_1, \dots, g_k$ denote the rows of $G$. Define the Dickson Gram matrix $G \circ G^\top$ by

$$(G \circ G^\top)_{ij} = \sum_{t=1}^{n} (g_i)_t \circ (g_j)_t = \langle g_i, g_j \rangle.$$

If $C$ is self-orthogonal, then $G \circ G^\top = 0$.

**Proof.** Assume first that $C$ is self-orthogonal. Then every two rows $g_i, g_j$ of $G$ are codewords in $C$ and hence must be orthogonal:

$$\langle g_i, g_j \rangle = 0 \quad \text{for all } 1 \le i, j \le k.$$

By definition of the Dickson Gram matrix we have

$$(G \circ G^\top)_{ij} = \sum_{t=1}^{n} (g_i)_t \circ (g_j)_t = \langle g_i, g_j \rangle,$$

so every entry of $G \circ G^\top$ is zero. Thus $G \circ G^\top = 0$. $\square$

Under the additional assumption that the systematic part $A$ has entries in $\mathbb{F}_3$, the Dickson Gram matrix simplifies to the usual Gram matrix and the self-duality condition admits a convenient algebraic description.

**Proposition 4.** Let $C$ be a linear code with systematic generator matrix $G = [I_k A]$, where $A \in \mathbb{F}_3^{k \times (n-k)}$. Then

$$C \text{ is self-orthogonal if and only if } GG^\top = 0 \text{ if and only if } AA^\top = -I_k.$$
**Proof.** (⇒) Assume $\mathcal{C}$ is self-orthogonal. In particular, every two rows of $G$ are codewords in $\mathcal{C}$, so they must be orthogonal. Let $g_1, \dots, g_k$ be the rows of $G$. Then

$$ \langle g_i, g_j \rangle = 0 \quad \text{for all } 1 \le i, j \le k. $$

But

$$ (GG^\top)_{ij} = \sum_{t=1}^{n} (g_i)_t \circ (g_j)_t = \langle g_i, g_j \rangle, $$

so all entries of $GG^\top$ are zero, i.e., $GG^\top = 0$.

(⇔) Now assume $GG^\top = 0$. We must show that any two codewords of $\mathcal{C}$ are orthogonal. Since $G$ is systematic. Let

$$ \mathbf{c} = (b, Ab), \quad \mathbf{d} = (b', Ab') $$

be two codewords, with $b = (b_1, \dots, b_k)$ and $b' = (b'_1, \dots, b'_k) \in \text{NF}(9)^k$. Now, we compute their inner product coordinatewise. The first sum $\sum_{i=1}^k b_i \circ b'_i$, and The second sum for each $j = 1, \dots, n-k$,

$$ (Ab)_j = \sum_{i=1}^{k} A_{ij}b_i, \quad (Ab')_j = \sum_{r=1}^{k} A_{rj}b'_r, $$

and since $A_{ij}, A_{rj} \in \mathbb{F}_3 \subset H_0$, Dickson multiplication with these coefficients is the usual field multiplication. Hence

$$ (Ab)_j \circ (Ab')_j = \sum_{i=1}^{k} \sum_{r=1}^{k} A_{ij}A_{rj} (b_i \circ b'_r). $$

Summing over $j = 1, \dots, n-k$ we get

$$ \sum_{j=1}^{n-k} (Ab)_j \circ (Ab')_j = \sum_{i=1}^{k} \sum_{r=1}^{k} \left( \sum_{j=1}^{n-k} A_{ij} A_{rj} \right) (b_i \circ b'_r) = \sum_{i=1}^{k} \sum_{r=1}^{k} (AA^\top)_{ir} (b_i \circ b'_r). $$

Therefore $\langle (b, Ab), (b', Ab') \rangle = \sum_{i=1}^{k} b_i \circ b'_i + \sum_{i=1}^{k} \sum_{r=1}^{k} (AA^\top)_{ir} (b_i \circ b'_r)$. Write the first sum also with two indices using the Kronecker symbol $\delta_{ir}$:

$$ \sum_{i=1}^{k} b_i \circ b'_i = \sum_{i=1}^{k} \sum_{r=1}^{k} \delta_{ir} (b_i \circ b'_r). $$

So $\langle (b, Ab), (b', Ab') \rangle = \sum_{i=1}^{k} \sum_{r=1}^{k} (\delta_{ir} + (AA^\top)_{ir}) (b_i \circ b'_r)$. But if $G = [I_k A]$, then $GG^\top = I_k + AA^\top$. Thus $\langle (b, Ab), (b', Ab') \rangle = \sum_{i=1}^{k} \sum_{r=1}^{k} (GG^\top)_{ir} (b_i \circ b'_r)$. By assumption $GG^\top = 0$, so every entry $(GG^\top)_{ir} = 0$, and the whole sum is 0. Hence every two codewords are orthogonal, i.e., $\mathcal{C} \subseteq \mathcal{C}^\perp$, so $\mathcal{C}$ is self-orthogonal. Finally, since $GG^\top = I_k + AA^\top$, the condition $GG^\top = 0$ is equivalent to $I_k + AA^\top = 0$, i.e., $AA^\top = -I_k$. $\square$

**Theorem 9.** Let $G = [I_k A]$ with $A \in \mathbb{F}_3^{k \times (n-k)}$ and $H = [-A^\top I_{n-k}]$. The following are equivalent:

(i) $\mathcal{C}$ is self-dual.

(ii) $n = 2k$ and $AA^\top = -I_k$.

(iii) $n = 2k$ and $GG^\top = 0$.

(iv) $n = 2k$ and $HH^\top = 0$.

In particular, if $\mathcal{C}$ is self-dual then $k$ is even (hence $n \equiv 0 \pmod{4}$).

**Proof.** We use Proposition 4.
(i) ⇒ (ii). Assume that $\mathcal{C}$ is self-dual. By Theorem 4, we have

$$ \dim_R(\mathcal{C}) + \dim_R(\mathcal{C}^{\perp_R}) = n. $$

Since $\mathcal{C} = \mathcal{C}^{\perp_R}$, it follows that $k + k = n$, and hence $n = 2k$. Moreover, every self-dual code is self-orthogonal, so Proposition 4 yields $AA^\top = -I_k$. Thus (ii) holds.

(ii) ⇒ (i). Assume that $n = 2k$ and $AA^\top = -I_k$. Then Proposition 4 implies that $\mathcal{C}$ is self-orthogonal. Since $\dim_R(\mathcal{C}) = k$ and $n = 2k$, we have

$$ \dim_R(\mathcal{C}^{\perp_R}) = n - k = 2k - k = k. $$

Therefore, $\mathcal{C} \subseteq \mathcal{C}^{\perp_R}$ and both codes have the same right dimension, so $\mathcal{C} = \mathcal{C}^{\perp_R}$. Hence (i) holds.

(ii) ⇔ (iii). For a systematic generator matrix $G = [I_k A]$, we have

$$ GG^\top = I_k + AA^\top, $$

so $GG^\top = 0$ if and only if $AA^\top = -I_k$. Together with the common condition $n = 2k$, this gives the equivalence of (ii) and (iii).

(ii) ⇔ (iv). When $n = 2k$, the matrix $A$ is $k \times k$ and

$$ H = [-A^\top I_k], \quad HH^\top = A^\top A + I_k. $$

If (ii) holds, then $AA^\top = -I_k$. Over a field, $AA^\top$ and $A^\top A$ are similar, hence $A^\top A = -I_k$, and therefore $HH^\top = 0$, i.e., (iv).

Conversely, if (iv) holds, i.e., $A^\top A + I_k = 0$, then $A^\top A = -I_k$ and, by the same similarity argument, we get $AA^\top = -I_k$, so (ii) holds.

From (ii), we have $AA^\top = -I_k$. Taking determinants on both sides gives

$$ (\det A)^2 = \det(AA^\top) = \det(-I_k) = (-1)^k = 2^k \in \mathbb{F}_3. $$

In $\mathbb{F}_3$ the only nonzero square is 1, hence $2^k = 1$ in $\mathbb{F}_3$, which forces $k$ to be even. Since $n = 2k$, we also get $n \equiv 0 \pmod{4}$. $\square$

## 5. LCD Codes

Fix $\mathcal{V} = \text{NF}(9)^n$ and a linear code $\mathcal{C} \subseteq \mathcal{V}$ with systematic generator $G = [I_k A]$, $A \in \text{NF}(9)^{k \times (n-k)}$. Assume that $\mathcal{C}$ is left-stable. A code $\mathcal{C}$ is called **linear complementary dual (LCD)** if

$$ \mathcal{C} \cap \mathcal{C}^{\perp_R} = \{0\}. $$

Write the rows of $G$ as $g_1, \dots, g_k$.

The following lemma shows that the LCD property is invariant under coordinate permutations.

**Lemma 9.** If $\pi \in S_n$ is a coordinate permutation, then $\mathcal{C}$ is LCD if and only if $\pi(\mathcal{C})$ is LCD.

**Proof.** By Lemma 6, $(\pi(\mathcal{C}))^{\perp_R} = \pi(\mathcal{C}^{\perp_R})$. Hence

$$ \pi(\mathcal{C}) \cap (\pi(\mathcal{C}))^{\perp_R} = \pi(\mathcal{C} \cap \mathcal{C}^{\perp_R}), $$

which is trivial if and only if the original intersection $\mathcal{C} \cap \mathcal{C}^{\perp_R}$ is trivial. $\square$

The next standard characterization identifies LCD codes precisely as those whose ambient space splits as a direct sum with their dual.
**Theorem 10.** C is LCD if and only if $\mathcal{V} = C \oplus C^{\perp_R}$.

**Proof.** Recall from Theorem 4 (iii) that

$$ \dim_R(C) + \dim_R(C^{\perp_R}) = n. $$

(⇒) Suppose C is LCD, so $C \cap C^{\perp_R} = \{0\}$. Then

$$ \dim_R(C + C^{\perp_R}) = \dim_R(C) + \dim_R(C^{\perp_R}) - \dim_R(C \cap C^{\perp_R}) = n, $$

hence $C + C^{\perp_R} = \mathcal{V}$. Together with the trivial intersection this shows that $\mathcal{V} = C \oplus C^{\perp_R}$.

(←) Conversely, if $\mathcal{V} = C \oplus C^{\perp_R}$, then by definition of direct sum we have $C \cap C^{\perp_R} = \{0\}$, so C is LCD. □

We next express the dimension of the hull $C \cap C^{\perp_R}$ in terms of Gram-type matrices when the systematic block A is $\mathbb{F}_3$-valued.

**Theorem 11.** Assume $G = [I_k A]$ with $A \in \mathbb{F}_3^{k \times (n-k)}$ and set $H = [-A^\top I_{n-k}]$. Then

$$ \dim_R(C \cap C^{\perp_R}) = k - \mathrm{rank}(I_k + AA^\top) = (n-k) - \mathrm{rank}(I_{n-k} + A^\top A), $$

where $\mathrm{rank}(\cdot)$ is taken over $\mathbb{F}_3$. Consequently, C is LCD if and only if $I_k + AA^\top$ (equivalently, $I_{n-k} + A^\top A$) is nonsingular.

**Proof.** Any codeword of C can be written uniquely in systematic form

$$ c = (b, Ab) \in \mathrm{NF}(9)^n, \quad b \in \mathrm{NF}(9)^k. $$

Let $g_1, \dots, g_k$ be the rows of $G = [I_k A]$, so

$$ g_i = (e_i, A_{i*}) \in \mathrm{NF}(9)^n, \quad i = 1, \dots, k. $$

Since all entries of G lie in $\mathbb{F}_3 \subset H_0 \cup \{0\}$, we have $x \circ y = xy$ for every y-entry of $g_i$, and the Dickson inner product $\langle \cdot, \cdot \rangle$ with $g_i$ coincides with the usual field inner product in $\mathbb{F}_9$.
Fix $i \in \{1, \dots, k\}$. Then

$$ \langle (b, Ab), g_i \rangle = \sum_{j=1}^{k} b_j \circ (g_i)_j + \sum_{j=1}^{n-k} (Ab)_j \circ A_{ij}. $$

In the first sum, $(g_i)_j = \delta_{ij} \in \mathbb{F}_3$, so

$$ \sum_{j=1}^{k} b_j \circ (g_i)_j = b_i. $$

For $j = 1, \dots, n-k$ we have

$$ (Ab)_j = \sum_{r=1}^{k} A_{rj} b_r $$

with $A_{rj} \in \mathbb{F}_3$, hence

$$ (Ab)_j \circ A_{ij} = (Ab)_j A_{ij} = \sum_{r=1}^{k} A_{rj} A_{ij} b_r. $$

Summing over $j = 1, \dots, n-k$ gives

$$ \sum_{j=1}^{n-k} (Ab)_j \circ A_{ij} = \sum_{r=1}^{k} \left( \sum_{j=1}^{n-k} A_{ij} A_{rj} \right) b_r = \sum_{r=1}^{k} (AA^\top)_{ir} b_r. $$
Therefore

$$ \langle (b, Ab), g_i \rangle = b_i + \sum_{r=1}^{k} (AA^{\top})_{ir} b_r = ((I_k + AA^{\top})b)_i. $$

Thus $c = (b, Ab)$ belongs to $C^{\perp R}$ if and only if

$$ \langle (b, Ab), g_i \rangle = 0 \quad \text{for all } i = 1, \dots, k, $$

which is equivalent to

$$ (I_k + AA^{\top})b = 0. $$

In particular,

$$ C \cap C^{\perp R} \simeq \ker(I_k + AA^{\top}) $$

as right NF(9)-modules, so

$$ \dim_R(C \cap C^{\perp R}) = \dim_R \ker(I_k + AA^{\top}) = k - \dim(R(I_k + AA^{\top})), $$

where the rank is computed over $\mathbb{F}_3$.

By Theorem 4, $C^{\perp R} = \langle H \rangle$ with $H = [-A^{\top} \ I_{n-k}]$, and the same argument applied to $H$ shows that

$$ \dim_R(C \cap C^{\perp R}) = (n-k) - \dim(R(I_{n-k} + A^{\top}A)). $$

Finally, $C$ is LCD if and only if $\dim_R(C \cap C^{\perp R}) = 0$, i.e.,

$$ \dim_R(I_k + AA^{\top}) = k \iff I_k + AA^{\top} \text{ is nonsingular,} $$

equivalently $I_{n-k} + A^{\top}A$ is nonsingular. $\square$

In this subsection we collect several easy but useful permanence properties of LCD codes over NF(9).

**Proposition 5.** Let $C \subseteq \text{NF}(9)^n$ be an LCD code. Then its Dickson dual $C^{\perp R}$ is also LCD.

**Proof.** By Theorem 5 we have $(C^{\perp R})^{\perp R} = C$. Since $C \cap C^{\perp R} = \{0\}$, we get

$$ C^{\perp R} \cap (C^{\perp R})^{\perp R} = C^{\perp R} \cap C = \{0\}, $$

so $C^{\perp R}$ is LCD. $\square$

**Proposition 6.** Let $C_1$ and $C_2$ be linear codes over NF(9). Then $C_1 \oplus C_2$ is LCD if and only if each $C_1$ and $C_2$ is LCD.

**Proof.** By Theorem 7 we have

$$ (C_1 \oplus C_2)^{\perp R} = C_1^{\perp R} \oplus C_2^{\perp R}. $$

Thus

$$ (C_1 \oplus C_2) \cap (C_1 \oplus C_2)^{\perp R} = (C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R}). $$

We now show that

$$ (C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R}) = (C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R}). $$

Let $(u, v)$ belong to the intersection $(u, v) \in (C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R})$. Then, by definition of the direct sum, there exist $x_1 \in C_1$, $x_2 \in C_2$, $y_1 \in C_1^{\perp R}$, $y_2 \in C_2^{\perp R}$ such that $(u, v) = (x_1, x_2) = (y_1, y_2)$. Equating coordinates gives $u = x_1 = y_1$, $v = x_2 = y_2$. Hence $u \in C_1 \cap C_1^{\perp R}$, $v \in C_2 \cap C_2^{\perp R}$, and therefore $(u, v) \in (C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R})$.
Thus $(C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R}) \subseteq (C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R})$. Conversely, let $(\mathbf{u}, \mathbf{v}) \in (C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R})$. This means $\mathbf{u} \in C_1 \cap C_1^{\perp R}$, $\mathbf{v} \in C_2 \cap C_2^{\perp R}$. In particular,

$$ \mathbf{u} \in C_1, \mathbf{v} \in C_2 \implies (\mathbf{u}, \mathbf{v}) \in C_1 \oplus C_2, $$

and

$$ \mathbf{u} \in C_1^{\perp R}, \mathbf{v} \in C_2^{\perp R} \implies (\mathbf{u}, \mathbf{v}) \in C_1^{\perp R} \oplus C_2^{\perp R}. $$

Hence $(\mathbf{u}, \mathbf{v}) \in (C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R})$, and therefore $(C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R}) \subseteq (C_1 \oplus C_2) \cap (C_1^{\perp R} \oplus C_2^{\perp R})$. Combining both inclusions we obtain

$$ (C_1 \oplus C_2) \cap (C_1 \oplus C_2)^{\perp R} = (C_1 \cap C_1^{\perp R}) \oplus (C_2 \cap C_2^{\perp R}). $$

Now $(C_1 \oplus C_2)$ is LCD if and only if the left-hand side is $\{0\}$, which happens if and only if both $C_1 \cap C_1^{\perp R}$ and $C_2 \cap C_2^{\perp R}$ are $\{0\}$, i.e., if and only if each $C_1$ and $C_2$ is LCD. $\square$

## 6. Numerical Section

In this section we classify self-orthogonal codes over NF(9) of length $n \le 8$ and right dimension $k = 1$ or 2. All classification results and numerical data in this section were obtained with the computer algebra system Magma [14].

We proceed as follows:

* For each admissible pair $(n,k)$ with $n \le 8$ and $k \in \{1,2\}$, list all linear codes over NF(9) up to coordinate permutations.

* Bring every code to a systematic form $G = [I_k A]$ by Theorem 1.

* Test self-orthogonality by Proposition 4, i.e., retain only those matrices $A \in \mathbb{F}_3^{k \times (n-k)}$ for which $AA^\top = -I_k$.

* For each remaining code, compute the minimum Hamming distance and the weight distribution, and identify codes that are permutation equivalent.

See the Tables 2 and 3.

<table><caption>**Table 2.** Self-orthogonal codes over NF(9) for $n = 3, 4, 5, 6$.</caption><thead><tr><th>n</th><th>k</th><th>d<sub>H</sub></th><th>A</th><th>Aut(C)</th><th>Weight Distribution</th><th>Note</th></tr></thead><tbody><tr><td>3</td><td>1</td><td>3</td><td><b>[1 1 1]</b><br><b>[1 2]</b></td><td>6<br>2</td><td><b>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;, &lt;3,8&gt;]</b></td><td></td></tr><tr><td>4</td><td>1</td><td>3</td><td><b>[1 1 0 0]</b><br><b>[1 2 0 0]</b></td><td>6<br>2</td><td><b>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;, &lt;3,8&gt;, &lt;4,0&gt;]</b></td><td></td></tr><tr><td>4</td><td>2</td><td>3</td><td><b>[1 1 1]</b><br><b>[1 2]</b></td><td>3</td><td><b>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;, &lt;3,32&gt;, &lt;4,48&gt;]</b></td><td>Self-dual</td></tr><tr><td>5</td><td>1</td><td>3</td><td><b>[1 1 0 0]</b><br><b>[1 2 0 0]</b></td><td>12<br>4</td><td><b>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;, &lt;3,8&gt;, &lt;4,0&gt;, &lt;5,0&gt;]</b></td><td></td></tr><tr><td>5</td><td>2</td><td>3</td><td><b>[1 1 0 0]</b><br><b>[1 2 0 0]</b><br><b>[0 1 2]</b><br><b>[0 2 2]</b><br><b>[0 2 2]</b><br><b>[0 1 2]</b></td><td>3<br>3<br>3</td><td><b>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;, &lt;3,32&gt;, &lt;4,48&gt;, &lt;5,0&gt;]</b></td><td></td></tr></tbody></table>
<table><caption>**Table 2. Cont.**</caption><thead><tr><th>n</th><th>k</th><th>d<sub>H</sub></th><th>A</th><th>Aut(C)</th><th>Weight Distribution</th><th>Note</th></tr></thead><tbody><tr><td rowspan="5">6</td><td rowspan="5">1</td><td>3</td><td>[1 1 0 0 0]</td><td>36</td><td>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;,</td><td></td></tr><tr><td rowspan="4">6</td><td>[1 2 0 0 0]</td><td>12</td><td>&lt;3,8&gt;, &lt;4,0&gt;, &lt;5,0&gt;,</td><td></td></tr><tr><td>[1 1 1 1 1]</td><td>720</td><td>&lt;6,0&gt;]</td><td></td></tr><tr><td>[2 1 1 1 1]</td><td>120</td><td></td><td></td></tr><tr><td>[2 2 1 1 1]</td><td>48</td><td></td><td></td></tr><tr><td></td><td></td><td>[2 2 2 1 1]</td><td>36</td><td></td><td></td><td></td></tr><tr><td rowspan="5">6</td><td rowspan="5">2</td><td rowspan="5">3</td><td>[0 0 1 1]</td><td>6</td><td>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;,</td><td></td></tr><tr><td>[0 0 1 2]</td><td></td><td>&lt;3,32&gt;, &lt;4,48&gt;, &lt;5,0&gt;, &lt;6,0&gt;]</td><td></td></tr><tr><td>[0 0 1 1]</td><td>72</td><td>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;,</td><td></td></tr><tr><td>[1 1 0 0]</td><td></td><td>, &lt;3,16&gt;, &lt;4,0&gt;, &lt;5,0&gt;, &lt;6,64&gt;]</td><td></td></tr><tr><td>[0 0 1 1]</td><td>12</td><td></td><td></td></tr><tr><td></td><td></td><td>[1 2 0 0]</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>[0 0 1 2]</td><td></td><td>8</td><td></td><td></td></tr><tr><td></td><td></td><td>[1 2 0 0]</td><td></td><td></td><td></td><td></td></tr></tbody></table>

<table><caption>**Table 3.** Self-orthogonal codes over NF(9) for $n = 7, 8$.</caption><thead><tr><th>n</th><th>k</th><th>d<sub>H</sub></th><th>A</th><th>Aut(C)</th><th>Weight Distribution</th></tr></thead><tbody><tr><td rowspan="5">7</td><td rowspan="5">1</td><td>3</td><td>[1 1 0 0 0 0]</td><td>144</td><td>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;,</td></tr><tr><td rowspan="4">6</td><td>[1 2 0 0 0 0]</td><td>48</td><td>&lt;3,8&gt;, &lt;4,0&gt;, &lt;5,0&gt;,</td></tr><tr><td>[1 1 1 1 1 0]</td><td>720</td><td>[&lt;6,0&gt;, &lt;7,0&gt;]</td></tr><tr><td>[2 1 1 1 1 0]</td><td>120</td><td>[&lt;0,1&gt;, &lt;1,0&gt;, &lt;2,0&gt;,</td></tr><tr><td>[2 2 1 1 1 0]</td><td>48</td><td>&lt;3,0&gt;, &lt;4,0&gt;, &lt;5,0&gt;,</td></tr><tr><td></td><td></td><td>[2 2 2 1 1 0]</td><td>36</td><td>, &lt;6,8&gt;, &lt;7,0&gt;]</td></tr><tr><td rowspan="15">7</td><td rowspan="15">2</td><td rowspan="15">3</td><td>[0 0 0 1 1]</td><td>72</td><td>[&lt;0,1&gt;, &lt;3,16&gt;, &lt;6,64&gt;]</td></tr><tr><td>[0 1 1 0 0]</td><td></td><td></td></tr><tr><td>[0 0 0 1 1]</td><td>12</td><td></td></tr><tr><td>[0 1 2 0 0]</td><td>12</td><td></td></tr><tr><td>[0 0 0 1 1]</td><td></td><td></td></tr><tr><td>[0 2 2 0 0]</td><td>12</td><td></td></tr><tr><td>[0 1 1 0 0]</td><td></td><td></td></tr><tr><td>[0 0 0 1 2]</td><td>8</td><td></td></tr><tr><td>[0 1 2 0 0]</td><td>8</td><td></td></tr><tr><td>[0 2 2 0 0]</td><td>8</td><td></td></tr><tr><td>[0 0 0 2 2]</td><td>12</td><td></td></tr><tr><td>[0 1 1 0 0]</td><td></td><td></td></tr><tr><td>[0 0 0 2 2]</td><td>8</td><td></td></tr><tr><td>[0 1 2 0 0]</td><td>8</td><td></td></tr><tr><td>[0 0 0 2 2]</td><td>8</td><td></td></tr><tr><td>[0 2 2 0 0]</td><td></td><td></td></tr></tbody></table>
<table><caption>Table 3. *Cont.*</caption><thead><tr><th>n</th><th>k</th><th>d<sub>H</sub></th><th>A</th><th>Aut(C)</th><th>Weight Distribution</th></tr></thead><tbody><tr><td rowspan="12">8</td><td rowspan="12">1</td><td rowspan="3">3</td><td>[1 1 0 0 0 0 0]</td><td>720</td><td rowspan="3">[&lt;0,1&gt;, &lt;3,8&gt;, &lt;4,0&gt;, &lt;5,0&gt;, &lt;6,0&gt;, &lt;7,0&gt;, &lt;8,0&gt;]</td></tr><tr><td>[1 2 0 0 0 0 0]</td><td>240</td></tr><tr><td>[2 2 0 0 0 0 0]</td><td>240</td></tr><tr><td rowspan="6">6</td><td>[2 2 2 2 2 0 0]</td><td>240</td><td rowspan="6">[&lt;0,1&gt;, &lt;6,8&gt;, &lt;7,0&gt;, &lt;8,0&gt;]</td></tr><tr><td>[1 2 2 2 2 0 0]</td><td>96</td></tr><tr><td>[1 1 2 2 2 0 0]</td><td>144</td></tr><tr><td>[1 1 1 2 2 0 0]</td><td>96</td></tr><tr><td>[1 1 1 1 2 0 0]</td><td>240</td></tr><tr><td>[1 1 1 1 1 0 0]</td><td>1440</td></tr><tr><td rowspan="12">2</td><td rowspan="12">3</td><td>[0 0 0 0 1 1]</td><td>72</td><td rowspan="12">[&lt;0,1&gt;, &lt;3,16&gt;, &lt;6,64&gt;, &lt;7,0&gt;, &lt;8,0&gt;]</td></tr><tr><td>[0 0 1 1 0 0]</td><td>12</td></tr><tr><td>[0 0 1 2 0 0]</td><td>12</td></tr><tr><td>[0 0 0 0 1 1]</td><td>12</td></tr><tr><td>[0 0 2 2 0 0]</td><td>12</td></tr><tr><td>[0 0 0 0 1 2]</td><td>12</td></tr><tr><td>[0 0 1 1 0 0]</td><td>8</td></tr><tr><td>[0 0 0 0 1 2]</td><td>8</td></tr><tr><td>[0 0 2 2 0 0]</td><td>8</td></tr><tr><td>[0 0 0 0 2 2]</td><td>12</td></tr><tr><td>[0 0 1 1 0 0]</td><td>8</td></tr><tr><td>[0 0 0 0 2 2]</td><td>8</td></tr><tr><td>[0 0 1 2 0 0]</td><td>8</td></tr><tr><td>[0 0 0 0 2 2]</td><td>8</td></tr><tr><td>[0 0 2 2 0 0]</td><td>8</td></tr></tbody></table>

## 7. Conclusions

In this paper we developed a first systematic framework for linear codes over the Dickson near-field of order nine NF(9). We described the underlying near-field structure and the induced one-sided linear algebra, introduced right linear codes and showed that they admit a suitable systematic form, and established basic parameter relations and bounds for their minimum Hamming distance. Using a Dickson inner product we defined the associated dual codes and clarified how self-orthogonality, self-duality, and the LCD property fit into this setting. As an illustration of the theory, we carried out a complete classification of short self-orthogonal codes over NF(9).

Further work. Several natural extensions of this work suggest themselves:

* Extend the classification to larger lengths and higher dimensions, and search for families of near-field self-dual and LCD codes with good parameters.

* Generalize the theory to other Dickson near-fields and suitable non-unitary near-rings, comparing which results persist beyond NF(9).

* Investigate MacWilliams-type identities and develop decoding algorithms and potential applications of NF(9)-codes in communications and cryptography.

**Author Contributions:** Conceptualization, A.A.; Methodology, A.A. and P.S.; Software, M.F.A.A.; Validation, P.S.; Formal analysis, A.A. and M.F.A.A.; Resources, M.F.A.A. and P.S.; Data curation, A.A., M.F.A.A., and P.S.; Writing—original draft, A.A.; Writing—review and editing, M.F.A.A. and P.S.; Visualization, P.S.; Supervision, A.A.; Funding acquisition, A.A. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.
**Data Availability Statement:** The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

**Acknowledgments:** This research has been funded by Scientific Research Deanship at University of Ha'il-Saudi Arabia through project number «BA-25 016.»

**Conflicts of Interest:** The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

## References

1. Huffman, W.C.; Pless, V. *Fundamentals of Error-Correcting Codes*; Cambridge University Press: Cambridge, UK, 2003.

2. Hammons, A.R., Jr.; Kumar, P.V.; Calderbank, A.R.; Sloane, N.J.A.; Solé, P. The $\mathbb{Z}_4$-linearity of Kerdock, Preparata, Goethals, and related codes. *IEEE Trans. Inf. Theory* **1994**, *40*, 301–319.

3. Shi, M.; Alahmadi, A.; Solé, P. *Codes and Rings: Theory and Practice*; Academic Press: Amsterdam, The Netherlands, 2017.

4. Alahmadi, A.; Melaibari, A.; Solé, P. Duality of Codes Over Non-Unital Rings of Order Four. *IEEE Access* **2023**, *11*, 53120–53133.

5. Deb, S.; Kikani, I.; Gupta, M.K. On the classification of codes over non-unital ring of order 4. *Discret. Math. Algorithms Appl.* **2024**, *16*, 2350076.

6. Kushwaha, A.; Prakash, O. Hulls of Free Linear Codes over a Non-Unital Ring. *arXiv* **2025**, arXiv:2512.12335.

7. Olavides, M.; Roe, Y.G.; Kim, J.-L. Some MDS and ACD codes over commutative non-unital rings of order 4 and 9. Unpublished manuscript, submitted for publication, 24 October 2025. Available online: https://cicagolab.sogang.ac.kr/cicagolab/2638.html.

8. Sagar, V.; Sarma, R. Codes over the non-unital non-commutative ring $E$ using simplicial complexes. *IEEE Trans. Inf. Theory* **2024**, *70*, 3373–3384.

9. Dickson, L.E. On finite algebras. In *Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse; Göttinger Akademie der Wissenschaften*: Göttingen, Germany, 1905; pp. 358–393.

10. Djagba, P.; Prins, A.L. On linear mappings and seed sets of Beidleman near-vector spaces. *Palest. J. Math.* **2025**, *14*, 195–212.

11. Zassenhaus, H. Über endliche Fastkörper. *Abh. Math. Semin. Univ. Hambg.* **1935**, *11*, 187–220.

12. Hughes, D.R.; Piper, F.C. *Projective Planes*; Springer: New York, NY, USA, 1973.

13. Massey, J.L. Linear Codes with Complementary Duals. *Discret. Math.* **1992**, *106–107*, 337–342.

14. Bosma, W.; Cannon, J.; Playoust, C. The magma algebra system I: The user language. *J. Symb. Comput.* **1997**, *24*, 235–265.

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.