%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Basic packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath,amsthm,amssymb}
\usepackage{mathtools}
\usepackage{etoolbox}
\usepackage{mathpartir}
\usepackage{hyperref}
\usepackage{stmaryrd}
\usepackage[all]{xy}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Theorem-like environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{plain}% default
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{task}{Task}
\newtheorem{bonus}{Bonus Task}
\newenvironment{hint}{\noindent{\bf (Hint)}}{}

\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]

\theoremstyle{remark}
\newtheorem*{remark}{Remark}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ITT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newrobustcmd*{\ctx}{\Gamma}
\newrobustcmd*{\entails}{\vdash}
\newrobustcmd*{\jdeq}{\equiv} %%% judgmental equality
\newrobustcmd*{\defeq}{\vcentcolon\equiv} %%% definition. Sorry I screwed this up.
\newrobustcmd*{\id}{\mathtt{id}}
\newrobustcmd*{\dummy}{\underline{\hspace{0.5em}}}
% Units
\newrobustcmd*{\triv}{\langle\rangle}
% Products
\newrobustcmd*{\fst}{\mathtt{fst}}
\newrobustcmd*{\snd}{\mathtt{snd}}
\newrobustcmd*{\pair}[2]{\langle #1,#2\rangle}
\newrobustcmd*{\tuplepair}[2]{\langle #1,#2\rangle}
% Sums
\newrobustcmd*{\inl}{\mathtt{inl}}
\newrobustcmd*{\inr}{\mathtt{inr}}
\newrobustcmd*{\case}{\mathtt{case}}
% Natural numbers
\newrobustcmd*{\rec}{\mathtt{rec}}
\newrobustcmd*{\zero}{\mathtt{zero}}
\newrobustcmd*{\suc}{\mathtt{suc}}
\newrobustcmd*{\N}{\mathbb{N}}
\newrobustcmd*{\nat}{\mathtt{nat}}
% Identity
\newrobustcmd*{\Id}{\mathtt{Id}}
\newrobustcmd*{\refl}{\mathtt{refl}}
\newrobustcmd*{\J}{\mathsf{J}}
\newrobustcmd*{\sym}{\mathtt{sym}}
\newrobustcmd*{\trans}{\mathtt{trans}}
\newrobustcmd*{\ap}{\mathtt{ap}}
\newrobustcmd*{\tr}{\mathtt{tr}}
%%% Path concatenation
\newrobustcmd*{\concat}{%
  \mathchoice{\mathbin{\raisebox{0.5ex}{$\displaystyle\centerdot$}}}%
  {\mathbin{\raisebox{0.5ex}{$\centerdot$}}}%
  {\mathbin{\raisebox{0.25ex}{$\scriptstyle\,\centerdot\,$}}}%
  {\mathbin{\raisebox{0.1ex}{$\scriptscriptstyle\,\centerdot\,$}}}
}
% Universes
\newrobustcmd*{\U}{\mathcal{U}}
