---
title: Cartesian Square-Free Codes
url: https://www.emergentmind.com/topics/cartesian-square-free-codes
type: topic
---

# Cartesian Square-Free Codes

Cartesian square-free codes are a class of linear codes constructed by evaluating square-free monomials over Cartesian product subsets of a finite field. These codes generalize affine toric codes and arise naturally in applications using commutative algebraic techniques to analyze their parameters, notably the hierarchy of generalized Hamming weights (GHWs). Their study provides explicit combinatorial and algebraic characterizations for code parameters relevant across algebraic coding theory.

## 1. Algebraic Construction and Definitions

Let $\mathbb{F}_q$ be a finite field of cardinality $q$. Fix nonempty subsets $A_1, A_2, \ldots, A_m \subset \mathbb{F}_q$ and set $S = A_1 \times \cdots \times A_m$, so $|S| = n_1 n_2 \cdots n_m$, where $n_i = |A_i|$. Cartesian square-free codes are defined using square-free monomials $x_1^{\alpha_1} \cdots x_m^{\alpha_m}$ with each exponent $\alpha_i \in \{0,1\}$.

Denote
- $S_d = \{ \alpha \in \{0,1\}^m : |\alpha| = d \}$ for fixed degree $d$,
- $S_{\le d} = \{ \alpha : |\alpha| \le d \}$ for degrees up to $d$.

Define the evaluation map:
$$
\mathrm{ev}_S : \mathbb{F}_q[x_1, \ldots, x_m] \to \mathbb{F}_q^{|S|}, \quad f \mapsto (f(P))_{P \in S}.
$$
The resulting codes are
- $C_d(S) = \operatorname{Span}_{\mathbb{F}_q} \{ \mathrm{ev}_S(x^\alpha) : \alpha \in S_d \}$, homogeneous degree $d$,
- $C_{\le d}(S) = \operatorname{Span}_{\mathbb{F}_q} \{ \mathrm{ev}_S(x^\alpha) : \alpha \in S_{\le d} \}$, degrees up to $d$.

One has $\dim C_d(S) = \binom{m}{d}$ and $\dim C_{\le d}(S) = \sum_{i=0}^d \binom{m}{i}$.

## 2. Generalized Hamming Weights and the Footprint Bound

For a $[n, k]$ code $C \subset \mathbb{F}_q^n$, the $r$-th generalized Hamming weight (GHW) is the minimum cardinality of the support among all $r$-dimensional subspaces $D \leq C$:
$$
d_r(C) := \min \{ |\operatorname{Supp}(D)| : D \leq C,\, \dim D = r \}
$$
with $\operatorname{Supp}(D) = \bigcup_{c \in D} \{ i : c_i \neq 0 \}$.

Wei’s monotonicity asserts $1 \leq d_1(C) < d_2(C) < \cdots < d_k(C) \leq n$, and duality covers the spectrum $\{ d_r(C)\} \cup \{ n + 1 – d_s(C^\perp)\}$ for $1 \leq r \leq k$, $1 \leq s \leq n - k$.

The footprint bound, adapted for these codes, arises from commutative algebra: Picking a monomial order and considering the ideal $I(S)$ of polynomials vanishing on $S$, the footprint $\Delta(I)$ is the set of monomials not in the initial ideal. For $N = \{M_1, \ldots, M_r\}$, the shadow is the set of monomials divisible by some $M_i$ not in $\mathrm{in}(I(S))$. The key technical result is that for Cartesian square-free codes the footprint bound is sharp, permitting exact computation of GHWs using combinatorics [2511.08304].

## 3. Explicit Formulas for Weight Hierarchy

Assume $2 \leq n_1 \leq n_2 \leq \cdots \leq n_m$ and $1 \leq d \leq m$, $1 \leq r \leq m + 1 - d$, with $n = \prod_{i=1}^m n_i$.

The main formula for the $r$-th GHW of $C_d(S)$ is:
$$
d_r(C_d(S)) = \Bigg( \prod_{i=1}^{d-1} (n_i - 1) \Bigg) \Big[ \prod_{i=d}^{d+r-1} n_i - 1 \Big] \prod_{i=d+r}^m n_i
$$
For the nested codes $C_{\leq d}(S)$,
$$
d_r(C_{\leq d}(S)) = \prod_{i=1}^{d-1} (n_i-1) \cdot \left( \prod_{i=d}^{d+r-1} n_i -1 \right) \prod_{i=d+r}^m n_i
$$
This formula arises by minimization over shadow sets of $r$ square-free monomials, with the minimal pattern given as $N_0 = \{ x_1 \cdots x_{d-1} x_d,\, x_1 \cdots x_{d-1} x_{d+1},\, \ldots \}$ [2511.08304]. The exact sharpness is proven for these decreasing (i.e., square-free) evaluation codes.

## 4. Extension to Affine Torus and Dual Codes

The affine torus in the context of square-free codes is $T = (\mathbb{F}_q^*)^s$, ensuring all evaluations avoid zero denominators. In this algebraic setting,
- The code $C_{\leq d}$, constructed from square-free monomials of degree up to $d$, has $\dim C_{\leq d} = \sum_{k=0}^d \binom{s}{k}$ and code length $n = (q-1)^s$.
- Bounds on the number of common zeros of $r$ linearly independent $f_1, \dots, f_r \in V_{\le d}$ in $T$ are sharply bounded by [2002.10920]:
$$
|Z| \leq (q-1)^s - (q-2)^{d-1} (q-1)^{s-d-r+1} \Big[ (q-1)^r - 1 \Big]
$$
Weight hierarchy results follow as
$$
d_r(C_{\leq d}) = (q-2)^{d-1}(q-1)^{s-d-r+1} \left[ (q-1)^r -1 \right], \quad d+r-2 < s
$$
The Euclidean dual code $C_{\leq d}^\perp$ is described by the complementary set of exponent vectors:
$$
C_{\leq d}^\perp = \mathrm{ev}_T \left( \operatorname{Span}_{\mathbb{F}_q} \{ t_1^{a_1} \cdots t_s^{a_s} : (a_1, \dots, a_s) \in A' \} \right)
$$
where $A' = \{0, 1, \dots, q-2 \}^s \setminus A_{\leq d}$. Dimension sums confirm orthogonality: $\dim C_{\leq d} + \dim C_{\leq d}^\perp = (q-1)^s$ [2002.10920].

## 5. Projective Evaluation Codes and Toric Hypersimplices

Cartesian square-free codes admit an extension to projective space. Given $\mathbb{P}^m(\mathbb{F}_q)$, the code $C_d(\mathbb{P}^m)$ spans the evaluations of all square-free monomials of homogeneous degree $d$ on representative points. There is a monomial equivalence between projective and affine evaluation codes:
$$
C_d(\mathbb{P}^m) \simeq (1 : \xi^d : \xi^{2d} : \ldots : \xi^{d(q-2)}) \otimes C_d(\mathbb{A}^m \setminus \{ 0 \})
$$
yielding $d_r(C_d(\mathbb{P}^m)) = (q-1) \cdot d_r(C_d(\mathbb{A}^m \setminus \{ 0 \}))$. The explicit formula becomes
$$
d_r(C_d(\mathbb{P}^m)) = (q-1)^d q^{m-d-r+1} (q^r - 1)
$$
For nested degree codes:
$$
d_r = (q-1)^{d-1} q^{m-d-r+2}(q^r-1)
$$
Projective square-free codes coincide with dehomogenizations of toric codes on hypersimplices, preserving all minimum-distance and weight-hierarchy properties [2511.08304][2002.10920].

## 6. Examples and Computational Verification

- **Binary Cartesian Cube ($m=3$, $A_i = \{0, 1\}$, $d=1$):** $S=\{0,1\}^3$, $n=8$, code $C_1(S) = \operatorname{span}\{x_1,x_2,x_3\}$ is $[8,3]$, with $d_1=4$, $d_2=6$, $d_3=7$.
- **Ternary Cube ($m=3$, $A_i=\{0,1,2\}$, $d=2$):** $n=27$, $C_2(S) = \operatorname{span}\{x_1x_2,x_1x_3,x_2x_3\}$ is $[27,3]$, with $d_1=12$, $d_2=16$, for allowed $r$.

These computations validate the closed-form formulas and demonstrate that the sharp footprint bound leads to exact hierarchy calculation in both affine and projective settings [2511.08304].

## 7. Connections, Implications, and Future Perspectives

Cartesian square-free codes integrate commutative algebra (initial ideals, footprints, shadow sets) into the combinatorial determination of code parameters. The translation of bounds and weight formulas to projective cases and toric hypersimplices facilitates interplay with geometric coding schemes. The explicit weight hierarchy provided by sharp footprint bounds extends the toolkit for evaluating code performance in applications requiring precise support guarantees and dual code computation.

A plausible implication is the broad transferability of these results to other monomial evaluation codes with similar combinatorial structure, pending suitable adaptations of the underlying algebraic machinery. This suggests rich further study in Gröbner basis theory and algebraic geometry applied to the family of evaluation codes over structured finite sets.

Key references include [2511.08304] for the full Cartesian code framework and sharp GHW formulas, and [2002.10920] for affine torus, dual code description, and ties to hypersimplex toric codes. These results establish foundational methodology for square-free code analysis in both affine and projective contexts.

Source: https://www.emergentmind.com/topics/cartesian-square-free-codes