A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural...

98
A Fibrational Framework for Substructural and Modal Logics Dan Licata Wesleyan University Michael Shulman University of San Diego 1 Mitchell Riley Wesleyan University

Transcript of A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural...

Page 1: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

A Fibrational Framework for Substructural and Modal Logics

Dan Licata Wesleyan University

Michael ShulmanUniversity of San Diego

1

Mitchell RileyWesleyan University

Page 2: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

2

Substructural Logic

Γ,x:A ⊢ BΓ ⊢ B

Γ,x:A,y:B ⊢ CΓ,y:B,x:A ⊢ B

Γ,x:A,y:A ⊢ BΓ,x:A ⊢ B

Weakening

Exchange

Contraction

Page 3: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Modal Logic

Γ ⊢ ☐A

∅ ⊢ A

♢A ⊢ ♢C

A ⊢ ♢C

Page 4: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Modal Logic

Γ ⊢ ☐A

∅ ⊢ A

♢A ⊢ ♢C

A ⊢ ♢C

(♢A) × B vs. ♢(A × B)

Page 5: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

4

Intuitionistic substructural and modal logics/type systems

Linear/affine: use once (state, sessions)Relevant: strictness annotationsOrdered: linguisticsBunched: separation logic Comonads: staging, metavariables, coeffectsMonads: effectsInteractions between products and modalities

Page 6: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

5

Homotopy type theory

highercategory theory homotopy theory

dependent type theory

Page 7: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

Page 8: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

♭A ⊢ B A ⊢ # B

Page 9: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

monad ♢

♭A ⊢ B A ⊢ # B

Page 10: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

monad ♢

comonad ☐

♭A ⊢ B A ⊢ # B

Page 11: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

monad ♢

comonad ☐

monad

♭A ⊢ B A ⊢ # B

Page 12: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

6

Cohesive HoTT

♭∫ #⊣ ⊣

Dependent type theory with modalities ∫A, ♭A, #A

[Shulman,Schreiber]

monad ♢

comonad ☐

monad(idempotent)♭♭ A ≅ ♭ A

♭A ⊢ B A ⊢ # B

Page 13: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

7

𝕊-Cohesion

♮ ♮⊣

comonad monad

[Finster,L.,Morehouse,Riley]

Page 14: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

7

𝕊-Cohesion

♮ ♮⊣

comonad monad

A ⊢♮A ⊢ A

[Finster,L.,Morehouse,Riley]

Page 15: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

7

𝕊-Cohesion

♮ ♮⊣

comonad monad

A ⊢♮A ⊢ A

[Finster,L.,Morehouse,Riley]

♮(A ⋀ B) ≅ ♮A ×♮B

Page 16: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

8

Differential Cohesion[Schreiber; Gross,L.,New,Paykin,Riley,Shulman,Wellen]

♭∫ #⊣ ⊣

Page 17: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

8

Differential Cohesion[Schreiber; Gross,L.,New,Paykin,Riley,Shulman,Wellen]

♭∫ #⊣ ⊣

𝖩R &⊣ ⊣

Page 18: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

8

Differential Cohesion[Schreiber; Gross,L.,New,Paykin,Riley,Shulman,Wellen]

♭∫ #⊣ ⊣

𝖩R &⊣ ⊣

HoTT/UF Saturday!

Page 19: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

9

What are the common patterns in substructural and modal logics?

Page 20: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

S4 ☐

Γ ; Δ ⊢☐A Γ; Δ,☐A ⊢ C

Γ,A ; Δ,☐A ⊢ CΓ ; ⋅ ⊢ A

Γ,A; Δ ⊢ CΓ,A; Δ,A ⊢ C

Γ; Δ ⊢ C

Page 21: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

S4 ☐

Γ ; Δ ⊢☐A Γ; Δ,☐A ⊢ C

Γ,A ; Δ,☐A ⊢ CΓ ; ⋅ ⊢ A

Γ,A; Δ ⊢ CΓ,A; Δ,A ⊢ C

morally ☐Γ× Δ → CΓ; Δ ⊢ C

Page 22: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

S4 ☐

Γ ; Δ ⊢☐A Γ; Δ,☐A ⊢ C

Γ,A ; Δ,☐A ⊢ CΓ ; ⋅ ⊢ A

Γ,A; Δ ⊢ CΓ,A; Δ,A ⊢ C

context is all boxed formulae (up to weakening)

morally ☐Γ× Δ → CΓ; Δ ⊢ C

Page 23: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

S4 ☐

Γ ; Δ ⊢☐A Γ; Δ,☐A ⊢ C

Γ,A ; Δ,☐A ⊢ CΓ ; ⋅ ⊢ A

Γ,A; Δ ⊢ CΓ,A; Δ,A ⊢ C

context is all boxed formulae (up to weakening)

morally ☐Γ× Δ → CΓ; Δ ⊢ C

because ☐A → A

Page 24: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Γ ; ⋅ ⊢ ! A Γ; Δ,!A ⊢ C

Γ,A ; Δ ⊢ CΓ ; ⋅ ⊢ A

Γ,A; Δ ⊢ CΓ,A; Δ,A ⊢ C

Linear Logic !

context is all !’ed formulae (no weakening)

cartesian/structural

linear

Page 25: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Linear Logic ⊗

Γ,Δ ⊢ A ⊗ BΓ ⊢ A Δ ⊢ B

Γ,A⊗B ⊢ CΓ,A,B ⊢ C

Page 26: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Linear Logic ⊗

Γ,Δ ⊢ A ⊗ BΓ ⊢ A Δ ⊢ B

Γ,A⊗B ⊢ CΓ,A,B ⊢ C

context “is” a ⊗

Page 27: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Linear Logic ⊗

Γ,Δ ⊢ A ⊗ BΓ ⊢ A Δ ⊢ B

Γ,A⊗B ⊢ CΓ,A,B ⊢ C

context “is” a ⊗

Γ0 ⊢ A ⊗ BΓ ⊢ A Δ ⊢ BΓ0 ≡ Γ, Δ

context is a ⊗, up to some structural rules

Page 28: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

Types inherit properties

A,B ⊢ B ⊗ AA ⊢ AB ⊢ BA,B ≡ B,A

A⊗B ⊢ B ⊗ A

Page 29: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

14

Types inherit properties

⋅ ; ! A ⊗ ! B ⊢ ! (A ⊗ B)⋅; ! A, ! B ⊢ ! (A ⊗ B)

A ; ! B ⊢ ! (A ⊗ B)A,B ; ⋅ ⊢ ! (A ⊗ B)A,B; ⋅ ⊢ A ⊗ B

Page 30: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

15

Pattern for ☐ ! ⊗

Operation on contexts, with explicit or admissible structural properties

Type constructor that “internalizes” the context operation, inherits the structural properties

Page 31: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

16

This paper

Products and left-adjoints (⊗,F) all one connectiveNegatives and right adjoints (⊸,U) anotherCut elimination for all instances at onceEquational theory: differ by structural rulesCategorical semantics

A framework that abstracts the common aspects of many intuitionistic

substructural and modal logics

Page 32: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

17

ExamplesNon-assoc, ordered, linear, affine, relevant, cartesian, bunched products and implicationsN-linear variables [Reed,Abel,McBride]Monoidal, lax, non- left adjointsNon-strong, strong, ☐-strong monadsCohesion

Page 33: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

17

ExamplesNon-assoc, ordered, linear, affine, relevant, cartesian, bunched products and implicationsN-linear variables [Reed,Abel,McBride]Monoidal, lax, non- left adjointsNon-strong, strong, ☐-strong monadsCohesion

Logical adequacy: sequent is provable iff its encoding is

Page 34: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related Work

Page 35: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semantics

Page 36: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semanticsAdjoint linear logic [Benton&Wadler,95]

Page 37: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semanticsAdjoint linear logic [Benton&Wadler,95]

cartesian

linear

F U⊣

Page 38: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semanticsAdjoint linear logic [Benton&Wadler,95]

cartesian

linear

F U⊣A ::= F C | A ⊗ B | …C ::= U A | C × D | …

Page 39: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semanticsAdjoint linear logic [Benton&Wadler,95]

cartesian

linear

F U⊣

!A := FU A

A ::= F C | A ⊗ B | …C ::= U A | C × D | …

Page 40: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

18

Closely Related WorkDisplay logic, Lambek calculus, resource semanticsAdjoint linear logic [Benton&Wadler,95]

λ-calculus for Resource Separation [Atkey,2004] Adjoint logic [Reed,2009]

cartesian

linear

F U⊣

!A := FU A

A ::= F C | A ⊗ B | …C ::= U A | C × D | …

Page 41: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

19

Technique

Γ ⊢α A

ψ ⊢ α : p

Sequent

Context descriptor

A substructural/modal typing judgement is an ordinary structural judgement, annotated with a term that

describes the tree structure of the context

Page 42: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

20

Sequent Calculus

Page 43: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

21

Mode Theory

x1:p1, … , xn:pn ⊢ α : q

α ⇒ β

p,q,… Modes

Context Descriptors

Structural Properties

Page 44: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

21

Mode Theory

Types p,q are “modes” of types/contexts

x1:p1, … , xn:pn ⊢ α : q

α ⇒ β

p,q,… Modes

Context Descriptors

Structural Properties

Page 45: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

21

Mode Theory

Types p,q are “modes” of types/contexts

Terms α are descriptions of the context

x1:p1, … , xn:pn ⊢ α : q

α ⇒ β

p,q,… Modes

Context Descriptors

Structural Properties

Page 46: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

21

Mode Theory

Types p,q are “modes” of types/contexts

Terms α are descriptions of the context

“Transformations” α ⇒ β are structural properties

x1:p1, … , xn:pn ⊢ α : q

α ⇒ β

p,q,… Modes

Context Descriptors

Structural Properties

Page 47: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

21

Mode Theory

Types p,q are “modes” of types/contexts

Terms α are descriptions of the context

“Transformations” α ⇒ β are structural properties

x1:p1, … , xn:pn ⊢ α : q

α ⇒ β

p,q,… Modes

Context Descriptors

Structural Properties

cartesian/structural

Page 48: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Page 49: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformations

Page 50: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)

Page 51: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ a

Page 52: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ aRelevant logic: a ⟹ a ⊗ a

Page 53: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ aRelevant logic: a ⟹ a ⊗ aAffine logic: a ⟹ 1

Page 54: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ aRelevant logic: a ⟹ a ⊗ aAffine logic: a ⟹ 1BI: two function symbols ✻ and ⋀: (a ✻ b) ⋀ (c ✻ d)

Page 55: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ aRelevant logic: a ⟹ a ⊗ aAffine logic: a ⟹ 1BI: two function symbols ✻ and ⋀: (a ✻ b) ⋀ (c ✻ d)Modalities: unary function symbols: r(a) ⊗ r(b) ⊗ c ⊗ d

Page 56: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

22

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X

cartesian

Non-associative logic: no equations/transformationsOrdered logic: (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)Linear logic: a ⊗ b = b ⊗ aRelevant logic: a ⟹ a ⊗ aAffine logic: a ⟹ 1BI: two function symbols ✻ and ⋀: (a ✻ b) ⋀ (c ✻ d)Modalities: unary function symbols: r(a) ⊗ r(b) ⊗ c ⊗ d

Page 57: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

23

Weakening over weakening

Page 58: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

23

Weakening over weakening

Γ,x:A ⊢α BΓ ⊢α B

Page 59: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

23

Weakening over weakening

Γ,x:A ⊢α BΓ ⊢α B

a:A,b:B,c:C,d:D ⊢(a ⊗ b) ⊗ (c ⊗ d) X a:A,b:B,c:C,d:D,e:E ⊢(a ⊗ b) ⊗ (c ⊗ d) X

Page 60: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

24

Structural Rules (Admiss)

Γ,x:A ⊢α BΓ ⊢α B

Page 61: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

24

Structural Rules (Admiss)

Γ,x:A ⊢α BΓ ⊢α B

Γ,x:A,y:B ⊢α CΓ,y:B,x:A ⊢α B

Page 62: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

24

Structural Rules (Admiss)

Γ ⊢α A Γ,x:A ⊢β BΓ ⊢β[α/x] B

Γ,x:A ⊢α BΓ ⊢α B

Γ,x:A,y:B ⊢α CΓ,y:B,x:A ⊢α B

Page 63: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

24

Structural Rules (Admiss)

Γ ⊢α A Γ,x:A ⊢β BΓ ⊢β[α/x] B

Γ,x:A ⊢α BΓ ⊢α B

Γ,x:A ⊢x A

Γ,x:A,y:B ⊢α CΓ,y:B,x:A ⊢α B

Page 64: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

24

Structural Rules (Admiss)

Γ ⊢α A Γ,x:A ⊢β BΓ ⊢β[α/x] B

Γ,x:A ⊢α BΓ ⊢α B

Γ,x:A ⊢x A

Γ,x:A,y:B ⊢α CΓ,y:B,x:A ⊢α B

Γ ⊢β A

Page 65: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

25

Hypothesis

Γ ⊢β Pβ ⇒ x x : P ∊ Γ

Page 66: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

25

Hypothesis

Γ ⊢β Pβ ⇒ x x : P ∊ Γ

up to whatever structural properties you’ve asserted, the context is just x (typically x⊗y ⇒ x)

Page 67: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

26

F types

Fα (x1:A1,…,xn:An)

Page 68: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

26

F types the “product” of A1 … Anstructured according to α

Fα (x1:A1,…,xn:An)

Page 69: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

26

F types the “product” of A1 … Anstructured according to α

Fα (x1:A1,…,xn:An)

A ⊗ B := F(x ⊗ y) (x:A, y:B)e.g.

Page 70: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

26

F types the “product” of A1 … Anstructured according to α

Fα (x1:A1,…,xn:An)

A ⊗ B := F(x ⊗ y) (x:A, y:B)e.g.

♭A := F(r x) (x:A)

Page 71: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

27

F Left

Γ,A⊗B,Δ ⊢ CΓ,A,B,Δ ⊢ C

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

Γ; Δ,!A ⊢ C

Γ,A ; Δ ⊢ C

Γ; Δ,☐A ⊢ CΓ,A ; Δ,☐A ⊢ C

Page 72: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

28

F Left

Γ, x:Fα(Δ) ⊢β B Γ,Δ ⊢β[α/x] B

Page 73: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

28

F Left

Γ, x:Fα(Δ) ⊢β B Γ,Δ ⊢β[α/x] B

remember where in the tree Δ variables occur

Page 74: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

29

F Right

Γ0 ⊢ A ⊗ BΓ ⊢ A Δ ⊢ BΓ0 ≡ Γ, Δ

Γ0 ⊢ !A

Γ ; ⋅ ⊢ AΓ0 ≡ (Γ; ⋅)

Page 75: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

30

F Right

Γ ⊢β Fα Δ β ⇒ α[γ] Γ ⊢γ Δ

Page 76: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x:A⊗B ⊢x B⊗A

Page 77: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)x:A⊗B ⊢x B⊗A

Page 78: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

x:A⊗B ⊢x B⊗A

Page 79: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

x:A⊗B ⊢x B⊗A

Page 80: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

y⊗z ⇒ (z’⊗y’)[?]

x:A⊗B ⊢x B⊗A

Page 81: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

x:A⊗B ⊢x B⊗A

Page 82: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

y⊗z ⇒ (z’⊗y’)[z/z’,y/y’]

x:A⊗B ⊢x B⊗A

Page 83: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

x:A⊗B ⊢x B⊗A

Page 84: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

y⊗z ⇒ z⊗y

x:A⊗B ⊢x B⊗A

Page 85: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

y:A ⊢y A

y⊗z ⇒ z⊗y

x:A⊗B ⊢x B⊗A

Page 86: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

31

Exchange

x : F(y⊗z)(y:A,z:B) ⊢x F(z’⊗y’)(z’:B,y’:A)y:A,z:B ⊢y⊗z F(z’⊗y’)(z’:B,y’:A)

y:A ⊢y Az:B ⊢z By⊗z ⇒ z⊗y

x:A⊗B ⊢x B⊗A

Page 87: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

32

Right Adjoints

Γ ⊢ A ⊸ BΓ,A ⊢ B

Γ ⊢c U AΓ;⋅⊢l A

Γ[A⊸B,Δ] ⊢ CΔ ⊢ A Γ[B] ⊢ C

Γ,U A;Δ ⊢l B

Γ;Δ,A ⊢l B

Page 88: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

33

Right Adjoints

Uc.α(Δ|A) typeq

A typepΔ ctxφφ,c:q ⊢ α : p

A ⊸ B := Uc.(c ⊗ y)(y:A|B)

Page 89: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

33

Right Adjoints

Uc.α(Δ|A) typeq

A typepΔ ctxφφ,c:q ⊢ α : p

A ⊸ B := Uc.(c ⊗ y)(y:A|B)

A \ B := Uc.(y ⊗ c)(y:A|B)A / B := Uc.(c ⊗ y)(y:A|B)

Page 90: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

34

Right Adjoints

Uc.α(Δ|A) typeq

A typepΔ ctxφφ,c:q ⊢ α : p

Γ ⊢β Uc.α(Δ|A)Γ,Δ ⊢α[β/c] A

Page 91: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

35

Right Adjoints

x:X ⊢x Uc ⊗ a(a:A|Y)A ⊸ Y

Page 92: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

35

Right Adjoints

x:X ⊢x Uc ⊗ a(a:A|Y)

x:X,a:A ⊢x⊗a Y

A ⊸ Y

Page 93: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

35

Right Adjoints

x:X ⊢x Uc ⊗ a(a:A|Y)

x:X,a:A ⊢x⊗a Y

z:Fx⊗a(x:X,a:A) ⊢z Y

A ⊸ Y

Page 94: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

35

Right Adjoints

x:X ⊢x Uc ⊗ a(a:A|Y)

x:X,a:A ⊢x⊗a Y

z:Fx⊗a(x:X,a:A) ⊢z Y

A ⊸ Y

X ⊗ A

Page 95: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

36

ExamplesNon-assoc, ordered, linear, affine, relevant, cartesian, bunched products and implicationsN-linear variables [Reed,Abel,McBride]Monoidal, lax, non- left adjointsNon-strong, strong, ☐-strong monadsSpatial type theory

Logical adequacy: sequent is provable iff its encoding is

Page 96: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

37

Bifibrations

locally discrete fibration (action of structural rules)Fα Δ makes this into an opfibration Uα(Δ|A) makes this into a fibration

Sound/Complete: Syntax forms a bifibration and can be interpreted in any

D

M

derivations

modes

cartesian 2- multicategories 𝜋

Page 97: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

38

Equational Theoryβη for F and Uequations governing action of 2-cells: when do two terms differ by placement of structural properties?

A,B ⊢ B × AA ⊢ AB ⊢ BA,B ≡ B,A

A,B ⊢ B × AA,B ⊢ AA,B ⊢ BA,B ≡ A,B,A,B

Page 98: A Fibrational Framework for Substructural and Modal Logics€¦ · 4 Intuitionistic substructural and modal logics/type systems Linear/affine: use once (state, sessions) Relevant:

39

This paper

Products and left-adjoints (⊗,F) all one connectiveNegatives and right adjoints (⊸,U) anotherCut elimination for all instances at onceEquational theory: differ by structural rulesCategorical semantics

A framework that abstracts the common aspects of many intuitionistic

substructural and modal logics