\usepackage{xspace}

\DeclareSymbolFont{stmry}{U}{stmry}{m}{n}
\DeclareMathSymbol\mapsfromchar\mathrel{stmry}{"5B}
\def\mapsfrom{\leftarrow\mapsfromchar}
\def\longmapsfrom{\longleftarrow\mapsfromchar}

\newcommand{\ie}{{i.e.}\xspace} % also requires "," to the left!
\newcommand{\eg}{{e.g.}\xspace} % also requires "," to the left!
\newcommand{\etc}{{etc}\xspace}
\newcommand{\arXiv}[1]{\texttt{arXiv:#1}}

\DeclareMathOperator*{\argmax}{\arg\max}

\DeclareMathOperator*{\sign}{sign}
\DeclareMathOperator*{\tsign}{tsign}
\DeclareMathOperator*{\tdet}{tdet}
%\DeclareMathOperator*{\tper}{tper}
\DeclareMathOperator*{\tper}{tdet}
\DeclareMathOperator*{\sdet}{sdet}

\newcommand{\bal}{\mathrel{\nabla}}

%\DeclareMathOperator*{\tconv}{tconv}
\DeclareMathOperator*{\tcone}{tpos}
\DeclareMathOperator*{\tpos}{\tcone}

\DeclareMathOperator*{\conv}{conv}
\DeclareMathOperator*{\cone}{pos}

\DeclareMathOperator*{\Sym}{Sym}
\DeclareMathOperator*{\rank}{rank}
\DeclareMathOperator*{\Coeffs}{coeff}
\DeclareMathOperator*{\diag}{diag}

\newcommand{\lpvalue}{\nu}
\newcommand{\hardyex}{{\bf LP}} % correct typesetting in theorem like environments
\newcommand{\tropex}{{\rm LP}} % correct typesetting in theorem like environments

\newcommand{\deriv}[1]{%
\accentset{\mbox{\large\bfseries .}}{#1}
%\overset{\bm .}{#1}
}
\newcommand{\dderiv}[1]{%
\accentset{\mbox{\large\bfseries .\hspace{-0.25ex}.}}{#1}
%\overset{\bm . \bm .}{#1}
}

\newcommand{\tropcpath}{\Phi^{\text{\rm trop}}}
\newcommand{\troppath}{\mathcal{C}^{\text{\rm trop}}}
\newcommand{\troppathprimal}{\mathcal{C}^{\text{\rm trop}}_{\text{\rm primal}}}

\newcommand{\pcpath}{\Phi}
\newcommand{\arcpath}{\Gamma}

\newcommand{\interior}[1]{\accentset{\circ}{#1}}

\newcommand{\lang}{\mathcal{L}}
\newcommand{\arity}{\text{arity}}

%\newcommand{\struct}{\mathfrak{M}}
\newcommand{\theory}{\text{Th}}

\newcommand{\struct}{\mathfrak{R}}
\newcommand{\mystruct}{\bar{\R} ^ {\R}}


\DeclareMathAlphabet\mathbfcal{OMS}{cmsy}{b}{n}
\newcommand{\bbfamily}{\fontencoding{U}\fontfamily{bbold}\selectfont}
\DeclareMathAlphabet{\mathbbold}{U}{bbold}{m}{n}

\newcommand{\subdiv}[1]{\Sigma(#1)}
\newcommand{\hyper}[1]{\mathcal{H}(#1)}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
%\newcommand{\abs}[1]{\operatorname{abs}(#1)} % absolute value must be distinct from modulus

%usual fields
\newcommand{\R}[0]{\mathbb{R}}       %real    
\newcommand{\Rmax}[0]{\mathbb{R}_{\max}}       %real 
\newcommand{\Q}[0]{\mathbb{Q}}       %real    
\newcommand{\Qmax}[0]{\mathbb{Q}_{\max}}       %real   
\newcommand{\Z}[0]{\mathbb{Z}}       %real    

\newcommand{\F}[0]{\mathbb {F}}                % some (ordered) field
\newcommand{\K}[0]{\mathbb {K}}                % Hardy field


%real subsets
\newcommand{\realP}[0]{\mathcal{P}}     %real polyhedron


%tropical "fields"
\newcommand{\trop}[1][]{
\ifthenelse{\equal{#1}{}}{ \mathbb{T} }{ \mathbb{T}(#1) }%
}    %tropical

\newcommand{\strop}[1][]{{\trop[#1]}_{\pm}}    %tropical signed
\newcommand{\postrop}[1][]{{\trop[#1]}_{+}}    %tropical signed
\newcommand{\negtrop}[1][]{{\trop[#1]}_{-}}    %tropical signed
\newcommand{\baltrop}[1][]{{\trop[#1]}_{\bullet}}    %tropical signed
%\newcommand{\symtrop}[1][]{{\trop[#1]}_{\diamond}}    %tropical signed
\newcommand{\tropProj}[1][]{\trop[#1] \mathbb{P}}%tropical projective space

% \newcommand{\trop}[1][\group]{\overline{#1}}    %tropical
% \newcommand{\strop}[1][\group]{\trop[#1]_{\!\pm}}    %tropical signed
\newcommand{\symtrop}[1][]{\mathbb{S}\trop[#1]}    %tropical signed
\newcommand{\shortsymtrop}{\mathbb{S}}    %tropical signed
% \newcommand{\tropProj}[1][\group]{\trop[#1] \mathbb{P}}%tropical projective space

%matrix operation
\newcommand{\transpose}[1]{#1^{\top}}

%tropical operations
\newcommand{\tplus}{\oplus}          %tropical addition
\newcommand{\tsum}{\bigoplus}        %tropical sum
\newcommand{\ttimes}{\odot}       %tropical multiplication
\newcommand{\tdot}{\odot} 	%tropical dot product
\newcommand{\tscale}{\ttimes}               %tropical scaling [officially approved by SG, PB & MJ on June 25, 2013]
\newcommand{\tminus}{\ominus}        %tropical negative sign

%signed tropical operations
\newcommand{\splus}{\oplus}
\newcommand{\ssum}{\bigoplus}
\newcommand{\stimes}{\odot}
%\newcommand{\sproduct}{\bigodot}
\newcommand{\sdot}{\odot}


%tropical shorthands
\newcommand{\zero}{\mathbbold{0}}    %tropical zero
%\newcommand{\zero}{-\infty}    %tropical zero
\newcommand{\unit}{\mathbbold{1}}    %tropical unit
\newcommand{\tropP}{\mathcal{P}}  %tropical polyhedron
\newcommand{\tropQ}{\mathcal{Q}}  %tropical polyhedron
\newcommand{\tropR}{\mathcal{R}}  %tropical polyhedron
\newcommand{\tropC}{\mathcal{C}}  %tropical cone
\newcommand{\tropD}{\mathcal{D}}  %tropical dual polyhedron
\newcommand{\tropE}{\mathcal{E}}  %tropical dual polyhedron
\newcommand{\tropS}{\mathcal{S}}  %tropical dual polyhedron
\newcommand{\tropH}{\mathcal{H}} 		%tropical signed hyperplane

\newcommand{\recCone}{\mathsf{Rec}}

\newcommand{\xopt}{x_{\rm opt}} % optimal solution of tropical linear program

%puiseux fields
%\newcommand{\puiseux}[0]{\mathbb{K}} %Puiseux, shorthand
\newcommand{\puiseux}[0]{\R\{\!\{t\}\!\}} %Puiseux
\newcommand{\convpuiseux}[0]{\R_{\text{conv}}\{\!\{t\}\!\}} % convergent Puiseux series
\newcommand{\hahn}[1]{\R[\![t^{#1}]\!]}

%valuations
\DeclareMathOperator*{\val}{val}
\DeclareMathOperator*{\lc}{lc}
\DeclareMathOperator*{\sval}{sval}

%puiseux shorthands
\newcommand{\puiseuxP}[0]{\bm{\mathcal{P}}}   %Puiseux polyhedron
\newcommand{\puiseuxQ}[0]{\bm{\mathcal{Q}}}   %Another puiseux polyhedron
\newcommand{\puiseuxS}[0]{\bm{\mathcal{S}}}   %Another puiseux polyhedron
\newcommand{\puiseuxH}[0]{\bm{\mathcal{H}}}             %Puiseux halfspace
\newcommand{\puiseuxC}[0]{\bm{\mathcal{C}}}   %Puiseux cone
\newcommand{\puiseuxD}[0]{\bm{\mathcal{D}}}   %Puiseux dual polyhedron
\newcommand{\puiseuxE}[0]{\bm{\mathcal{E}}}   %Puiseux edge
\newcommand{\puiseuxX}[0]{\bm{\mathcal{X}}}   %Puiseux set
\newcommand{\puiseuxId}[0]{\textbf{Id}}
%puiseux vars
\newcommand{\x}[0]{\bm{x}}
\newcommand{\y}[0]{\bm{y}}
\newcommand{\s}[0]{\bm{s}}
\newcommand{\p}[0]{\bm{p}}
\newcommand{\cc}[0]{\bm{c}}
\newcommand{\A}[0]{\bm{A}}
\newcommand{\Ss}[0]{\bm{S}}
\renewcommand{\P}[0]{\bm{P}}
\newcommand{\W}[0]{\bm{W}}
%\newcommand{\D}[0]{\bm{D}}
\renewcommand{\b}[0]{\bm{b}}
\renewcommand{\a}[0]{\bm{a} }
\newcommand{\vv}[0]{\bm{v} }
\newcommand{\V}[0]{\bm{V} }
\newcommand{\puiseuxR}[0]{\bm{\mathcal{R}}}
\newcommand{\plambda}[0]{\bm{\lambda} }
\newcommand{\pmu}[0]{\bm{\mu} }
%\renewcommand{\d}[0]{\bm{d}}
\newcommand{\M}[0]{\bm{M}}
\newcommand{\m}[0]{\bm{m}}
\renewcommand{\H}[0]{\bm{H}}
\newcommand{\puiseuxl}[0]{\bm{l}}
\newcommand{\puiseuxu}[0]{\bm{u}}

\newcommand{\ep}{w}  %extended primal coeff
\newcommand{\epm}{W} %extended primal matrix
\newcommand{\epr}{W} %extended primal row

\newcommand{\pr}{A} %primal row

\newcommand{\Mrow}{M} %row for cramer systems

\newcommand{\pep}{\bm{w}} %extended primal coeff
\newcommand{\pepm}{\bm{W}}%extended primal matrix
\newcommand{\pepr}{\bm{W}}%extended primal row

\newcommand{\ppr}{\A} % primal row


%(hyper)graphs
\newcommand{\hgraph}[0]{\mathcal{H}}
\newcommand{\graph}[0]{\mathcal{G}}
\newcommand{\digraph}[0]{\vec{\mathcal{G}}}

\DeclareMathOperator*{\supp}{supp}
\DeclareMathOperator*{\sat}{sat}

\newcommand{\hgraphAx}[0]{\hgraph(\tropC_A, x)}
\newcommand{\graphAx}[0]{\graph(\tropC_A, x)}

\newcommand{\satAx}[0]{\sat(\tropCofA, x)}

\newcommand{\arrangement}{\mathcal{A}}
\newcommand{\arrangementPuiseux}{\bm{\mathcal{A}}}
\newcommand{\allMinors}{\mathfrak{M}}

%algo sets
\newcommand{\breakHyp}[0]{\mathsf{Br}}
\newcommand{\enteringHyp}[0]{\mathsf{Ent}}

\newcommand{\bound}[0]{\gamma}
\newcommand{\neigh}[0]{\delta}
\newcommand{\Jdiff}[0]{\Delta}
\newcommand{\Mu}[0]{\Gamma}

\newcommand{\inci}[0]{\mathcal{I}}

\newcommand{\basis}[0]{I}

\newcommand{\ileaving}[0]{i^{\mathsf{out}}}
\newcommand{\ient}[0]{i^{\mathsf{ent}}}

\newcommand{\ibreak}[0]{k}

\newcommand{\aleaving}[0]{a_{\mathsf{old}}}
\newcommand{\aent}[0]{a_{\mathsf{new}}}

\newcommand{\leaving}[0]{\mathsf{old}}
\newcommand{\ent}[0]{\mathsf{new}}





% \newcommand{\germsF}{\mathbb{G}'}
% \newcommand{\sgerms}{\mathbb{G}_{\!\pm}}

%\newcommand{\gzero}{\zero_{\germs}}

% \newcommand{\gA}{\bar{A}}
% \newcommand{\ga}{\bar{a}}
% \newcommand{\gb}{\bar{b}}
% \newcommand{\gx}{\bar{x}}
% \newcommand{\gs}{\bar{s}}
% \newcommand{\gc}{\bar{c}}
% \newcommand{\gz}{\bar{z}}
% \newcommand{\gy}{\bar{y}}
% \newcommand{\gw}{\bar{w}}

% \newcommand{\gmu}{\bar{\mu}}
% \newcommand{\gl}{\bar{l}}

% \newcommand{\gM}{\bar{M}}
% \newcommand{\gd}{\bar{d}}


%puiseux germs

%\newcommand{\hahn}{\mathbb{H}}
%\newcommand{\hahnF}{\mathbb{H}'}

\newcommand{\hA}{\bar{\A}}
\newcommand{\ha}{\bar{\a}}
\newcommand{\hb}{\bar{\b}}
\newcommand{\hx}{\bar{\x}}
\newcommand{\hc}{\bar{\cc}}
\newcommand{\hz}{\bar{\bm{z}}}
\newcommand{\hy}{\bar{\y}}
\newcommand{\hw}{\bar{\bm{w}}}
\newcommand{\he}{\bar{\bm{e}}}
%\newcommand{\hl}{\bar{\bm{l}}}

\newcommand{\hM}{\bar{\bm{M}}}
\newcommand{\hd}{\bar{\bm{d}}}

\newcommand{\hu}{\bar{\bm{u}}}
\newcommand{\hlow}{\bar{\bm{l}}}

\newcommand{\hmu}{\bar{\bm{\mu}}}
\newcommand{\hr}{\bar{\bm{r}}}

\newcommand{\hP}{\bar{\bm{\mathcal{P}}}}
\newcommand{\hLP}{\bar{\bm{LP}}}

\newcommand{\hE}{\bar{\bm{\mathcal{E}}}}

% relint
\DeclareMathOperator*{\relint}{relint}

\DeclarePairedDelimiter{\oiv}{]}{[}


\newcommand{\group}{G}

%\newcommand{\ext}[1]{\overline{#1}}

\newcommand{\plus}[1]{\mathbin{+_{#1}}}
\newcommand{\order}[1]{\mathbin{<_{#1}}}

\newcommand{\groupPrime}{H}

\newcommand{\first}{\pi}

\newcommand{\tropLP}{\text{LP}}
\newcommand{\phaseI}{\text{Phase I}}%\eqref{pb:phase_I}} %{LP Phase I}
\newcommand{\puiseuxLP}{\bm{LP}}
\newcommand{\IpertLP}{\overline{\Ipert{LP}}}%\eqref{pb:IpertLP}}
\newcommand{\pertLP}{{\widetilde{\Ipert{LP}}}}%\eqref{pb:pertLP}}

%tropical epsilon germs

\newcommand{\germs}{\mathbb{G}}
\newcommand{\sgerms}{\mathbb{G}_{\!\pm}}

\newcommand{\cpath}{\mathcal{C}}

% \newcommand{\perturb}[2][]{
% \ifthenelse{\equal{#1}{}}{ \tilde{#2} }{ \tilde{#2}[#1] }%
% }

\newcommand{\perturb}[2][]{
\ifthenelse{\equal{#1}{}}{ \tilde{\Ipert{#2}} }{ #2[#1] }%
}
\newcommand{\pert}[2][]{
\ifthenelse{\equal{#1}{}}{ \widetilde{\Ipert{#2}} }{ \Ipert{#2}[#1] }%
}

\newcommand{\epsMat}{E}
\newcommand{\epsMatEnt}{\epsilon}
\newcommand{\epsMatRow}{E}

%\newcommand{\pert}[1]{\tilde{#1}}

%tropical infinite germs

\newcommand{\Igroup}{F}

\newcommand{\Igerms}{\mathbb{I}} %semiring with of all pairs
\newcommand{\fIgerms}{\mathbb{F}} %semiring composed with pairs (a,b) s.t. a \leq 0

\newcommand{\sIgerms}{\Igerms_{\!\pm}}

\newcommand{\second}{\rho}


\newcommand{\ib}{\alpha^b}
\newcommand{\il}{\alpha^l}
\newcommand{\iu}{\alpha^u}


\newcommand{\Ipert}[1]{
\mathsf{#1}}

\newcommand{\Iperturb}[1]{\Ipert{#1}}

\newcommand{\norm}[1]{\|#1\|}
\newcommand{\scalar}[2]{\langle#1,#2\rangle}
\newcommand{\dif}{\text{d}}

\newcommand{\iter}{\mathsf{Iter}}
\newcommand{\signMinors}{\mathsf{Signs}}

\newcommand{\strategy}{\phi}
\newcommand{\strategytrop}{\strategy^{\text{trop}}}

%\newcommand{\MinorOracle}{{\sf SignMinor}}
\newcommand{\MinorOracle}{$\Omega$}
\newcommand{\classicalpuiseux}{\R\{\!\{t\}\!\}}
%\newcommand{\ang}{\operatorname{ang}}
%\newcommand{\tang}{\operatorname{tang}}
\newcommand{\tangle}{\angle^t}
\newcommand{\tarcos}{\operatorname{tarccos}}
\newcommand{\tropicalnorm}[1]{\|#1\|_t}
\newcommand{\tropicalscalarprod}[2]{\langle #1,#2\rangle_t}


\newcommand{\funk}{\delta_{\mathrm F}}
\newcommand{\hilbert}{d_{\mathrm H}}
\newcommand{\inverse}[1]{\jmath(#1)}

\newcommand{\puiseuxA}[0]{\bm{\mathcal{A}}} 
\newcommand{\f}[0]{\bm{f}}
\newcommand{\g}[0]{\bm{g}}
%\newcommand{\cone}{\operatoname{cone}}
\newcommand{\vol}{\operatorname{vol}}
\newcommand{\pol}{\operatorname{pol}}
\newcommand{\Kplus}{\K_{\geq 0}}

\DeclareMathOperator*{\atconv}{tconv}
\DeclareMathOperator*{\sgn}{sgn}

\DeclareMathOperator*{\Log}{Log}

