\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*{Initiality Project - Overview} \hypertarget{initiality_project__overview}{}\section*{{Initiality Project - Overview}}\label{initiality_project__overview} This page is part of the [[Initiality Project]]. Here is a proposed slate of choices to make regarding type theories, presentations, definitions, and proof structure. (``I'' refers to [[Mike Shulman]].) This is only a first proposal and may change; discussion is underway at the nForum \href{https://nforum.ncatlab.org/discussion/9160/initiality-project-plans/}{here}. \noindent\hyperlink{Semantics}{The semantics}\dotfill \pageref*{Semantics} \linebreak \noindent\hyperlink{the_type_theory}{The type theory}\dotfill \pageref*{the_type_theory} \linebreak \noindent\hyperlink{axioms}{Axioms}\dotfill \pageref*{axioms} \linebreak \noindent\hyperlink{raw_syntax}{Raw syntax}\dotfill \pageref*{raw_syntax} \linebreak \noindent\hyperlink{bidirectionality}{Bidirectionality}\dotfill \pageref*{bidirectionality} \linebreak \noindent\hyperlink{the_proof}{The proof}\dotfill \pageref*{the_proof} \linebreak \noindent\hyperlink{the_partial_interpretation}{The partial interpretation}\dotfill \pageref*{the_partial_interpretation} \linebreak \noindent\hyperlink{totality_of_the_interpretation}{Totality of the interpretation}\dotfill \pageref*{totality_of_the_interpretation} \linebreak \noindent\hyperlink{loose_ends}{Loose ends}\dotfill \pageref*{loose_ends} \linebreak \hypertarget{Semantics}{}\subsection*{{The semantics}}\label{Semantics} Of the various ways to describe a [[categorical model of dependent types]], I suggest to use \emph{categories with families}, presented in the style called by [[Steve Awodey|Awodey]] a \href{https://arxiv.org/abs/1406.3219}{natural model}, but fully algebraically. That is, for us a category with families is a (small) [[category]] $C$ together with two [[presheaves]] $Tm,Ty \in [C^{op},Set]$ and a morphism $Tm \to Ty$ that is \emph{algebraically representable} (or, one might say, ``represented''): it is equipped with a \emph{function} assigning to each morphism $A:y \Gamma \to Ty$, where $\Gamma\in C$ and $y$ denotes the [[Yoneda embedding]], an object $\Gamma.A\in C$ and a [[pullback square]] \begin{displaymath} \itexarray{ y(\Gamma.A) & \to & Tm \\ \downarrow &&\downarrow \\ y\Gamma & \xrightarrow{A} & Ty. } \end{displaymath} This is equivalent to the usual notion of category with families (and thereby also to the usual notion of ``category with attributes'', hence also to discrete or full split comprehension categories). But, as noted by Awodey, focusing attention on $Tm$ and $Ty$ as objects of $[C^{op},Set]$ has the advantage that the additional structure corresponding to the rules of a type theory are also naturally formulated in $[C^{op},Set]$. For instance, if $Ty^2$ denotes the domain of the local exponential $(Ty\times Ty \to Ty)^{(Tm\to Ty)}$, then the rules of $\Sigma$-formation and $\Pi$-formation correspond semantically to giving a morphism $Ty^2 \to Ty$. Note also that $Ty^2$ can be described in the internal extensional type theory of $[C^{op},Set]$ by the context $(A:Ty, B:Tm(A) \to Ty)$; thus $[C^{op},Set]$ is a sort of ``semantic [[logical framework]]'' for structuring $C$. My inclination right now is that while we can rely on this for intuition and explanation, we should also formulate all this structure precisely in traditional category-theoretic language, to avoid any appearance of circularity in our construction of categorical models of dependent type theory. A \emph{morphism of categories with families} is a functor $F:C\to D$ together with a commutative square in $[C^{op},Set]$: \begin{displaymath} \itexarray{ Tm_C & \to & F^*(Tm_D) \\ \downarrow & & \downarrow \\ Ty_C & \to & F^*(Ty_D) } \end{displaymath} which strictly respects the chosen pullback squares in an appropriate way. This defines the category $CwF$ in which we hope to construct an initial object. \hypertarget{the_type_theory}{}\subsection*{{The type theory}}\label{the_type_theory} I suggest to start with a type theory containing only $\Pi$-types. This seems the simplest situation where we will have to deal with all the basic issues. We can then add additional structure as desired. \hypertarget{axioms}{}\subsubsection*{{Axioms}}\label{axioms} Note that this type theory is completely empty unless we also assert some axioms. Ideally, I would like the ``initiality theorem'' to really be a ``freeness theorem'', saying that the syntactic category of a type theory with axioms is freely generated by those axioms. Of course, particular axioms can just be added as rules to a theory, but such a general freeness theorem should be parametric over all possible axioms. Since in a dependent type theory, each axiom can involve previous axioms in its type, it seems that the general semantic formulation will have to involve some kind of a ``cell complex'' in the category $CwF$. However, we can leave this to the future for the moment and concentrate on the inductive clauses for interpreting the basic rules of $\Pi$-types. \hypertarget{raw_syntax}{}\subsubsection*{{Raw syntax}}\label{raw_syntax} I propose to use syntax with named variables, quotiented by $\alpha$-equivalence. My reason is that our goal is expositional and sociological, and named variables keep the syntax as close as possible to what ``users'' of type theory are familiar with. Since we are humans writing for humans to read, I don't want to deal explicitly with de Bruijn indices, and neither do I want to pretend that we are using de Bruijn indices when we aren't \emph{really} using them. If this proposal is adopted, then the raw terms for our simple type theory will be inductively generated by: \begin{itemize}% \item Every variable $x$ is a term. \item If $A,B$ are terms and $x$ is a variable, then $\Pi(x:A) B$ is a term. \item If $A,B,M$ are terms and $x$ is a variable, then $\lambda(x:A.B)M$ is a term. \item If $A,B,M,N$ are terms and $x$ is a variable, then $App^{(x:A)B}(M,N)$ is a term. \end{itemize} We define $\alpha$-equivalence which renames bound variables as usual. Note that the variable $x$ in $\Pi(x:A)B$ scopes only over $B$, in $\lambda(x:A.B)M$ it scopes only over $B$ and $M$, and in $App^{(x:A)B}(M,N)$ it scopes only over $B$. Capture-avoiding substitution is likewise defined as usual. Our partial interpretation will be defined recursively over the above inductive definition of terms, and proven to respect $\alpha$-equivalence. \hypertarget{bidirectionality}{}\subsubsection*{{Bidirectionality}}\label{bidirectionality} Following Streicher, all our terms are fully (or at least ``sufficiently'') annotated. For instance, we write $App^{(x:A)B}(M,N)$ rather than just $App(M,N)$. (It is, at best, unclear whether any less than fully annotated syntax can be used in an initiality theorem without preprocessing that is tantamount to annotating it.) In particular, this means that given $\Gamma$ and $t$, if $\Gamma \vdash t:A$ can be derived for any value of $A$, then there is a canonical such $A$ that can be deduced syntactically, or \emph{synthesized}, from $\Gamma$ and $t$. For instance, if $App^{(x:A)B}(M,N)$ has any type, then it must have the type $B[N/x]$. On the other hand, the conversion rule implies that $App^{(x:A)B}(M,N)$ must also have any type that is judgmentally \emph{equal} to $B[N/x]$. Type theorists have a standard technique for distinguishing these two situations, known as [[bidirectional typechecking]]. Instead of one judgment $\Gamma\vdash t:A$, we have two typing judgments: \begin{itemize}% \item $\Gamma \vdash t \Rightarrow A$: in context $\Gamma$ the term $t$ \emph{synthesizes} the type $A$. Here $A$ is, if it exists, uniquely determined by $\Gamma$ and $t$: it is an ``output'' to their ``inputs''. \item $\Gamma \vdash t \Leftarrow A$: in context $\Gamma$ the term $t$ \emph{checks against} the type $A$. Here $\Gamma$, $t$, and $A$ are all ``inputs'' and the only ``output'' is the truth value of whether the typecheck is valid. \end{itemize} There are various advantages of bidirectional typechecking, including: \begin{enumerate}% \item In at least some cases, it permits a formulation of type theory in which only normal forms exist. \item In at least some cases, it allows omission of annotations, e.g. an un-annotated abstraction $\lambda x.M$ cannot synthesize a type, but it can check against a $\Pi$-type $\Pi(x:A) B$. \item In at least some cases, it makes it easier to incorporate [[η-expansion]] into an equality-checking algorithm. \item In at least some cases, it makes derivations of judgments unique, or at least canonical. \item In at least some cases, it isolates the use of judgmental equality during typechecking in one particular ``mode-switching'' rule:\begin{displaymath} \frac{\Gamma \vdash t \Rightarrow A \qquad \Gamma \vdash A\equiv B}{\Gamma \vdash t \Leftarrow B} \end{displaymath} \end{enumerate} (Experts, feel free to add more.) It is unclear at present whether any of these advantages are relevant to categorical semantics, but by using a bidirectional framework we are better placed to take advantage of them if they do become relevant. More importantly, it seems to me that the natural structure of the semantic interpretation, as suggested by [[Peter Lumsdaine]] (see below), matches the syntactic bidirectional picture quite closely, and it may be clarifying to make that analogy more precise. Since all our terms are fully annotated, all of our formation, introduction, and elimination rules can synthesize their types. However, their \emph{premises} usually involve \emph{checking} their subterms against appropriate types, so the above mode-switching rule gets applied a lot (it is the only way, in our system, to derive a checking judgment). This might be an issue to want to optimize away in an implementation, but for our semantic purposes it seems irrelevant. For instance, here are the formation, introduction, and elimination rules for $\Pi$-types: \begin{displaymath} \frac{\Gamma \vdash A \, type \qquad \Gamma, x:A \vdash B\,type}{\Gamma \vdash \Pi(x:A) B \, type} \end{displaymath} \begin{displaymath} \frac{\Gamma \vdash A \, type \qquad \Gamma, x:A \vdash B\,type \qquad \Gamma \vdash M \Leftarrow \Pi(x:A) B \qquad \Gamma \vdash N \Leftarrow A}{\Gamma \vdash App^{(x:A)B}(M,N) \Rightarrow B[N/x]} \end{displaymath} \begin{displaymath} \frac{\Gamma \vdash A \, type \qquad \Gamma,x:A \vdash B \,type \qquad \Gamma,x:A \vdash M \Leftarrow B}{\Gamma \vdash \lambda(x:A.B)M \Rightarrow \Pi(x:A) B} \end{displaymath} (Note that the ``is a type'' judgment $\Gamma \vdash A\,type$ is not bidirectional. With Russell universes we could consider making it so.) The ``hypothesis'' rule is that a variable in the context synthesizes its assumed type: \begin{displaymath} \frac{(x:A) \in \Gamma}{\Gamma \vdash x \Rightarrow A.} \end{displaymath} In implementations of bidirectional typechecking, the equality judgments $\Gamma \vdash s\equiv t : A$ and $\Gamma \vdash A \equiv B \, type$ are sometimes made bidirectional as well. But at the moment, I don't think there will be is any benefit to us in doing likewise. In particular, we would like our setup to be general enough to encompass type theories whose judgmental equality is ``poorly behaved'', e.g. undecidable, such as those with an [[extensional type theory|equality reflection rule]]. Thus the equality judgments should have primitive rules asserting reflexivity, symmetry, transitivity, and congruence properties. Streicher also includes a basic judgment for equality of \emph{contexts}. Peter \href{https://nforum.ncatlab.org/discussion/8904/a-communal-proof-of-an-initiality-theorem/?Focus=71254#Comment_71254}{suggests} that that isn't necessary, because \begin{quote}% any contexts that \emph{would} be judgementally equal in the system with that judgement still end up canonically end up judgementally isomorphic, by the substitution that consists of not renaming variables. \end{quote} I'm inclined to follow Peter's suggestion here, but am open to counterarguments. Streicher also includes a number of explicit primitive rules involving things like validity of contexts and type-preservation by substitution. I'm not sure whether these are necessary or not; it seems that maybe by presenting our type theories in ``the usual way'' we should always be able to ensure that substitution is admissible, even for type theories that are ``ill-behaved'' in other ways (such as equality reflection). But maybe there are good reasons to include these rules explicitly? \hypertarget{the_proof}{}\subsection*{{The proof}}\label{the_proof} The following proposal for the inductive structure of the argument is based on Streicher's original approach, with a modification suggested by \href{https://nforum.ncatlab.org/discussion/8904/a-communal-proof-of-an-initiality-theorem/?Focus=71254#Comment_71254}{Peter Lumsdaine}, and further tweaks to incorporate bidirectionality and build in naturality using the natural-models technology. \hypertarget{the_partial_interpretation}{}\subsubsection*{{The partial interpretation}}\label{the_partial_interpretation} Given a finite set of variables $V = \{x_1,\dots,x_n\} \subseteq Var$, the \emph{presheaf of environments} for $V$ is $Tm^V$. We will define, by structural induction on any term $t$, and any any finite set $V$ of variables, the following partial morphisms of presheaves. \begin{enumerate}% \item $\llbracket t \rrbracket ^V_{type} : Tm^V \rightharpoonup Ty$. \item $\llbracket t \rrbracket ^V_{\Rightarrow} : Tm^V \rightharpoonup Tm$. \item $\llbracket t \rrbracket ^V_{\Leftarrow} : Tm^V \times Ty \rightharpoonup Tm$ such that the composite $Tm^V \times Ty \rightharpoonup Tm \to Ty$ is the second projection. \end{enumerate} In fact, the third of these is not actually inductive at all: it is simply a semantic counterpart of the bidirectional mode-switching judgment. We define $\llbracket t \rrbracket ^V_{\Leftarrow}$ to be the domain restriction of \begin{displaymath} Tm^V \times Ty \xrightarrow{pr_1} Tm^V \overset{\llbracket t \rrbracket ^V_{\Rightarrow}}{\rightharpoonup} Tm \end{displaymath} to the equalizer of \begin{displaymath} Tm^V \times Ty \xrightarrow{pr_1} Tm^V \overset{\llbracket t \rrbracket ^V_{\Rightarrow}}{\rightharpoonup} Tm \to Ty \end{displaymath} and the restriction of the second projection $Tm^V \times Ty$ to its domain. The other inductive clauses of the partial interpretation should precisely mirror the bidirectional rules of our type theory, using recursive calls to the above three operations as counterparts of the three syntactic judgments $\Gamma \vdash A\,type$, $\Gamma \vdash t\Rightarrow A$, and $\Gamma \vdash t\Leftarrow A$. Note, though, that at this point this is only an analogy: we are simply inducting over the raw term structure of $t$, not making any actual reference to these judgments. This suggestion incorporates the innovation proposed by \href{https://nforum.ncatlab.org/discussion/8904/a-communal-proof-of-an-initiality-theorem/?Focus=71254#Comment_71254}{Peter} over Streicher's proof of taking the interpretation of the context $\Gamma$ as an \emph{input} to the partial intepretation functions rather than an output (see in particular his point (7)). The elements of the presheaf $Tm^V$ at some object $X\in C$ are what Peter calls ``environments'' for $t$. Note that we do not require that $V$ contain all free variables occurring in $t$, but if it omits some then the partial interpretation morphisms should turn out to have empty domain. I have also reformulated the interpretation function to ``put naturality into the goals of the original induction'' as suggested by Peter in his point (8), by directly defining partial morphisms in the ``semantic logical framework'' $[C^{op},Set]$. This has the additional advantage that in writing down the inductive clauses we can refer directly to the natural-models formulation of the corresponding structure on $C$, as sketched \hyperlink{Semantics}{above}. \hypertarget{totality_of_the_interpretation}{}\subsubsection*{{Totality of the interpretation}}\label{totality_of_the_interpretation} Although the partial interpretation functions sketched above incorporate a number of ``tweaks'' to make it more pleasing, in fact it was already the short part: Streicher does it in only 5 pages. (His pages are very short, so this isn't actually very much, plus his type theory is more complicated.) The long part is proving that these interpretation functions are total on derivable judgments; this takes Streicher 40 pages. The outline should be the same as in Streicher's proof and Peter's proposal: \begin{enumerate}% \item Prove by induction on raw terms that the partial interpretation functions take syntactic substitution (including weakening) to semantic substitution (restriction in the presheaves $Tm$ and $Ty$). This takes Streicher 17 pages. \item Prove by induction on derivations that the partial interpretation functions are total on derivable judgments. This takes Streicher 20 pages. \end{enumerate} \hypertarget{loose_ends}{}\subsubsection*{{Loose ends}}\label{loose_ends} To complete the proof of initiality after this, it remains to: \begin{enumerate}% \item Construct the term model. This takes Streicher 12 pages. \item Show that the above interpretation assembles into a morphism in $CwF$ from the term model to $C$. As far as I can tell, Streicher doesn't actually do this, he just claims that it can be done. \item Show that this morphism is unique. Streicher doesn't actually do this either. \end{enumerate} category: Initiality Project \end{document}