A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal...

145
A Fibrational Framework for Substructural and Modal Dependent Type Theories Dan Licata Wesleyan University 1 joint work with Mitchell Riley and Mike Shulman

Transcript of A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal...

Page 1: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

A Fibrational Framework for Substructural and

Modal Dependent Type Theories

Dan LicataWesleyan University

1

joint work with Mitchell Riley and Mike Shulman

Page 2: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

2

Modalities

Page 3: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

3

Axiomatic cohesion

Sets

Spaces

Γ∆ ∇⊣ ⊣⊣Π0

[Lawvere]

Page 4: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

4

∞-categorical Cohesion

∞-groupoids

Topological ∞-groupoids

Γ∆ ∇⊣ ⊣⊣Π

[Schreiber,Shulman]

Page 5: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

4

∞-categorical Cohesion

∞-groupoids

Topological ∞-groupoids

Γ∆ ∇⊣ ⊣⊣Π

fundamental ∞-groupoid! e.g. ∆Π(topological 𝕊1) = HIT S1 in real-cohesive HoTT

[Schreiber,Shulman]

Page 6: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

4

∞-categorical Cohesion

∞-groupoids

Topological ∞-groupoids

Γ∆ ∇⊣ ⊣⊣Π

fundamental ∞-groupoid! e.g. ∆Π(topological 𝕊1) = HIT S1 in real-cohesive HoTT

[Schreiber,Shulman]

∆ and ∇ full and faithful…

Page 7: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

Page 8: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

comonad

Page 9: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

comonad

monad

Page 10: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

comonad

monad

idempotent

Page 11: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

comonad

monad

idempotent

monad

Page 12: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

5

∞-categorical cohesion

Topological ∞-groupoids

Topological ∞-groupoids

♭∫ #⊣ ⊣

∫ = ∆Π ♭ = ∆Γ # = ∇Γ

comonad

monad

idempotent

Modality: historically endofunctor on types/propositions ☐A A !A ?A

monad

Page 13: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Differential cohesion[Scheiber; Wellen; Gross,L.,New,Paykin,Riley,Shulman,Wellen]

6

Page 14: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Differential cohesion[Scheiber; Wellen; Gross,L.,New,Paykin,Riley,Shulman,Wellen]

6

Next level: super homotopy theory [Schreiber]

Page 15: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

7

Parametrized spectra[Finster,L.,Morehouse,Riley]

x

≃Ω… …

A

B(x) B0 B1

Page 16: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

7

Parametrized spectra[Finster,L.,Morehouse,Riley]

x

≃Ω… …

A

B(x) B0 B1

Page 17: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

7

Parametrized spectra[Finster,L.,Morehouse,Riley]

♭ ♭⊣

x

≃Ω… …

A

B(x) B0 B1

Page 18: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

7

Parametrized spectra[Finster,L.,Morehouse,Riley]

♭ ♭⊣

self-adjoint, idempotentmonad and comonad

x

≃Ω… …

A

B(x) B0 B1

Page 19: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

8

Parametrized spectra[Finster,L.,Morehouse,Riley]

x

≃Ω… …

A

B(x) B0 B1

x

≃Ω… …

♭A

1 1

Page 20: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

9

Other places with cohesionuniverses in cubical models (presheaves/sets) [L.,Orton,Pitts,Spitters]

parametricity (bridge-path cubical sets, bicubical sets) [Nuyts,Vezzosi,Devriese; Cavallo,Harper]

bisimplicial/bicubical directed type theories[Riehl,Shulman; Riehl,Sattler; L.-Weaver; Nuyts]

information flow security (classified sets) [Kavvos]

Page 21: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

10

Other modalitieswhole area of proof theory and programming langs, mostly simply typed

linear logic ! comonad [Girard] in dependently indexed linear logic [Vákár; Benton, Pradic, Krishnaswami]

Squash types [Constable+], bracket types [Awodey, Bauer], contextual modal type theory [Nanevski, Pientka, Pfenning]

Dependent right adjoints (generalizing #) [Birkedal, Clouston, Mannaa, Møgelberg, Pitts,Spitters]

“Later” in guarded recursion [Nakano,Birkedal+]

Page 22: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

11

Page 23: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

12

Type theorieswith modalities

Page 24: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Monadic modality in Book HoTT[Rijke,Shulman,Spitters]

13

Page 25: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Monadic modality in Book HoTT

(idempotent, monadic)

[Rijke,Shulman,Spitters]

13

Page 26: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Monadic modality in Book HoTT

(idempotent, monadic)

[Rijke,Shulman,Spitters]

13

works because terms Γ ⊢ a : A have many variables but one conclusion A — easy to control

Page 27: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Comonadic modalities

14

Internal definitions don’t work: need new rules to control use of context

[Pfenning-Davies; dependent/idempotent version by Shulman]

Page 28: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Monadic modalities via new rules

15

Define ♭ ⊣ #, ♭# A ≃ ♭ Athen can prove it satisfies modality axioms

[Shulman]

Page 29: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Monadic modalities not via rules

16

In real-cohesive HoTT, shape ∫ A is nullification:monadic modality for ℝ-null types A ≃ (ℝ → A)

defined modalities: ∫, truncation, …judgemental modalities: ♭, #

[Shulman]

Page 30: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

17

Multiple kinds of assumptions/multi-zoned contexts: Andreoli’92; Wadler’93; Plotkin’93;Barber’96; Benton’94; Pfenning,Davies’01

Tree-structured contexts:Display logic: BelnapBunched contexts: O’Hearn,Pym’99,Resource separation: Atkey,’04

Multiple modes: Benton’94; Benton,Wadler’96, Reed’09

Fibrational perspective: Melliès,Zeilberger’15

Substructural/Modal Logics

Page 31: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

18

1.Add a new form of judgement for left adjoints

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal property relative to that judgement

4.Structural rules are equations, natural isomorphisms, or natural transformations between contexts

5.Optimize placement of structural rules

Substructural/Modal T.T.

Page 32: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

19

1.Add a new form of judgement for left adjoints

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal property relative to that judgement

4.Structural rules are equations, natural isomorphisms, or natural transformations between contexts

5.Optimize placement of structural rules

Monoidal Product

Page 33: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

20

new judgement: the context Γ,Γ’

left adjoint:

right adjoint:

Monoidal Product

Page 34: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Γ[A⊗B] ⊢ CΓ[A,B] ⊢ C

20

new judgement: the context Γ,Γ’

left adjoint:

right adjoint:

Monoidal Product

Page 35: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Γ[A⊗B] ⊢ CΓ[A,B] ⊢ C

20

new judgement: the context Γ,Γ’

left adjoint:

Γ ⊢ A ⊸ BΓ,A ⊢ B

right adjoint:

Monoidal Product

Page 36: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A⊗(B⊗C) ⊢ (A⊗B)⊗C

If , is associative then ⊗ is

Page 37: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A,(B⊗C) ⊢ (A⊗B)⊗CA⊗(B⊗C) ⊢ (A⊗B)⊗C

If , is associative then ⊗ is

Page 38: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A,(B⊗C) ⊢ (A⊗B)⊗CA⊗(B⊗C) ⊢ (A⊗B)⊗C

A,(B,C) ⊢ (A⊗B)⊗C

If , is associative then ⊗ is

Page 39: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A,(B⊗C) ⊢ (A⊗B)⊗CA⊗(B⊗C) ⊢ (A⊗B)⊗C

A,(B,C) ⊢ (A⊗B)⊗C

If , is associative then ⊗ is

(A,B),C ⊢ (A⊗B)⊗C

Page 40: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A,(B⊗C) ⊢ (A⊗B)⊗CA⊗(B⊗C) ⊢ (A⊗B)⊗C

A,(B,C) ⊢ (A⊗B)⊗C

A,B ⊢ A ⊗ B C ⊢ C

If , is associative then ⊗ is

(A,B),C ⊢ (A⊗B)⊗C

Page 41: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Structural rules

A,(B⊗C) ⊢ (A⊗B)⊗CA⊗(B⊗C) ⊢ (A⊗B)⊗C

A,(B,C) ⊢ (A⊗B)⊗C

A,B ⊢ A ⊗ B C ⊢ C

If , is associative then ⊗ is

(A,B),C ⊢ (A⊗B)⊗Cequality or isomorphism

Page 42: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

OptimizationPick a canonical associativity, and build re-associating into the other rules

Γ,A⊗B ⊢ CΓ,(A,B) ⊢ C

Γ,A⊗B ⊢ C

(Γ,A),B ⊢ Cbasic optimized

Γ,(A,B) ⊢ C

Page 43: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

23

1.Add a new form of judgement for left adjoints

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal property relative to that judgement

4.Structural rules are equations, natural isos, or natural transformations between contexts

5.Optimize placement of structural rules

Cartesian Product (Positive)

Page 44: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Cartesian Product

Γ,Δ ⊢ (a,b) : A × B

24

Γ ⊢ a : A Δ ⊢ b : B

Γ ⊢ w : ∅ Γ ⊢ c : Γ,Γ

x : A ⊢ x : A

Page 45: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

“Optimized” Rules

Γ ⊢ (a,b) : A × B

25

Γ ⊢ a : A Γ ⊢ b : B

Γ,x : A ⊢ x : A

Page 46: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

“Optimized” Rules

Γ ⊢ (a,b) : A × B

25

Γ ⊢ a : A Γ ⊢ b : B

Γ,x : A ⊢ x : Acan weaken at the leaves

Page 47: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

“Optimized” Rules

Γ ⊢ (a,b) : A × B

25

Γ ⊢ a : A Γ ⊢ b : B

Γ,x : A ⊢ x : Acan weaken at the leaves

so might as well always contract

Page 48: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

26

1.Add a new form of judgement for left adjoints

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal property relative to that judgement

4.Structural rules are equations, natural isos, or natural transformations between contexts

5.Optimize placement of structural rules

♭in spatial type theory

Page 49: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Simply-typed♭

27

new judgement: the context f(Γ)

left adjoint:

right adjoint:

Page 50: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Simply-typed♭

♭Γ ⊢ Af Γ ⊢ A

27

new judgement: the context f(Γ)

left adjoint:

right adjoint:

Page 51: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Simply-typed♭

♭Γ ⊢ Af Γ ⊢ A

27

new judgement: the context f(Γ)

left adjoint:

Γ ⊢ #A f Γ ⊢ A

right adjoint:

Page 52: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

f Γ ⊢ Γ

28

structural rules for idempotent comonad:

counit:

f Γ ≃ f f Γ comult:

Simply-typed♭

Page 53: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

Page 54: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization pick canonical “associativity” of contexts: placement of f

Page 55: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

f(Δ,A,Δ’),Γ ⊢ f(A) ⊢ A

pick canonical “associativity” of contexts: placement of f

Page 56: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

f(Δ,A,Δ’),Γ ⊢ f(A) ⊢ Af(projection)

pick canonical “associativity” of contexts: placement of f

Page 57: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

f(Δ,A,Δ’),Γ ⊢ f(A) ⊢ Af(projection) counit

pick canonical “associativity” of contexts: placement of f

Page 58: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

f(Δ,A,Δ’),Γ ⊢ f(A) ⊢ Af(projection) counit

might as well use comult, because you can counit Δ later if you need to

pick canonical “associativity” of contexts: placement of f

Page 59: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

29

Optimization

f(Δ,A,Δ’),Γ ⊢ f(A) ⊢ Af(projection) counit

might as well use comult, because you can counit Δ later if you need to

[same placement as comonoid for ×]

pick canonical “associativity” of contexts: placement of f

Page 60: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

30

1.Add a new form of judgement for left adjoints

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal property relative to that judgement

4.Structural rules are equations, natural isos, or natural transformations between contexts

5.Optimize placement of structural rules

Pattern

Page 61: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

31

Only part of the story…Structural rules for interaction of modalities(e.g. f(Δ,Δ’) vs. f(Δ),f(Δ’))

Rules for dependency

Interaction with identity types, inductive types, HITs

Universes

Stability under substitution

Fibrancy

Page 62: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

32

Pattern to Framework

Page 63: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Fibrational Framework

33

A Judgemental Deconstruction of Modal Logic [Reed’09]

Adjoint Logic with a 2-Category of Modes [L.Shulman’16]

A Fibrational Framework for Substructuraland Modal Logics [L.,Shulman,Riley,’17]

A Fibrational Framework for Substructural and Modal Dependent Type Theories [L.,Riley,Shulman, in progress]

Page 64: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

34

Logical Framework[Martin-Löf; Harper,Honsell,Plotkin]

a type theory where other type theoriesare specified by signatures

Page 65: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

34

implement one proof assistant for a number of type theories

Logical Framework[Martin-Löf; Harper,Honsell,Plotkin]

a type theory where other type theoriesare specified by signatures

Page 66: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

34

implement one proof assistant for a number of type theories

semantics: prove initiality for a class of type theories at once

Logical Framework[Martin-Löf; Harper,Honsell,Plotkin]

a type theory where other type theoriesare specified by signatures

Page 67: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Framework

Page 68: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

Page 69: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

Page 70: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

Page 71: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

can derive “optimized” rules (requires cleverness)

Page 72: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

can derive “optimized” rules (requires cleverness)

categorical semantics for whole framework at once

Page 73: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

can derive “optimized” rules (requires cleverness)

categorical semantics for whole framework at once

expected structures are models of signatures

Page 74: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

35

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

can derive “optimized” rules (requires cleverness)

categorical semantics for whole framework at once

expected structures are models of signatures

proof assistant with enough automationto make it convenient

Page 75: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Fibrational Framework

36

π

𝓜

𝒟

base type theory

top type theory

algebraic syntax for judgements

types and terms of a modal type theory

Page 76: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Fibrational Framework

37

π

𝓜

𝒟 ⊢γ Γ ctx Γ ⊢p A type Γ ⊢f a : A

γ ctx γ ⊢ p mode γ ⊢ f : p

𝒟 and 𝓜 both dependent type theories

Page 77: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

38

x:p, y:q, z:r ⊢ f : s

x:A,y:B,z:C ⊢f d : Dtop

base

Fibrational Framework

Page 78: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

38

x:p, y:q, z:r ⊢ f : s

x:A,y:B,z:C ⊢f d : Dtop

base

Fibrational Frameworkframework contexts are both standard:not modal or substructural

Page 79: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

38

x:p, y:q, z:r ⊢ f : s

x:A,y:B,z:C ⊢f d : Dtop

base

Fibrational Frameworkframework contexts are both standard:not modal or substructural

base term f representsthe modal structure of the context

Page 80: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

A semantic intuition(non-dependent)

39

π

𝓜

𝒟 ⊢γ Γ ctx

Γ ⊢f a : Δ

γ ctx

γ ⊢ f : δ

categories

functors

γ ⊢ s : f ⇒δ g natural trans.

objects of γmaps f(Γ) →δ Δ

Page 81: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

40

1.Judgement for left adjoint: modes and mode terms

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal propertyrelative to that judgement

4.Structural rules: 2-cells between mode terms

5.Optimize placement of structural rules

Pattern

Page 82: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

41

SpatialTT♭ #⊣ ♭ idem comonad

# idem monad

41

p

p

Page 83: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

41

SpatialTT

p modex:p ⊢ f(x) : pcounit : x:p ⊢ f(x) ⟹ xcomult : x:p ⊢ f(x) ⇒ f f(x)

Mode theory

♭ #⊣ ♭ idem comonad# idem monad

41

categoryfunctor

nat. trans

… + equations

p

p

Page 84: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

A semantic intuition(dependent)

42

π

𝓜

𝒟Γ ⊢f a : A

γ ⊢ p mode functors γop → Cat

γ ⊢ s : f ⇒p g natural trans. over id

objects of p(Γ)maps f(Γ) →p(Γ) A

γ ⊢ f : p sections of ∫p → γ

Γ ⊢p A type

Page 85: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

43

Dependent Contextsmode p “contexts”mode a:p ⊢T(a) “types” in context a2-cells a ⇒p b “substitutions”

Page 86: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

43

Dependent Contexts

mode term a:p, x:T(a) ⊢ a.x : p

mode p “contexts”mode a:p ⊢T(a) “types” in context a2-cells a ⇒p b “substitutions”

Page 87: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

43

Dependent Contexts

mode term a:p, x:T(a) ⊢ a.x : p

mode p “contexts”mode a:p ⊢T(a) “types” in context a2-cells a ⇒p b “substitutions”

mode 2-cell a:p, x:T(a) ⊢ π : a.x ⇒p a

Page 88: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

43

Dependent Contexts

mode term a:p, x:T(a) ⊢ a.x : p

mode p “contexts”mode a:p ⊢T(a) “types” in context a2-cells a ⇒p b “substitutions”

mode 2-cell a:p, x:T(a) ⊢ π : a.x ⇒p a…

Page 89: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

44

[Lawvere,Ehrhard]

Dependent Contexts

A comprehension object on (p,T) has mode term a:p ⊢ 1a : T(a) such that a:p ⊢ (a,1a) : (a : p, T(a)) has a right adjoint

mode p “contexts”mode a:p ⊢T(a) “types” in context a2-cell a ⇒p b “substitutions”

Page 90: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

44

[Lawvere,Ehrhard]unit/counit mode term 2-cells

Dependent Contexts

A comprehension object on (p,T) has mode term a:p ⊢ 1a : T(a) such that a:p ⊢ (a,1a) : (a : p, T(a)) has a right adjoint

mode p “contexts”mode a:p ⊢T(a) “types” in context a2-cell a ⇒p b “substitutions”

Page 91: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

45

[Lawvere,Ehrhard]

a ⇒p b.x ≅ s : a ⇒p b and t : 1a ⇒T(a) s+ x

Dependent Contexts

unit/counit mode term 2-cells

A comprehension object on (p,T) has mode term a:p ⊢ 1a : T(a) such that a:p ⊢ (a,1a) : (a : p, T(a)) has a right adjoint

Page 92: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

45

[Lawvere,Ehrhard]

a ⇒p b.x ≅ s : a ⇒p b and t : 1a ⇒T(a) s+ x

framework level transport that represents “substitution” (mode types are functors γop → Cat )

Dependent Contexts

unit/counit mode term 2-cells

A comprehension object on (p,T) has mode term a:p ⊢ 1a : T(a) such that a:p ⊢ (a,1a) : (a : p, T(a)) has a right adjoint

Page 93: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

46

Dependent Contexts

p

T:=(a:p, T(a)) p→

comprehension induces comprehension category [Jacobs]

full comprehension category with1 terminal has comprehension

fst cod

Page 94: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

47

Dependent Contexts

p

T:=(a:p, T(a)) p→

if full and 1 terminal, then maps in the fiber 1a ⇒T(a) x ≅ a ⇒p a.x sections of π : a.x ⇒ a

fst cod

Page 95: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

Page 96: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

Page 97: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:T(∅),y:T(∅.x),z:T(∅.x.y) ⊢1∅.x.y.z : T(∅.x.y.z)

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

Page 98: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:T(∅),y:T(∅.x),z:T(∅.x.y) ⊢1∅.x.y.z : T(∅.x.y.z)

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

A depends on nothing (∅ terminal in p)

Page 99: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:T(∅),y:T(∅.x),z:T(∅.x.y) ⊢1∅.x.y.z : T(∅.x.y.z)

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

A depends on nothing (∅ terminal in p)B depends on x

Page 100: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:T(∅),y:T(∅.x),z:T(∅.x.y) ⊢1∅.x.y.z : T(∅.x.y.z)

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

A depends on nothing (∅ terminal in p)B depends on xC depends on x and y

Page 101: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

48

x:A, y:B, z:C ⊢1 d : D

x:T(∅),y:T(∅.x),z:T(∅.x.y) ⊢1∅.x.y.z : T(∅.x.y.z)

x:A,y:B,z:C ⊢ d : D

𝒟𝓜

EncodingsMLTT

A depends on nothing (∅ terminal in p)B depends on xC depends on x and y so does c (over 1 b/c Γ ⊢ a : A where Γ ⊢ A type)

Page 102: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

Page 103: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

Page 104: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:T(f(∅)),y:T(f(f(∅).x)) ⊢1 : T(f(f(∅).x) . y)

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

Page 105: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:T(f(∅)),y:T(f(f(∅).x)) ⊢1 : T(f(f(∅).x) . y)

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

A depends on nothing (“crisply”/flatly)

Page 106: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:T(f(∅)),y:T(f(f(∅).x)) ⊢1 : T(f(f(∅).x) . y)

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

A depends on nothing (“crisply”/flatly)B depends on x crisply

Page 107: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:T(f(∅)),y:T(f(f(∅).x)) ⊢1 : T(f(f(∅).x) . y)

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

A depends on nothing (“crisply”/flatly)B depends on x crisplyC depends on x crisply and y normally/cohesively

Page 108: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

49

x:A, y:B ⊢1 c : C

x:T(f(∅)),y:T(f(f(∅).x)) ⊢1 : T(f(f(∅).x) . y)

x:A | y:B ⊢ c : C

𝒟𝓜

EncodingsSpatialTT

A depends on nothing (“crisply”/flatly)B depends on x crisplyC depends on x crisply and y normally/cohesivelyso does c

Page 109: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

50

1.Judgement for left adjoint: modes and mode terms

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal propertyrelative to that judgement

4.Structural rules: 2-cells between mode terms

5.Optimize placement of structural rules

Pattern

Page 110: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

51

1.Judgement for left adjoint: modes and mode terms

2.Left adjoint types have a left universal property relative to that judgement

3.Right adjoint types have a right universal propertyrelative to that judgement

4.Structural rules: 2-cells between mode terms

5.Optimize placement of structural rules

Pattern

Page 111: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Cat semantics(non-dependent)

52

π

𝓜

𝒟 ⊢γ Γ ctx

Γ ⊢f a : Δ

γ ctx

γ ⊢ f : δ

categories

functors

γ ⊢ s : f ⇒δ g natural trans.

objects of γmaps f(Γ) →δ Δ

Page 112: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Fibrational Generalization

53

π

𝓜

𝒟

2-category

local discrete fib.

types and terms

Page 113: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Fibrational Generalization

53

π

𝓜

𝒟

2-category

local discrete fib.

types and terms F and U types:(op)cartesian lifts

Page 114: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

54

F types: opcartesian

qp

π

𝓜

𝒟

f

A

Ff Aintro

Page 115: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

54

F types: opcartesian

qp

π

𝓜

𝒟

f

A

Ff Aintro

Cd

Page 116: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

54

F types: opcartesian

qp

π

𝓜

𝒟

f

A

Ff Aintro

Cd

elim

Page 117: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

54

F types: opcartesian

qp

π

𝓜

𝒟

f

A

Ff Aintro

Cd

elim

[simplified]

Page 118: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

55

F types: opcartesian

Page 119: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

56

U types: cartesian w/contra.

rq

π

𝓜

𝒟

f

B

Uf (A|B)

d

p

A C

[Atkey,Hermida,Buckley]

,

Page 120: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

56

U types: cartesian w/contra.

rq

π

𝓜

𝒟

f

B

Uf (A|B)

d

p

A C

[Atkey,Hermida,Buckley]

,

[simplified]

Page 121: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

57

U types: cartesian

Page 122: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

58

Σ types

Page 123: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

58

A comprehension object supports Σ types if a:p, x:T(a), y:T(a.x) ⊢ Σ1(a,x,y) : T(a) contract : 1a ⇒ Σ1(a,1a,1a.1) induced a.x.y ⇒ a.Σ1(a,x,y) is an ≅ characterize

comprehension

type constructor

Σ types

Page 124: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

58

A comprehension object supports Σ types if a:p, x:T(a), y:T(a.x) ⊢ Σ1(a,x,y) : T(a) contract : 1a ⇒ Σ1(a,1a,1a.1) induced a.x.y ⇒ a.Σ1(a,x,y) is an ≅ characterize

comprehension

type constructor

Σ types

Represent Σx:A.B := FΣ1(x,y) (x:A, y:B)

Page 125: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

59

Π types

Page 126: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

59

A comprehension object supports Π types ifunit types are stable under weakening: 1a.x ⇒ π+(1a) is an isomorphism

Π types

Page 127: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

59

A comprehension object supports Π types ifunit types are stable under weakening: 1a.x ⇒ π+(1a) is an isomorphism

Π types

Represent Πx:A.B := Uy.π(y) (x:A | B)

Page 128: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

60

Morphism of comp. objects

Page 129: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

60

Morphism of comp. objects

A morphism of comprehension objects (p,T) to (q,S) has mode term a:p ⊢ f(a) : q mode term a:p,x:T(a) ⊢ f1(a,x) : S(f(a)) 2-cell a:p ⊢ 1f(a) ⇒ f1(a,1a)

Page 130: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

61

L and R types

Page 131: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

61

A morphism of comprehension objects supports left adjoint types if induced map f(a.x) ⇒ f(a).f1(x) is an isomorphism

L and R types

Page 132: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

61

A morphism of comprehension objects supports left adjoint types if induced map f(a.x) ⇒ f(a).f1(x) is an isomorphism

L and R types

A morphism of comprehension objects supports right adjoint types if1f(a) ⇒ f1(a,1a) is an isomorphism

Page 133: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

61

A morphism of comprehension objects supports left adjoint types if induced map f(a.x) ⇒ f(a).f1(x) is an isomorphism

L and R types

A morphism of comprehension objects supports right adjoint types if1f(a) ⇒ f1(a,1a) is an isomorphism

Represent R A := Uy.f1(y) (A)

Page 134: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

61

A morphism of comprehension objects supports left adjoint types if induced map f(a.x) ⇒ f(a).f1(x) is an isomorphism

L and R types

A morphism of comprehension objects supports right adjoint types if1f(a) ⇒ f1(a,1a) is an isomorphism

Represent R A := Uy.f1(y) (A)

Define L A := Fy.f1(y) (A)

Page 135: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

62

Spatial type theory

Page 136: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

62

Spatial type theoryA endomorphism of comprehension objects supports spatial type theory if it supports L and R types and x:p ⊢ f(x) : p is an idempotent comonad

Page 137: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

62

Spatial type theoryA endomorphism of comprehension objects supports spatial type theory if it supports L and R types and x:p ⊢ f(x) : p is an idempotent comonad

Represent ♭ A := comult*(L(A)) # A := R A

Page 138: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

63

R types [Birkedal+ dependent right adjoints]

Page 139: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

64

L and R types

Page 140: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

65

Spatial L and R types

Page 141: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

65

Spatial L and R types [can translate Shulman’s optimized rules into this]

Page 142: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

Semantics (dependent)

π

𝓜

𝒟

“local discrete fibrationof 2-categories with families”

Page 143: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

67

WIP

Current translations of object-language substitutions use some stricter F types, or modified mode theory;trying to reconcile with the semantics

Top F and U types are strictly stable under substitution — move to mode theory? strictification?

Semantics with fibrancy for homotopy models

Page 144: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

68

1.New judgements for left adjoints: mode types/terms

2.Left adjoint types: F types

3.Right adjoint types: U types

4.Structural rules: 2-cells between mode terms

5.Optimize placement of structural rules: derived rules

Pattern

Page 145: A Fibrational Framework for Substructural and Modal ......A Judgemental Deconstruction of Modal Logic [Reed’09] Adjoint Logic with a 2-Category of Modes [L.Shulman’16] A Fibrational

69

Goals for Modal Frameworkcovers lots of examples

easy to go from intended semantics to a signature

automatically get type theoretic rules (but with explicit structural rules)

can derive “optimized” rules (requires cleverness)

categorical semantics for whole framework at once

expected structures are models of signatures

proof assistant with enough automationto make it convenient