lysa.ltx 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. \documentclass[12pt]{book}
  2. % Append yourself to this list. Aliases are fine (e.g. darkf), but please do
  3. % include an email where people can email you. If applicable, also include your
  4. % middle initial, as is the convention in academia.
  5. \author{
  6. \pharpend
  7. }
  8. \newcommand{\editors}{
  9. \aneditor{Randy Brown}{randy@beingbrown.net}
  10. \aneditor{Nick Chambers}{DTSCode@gmail.com}
  11. % \aneditor{Anton Golov}{jesyspa@gmail.com}
  12. \aneditor{Ng Wei En}{wei2912.supp0rt@gmail.com}
  13. \aneditor{Ben Z RF}{benzrf@benzrf.com}
  14. \aneditor{Alexander G Bauer}{sasha@crofter.org}
  15. }
  16. \usepackage{amsmath}
  17. \usepackage{amsfonts}
  18. \usepackage{amssymb}
  19. \usepackage{amsthm}
  20. \usepackage[toc,page]{appendix}
  21. \usepackage[backend=bibtex]{biblatex}
  22. \usepackage{centernot}
  23. \usepackage[answerdelayed]{exercise}
  24. \usepackage[T1]{fontenc}
  25. \usepackage[utf8]{inputenc}
  26. \usepackage{listings}
  27. \usepackage{mathtools}
  28. \usepackage{relsize}
  29. \usepackage{scrextend}
  30. \usepackage{setspace}
  31. \usepackage{tabu}
  32. \usepackage{ulem}
  33. \usepackage{url}
  34. \usepackage[hidelinks]{hyperref}
  35. \usepackage{cleveref}
  36. \crefname{chapter}{\S}{\S}
  37. \crefname{section}{\S}{\S}
  38. \crefname{subsection}{\S}{\S}
  39. \crefname{subsubsection}{\S}{\S}
  40. \crefname{paragraph}{\S}{\S}
  41. \Crefname{chapter}{\S}{\S}
  42. \Crefname{section}{\S}{\S}
  43. \Crefname{subsection}{\S}{\S}
  44. \Crefname{subsubsection}{\S}{\S}
  45. \Crefname{paragraph}{\S}{\S}
  46. \addbibresource{lysa.bib}
  47. \usepackage{listings}
  48. \usepackage{color}
  49. \definecolor{mygreen}{rgb}{0,0.6,0}
  50. \definecolor{mygray}{rgb}{0.5,0.5,0.5}
  51. \definecolor{mymauve}{rgb}{0.58,0,0.82}
  52. \lstset{ %
  53. backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
  54. basicstyle=\footnotesize\tt, % the size of the fonts that are used for the code
  55. breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
  56. breaklines=true, % sets automatic line breaking
  57. captionpos=b, % sets the caption-position to bottom
  58. commentstyle=\color{mygreen}, % comment style
  59. deletekeywords={...}, % if you want to delete keywords from the given language
  60. escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
  61. extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  62. frame=single, % adds a frame around the code
  63. keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  64. keywordstyle=\color{blue}, % keyword style
  65. % Actually, we are using Idris, but Haskell is close enough
  66. language=Haskell, % the language of the code
  67. % morekeywords={*,...}, % if you want to add more keywords to the set
  68. numbers=left, % where to put the line-numbers; possible values are (none, left, right)
  69. numbersep=5pt, % how far the line-numbers are from the code
  70. numberstyle=\footnotesize\tt, % the style that is used for the line-numbers
  71. rulecolor=\color{mygray}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  72. showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  73. showstringspaces=false, % underline spaces within strings only
  74. showtabs=false, % show tabs within strings adding particular underscores
  75. stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered
  76. % stringstyle=\color{mymauve}, % string literal style
  77. tabsize=2, % sets default tabsize to 2 spaces
  78. title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
  79. }
  80. % Print-friendly links
  81. \newcommand{\anauthor}[2]
  82. {#1 {\href{mailto:#2}<{\tt #2}>} \\
  83. }
  84. \newcommand{\aneditor}[2]{#1 & {\href{mailto:#2}{<{#2}>}} \\ }
  85. \newcommand{\link}[2]{#2 (\url{#1})}
  86. % Section & Chapter he
  87. \newcommand{\ch}[1]{\chapter{#1}\label{ch: #1}}
  88. \newcommand{\s}[1]{\section{#1}\label{s: #1}}
  89. \renewcommand{\ss}[1]{\subsection{#1}\label{ss: #1}}
  90. \newcommand{\sss}[1]{\subsubsection{#1}\label{sss: #1}}
  91. \newcommand{\pg}[2]{\paragraph{#1}\label{pg: #1}}
  92. % Math shortcuts
  93. \newcommand{\suc}{\mathrm{suc}}
  94. \newcommand{\N}{\mathbb{N}}
  95. \newcommand{\R}{\mathbb{R}}
  96. \newcommand{\Z}{\mathbb{Z}}
  97. \renewcommand{\emptyset}{\varnothing}
  98. % \newcommand{\nil}{\varnothing}
  99. \newcommand{\nil}{\emptyset}
  100. \newcommand{\subof}{\subset}
  101. \newcommand{\subeq}{\subseteq}
  102. \newcommand{\subofnm}{$\subset$}
  103. \newcommand{\subeqnm}{$\subseteq$}
  104. \newcommand{\supof}{\supset}
  105. \newcommand{\supeq}{\supseteq}
  106. \newcommand{\supofnm}{$\supset$}
  107. \newcommand{\supeqnm}{$\supseteq$}
  108. \newcommand{\mset}[1]{\left\{\,#1\,\right\}}
  109. \newcommand{\parens}[1]{\left(\,#1\,\right)}
  110. \newcommand{\brackets}[1]{\left[\,#1\,\right]}
  111. \newcommand{\Qimplies}{\stackrel{?}{\implies}}
  112. \newcommand{\Qimpliedby}{\stackrel{?}{\impliedby}}
  113. \newcommand{\comma}{,\,}
  114. \newcommand{\notimplies}{\centernot\implies}
  115. \newcommand{\notimpliedby}{\centernot\impliedby}
  116. \newcommand{\notiff}{\centernot\iff}
  117. \newcommand{\Qin}{\stackrel{?}{\in}}
  118. \newcommand{\Qiff}{\stackrel{?}{\iff}}
  119. \newcommand{\truenm}{$\true$}
  120. \newcommand{\falsenm}{$\false$}
  121. \newcommand{\true}{\mathrm{True}}
  122. \newcommand{\false}{\mathrm{False}}
  123. \newcommand{\bigand}[1]{\land\brackets{#1}}
  124. \newcommand{\semicolon}{;\;}
  125. \newcommand{\mlist}[1]{\left(\,#1\,\right)}
  126. \newcommand{\sfall}{\semicolon\forall}
  127. \newcommand{\ld}[1]{\lambda\mlist{#1} \to}
  128. \newcommand{\domain}[1]{^{\mathrm{dom}}\brackets{#1}}
  129. \let\dom\domain
  130. \newcommand{\codomain}[1]{^{\mathrm{codom}}\brackets{#1}}
  131. \let\codom\codomain
  132. \newcommand{\bool}{\mathbb{B}}
  133. \newcommand{\boolnm}{$\mathrm{\bool}$}
  134. \newcommand{\bracketset}[1]{\brackets{ #1 }}
  135. \newcommand{\evalat}[2]{#1 _{\,\bracketset{#2}}}
  136. \newenvironment{alignmath}[1]
  137. {\begin{displaymath}\begin{array}{#1}}
  138. {\end{array}\end{displaymath}}
  139. \newenvironment{alignedmath}
  140. {\begin{alignmath}{l}}
  141. {\end{alignmath}}
  142. \newcommand{\lto}{\lambda\to}
  143. \newcommand{\arc}[1] {{^{\mathrm{arc}}\brackets{#1}}}
  144. \newcommand{\im}[1] {{^{\mathrm{im}}\brackets{#1}}}
  145. \newcommand{\preim}[1]{{^{\mathrm{preim}}\brackets{#1}}}
  146. \newcommand{\Set}{\mathbf{Set}}
  147. \newcommand{\Qsubof}{\stackrel{?}{\subof}}
  148. \newcommand{\Qsubeq}{\stackrel{?}{\subeq}}
  149. \newcommand{\Qsupof}{\stackrel{?}{\supof}}
  150. \newcommand{\Qsupeq}{\stackrel{?}{\supeq}}
  151. \newcommand{\notsubof}{\centernot{\subof}}
  152. \newcommand{\notsubeq}{\centernot{\subeq}}
  153. \newcommand{\notsupof}{\centernot{\supof}}
  154. \newcommand{\notsupeq}{\centernot{\supeq}}
  155. \newcommand{\superbracket}[2]{
  156. {
  157. ^{
  158. {#1}
  159. }
  160. \brackets{
  161. {#2}
  162. }
  163. }
  164. }
  165. % Miscellaneous
  166. \newcommand{\pharpend}{\anauthor{Peter Harpending}{pharpend2@gmail.com}}
  167. \let\xti\textit %italicize
  168. \let\xtb\textbf %boldface
  169. \newcommand{\code}[1]{{\tt #1}} %boldface
  170. \let\crappycode\code %boldface
  171. \let\terminal\code
  172. \let\tilde\textasciitilde
  173. \setlength{\parskip}{2ex}
  174. \newenvironment{ExcList}
  175. {
  176. \newpage
  177. \ss{Exercises}
  178. \begin{ExerciseList}
  179. }
  180. {
  181. \end{ExerciseList}
  182. \newpage
  183. \sss{Answers}
  184. \shipoutAnswer
  185. \newpage
  186. }
  187. \newenvironment{iquote}{\begin{quote}\it}{\end{quote}}
  188. \lstnewenvironment{plainfile}[1][]
  189. {\lstset{
  190. numbers=none,
  191. basicstyle=\small\ttfamily,
  192. #1
  193. }}
  194. {}
  195. \lstnewenvironment{shellsession}[1][]
  196. {\lstset{
  197. numbers=none,
  198. % language=bash,
  199. basicstyle=\small\ttfamily,
  200. #1
  201. }}
  202. {}
  203. \newcommand{\filepath}{\texttt}
  204. \title{Learn You Some Algebras for Glorious Good!}
  205. \begin{document}
  206. \maketitle
  207. \newpage
  208. \topskip0pt
  209. \vspace*{\fill}
  210. {\footnotesize
  211. \begin{center}
  212. Copyright © 2014-2015 \pharpend
  213. \end{center}
  214. % \noindent
  215. \begin{center}
  216. Permission is granted to copy, distribute and/or modify this document under
  217. the terms of the GNU Free Documentation License, Version 1.3 or any later
  218. version published by the Free Software Foundation; with no Invariant
  219. Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the
  220. license is included in \cref{gfdl}.
  221. \end{center}
  222. }
  223. \vspace*{\fill}
  224. % \newpage
  225. % \section*{Editors \& Noted Contributors}
  226. % \begin{addmargin}[4em]{2em}
  227. % \begin{tabular}{l l}
  228. % \editors
  229. % \end{tabular}
  230. % \end{addmargin}
  231. \newpage
  232. \tableofcontents
  233. \newpage
  234. \input{1-introduction.ltx}
  235. \input{2-boolean-algebra.ltx}
  236. \input{3-sets-functions.ltx}
  237. \input{4-proofs.ltx}
  238. \begin{appendices}
  239. {\footnotesize
  240. \setlength{\parskip}{0ex}
  241. \setlength{\parindent}{0ex}
  242. \input{fdl.ltx}
  243. }
  244. \input{how-to-learn.ltx}
  245. \end{appendices}
  246. \newpage
  247. \printbibliography
  248. \end{document}