\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{xgeometry}[2021/02/09 1.0.0 Usefull definitions for Riemannian
geometry and Lie groups/algebras]

\RequirePackage{amssymb}  % For the standard sets
\RequirePackage{amsmath}  % For \DeclareMathOperator
\RequirePackage{tikz}     % For \tikzset

% Smooth manifolds
\DeclareMathOperator{\Der}{Der}   % Algebra of formal derivations on a manifold

% Riemannian geometry
\newcommand{\g}{\mathrm{g}}     % Reimannian metric
\DeclareMathOperator{\Iso}{Iso} % Isometry group
\DeclareMathOperator{\Hol}{Hol} % Holonomy group

% Diferential forms
\newcommand{\exterior}{\mathrm{d}} % The exterior derivative
\newcommand{\dd}{\exterior}        % Alias for \exterior
\newcommand{\dx}{\exterior x}      % dx
\newcommand{\dy}{\exterior y}      % dy
\newcommand{\dz}{\exterior z}      % dz
\newcommand{\dt}{\exterior t}      % dt

% Lie groups and algebras
\DeclareMathOperator{\GL}{GL}       % General linear group
\DeclareMathOperator{\SL}{SL}       % Simple linear group
\DeclareMathOperator{\SO}{SO}       % Simple orthogonal group
\DeclareMathOperator{\SU}{SU}       % Simple unitary group
\DeclareMathOperator{\Sp}{Sp}       % Sympletic group
\newcommand{\PR}{\mathbb{PR}}       % Projective real group
\newcommand{\RP}{\mathbb{RP}}       % Projective real group
\newcommand{\PC}{\mathbb{PC}}       % Projective complex group
\newcommand{\CP}{\mathbb{CP}}       % Projective complex group
\DeclareMathOperator{\PGL}{PGL}     % Projective general linear group
\DeclareMathOperator{\PSL}{PSL}     % Projective general linear group
\newcommand{\gl}{\mathfrak{gl}}     % Lie algebra of \GL
\renewcommand{\sl}{\mathfrak{sl}}   % Lie algebra of \SL
\newcommand{\so}{\mathfrak{so}}     % Lie algebra of \SO
% The following is ommited because \sp is a spacing character
% \renewcommand{\sp}{\mathfrak{sp}} % Lie algebra of \Sp
\newcommand{\pr}{\mathfrak{pr}}     % Lie algebra of \PR
\newcommand{\rp}{\mathfrak{rp}}     % Lie algebra of \RP
\newcommand{\pc}{\mathfrak{pC}}     % Lie algebra of \PC
\newcommand{\cp}{\mathfrak{cp}}     % Lie algebra of \CP
\newcommand{\pgl}{\mathfrak{pgl}}   % Lie algebra of \PGL
\newcommand{\psl}{\mathfrak{psl}}   % Lie algebra of \PSL

% Representation theory of Lie groups and algebras
\DeclareMathOperator{\Ad}{Ad}
\DeclareMathOperator{\ad}{ad}

% Projective spaces
\renewcommand{\RP}{{\mathbb{R}\mathrm{P}}}
\renewcommand{\CP}{{\mathbb{C}\mathrm{P}}}

% Double Hat! (for Pontryagin duals of Pontryagin duals)
\makeatletter
\newcommand{\doublehat}[1]{% 
\begingroup%
  \let\macc@kerna\z@%
  \let\macc@kernb\z@%
  \let\macc@nucleus\@empty%
  \widehat{\raisebox{.5ex}{\vphantom{\ensuremath{#1}}}\smash{\widehat{#1}}}%
\endgroup%
}
\makeatother

