\documentclass[12pt,titlepage]{article} \usepackage{amsmath} \usepackage{mathrsfs} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{mathtools} \usepackage{graphicx} \usepackage{color} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{xparse} \usepackage{hyperref} %----Macros---------- % % Unresolved issues: % % \righttoleftarrow % \lefttorightarrow % % \color{} with HTML colorspec % \bgcolor % \array with options (without options, it's equivalent to the matrix environment) % Of the standard HTML named colors, white, black, red, green, blue and yellow % are predefined in the color package. Here are the rest. \definecolor{aqua}{rgb}{0, 1.0, 1.0} \definecolor{fuschia}{rgb}{1.0, 0, 1.0} \definecolor{gray}{rgb}{0.502, 0.502, 0.502} \definecolor{lime}{rgb}{0, 1.0, 0} \definecolor{maroon}{rgb}{0.502, 0, 0} \definecolor{navy}{rgb}{0, 0, 0.502} \definecolor{olive}{rgb}{0.502, 0.502, 0} \definecolor{purple}{rgb}{0.502, 0, 0.502} \definecolor{silver}{rgb}{0.753, 0.753, 0.753} \definecolor{teal}{rgb}{0, 0.502, 0.502} % Because of conflicts, \space and \mathop are converted to % \itexspace and \operatorname during preprocessing. % itex: \space{ht}{dp}{wd} % % Height and baseline depth measurements are in units of tenths of an ex while % the width is measured in tenths of an em. \makeatletter \newdimen\itex@wd% \newdimen\itex@dp% \newdimen\itex@thd% \def\itexspace#1#2#3{\itex@wd=#3em% \itex@wd=0.1\itex@wd% \itex@dp=#2ex% \itex@dp=0.1\itex@dp% \itex@thd=#1ex% \itex@thd=0.1\itex@thd% \advance\itex@thd\the\itex@dp% \makebox[\the\itex@wd]{\rule[-\the\itex@dp]{0cm}{\the\itex@thd}}} \makeatother % \tensor and \multiscript \makeatletter \newif\if@sup \newtoks\@sups \def\append@sup#1{\edef\act{\noexpand\@sups={\the\@sups #1}}\act}% \def\reset@sup{\@supfalse\@sups={}}% \def\mk@scripts#1#2{\if #2/ \if@sup ^{\the\@sups}\fi \else% \ifx #1_ \if@sup ^{\the\@sups}\reset@sup \fi {}_{#2}% \else \append@sup#2 \@suptrue \fi% \expandafter\mk@scripts\fi} \def\tensor#1#2{\reset@sup#1\mk@scripts#2_/} \def\multiscripts#1#2#3{\reset@sup{}\mk@scripts#1_/#2% \reset@sup\mk@scripts#3_/} \makeatother % \slash \makeatletter \newbox\slashbox \setbox\slashbox=\hbox{$/$} \def\itex@pslash#1{\setbox\@tempboxa=\hbox{$#1$} \@tempdima=0.5\wd\slashbox \advance\@tempdima 0.5\wd\@tempboxa \copy\slashbox \kern-\@tempdima \box\@tempboxa} \def\slash{\protect\itex@pslash} \makeatother % math-mode versions of \rlap, etc % from Alexander Perlis, "A complement to \smash, \llap, and lap" % http://math.arizona.edu/~aprl/publications/mathclap/ \def\clap#1{\hbox to 0pt{\hss#1\hss}} \def\mathllap{\mathpalette\mathllapinternal} \def\mathrlap{\mathpalette\mathrlapinternal} \def\mathclap{\mathpalette\mathclapinternal} \def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}} \def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}} \def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}} % Renames \sqrt as \oldsqrt and redefine root to result in \sqrt[#1]{#2} \let\oldroot\root \def\root#1#2{\oldroot #1 \of{#2}} \renewcommand{\sqrt}[2][]{\oldroot #1 \of{#2}} % Manually declare the txfonts symbolsC font \DeclareSymbolFont{symbolsC}{U}{txsyc}{m}{n} \SetSymbolFont{symbolsC}{bold}{U}{txsyc}{bx}{n} \DeclareFontSubstitution{U}{txsyc}{m}{n} % Manually declare the stmaryrd font \DeclareSymbolFont{stmry}{U}{stmry}{m}{n} \SetSymbolFont{stmry}{bold}{U}{stmry}{b}{n} % Manually declare the MnSymbolE font \DeclareFontFamily{OMX}{MnSymbolE}{} \DeclareSymbolFont{mnomx}{OMX}{MnSymbolE}{m}{n} \SetSymbolFont{mnomx}{bold}{OMX}{MnSymbolE}{b}{n} \DeclareFontShape{OMX}{MnSymbolE}{m}{n}{ <-6> MnSymbolE5 <6-7> MnSymbolE6 <7-8> MnSymbolE7 <8-9> MnSymbolE8 <9-10> MnSymbolE9 <10-12> MnSymbolE10 <12-> MnSymbolE12}{} % Declare specific arrows from txfonts without loading the full package \makeatletter \def\re@DeclareMathSymbol#1#2#3#4{% \let#1=\undefined \DeclareMathSymbol{#1}{#2}{#3}{#4}} \re@DeclareMathSymbol{\neArrow}{\mathrel}{symbolsC}{116} \re@DeclareMathSymbol{\neArr}{\mathrel}{symbolsC}{116} \re@DeclareMathSymbol{\seArrow}{\mathrel}{symbolsC}{117} \re@DeclareMathSymbol{\seArr}{\mathrel}{symbolsC}{117} \re@DeclareMathSymbol{\nwArrow}{\mathrel}{symbolsC}{118} \re@DeclareMathSymbol{\nwArr}{\mathrel}{symbolsC}{118} \re@DeclareMathSymbol{\swArrow}{\mathrel}{symbolsC}{119} \re@DeclareMathSymbol{\swArr}{\mathrel}{symbolsC}{119} \re@DeclareMathSymbol{\nequiv}{\mathrel}{symbolsC}{46} \re@DeclareMathSymbol{\Perp}{\mathrel}{symbolsC}{121} \re@DeclareMathSymbol{\Vbar}{\mathrel}{symbolsC}{121} \re@DeclareMathSymbol{\sslash}{\mathrel}{stmry}{12} \re@DeclareMathSymbol{\bigsqcap}{\mathop}{stmry}{"64} \re@DeclareMathSymbol{\biginterleave}{\mathop}{stmry}{"6} \re@DeclareMathSymbol{\invamp}{\mathrel}{symbolsC}{77} \re@DeclareMathSymbol{\parr}{\mathrel}{symbolsC}{77} \makeatother % \llangle, \rrangle, \lmoustache and \rmoustache from MnSymbolE \makeatletter \def\Decl@Mn@Delim#1#2#3#4{% \if\relax\noexpand#1% \let#1\undefined \fi \DeclareMathDelimiter{#1}{#2}{#3}{#4}{#3}{#4}} \def\Decl@Mn@Open#1#2#3{\Decl@Mn@Delim{#1}{\mathopen}{#2}{#3}} \def\Decl@Mn@Close#1#2#3{\Decl@Mn@Delim{#1}{\mathclose}{#2}{#3}} \Decl@Mn@Open{\llangle}{mnomx}{'164} \Decl@Mn@Close{\rrangle}{mnomx}{'171} \Decl@Mn@Open{\lmoustache}{mnomx}{'245} \Decl@Mn@Close{\rmoustache}{mnomx}{'244} \makeatother % Widecheck \makeatletter \DeclareRobustCommand\widecheck[1]{{\mathpalette\@widecheck{#1}}} \def\@widecheck#1#2{% \setbox\z@\hbox{\m@th$#1#2$}% \setbox\tw@\hbox{\m@th$#1% \widehat{% \vrule\@width\z@\@height\ht\z@ \vrule\@height\z@\@width\wd\z@}$}% \dp\tw@-\ht\z@ \@tempdima\ht\z@ \advance\@tempdima2\ht\tw@ \divide\@tempdima\thr@@ \setbox\tw@\hbox{% \raise\@tempdima\hbox{\scalebox{1}[-1]{\lower\@tempdima\box \tw@}}}% {\ooalign{\box\tw@ \cr \box\z@}}} \makeatother % \mathraisebox{voffset}[height][depth]{something} \makeatletter \NewDocumentCommand\mathraisebox{moom}{% \IfNoValueTF{#2}{\def\@temp##1##2{\raisebox{#1}{$\m@th##1##2$}}}{% \IfNoValueTF{#3}{\def\@temp##1##2{\raisebox{#1}[#2]{$\m@th##1##2$}}% }{\def\@temp##1##2{\raisebox{#1}[#2][#3]{$\m@th##1##2$}}}}% \mathpalette\@temp{#4}} \makeatletter % udots (taken from yhmath) \makeatletter \def\udots{\mathinner{\mkern2mu\raise\p@\hbox{.} \mkern2mu\raise4\p@\hbox{.}\mkern1mu \raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern1mu}} \makeatother %% Fix array \newcommand{\itexarray}[1]{\begin{matrix}#1\end{matrix}} %% \itexnum is a noop \newcommand{\itexnum}[1]{#1} %% Renaming existing commands \newcommand{\underoverset}[3]{\underset{#1}{\overset{#2}{#3}}} \newcommand{\widevec}{\overrightarrow} \newcommand{\darr}{\downarrow} \newcommand{\nearr}{\nearrow} \newcommand{\nwarr}{\nwarrow} \newcommand{\searr}{\searrow} \newcommand{\swarr}{\swarrow} \newcommand{\curvearrowbotright}{\curvearrowright} \newcommand{\uparr}{\uparrow} \newcommand{\downuparrow}{\updownarrow} \newcommand{\duparr}{\updownarrow} \newcommand{\updarr}{\updownarrow} \newcommand{\gt}{>} \newcommand{\lt}{<} \newcommand{\map}{\mapsto} \newcommand{\embedsin}{\hookrightarrow} \newcommand{\Alpha}{A} \newcommand{\Beta}{B} \newcommand{\Zeta}{Z} \newcommand{\Eta}{H} \newcommand{\Iota}{I} \newcommand{\Kappa}{K} \newcommand{\Mu}{M} \newcommand{\Nu}{N} \newcommand{\Rho}{P} \newcommand{\Tau}{T} \newcommand{\Upsi}{\Upsilon} \newcommand{\omicron}{o} \newcommand{\lang}{\langle} \newcommand{\rang}{\rangle} \newcommand{\Union}{\bigcup} \newcommand{\Intersection}{\bigcap} \newcommand{\Oplus}{\bigoplus} \newcommand{\Otimes}{\bigotimes} \newcommand{\Wedge}{\bigwedge} \newcommand{\Vee}{\bigvee} \newcommand{\coproduct}{\coprod} \newcommand{\product}{\prod} \newcommand{\closure}{\overline} \newcommand{\integral}{\int} \newcommand{\doubleintegral}{\iint} \newcommand{\tripleintegral}{\iiint} \newcommand{\quadrupleintegral}{\iiiint} \newcommand{\conint}{\oint} \newcommand{\contourintegral}{\oint} \newcommand{\infinity}{\infty} \newcommand{\bottom}{\bot} \newcommand{\minusb}{\boxminus} \newcommand{\plusb}{\boxplus} \newcommand{\timesb}{\boxtimes} \newcommand{\intersection}{\cap} \newcommand{\union}{\cup} \newcommand{\Del}{\nabla} \newcommand{\odash}{\circleddash} \newcommand{\negspace}{\!} \newcommand{\widebar}{\overline} \newcommand{\textsize}{\normalsize} \renewcommand{\scriptsize}{\scriptstyle} \newcommand{\scriptscriptsize}{\scriptscriptstyle} \newcommand{\mathfr}{\mathfrak} \newcommand{\statusline}[2]{#2} \newcommand{\tooltip}[2]{#2} \newcommand{\toggle}[2]{#2} % Theorem Environments \theoremstyle{plain} \newtheorem{theorem}{Theorem} \newtheorem{lemma}{Lemma} \newtheorem{prop}{Proposition} \newtheorem{cor}{Corollary} \newtheorem*{utheorem}{Theorem} \newtheorem*{ulemma}{Lemma} \newtheorem*{uprop}{Proposition} \newtheorem*{ucor}{Corollary} \theoremstyle{definition} \newtheorem{defn}{Definition} \newtheorem{example}{Example} \newtheorem*{udefn}{Definition} \newtheorem*{uexample}{Example} \theoremstyle{remark} \newtheorem{remark}{Remark} \newtheorem{note}{Note} \newtheorem*{uremark}{Remark} \newtheorem*{unote}{Note} %------------------------------------------------------------------- \begin{document} %------------------------------------------------------------------- \section*{Martin-Löf dependent type theory} \hypertarget{context}{}\subsubsection*{{Context}}\label{context} \hypertarget{type_theory}{}\paragraph*{{Type theory}}\label{type_theory} [[!include type theory - contents]] \hypertarget{foundations}{}\paragraph*{{Foundations}}\label{foundations} [[!include foundations - contents]] \hypertarget{martinlf_dependent_type_theory}{}\section*{{Martin-L\"o{}f dependent type theory}}\label{martinlf_dependent_type_theory} \noindent\hyperlink{idea}{Idea}\dotfill \pageref*{idea} \linebreak \noindent\hyperlink{syntax}{Syntax}\dotfill \pageref*{syntax} \linebreak \noindent\hyperlink{binary_product_types}{Binary product types}\dotfill \pageref*{binary_product_types} \linebreak \noindent\hyperlink{unit_type}{Unit type}\dotfill \pageref*{unit_type} \linebreak \noindent\hyperlink{dependent_product_types}{Dependent product types}\dotfill \pageref*{dependent_product_types} \linebreak \noindent\hyperlink{function_types}{Function types}\dotfill \pageref*{function_types} \linebreak \noindent\hyperlink{binary_sum_types}{Binary sum types}\dotfill \pageref*{binary_sum_types} \linebreak \noindent\hyperlink{empty_type}{Empty type}\dotfill \pageref*{empty_type} \linebreak \noindent\hyperlink{dependent_sum_types}{Dependent sum types}\dotfill \pageref*{dependent_sum_types} \linebreak \noindent\hyperlink{finite_types}{Finite types}\dotfill \pageref*{finite_types} \linebreak \noindent\hyperlink{propositions_as_types}{Propositions as types}\dotfill \pageref*{propositions_as_types} \linebreak \noindent\hyperlink{equality_types}{Equality types}\dotfill \pageref*{equality_types} \linebreak \noindent\hyperlink{finite_product_types}{Finite product types}\dotfill \pageref*{finite_product_types} \linebreak \noindent\hyperlink{unit_type_2}{Unit type}\dotfill \pageref*{unit_type_2} \linebreak \noindent\hyperlink{dependent_product_types_2}{Dependent product types}\dotfill \pageref*{dependent_product_types_2} \linebreak \noindent\hyperlink{function_types_2}{Function types}\dotfill \pageref*{function_types_2} \linebreak \noindent\hyperlink{finite_sum_types}{Finite sum types}\dotfill \pageref*{finite_sum_types} \linebreak \noindent\hyperlink{dependent_sum_types_2}{Dependent sum types}\dotfill \pageref*{dependent_sum_types_2} \linebreak \noindent\hyperlink{properties}{Properties}\dotfill \pageref*{properties} \linebreak \noindent\hyperlink{models_and_categorical_semantics}{Models and categorical semantics}\dotfill \pageref*{models_and_categorical_semantics} \linebreak \noindent\hyperlink{AxiomOfChoice}{Axiom of choice}\dotfill \pageref*{AxiomOfChoice} \linebreak \noindent\hyperlink{related_concepts}{Related concepts}\dotfill \pageref*{related_concepts} \linebreak \noindent\hyperlink{references}{References}\dotfill \pageref*{references} \linebreak \hypertarget{idea}{}\subsection*{{Idea}}\label{idea} [[Per Martin-Lof|Per Martin-Löf]]`s \textbf{[[dependent type theory]]}, also known as \textbf{[[intuitionistic logic|intuitionistic]] type theory}, or \textbf{constructive type theory} is a specific form of [[type theory]] developed to support [[constructive mathematics]]. (Note that both ``dependent type theory'' and ``intuitionistic type theory'' may refer more generally to [[type theories]] that contain [[dependent types]] or are [[intuitionistic mathematics|intuitionistic]], respectively.) Martin-L\"o{}f's dependent type theory is notable for several reasons: \begin{itemize}% \item One can construct an interpretation of first-order [[intuitionistic logic]] by interpreting [[propositions as types]] (this is true of most any dependent type theory). \item It has a version of a variant of the [[axiom of choice]] \emph{as a theorem} (because of the properties of the above interpretation), see the discussion \hyperlink{AxiomOfChoice}{below}. \item In its [[intensional type theory|intensional]] form, it has sufficient computational content to function as a programming language. At the same time, it then has [[identity types]] whose presence shows that one is really dealing with a form of [[homotopy type theory]]. \end{itemize} \hypertarget{syntax}{}\subsection*{{Syntax}}\label{syntax} If $t$ is a term, and $A$ a type, then $t : A$ is a \textbf{typing declaration} asserting that $t$ is a term of type $A$. We will define the forms of valid terms and types below; to begin with, we assume we have a stock of variables, atomic types, and parametrised types. A \textbf{context} is a [[finite set|finite]] ordered list of typing declarations, defined [[inductive definition|inductively]] as follows: \begin{itemize}% \item The empty list is a valid context. \item If $\Gamma$ is a valid context, $x$ is a variable not appearing in $\Gamma$, and $A$ is a valid type in the context $\Gamma$, then the context obtained by appending $x : A$ to $\Gamma$ is also valid. \end{itemize} Note that this must be considered a \emph{mutual} inductive definition along with the definition of when a type is valid in a given context, which is to be given below in terms of type constructors. We write $\Gamma \vdash t : A$ to assert that $t : A$ is a valid typing declaration in the context of $\Gamma$, and by abuse of notation we may write $\Gamma \vdash A : \mathrm{Type}$ to assert that $A$ is a valid type in the context of $\Gamma$. For any context $\Gamma$, if $A$ is an atomic type, $\Gamma \vdash A : \mathrm{Type}$. If $x : A$ is a typing declaration in $\Gamma$, then we have $\Gamma \vdash x : A$. \hypertarget{binary_product_types}{}\subsubsection*{{Binary product types}}\label{binary_product_types} If $\Gamma \vdash A : \mathrm{Type}$ and $\Delta \vdash B : \mathrm{Type}$, then $\Gamma, \Delta \vdash A \times B : \mathrm{Type}$. If $\Gamma \vdash a : A$ and $\Delta \vdash b : B$ then $\Gamma, \Delta \vdash \langle a, b \rangle : A \times B$. If $\Gamma \vdash c : A \times B$, then $\Gamma \vdash \pi_0(c) : A$ and $\Gamma \vdash \pi_1(c) : B$. \hypertarget{unit_type}{}\subsubsection*{{Unit type}}\label{unit_type} There is an atomic type called $\top$. For any context $\Gamma$ we have $\Gamma \vdash \mathrm{tt} : \top$. \hypertarget{dependent_product_types}{}\subsubsection*{{Dependent product types}}\label{dependent_product_types} If $\Gamma, x : X \vdash A(x) : \mathrm{Type}$, then $\Gamma \vdash (\Pi x : X) A(x) : \mathrm{Type}$. If $\Gamma, x : X \vdash a(x) : A(x)$, then $\Gamma \vdash (\lambda x : X) a(x) : (\Pi x : X) A(x)$. If $\Gamma \vdash f : (\Pi x : X) A(x)$ and $\Delta \vdash t : X$, then $\Gamma, \Delta \vdash \mathrm{apply}(f, t) : A(t)$. \hypertarget{function_types}{}\subsubsection*{{Function types}}\label{function_types} Function types may be regarded as a special case of dependent product types, where $A(x)$ does not depend on $x$ at all. When we write out the rules for dependent products in this case, they become the following. Firstly, if $\Gamma \vdash X : \mathrm{Type}$ and $\Gamma \vdash A : \mathrm{Type}$, then $\Gamma \vdash X \to A : \mathrm{Type}$. If $\Gamma, x : X \vdash a(x) : A$, then $\Gamma \vdash (\lambda x : X) a(x) : X \to A$. If $\Gamma \vdash f : X \to A$ and $\Delta \vdash t : X$, then $\Gamma, \Delta \vdash \mathrm{apply}(f, t) : A$. \hypertarget{binary_sum_types}{}\subsubsection*{{Binary sum types}}\label{binary_sum_types} If $\Gamma \vdash A : \mathrm{Type}$ and $\Gamma \vdash B : \mathrm{Type}$, then $\Gamma \vdash A + B : \mathrm{Type}$. If $\Gamma \vdash a : A$ and $\Gamma \vdash A + B : \mathrm{Type}$, then $\Gamma \vdash a : A + B$; and if $\Gamma \vdash b : B$ and $\Gamma \vdash A + B : \mathrm{Type}$, then $\Gamma \vdash b : A + B$. If $\Gamma \vdash s : A + B$, $\Delta, x : A \vdash c(x) : C(x)$ and $E, y : B \vdash c'(y) : C(y)$, then $\Gamma, \Delta, E \vdash \mathrm{cases}(s, (\lambda x : A) c(x), (\lambda y : B) c'(y)) : C(s)$. \hypertarget{empty_type}{}\subsubsection*{{Empty type}}\label{empty_type} There is an atomic type called $\bot$. If $\Gamma \vdash A : \mathrm{Type}$, then $\Gamma, x : \bot \vdash \mathrm{abort} : A$. \hypertarget{dependent_sum_types}{}\subsubsection*{{Dependent sum types}}\label{dependent_sum_types} If $\Gamma, x : X \vdash A(x) : \mathrm{Type}$, then $\Gamma \vdash (\Sigma x : X) A(x) : \mathrm{Type}$. If $\Gamma \vdash t : X$, $\Gamma \vdash a : A(t)$ and $\Gamma \vdash (\Sigma x : X) A(x) : \mathrm{Type}$, then $\Gamma \vdash (t, a) : (\Sigma x : X) A(x)$. If $\Gamma \vdash s : (\Sigma x : X) A(x)$ and $\Delta, x : X, y : A(x) \vdash b(x, y) : B((x, y))$, then $\Gamma, \Delta \vdash \mathrm{cases}(s, (\lambda x : X)(\lambda y : A(x)) b(x, y)) : B(s)$. Note that just as function types can be defined to be dependent products where $A(x)$ does not depend on $x$, binary product types (above) can be defined to be dependent sums where $A(x)$ does not depend on $x$. \hypertarget{finite_types}{}\subsubsection*{{Finite types}}\label{finite_types} Martin-L\"o{}f also includes in his type theory a type $\mathbb{N}_n$ with exactly $n$ elements, for every \emph{external} [[natural number]] $n$. The types $\bot$ and $\top$ can then be defined as $\mathbb{N}_0$ and $\mathbb{N}_1$, respectively. On the other hand, with $\bot$ and $\top$ given as above, one may define $\mathbb{N}_2 = \top + \top$, $\mathbb{N}_3 = \top+\top+\top$, and so on (by [[recursion]] on the external natural number $n$). Note that we have not included any [[axiom of infinity]], however. \hypertarget{propositions_as_types}{}\subsubsection*{{Propositions as types}}\label{propositions_as_types} Under the [[Curry-Howard isomorphism]], we may identify propositions with certain atomic types and predicates with certain parametrised types. An inhabitant of such a [[propositions as types|proposition-as-a-type]] is interpreted as a `proof' of that proposition. We write $\Gamma \vdash A : \mathrm{true}$ for the judgement that $A$ is [[inhabited set|inhabited]]: that is, if $\Gamma \vdash a : A$, then $\Gamma \vdash A : \mathrm{true}$. The type-formation rules above are then seen to be the rules of inference for (a fragment of) [[intuitionistic logic|intuitionistic]] [[first-order logic]]. Indeed, we have: \begin{itemize}% \item [[logical conjunction|Conjunction]] introduction:\begin{displaymath} \frac{\Gamma \vdash A : \mathrm{true} ; \Delta \vdash B : \mathrm{true}}{\Gamma, \Delta \vdash A \times B : \mathrm{true}} \end{displaymath} \item Conjunction elimination:\begin{displaymath} \begin{aligned} \frac{\Gamma \vdash A \times B : \mathrm{true}}{\Gamma \vdash A : \mathrm{true}} \,\, & \frac{\Gamma \vdash A \times B : \mathrm{true}}{\Gamma \vdash B : \mathrm{true}} \end{aligned} \end{displaymath} \item [[truth|Truth]] introduction\begin{displaymath} \frac{}{\Gamma \vdash \top : \mathrm{true}} \end{displaymath} \item [[universal quantifier|Universal]] generalisation:\begin{displaymath} \frac{\Gamma, x : X \vdash A(x) : \mathrm{true}}{\Gamma \vdash (\Pi x : X) A(x) : \mathrm{true}} \end{displaymath} \item Universal instantiation:\begin{displaymath} \frac{\Gamma \vdash (\Pi x : X) A(x) : \mathrm{true} ; \Delta \vdash t : X}{\Gamma, \Delta \vdash A(t) : \mathrm{true}} \end{displaymath} \item Conditional proof ([[implication]] introduction):\begin{displaymath} \frac{\Gamma, X : \mathrm{true} \vdash A : \mathrm{true}}{\Gamma \vdash X \to A : \mathrm{true}} \end{displaymath} \item Modus ponens ([[implication]] elimination):\begin{displaymath} \frac{\Gamma \vdash X \to A : \mathrm{true} ; \Delta \vdash X : \mathrm{true}}{\Gamma, \Delta \vdash A : \mathrm{true}} \end{displaymath} \item [[disjunction|Disjunction]] introduction:\begin{displaymath} \begin{aligned} \frac{\Gamma \vdash A : \mathrm{true}}{\Gamma \vdash A + B : \mathrm{true}} \,\, & \frac{\Gamma \vdash B : \mathrm{true}}{\Gamma \vdash A + B : \mathrm{true}} \end{aligned} \end{displaymath} \item Disjunction elimination:\begin{displaymath} \frac{\Gamma \vdash A + B : \mathrm{true} ; \Delta, A : \mathrm{true} \vdash C : \mathrm{true} ; E, B : \mathrm{true} \vdash C : \mathrm{true}}{\Gamma, \Delta, E \vdash C : \mathrm{true}} \end{displaymath} \item [[false|False]] elimination:\begin{displaymath} \frac{\Gamma \vdash \bot : \mathrm{true}}{\Gamma \vdash A : \mathrm{true}} \end{displaymath} \item [[existential quantifier|Existential]] generalisation:\begin{displaymath} \frac{\Gamma \vdash t : X ; \Gamma \vdash A(t) : \mathrm{true}}{\Gamma \vdash (\Sigma x : X) A(x) : \mathrm{true}} \end{displaymath} \item Existential instantiation:\begin{displaymath} \frac{\Gamma \vdash (\Sigma x : X) A(x) : \mathrm{true} ; \Delta, x : X, A(x) : \mathrm{true} \vdash B : \mathrm{true}}{\Gamma, \Delta \vdash B : \mathrm{true}} \end{displaymath} \end{itemize} The only traditional rule of inference we are missing is the rule of [[excluded middle]], so this logic is [[intuitionistic logic|intuitionistic]]. The above interpretation justifies the use of the symbols $\forall$, $\exists$, $\wedge$, $\vee$ instead of $\Pi$, $\Sigma$, $\times$, $+$, when we are using types to represent propositions. \hypertarget{equality_types}{}\subsubsection*{{Equality types}}\label{equality_types} We may introduce a family of equality types for each type and each pair of terms of that type: if $\Gamma \vdash a : A$ and $\Delta \vdash a' : A$, then $\Gamma \vdash a = a' : \mathrm{Type}$. These are not the intensional [[identity types]] which Martin-L\"o{}f later introduced as a particular sort of [[inductive type|inductive family of types]], but instead an extensional notion of equality defined by [[induction]] \emph{over} the class of all types (regarded as inductively defined by the above type-formation clauses). Note that it is essential, for a purpose such as this, that the type-formation clauses be regarded as an inductive definition, rather than as ``operations'' defined on some pre-existing collection of types: in order to define equality in the way we are about to do, we have to be able to inspect a given type and decide uniquely which rule was used to construct it. The equality type is reflexive, symmetric, and transitive. That means, for example, if $\Gamma \vdash a : A$, $\Gamma \vdash b : A$, $\Gamma \vdash c : A$, $\Gamma \vdash a = b : \mathrm{true}$ and $\Gamma \vdash b = c : \mathrm{true}$ then $\Gamma \vdash a = c : \mathrm{true}$. [[Mike Shulman]]: Is that (reflexivity, symmetry, and transitivity) a rule we are giving, or an assertion we are making about derivability? I'm a little unsure because the presentation here is slightly different from that in the reference: there Martin-L\"o{}f uses both a propositional equality and a judgmental one. \hypertarget{finite_product_types}{}\subsubsection*{{Finite product types}}\label{finite_product_types} If $\Gamma \vdash a : A$, and $\Gamma \vdash b : B$, then $\Gamma \vdash a = \pi_0 (\langle a, b \rangle) : \mathrm{true}$ and $\Gamma \vdash \pi_1 (\langle a, b \rangle) = b : \mathrm{true}$. If $\Gamma \vdash c : A \times B$, then $c = \langle \pi_0 (c), \pi_1 (c) \rangle : \mathrm{true}$. \hypertarget{unit_type_2}{}\subsubsection*{{Unit type}}\label{unit_type_2} If $\Gamma \vdash a : \top$, then $\Gamma \vdash a = \mathrm{tt} : \mathrm{true}$. \hypertarget{dependent_product_types_2}{}\subsubsection*{{Dependent product types}}\label{dependent_product_types_2} If $\Gamma, x : X \vdash a(x) : A(x)$ and $\Delta \vdash t : X$, then $\Gamma, \Delta \vdash \mathrm{apply}((\lambda x : X) a(x), t) = a(t) : \mathrm{true}$. If $\Gamma \vdash f : (\Pi x : X) A(x)$, then $\Gamma \vdash f = (\lambda x : X) \mathrm{apply}(f, x) : \mathrm{true}$. \hypertarget{function_types_2}{}\subsubsection*{{Function types}}\label{function_types_2} If $\Gamma, x : X \vdash a(x) : A$ and $\Delta \vdash t : X$, then $\Gamma, \Delta \vdash \mathrm{apply}((\lambda x : X) a(x), t) = a(t) : \mathrm{true}$. If $\Gamma \vdash f : X \to A$, then $\Gamma \vdash f = (\lambda x : X) \mathrm{apply}(f, x) : \mathrm{true}$. \hypertarget{finite_sum_types}{}\subsubsection*{{Finite sum types}}\label{finite_sum_types} If $\Gamma \vdash a : A$ and $\Gamma \vdash A + B : \mathrm{Type}$, $\Delta, x : A \vdash c(x) : C(x)$ and $E, y : B \vdash c'(y) : C(y)$, then $\Gamma, \Delta, E \vdash \mathrm{cases}(a, (\lambda x : A) c(x), (\lambda y : B) c(y)) = c(a) : \mathrm{true}$ and $\Gamma, \Delta, E \vdash \mathrm{cases}(b, (\lambda x : A) c(x), (\lambda y : B) c'(y)) = c'(b) : \mathrm{true}$ \hypertarget{dependent_sum_types_2}{}\subsubsection*{{Dependent sum types}}\label{dependent_sum_types_2} If $\Gamma \vdash t : X$, $\Gamma \vdash a : A(t)$ and $\Delta, x : X, y : A(x) \vdash b(x, a) : B((x, a))$, then $\Gamma, \Delta \vdash \mathrm{cases}((t, a), (\lambda x : X)(\lambda y : A(x)) b(x, y)) = b(t, a) : \mathrm{true}$. The other equality rule for dependent sum types is derivable from the above. \hypertarget{properties}{}\subsection*{{Properties}}\label{properties} \hypertarget{models_and_categorical_semantics}{}\subsubsection*{{Models and categorical semantics}}\label{models_and_categorical_semantics} The [[models]] of ML type theory depend crucially on whether one considers the variant of [[extensional type theory]] or that of [[intensional type theory]]. The models of the extensional version are (just) [[locally cartesian closed categories]]. The faithful models of the intensional version with [[identity types]] are however certain [[(∞,1)-categories]], notably [[(∞,1)-toposes]], presented by [[simplicial model categories]] (\hyperlink{Warren}{Warren}). For this reason one speaks of \emph{[[homotopy type theory]]}. For a more detailed discussion of these matters see at \emph{[[relation between type theory and category theory]]}. \hypertarget{AxiomOfChoice}{}\subsubsection*{{Axiom of choice}}\label{AxiomOfChoice} In dependent type theory we can verify the following ``logical form of the [[axiom of choice]]'' (\hyperlink{Bell}{Bell}, \hyperlink{Tait}{Tait}), see also (\hyperlink{Rijke}{Rijke, section 2.5.1}). \begin{theorem} \label{}\hypertarget{}{} \textbf{(ACL)} \begin{displaymath} x : A, y : B(x) \vdash C(x, y) : Type \; \vdash \; acl : (\forall x : A) (\exists y : B(x)) C(x, y) \to (\exists f : (\Pi x : A)B(x) )(\forall x : A) C(x, \mathrm{apply}(f, x)) \,. \end{displaymath} \end{theorem} One should note carefully that this ``is'' only ``the axiom of choice'' under the above propositions-as-types interpretation of the quantifiers $\forall$ and $\exists$. \begin{remark} \label{}\hypertarget{}{} In the [[categorical semantics]] of this expression, using the [[propositions-as-types]] logic corresponds roughly to working with the [[subobject lattices]] in the [[ex/lex completion]] of a [[locally cartesian closed category]]; the ACL then follows since every object of the original category becomes [[projective object|projective]] in its ex/lex completion. \end{remark} \begin{remark} \label{}\hypertarget{}{} If we use instead a different logic over the same type theory, such as [[bracket types]] to model the actual subobject lattices in an arbitrary [[locally cartesian closed category|lccc]] (not necessarily the ex/lex completion of anything), or the [[hProp]] logic in [[homotopy type theory]], then the ACL in that logic will not be derivable. \end{remark} \hypertarget{related_concepts}{}\subsection*{{Related concepts}}\label{related_concepts} [[!include notions of type]] \hypertarget{references}{}\subsection*{{References}}\label{references} See also the references at \emph{[[type theory]]}. The original reference is \begin{itemize}% \item [[Per Martin-Löf]], \emph{Intuitionistic type theory} (1984) \item [[Per Martin-Löf]], \emph{An intuitionistic theory of types: predicative part}, In Logic Colloquium (1973), ed. H. E. Rose and J. C. Shepherdson (North-Holland, 1974), 73-118. (\href{http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.926}{web}) \end{itemize} A philosophical examination is \begin{itemize}% \item [[Göran Sundholm​]], \emph{Proof Theory and Meaning} (1986), (\href{https://openaccess.leidenuniv.nl/bitstream/handle/1887/11978/9_05?sequence=1}{pdf}) \end{itemize} An introduction and survey (with an eye towards [[homotopy type theory]]) is in chapter 1 of \begin{itemize}% \item [[Michael Warren]], \emph{Homotopy theoretic aspects of constructive type theory}, PhD thesis (2008) (\href{http://www.andrew.cmu.edu/user/awodey/students/warren.pdf}{pdf}) \end{itemize} as well as \begin{itemize}% \item Egbert Rijke, \emph{Homotopy type theory} (2012) (\href{http://hottheory.files.wordpress.com/2012/08/hott2.pdf}{pdf}) \end{itemize} A discussion of ML dependent type theory as the [[internal language]] of [[locally cartesian closed categories]] is in \begin{itemize}% \item R. A. G. Seely, \emph{Locally cartesian closed categories and type theory}, Math. Proc. Camb. Phil. Soc. (1984) 95 (\href{http://www.math.mcgill.ca/rags/LCCC/LCCC.pdf}{pdf}) \end{itemize} Discussion of the logical [[axiom of choice]] in dependent type theory is in \begin{itemize}% \item John Bell, \emph{The Axiom of choice in type theory}, Stanford Encyclopedia of philosophy, 2008 (\href{http://plato.stanford.edu/entries/axiom-choice/choice-and-type-theory.html}{web}) \end{itemize} \begin{itemize}% \item Tait (1994) \end{itemize} [[!redirects Martin-Lof dependent type theory]] [[!redirects Martin-Löf dependent type theory]] [[!redirects Martin-Lof type theory]] [[!redirects Martin-Löf type theory]] [[!redirects Martin-Löf type theories]] [[!redirects constructive type theory]] [[!redirects intuitionistic type theory]] \end{document}