1\newpage
2\section{Doing tropical computations}
3\label{sec:tropical}
4\emph{This section follows the max convention for tropical
5arithmetic. For the non-constant coefficient case tropical varieties are defined as in \cite{lifting} and \cite{thesis}.}
6\vspace{0.5cm}
7
8In this section we
9explain how to use Gfan to do tropical computations.  For a fixed ideal $I\subseteq
10k[x_1,\dots,x_n]$ the set of all faces of all full-dimensional
11Gr\"obner cones is a polyhedral complex which we call the Gr\"obner
12fan of $I$. For tropical computations the lower dimensional cones of
13the complex will be of our interest. In general every Gr\"obner cone
14is of the form:
15$$C_\omega(I):=\overline{\{\omega'\in\R^n:\init_{\omega'}(I)=\init_\omega(I)\}
16}.$$
17
18We define the tropical variety $\T(I)$ of an ideal $I$ to be the
19the set of all $\omega$ such that $\init_\omega(I)$ does not contain a monomial.
20If the ideal $I$ is homogeneous with respect to a positive grading, then the Gr\"obner cones cover all of $\R^n$ and $\T(I)$ is a union of Gr\"obner cones.
21Thus for a homogeneous ideal the tropical variety gets the structure of a polyhedral fan which it inherits from the Gr\"obner fan.
22%collection of all Gr\"obner cones with monomial-free initial
23%ideals.
24We therefore also define the tropical variety $\T(I)$ to be the collection of all Gr\"obner cones $C_\omega(I)$ such that $\init_\omega(I)$ is monomial-free.
25
26We start by noticing that for computational purposes it is no restriction to only consider the case of a homogeneous ideal:
27\begin{lemma}\cite[Lemma~6.2.5]{thesis}
28\label{lem:tropical by homogenisation}
29Let $I\subseteq k[x_1,\dots,x_n]$ be an ideal generated by
30$f_1,\dots,f_m\in k[x_1,\dots,x_n]$. Let $J=\langle
31f_1^h,\dots,f_m^h\rangle\subseteq k[x_0,\dots,x_n]$. Then $\init_\omega(I)$ is monomial-free if and
32only if $\init_{(0,\omega)}(J)$ is monomial-free where $\omega\in\R^n$. In particular we have the following identity of sets in $\R^{n+1}$:
33$$\{0\}\times\T(I)=\T(J)\cap(\{0\}\times\R^n).$$
34\end{lemma}
35Here $f^h$ denotes the homogenization of the polynomial $f$.
36The homogenization of a list of polynomials can be computed by the program \texttt{gfan\_homogenize}.
37Notice that the lemma only requires the generators to be homogenized as a set of polynomials and not in the sense of a polynomial ideal.
38
39The tropical algorithms
40implemented in Gfan are explained in \cite{ctv}.
41% The reference also
42%contains definitions and theorems needed for understanding this
43%section of the manual.
44Notice that Gfan follows the usual conventions
45for signs of weight vectors defining initial forms while \cite{ctv}
46uses opposite signs. This means that \name is compatible with the max-plus convention whereas \cite{ctv} is compatible with the min-plus convention.
47
48\subsection{Tropical variety by brute force}
49The command \texttt{gfan\_tropicalbruteforce} will compute all
50Gr\"obner cones of a homogeneous ideal and for each check if its initial ideal
51contains a monomial. The output is the tropical variety of the
52ideal. Since the tropical variety is usually much smaller than the
53Gr\"obner fan this is a rather slow method for computing the tropical
54variety. The line
55\begin{verbatim}
56gfan_buchberger | gfan_tropicalbruteforce
57\end{verbatim}
58run on the input
59\begin{verbatim}
60Q[a,b,c,d,e,f,g,h,i,j]
61{
62bf-ah-ce,
63bg-ai-de,
64cg-aj-df,
65ci-bj-dh,
66fi-ej-gh
67}
68\end{verbatim}
69produces a tropical variety of the input ideal in a few minutes as a
70polyhedral fan, see Section~\ref{format:fan}. We use
71\texttt{gfan\_buchberger} since \texttt{gfan\_tropicalbruteforce}
72requires its input to be a marked reduced Gr\"obner basis.
73\begin{remark}
74Notice that if $k'\supseteq k$ is a field extension and $I\subseteq
75k[x_1,\dots,x_n]$ an ideal then $\T(I)=\T(\langle
76I\rangle_{k'[x_1,\dots,x_n]})$ as a polyhedral fan. This identity
77follows since both objects can be computed by Gr\"obner basis methods
78and Gr\"obner bases are independent of such field extensions. The same argument of course also applies to the Gr\"obner fans of the two ideals.
79\end{remark}
80\subsection{Traversing tropical varieties of prime ideals}
81Let $I\subseteq \CC[x_1,\dots,x_n]$ be a homogeneous monomial-free
82prime ideal of dimension $d$. By the Bieri Groves Theorem \cite{bg}
83the tropical variety of $I$ is a pure $d$-dimensional polyhedral
84fan. It is connected in codimension one (\cite[Theorem~14]{ctv}) and can be
85traversed by Gfan. Let $\omega$ be a relative interior point of a
86$d$-dimensional Gr\"obner cone in the tropical variety of $I$. Fix
87some term order $\prec$. Gfan represents $C_\omega(I)$ by the pair of
88marked reduced Gr\"obner bases
89$(\G_{\prec_\omega}(\init_\omega(I)),\G_{\prec_\omega}(I))$.  To
90compute the tropical variety of an ideal we must begin by finding a
91starting $d$-dimensional Gr\"obner cone. For this
92\texttt{gfan\_tropicalstartingcone} is used. % This programs guesses a
93%starting cone by heuristic methods. The guessing might fail. In that
94%case the program will terminate with an error message.
95After having
96computed a starting cone we use the program
97\texttt{gfan\_tropicaltraverse} to traverse the tropical variety.
98%There are several options for the output. In general the choice of output we request can have a huge influence on the running time for the program.
99We illustrate the procedure with an example.
100\begin{remark}
101Gfan does its computations over $\Q$ and thus the input should be an
102ideal generated by polynomials in $\Q[x_1,\dots,x_n]$. The assumption
103that $I$ is an ideal in $\CC[x_1,\dots,x_n]$ is needed since by
104``prime ideal'' in the above we mean ``prime ideal in the polynomial
105ring over the algebraically closed field $\CC$''. If $I$ is a prime ideal in
106$\Q[x_1,\dots,x_n]$ we do not know that its tropical variety is connected.
107 In
108Section~\ref{sec:non-constant} we address the problem of specifying non-rational
109coefficients.
110\end{remark}
111\begin{example}
112Let $I\subseteq\Q[a,\dots,o]$ be the ideal generated by the relations
113on the 2 by 2 minors of a 2 by 6 generic matrix.  In $\CC[x_1,\dots,x_n]$ the
114ideal $I$ generates a prime ideal.  To get a starting cone for the
115traversal of $\T(I)$ we run the command
116\begin{verbatim}
117gfan_tropicalstartingcone
118\end{verbatim}
119on the input
120\begin{verbatim}
121Q[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o]
122{
123bg-aj-cf,  bh-ak-df,  bi-al-ef,  ck-bm-dj,  ch-am-dg,
124cl-ej-bn,  ci-eg-an,  dn-co-em,  dl-bo-ek,  di-ao-eh,
125gk-fm-jh,  gl-fn-ij,  hl-fo-ik,  kn-jo-lm,  hn-im-go
126}
127\end{verbatim}
128and get a pair of marked reduced Gr\"obner bases
129\begin{verbatim}
130Q[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o]
131{
132l*m+j*o,  i*m+g*o,  i*k-h*l,  i*j-g*l,  h*j-g*k,
133e*m+c*o,  e*k+b*o,  e*j-c*l,  e*h+a*o,  e*g-c*i,
134c*k-b*m,  c*h-a*m,  b*i-a*l,  b*h-a*k,  b*g-a*j}
135{
136l*m-k*n+j*o, i*m-h*n+g*o, i*k-h*l+f*o, i*j-g*l+f*n, h*j-g*k+f*m,
137e*m-d*n+c*o, e*k-d*l+b*o, e*j-c*l+b*n, e*h-d*i+a*o, e*g-c*i+a*n,
138c*k-d*j-b*m, c*h-d*g-a*m, b*i-e*f-a*l, b*h-d*f-a*k, b*g-c*f-a*j}
139\end{verbatim}
140This takes about a second. We store the output in the file \texttt{grassmann2\_6.cone} for later use. Since $I$ has many symmetries we add the following lines describing the symmetry group to the end of the file:
141\begin{verbatim}
142{
143(0,8,7,6,5,4,3,2,1,14,13,11,12,10,9),
144(5,6,7,8,0,9,10,11,1,12,13,2,14,3,4)
145}
146\end{verbatim}
147We are ready to traverse $\T(I)$.
148% We start by running the program with the simplest possible output and using symmetries:
149We run the following command
150\begin{verbatim}
151gfan_tropicaltraverse --symmetry <grassmann2_6.cone
152\end{verbatim}
153The computation takes a few (two - three) minutes. The output looks like this:
154\begin{verbatim}
155_application PolyhedralFan
156_version 2.2
157_type PolyhedralFan
158
159AMBIENT_DIM
16015
161
162DIM
1639
164
165LINEALITY_DIM
1666
167
168RAYS
1690 0 -1 0 0 0 0 0 0 0 0 0 0 0 0	# 0
1700 0 0 0 0 0 0 -1 0 0 0 0 0 0 0	# 1
1710 0 0 0 0 0 0 0 0 0 0 -1 0 0 0	# 2
1720 0 0 -1 0 0 0 0 0 0 0 0 0 0 0	# 3
1730 0 0 0 0 0 -1 0 0 0 0 0 0 0 0	# 4
1740 -1 0 0 0 0 0 0 0 0 0 0 0 0 0	# 5
1750 0 0 0 0 0 0 0 -1 0 0 0 0 0 0	# 6
1760 0 0 0 0 0 0 0 0 0 -1 0 0 0 0	# 7
1770 0 0 0 0 0 0 0 0 0 0 0 0 -1 0	# 8
1780 0 0 0 0 -1 0 0 0 0 0 0 0 0 0	# 9
1790 0 0 0 -1 0 0 0 0 0 0 0 0 0 0	# 10
1800 0 0 0 0 0 0 0 0 0 0 0 0 0 -1	# 11
1810 0 0 0 0 0 0 0 0 -1 0 0 0 0 0	# 12
182-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0	# 13
1830 0 0 0 0 0 0 0 0 0 0 0 -1 0 0	# 14
1840 0 0 -1 -1 -1 -1 0 0 -1 0 0 0 0 -1	# 15
185-1 -1 0 0 0 -1 0 0 0 0 0 0 -1 -1 -1	# 16
186-1 0 0 0 -1 0 0 0 -1 -1 -1 0 -1 0 0	# 17
1871 1 0 0 0 1 2 2 0 2 2 0 1 1 1	# 18
1881 0 2 2 1 0 0 0 1 1 1 0 1 2 2	# 19
1890 0 0 1 1 1 1 0 0 1 2 2 2 2 1	# 20
1901 1 0 2 2 1 0 2 2 0 0 0 1 1 1	# 21
1911 2 2 0 1 2 2 0 1 1 1 0 1 0 0	# 22
1922 2 0 1 1 1 1 0 2 1 0 2 0 0 1	# 23
1930 -1 0 -1 0 0 -1 0 -1 0 -1 0 0 -1 0	# 24
194
195N_RAYS
19625
197
198LINEALITY_SPACE
1990 0 0 0 0 1 1 1 1 1 1 1 1 1 1
2000 0 0 0 1 0 0 0 1 0 0 1 0 1 1
2010 0 0 1 0 0 0 1 0 0 1 0 1 0 1
2020 0 1 0 0 0 1 0 0 1 0 0 1 1 0
2030 1 0 0 0 0 -1 -1 -1 0 0 0 -1 -1 -1
2041 0 0 0 0 0 0 0 0 -1 -1 -1 -1 -1 -1
205
206ORTH_LINEALITY_SPACE
2070 0 0 0 0 0 0 0 0 0 1 -1 -1 1 0
2080 0 0 0 0 0 0 0 0 1 0 -1 -1 0 1
2090 0 0 0 0 0 0 1 -1 0 0 0 -1 1 0
2100 0 0 0 0 0 1 0 -1 0 0 0 -1 0 1
2110 0 0 0 0 1 0 0 -1 0 0 -1 -1 1 1
2120 0 0 1 -1 0 0 0 0 0 0 0 -1 1 0
2130 0 1 0 -1 0 0 0 0 0 0 0 -1 0 1
2140 1 0 0 -1 0 0 0 0 0 0 -1 -1 1 1
2151 0 0 0 -1 0 0 0 -1 0 0 0 -1 1 1
216
217F_VECTOR
2181 25 105 105
219\end{verbatim}
220After this follows a list of cones and maximal cones.
221Every maximal cone has an associated multiplicity which is also listed.
222
223The output says that the tropical variety has dimension $9$. Modulo the
224$6$-dimensional homogeneity space this is reduced to a $3$-dimensional complex in
225$\R^9$ and thus we may think of the tropical variety as a
226$2$-dimensional polyhedral complex on the $8$-sphere in $\R^9$. This
227complex is simplicial and has $105$ maximal cones.
228
229
230The extreme rays (modulo the homogeneity space) are labeled
231$0,\dots,24$. In the cone lists the cones are grouped together
232according to dimension and orbit with respect to the specified
233symmetries. See Section~\ref{sec:format fan} for more information on how to read the
234polyhedral fan format.
235\end{example}
236
237%If we look carefully in the debug output from the program we
238%will also see that these $105$ cones come in $17$ orbits.  If we
239%wanted to know more about the traversed cones we could use the option
240%\texttt{--largedimensional}. This will list the $d$-dimensional and
241%$(d-1)$-dimensional cones of the fan. In our example one of the
242%$d$-dimensional cones is listed like this: (In this manual lines have
243%been concatenated to avoid wasting paper)
244
245While traversing the variety the program
246\texttt{gfan\_tropicaltraverse} only computes $d$ and
247$(d-1)$-dimensional cones. The other cones are extracted after
248traversing. Also the symmetries are expanded. Sometimes extracting all
249cones is time consuming and one is only interested in the high
250dimensional cones up to symmetry. These can be output using the option
251\texttt{--noincidence}. In that case the output would be a list of
252orbits for maximal cones and a list of orbits for codimension one
253cones. It is also listed how these cones are connected taking symmetry
254into account. In general that format is rather difficult to read.
255
256
257A final remark about \texttt{gfan\_tropicaltraverse} is that the
258polyhedral structure of the complex comes from the Gr\"obner fan. For
259some ideals it is possible to find polyhedral fans covering the
260tropical variety with fewer cones.
261
262
263\subsection{Intersecting tropical hypersurfaces}
264The tropical variety of a principal ideal is called a \emph{tropical
265hypersurface}. A \emph{tropical prevariety} is a finite intersection of
266tropical hypersurfaces or, to be precise, the intersection of the
267support set of these hypersurfaces. In Gfan the intersection is
268represented by the \emph{common refinement} of the tropical
269hypersurfaces. The program \texttt{gfan\_tropicalintersection} can
270compute such intersections.
271\begin{example}
272To compute the intersection of the tropical hypersurfaces $\T(\langle a+b+c+1\rangle)$ and $\T(\langle a+b+2c\rangle)$ we run
273\begin{verbatim}
274gfan_tropicalintersection
275\end{verbatim}
276on
277\begin{verbatim}
278Q[a,b,c]
279{a+b+c+1,a+b+2c}
280\end{verbatim}
281The output is a polyhedral fan whose support is the intersection. The
282balancing condition for this fan is not satisfied which implies that it
283is not a tropical variety.
284%list of cones whose union is the tropical prevariety.  Notice, as a polyhedral complex, some cones might be missing from the list but all maximal cones are present. The program also gives a list with a relative interior point for each cone.
285
286%If we use the option \texttt{--incidence} we will get more information about the combinatorial structure of the intersection as a polyhedral complex. We should note that this option only investigates the maximal dimensional complex.
287
288%An interesting question is if the intersection equals the tropical variety of the ideal generated by the input polynomials. A necessary condition for this to be true is that all the computed relative interior points pick out monomial-free initial ideal. This can be checked with the option \texttt{-t}. In our example the prevariety is not equal to the tropical variety and the program will find a vector that proves this.
289\end{example}
290
291\subsection{Computing tropical bases of curves}
292In Gfan an ideal $I$ is said to define a \emph{tropical curve} if
293$k[\x_1,\dots,x_n]/I$ has Krull dimension equal to or one larger than the
294dimension of the homogeneity space of $I$.  A \emph{tropical basis} of $I$ is
295a finite generating set for the ideal such that the tropical variety
296defined by $I$ (as a set) is the intersection of the tropical
297hypersurfaces of the generators. A tropical basis always exists \cite{ctv}.  The
298program \textup{gfan\_tropicalbasis} computes a tropical basis for an
299ideal defining a tropical curve.
300\begin{example}
301Again we consider the ideal $\langle a+b+c+1,a+b+2c\rangle$. We notice that this ideal defines a curve since the Krull dimension is $1$ and the dimension of the homogeneity space is $0$. In the example above we saw that the listed set is not a tropical basis. We run
302\begin{verbatim}
303gfan_tropicalbasis -h
304\end{verbatim}
305on
306\begin{verbatim}
307Q[a,b,c]
308{a+b+c+1,a+b+2c}
309\end{verbatim}
310to get some tropical basis
311\begin{verbatim}
312Q[a,b,c]
313{
314-1+c,
3152+b+a}
316\end{verbatim}
317We needed the option \texttt{-h} here since the ideal was not homogeneous. If we run \texttt{gfan\_tropicalintersection} on the output we see that the tropical variety consists of three rays and the origin.
318\end{example}
319
320
321\subsection{Tropical intersection theory}
322Gfan contains a few experimental programs for doing computations in
323tropical intersection theory. In \cite[Definition 3.4]{allermannRau}
324the tropical Weil divisor of a tropical rational function on a
325(tropical) $k$-cycle in $\R^n$ is defined. This divisor can be
326computed in Gfan. However, Gfan and \cite{allermannRau} do not agree
327on the basic definitions in tropical geometry. For example the
328definition of a fan is different. Here we will adjust the necessary
329definitions to the Gfan conventions. A tropical $k$-cycle will be a
330pure (rational) polyhedral fan $F$ of dimension $k$ in $\R^n$ with
331weights which is balanced in the following sense: To every
332$k$-dimensional facet $C$ we assign a weight (or multiplicity)
333$m_C\in\Z$. The vector space $\R^n$ comes with its standard lattice
334$\Z^n$. For a $k-1$-dimensional ridge $R\in F$ and a facet $C$ in its
335star\footnote{the smallest polyhedral subcomplex of $F$ containing all
336faces of $F$ containing $R$.} in $F$ corresponding to a cone $L$ in
337the link\footnote{take an $\epsilon$-ball around a relative interior
338$\omega\in R$ and intersect it with $F$. Translating the ball to the
339origin and scaling the intersection to infinity we get the link of $R$
340in $F$.} of $R$ in $F$, the semi-group
341$L\cap\Z^n/\textup{span}_{\R}(R)\cap\Z^n\subseteq
342\Z^n/\textup{span}_{\R}(R)\cap\Z^n$ is isomorphic to $\N$. Define
343$u_{C/R}\in \Z^n/\textup{span}(R)\cap\Z^n$ as the element identified
344with $1\in\N$. The balancing condition at $R$ is that
345$$\sum_{C\in F:R\subset C} m_Cu_{C/R}=0.$$
346For a (weighted) fan to be a tropical cycle this must hold at every ridge $R$.
347
348It remains to define what a tropical rational function is. Take a
349polyhedral fan $F'$ and associate to each of its maximal cones a
350linear form. When evaluating a point $x$ in the support of $F'$ simply
351evaluate the linear form of cone containing $x$. If this gives a
352well-defined function we call this function a tropical rational
353function.  When computing Weil divisors we will require that the supports satisfy
354$\textup{supp}(F)\subseteq \textup{supp}(F')$.  There will be no further restriction
355on the polyhedral structure.
356
357For a definition of the Weil divisor itself we refer
358to \cite[Definition 3.4]{allermannRau}. Here we just mention that it
359again is a cycle of dimension one lower.
360
361To demonstrate the Gfan features we recompute \cite[Example 3.10]{allermannRau}.
362An easy way to generate the $k$-cycle of that example is to compute it as a hypersurface. Since the paper is using min and Gfan is using max we need to change the polynomial from the paper such that the Newton polytope is flipped:
363\begin{verbatim}
364gfan_tropicalhypersurface > tmpfile1.poly
365Q[x_1,x_2,x_3]
366{x_2x_3+x_1x_3+x_1x_2+x_1x_2x_3}
367\end{verbatim}
368The weights/multiplicities are stored in the MULTIPLICITIES section of the Polymake file.
369
370It is harder specifying the rational function. We make the following file and call in \texttt{func.poly}.
371\begin{footnotesize}
372\begin{verbatim}
373_application PolyhedralFan
374_version 2.2
375_type PolyhedralFan
376
377AMBIENT_DIM
3783
379
380DIM
3812
382
383LINEALITY_DIM
3840
385
386RAYS
3871 0 0	# 0
3880 1 0	# 1
3890 0 1	# 2
390-1 -1 -1	# 3
3911 1 0	# 4
392-1 -1 0	# 5
393
394N_RAYS
3956
396
397LINEALITY_SPACE
398
399ORTH_LINEALITY_SPACE
4001 0 0
4010 1 0
4020 0 1
403
404MAXIMAL_CONES
405{3 5}	# Dimension 2
406{5 2}
407{0 2}
408{1 2}
409{1 3}
410{0 3}
411{1 4}
412{0 4}
413
414MULTIPLICITIES
4151
4161
4171
4181
4191
4201
4211
4221
423
424RAY_VALUES
4250
4260
4270
4281
429-1
4300
431
432LINEALITY_VALUES
433\end{verbatim}
434\end{footnotesize}
435Instead of specifying the linear function on each maximal cone we have
436to specify its values on each of the rays in the fan and each of the
437generators of the lineality space. Then Gfan will automatically
438interpolate the function. Since the lineality space of the fan is
439empty we leave the LINEALITY\_VALUES section empty.
440
441We now compute the Weil divisor:
442\begin{footnotesize}
443\begin{verbatim}
444gfan_tropicalweildivisor -i1 tmpfile1.poly -i2 func.poly >tmpfile2.poly
445\end{verbatim}
446\end{footnotesize}
447...and compute the Weil divisor again as in \cite{allermannRau}...
448\begin{footnotesize}
449\begin{verbatim}
450gfan_tropicalweildivisor -i1 tmpfile2.poly -i2 func.poly >tmpfile3.poly
451\end{verbatim}
452\end{footnotesize}
453We get a fan with the origin being the only cone. It has multiplicity $-1$:
454\begin{verbatim}
455MULTIPLICITIES
456-1      # Dimension 0
457\end{verbatim}
458
459There is another useful command for computing polyhedral fans for
460rational functions. The command \texttt{gfan\_tropicalfunction} takes a
461polynomial and turns it into a fan representing its tropicalization
462which is a tropical rational function.
463
464\subsection{Non-constant coefficients}
465\label{sec:non-constant}
466In tropical geometry it is common to take the valuation of
467$\CC\{\{t\}\}$ into account when defining the tropical variety of
468an ideal in $\CC\{\{t\}\}[x_1,\dots,x_n]$.  Here $\CC\{\{t\}\}$ denotes the field of
469Puiseux series. The valuation $\textup{val}(p)$ of a non-zero Puiseux
470series $p$ is the degree of its lowest order term.
471
472
473\begin{definition}
474For $\omega\in\R^n$ the \emph{t-$\omega$-degree}\index{t-$\omega$-degree} of a term $ct^ax^v$
475with $c\in\CC^*$, $a\in \Q$ and $v\in\Z^n$ is defined as
476$-\val(ct^a)+\omega\cdot v=-a+\omega\cdot v$.  The \emph{t-initial
477form}\index{t-initial form} $\tinit_\omega(f)\in\CC[x_1,\dots,x_n]$ of a polynomial
478$f\in\puiseux[x_1,\dots,x_n]$ is the sum of all terms in $f$ of maximal
479t-$\omega$-weight but with $1$ substituted for $t$.
480\end{definition}
481\begin{remark}
482Notice that since $t$ has t-$\omega$-degree $-1$, the maximal
483t-$\omega$-weight \emph{is} attained by a term if the polynomial is
484non-zero. Furthermore, only a finite number of terms attain the
485maximum. Therefore, it makes sense to substitute $t=1$ and consider
486the finite sum of terms as a polynomial in $\CC[x_1,\dots,x_n]$.
487\end{remark}
488\begin{example}
489Consider $f=(1+t)+t^2x+tx^2\in\puiseux[x_1,\dots,x_n]$. Let $\omega=({1\over
4902})\in\R^1$. Then $\tinit_\omega(f)=1+x^2$. For any
491other choice of $\omega$ the t-initial form is a monomial.
492\end{example}
493\begin{definition}
494Let $I\subseteq \puiseux[x_1,\dots,x_n]$ and $\omega\in\R^n$. The \emph{t-initial ideal}\index{t-initial ideal} of $I$ with respect to $\omega$ is defined as:
495$$\tinit_\omega(I):=\langle \tinit_\omega(f):f\in I\rangle\subseteq\CC[x_1,\dots,x_n].$$
496\end{definition}
497
498\begin{definition}
499\label{def:tropvar}
500Let $I\subseteq \puiseux[x_1,\dots,x_n]$ be an ideal. The \emph{tropical variety} of $I$ is the set
501$$\T'(I):=\{\omega\in\R^n:\tinit_\omega(I) \textup{ is monomial-free}\}.$$
502%Here monomial-free\index{monomial-free} means that the ideal does not contain a monomial.
503\end{definition}
504We use the notation $\T'(I)$ to avoid contradicting our original definition
505of the tropical variety of an ideal in the polynomial ring over a
506field.
507%An important theorem says that the tropical variety of $I$ is also the
508%negative of the closure of the image of $V(I)\subseteq \CC\{\{t\}\}^*$
509%under the coordinatewise valuation.
510
511
512\begin{proposition} \cite[Proposition~7.3]{lifting}
513\label{prop:computing tinit}
514Let $I\subseteq \CC[t,x_1,\dots,x_n]$ be an ideal, $J=\langle I\rangle_{\puiseux[x_1,\dots,x_n]}$ and $\omega\in\R^n$. Then $\textup{t-in}_\omega(I)=\textup{t-in}_\omega(J)$.
515\end{proposition}
516
517\begin{remark}
518\label{rem:computing tinit}
519For $f\in\CC[t,x_1,\dots,x_n]$ we have
520$\tinit_\omega(f)=(\init_{(-1,\omega)}(f))|_{t=1}$. Consequently, for
521$I\subseteq\CC[t,x_1,\dots,x_n]$ we have
522$\tinit_\omega(I)=(\init_{(-1,\omega)}(I))|_{t=1}$. In order to
523decide if $\tinit_\omega(I)$ contains a monomial we may simply decide if the initial ideal
524$\init_{(-1,\omega)}(I)$ contains a monomial.
525 As a corollary we get
526$$\T(I)\cap(\{-1\}\times\R^n)=\{-1\}\times\T'(J).$$
527
528In fact this gives a method for computing the tropical variety as a set of any
529ideal $J\subseteq\CC\{\{t\}\}[x_1,\dots,x_n]$ generated by elements
530in the polynomial ring over the field of rational functions
531$\Q(t)[x_1,\dots,x_n]$ in Gfan by clearing denominators and
532intersecting the result with the $t=-1$ plane.  (We remind the reader
533that Lemma~\ref{lem:tropical by homogenisation} shows that for
534computational purposes it is no restriction if $I$ is not
535homogeneous.)
536\end{remark}
537
538Intersecting the tropical variety with the $t=-1$ plane can with some difficulty be done by
539hand. If the tropical (pre)-variety has been computed with
540\texttt{gfan\_tropicalintersection} then it is also possible to let Gfan do
541the intersection. What Gfan does is to compute the common refinement
542of the fan with the fan consisting of the halfspace $t\leq 0$ and its
543proper face. Of course this does not remove the cones in the $t=0$
544plane, but they are easily removed by hand. We illustrate the
545procedure by an example.
546
547\begin{example}
548\label{ex:nonconstant}
549Exercise 2 in Chapter 9 of \cite{sturmfelssolving} asks us to draw the variety
550defined by the \emph{tropical} polynomial
551$f=1x^2+2xy+1y^2+3x+3y+1$. If we tropically divide this polynomial by $3$ we get $f':=f/3=-2x^2-1xy-2y^2+0x+0y+-2$ which defines the same tropical variety. This variety equals the variety defined by
552the polynomial $g=t^2x^2+txy+t^2y^2+x+y+t^2\in\CC\{\{t\}\}[x,y]$. Notice that $f'$ is the tropicalisation of $g$.
553
554According to Remark~\ref{rem:computing tinit} above the we may compute $\T'(\langle g\rangle)$ by computing
555the variety of $\langle t^2x^2+txy+t^2y^2+x+y+t^2\rangle\subseteq \CC[t,x,y]$ and intersecting it with the hyperplane $t=-1$.
556Running
557\begin{verbatim}
558gfan_tropicalintersection --tplane
559\end{verbatim}
560on
561\begin{verbatim}
562Q[t,x,y]
563{t^2x^2+txy+t^2y^2+x+y+t^2}
564\end{verbatim}
565we get
566\begin{verbatim}
567RAYS
5680 -1 0	# 0
569-1 2 1	# 1
5700 1 1	# 2
571-1 1 1	# 3
572-1 -2 -2	# 4
5730 0 -1	# 5
574-1 1 2	# 6
575
576MAXIMAL_CONES
577{3 4}	# Dimension 2
578{2 6}
579{1 3}
580{1 2}
581{3 6}
582{4 5}
583{0 4}
584{0 6}
585{1 5}
586\end{verbatim}
587among other information. We can now draw the two-dimensional picture
588asked for in the exercise.  The rays with non-zero first coordinate
589become points in the picture. (If the first coordinate is not $-1$ scaling
590is required to get the rational $x,y$-coordinates.) The rays with zero
591first coordinate become directions. The maximal cones show how to
592connect the rays; see Figure~\ref{fig:nonconstant}. Notice that some
593of the connections could have been ``at infinity''.
594\begin{figure}
595\begin{center}
596\epsfig{file=nonconst.eps,height=5.5cm}
597\end{center}
598\caption{The tropical variety defined by the tropical polynomial in Example~\ref{ex:nonconstant}.}
599\label{fig:nonconstant}
600\end{figure}
601
602\end{example}
603
604\subsubsection{Algebraic field extensions of $\Q$}
605Ignoring time, memory usage and overflows Gfan can compute the tropical variety $\T'(I)$ of any ideal $I\subseteq \puiseux[x_1,\dots,x_n]$ generated by elements of $\overline{\Q}(t)[x_1,\dots,x_n]$. This is a consequence of the following lemma:
606\begin{lemma}\cite[Lemma~3.12]{lifting}
607\label{lem:fieldextension}
608Let $k$ be a field and $M=\langle m\rangle\subseteq k[a]$ a maximal ideal where $m$ is not a monomial. Let
609$I\subseteq (k[a]/M)[x_1,\dots,x_n]$ be an ideal. For $\omega\in\R^n$ we
610have
611$$\init_\omega(I) \textup{ contains a monomial} \Longleftrightarrow \init_{(0,\omega)}(\varphi^{-1}(I)) \textup{ contains a monomial}$$
612where $\varphi:k[a,x_1,\dots,x_n]\rightarrow (k[a]/M)[x_1,\dots,x_n]$ is the homomorphism taking elements to their cosets.
613\end{lemma}
614