forked from maurer/hott-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
151 lines (135 loc) · 4.73 KB
/
macros.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
%%% This file can never be completed.
%%% If you need something but cannot find it,
%%% contact the TA Favonia!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Basic packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath,amsthm,amssymb}
\usepackage{mathtools}
\usepackage{etoolbox}
\usepackage{fancyhdr}
\usepackage{mathpartir}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{xspace}
\usepackage{comment}
\usepackage{url} % for url in bib entries
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Acronyms
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[acronym, shortcuts]{glossaries}
\newacronym{HoTT}{HoTT}{homotopy type theory}
\newacronym{IPL}{IPL}{intuitionistic propositional logic}
\newacronym{TT}{TT}{intuitionistic type theory}
\newacronym{LEM}{LEM}{law of the excluded middle}
\newacronym{ITT}{ITT}{intensional type theory}
\newacronym{ETT}{ETT}{extensional type theory}
\newacronym{NNO}{NNO}{natural numbers object}
% Make \ac robust.
\robustify{\ac}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fancy page style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy}
\newcommand{\metadata}[2]{
\lhead{}
\chead{}
\rhead{\bfseries Homotopy Type Theory}
\lfoot{#1}
\cfoot{#2}
\rfoot{\thepage}
}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\newrobustcmd*{\vocab}[1]{\emph{#1}}
\newrobustcmd*{\latin}[1]{\textit{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Customize list enviroonments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% package to customize three basic list environments: enumerate, itemize and description.
\usepackage{enumitem}
\setitemize{noitemsep, topsep=0pt, leftmargin=*}
\setenumerate{noitemsep, topsep=0pt, leftmargin=*}
\setdescription{noitemsep, topsep=0pt, leftmargin=*}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some really basic macros.
% (Lots of them were stolen from HoTT/Book.)
% See macros.tex in HoTT/book.
%
% This is a mess. Needs clean-ups.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newrobustcmd*{\ctx}{\Gamma}
\newrobustcmd*{\entails}{\vdash}
\newrobustcmd*{\judgmentfont}[1]{{\normalfont\sffamily #1}}
\newrobustcmd*{\postfixjudgment}[1]{%
\relax\ifnum\lastnodetype>0\mskip\medmuskip\fi
\text{\judgmentfont{#1}}%
}
\newrobustcmd*{\prop}{\postfixjudgment{prop}}
\newrobustcmd*{\true}{\postfixjudgment{true}}
\newrobustcmd*{\type}{\postfixjudgment{type}}
\newrobustcmd*{\context}{\postfixjudgment{ctx}}
\newrobustcmd*{\truth}{\top}
\newrobustcmd*{\conj}{\wedge}
\newrobustcmd*{\disj}{\vee}
\newrobustcmd*{\falsehood}{\bot}
\newrobustcmd*{\imp}{\supset}
\newrobustcmd*{\zero}{0}
%%% Judgmental equality
\newrobustcmd*{\jdeq}{\equiv}
%%% Definition
\newrobustcmd*{\defeq}{\vcentcolon\equiv}
%%% Binary sums
\newrobustcmd*{\inlsym}{{\mathsf{inl}}}
\newrobustcmd*{\inrsym}{{\mathsf{inr}}}
\newrobustcmd*{\inl}{\ensuremath\inlsym\xspace}
\newrobustcmd*{\inr}{\ensuremath\inrsym\xspace}
%%% Booleans
\newrobustcmd*{\ttsym}{{\mathsf{tt}}}
\newrobustcmd*{\ffsym}{{\mathsf{ff}}}
%%% Pairs
\newrobustcmd*{\pair}{\ensuremath{\mathsf{pair}}\xspace}
\newrobustcmd*{\tuple}[2]{(#1,#2)}
\newrobustcmd*{\proj}[1]{\ensuremath{\mathsf{pr}_{#1}}\xspace}
%% Empty type
\newrobustcmd*{\abort}[1]{\ensuremath{\mathsf{abort}_{#1}}}
%%% 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\,$}}}
}
%%% Transport (covariant)
\newrobustcmd*{\trans}[2]{\ensuremath{{#1}_{*}\mathopen{}\left({#2}\right)\mathclose{}}\xspace}
% Natural numbers objects
\newrobustcmd*{\Nat}{\mathsf{Nat}}
\newrobustcmd*{\rec}{\ensuremath{\mathsf{rec}}\xspace}
% Sequence
\newrobustcmd*{\Seq}{\ensuremath{\mathsf{Seq}}\xspace}
% Identity type
\newrobustcmd*{\Id}[1]{\ensuremath{\mathsf{Id}_{#1}}\xspace}
% Reflection
\newrobustcmd*{\refl}[1]{\ensuremath{\mathsf{refl}_{#1}}\xspace}
\newrobustcmd*{\J}{\ensuremath{\mathsf{J}}\xspace}
% fst,snd,case,id
\newrobustcmd*{\fst}{\textsf{fst}}
\newrobustcmd*{\snd}{\textsf{snd}}
\DeclareMathOperator{\case}{\textsf{case}}
\DeclareMathOperator{\caseif}{\textsf{if}}
\DeclareMathOperator{\casesplit}{\textsf{split}}
\DeclareMathOperator{\ttrue}{\textsf{tt}\xspace}
\DeclareMathOperator{\ffalse}{\textsf{ff}\xspace}
\newrobustcmd*{\id}{\textsf{id}}
\newrobustcmd*{\op}[1]{\operatorname{#1}}
\newrobustcmd*{\universe}{\mathcal{U}}
%inductive types
\newrobustcmd*{\ind}{\ensuremath{\mathsf{ind}}\xspace}
%higher inductive types
%interval
\newrobustcmd*{\interval}{\ensuremath{I}\xspace}
\newrobustcmd*{\seg}{\ensuremath{\mathsf{seg}}\xspace}
%circle
\newrobustcmd*{\Sn}{\mathbb{S}}
\newrobustcmd*{\base}{\ensuremath{\mathsf{base}}\xspace}
\newrobustcmd*{\lloop}{\ensuremath{\mathsf{loop}}\xspace}