---
abstract: 'Let $X$ be a complete simplicial toric variety over a finite field ${\mathbb F}_q$ with homogeneous coordinate ring $S={\mathbb F}_q[x_1,\dots,x_r]$ and split torus $T_X\cong ({\mathbb F}^*_q)^n$. We prove that vanishing ideal of a subset $Y$ of the torus $T_X$ is a lattice ideal if and only if $Y$ is a subgroup. We show that these subgroups are exactly those subsets that are parameterized by Laurents monomials. We give an algorithm for determining this parametrization if the subgroup is the zero locus of a lattice ideal in the torus. We also show that vanishing ideals of subgroups of $T_X$ are radical homogeneous lattice ideals of dimension $r-n$. We identify the lattice corresponding to a degenerate torus in $X$ and completely characterize when its lattice ideal is a complete intersection. We compute dimension and length of some generalized toric codes defined on these degenerate tori.'
address: 'Department of Mathematics, Hacettepe University, Ankara,TURKEY'
author:
- Mesut ŞAHİN
title: Toric Codes and Lattice Ideals
---

[^1]

Introduction
============

Let $X$ be a complete simplicial toric variety over a field ${{\mathbb K}}$, corresponding to a fan ${\Sigma}\subset {\mathbb R}^n$ and let $T_X \cong ({{\mathbb K}}^*)^n$ be split which is the case for instance when ${{\mathbb K}}$ is algebraically closed or finite. Denote by $\rho_1,\dots,\rho_r$ the rays in ${\Sigma}$ and $\vv_1,\dots,\vv_r\in {\mathbb Z}^n$ the corresponding primitive lattice vectors generating them. Given a vector $\uu=(u_1,\dots,u_r)$ we use $\mathbf{t}^\uu$ to denote the monomial $\mathbf{t}^\uu=t_1^{u_1}\dots t_r^{u_r}$. Recall the following dual exact sequences: $${\displaystyle}\xymatrix{ \mathfrak{P}: 0  \ar[r] & {\mathbb Z}^n \ar[r]^{\phi} & {\mathbb Z}^r \ar[r]^{{\bb}} & {{\mathcal{A}}}\ar[r]& 0},$$ where $\phi$ is the matrix with rows $\vv_1,\dots,\vv_r$, and $${\displaystyle}\xymatrix{ \mathfrak{P}^*: 1  \ar[r] & G \ar[r]^{i} & ({{\mathbb K}}^*)^r \ar[r]^{\pi} & T_X \ar[r]& 1},$$ where $\pi:(t_1,\dots, t_r)\mapsto [\mathbf{t}^{\uu_1}: \cdots : \mathbf{t}^{\uu_n}],$ with $\uu_1,\dots, \uu_n$ being the columns of $\phi$ and $G={\operatorname{Ker}}(\pi)$.

Let ${\displaystyle}S={{\mathbb K}}[x_1,\dots, x_r]=\bigoplus_{\aa \in {{\mathcal{A}}}} S_{\aa}$ be the homogeneous coordinate or Cox ring of $X$, multigraded by ${{\mathcal{A}}}\cong {\operatorname{Cl}}(X)$ via $\bb_j:=\deg_{{{\mathcal{A}}}}(x_j):=\bb(e_j)$, where $e_j$ is the standart basis element of ${\mathbb Z}^r$ for each $j=1,\dots,r$. The irrelevant ideal is a monomial ideal defined by $B={\langle}x^{\hat{{\sigma}}} ~:~ {\sigma}\in {\Sigma}{\rangle}$, where ${\displaystyle}x^{\hat{{\sigma}}}=\Pi_{\rho_i \notin {\sigma}}^{}x_i$. Thus, $T_X \cong ({{\mathbb K}}^*)^r /G$ and $X\cong ({ {{\mathbb K}}^r}\setminus V(B)) /G$ as a geometric quotient if we additionally assume that the order of the torsion part of the group ${{\mathcal{A}}}$ is coprime to the characteristic of the field ${{\mathbb K}}$, since $G$ will be reductive in this case, see [@Coxhom; @CLSch]. This assumption is satisfied in particular when ${{\mathcal{A}}}$ is free or ${{\mathbb K}}$ has characteristic zero. The homogeneous polynomials of $S$ are supported in the semigroup ${\mathbb N}\bb$ generated by $\bb_1,\dots,\bb_r$, i.e. $\dim_{{{\mathbb K}}}{S}_{\aa}=0$ when $\aa \notin {\mathbb N}\bb$.

Next, we recall evaluation codes defined on subsets $Y=\{[P_1],\dots,[P_N]\}$ of the torus $T_X$. Fix a degree $\aa\in{\mathbb N}\beta$ and a monomial $F_0=\x^{\phi({\mathfra{{\mathbb K}}{m}}_0)+\a} \in S_{\aa}$, where ${\mathfra{{\mathbb K}}{m}}_0\in {\mathbb Z}^n$, $\a$ is any element of ${\mathbb Z}^r$ with $\deg(\a)=\aa$, and $\phi$ as in the exact sequence $\mathfrak{P}$. This defines the [*evaluation map*]{} $$\label{e:evalmap}
\ev_{Y}:S_\aa\to {\mathbb F}_q^N,\quad F\mapsto \left(\frac{F(P_1)}{F_0(P_1)},\dots,\frac{F(P_N)}{F_0(P_N)}\right).$$ The image ${{\mathcal{C}}}_{\aa,Y}=\text{ev}_{Y}(S_\aa)$ is a linear code, called the [*generalized toric code*]{}. The block-length $N$, the dimension $k=\dim_{{\mathbb F}_q}({{\mathcal{C}}}_{\aa,Y})$, and the minimum distance $d=d({{\mathcal{C}}})$ are three basic parameters of ${{\mathcal{C}}}_{\aa,Y}$. Minimum distance is the minimum of the number of nonzero components of nonzero vectors in ${{\mathcal{C}}}_{\aa,Y}$. Toric codes was introduced for the first time by Hansen in [@Ha0; @Ha1] and studied later in [@Jo; @Ru] for the special case of $Y=T_X$. Clearly, the block-length of ${{\mathcal{C}}}_{\aa,Y}$ equals $N=|T_X|=(q-1)^n$ in this case. But it is not known in the general case. An algebraic way to compute the dimension and length of a generalized toric code is given in [@sasop]. This method is based on the observation that the kernel of the evaluation map above is determined by the vanishing ideal of $Y$ defined as follows. For $Y\subset X$, we define the vanishing ideal $I(Y)$ of $Y$ to be the ideal generated by homogeneous polynomials vanishing on $Y$. $I(Y)$ is a [*complete intersection*]{} if it is generated by a regular sequence of homogeneous polynomials $F_1,\dots, F_k\in S$ where $k$ is the height of $I_Y$. When the vanishing ideal $I_Y$ is a complete intersection, bounds on the minimum distance of ${{\mathcal{C}}}_{\aa,Y}$ is provided in [@sop]. There are interesting results about evaluation codes on complete intersections in literature, e.g. [@DRT; @GLSch; @Ha3]. These results motivate studying vanishing ideals of special subsets of the torus $T_X$ and characterize when they are complete intersections.

When the vanishing ideal is a binomial or a lattice ideal it is relatively easier to characterize whether it is a complete intersection, see [@MT] and references therein. In the case that the toric variety $X$ is a projective space over a finite field, there are interesting results relating lattice ideals and subtori of the torus $T_X$. Vanishing ideals of subgroups of $T_X$ parameterised by Laurent monomials are studied in [@RSV] and shown to be homogeneous lattice ideals of dimension $1$. Binomial ideals that are vanishing ideals are characterised in [@TV]. It was also proven that homogeneous lattice ideals of dimension $1$ correspond to subgroups of the torus $T_X$. In [@NPV], these subgroups are identified as being the subgroups of $T_X$ parameterized by Laurent monomials. In the case that the toric variety $X$ is weighted projective space over a finite field, vanishing ideal of the torus itself is shown to be a homogeneous lattice ideal of dimension $1$ in [@DN].

We use some of the main ideas in these works and extend the main results to more general toric varieties over any field in the present paper. In section $2$, we show that a homogeneous binomial ideal gives a submonoid of $T_X$, see Proposition \[p:monoid\] and Corollary \[c:latticemonoid\]. Conversely, we show that vanishing ideals of submonoids of $T_X$ are lattice ideals in Proposition \[p:binom\]. We prove that vanishing ideal of a subset $Y$ of the torus $T_X$ is a lattice ideal if and only if $Y$ is a subgroup, for ${{\mathbb K}}={\mathbb F}_q$, in Theorem \[t:subgpsLattices\]. In section $3$, we focus on finite submonoids of the torus when ${{\mathbb K}}$ is algebraically closed or finite. We show that these submonoids coincide with the submonoids parameterized by Laurent monomials on a finite subgroup of ${{\mathbb K}}^*$, see Theorem \[t:parametrizingsubmonoids\]. We also give an algorithm for parameterizing the submonoid obtained from a homogeneous lattice ideal, when ${{\mathbb K}}={\mathbb F}_q$, see Proposition \[p:parameterisingV\_L\] and Algorithm $1$. In section $4$, we determine the homogeneous lattice defining the vanishing ideals of subtori of $T_X$ called the degenerate tori which are parameterized by diagonal matrices, see Theorem \[t:I(Y\_A)\]. We also characterize when these are complete intersection in Proposition \[p:ci\]. In section $5$, we list main properties of vanishing ideals of arbitrary subsets of the torus $T_X$ and prove that they must be radical homogeneous ideals of dimension $r-n$, see Theorem \[t:primdec\]. Finally, we give quick applications of these on evaluation codes on degenerate tori, see Corollaries \[c:dimcode\] and \[c:lengthcode\].

Lattice Ideals and Submonoids of the Torus {#S:latticeideals}
==========================================

In this section we explore the connection between homogeneous lattice ideals and submonoids of the torus $T_X$.

Recall that $\x^{\uu}:=x_1^{u_1}\dots x_m^{u_m}$ denotes a Laurent monomial for a vector $\uu\in{\mathbb Z}^r$. A binomial is a difference $\x^{\a}-\x^{{\mathbf b}}$ of two monomials corresponding to the vectors $\a,{\mathbf b}\in {\mathbb N}^r$. An ideal is called a *binomial ideal* if it is generated by binomials. An exact sequence $\mathfrak{P}$ gives a grading on the polynomial ring $S={{\mathbb K}}[x_1,\dots,x_r]$, where $\deg_{{{\mathcal{A}}}}(x_j):=\bb_j$ is the $j$-th column of the degree matrix $\bb$. A homogeneous ideal in $S$ with respect to this grading is called ${{\mathcal{A}}}$-graded or ${{\mathcal{A}}}$-homogeneous. We usually just say that it is *homogeneous* if the group ${{\mathcal{A}}}$ is clear from the context.

Throughout $[P]=G \cdot P$ denotes a point in $X$. We use $[1]$ to denote $[1:\cdots:1]$. Similarly, $[V(B)]$ denotes the set of elements $[P]$ suct that $P\in V(B)\subset {{\mathbb K}}^r$. If $[P],[P']\in X$ then $[P]\cdot[P']:=[PP']$ is a well-defined element of $X\cup [V(B)]$. The set $[V(B)]$ does not include $[1]$ but it is closed with respect to this coordinatewise multiplication operation as $x^{\hat{{\sigma}}} (PP')=x^{\hat{{\sigma}}} (P)x^{\hat{{\sigma}}} (P')=0$ when $[P]\in [V(B)]$ or $[P']\in [V(B)]$. Although $X$ might not be closed with respect to this multiplication, $X\cup [V(B)]$ is a monoid with identity $[1]$. Finally, if $Y\subseteq X$ is a submonoid of $X\cup [V(B)]$, then so is $Y\cup [V(B)]$.

For a homogeneous ideal $J$ of $S$, let $$V_X(J):=\{[P]\in X : F(P)=0, \mbox{for all homogeneous}\: F\in J\}.$$

\[p:monoid\] If $J\subset S$ is a homogeneous binomial ideal then $V_X(J)\cup [V(B)]$ is a submonoid of $X\cup [V(B)]$. If furthermore, $PP'\notin V(B)$, for all $[P],[P']\in V_X(J)$, then $V_X(J)$ is a submonoid of $X\cup [V(B)]$. In particular, $V_X(J)\cap T_X$ is a submonoid of $T_X$.

If $0\neq f=\x^{\a}- \x^{{\mathbf b}}$ is a generator of $J$, then $f([1])=1-1=0$. So, $[1]\in V_X(J)$. If $[P],[P']\in V_X(J)$, then $f(P)=f(P')=0$. This implies that $\x^\a(P)=\x^{\mathbf b}(P)$ and $\x^\a(P')=\x^{\mathbf b}(P')$. So, $\x^{\a}(PP')=\x^{\mathbf b}(PP')$ yielding $f(PP')=0$, i.e. $PP'\in V(J)$. Hence $[V(J)]=V_X(J)\cup [V(B)]$ is a submonoid. If furthermore, $PP'\notin V(B)$, for all $[P],[P']\in V_X(J)$, then $[PP']\in V_X(J)$ and thus $V_X(J)$ is a submonoid. When $[P],[P']\in V_X(J)\cap T_X$, we have $PP'\notin V(B)$ and so $[PP']\in V_X(J)\cap T_X$. Therefore, $V_X(J)\cap T_X$ is a submonoid.

A lattice $L$ is a subgroup of ${\mathbb Z}^r$ and is called [**homogeneous**]{} if $L \subseteq L_{\bb}={\operatorname{Ker}}\bb={\operatorname{Im}}\phi$. Recall that every vector in ${\mathbb Z}^r$ is written as ${\mathfra{{\mathbb K}}{m}}={\mathfra{{\mathbb K}}{m}}^+ -{\mathfra{{\mathbb K}}{m}}^-$, where ${\mathfra{{\mathbb K}}{m}}^+ ,{\mathfra{{\mathbb K}}{m}}^-\in {\mathbb N}^r$. Letting $F_{\mathfra{{\mathbb K}}{m}}=\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}^-} $, the **lattice ideal** $I_L$ is the binomial ideal $I_L=\langle F_{\mathfra{{\mathbb K}}{m}}\: | \: {\mathfra{{\mathbb K}}{m}}\in L \rangle$ generated by special binomials $F_{\mathfra{{\mathbb K}}{m}}$ arising from $L\subset {\mathbb Z}^r$.

\[p:homogeneouslattice\] $L$ is homogeneous if and only if $I_L$ is homogeneous.

Since $I_L$ is generated by the set $\{F_{\mathfra{{\mathbb K}}{m}}\: | \: {\mathfra{{\mathbb K}}{m}}\in L\}$, it is homogeneous if and only if $F_{\mathfra{{\mathbb K}}{m}}$ is homogeneous for all ${\mathfra{{\mathbb K}}{m}}\in L$. But $F_{\mathfra{{\mathbb K}}{m}}=\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}^-} $ is homogeneous $\iff \bb({\mathfra{{\mathbb K}}{m}}^+)=\bb({\mathfra{{\mathbb K}}{m}}^+)$ $\iff \bb({\mathfra{{\mathbb K}}{m}})=0$ $\iff {\mathfra{{\mathbb K}}{m}}\in L_{\bb}$. Thus, $I_L$ is homogeneous if and only if ${\mathfra{{\mathbb K}}{m}}\in L_{\bb}$ for all ${\mathfra{{\mathbb K}}{m}}\in L$, that is, $L$ is homogeneous.

\[c:latticemonoid\] If $L$ is homogeneous, $V_X(I_L)\cap T_X$ is a submonoid of $T_X$.

This follows from Propositions \[p:monoid\] and \[p:homogeneouslattice\].

\[D:VanIdeal\] For $Y\subseteq X$, we define the vanishing ideal $I(Y)$ of $Y$ to be the ideal generated by homogeneous polynomials vanishing on $Y$.

\[p:binom\] Let $Y \subseteq X$. If $Y$ is a submonoid of $X\cup [V(B)]$, then $I(Y)$ is a binomial ideal. If $Y \subseteq T_X$ is a submonoid, $I(Y)$ is a lattice ideal.

If $Y$ is a submonoid of $X\cup [V(B)]$, the set $\mathcal{Y}=\{P\in {{\mathbb K}}^r \:|\: [P]\in Y\}$ is a submonoid of ${{\mathbb K}}^r$. Take a homogeneous polynomial $f=\lambda_1 \x^{\a_1}+\cdots+\lambda_k \x^{\a_k}$ from $ I(Y)$ with exactly $k$ terms. As $[1]\in Y$, $f$ can not be a monomial, i.e. $k>1$. Since monomials are characters from $\mathcal{Y}$ to the multiplicative monoid $({{\mathbb K}},.,1)$, it follows from Dedekind’s Theorem that the monomials of $f$ can not be distinct characters as in the proof of [@TV Theorem 3.2]. If, say, $\x^{\a_1}$ and $\x^{\a_2}$ are the same as characters, then $\x^{\a_1}-\x^{\a_2}\in I(Y)$. Thus $f-\lambda_1(\x^{\a_1}-\x^{\a_2})$ lies in $I(Y)$ and has exactly $k-1$ terms. By induction on $k$, $f$ must be written as an algebraic combination of binomials, and hence $I(Y)$ is a binomial ideal. For the second part, take a polynomial $f$ of $S$ such that $x_jf\in I(Y)$ for any $j=1,\dots,r$. By [@binomial Corollary 2.5], it is enough to show that $f\in I(Y)$. Let $f=\bigoplus\limits_{\alpha\in {{\mathbb N}\beta}}f_\alpha$ be the expansion of $f$ as the sum of its homogeneous components where $f_\alpha$ has total degree $\alpha$. Then $x_j{f}=\bigoplus\limits _{\alpha\in {{\mathbb N}\beta}}x_j{f_\alpha}$ and $x_j{f_\alpha}$ is homogeneous of total degree $\alpha+ \beta_j$. As $I(Y)$ is a homogeneous ideal, $x_j{f_\alpha}\in I(Y)$. So, $(x_jf_\alpha)(P)=p_jf_{\alpha}(P)=0$ for any element $[P] \in Y$. Since $P\in({{\mathbb K}}^*)^r$, $p_j\neq 0$, and so $f_{\alpha}(P)=0$. This yields that $f_\alpha\in I(Y)$ for all $\alpha$, consequently $f\in I(Y)$ completing the proof.

It is not clear if the hypothesis of Proposition \[p:binom\] can be replaced with the weaker hypothesis that $Y\cup [V(B)]$ is a submonoid of $X \cup [V(B)]$. When $X$ is a projective space or weighted projective space $V(B)=\{0\}$, so this can be done using the fact that if $f\in I(Y)$ is a homogeneous polynomial then it also vanishes on $V(B)$. See [@TV Theorem 3.2] for the case of projective space.

\[L:Zariski\]We have the following basic properties.

1.  $\emptyset=V_X(1)$ and $X=V_X(0)$.\

2.  $V_X(J_1)\cup V_X(J_2)=V_X(J_1J_2)$ and $\displaystyle \bigcap_{i} V_X(J_i)=V_X(\bigcup_i J_i)$.\

3.  $Y_1\subseteq Y_2 \implies I(Y_2)\subseteq I(Y_1)$ .\

4.  $J_1\subseteq J_2 \implies V_X(J_2)\subseteq V_X(J_1)$.\

5.  If $\bar{Y}$ is the Zariski closure of $Y$, then $ I(Y)= I(\bar{Y})$ .\

6.  $\bar{Y}= V_X(I(Y))$.\

These can be proven using the fact that homogeneous ideals are generated by homogeneous polynomials. For instance, if $[P]\in V_X(J_1J_2)\setminus V_X(J_1)$, then it suffices to show that $G(P)=0$ for every homogeneous $G\in J_2$. Since, there is some homogeneous $F\in J_1$ with $F(P)\neq 0$ and $F(P)G(P)=0$, this follows at once. So, $V_X(J_1J_2) \subseteq V_X(J_1)\cup V_X(J_2)$. The rest is either similar or obvious.

We define Zariski topology on $X$ by taking closed sets to be the zero loci $V_X(J)$ for homogeneous ideals $J$.

We close this section with establishing the following correspondence.

\[t:subgpsLattices\]Let $Y \subseteq T_X$ and ${{\mathbb K}}={\mathbb F}_q$. Then, $I(Y)$ is a lattice ideal if and only if $Y$ is a subgroup.

If $I(Y)$ is a lattice ideal then $V_X(I(Y))\cap T_X$ is a submonoid of $T_X$ by Proposition \[p:monoid\]. Since $V_X(I(Y))=\bar{Y}=Y$ lies in $T_X$ and ${{\mathbb K}}$ is finite $Y$ is a subgroup. The converse follows directly from Proposition \[p:binom\].

Finite submonoids of the torus
==============================

In this section we completely characterize finite submonoids of the torus $T_X$ when ${{\mathbb K}}$ is a finite field or an algebraically closed field by showing that they are exactly those that are parameterized by Laurent monomials. This was done when $X$ is a projective space over a finite field by [@NPV] and over an algebraically closed field by [@TV]. We give an algorithm producing these monomials when ${{\mathbb K}}$ is a finite field and the submonoid corresponds to a homogeneous lattice ideal.

Let $H$ be a subset of ${{\mathbb K}}^*$ and $Q$ be an $s\times r$ integer matrix with entries $q_{ij}$. Then the parameterized set corresponding to $Q$ and $H$ is defined as follows: $$Y_{Q,H}=\{[t_1^{q_{11}}\cdots t_s^{q_{s1}}:\cdots :t_1^{q_{1r}}\cdots t_s^{q_{sr}}]: t_1,\dots,t_s \in H\}.$$

\[t:parametrizingsubmonoids\] Let ${{\mathbb K}}$ be a finite field or an algebraically closed field. Then the following are equivalent:

1.  $Y$ is a **finite** submonoid of $T_X$.\

2.  $Y =Y_{Q,H}$ for a **finite** submonoid $H$ of ${{\mathbb K}}^*$.

Suppose that $(1)$ holds. In this case $Y$ is a finite subgroup as being a finite sumbonoid of a group. Thus $Y$ is a product ${\langle}[P_1] {\rangle}\times\cdots \times \langle [P_s] \rangle$ of cyclic subgroups generated by points $[P_1],\dots, [P_s]\in Y$ of orders, say, $c_1,\dots,c_s$. In this case, for every $i=1,\dots,s$, we have $[P_i]^{c_i}=[1]=G$. If ${{\mathbb K}}$ is finite, we define $H$ to be the subgroup generated by the coordinates $p_{ij}$ of $P_1,\dots, P_s$. Then $H$ is a finite subgroup of ${{\mathbb K}}^*$. If ${{\mathbb K}}$ is algebraically closed, then we define $H$ to be the subgroup generated by all $x\in {{\mathbb K}}$ such that $x^{c_i}=1$, for some $i=1,\dots,s$. We show that $H$ is non-empty. Since $(1,\dots,1)\in G=[P_i^{c_i}]$ and $G$ is parameterized by the columns of $\bb$, it follows that $(1,\dots,1)=(\mathbf{t}^{\bb_1}p_{i1}^{c_i},\dots,\mathbf{t}^{\bb_r}p_{ir}^{c_i})$. So, $\mathbf{t}^{\bb_j}p_{ij}^{c_i}=1$, for all $j=1,\dots,r$. Let ${\mu}_{jk}\in {{\mathbb K}}^*$ be such that ${\mu}_{jk}^{c_i}=t_k$, for $j=1,\dots,r$ and $k=1,\dots,r-n$. This leads to $\mu_j^{c_i\bb_j}=\mathbf{t}^{\bb_j}$, where $\mu_j=({\mu}_{i1},\dots,{\mu}_{ik})$. Thus, we have $(\mu_j^{\bb_j}p_{ij})^{c_i}=1$, for all $j=1,\dots,r$. If $p'_{ij}=\mu_j^{\bb_j}p_{ij}$, then $p'_{ij}\in H$ and $[P'_i]=[P_i]$. In order to unify the rest of the proof for both cases that ${{\mathbb K}}$ is finite and algebraically closed, by abusing the notation, let us assume that $p_{ij}\in H$. This implies that $H$ is a non-empty finite subgroup of ${{\mathbb K}}$. Since ${{\mathbb K}}$ is a field and $H$ is finite, $H$ must be cyclic, i.e., $H={\langle}\eta {\rangle}$, for some $\eta\in {{\mathbb K}}^*$. Then $p_{ij}=\eta^{q_{ij}}$ for some $q_{ij}$. Let $Q$ be the $s\times r$ integer matrix with entries $q_{ij}$ and let $$Y_{Q,H}=\{[t_1^{q_{11}}\cdots t_s^{q_{s1}}:\cdots :t_1^{q_{1r}}\cdots t_s^{q_{sr}}]: t_1,\dots,t_s \in H\}.$$

Then $$\begin{array}{lcl}
[P]\in Y &\iff& [P]=[P_1]^{i_1}\cdots[P_s]^{i_s}=[p_{11}^{i_1}\cdots p_{s1}^{i_s}:\dots:p_{1r}^{i_1}\cdots p_{sr}^{i_s}]\\
&\iff&[P]=[\eta^{i_1q_{11}}\cdots \eta^{i_sq_{s1}}:\dots:\eta^{i_1q_{1r}}\cdots \eta^{i_sq_{sr}}]
\end{array}$$ Since $t_j\in H \iff t_j=\mu^{i_j}$, for all $j=1,\dots,s$, it follows that $[P]\in Y \iff [P]\in Y_{Q,H}$. Therefore, $(2)$ holds.

Suppose now that $(2)$ holds. Then, taking $t_i=1\in H$, for all $i=1,\dots,s$, we see that $[1]\in Y$. The product of two elements $[P]=[t_1^{q_{11}}\cdots t_s^{q_{s1}}:\cdots :t_1^{q_{1r}}\cdots t_s^{q_{sr}}]$ and $[P']= [{t'}_1^{q_{11}}\cdots {t'}_s^{q_{s1}}:\cdots :{t'}_1^{q_{1r}}\cdots {t'}_s^{q_{sr}}]$ of $Y$ lies in $Y$ since $t_it'_i\in H$ and $$[P][P']=[(t_1 {t'}_1)^{q_{11}}\cdots (t_s {t'}_s)^{q_{s1}}:\cdots :(t_1 {t'}_1)^{q_{1r}}\cdots (t_s {t'}_s)^{q_{sr}}].$$ Therefore, $(1)$ holds, as $Y$ is finite whenever $H$ is so.

\[l:varietyoflattice\] If $L$ is a homogeneous lattice with basis $\mathbf b_1,\dots,\mathbf b_{\ell}$ then $$V_X(I_L)\cap T_X=\bigcap_{i=1}^{\ell} V_X(F_{{\mathbf b}_i})\cap T_X.$$

Take a point $[P]$ from the intersection $\bigcap_{i=1}^{\ell} V_X(F_{{\mathbf b}_i})\cap T_X$. Then, $F_{{\mathbf b}_i}(P)=\x^{{{\mathbf b}_i}^+}(P)-\x^{{{\mathbf b}_i}^-}(P)=0$, for all $i=1,\dots,\ell$. Since $[P]\in T_X$, its coordinates are not zero, and thus $\x^{{\mathbf b}_i}(P)=1$, for all $i=1,\dots,\ell$. As we have ${\mathfra{{\mathbb K}}{m}}=c_1{\mathbf b}_1+\cdots+c_{\ell}{\mathbf b}_{\ell}$, for any ${\mathfra{{\mathbb K}}{m}}\in L$, it follows that $\x^{{\mathfra{{\mathbb K}}{m}}}(P)=1$. So, $F_{\mathfra{{\mathbb K}}{m}}(P)=0$, for any ${\mathfra{{\mathbb K}}{m}}\in L$. Hence, $[P]\in V_X(I_L)\cap T_X$. The other inclusion is straightforward.

For finite fields Theorem \[t:parametrizingsubmonoids\] has a more precise form given below.

\[p:parameterisingV\_L\] Let ${{\mathbb K}}={\mathbb F}_q$ be a finite field. Let $L\subset {\mathbb Z}^r$ be a homogeneous lattice of rank $\ell$ with basis vectors $\mathbf b_1,\dots,\mathbf b_{\ell}$ and $B_L$ be a matrix with rows of the form $[\mathbf b_j \; \mathbf (q-1) \mathbf e_j]$ where $\mathbf e_j$ is the standard basis vector of ${\mathbb Z}^{\ell}$. If $A_L$ is an integer matrix of size $(r+\ell)\times r$ such that ${\operatorname{Ker}}(B_L)={\operatorname{Im}}(A_L)$, and $A=[a_{ij}]$ is an $r \times r$ matrix consisting of the first $r$ rows of $A_L$, then $V_X(I_L)\cap T_X=Y_{A,{{\mathbb K}}^*}$.

Since ${{\mathbb K}}$ is a finite field, ${{\mathbb K}}^*={\langle}\eta {\rangle}$ is cyclic, and so every point in $T_X$ is of the form $[P]=[\eta^{s_1}:\cdots:\eta^{s_r}]$ for some $\mathbf s=(s_1,\dots,s_r)\in {\mathbb N}^r$. Then, by Lemma \[l:varietyoflattice\], we have $[P]\in V_X(I_L)$ if and only if $F_{{\mathbf b}_j}(P)=0$ for all $j=1,\dots,\ell$. This is equivalent to $\eta^{\mathbf s\cdot {\mathbf b}_j}=1$ for all $j=1,\dots,\ell$. Since the order of $\eta $ is $q-1$ the latter is equivalent to $\mathbf s\cdot \mathbf b_j \cong 0 \mod q-1$ for all $j=1,\dots,\ell$. This can be turned into a system of linear equations as $\mathbf s\cdot \mathbf b_j \cong 0 \mod q-1$ if and only if $\mathbf s\cdot \mathbf b_j =(q-1) c_j$ for some $c_j \in {\mathbb Z}$: $$\begin{array}{lcl}
 s_1b_{11}+\cdots+s_rb_{1r}-(q-1)c_1&=&0\\
 &\vdots&\\
  s_1b_{\ell 1}+\cdots+s_rb_{\ell r}-(q-1)c_{\ell}&=&0.
\end{array}$$ Then $B_L$ is the matrix of this system. Thus, $\mathbf s\in {\mathbb Z}^r$ is a common solution of the equations $\mathbf s\cdot \mathbf b_j \cong 0 \mod q-1$ for all $j=1,\dots,\ell$ if and only if $(\mathbf s,\mathbf c)\in {\operatorname{Ker}}(B_L)\cap {\mathbb Z}^{r+\ell}$ for some $\mathbf c=(c_1,\dots,c_{\ell}) \in {\mathbb Z}^{\ell}$. If $A_L$ is an integer matrix of size $(r+\ell)\times r$ such that ${\operatorname{Ker}}(B_L)={\operatorname{Im}}(A_L)$, then the last condition means that there is some $(\lambda_1,\dots,\lambda_{r})\in {\mathbb Z}^{r}$ with $(\mathbf s,\mathbf c)=A_L(\lambda_1,\dots,\lambda_r)$. If $A=[a_{ij}]$ is an $r \times r$ matrix consisting of the first $r$ rows of $A_L$, we have $[P]\in V_X(I_L)$ if and only if $(s_1,\dots,s_{r})=A(\lambda_1,\dots,\lambda_{r})$. In this case, $s_i=a_{i1}\lambda_1+\cdots+a_{ir}\lambda_{r}$ and hence $\eta^{s_i}=(\eta^{\lambda_1})^{a_{i1}}\cdots (\eta^{\lambda_r})^{a_{ir}}$, for all $i=1,\dots,r$. Letting $t_j=\eta^{\lambda_j}$ for any $j=1,\dots,r$, we conclude that $[P]\in V_X(I_L)$ if and only if $[P]=[t_1^{a_{11}}\cdots t_r^{a_{1r}}:\cdots :t_1^{a_{r1}}\cdots t_r^{a_{rr}}]$. So, if $[P]\in V_X(I_L)\cap T_X$ then $[P]\in Y_{A,{{\mathbb K}}^*}$ by above. Converse is straightforward since any $t_j\in {{\mathbb K}}^*$ is of the form $\eta^{\lambda_j}$ for $j=1,\dots,r$.

\[a:algorithm\]

**Input** A matrix L whose rows constitute a basis for a lattice $L\subset {\mathbb Z}^r$,\
**Output** A matrix $A$ parameterizing $V_X(I_L)\cap T_X$.

Form the matrix $B_L$ adding to L an identity matrix of size rank L. Find a matrix $A_L$ with ${\operatorname{Ker}}(B_L)={\operatorname{Im}}(A_L)$ Choose the first $r$ rows of $A_L$

The following will illustrate how to run this algorithm in Macaulay$2$.

\[ex:H2param\] Let $X={\mathcal{H}}_{2}$ be the Hirzebruch surface whose rays are generated by $\vv_1=(1,0)$, $\vv_2=(0,1)$, $\vv_3=(-1,2)$, and $\vv_4=(0,-1)$. Thus we have the short exact sequence $${\displaystyle}\xymatrix{ \mathfrak{P}: 0  \ar[r] & {\mathbb Z}^2 \ar[r]^{\phi} & {\mathbb Z}^4 \ar[r]^{\bb}& {\mathbb Z}^2 \ar[r]& 0},$$ where $$\phi=\begin{bmatrix}
    1 & 0 & -1& ~~0 \\
    0 & 1 & ~~~2& -1
    \end{bmatrix}^T   \quad  \mbox{ and} \quad \bb=\begin{bmatrix}
    1 & -2 & 1& 0 \\
    0 & ~~~1 & 0&1  
    \end{bmatrix}.$$ This shows that the class group is ${{\mathcal{A}}}={\mathbb Z}^2$ and the total coordinate ring is $S=K[x_1,x_2,x_3,x_4]$ where $$\deg_{{{\mathcal{A}}}}(x_1)=\deg_{{{\mathcal{A}}}}(x_3)=(1,0), \deg_{{{\mathcal{A}}}}(x_2)=(-2,1), \deg_{{{\mathcal{A}}}}(x_4)=(0,1).$$

We illustrate Proposition \[p:parameterisingV\_L\] taking $L\subset {\mathbb Z}^4$ to be the lattice generated by the rows of the matrix L below.

    q=11;
    beta = matrix {{1, -2, 1, 0}, {0, 1, 0, 1}};
    L=matrix {{10,0,-10,0},{0,5,10,-5}};
    beta*transpose L--L is homogeneous as this is zero
    r=numColumns L;
    l=numRows L;
    BL=L|(q-1)*id_(ZZ^l)
    O = matrix mutableMatrix(ZZ,r,l)--zero matrix
    A=transpose ((id_(ZZ^r)| O)*gens ker BL)

    o1 = |  0  1  0  1 |
         |  1  0  0  0 |
         |  0  2 -1  0 |
         | -1  0 -1  0 | 

In this example the zero set $V_X(I_L)$ of the lattice ideal $I_L={\langle}x_1^{10}-x_3^{10}, x_2^{5}x_3^{10}-x_4^{5} {\rangle}$ does lie in the torus, as $V(I_L)\setminus ({\mathbb F}_q^*)^4 \subset V(B)=V(x_1,x_3)\cup V(x_2,x_4)$. Therefore, $V_X(I_L)=Y_{A,{\mathbb F}_{11}^*}$.

We also consider the following typical singular example.

\[ex:1113param\] Let $X=P(1,1,1,3)$ be the weighted projective surface with homogeneous coordinate ring $S={{\mathbb K}}[x_1,x_2,x_3,x_4]$ where $\deg_{{{\mathcal{A}}}}(x_1)=\deg_{{{\mathcal{A}}}}(x_2)=\deg_{{{\mathcal{A}}}}(x_3)=1$, $\deg_{{{\mathcal{A}}}}(x_4)=3$. The same lattice is homogeneous here as in the previous example.

    q=11;
    beta = matrix {{1,1,1,3}};
    Phi=gens ker beta

    o1 =  |  1  -1   0  |
          | -1   0   3  |
          |  0   1   0  |
          |  0   0  -1  |
    L=matrix {{10,0,-10,0},{0,5,10,-5}};
    beta*transpose L--L is homogeneous as this is zero
    r=numColumns L;
    l=numRows L;
    BL=L|(q-1)*id_(ZZ^l)
    O = matrix mutableMatrix(ZZ,r,l)--zero matrix
    A=transpose ((id_(ZZ^r)| O)*gens ker BL)

    o1 = |  0  1  0  1 |
         |  1  0  0  0 |
         |  0  2 -1  0 |
         | -1  0 -1  0 |

Thus we have the short exact sequence $${\displaystyle}\xymatrix{ \mathfrak{P}: 0  \ar[r] & {\mathbb Z}^3 \ar[r]^{\phi} & {\mathbb Z}^4 \ar[r]^{\bb}& {\mathbb Z}\ar[r]& 0},$$ where $$\phi=\begin{bmatrix}
    ~~1 & -1 & ~~0& ~~0 \\
    -1 & ~~0 & ~~1& ~~0 \\
    ~~0 & ~~3 & ~~0& -1
    \end{bmatrix}^T   \quad  \mbox{ and} \quad \bb=\begin{bmatrix}
    1 & 1 & 1& 3 \\  
    \end{bmatrix}.$$ In this example the zero set $V_X(I_L)$ of the lattice ideal does not lie in the torus. But if we add to $L$ the subgroup generated by the vector $(0,10,-10,0)$ and denote by $L'$ the new lattice we obtain, then it follows that $V_X(I_{L'})=V_X(I_L)\cap T_X=Y_{A,{\mathbb F}_{11}^*}$.

We close this section with the following observation.

If ${{\mathbb K}}={\mathbb F}_q$, then $Y_{Q,H}=Y_{A,{{\mathbb K}}^*}$ for some square integer matrix $A$.

Let $I_L=I(Y_{Q,H})$ be the lattice ideal of $Y_{Q,H}\subseteq T_X$. Then, by Proposition \[p:parameterisingV\_L\], there is a square integer matrix $A$ such that $V_X(I_L)\cap T_X=Y_{A,{{\mathbb K}}^*}$. Since $Y_{Q,H}=V_X(I_L)$ by Lemma \[L:Zariski\], the claim follows.

Degenerate Tori
===============

In this section, we focus on finite submonoids of the torus $T_X$ which are parameterized by diagonal matrices.

If $H={\langle}\eta {\rangle}$ is a finite submonoid of ${{\mathbb K}}^*$, then the finite submonoid $Y_{A,H} =\{[t_1^{a_1}:\cdots:t_r^{a_r}] \: : \: t_i \in H \}$ of the torus $T_X$ is called a [**degenerate torus**]{}.

Since $H={\langle}\eta {\rangle}$, every $t_i \in H$ is of the form $t_i=\eta^{s_i}$, for some $0 \leq s_i \leq h-1$, where $h=| \eta |$ is the order of $\eta$. Let $d_i=| \eta^{a_i} |$ and $D=diag(d_1,\dots,d_r)$.

\[p:degY\] If $d_1,\dots,d_r$ are coprime to each other then $Y_{A,H}$ is a cyclic group of order $d_1 \cdots d_r$.

Let $[P_i]=[1:\cdots:\eta^{a_i}:\cdots:1]$, for $i=1,\dots,r$. If $[P_i]^{s_i}=[1]$, then $(1,\dots,1,\eta^{a_is_i},1,\dots,1)\in G$. Since $G={\operatorname{Ker}}\pi$, it follows that $\x^{\uu_1}=\cdots=\x^{\uu_n}=1$ at $[P_i]$. So, $\eta^{a_is_iu_{1i}}=\cdots=\eta^{a_is_iu_{ni}}=1$. Since $\vv_i=(u_{1i},\dots,u_{ni})$ is a primitive ray generator, the greatest common divisor of its coordinates is $1$. Thus, $d_i$ divides $s_i$ as $d_i=| \eta^{a_i} |$. This means the point $[P_i]$ generates a cyclic group of order $d_i$, for all $i=1,\dots,r$.

On the other hand, every element $[t_1^{a_1}:\cdots:t_r^{a_r}]$ is a product $[P_1]^{s_1}\cdots [P_r]^{s_r}$ of powers of the points $[P_1], \dots [P_r]$, as $t_i=\eta^{s_i}$, for all $i=1,\dots,r$. This shows that $Y$ is a product of cyclic subgroups generated by $[P_1],\dots, [P_r]$. Under the hypothesis, this product becomes a direct product, completing the proof.

When $X=\mathbb{P}^{r-1}$, $H={\mathbb F}_q^*$, and $\gcd(d_1,\dots,d_r)=1$, the order of $Y_{A,H}$ is $d_1 \cdots d_r$ by [@LVZ]. This does not hold in general, as the following example illustrates.

\[ex:notcyclic\] Take $X={\mathcal{H}}_{2}$ to be the Hirzebruch surface over ${\mathbb F}_{11}$ and consider $(a_1,a_2,a_3,a_4)=(2,5,4,5)$. Then, we have $(d_1,d_2,d_3,d_4)=(5,2,5,2)$ and $\gcd(d_1,d_2,d_3,d_4)=1$. In this case $G$ has points of the form $(g_1,g_2,g_1,g_1^2g_2)$ for $g_1,g_2 \in {{\mathbb K}}^*$. Denote by $C_i$ the cyclic subgroup generated by $[P_i]$, for $i=1,2,3,4$. One can check that $C_1\cap C_3=[1]$, so $C_1C_3=C_1 \times C_3$. Since the orders $25$ of $C_1C_3$ and $2$ of $C_2$ are relatively prime, it follows that $C_1C_2C_3=C_1 \times C_2\times C_3$ having order $50$. Now, $C_4$ is a subgroup of $C_1C_2C_3$, since $[P_4]=[P_2]$ via $(1,1,1,\eta^{5})=(1,\eta^{5},1,\eta^{5})(1,\eta^{5},1,1)$. Hence, $Y_{A,H}=C_1C_2C_3C_4=C_1C_2C_3$ have order $50$.

On the other hand, if we take $(a_1,a_2,a_3,a_4)=(5,2,5,4)$, then $(d_1,d_2,d_3,d_4)=(2,5,2,5)$ and $\gcd(d_1,d_2,d_3,d_4)=1$ as before. We observe that $[P_3]=[P_1]$ and $C_4=C_2$ in this case. So, $Y_{A,H}=C_1C_2C_3C_4=C_1\times C_2$ have order $10$.

As $Y_{A,H}$ is a submonoid of $T_X$, $I(Y_{A,H})$ is a lattice ideal. We are ready to give our first main result specifying the lattice of this ideal. Algorithms for finding general $I(Y)$ are given in [@BaranSahin].

\[t:I(Y\_A)\] If $Y=Y_{A,H}$ then $I(Y)=I_L$ for $L=D(L_{\beta D})$.

Take a generator $F_{\mathfra{{\mathbb K}}{m}}=\x^{{\mathfra{{\mathbb K}}{m}}^{+}}-\x^{{\mathfra{{\mathbb K}}{m}}^{-}} $ of $I(Y_{A,H})$. Since $F_{\mathfra{{\mathbb K}}{m}}$ homogeneous, ${\mathfra{{\mathbb K}}{m}}\in L_{\bb}$ and $F_{{\mathfra{{\mathbb K}}{m}}}(P)=0$, for all $[P]\in Y_{A,H}$. So, $\x^{{\mathfra{{\mathbb K}}{m}}}(P)=1$, for all $[P]\in Y_{A,H}$. This is true in particular for points having homogeneous coordinates $[1:\cdots:\eta^{a_i}:\cdots:1]$ with $\eta^{a_i}$ in the $i-th$ component. So, $(\eta^{a_i})^{m_i}=1$ yielding $d_i | m_i$, i.e., ${\mathfra{{\mathbb K}}{m}}=D({\mathfra{{\mathbb K}}{m}}')$, for some ${\mathfra{{\mathbb K}}{m}}'\in {\mathbb Z}^r$. As ${\mathfra{{\mathbb K}}{m}}\in L_{\bb}$, we have $\bb D({\mathfra{{\mathbb K}}{m}}')=\bb {\mathfra{{\mathbb K}}{m}}=0$, so ${\mathfra{{\mathbb K}}{m}}'\in L_{\bb D}$. Therefore, ${\mathfra{{\mathbb K}}{m}}\in D(L_{\beta D})=L$ and $F_{\mathfra{{\mathbb K}}{m}}$ is a binomial generator of $I_{L}$.

Conversely, take a binomial generator $F_{\mathfra{{\mathbb K}}{m}}$ of $I_{L}$. Then ${\mathfra{{\mathbb K}}{m}}\in L$, so ${\mathfra{{\mathbb K}}{m}}=D({\mathfra{{\mathbb K}}{m}}')$, for some ${\mathfra{{\mathbb K}}{m}}'\in L_{\bb D}$. Since $\bb {\mathfra{{\mathbb K}}{m}}=\bb D({\mathfra{{\mathbb K}}{m}}')=0$, $F_{\mathfra{{\mathbb K}}{m}}$ is homogeneous. On the other hand, $\x^{{\mathfra{{\mathbb K}}{m}}}([P])=\eta^{a_1s_1m_1}\cdots \eta^{a_rs_rm_r}=1$ , for all $[P]=[\eta^{a_1s_1}:\cdots:\eta^{a_rs_r}] \in Y_{A,H}$, since $m_i=d_im'_i$ and $(\eta^{a_i})^{d_i}=1$ for all $i \in [r]$. Thus, $\x^{{\mathfra{{\mathbb K}}{m}}^{+}}([P])=\x^{{\mathfra{{\mathbb K}}{m}}^{-}} ([P])$ and $F_{\mathfra{{\mathbb K}}{m}}([P])=0$, for all $[P] \in Y_{A,H}$. Hence, $F_{\mathfra{{\mathbb K}}{m}}$ is a generator of $I(Y_{A,H})$.

As $d_i=| \eta^{a_i} |=h/ \gcd(h,a_i)$, the lattice $L=D(L_{\beta D})$ depends on $H$. Since the lattice $L_{\beta D}$ is saturated, $I_{L_{\beta D}}$ is a prime lattice ideal also known as a toric ideal. There are various algorithms for finding generators of a toric ideal, and these can be used here.

\[a:algorithm2\]

**Input** A matrix A parameterizing the degenerate torus,\
**Output** A matrix $\Gamma$ whose columns generate the lattice $L$.

Find the matrix $D$ using $d_i=h/ \gcd(h,a_i)$. Compute the matrix LbetaD whose columns generate $L_{\beta D}$. Multiply D by LbetaD

If each column of a matrix has both a positive and a negative entry we say that it is [*mixed*]{}. If it does not have a square mixed submatrix, then it is called [*dominating*]{}.

The matrix $\phi=\begin{bmatrix}
 0 & 1 &1& ~~1& ~~0 & -1& -1& -1 \\
 1 & 1 &0& -1 & -1& -1 & ~~0& ~~1
\end{bmatrix}^T$ is a mixed BUT not dominating matrix.

\[D:CI\] For $Y\subset X$, the ideal $I(Y)$ is called a [*complete intersection*]{} if it is generated by a regular sequence of homogeneous polynomials $F_1,\dots, F_k\in S$ where $k$ is the height of $I(Y)$.

\[Morales-Thoma 2005\]\[t:MT\] Let $L$ be a sublattice of ${\mathbb Z}^r$ with $L\cap {\mathbb N}^r=\{0\}$ and $\Gamma$ be a matrix whose columns constitute a basis of $L$. Then $I_L$ is a complete intersection iff $\Gamma$ is mixed dominating.

\[ex:idealnotcyclic\] Take $X={\mathcal{H}}_{2}$ to be the Hirzebruch surface over ${\mathbb F}_{11}$ and consider $(a_1,a_2,a_3,a_4)=(2,5,4,5)$. Then, we have $(d_1,d_2,d_3,d_4)=(5,2,5,2)$ and $\gcd(d_1,d_2,d_3,d_4)=1$. We compute the vanishing ideal in Macaulay2 as follows:

    i1 :  beta = matrix {{1, -2, 1, 0}, {0, 1, 0, 1}}

    o1 = | 1 -2 1 0 |
         | 0 1  0 1 |
         
    i2 : D=matrix{{5,0,0,0},{0,2,0,0},{0,0,5,0},{0,0,0,2}};

    i3 : LbetaD =gens ker (beta*D);

    i4 : gamma=D*LbetaD 

    o4 =  | -5   20  |
          |  0   10  |
          |  5    0  |
          |  0  -10  |

Thus, $I(Y_{A,{{\mathbb K}}^*})={\langle}x_1^5-x_3^5, x_1^{20}x_2^{10}-x_4^{10} {\rangle}$.

On the other hand, if we take $(a_1,a_2,a_3,a_4)=(5,2,5,4)$, then $(d_1,d_2,d_3,d_4)=(2,5,2,5)$ and $\gcd(d_1,d_2,d_3,d_4)=1$ as before. Similarly, the vanishing ideal is found to be $I(Y_{A,{{\mathbb K}}^*})={\langle}x_1^2-x_3^2, x_1^{10}x_2^{5}-x_4^{5} {\rangle}$. Note that the matrix Gamma above is mixed-dominating and that the ideal $I(Y_{A,{{\mathbb K}}^*})$ is a complete intersection, in both cases.

\[p:ci\] A generating system of binomials for $I(Y_{A,H})$ is obtained from that of $I_{L_{\beta D}}$ by replacing $x_i$ with $x_i^{d_i}$. $I(Y_{A,H})$ is a complete intersection if and only if so is the toric ideal $I_{L_{\beta D}}$. In this case, a minimal generating system is obtained from a minimal generating system of $I_{L_{\beta D}}$ this way.

$I(Y_{A,H})=I_L$ for $L=D(L_{\beta D})$. The first part relies on the fact that ${\mathfra{{\mathbb K}}{m}}\in L_{\beta D}$ iff $D{\mathfra{{\mathbb K}}{m}}\in D(L_{\beta D})$ and thus $\x^{{\mathfra{{\mathbb K}}{m}}^{+}}-\x^{{\mathfra{{\mathbb K}}{m}}^{-}} \in I_{L_{\beta D}}$ iff $\x^{D{\mathfra{{\mathbb K}}{m}}^{+}}-\x^{D{\mathfra{{\mathbb K}}{m}}^{-}} \in I(Y_{A,H})$. So, there is a one-to-one correspondence between the binomials with disjoint supports. If $\x^{{\mathfra{{\mathbb K}}{m}}^{+}}-\x^{{\mathfra{{\mathbb K}}{m}}^{-}}=g_1(\x^{{\mathfra{{\mathbb K}}{m}}_1^{+}}-\x^{{\mathfra{{\mathbb K}}{m}}_1^{-}})+\cdots+g_k(\x^{{\mathfra{{\mathbb K}}{m}}_k^{+}}-\x^{{\mathfra{{\mathbb K}}{m}}_k^{-}})$, then $\x^{D{\mathfra{{\mathbb K}}{m}}^{+}}-\x^{D{\mathfra{{\mathbb K}}{m}}^{-}}=D(g_1)(\x^{D{\mathfra{{\mathbb K}}{m}}_1^{+}}-\x^{D{\mathfra{{\mathbb K}}{m}}_1^{-}})+\cdots+D(g_k)(\x^{D{\mathfra{{\mathbb K}}{m}}_k^{+}}-\x^{D{\mathfra{{\mathbb K}}{m}}_k^{-}})$, where $D(g)$ means that every $x_i$ in the polynomial $g$ is replaced with $x_i^{d_i}$.

Let $\Gamma$ be a matrix whose columns constitute a basis for the lattice $L_{\beta D}$. It is clear that $D\Gamma$ is a matrix whose columns form a basis of $L$. Since $D$ is a diagonal matrix with positive entries in the main diagonal, the sign patterns of $\Gamma$ and $D\Gamma$ are the same. By Theorem \[t:MT\] above, $I(Y_{A,H})$ is a complete intersection iff so is the toric ideal $I_{L_{\beta D}}$. In this case we know that the minimal generating sets for both ideals have the same cardinality : height $I(Y_{A,H})=$ height $I_{L_{\beta D}}$. If $f_1,\dots,f_k$ are minimal generators for the ideal $I_{L_{\beta D}}$, with $k=$ height $I_{L_{\beta D}}$, then $D(f_1),\dots,D(f_k)$ are generators for the ideal $I(Y_{A,H})$. Since height $I(Y_{A,H})$ is a lower bound for the number of generators, this set must be a minimal generating set, completing the proof.

The toric ideal $I_{L_{\beta D}}$ depends on $h$ but not on the field ${{\mathbb K}}$.

When ${{\mathcal{A}}}$ is free, the ideal of $\{[1]\}$ is the toric ideal of ${\mathbb N}\beta$.

\[c:torus\]When ${{\mathbb K}}={\mathbb F}_q$ we have the following.\
(**i**) If $Y=\{[1]\}$ then $I(Y)=I_{L_{\beta}}$,\
(**ii**) If $Y=T_X$ then $I(Y)=I_{L}$, for $L=(q-1)L_{\beta}$,\
(**iii**) $I(T_X)$ is a complete intersection iff so is $I_{L_{\beta}}$, which is independent of $q$.

(**i**) If $Y=\{[1]\}$ then $H={\langle}1 {\rangle}$. So, $D=I_r$ and $I(Y)=I_{L_{\beta}}$. This is true for any field ${{\mathbb K}}$.\
(**ii**) If $Y=T_X$ then $H={{\mathbb K}}^*$ and $A=I_r$. So, $D=(q-1)I_r$ and thus $I(Y)=I_{L}$ for $L=DL_{\beta D}=(q-1)L_{\beta}$, since $\beta D=(q-1)I_r\beta=(q-1)\beta$ and $\beta$ have the same kernel: $L_{\beta D}=L_{\beta}$.\
(**iii**) This is a direct consequence of Proposition \[p:ci\].

These consequences generalize some results of [@DN] from weighted projective spaces to a general toric variety. Using the matrix $\phi$ defined by the fan ${\Sigma}$ and the result presented in this section one can easily check whether the vanishing ideal of $T_X$ is a complete intersection.

The matrix $\phi=\begin{bmatrix}
 1 & 0 & -1& ~~0 \\
0 & 1 & ~~~\ell& -1
\end{bmatrix}^T$ is a mixed dominating matrix.

-   So, $I_{L_\bb}={\langle}{x_1}-{x_3},{x_2}{x_3}^{\ell}-{x_4}^{}{\rangle}$ is a complete intersection.

-   Thus, tori $T_X$ of the Hirzebruch surfaces ${\mathcal{H}}_{\ell}$ are all complete intersection for every $q$ and $\ell$: $$I(T_X)={\langle}{x_1}^{q-1}-{x_3}^{q-1},{x_2}^{q-1}{x_3}^{\ell(q-1)}-{x_4}^{q-1}{\rangle}.$$

Primary Decomposition of Vanishing Ideals
=========================================

In this section, we list main properties of vanishing ideals of subsets of the torus $T_X$ over ${\mathbb F}_q$.

\[t:primdec\] Let $Y$ be a subset of $T_X$ and $[P]\in T_X$.\
(**i**) If $I(Y)=I_L$ then $I([P]Y)={\langle}\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}  ~ | ~  {\mathfra{{\mathbb K}}{m}}\in L {\rangle}$.\
(**ii**) $I([P])={\langle}\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}  ~ | ~ {\mathfra{{\mathbb K}}{m}}\in L_{\beta} {\rangle}$ is a prime ideal of height $n$.\
(**iii**) The minimal primary decomposition of $I(Y)$ is as follows: $$\displaystyle I(Y)=\bigcap_{[P] \in Y} I([P]).$$ (**iv**) $I(Y)$ is radical.\
(**v**) ${\operatorname{height}}I(Y)=n$.\
(**vi**) $\dim I(Y)=r-n$.

(**i**) Let $F_p(\x):=F(p^{-1}\x)$, for a polynomial $F\in S$. Then $F_{p}\in I([P]Y)$ if and only if $F\in I(Y)$, since $F_p(p\t)=F(p^{-1}p\t)=F(\t)$ for all $\t\in Y$. If $I(Y)=I_L$ and $F(\x)=\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}^-}$ is a generator for $I_L$, then $$F_p(\x)=\x^{-{\mathfra{{\mathbb K}}{m}}^+}(P)\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{-{\mathfra{{\mathbb K}}{m}}^-}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}=\x^{-{\mathfra{{\mathbb K}}{m}}^+}(P)(\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}),$$ giving a generator $\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}$ for $I([P]Y)$. When $[P]=[P']$, $p=gp'$, for some $g\in G$. Since $\x^{{\mathfra{{\mathbb K}}{m}}}(P)=\x^{{\mathfra{{\mathbb K}}{m}}}(g)\x^{{\mathfra{{\mathbb K}}{m}}}(P')=\x^{{\mathfra{{\mathbb K}}{m}}}(P')$, for all $g\in G$ and ${\mathfra{{\mathbb K}}{m}}\in L \subset L_\bb$, it follows that $\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-}$ is independent of the representative of $[P]$.

(**ii**) Since $\{[P]\}=[P]Y$ for $Y=\{[1]\}$, the claim follows from the previous item and Corollary \[c:torus\] (**i**). As the map sending $F$ to $F_p$ is ring autormorphism, it follows that $I([P])$ is a prime ideal of height $n$ if and only if so is the toric ideal $I([1])=I_{L_\bb}$. By [@MS Proposition 7.5], the Krull dimension of $S/I_{L_\bb}$, which is $r-{\operatorname{height}}I_{L_\bb}$, equals $r-{\operatorname{rank}}{L_\bb}=r-n$, whence the result.

(**iii**) Since intersection of homogeneous ideals is homogeneous, we have $$\displaystyle I(Y)=\bigcap_{[P] \in Y} I([P]).$$ In order to show that this decomposition is minimal we prove that $I([P])$ is a minimal prime of $I(Y)$, for every $[P]\in Y$. This follows from the following observation. $ (\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P)\x^{{\mathfra{{\mathbb K}}{m}}^-})(P_0)=0$ if and only if $\x^{{\mathfra{{\mathbb K}}{m}}}(P)=\x^{{\mathfra{{\mathbb K}}{m}}}(P_0)$ if and only if $ (\x^{{\mathfra{{\mathbb K}}{m}}^+}-\x^{{\mathfra{{\mathbb K}}{m}}}(P_0)\x^{{\mathfra{{\mathbb K}}{m}}^-})(P)=0$. Thus, $I([P])\subset I([P_0])$ if and only if $I([P_0])\subset I([P])$, meaning that $I([P])\subset I([P_0])$ if and only if $I([P])= I([P_0])$.

(**iv**) This follows directly from the previous decomposition and the fact that each $I([P])$ is prime.

(**v**) ${\operatorname{height}}I(Y)=n$, since all the minimal primes are of height $n$ and thus the maximum is $n$.

(**vi**) $\dim I(Y)$ is the maximum of $\dim I([P])$ as $[P]$ vary in $Y$. Since $\dim I([P])=r-{\operatorname{height}}I([P])$, for all points $[P] \in Y$, the result follows from item (**ii**).

Evaluation codes on degenerate tori {#S:codes}
===================================

In this section we apply our results in previous sections to evaluation codes on degenerate tori in a toric variety.

Recall the basic definitions from coding theory. Let ${\mathbb F}_q$ be a finite field of $q$ elements and ${\mathbb F}_q^*={\mathbb F}_q\setminus\{0\}$ its multiplicative group. A subspace ${{\mathcal{C}}}$ of $ {\mathbb F}_q^{N}$ is called a *linear code*, and its elements ${c}=(c_{1},\dotsc,c_{N})$ are called *codewords*. The number $N$ is called the [*block-length*]{} of ${{\mathcal{C}}}$. The [*weight*]{} of $c$ in ${{\mathcal{C}}}$ is the number of non-zero entries in $c$. The [*distance*]{} between two codewords $a$ and $b$ in $\mathcal{C}$ is the weight of $a-b\in{{\mathcal{C}}}$. The minimum distance between distinct codewords in ${{\mathcal{C}}}$ is the same as the minimum weight of non-zero codewords in ${{\mathcal{C}}}$. The block-length $N$, the dimension $k=\dim_{{\mathbb F}_q}({{\mathcal{C}}})$, and the minimum distance $d=d({{\mathcal{C}}})$ are the basic parameters of ${{\mathcal{C}}}$.

Now, let $X$ be a simplicial complete toric variety over ${\mathbb F}_q$ with torsion-free class group and $S$ its homogeneous coordinate ring as in the previous sections.

Now, we recall evaluation codes defined on subsets $Y=\{[P_1],\dots,[P_N]\}$ of the torus $T_X$. Fix a degree $\aa\in{\mathbb N}\beta$ and a monomial $F_0=\x^{\phi({\mathfra{{\mathbb K}}{m}}_0)+\a} \in S_{\aa}$, where ${\mathfra{{\mathbb K}}{m}}_0\in {\mathbb Z}^n$, $\a$ is any element of ${\mathbb Z}^r$ with $\deg(\a)=\aa$, and $\phi$ as in the exact sequence $\mathfrak{P}$. This defines the [*evaluation map*]{} $$\label{e:evalmap}
\text{ev}_{Y}:S_\aa\to {\mathbb F}_q^N,\quad F\mapsto \left(\frac{F(P_1)}{F_0(P_1)},\dots,\frac{F(P_N)}{F_0(P_N)}\right).$$ The image ${{\mathcal{C}}}_{\aa,Y}=\text{ev}_{Y}(S_\aa)$ is a linear code, called the [*generalized toric code*]{}. It can be readily seen that different choices of $F_0\in S_\aa$ yield to equivalent codes. Clearly, the block-length $N$ of ${{\mathcal{C}}}_{\aa,Y}$ equals $|T_X|=(q-1)^n$ in the case of toric codes where $Y=T_X$, which was introduced for the first time by Hansen in [@Ha0; @Ha1]. A way to compute the dimension of a toric code is given in [@Ru]. In the generalized case, multigraded Hilbert function can be used to compute the length and dimension as shown by Şahin and Soprunov in [@sasop]. For general information about algebraic geometry codes we refer the reader to [@TVN] and [@Li].

The next proposition provides a way to calculate the dimension of the code as the value of the Hilbert function $H_Y(\aa):=\dim_{{{\mathbb K}}} S_{\aa}-\dim_{{{\mathbb K}}} I(Y)_{\aa}$.

\[p:dim=HF\] $\dim_{{{\mathbb K}}} {{\mathcal{C}}}_{\aa,Y}$ equals $H_{Y}(\aa)$.

This follows as the kernel of the evaluation map is exactly the the degree $\aa$ part of the vanishing ideal $I(Y)$.

We write $\aa \preceq \aa'$ if $\aa'-\aa$ lies in ${\mathbb N}\beta$, where ${\mathbb N}\beta\subset {{\mathcal{A}}}$ denotes the semigroup generated by the degrees $\bb_i$ of the variables $x_i$.

\[c:dimcode\] If the set $Y=Y_{A,H}$ and $\aa \preceq d_1\bb_1+\cdots +d_r \bb_r$, then $ev_{Y}$ is injective, that is, $\dim_{{{\mathbb K}}} {{\mathcal{C}}}_{\aa,Y}=\dim_{{{\mathbb K}}} S_{\aa}$.

In this case we have $I(Y)=I_L$ for $L=D(L_{\bb D})$ by Theorem \[t:I(Y\_A)\], where $D=diag (d_1,\dots,d_r)$. By Proposition \[p:ci\], the generators of $I(Y)$ are obtained from the generators of the toric ideal $I_{L_{\bb}}$ by substituting $x_i^{d_i}$ in $x_i$. Thus, their degrees are at least $d_i\bb_i$. In particular, the degree $\aa$ part of the kernel $I(Y)_{\aa}=\{0\}$ when $\aa \preceq d_1\bb_1+\cdots +d_r \bb_r$.

\[c:lengthcode\] If the set $Y=Y_{A,H}$ and $d_1,\dots ,d_r$ are pairwise relatively prime, then the length of ${{\mathcal{C}}}_{\aa,Y}$ is $d_1\cdots d_r$.

This follows directly from Proposition \[p:degY\].

We finish with the following example.

\[ex:idealnotcyclicCode\] Take $X={\mathcal{H}}_{2}$ to be the Hirzebruch surface over ${\mathbb F}_{11}$ and consider $(a_1,a_2,a_3,a_4)=(2,5,4,5)$. Then, we have $(d_1,d_2,d_3,d_4)=(5,2,5,2)$ and $\gcd(d_1,d_2,d_3,d_4)=1$. Thus, $I(Y_{A,{{\mathbb K}}^*})={\langle}x_1^5-x_3^5, x_1^{20}x_2^{10}-x_4^{10} {\rangle}$ by Example \[ex:idealnotcyclic\]. The fan ${\Sigma}$ of $X$ determines an important subsemigroup ${\mathcal{K}}$ of the semigroup ${\mathbb N}\bb$. Namely, ${\displaystyle}{\mathcal{K}}=\cap_{{\sigma}\in {\Sigma}} {\mathbb N}\hat{{\sigma}}$, where ${\mathbb N}\hat{{\sigma}}$ is the semigroup generated by the subset $\{\bb_j \; : \; \rho_j \notin {\sigma}\}$. In this example, ${\displaystyle}{\mathcal{K}}={\mathbb N}^2$. Since the degrees $(5,0)$ and $(0,10)$ lie in ${\mathcal{K}}$, it follows that the Hilbert function at $(5,10)$ gives us the length by [@sasop].

    i1 : hilbertFunction({5,10},IYQ)
    o1 = 50

On the other hand, if we take $(a_1,a_2,a_3,a_4)=(5,2,5,4)$, then $(d_1,d_2,d_3,d_4)=(2,5,2,5)$ and $\gcd(d_1,d_2,d_3,d_4)=1$ as before. Similarly, the vanishing ideal is found to be $I(Y_{A,{{\mathbb K}}^*})={\langle}x_1^2-x_3^2, x_1^{10}x_2^{5}-x_4^{5} {\rangle}$. Note that the matrix Gamma above is mixed-dominating and that the ideal $I(Y_{A,{{\mathbb K}}^*})$ is a complete intersection, in both cases.

Dimensions of various codes are encoded in the matrix below:

    i2 : apply(6,j-> apply(18,i-> hilbertFunction({i-5,5-j},IYQ)));
    i3 : oo / print @@ print
    {06,07,08,09,10,10,10,10,10,10,10,10,10,10,10,10,10,10}
    {04,05,06,07,08,09,10,10,10,10,10,10,10,10,10,10,10,10}
    {02,03,04,05,06,07,08,08,08,08,08,08,08,08,08,08,08,08}
    {00,01,02,03,04,05,06,06,06,06,06,06,06,06,06,06,06,06}
    {00,00,00,01,02,03,04,04,04,04,04,04,04,04,04,04,04,04}
    {00,00,00,00,00,01,02,02,02,02,02,02,02,02,02,02,02,02}

Acknowledgements {#acknowledgements .unnumbered}
================

All the examples were computed by using the computer algebra system Macaulay $2$, see [@Mac2].

[10]{} E. Baran and M. Şahin. preprint. Eisenbud, D., Sturmfels, B., 1997. [*Binomial ideals*]{}, Duke Math. J., 84, 1–45.

D. A. Cox, [*The homogeneous coordinate ring of a toric variety*]{}, J. Algebr. Geom. [**4**]{} (1995), 17–50.

Cox, D. A., Little, J., Schenck, H., 2011, [Toric Varieties]{}, Graduate Studies in Mathematics, 124, AMS, Providence, RI

E. Dias and J. Neves, [Codes over a weighted torus]{}, Finite Fields and Their Appl., 2015, 33, 66-79.

Duursma, I., . Rentería, C, Tapia-Recillas, H., 2001. [Reed-Muller codes on complete intersections]{}, Appl. Algebra Engrg. Comm. Comput. 11, 455–462.

Gold, L., Little, J., Schenck, H., 2005. [*Cayley–Bacharach and evaluation codes on complete intersections*]{}, J. Pure Appl. Algebra 196, no. 1, 91–99.

D. Grayson, M. Stillman, Macaulay2–A System for Computation in Algebraic Geometry and Commutative Algebra. [math.uiuc.edu/Macaulay2]{}.

Hansen, J., 2003. [*Linkage and codes on complete intersections*]{}, Appl. Algebra Engrg. Comm. Comput. 14, 175–185.

Hansen, J., 2000. [*Toric Surfaces and Error–correcting Codes*]{} in: Buchmann, J. et al. (Eds.), Coding Theory, Cryptography, and Related Areas, Springer, pp. 132–142.

Hansen, J., 2001. [*Error-Correcting Codes from Higher-Dimensional Varieties*]{}, Finite Fields Appl., [ 7]{} no. 4, 530–552.

Joyner, D., 2004. [*Toric codes over finite fields*]{}, Appl. Algebra Engrg. Comm. Comput., 15, 63–79.

Little, J., 2008. [Algebraic geometry codes from higher dimensional varieties]{}, in Martinez-Moro, E. et al. (Eds.), Advances in algebraic geometry codes, Series on Coding Theory Cryptology, [5]{}, World Sci. Publ., Hackensack, NJ., pp. 257–293.

H. H. Lopez, R. H. Villarreal and L. Zarate, [Complete Intersection Vanishing Ideals on Degenerate Tori over Finite Fields]{}, Arab J. Math, 2013, 189-197.

Miller, E. and Sturmfels, B., Combinatorial commutative algebra. Graduate Texts in Mathematics, 227. Springer-Verlag, New York, (2005).

M. Morales and A. Thoma, [Complete Intersection Lattice Ideals]{}, J. Algebra, 2005, 284, 755-770.

J. Neves, M. V. Pinto, R. H. Villarreal [*Regularity and algebraic properties of certain lattice ideals*]{}, Bull. Brazilian Math. Soc. 45 (4) (2014),777–806.

Renteria, C., Simis, A., Villarreal, R. H., 2011. [*Algebraic methods for parameterized codes and invariants of vanishing over finite fields*]{}, Finite Fields Appl.,[17]{} no. 1, 81–104.

Ruano, Diego, 2007. [ On the parameters of $r$-dimensional toric codes]{}, Finite Fields and Their Applications [13]{}, 962–976.

M. Şahin and I. Soprunov, [*Multigraded Hilbert functions and toric complete intersection codes*]{}, J. Algebra, 459 (2016), 446–467.

I. Soprunov, [*Toric complete intersection codes*]{}, J. Symbolic Comput. 50 (2013), 374–385.

A. Tochimani and R. H. Villarreal, [Binomial Vanishing Ideals]{}, J. Algebra Comb. Discrete Appl., 2015, 151-156.

Tsfasman M., Vlăduţ, S., Nogin, D.,2007. [Algebraic geometric codes: basic notions]{}, Mathematical Surveys and Monographs, 139, AMS, Providence.

[^1]: The author is supported by TÜBİTAK Project No:114F094
