%%%%%%%%%%%%%%%%%
%%% Alphabets %%%
%%%%%%%%%%%%%%%%%

% Raccourcis grecs
\newcommand{\ag}{\alpha}
\newcommand{\bg}{\beta}
\newcommand{\Gg}{\Gamma}
\newcommand{\gag}{\gamma}
\newcommand{\Dg}{\Delta}
\newcommand{\dg}{\delta}
\newcommand{\eg}{\varepsilon}
\newcommand{\zg}{\zeta}
\newcommand{\hg}{\eta}
\newcommand{\Tg}{\Theta}
\newcommand{\tg}{\theta}
\newcommand{\ig}{\iota}
\newcommand{\kg}{\kappa}
\newcommand{\Lg}{\Lambda}
\renewcommand{\lg}{\lambda}
\newcommand{\rg}{\rho}
\newcommand{\Sg}{\Sigma}
\newcommand{\sg}{\sigma}
\newcommand{\Ug}{\Upsilon}
\newcommand{\ug}{\upsilon}
\renewcommand{\phi}{\varphi}
\newcommand{\Og}{\Omega}
\newcommand{\omg}{\omega}

% Raccourcis ensemblistes
\newcommand{\C}{\mathbb{C}}
\newcommand{\D}{\mathbb{D}}
\newcommand{\Hh}{\mathbb{H}}
\newcommand{\K}{\mathbb{K}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\U}{\mathbb{U}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Ss}{\mathfrak{S}_n}

% Raccourcis lettres rondes
\renewcommand{\AA}{\mathcal{A}}
\newcommand{\BB}{\mathcal{B}}
\newcommand{\CC}{\mathcal{C}}
\newcommand{\DD}{\mathcal{D}}
\newcommand{\EE}{\mathcal{E}}
\newcommand{\FF}{\mathcal{F}}
\newcommand{\GG}{\mathcal{G}}
\newcommand{\HH}{\mathcal{H}}
\newcommand{\II}{\mathcal{I}}
\newcommand{\NN}{\mathcal{N}}
\newcommand{\MM}{\mathcal{M}}
\newcommand{\LL}{\mathcal{L}}
\newcommand{\OO}{\mathcal{O}}
\newcommand{\PP}{\mathcal{P}}
\newcommand{\QQ}{\mathcal{Q}}
\newcommand{\RR}{\mathcal{R}}
\renewcommand{\SS}{\mathcal{S}}
\newcommand{\TT}{\mathcal{T}}
\newcommand{\UU}{\mathcal{U}}
\newcommand{\VV}{\mathcal{V}}

% Raccourcis lettres manuscrites
\RequirePackage{mathrsfs}
\newcommand{\ELL}{\mathscr{L}}

% Pour avoir de grandes tildes
\renewcommand{\tilde}{\widetilde}



%%%%%%%%%%%%%%%%%%%%%%
%%% Environnements %%%
%%%%%%%%%%%%%%%%%%%%%%

% Pour avoir de grands tableaux
\newenvironment{disarray}%
 {\everymath{\displaystyle\everymath{}}\array}%
 {\endarray}

% Encadrements
\newenvironment{encadrement}{\begin{disarray}{rcccl}}{\end{disarray}}

% Systemes lineaires
\RequirePackage{array}
\newenvironment{systeme}{\left\{ \! \begin{array}{r @{\,}c @{\,} l @{\;}>{\scriptstyle}l}}{\end{array}\right.}
\newcommand{\ot}{\leftarrow}



%%%%%%%%%%%%%%%
%%% Logique %%%
%%%%%%%%%%%%%%%
% Ensembles
\newcommand{\privede}{\backslash}

% Logique
\newcommand{\tq}{~;~}
\newcommand{\pourtout}{\forall~}
\newcommand{\existe}{\exists~}
\newcommand{\implique}{~\Rightarrow~}
\newcommand{\non}{\textsc{non}~}
\newcommand{\et}{~\textsc{et}~}
\newcommand{\ou}{~\textsc{ou}~}
\newcommand{\equivaut}{~\Leftrightarrow~}

% Arithmetiques
\RequirePackage{stmaryrd}
\newcommand{\entiers}[2]{\llbracket#1,#2\rrbracket}
\newcommand{\signe}[1]{\mathrm{signe}(#1)}
\newcommand{\cl}[1]{\mathrm{cl}(#1)}
\DeclareMathOperator{\val}{val}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\DeclareMathOperator{\pgcd}{pgcd}
\DeclareMathOperator{\ppcm}{ppcm}


%%%%%%%%%%%%%%%
%%% Algebre %%%
%%%%%%%%%%%%%%%

\newcommand{\rel}{\preccurlyeq}

% Calcul
\newcommand{\dsum}{\sum\limits}
\newcommand{\dprod}{\prod\limits}

% Nombres complexes
\renewcommand{\mod}[1]{~[#1]}
\renewcommand{\Re}{\mathrm{Re}}
\renewcommand{\Im}{\mathrm{Im}}
\renewcommand{\bar}{\overline}
\renewcommand{\angle}{\widehat}

% Vecteurs
\newcommand{\vu}{\vect{u}}
\newcommand{\vv}{\vect{v}}
\newcommand{\vw}{\vect{w}}
\newcommand{\vt}{\vect{t}}
\newcommand{\vi}{\vect{i}}
\newcommand{\vj}{\vect{j}}
\newcommand{\vk}{\vect{k}}

% Espaces vectoriels
\newcommand{\vect}{\overrightarrow}
\newcommand{\Gl}{\mathcal{G}\ell}
\DeclareMathOperator{\Id}{Id}
\DeclareMathOperator{\Rg}{Rg}
\DeclareMathOperator{\Ima}{Im}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\Vect}{Vect}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\Res}{Res}
\newcommand{\ps}[2]{\left(#1|#2\right)}
\DeclareMathOperator{\trans}{{}^t\!}

% Polynomes
\renewcommand{\degre}{\mathrm{deg}}

%%%%%%%%%%%%%%%
%%% Analyse %%%
%%%%%%%%%%%%%%%

% Definition fonctions
\newcommand{\fct}[5]{
\begin{array}[t]{l@{\,}c@{\,}c@{\,}l}
  #1\,:\,&  #2 & \to     & #3 \\
         & #4 & \mapsto & #5
 \end{array}
}


\newcommand{\dlim}{\lim\limits}
\newcommand{\dsup}{\sup\limits}
\newcommand{\dinf}{\inf\limits}

\newcommand{\vabs}[1]{\left| #1 \right|}

% Les fonctions usuelles
\DeclareMathOperator{\argch}{argch}
\DeclareMathOperator{\argsh}{argsh}
\DeclareMathOperator{\argth}{argth}
\DeclareMathOperator{\cotan}{cotan}
\DeclareMathOperator{\arccotan}{acotan}

% Integration
\newcommand{\dint}{\displaystyle \int}
\newcommand{\diint}{\displaystyle \iint}
\newcommand{\dt}{\:dt}
\newcommand{\dx}{\:dx}
\newcommand{\dy}{\:dy}
\newcommand{\du}{\:du}
\newcommand{\dv}{\:dv}

% Derivation
\newcommand{\difx}[1]{\frac{\partial #1}{\partial x_1}}
\newcommand{\dify}[1]{\frac{\partial #1}{\partial x_2}}
\newcommand{\difxy}[1]{\frac{\partial^2 #1}{\partial x_1 \partial x_2}}
\newcommand{\difyx}[1]{\frac{\partial^2 #1}{\partial x_2 \partial x_1}}
\newcommand{\difxx}[1]{\frac{\partial^2 #1}{\partial x_1^2}}
\newcommand{\difyy}[1]{\frac{\partial^2 #1}{\partial x_2^2}}

%%%%%%%%%%%%%%%%%%%%
%%% Probabilites %%%
%%%%%%%%%%%%%%%%%%%%

% Pour faire des indicatrices
\RequirePackage{bbm}
\newcommand{\indicatrice}[1]{\ensuremath{\mathbbm{1}_{#1}}}
\newcommand{\comp}[1]{{}^c~#1}

% Probabilites
\renewcommand{\P}{\mathbb{P}}
\newcommand{\E}{\mathbb{E}}

%%%%%%%%%%%%%%%%%%%%
%%% Informatique %%%
%%%%%%%%%%%%%%%%%%%%
\newcommand{\commande}[1]{{\normalfont\tt #1}\index{{\tt #1}}}
\newcommand{\code}[1]{{\normalfont\tt #1}}
\RequirePackage{xspace}
\newcommand{\Maple}{{\sf Maple}\xspace}

