2023-05-19 15:25:37 +00:00
|
|
|
\usepackage{amsfonts, amsmath, amssymb, amsthm}
|
2023-05-17 18:28:02 +00:00
|
|
|
\usepackage{bigfoot}
|
2023-08-18 03:32:05 +00:00
|
|
|
\usepackage{colortbl}
|
2023-05-13 12:38:55 +00:00
|
|
|
\usepackage{comment}
|
2023-05-10 16:45:42 +00:00
|
|
|
\usepackage[shortlabels]{enumitem}
|
2023-05-17 18:28:02 +00:00
|
|
|
\usepackage{etoolbox}
|
2023-05-10 16:45:42 +00:00
|
|
|
\usepackage{environ}
|
|
|
|
\usepackage{fontawesome5}
|
2023-06-29 20:05:08 +00:00
|
|
|
\usepackage{mathabx, mathrsfs}
|
2023-05-11 00:26:01 +00:00
|
|
|
\usepackage{soul}
|
2023-06-28 19:19:59 +00:00
|
|
|
\usepackage{stmaryrd}
|
2023-08-10 17:16:47 +00:00
|
|
|
% Must load `xcolor` before `tcolorbox` and `tikz`.
|
2023-08-08 23:43:08 +00:00
|
|
|
\usepackage[dvipsnames]{xcolor}
|
2023-08-10 17:16:47 +00:00
|
|
|
\usepackage{tcolorbox}
|
2023-08-08 23:43:08 +00:00
|
|
|
\usepackage{tikz}
|
2023-05-11 00:26:01 +00:00
|
|
|
% `hyperref` comes after `xr-hyper`.
|
|
|
|
\usepackage{xr-hyper}
|
|
|
|
\usepackage{hyperref}
|
2023-04-10 12:56:47 +00:00
|
|
|
|
2023-05-17 18:28:02 +00:00
|
|
|
% Open "private" namespace.
|
|
|
|
\makeatletter
|
|
|
|
|
|
|
|
% ========================================
|
|
|
|
% General
|
|
|
|
% ========================================
|
|
|
|
|
|
|
|
\newcommand{\header}[2]{\title{#1}\author{#2}\date{}\maketitle}
|
|
|
|
|
|
|
|
% ========================================
|
|
|
|
% Dividers
|
|
|
|
% ========================================
|
|
|
|
|
|
|
|
\newcommand\@linespace{\vspace{10pt}}
|
|
|
|
\newcommand\linedivider{\@linespace\hrule\@linespace}
|
|
|
|
\WithSuffix\newcommand\linedivider*{\@linespace\hrule}
|
2023-05-22 00:32:59 +00:00
|
|
|
\newcommand\suitdivider{$$\spadesuit\;\spadesuit\;\spadesuit$$}
|
2023-05-17 18:28:02 +00:00
|
|
|
|
2023-05-10 16:45:42 +00:00
|
|
|
% ========================================
|
2023-08-18 17:22:23 +00:00
|
|
|
% Links
|
2023-05-10 16:45:42 +00:00
|
|
|
% ========================================
|
2023-04-10 12:56:47 +00:00
|
|
|
|
2023-05-13 01:31:44 +00:00
|
|
|
\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue}
|
2023-05-13 12:38:55 +00:00
|
|
|
\newcommand{\textref}[1]{\text{\nameref{#1}}}
|
2023-07-12 16:54:35 +00:00
|
|
|
\newcommand{\hyperlabel}[1]{%
|
|
|
|
\label{#1}%
|
|
|
|
\hypertarget{#1}{}}
|
2023-05-10 16:45:42 +00:00
|
|
|
|
2023-08-10 17:31:14 +00:00
|
|
|
% Links to theorems/statements/etc. that can be found in Mathlib4's index.
|
|
|
|
\newcommand\@leanlink[3]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\textcolor{BlueViolet}{\raisebox{-4.5pt}{%
|
|
|
|
\tikz{\draw (0, 0) node[yscale=-1,xscale=1] {\faFont};}}{-\;}}%
|
2023-08-10 17:31:14 +00:00
|
|
|
\href{https://leanprover-community.github.io/mathlib4_docs/#1.html\##2}%
|
|
|
|
{\color{BlueViolet}{#3}}}
|
|
|
|
|
|
|
|
\newcommand\lean[2]{%
|
|
|
|
\noindent\@leanlink{#1}{#2}{#2}}
|
|
|
|
\WithSuffix\newcommand\lean*[2]{%
|
|
|
|
\vspace{6pt}\lean{#1}{#2}}
|
|
|
|
|
|
|
|
\newcommand\leanp[3]{%
|
|
|
|
\noindent\@leanlink{#1}{#2}{#3}}
|
|
|
|
\WithSuffix\newcommand\leanp*[3]{%
|
|
|
|
\vspace{6pt}\leanp{#1}{#2}{#3}}
|
|
|
|
|
|
|
|
% Links to theorems/statements/etc. found in custom index.
|
2023-08-08 23:43:08 +00:00
|
|
|
\newcommand\@codelink[4]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\textcolor{MidnightBlue}{\raisebox{-4.5pt}{%
|
|
|
|
\tikz{\draw (0, 0) node[xshift=8pt] {\faCodeBranch};}}{-\;}}%
|
2023-08-10 17:31:14 +00:00
|
|
|
\href{#1/#2.html\##3}%
|
|
|
|
{\color{MidnightBlue}{#4}}}
|
2023-05-17 18:28:02 +00:00
|
|
|
|
2023-08-08 23:43:08 +00:00
|
|
|
\newcommand\coderef[3]{%
|
|
|
|
\@codelink{#1}{#2}{#3}{#3}}
|
|
|
|
\newcommand\codepref[4]{%
|
|
|
|
\@codelink{#1}{#2}{#3}{#4}}
|
|
|
|
|
2023-08-10 17:31:14 +00:00
|
|
|
% Macro to build our `code` commands relative to a given directory. For
|
|
|
|
% instance, we expect to have invocation `\makecode{..}` if the TeX file exists
|
|
|
|
% one directory deep from the root of our project..
|
|
|
|
\newcommand\makecode[1]{%
|
2023-08-08 23:43:08 +00:00
|
|
|
\newcommand\code[2]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\noindent\coderef{#1}{##1}{##2}}
|
2023-08-08 23:43:08 +00:00
|
|
|
\WithSuffix\newcommand\code*[2]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\vspace{6pt}\noindent\coderef{#1}{##1}{##2}}
|
2023-08-08 23:43:08 +00:00
|
|
|
|
|
|
|
\newcommand\codep[3]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\noindent\codepref{#1}{##1}{##2}{##3}}
|
2023-08-08 23:43:08 +00:00
|
|
|
\WithSuffix\newcommand\codep*[3]{%
|
2023-08-09 13:39:41 +00:00
|
|
|
\vspace{6pt}\noindent\codepref{#1}{##1}{##2}{##3}}
|
2023-05-17 18:28:02 +00:00
|
|
|
}
|
|
|
|
|
2023-05-10 16:45:42 +00:00
|
|
|
% ========================================
|
2023-05-17 18:28:02 +00:00
|
|
|
% Admonitions
|
2023-05-10 16:45:42 +00:00
|
|
|
% ========================================
|
|
|
|
|
2023-08-13 18:39:50 +00:00
|
|
|
\NewEnviron{induction}[1][]{%
|
|
|
|
\def\title{\ifstrempty{#1}
|
|
|
|
{Induction Hypothesis (IH)}
|
|
|
|
{#1}}
|
|
|
|
\begin{tcolorbox}[title=\title]
|
|
|
|
\BODY
|
|
|
|
\end{tcolorbox}}
|
|
|
|
|
|
|
|
\newcommand{\ihref}[1]{\hyperref[#1]{(IH)}}
|
2023-08-13 16:03:41 +00:00
|
|
|
|
2023-08-10 17:16:47 +00:00
|
|
|
\NewEnviron{note}{%
|
|
|
|
\begin{tcolorbox}[%
|
|
|
|
sharp corners,
|
|
|
|
fonttitle=\sffamily\bfseries,
|
|
|
|
toptitle=2pt,
|
|
|
|
bottomtitle=2pt,
|
|
|
|
coltitle=black!80!white,
|
|
|
|
colback=yellow!30,
|
|
|
|
colframe=yellow!80!black,
|
|
|
|
title=Note]
|
|
|
|
\BODY
|
|
|
|
\end{tcolorbox}}
|
2023-05-17 18:28:02 +00:00
|
|
|
|
|
|
|
% ========================================
|
|
|
|
% Statements
|
|
|
|
% ========================================
|
|
|
|
|
|
|
|
\newcommand\@statement[1]{%
|
|
|
|
\linedivider*\paragraph{\normalfont\normalsize\textit{#1.}}}
|
2023-05-22 00:32:59 +00:00
|
|
|
\newenvironment{answer}{\@statement{Answer}}{\hfill$\square$}
|
2023-05-17 18:28:02 +00:00
|
|
|
\renewenvironment{proof}{\@statement{Proof}}{\hfill$\square$}
|
2023-05-17 16:32:49 +00:00
|
|
|
|
2023-08-05 17:18:53 +00:00
|
|
|
\newtheorem{corollaryinner}{Corollary}
|
|
|
|
\newenvironment{corollary}[1][]{%
|
|
|
|
\ifstrempty{#1}
|
|
|
|
{\corollaryinner}
|
|
|
|
{\renewcommand\thecorollaryinner{#1}\corollaryinner}
|
|
|
|
}{\endcorollaryinner}
|
|
|
|
|
2023-05-17 16:32:49 +00:00
|
|
|
\newtheorem{lemmainner}{Lemma}
|
2023-05-17 18:28:02 +00:00
|
|
|
\newenvironment{lemma}[1][]{%
|
|
|
|
\ifstrempty{#1}
|
|
|
|
{\lemmainner}
|
|
|
|
{\renewcommand\thelemmainner{#1}\lemmainner}
|
2023-05-17 16:32:49 +00:00
|
|
|
}{\endlemmainner}
|
2023-05-17 18:28:02 +00:00
|
|
|
|
2023-05-17 16:32:49 +00:00
|
|
|
\newtheorem{theoreminner}{Theorem}
|
2023-05-17 18:28:02 +00:00
|
|
|
\newenvironment{theorem}[1][]{%
|
|
|
|
\ifstrempty{#1}
|
|
|
|
{\theoreminner}
|
|
|
|
{\renewcommand\thetheoreminner{#1}\theoreminner}
|
2023-05-17 16:32:49 +00:00
|
|
|
}{\endtheoreminner}
|
|
|
|
|
2023-05-11 02:19:18 +00:00
|
|
|
% ========================================
|
|
|
|
% Status
|
|
|
|
% ========================================
|
|
|
|
|
|
|
|
\DeclareRobustCommand{\defined}[1]{%
|
2023-05-13 01:31:44 +00:00
|
|
|
\texorpdfstring{\color{darkgray}\faParagraph\ #1}{#1}}
|
2023-05-10 16:45:42 +00:00
|
|
|
\DeclareRobustCommand{\verified}[1]{%
|
2023-05-11 01:09:41 +00:00
|
|
|
\texorpdfstring{\color{teal}\faCheckCircle\ #1}{#1}}
|
2023-05-10 16:45:42 +00:00
|
|
|
\DeclareRobustCommand{\unverified}[1]{%
|
2023-06-30 17:50:34 +00:00
|
|
|
\texorpdfstring{\color{olive}\faCheckCircle[regular]\ #1}{#1}}
|
|
|
|
\DeclareRobustCommand{\pending}[1]{%
|
|
|
|
\texorpdfstring{\color{Fuchsia}\faPencil*\ #1}{#1}}
|
|
|
|
\DeclareRobustCommand{\sorry}[1]{%
|
2023-05-13 12:38:55 +00:00
|
|
|
\texorpdfstring{\color{Maroon}\faExclamationCircle\ #1}{#1}}
|
2023-05-10 16:45:42 +00:00
|
|
|
|
|
|
|
% ========================================
|
|
|
|
% Math
|
|
|
|
% ========================================
|
|
|
|
|
2023-05-09 17:15:49 +00:00
|
|
|
\newcommand{\abs}[1]{\left|#1\right|}
|
2023-08-23 20:22:19 +00:00
|
|
|
\newcommand{\card}[1]{\mathop{\text{card}}{#1}}
|
2023-05-08 19:18:12 +00:00
|
|
|
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
|
2023-08-13 16:03:41 +00:00
|
|
|
\newcommand{\ctuple}[2]{\left< #1, \cdots, #2 \right>}
|
2023-06-30 14:05:12 +00:00
|
|
|
\newcommand{\dom}[1]{\textop{dom}{#1}}
|
2023-09-30 20:29:50 +00:00
|
|
|
\newcommand{\equin}{\approx}
|
2023-06-30 14:05:12 +00:00
|
|
|
\newcommand{\fld}[1]{\textop{fld}{#1}}
|
2023-05-08 19:18:12 +00:00
|
|
|
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
|
2023-05-09 17:15:49 +00:00
|
|
|
\newcommand{\icc}[2]{\left[#1, #2\right]}
|
|
|
|
\newcommand{\ico}[2]{\left[#1, #2\right)}
|
2023-06-30 14:05:12 +00:00
|
|
|
\newcommand{\img}[2]{#1\!\left\llbracket#2\right\rrbracket}
|
2023-05-09 17:15:49 +00:00
|
|
|
\newcommand{\ioc}[2]{\left(#1, #2\right]}
|
|
|
|
\newcommand{\ioo}[2]{\left(#1, #2\right)}
|
2023-08-13 16:03:41 +00:00
|
|
|
\newcommand{\ltuple}[2]{\left< #1, \ldots, #2 \right>}
|
2023-05-22 00:32:59 +00:00
|
|
|
\newcommand{\powerset}[1]{\mathscr{P}#1}
|
2023-06-30 14:05:12 +00:00
|
|
|
\newcommand{\ran}[1]{\textop{ran}{#1}}
|
2023-06-15 21:31:58 +00:00
|
|
|
\newcommand{\textop}[1]{\mathop{\text{#1}}}
|
2023-08-13 16:03:41 +00:00
|
|
|
\newcommand{\tuple}[1]{\left< #1 \right>}
|
2023-05-17 18:28:02 +00:00
|
|
|
\newcommand{\ubar}[1]{\text{\b{$#1$}}}
|
|
|
|
|
2023-05-19 15:25:37 +00:00
|
|
|
\let\oldemptyset\emptyset
|
|
|
|
\let\emptyset\varnothing
|
|
|
|
|
2023-05-17 18:28:02 +00:00
|
|
|
% Close off "private" namespace.
|
|
|
|
\makeatother
|