1. Point-free semantics of dependent type theories
M Benini, R Bonacina
Università degli Studi dell’Insubria
University of Canterbury,
December 4th, 2017
2. Why
Also known as constructive type theory, or Martin-Löf type theory,
dependent type theory has recently seen a huge raise of interest
because it is the basis for homotopy type theory.
Semantics for dependent type theories are known: they are variations
on the semantics of typed λ-calculi. Usually, they are complex:
they are either based on the advanced theory of orders (specialised
domains), or on category theory;
in the case of categorical models, they use non-elementary
constructions (fibrations, higher-order cells, . . . );
homotopy type theory has an intended semantics based on
∞-groupoids;
the only categorical semantics (Seely) which does not use those
advanced constructions, contains a problem (i.e., it does not
work). Locally Cartesian closed categories are not enough to
properly model dependent type theory (Hoffman, Dybjer).
( 2 of 17 )
3. Why
Why are complex, higher-order models needed? Are they, really?
These were the initial questions that have been addressed in
Roberta’s master thesis. The answer was that there is no need for
such complex constructions: a categorical model, using no
higher-order constructions, suffices to provide a sound and complete
explanation to dependent type theory.
However, the result was not completely satisfactory because
the notion of inductive theory was sketched but not precisely
defined in all the details;
some passages in the soundness and completeness proofs were
reasonable but not formal;
in the overall, there was the feeling that the result had to be
polished to reach its maximal generality.
( 3 of 17 )
4. What
So, the visit here, at the University of Canterbury had the purpose to
precisely define the syntactic notion of inductive theory, and pave
the way toward its extension to higher-inductive types, as defined
in homotopy type theory;
polish the semantics and fix all the passages in the soundness and
completeness proofs.
In short, we did it!
In the following, I am going to give a glance to the semantics.
( 4 of 17 )
5. Point-free semantics
Consider the following inductive types:
the 0 type, which is characterised as the type having no terms;
the N−
, which is characterised by the rule having the inductive step
n : N−
→ succ(n) : N−
but not the basic step 0 : N−
.
Usually, these two types are considered equivalent because they have
no terms belonging to them: the minimal fix point of their
constructing rules is the same.
However, they can be distinguished: if x : 0 and y : N−
stand for some
objects in the types 0 and N−
, it is evident that no object other than
x is forced to be in 0, while succ(y), succ(succ(y)), ... are all in N−
.
We want a semantics in which the meaning of a type depends on the
context in which it is defined, so to be able to distinguish 0 from N−
.
( 5 of 17 )
6. Point-free semantics
The semantics is then point-free: types and their terms do not
identify entities (“points”) in some universe. They explain how
judgements are kept together by the logical inferences. And they do
so by taking local values, which change under different assumptions.
So N−
is not equivalent to the 0 type: they are the same thing in the
empty context, while they differ in a context in which we assume both
types contain at least one term.
( 6 of 17 )
7. The big picture
The semantics is based on category theory.
An inductive theory, i.e., a series of inductive types defined in the
standard dependent type theory, has models in the class of
ML-categories.
These categories allow to interpret dependent type theory and
inductive types in a natural way. A category which makes valid all the
judgements of an inductive theory is a model, and it has holds that
every inductive theory has a model (Soundness);
every judgement which is valid in any model of an inductive theory
is derivable (Completeness);
for every inductive theory there is a model which is contained in
every other model (Classification).
( 7 of 17 )
8. The big picture
Mctx
Γ
MΓ
∆
M∆
•
M•
Mctx is a partial order with minimum • in which all paths are finite;
each MΓ is a preorder with Γ as its minimum such that each pair of
elements has a least upper bound;
Mctx and all the MΓ form the ML-category (for Martin-Löf).
( 8 of 17 )
9. Inside pyramids
Each MΓ has the following structure:
Γ
π π π π
a
∈
a
∈
b
∈
b
∈A
∈
B
∈Ui
∈
Ui+1
10. Inside pyramids
Each MΓ has the following structure:
Γ
π π π π
a
∈
a
∈
b
∈
b
∈A
∈
B
∈Ui
∈
Ui+1
context
proper terms
proper types
universes
( 9 of 17 )
11. Interpretation
x : A,y : B,z : C ctx =
x : A
y : B
z : C
•ctx
x : Actx
x : A,y : Bctx
x : A,y : B,z : C ctx
in Mctx
Γ a : A = Γ a A
π ∈
in MΓ
Γ a ≡ b : A = Γ
a
b
A
π ∈
π ∈
i in MΓ
( 10 of 17 )
12. Variables
Variables have more than one role in dependent type theory:
they are hypotheses in the context;
they are terms in the language;
they are the only entities which may be substituted.
The first role is captured by interpreting contexts as objects in Mctx
and their way to be written down as path of irreducible arrows in the
same category.
The second role requires that there is an object in MΓ deputed to
interpret x.
The third role imposes a deeper structure on the ‘pyramids’ over Mctx.
( 11 of 17 )
15. Variables
Γ
x:A
A
Ui
π
∈
A
Ui
π
∈
x
π
∈
a
a
∼=
∼=
an irreducible arrow in Mctx induces a new term x in the pyramid
over the codomain;
a term a of type A in Γ is so also in the extended context;
substituting a in x, i.e., making them isomorphic and closing for
type generation, forces the pyramids to be equivalent.
( 12 of 17 )
16. Inductive types
An inductive type is the minimal collection of terms closed under the
interpretation of its introduction rules.
Semantically, this means an inductive type is the colimit of the
diagram composed by the terms-in-context which are the result of the
closure of the transformation associated to the introduction rules.
For example, the dependent sum has the following introduction rule:
Γ b : B[a/x] Γ a : A Γ,x : A B : Ui Γ A : Ui
Σ−I
Γ (a,b) : Σx : A.B
The associated semantic transformation θ maps each pair of objects
α and β in MΓ such that there are ∈: α → A Γ and ∈: β → B[a/x] Γ
in an object θ(α,β) of MΓ.
( 13 of 17 )
17. Inductive types
In general, the guiding principle is that the formation rule is used to
identify the space S of terms which is transformed to construct the
terms in the new inductive type. So, θ: S → MΓ.
The space S forms a category, and θ becomes a functor. As such, θ
has to be free, in one of the way to interpret this adjective in category
theory, to ensure that the construction is inductive.
The idea is that θ must be associated with T, the inductive theory as
a whole, not to each specific type. Then, MΓ is the minimal fix point
of the θ transformation in a category having enough terms to
interpret the context Γ in which every variable is a distinct term.
( 14 of 17 )
18. Inductive types
Difficult to express, but mathematically straightforward, this idea of
inductive theory allows to capture at once recursive types, mutual
recursive types, and even more esoteric beasts.
The formal framework had also a pleasant consequence: namely, all
the canonical types are inductive. So, the dependent sum Σ, the
dependent product Π, the coproduct +, the empty type 0, the unit
type 1, and equality in a type =A can be treated in the very same way
as natural numbers.
In fact, the non-inductive part of dependent type theory is reduced to
the structural rules (context formation, variables, judgemental
equality) and the rules about universes, which are structural in a
sense, because they are used to distinguish types.
( 15 of 17 )
19. The state of the art
We are in the process of writing down all of this. In this moment, we
have the definition of ML-category, a few of its properties, and the
definition of interpretation written down with all the details.
Inductive types are completely developed: however, only the syntactic
side has been polished. The semantics of them needs to be written
and checked once again.
We have the definition of syntactic category, the classification,
soundness and completeness theorem to polish: they have been
developed in all the details, but not yet written down in the proper
mathematical style.
We have a rough sketch of how everything should work on
higher-inductive types, but this is far from being a result, even with a
very optimistic view. . . not yet, at least!
( 16 of 17 )