Natural Model Semantics of Comonadic Modal Type Theory Colin - - PowerPoint PPT Presentation

natural model semantics of comonadic modal type theory
SMART_READER_LITE
LIVE PREVIEW

Natural Model Semantics of Comonadic Modal Type Theory Colin - - PowerPoint PPT Presentation

Natural Model Semantics of Comonadic Modal Type Theory Colin Zwanziger Department of Philosophy Carnegie Mellon University August 15, 2019 at the International Conference on Homotopy Type Theory Carnegie Mellon University Zwanziger (CMU)


slide-1
SLIDE 1

Natural Model Semantics of Comonadic Modal Type Theory

Colin Zwanziger

Department of Philosophy Carnegie Mellon University

August 15, 2019 at the International Conference on Homotopy Type Theory Carnegie Mellon University

Zwanziger (CMU) Natural Models ˆ Comonads 1 / 31

slide-2
SLIDE 2

Introduction

Problem: Semantics of Comonadic Type Theory

Comonads are pervasive. So comonadic dependent type theory (NPP 2008, Shulman 2018) has many intended models, e.g.: ‚ (Higher) Grothendieck toposes ` ∆Γ (Shulman 2018, 2019) ‚ In particular, cubical sets ` the 0-skeleton (LOPS 2018) ‚ Groupoids ` discretization (cf. Zwanziger 2018) What about a general categorical semantics for comonadic DTT?

Zwanziger (CMU) Natural Models ˆ Comonads 2 / 31

slide-3
SLIDE 3

Introduction

A Solution: Morphisms of Natural Models

‚ Simple picture: the comonadic operator is interpreted as a morphism of models of DTT that is a comonad ‚ I will work with morphisms of natural models.

Zwanziger (CMU) Natural Models ˆ Comonads 3 / 31

slide-4
SLIDE 4

Introduction

A Solution: Morphisms of Natural Models

‚ Simple picture: the comonadic operator is interpreted as a morphism of models of DTT that is a comonad ‚ I will work with morphisms of natural models. ‚ Natural models are a nice categorical characterization of categories with families (CwFs) (Awodey 2012, 2018, Fiore 2012) ‚ The relevant morphisms of natural models and CwFs were developed by Newstead (2018) and BCMMPS (2018), respectively.

Zwanziger (CMU) Natural Models ˆ Comonads 3 / 31

slide-5
SLIDE 5

Introduction

Morphism Semantics to Date

‚ BCMMPS use morphisms of CwFs to interpret DTT with an endo-adjunction. ‚ In Zwanziger (2019): morphisms of natural models for DTT with an adjunction. ‚ Same approach for comonadic DTT presently. So morphisms of NMs/CwFs have a broader applicability than the comonadic case.

Zwanziger (CMU) Natural Models ˆ Comonads 4 / 31

slide-6
SLIDE 6

Introduction

Outline

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 5 / 31

slide-7
SLIDE 7

Natural Model Theory Objects

Outline

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 6 / 31

slide-8
SLIDE 8

Natural Model Theory Objects

Natural Models

Definition (Awodey, Fiore 2012) A natural model consists of a category C a distinguished terminal object 1 P C presheaves Ty, Tm : C op Ñ Set a representable natural transformation p : Tm Ñ Ty

Zwanziger (CMU) Natural Models ˆ Comonads 7 / 31

slide-9
SLIDE 9

Natural Model Theory Objects

Conventions

Convention An object Γ P C is a “context”. An element A P TypΓq is a “type in context Γ”. An element a P TmpΓq such that pΓpaq “ A is a “term a of type A in context Γ”.

Zwanziger (CMU) Natural Models ˆ Comonads 8 / 31

slide-10
SLIDE 10

Natural Model Theory Objects

Conventions

Convention An object Γ P C is a “context”. An element A P TypΓq is a “type in context Γ”. An element a P TmpΓq such that pΓpaq “ A is a “term a of type A in context Γ”. This last is represented by the following commutative diagram: Tm y Γ Ty

p a A

Below, as here, we will freely use the Yoneda lemma to identify presheaf elements x P PpCq with the corresponding map x : y C Ñ P.

Zwanziger (CMU) Natural Models ˆ Comonads 8 / 31

slide-11
SLIDE 11

Natural Model Theory Objects

Comprehension as Representability

Representability of p : Tm Ñ Ty means the following: Definition Given a context Γ P C and a type A P TypΓq in the context Γ, there is Γ.A P C, pA : Γ.A Ñ Γ, and vA : ypΓ.Aq Ñ Tm such that the following diagram is a pullback: ypΓ.Aq Tm y Γ Ty

vA y pA

{

p A

These Γ.A, pA, vA constitute the comprehension of A.

Zwanziger (CMU) Natural Models ˆ Comonads 9 / 31

slide-12
SLIDE 12

Natural Model Theory Objects

Terms vs. Sections

Remark Terms are interchangeable with a “comprehension” as sections, as depicted by the following: Tm y Γ Ty

p a A

ð ñ ypΓ.Aq Tm y Γ Ty

vA y pA

{

p a A

See Awodey (2018) for more on natural models.

Zwanziger (CMU) Natural Models ˆ Comonads 10 / 31

slide-13
SLIDE 13

Natural Model Theory Morphisms

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 11 / 31

slide-14
SLIDE 14

Natural Model Theory Morphisms

Lax Morphisms

Definition A lax morphism of natural models F : C Ñ D consists of: a functor, also denoted F : C Ñ D, between the underlying categories a natural transformation φTy : F! TyC Ñ TyD a natural transformation φTm : F! TmC Ñ TmD such that the following diagram commutes: F! TmC TmD F! TyC TyD

F!pC φTm pD φTy

The definitions of this section are essentially those of Newstead (2018).

Zwanziger (CMU) Natural Models ˆ Comonads 12 / 31

slide-15
SLIDE 15

Natural Model Theory Morphisms

Notation

Convention Given a lax morphism F : C Ñ D, and a type A P TypΓq in context Γ P C, we write F{A for the composite y FΓ – F! y Γ F! TyC TyD

F!A φTy

Similarly, given a term a P TmpΓq, we write F{a for the composite y FΓ – F! y Γ F! TmC TmD

F!a φTm

One may think of F{A and F{a as the results of applying the morphism F to A and a. These operations are implicated in the interpretation of (respectively) formation and introduction rules for modal type operators.

Zwanziger (CMU) Natural Models ˆ Comonads 13 / 31

slide-16
SLIDE 16

Natural Model Theory Morphisms

Lax Preservation of Context Extension

Remark Let F : C Ñ D be a lax morphism. Then, given a type A P TyCpΓq in context Γ P C, there is a unique comparison map τA : FpΓ.Aq Ñ FΓ.pF{Aq such that FpA “ pF{A ˝ τA and F{vA “ vF{A ˝ ypτAq, i.e., such that the following diagram commutes: ypFpΓ.Aqq ypFΓ.pF{Aqq TmD ypFΓq TyD

ypτAq ypFpAq F{vA yppF{Aq

{

vF{A pD F{A

Zwanziger (CMU) Natural Models ˆ Comonads 14 / 31

slide-17
SLIDE 17

Natural Model Theory Morphisms

Morphisms

Definition Let F : C Ñ D be a lax morphism. Then F is said to preserve context extension if, for each type A P TyCpΓq in each context Γ P C, the comparison map τA : FpΓ.Aq Ñ FpΓq.pF{Aq is an isomorphism. Definition A lax morphism F : C Ñ D of natural models that preserves context extension and terminal objects is called a morphism of natural models.

Zwanziger (CMU) Natural Models ˆ Comonads 15 / 31

slide-18
SLIDE 18

Comonadic Type Theory

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 16 / 31

slide-19
SLIDE 19

Comonadic Type Theory

CoTT

Contexts and Judgments

We will use the comonadic fragment of Shulman (2018)’s real-cohesive type theory. We have two variable judgments, denoted u :: A and x : A , and the typing judgement has form u1 :: A1, ..., um :: Am | x1 : B1, ..., xn : Bn $ t : C .

Zwanziger (CMU) Natural Models ˆ Comonads 17 / 31

slide-20
SLIDE 20

Comonadic Type Theory

CoTT

Contexts and Judgments (cont’d)

The two variable judgements lead to a duplication of the context and variable rules: Emp. ¨ | ¨ $ ∆ | ¨ $ B type Ext.5 ∆, u :: B | ¨ $ ∆, u :: A, ∆1 | Γ $ Var.5 ∆, u :: A, ∆1 | Γ $ u : A

Zwanziger (CMU) Natural Models ˆ Comonads 18 / 31

slide-21
SLIDE 21

Comonadic Type Theory

CoTT

Contexts and Judgments (cont’d)

The two variable judgements lead to a duplication of the context and variable rules: Emp. ¨ | ¨ $ ∆ | ¨ $ B type Ext.5 ∆, u :: B | ¨ $ ∆, u :: A, ∆1 | Γ $ Var.5 ∆, u :: A, ∆1 | Γ $ u : A ∆ | Γ $ B type Ext. ∆ | Γ, x : B $ ∆ | Γ, x : A, Γ1 $ Var. ∆ | Γ, x : A, Γ1 $ x : A

Zwanziger (CMU) Natural Models ˆ Comonads 18 / 31

slide-22
SLIDE 22

Comonadic Type Theory

CoTT

The Comonad 5

∆ | ¨ $ B type 5-Form. ∆ | Γ $ 5B type ∆ | ¨ $ t : B 5-Intro. ∆ | Γ $ t5 : 5B

Zwanziger (CMU) Natural Models ˆ Comonads 19 / 31

slide-23
SLIDE 23

Comonadic Type Theory

CoTT

The Comonad 5

∆ | ¨ $ B type 5-Form. ∆ | Γ $ 5B type ∆ | ¨ $ t : B 5-Intro. ∆ | Γ $ t5 : 5B ∆ | Γ $ s : 5A ∆ | Γ, x : 5A $ B type ∆, u :: A | Γ $ t : Bru5{xs 5-Elim. ∆ | Γ $ plet u5 :“ s in tq : Brs{xs

Zwanziger (CMU) Natural Models ˆ Comonads 19 / 31

slide-24
SLIDE 24

Comonadic Type Theory

CoTT

The Comonad 5 (Conversions)

∆ | ¨ $ s : A ∆ | Γ, x : 5A $ B type ∆, u :: A | Γ $ t : Bru5{xs 5-β-Conv. ∆ | Γ $ plet u5 :“ s5 in tq ” trs{us : Brs5{xs ∆ | Γ $ s : 5A ∆ | Γ, x : 5A $ B type ∆ | Γ, x : 5A $ t : B 5-η-Conv. ∆ | Γ $ let u5 :“ s in tru5{xs ” trs{xs : Brs{xs

Zwanziger (CMU) Natural Models ˆ Comonads 20 / 31

slide-25
SLIDE 25

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 21 / 31

slide-26
SLIDE 26

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models

Cartesian Comonads

Our notion of model for CoTT takes an appealingly simple form:

Zwanziger (CMU) Natural Models ˆ Comonads 22 / 31

slide-27
SLIDE 27

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models

Cartesian Comonads

Our notion of model for CoTT takes an appealingly simple form: Definition Let 5 : E Ñ E be an endomorphism of natural models on E. This 5 is said to be a Cartesian comonad on E when its underlying functor is a comonad. The requirement that 5 be a morphism of natural models is a preservation condition analogous to finite limit preservation in the topos semantics of modal logic (cf. Zwanziger 2017).

Zwanziger (CMU) Natural Models ˆ Comonads 22 / 31

slide-28
SLIDE 28

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models

Notation

Some further notation: We write E5 for the category of coalgebras for 5, U or p´q0 : E5 Ñ E for the forgetful functor, and K : E Ñ E5 for the cofree functor. As the name suggests, we have U % K.

Zwanziger (CMU) Natural Models ˆ Comonads 23 / 31

slide-29
SLIDE 29

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models

Notation

Some further notation: We write E5 for the category of coalgebras for 5, U or p´q0 : E5 Ñ E for the forgetful functor, and K : E Ñ E5 for the cofree functor. As the name suggests, we have U % K. Definition Let ∆ “ p∆0, ∆1 : ∆0 Ñ 5∆0q P E5. Then 5A :” p5{Aq ˝ yp∆1q : yp∆0q Ñ Ty, where A : yp∆0q Ñ Ty, and 5a :” p5{aq ˝ yp∆1q : yp∆0q Ñ Tm, where a : yp∆0q Ñ Tm. It is this new 5p´q, not 5{p´q, which will interpret the formation and introduction rules for the type operator 5 of CoTT.

Zwanziger (CMU) Natural Models ˆ Comonads 23 / 31

slide-30
SLIDE 30

Semantics of Comonadic Type Theory Interpretation

1

Introduction

2

Natural Model Theory Objects Morphisms

3

Comonadic Type Theory

4

Semantics of Comonadic Type Theory Cartesian Comonads on Natural Models Interpretation

Zwanziger (CMU) Natural Models ˆ Comonads 24 / 31

slide-31
SLIDE 31

Semantics of Comonadic Type Theory Interpretation

Interpretation

A context ∆ | Γ will be interpreted not as an object of E, but as an arrow ∆ | Γ with codomain a coalgebra. However, the interpretation of a type ∆ | Γ $ A is simply in Typdom∆ | Γq.

Zwanziger (CMU) Natural Models ˆ Comonads 25 / 31

slide-32
SLIDE 32

Semantics of Comonadic Type Theory Interpretation

Interpretation

A context ∆ | Γ will be interpreted not as an object of E, but as an arrow ∆ | Γ with codomain a coalgebra. However, the interpretation of a type ∆ | Γ $ A is simply in Typdom∆ | Γq. The partial interpretation function ´ is given by recursion on raw syntax as follows: (Ext.). ∆ | Γ, x : B “ ∆ | Γ ˝ pB P E{ cod∆ | Γ (Var.). ∆ | Γ, x : A $ x : A “ vA P TmEpdom∆ | Γ.Aq

Zwanziger (CMU) Natural Models ˆ Comonads 25 / 31

slide-33
SLIDE 33

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

In the special case of ∆ | ¨, ∆ | ¨, abbreviated ∆, will be an identity. (Emp.). ¨ “ id51 P E{UK1

Zwanziger (CMU) Natural Models ˆ Comonads 26 / 31

slide-34
SLIDE 34

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

In the special case of ∆ | ¨, ∆ | ¨, abbreviated ∆, will be an identity. (Emp.). ¨ “ id51 P E{UK1 (Ext.5). ∆, u :: B “ iddom∆.5B P E{ dom∆.5B

Zwanziger (CMU) Natural Models ˆ Comonads 26 / 31

slide-35
SLIDE 35

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

In the special case of ∆ | ¨, ∆ | ¨, abbreviated ∆, will be an identity. (Emp.). ¨ “ id51 P E{UK1 (Ext.5). ∆, u :: B “ iddom∆.5B P E{ dom∆.5B (Using that 5 is a morphism of NMs, dom∆.5B admits a canonical coalgebra structure.)

Zwanziger (CMU) Natural Models ˆ Comonads 26 / 31

slide-36
SLIDE 36

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

In the special case of ∆ | ¨, ∆ | ¨, abbreviated ∆, will be an identity. (Emp.). ¨ “ id51 P E{UK1 (Ext.5). ∆, u :: B “ iddom∆.5B P E{ dom∆.5B (Using that 5 is a morphism of NMs, dom∆.5B admits a canonical coalgebra structure.) (Var.5). ∆, u :: A , u : A “ vA ˝ ypεdom∆

A

q P Tmpdom∆, u :: Aq (See next slide.)

Zwanziger (CMU) Natural Models ˆ Comonads 26 / 31

slide-37
SLIDE 37

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

Here, εdom∆

A

: dom∆.5A Ñ dom∆.A is the “indexed counit” induced over the coalgebra pdom∆, κ : dom∆ Ñ 5 dom∆q: dom∆.5A 5pdom∆.Aq dom∆.A dom∆ 5 dom∆ dom∆

π εdom∆

A

p5A

{

5ppAq εdom∆.A pA idL∆ κ εdom∆

The left-hand square exists and is a pullback because 5 is a morphism (not just a lax morphism).

Zwanziger (CMU) Natural Models ˆ Comonads 27 / 31

slide-38
SLIDE 38

Semantics of Comonadic Type Theory Interpretation

Interpretation (continued)

(5-Form.). ∆ | ¨ $ 5B “ 5B P Typdom∆q (5-Intro.). ∆ | ¨ $ t5 : 5B “ 5t P Tmpdom∆q (5-Elim.). ∆ | ¨ $ plet u5 :“ r in tq : Brr{xs “ t ˝ yprq P Tmpdom∆q

Zwanziger (CMU) Natural Models ˆ Comonads 28 / 31

slide-39
SLIDE 39

Semantics of Comonadic Type Theory Interpretation

Result

Theorem The interpretation ´ is sound. That is, it is defined on all derivable contexts, types, and terms, and, furthermore, all contexts, types, and terms identified by equations receive the same interpretation.

Zwanziger (CMU) Natural Models ˆ Comonads 29 / 31

slide-40
SLIDE 40

Semantics of Comonadic Type Theory Interpretation

Conclusion

‚ We used morphisms of natural models to interpret comonadic DTT. ‚ This work captures the groupoid model and cubical sets, with the comonads indicated, and other 1-topos models. ‚ Approach generalizes to some other type theories (BCMMPS 2018, Zwanziger 2019), but how far can one push this (cf. LSR 2017)?

Zwanziger (CMU) Natural Models ˆ Comonads 30 / 31

slide-41
SLIDE 41

Semantics of Comonadic Type Theory Interpretation

Thanks for your attention!

Zwanziger (CMU) Natural Models ˆ Comonads 31 / 31