It describes a type theory where you have a type $\T$ where you get a sequence of three adjoint functors: \[ (\T \x \dash) \adjoint (\T \to \dash) \adjoint \sqrt{}\] It's kind of unusual in general that a type $\T$ should have a right adjoint to its function space like this; it's sometimes called an Amazing Right Adjoint.
Mostly I was wondering; would it get simpler and nicer somehow?
In this setting, we're living inside a "big" type theory where every type is a function $f : A \to B$ from one "ordinary" type to another. Since $\T = 0 \to 1$, we can explicitly compute some of these functors:
Also in this setting $\T$ is a "mere proposition", i.e. its terms are "proof irrelevant". Any two functions into $\T$ are equal, despite it not being the terminal object of its category. So this is quite a special case!
As a general warning, the following bit of the story is pretty sketchy and extremely mutually recursive and full of forward references.
In fact, what I want to do is start with the idea that there are two distinct languages syntactically, one of which is the "main" type theory, and another one is the shadow of that theory after we've assumed at least some term of type $\T$ exists. This "reduced" or "erased" type theory is going to look pretty much like ordinary dependent type theory, \[\begin{array}{rlcl} \textrm{Erased Contexts} & \Gamma_0 &\cc=& \cdot \celse \Gamma_0, x : A_0 \\ \textrm{Erased Types} & A_0 &\cc=& \cdots \\ \textrm{Erased Terms} & M_0 &\cc=& \cdots \end{array}\] and then the "main" type theory we care about has some extra features on top of normal dependent type theory: \[\begin{array}{rlcl} \textrm{Contexts} & \Gamma &\cc=& \cdot \celse \Gamma, x : A \celse \Gamma, x :: A_0 \\ \textrm{Types} & A &\cc=& \cdots \celse \T \\ \textrm{Terms} & M &\cc=& \cdots \end{array}\] This new context former $x :: A_0$ is analogous to the locking that Riley is doing; intuitively a variable $x :: A_0$ has a type something like $\T \to A_0$. It's "locked behind" needing to provide a term of type $\T$. This is how we should eventually be able to give formation and introduction rules for $\sqrt{}$, by judgmentally applying its left adjoint $\T \to \dash$ to the context.
But before we even get to that point, we can think about how to even set up the context formation rule for $x :: A_0$. We posit: \[{\vdash \Gamma\ \ms{ctx} \qquad \Gamma^0 \vdash A_0 : \ms{type} \over \vdash (\Gamma, x \cc A_0)\ \ms{ctx}}\] Using an operation $\Gamma \mapsto \Gamma^0$ that we haven't defined yet, whose purpose is to take a "main" $\Gamma$ to an erased one. The idea is that to the extent that $x :: A_0$ is like $x : \T \to A_0$, the context in which $A_0$ makes sense is $\Gamma$ extended with a term of type $\T$, i.e. something like $\Gamma, t : \T$. This is morally what $\Gamma^0$ is supposed to be: the moment we assume a term of type $\T$ exists, various of things collapse. For example, assumptions $x :: A_0$ become ordinary assumptions $x : A_0$, because the obligation to come up with a term of type $\T$ to unlock them is now satisfied.
Here's a definition of a few of the more interesting cases of erasure:
Suppose $M_0 = x$ and $\Gamma = \Gamma_1, x \cc A_0, \Gamma_2$. Then we have
and we're trying to show
This follows immediately from the variable rule.
Suppose instead that $M_0 = x$ for $\Gamma = \Gamma_1, x : A, \Gamma_2$. Then we have
and we must show
For this it suffices to show $A \equiv A^0[t \star \Gamma]$, which we have by the previous lemma. $\cqed$
1.
Suppose we have
\[{\vdash \Gamma\ \ms{ctx} \qquad \Gamma^0 \vdash A_0 : \ms{type} \over \vdash (\Gamma, x \cc A_0)\ \ms{ctx}}\]then we can show
\[{\vdash \Gamma^0\ \ms{ctx} \qquad \Gamma^0 \vdash A_0 : \ms{type} \over \vdash (\Gamma^0, x : A_0)\ \ms{ctx}}\]3.
Suppose $\Gamma = \Gamma_1, x :: A_0, \Gamma_2$, and $M = x\llbracket t\rrbracket$. Then we have \[{\Gamma \vdash t : \T \qquad x \cc A_0 \in \Gamma \over \Gamma \vdash x\llbracket t \rrbracket : A_0[t \star \Gamma]}\]
and we need to show $\Gamma^0 \vdash x : (A_0[t \star \Gamma])^0$, so we need $x : (A_0[t \star \Gamma])^0 \in \Gamma^0$, hence we need $(A_0[t \star \Gamma])^0 \equiv A_0$, but we have this by earlier lemma. $\cqed$
Now I want to define an operation $\Gamma^🔒$ that takes a $\Gamma$ and makes everything in it locked behind the $::$ context-former. We define it as follows:
Case: Suppose we have $(\Gamma, x : A)$. \[((\Gamma, x : A)^🔒)^0 = (\Gamma^🔒, x \cc A^0)^0 = ((\Gamma^🔒)^0, x : A^0)\] \[ = (\Gamma^0, x : A^0) = (\Gamma, x : A)^0 \]
Case:Suppose we have $(\Gamma, x \cc A_0)$. \[((\Gamma, x \cc A_0)^🔒)^0 = (\Gamma^🔒, x \cc A_0)^0 = ((\Gamma^🔒)^0, x : A_0)\] \[ = (\Gamma^0, x : A_0) = (\Gamma, x :: A_0)^0 \]
Case: Suppose we have
\[{\vdash \Gamma\ \ms{ctx} \qquad \Gamma \vdash A : \ms{type} \over \vdash (\Gamma, x : A)\ \ms{ctx}}\]then use the i.h. to get $\vdash \Gamma^🔒\ \ms{ctx}$, and the well-typedness of erasure to get $\Gamma^0 \vdash A^0 : \ms{type}$ and apply the previous lemma and the rule \[{\vdash \Gamma^🔒\ \ms{ctx} \qquad (\Gamma^🔒)^0 \vdash A^0 : \ms{type} \over \vdash (\Gamma^🔒, x \cc A^0)\ \ms{ctx}}\]
Case: Suppose we have
\[{\vdash \Gamma\ \ms{ctx} \qquad \Gamma^0 \vdash A_0 : \ms{type} \over \vdash (\Gamma, x \cc A_0)\ \ms{ctx}}\]then use the i.h. to get $\vdash \Gamma^🔒\ \ms{ctx}$, and use the previous lemma and rule \[{\vdash \Gamma^🔒\ \ms{ctx} \qquad(\Gamma^🔒)^0 \vdash A_0 : \ms{type} \over \vdash (\Gamma^🔒, x \cc A_0)\ \ms{ctx}}\]
to finish. $\cqed$