point-free semantics of dependent type theories

20
Point-free semantics of dependent type theories M Benini, R Bonacina Università degli Studi dell’Insubria University of Canterbury, December 4 th , 2017

Upload: marco-benini

Post on 28-Jan-2018

51 views

Category:

Science


2 download

TRANSCRIPT

Page 1: Point-free semantics of dependent type theories

Point-free semantics of dependent type theories

M Benini, R Bonacina

Università degli Studi dell’Insubria

University of Canterbury,December 4th, 2017

Page 2: Point-free semantics of dependent type theories

Why

Also known as constructive type theory, or Martin-Löf type theory,dependent type theory has recently seen a huge raise of interestbecause it is the basis for homotopy type theory.Semantics for dependent type theories are known: they are variationson the semantics of typed λ-calculi. Usually, they are complex:■ they are either based on the advanced theory of orders (specialiseddomains), or on category theory;

■ in the case of categorical models, they use non-elementaryconstructions (fibrations, higher-order cells, . . . );

■ homotopy type theory has an intended semantics based on∞-groupoids;

■ the only categorical semantics (Seely) which does not use thoseadvanced constructions, contains a problem (i.e., it does notwork). Locally Cartesian closed categories are not enough toproperly model dependent type theory (Hoffman, Dybjer).

( 2 of 17 )

Page 3: Point-free semantics of dependent type theories

Why

Why are complex, higher-order models needed? Are they, really?These were the initial questions that have been addressed inRoberta’s master thesis. The answer was that there is no need forsuch complex constructions: a categorical model, using nohigher-order constructions, suffices to provide a sound and completeexplanation to dependent type theory.However, the result was not completely satisfactory because■ the notion of inductive theory was sketched but not preciselydefined in all the details;

■ some passages in the soundness and completeness proofs werereasonable but not formal;

■ in the overall, there was the feeling that the result had to bepolished to reach its maximal generality.

( 3 of 17 )

Page 4: Point-free semantics of dependent type theories

What

So, the visit here, at the University of Canterbury had the purpose to■ precisely define the syntactic notion of inductive theory, and pavethe way toward its extension to higher-inductive types, as definedin homotopy type theory;

■ polish the semantics and fix all the passages in the soundness andcompleteness proofs.

In short, we did it!

In the following, I am going to give a glance to the semantics.

( 4 of 17 )

Page 5: Point-free semantics of dependent type theories

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− 7→ succ(n) :N− but not the basic step 0 :N−.

Usually, these two types are considered equivalent because they haveno terms belonging to them: the minimal fix point of theirconstructing rules is the same.However, they can be distinguished: if x : 0 and y :N− stand for someobjects in the types 0 and N−, it is evident that no object other thanx 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 thecontext in which it is defined, so to be able to distinguish 0 from N−.

( 5 of 17 )

Page 6: Point-free semantics of dependent type theories

Point-free semantics

The semantics is then point-free: types and their terms do notidentify entities (“points”) in some universe. They explain howjudgements are kept together by the logical inferences. And they doso by taking local values, which change under different assumptions.So N− is not equivalent to the 0 type: they are the same thing in theempty context, while they differ in a context in which we assume bothtypes contain at least one term.

( 6 of 17 )

Page 7: Point-free semantics of dependent type theories

The big picture

The semantics is based on category theory.An inductive theory, i.e., a series of inductive types defined in thestandard dependent type theory, has models in the class ofML-categories.These categories allow to interpret dependent type theory andinductive types in a natural way. A category which makes valid all thejudgements 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 theoryis derivable (Completeness);

■ for every inductive theory there is a model which is contained inevery other model (Classification).

( 7 of 17 )

Page 8: Point-free semantics of dependent type theories

The big picture

Mctx

Γ

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 ofelements has a least upper bound;

■ Mctx and all the MΓ form the ML-category (for Martin-Löf).( 8 of 17 )

Page 9: Point-free semantics of dependent type theories

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 )

Page 10: Point-free semantics of dependent type theories

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 )

Page 11: Point-free semantics of dependent type theories

Interpretation

�x : A,y : B,z : C ctx� =x : A

y : B

z : C

•ctxx : Actx

x : A,y : B ctx

x : A,y : B,z : C ctx

in Mctx

�Γ` a : A� = Γ a Aπ ∈ in MΓ

�Γ` a ≡ b : A� = Γ

a

bA

π ∈

π ∈i in MΓ

( 10 of 17 )

Page 12: Point-free semantics of dependent type theories

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 Mctxand their way to be written down as path of irreducible arrows in thesame category.The second role requires that there is an object in MΓ deputed tointerpret x .The third role imposes a deeper structure on the ‘pyramids’ over Mctx.

( 11 of 17 )

Page 13: Point-free semantics of dependent type theories

Variables

Γ

x :A

A

Ui

π

A

Ui

π

x

π

a

a∼=∼=

■ an irreducible arrow in Mctx induces a new term x in the pyramidover 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 fortype generation, forces the pyramids to be equivalent.

( 12 of 17 )

Page 14: Point-free semantics of dependent type theories

Variables

Γ

x :A

A

Ui

π

A

Ui

π

x

π

a

a

∼=∼=

■ an irreducible arrow in Mctx induces a new term x in the pyramidover 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 fortype generation, forces the pyramids to be equivalent.

( 12 of 17 )

Page 15: Point-free semantics of dependent type theories

Variables

Γ

x :A

A

Ui

π

A

Ui

π

x

π

a

a∼=∼=

■ an irreducible arrow in Mctx induces a new term x in the pyramidover 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 fortype generation, forces the pyramids to be equivalent.

( 12 of 17 )

Page 16: Point-free semantics of dependent type theories

Inductive types

An inductive type is the minimal collection of terms closed under theinterpretation of its introduction rules.Semantically, this means an inductive type is the colimit of thediagram composed by the terms-in-context which are the result of theclosure 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 )

Page 17: Point-free semantics of dependent type theories

Inductive types

In general, the guiding principle is that the formation rule is used toidentify the space S of terms which is transformed to construct theterms 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 categorytheory, to ensure that the construction is inductive.The idea is that θ must be associated with T , the inductive theory asa whole, not to each specific type. Then, MΓ is the minimal fix pointof the θ transformation in a category having enough terms tointerpret the context Γ in which every variable is a distinct term.

( 14 of 17 )

Page 18: Point-free semantics of dependent type theories

Inductive types

Difficult to express, but mathematically straightforward, this idea ofinductive theory allows to capture at once recursive types, mutualrecursive types, and even more esoteric beasts.The formal framework had also a pleasant consequence: namely, allthe canonical types are inductive. So, the dependent sum Σ, thedependent product Π, the coproduct +, the empty type 0, the unittype 1, and equality in a type =A can be treated in the very same wayas natural numbers.In fact, the non-inductive part of dependent type theory is reduced tothe structural rules (context formation, variables, judgementalequality) and the rules about universes, which are structural in asense, because they are used to distinguish types.

( 15 of 17 )

Page 19: Point-free semantics of dependent type theories

The state of the art

We are in the process of writing down all of this. In this moment, wehave the definition of ML-category, a few of its properties, and thedefinition of interpretation written down with all the details.Inductive types are completely developed: however, only the syntacticside has been polished. The semantics of them needs to be writtenand checked once again.We have the definition of syntactic category, the classification,soundness and completeness theorem to polish: they have beendeveloped in all the details, but not yet written down in the propermathematical style.We have a rough sketch of how everything should work onhigher-inductive types, but this is far from being a result, even with avery optimistic view. . . not yet, at least!

( 16 of 17 )

Page 20: Point-free semantics of dependent type theories

The end

Questions?

( 17 of 17 )