Reynolds Parametricity Patricia Johann Appalachian State University - - PowerPoint PPT Presentation

reynolds parametricity
SMART_READER_LITE
LIVE PREVIEW

Reynolds Parametricity Patricia Johann Appalachian State University - - PowerPoint PPT Presentation

Reynolds Parametricity Patricia Johann Appalachian State University cs.appstate.edu/ johannp Based on joint work with Neil Ghani, Fredrik Nordvall Forsberg, Federico Orsanigo, and Tim Revell OPLSS 2016 Course Outline Topic:


slide-1
SLIDE 1

Reynolds’ Parametricity

Patricia Johann Appalachian State University

cs.appstate.edu/

∼johannp

Based on joint work with Neil Ghani, Fredrik Nordvall Forsberg, Federico Orsanigo, and Tim Revell

OPLSS 2016

slide-2
SLIDE 2

Course Outline

Topic: Reynolds’ theory of parametric polymorphism for System F Goals: - extract the fibrational essence of Reynolds’ theory

  • generalize Reynolds’ construction to very general models
  • Lecture 1: Reynolds’ theory of parametricity for System F
  • Lecture 2: Introduction to fibrations
  • Lecture 3: A bifibrational view of parametricity
  • Lecture 4: Bifibrational parametric models for System F
slide-3
SLIDE 3

Course Outline

Topic: Reynolds’ theory of parametric polymorphism for System F Goals: - extract the fibrational essence of Reynolds’ theory

  • generalize Reynolds’ construction to very general models
  • Lecture 1: Reynolds’ theory of parametricity for System F
  • Lecture 2: Introduction to fibrations
  • Lecture 3: A bifibrational view of parametricity
  • Lecture 4: Bifibrational parametric models for System F
slide-4
SLIDE 4

Where Were We?

  • Last time we recalled Reynolds’ standard relational parametricity
slide-5
SLIDE 5

Where Were We?

  • Last time we recalled Reynolds’ standard relational parametricity
  • This is the main inspiration for the bifibrational model of parametricity

for System F we will develop

slide-6
SLIDE 6

Where Were We?

  • Last time we recalled Reynolds’ standard relational parametricity
  • This is the main inspiration for the bifibrational model of parametricity

for System F we will develop

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

slide-7
SLIDE 7

Where Were We?

  • Last time we recalled Reynolds’ standard relational parametricity
  • This is the main inspiration for the bifibrational model of parametricity

for System F we will develop

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

  • Generalize Reynolds’ constructions to bifibrational models of System

F for which we can prove (bifibrational versions of) the IEL and Ab- straction Theorem

slide-8
SLIDE 8

Where Were We?

  • Last time we recalled Reynolds’ standard relational parametricity
  • This is the main inspiration for the bifibrational model of parametricity

for System F we will develop

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

  • Generalize Reynolds’ constructions to bifibrational models of System

F for which we can prove (bifibrational versions of) the IEL and Ab- straction Theorem

  • Reynolds’ construction is (ignoring size issues) such a model
slide-9
SLIDE 9

Motivation: Indexed Families of Sets

  • A fibration captures a family (EB)B∈B of categories EB indexed over
  • bjects of a(nother) category B
slide-10
SLIDE 10

Motivation: Indexed Families of Sets

  • A fibration captures a family (EB)B∈B of categories EB indexed over
  • bjects of a(nother) category B
  • A fibration is a functor U : E → B

– B is the base category of U – E is the total category of U

slide-11
SLIDE 11

Motivation: Indexed Families of Sets

  • A fibration captures a family (EB)B∈B of categories EB indexed over
  • bjects of a(nother) category B
  • A fibration is a functor U : E → B

– B is the base category of U – E is the total category of U Intuitively, E =

B∈B EB

slide-12
SLIDE 12

Motivation: Indexed Families of Sets

  • A fibration captures a family (EB)B∈B of categories EB indexed over
  • bjects of a(nother) category B
  • A fibration is a functor U : E → B

– B is the base category of U – E is the total category of U Intuitively, E =

B∈B EB

  • U must have some additional properties for describing indexing
slide-13
SLIDE 13

Motivation: Indexed Families of Sets

  • A fibration captures a family (EB)B∈B of categories EB indexed over
  • bjects of a(nother) category B
  • A fibration is a functor U : E → B

– B is the base category of U – E is the total category of U Intuitively, E =

B∈B EB

  • U must have some additional properties for describing indexing
  • We are interested in indexing because Reynolds’ interpretations are

type-indexed

slide-14
SLIDE 14

Display Maps

  • Simple case: Indexing for sets

– B is a set I of indices, – E is X =

i∈I Xi, where (Xi)i∈I is a (wlog, disjoint) family of sets

– U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ Xi

slide-15
SLIDE 15

Display Maps

  • Simple case: Indexing for sets

– B is a set I of indices, – E is X =

i∈I Xi, where (Xi)i∈I is a (wlog, disjoint) family of sets

– U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ Xi

  • U is called the display map for (Xi)i∈I
slide-16
SLIDE 16

Display Maps

  • Simple case: Indexing for sets

– B is a set I of indices, – E is X =

i∈I Xi, where (Xi)i∈I is a (wlog, disjoint) family of sets

– U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ Xi

  • U is called the display map for (Xi)i∈I
  • It is customary to draw it vertically, like this:

X

U

  • I
slide-17
SLIDE 17

Display Maps

  • Simple case: Indexing for sets

– B is a set I of indices, – E is X =

i∈I Xi, where (Xi)i∈I is a (wlog, disjoint) family of sets

– U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ Xi

  • U is called the display map for (Xi)i∈I
  • It is customary to draw it vertically, like this:

X

U

  • I
  • The set

Xi = U −1(i) = {x ∈ X| Ux = i} is called the fibre of X over i

slide-18
SLIDE 18

Categories from Indexed Families - Example I

  • The slice category Set/I
slide-19
SLIDE 19

Categories from Indexed Families - Example I

  • The slice category Set/I

– An object in Set/I is a function U : X → I in Set

slide-20
SLIDE 20

Categories from Indexed Families - Example I

  • The slice category Set/I

– An object in Set/I is a function U : X → I in Set – A morphism from U ′ : X′ → I and U : X → I in Set/I is a function g : X′ → X in Set such that U ◦ g = U ′ X′

g

  • U′
  • X

U

  • I
slide-21
SLIDE 21

Categories from Indexed Families - Example I

  • The slice category Set/I

– An object in Set/I is a function U : X → I in Set – A morphism from U ′ : X′ → I and U : X → I in Set/I is a function g : X′ → X in Set such that U ◦ g = U ′ X′

g

  • U′
  • X

U

  • I
  • We can view g as a family of functions (gi)i∈I, where gi : X′

i → Xi

slide-22
SLIDE 22

Categories from Indexed Families - Example I

  • The slice category Set/I

– An object in Set/I is a function U : X → I in Set – A morphism from U ′ : X′ → I and U : X → I in Set/I is a function g : X′ → X in Set such that U ◦ g = U ′ X′

g

  • U′
  • X

U

  • I
  • We can view g as a family of functions (gi)i∈I, where gi : X′

i → Xi

  • Identities and composition are inherited from Set
slide-23
SLIDE 23

Categories from Indexed Families - Example II

  • The arrow category Set→
slide-24
SLIDE 24

Categories from Indexed Families - Example II

  • The arrow category Set→

– An object of Set→ is a function U : X → I in Set for some index set I

slide-25
SLIDE 25

Categories from Indexed Families - Example II

  • The arrow category Set→

– An object of Set→ is a function U : X → I in Set for some index set I – A morphism from U ′ : Y → J to U : X → I in Set→ is a pair (g : Y → X, f : J → I) of functions in Set such that U ◦ g = f ◦ U ′ Y

g

  • U′
  • X

U

  • J

f

I

slide-26
SLIDE 26

Categories from Indexed Families - Example II

  • The arrow category Set→

– An object of Set→ is a function U : X → I in Set for some index set I – A morphism from U ′ : Y → J to U : X → I in Set→ is a pair (g : Y → X, f : J → I) of functions in Set such that U ◦ g = f ◦ U ′ Y

g

  • U′
  • X

U

  • J

f

I

  • We can view g as a family of functions (gj)j∈J, where gj : Yj → Xf(j)

(since g(y) ∈ U −1(f(j)) for any y ∈ Yj = U ′−1(j) )

slide-27
SLIDE 27

Categories from Indexed Families - Example II

  • The arrow category Set→

– An object of Set→ is a function U : X → I in Set for some index set I – A morphism from U ′ : Y → J to U : X → I in Set→ is a pair (g : Y → X, f : J → I) of functions in Set such that U ◦ g = f ◦ U ′ Y

g

  • U′
  • X

U

  • J

f

I

  • We can view g as a family of functions (gj)j∈J, where gj : Yj → Xf(j)

(since g(y) ∈ U −1(f(j)) for any y ∈ Yj = U ′−1(j) )

  • Identities and composition are componentwise inherited from Set.
slide-28
SLIDE 28

Categories from Indexed Families - Example II

  • The arrow category Set→

– An object of Set→ is a function U : X → I in Set for some index set I – A morphism from U ′ : Y → J to U : X → I in Set→ is a pair (g : Y → X, f : J → I) of functions in Set such that U ◦ g = f ◦ U ′ Y

g

  • U′
  • X

U

  • J

f

I

  • We can view g as a family of functions (gj)j∈J, where gj : Yj → Xf(j)

(since g(y) ∈ U −1(f(j)) for any y ∈ Yj = U ′−1(j) )

  • Identities and composition are componentwise inherited from Set.
  • Set→ induces a codomain functor cod : Set→ → Set mapping

U : X → I to I and (g, f) to f

slide-29
SLIDE 29

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
slide-30
SLIDE 30

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
  • Substitution along f : J → I turns the family (Xi)i∈I into a family

(Yj)j∈J such that Yj = Xf(j)

slide-31
SLIDE 31

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
  • Substitution along f : J → I turns the family (Xi)i∈I into a family

(Yj)j∈J such that Yj = Xf(j)

  • (Yj)j∈J is obtained by pullback of U along f

Y

g

  • U′
  • X

U

  • J

f

I

slide-32
SLIDE 32

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
  • Substitution along f : J → I turns the family (Xi)i∈I into a family

(Yj)j∈J such that Yj = Xf(j)

  • (Yj)j∈J is obtained by pullback of U along f

Y

g

  • U′
  • X

U

  • J

f

I

  • Y = {(j, x) ∈ J ×X | U(x) = f(j)} with projection functions g and U ′
slide-33
SLIDE 33

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
  • Substitution along f : J → I turns the family (Xi)i∈I into a family

(Yj)j∈J such that Yj = Xf(j)

  • (Yj)j∈J is obtained by pullback of U along f

Y

g

  • U′
  • X

U

  • J

f

I

  • Y = {(j, x) ∈ J ×X | U(x) = f(j)} with projection functions g and U ′
  • U ′ : Y → J gives a new family of sets (Yj)j∈J whose fibres are

Yj = U ′−1(j) = {x ∈ X | U(x) = f(j)} = U −1(f(j)) = Xf(j)

slide-34
SLIDE 34

Substitution

  • Consider U : X → I for X = (Xi)i∈I for some index set I
  • Substitution along f : J → I turns the family (Xi)i∈I into a family

(Yj)j∈J such that Yj = Xf(j)

  • (Yj)j∈J is obtained by pullback of U along f

Y

g

  • U′
  • X

U

  • J

f

I

  • Y = {(j, x) ∈ J ×X | U(x) = f(j)} with projection functions g and U ′
  • U ′ : Y → J gives a new family of sets (Yj)j∈J whose fibres are

Yj = U ′−1(j) = {x ∈ X | U(x) = f(j)} = U −1(f(j)) = Xf(j)

  • We usually write f ∗(U) for the display map U ′
slide-35
SLIDE 35

Substitution - Example 1

  • Let f be an element f : {∗} → I
slide-36
SLIDE 36

Substitution - Example 1

  • Let f be an element f : {∗} → I
  • Then f picks out an element i of I (i.e., f(∗) = i)
slide-37
SLIDE 37

Substitution - Example 1

  • Let f be an element f : {∗} → I
  • Then f picks out an element i of I (i.e., f(∗) = i)
  • Y∗ = U ′−1(∗) = {x ∈ X | U(x) = i} = U −1(i) = Xi
slide-38
SLIDE 38

Substitution - Example 1

  • Let f be an element f : {∗} → I
  • Then f picks out an element i of I (i.e., f(∗) = i)
  • Y∗ = U ′−1(∗) = {x ∈ X | U(x) = i} = U −1(i) = Xi
  • Thus Y =

j∈{∗} Yj = Y∗ = Xi

slide-39
SLIDE 39

Substitution - Example 1

  • Let f be an element f : {∗} → I
  • Then f picks out an element i of I (i.e., f(∗) = i)
  • Y∗ = U ′−1(∗) = {x ∈ X | U(x) = i} = U −1(i) = Xi
  • Thus Y =

j∈{∗} Yj = Y∗ = Xi

  • So substituting along a particular element of I selects the fibre of X
  • ver that element
slide-40
SLIDE 40

Substitution - Example 2

  • Let f be a non-indexed set f : J → {∗}
slide-41
SLIDE 41

Substitution - Example 2

  • Let f be a non-indexed set f : J → {∗}
  • Then, for every j ∈ J,

Yj = U ′−1(j) = {x ∈ X | U(x) = ∗} = U −1(∗) = X∗ = X

slide-42
SLIDE 42

Substitution - Example 2

  • Let f be a non-indexed set f : J → {∗}
  • Then, for every j ∈ J,

Yj = U ′−1(j) = {x ∈ X | U(x) = ∗} = U −1(∗) = X∗ = X

  • So Y =

j∈J Yj = J × X (since the Yj are disjoint)

slide-43
SLIDE 43

Substitution - Example 3

  • Let f be a projection f : I × J → I
slide-44
SLIDE 44

Substitution - Example 3

  • Let f be a projection f : I × J → I
  • Then, for every pair (i, j),

Y(i,j) = U ′−1(i, j) = {x ∈ X | U(x) = i} = U −1(i) = Xi

slide-45
SLIDE 45

Substitution - Example 3

  • Let f be a projection f : I × J → I
  • Then, for every pair (i, j),

Y(i,j) = U ′−1(i, j) = {x ∈ X | U(x) = i} = U −1(i) = Xi

  • So Y =

(i,j)∈I×J Y(i,j) = (i,j)∈I×J Xi = Xi × J

slide-46
SLIDE 46

Substitution - Example 3

  • Let f be a projection f : I × J → I
  • Then, for every pair (i, j),

Y(i,j) = U ′−1(i, j) = {x ∈ X | U(x) = i} = U −1(i) = Xi

  • So Y =

(i,j)∈I×J Y(i,j) = (i,j)∈I×J Xi = Xi × J

  • There is a “dummy” index j in the family f ∗(U) that plays no role
slide-47
SLIDE 47

Substitution - Example 3

  • Let f be a projection f : I × J → I
  • Then, for every pair (i, j),

Y(i,j) = U ′−1(i, j) = {x ∈ X | U(x) = i} = U −1(i) = Xi

  • So Y =

(i,j)∈I×J Y(i,j) = (i,j)∈I×J Xi = Xi × J

  • There is a “dummy” index j in the family f ∗(U) that plays no role
  • Logically speaking, substitution along a projection is weakening
slide-48
SLIDE 48

Substitution - Example 4

  • Let f be a diagonal map f : I → I × I
slide-49
SLIDE 49

Substitution - Example 4

  • Let f be a diagonal map f : I → I × I
  • Then, for every i ∈ I,

Yi = U ′−1(i) = {x ∈ X | U(x) = (i, i)} = U −1(i, i) = X(i,i)

slide-50
SLIDE 50

Substitution - Example 4

  • Let f be a diagonal map f : I → I × I
  • Then, for every i ∈ I,

Yi = U ′−1(i) = {x ∈ X | U(x) = (i, i)} = U −1(i, i) = X(i,i)

  • So Y =

i∈I Yi = (i,i)∈I×I X(i,i)

slide-51
SLIDE 51

Substitution - Example 4

  • Let f be a diagonal map f : I → I × I
  • Then, for every i ∈ I,

Yi = U ′−1(i) = {x ∈ X | U(x) = (i, i)} = U −1(i, i) = X(i,i)

  • So Y =

i∈I Yi = (i,i)∈I×I X(i,i)

  • In other words, Y is restriction of

(i,i′)∈I×I X(i,i′) to the diagonal i = i′

slide-52
SLIDE 52

Substitution - Example 4

  • Let f be a diagonal map f : I → I × I
  • Then, for every i ∈ I,

Yi = U ′−1(i) = {x ∈ X | U(x) = (i, i)} = U −1(i, i) = X(i,i)

  • So Y =

i∈I Yi = (i,i)∈I×I X(i,i)

  • In other words, Y is restriction of

(i,i′)∈I×I X(i,i′) to the diagonal i = i′

  • Logically speaking, substitution along a diagonal is contraction
slide-53
SLIDE 53

Best Substitution Morphisms - Part I

  • The pair (g, f) in the pullback diagram

Y

g

  • f ∗(U)
  • X

U

  • J

f

I

is a morphism from f ∗(U) to U in the arrow category Set→

slide-54
SLIDE 54

Best Substitution Morphisms - Part I

  • The pair (g, f) in the pullback diagram

Y

g

  • f ∗(U)
  • X

U

  • J

f

I

is a morphism from f ∗(U) to U in the arrow category Set→

  • We call (g, f) a substitution morphism from f ∗(U) to U
slide-55
SLIDE 55

Best Substitution Morphisms - Part II

  • (g, f) is such that if

– U ′′ : Z → K is any object in Set→ – (g′, f ′) : U ′′ → U is a morphism in Set→ – f ′ : K → I factors through f : J → I via v : K → J (i.e., f ′ = f ◦v) Z

g′

  • U′′
  • Y

g

  • f ∗(U)
  • X

U

  • K

f ′

  • v

J

f

I

slide-56
SLIDE 56

Best Substitution Morphisms - Part II

  • (g, f) is such that if

– U ′′ : Z → K is any object in Set→ – (g′, f ′) : U ′′ → U is a morphism in Set→ – f ′ : K → I factors through f : J → I via v : K → J (i.e., f ′ = f ◦v) then there exists a unique h : Z → Y in Set→ such that – cod(h, v) = v for cod : Set→ → Set – g ◦ h = g′ Z

g′

  • h
  • U′′
  • Y

g

  • f ∗(U)
  • X

U

  • K

f ′

  • v

J

f

I

slide-57
SLIDE 57

Best Substitution Morphisms - Part II

  • (g, f) is such that if

– U ′′ : Z → K is any object in Set→ – (g′, f ′) : U ′′ → U is a morphism in Set→ – f ′ : K → I factors through f : J → I via v : K → J (i.e., f ′ = f ◦v) then there exists a unique h : Z → Y in Set→ such that – cod(h, v) = v for cod : Set→ → Set – g ◦ h = g′ Z

g′

  • h
  • U′′
  • Y

g

  • f ∗(U)
  • X

U

  • K

f ′

  • v

J

f

I

  • That is, (g, f) is the best substitution morphism from f ∗(U) to U
slide-58
SLIDE 58

Best Substitution Morphisms - Part II

  • (g, f) is such that if

– U ′′ : Z → K is any object in Set→ – (g′, f ′) : U ′′ → U is a morphism in Set→ – f ′ : K → I factors through f : J → I via v : K → J (i.e., f ′ = f ◦v) then there exists a unique h : Z → Y in Set→ such that – cod(h, v) = v for cod : Set→ → Set – g ◦ h = g′ Z

g′

  • h
  • U′′
  • Y

g

  • f ∗(U)
  • X

U

  • K

f ′

  • v

J

f

I

  • That is, (g, f) is the best substitution morphism from f ∗(U) to U
  • The existence of such best substitution morphisms is what makes cod :

Set→ → Set a fibration

slide-59
SLIDE 59

Cartesian Morphisms

  • Let U : E → B be a functor
slide-60
SLIDE 60

Cartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : Q → P in E is cartesian over f : X → Y in B if
slide-61
SLIDE 61

Cartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : Q → P in E is cartesian over f : X → Y in B if

– Ug = f

slide-62
SLIDE 62

Cartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : Q → P in E is cartesian over f : X → Y in B if

– Ug = f – for every g′ : Q′ → P in E with Ug′ = f ◦ v for some v : UQ′ → X, there exists a unique h : Q′ → Q with Uh = v and g′ = g ◦ h

slide-63
SLIDE 63

Cartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : Q → P in E is cartesian over f : X → Y in B if

– Ug = f – for every g′ : Q′ → P in E with Ug′ = f ◦ v for some v : UQ′ → X, there exists a unique h : Q′ → Q with Uh = v and g′ = g ◦ h E

U

  • Q′

h

  • g′
  • Q

g

P

UQ′

v

  • Ug′
  • B

X

f

Y

slide-64
SLIDE 64

Opcartesian Morphisms

  • Let U : E → B be a functor
slide-65
SLIDE 65

Opcartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : P → Q in E is opcartesian over f : X → Y in B if
slide-66
SLIDE 66

Opcartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : P → Q in E is opcartesian over f : X → Y in B if

– Ug = f

slide-67
SLIDE 67

Opcartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : P → Q in E is opcartesian over f : X → Y in B if

– Ug = f – for every g′ : P → Q′ in E with Ug′ = v ◦ f for some v : Y → UQ′, there exists a unique h : Q → Q′ with Uh = v and g′ = h ◦ g

slide-68
SLIDE 68

Opcartesian Morphisms

  • Let U : E → B be a functor
  • A morphism g : P → Q in E is opcartesian over f : X → Y in B if

– Ug = f – for every g′ : P → Q′ in E with Ug′ = v ◦ f for some v : Y → UQ′, there exists a unique h : Q → Q′ with Uh = v and g′ = h ◦ g E

U

  • Q′

h

  • g′
  • Q′

Q

g

P

P

g′

  • g

Q

h

  • UQ′

v

  • Ug′
  • UQ′

B X

f

Y

X

Ug′

  • f

Y

v

slide-69
SLIDE 69

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
slide-70
SLIDE 70

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
  • (Op)cartesian morphisms over f wrt P are unique up to isomorphism
slide-71
SLIDE 71

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
  • (Op)cartesian morphisms over f wrt P are unique up to isomorphism
  • f §

P is the cartesian morphism over f with codomain P

slide-72
SLIDE 72

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
  • (Op)cartesian morphisms over f wrt P are unique up to isomorphism
  • f §

P is the cartesian morphism over f with codomain P

  • f P

§ is the opcartesian morphism over f with domain P

slide-73
SLIDE 73

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
  • (Op)cartesian morphisms over f wrt P are unique up to isomorphism
  • f §

P is the cartesian morphism over f with codomain P

  • f P

§ is the opcartesian morphism over f with domain P

  • f ∗P is the domain of f §

P

slide-74
SLIDE 74

Observations and Notation

  • Let P in E and f : X → Y with UP = Y
  • (Op)cartesian morphisms over f wrt P are unique up to isomorphism
  • f §

P is the cartesian morphism over f with codomain P

  • f P

§ is the opcartesian morphism over f with domain P

  • f ∗P is the domain of f §

P

  • ΣfP is the codomain of f P

§

slide-75
SLIDE 75

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

slide-76
SLIDE 76

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

  • U : E → B is an opfibration if for every object P of E and every

f : UP → Y in B, there is an opcartesian morphism f P

§ : P → Q in E

  • ver f
slide-77
SLIDE 77

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

  • U : E → B is an opfibration if for every object P of E and every

f : UP → Y in B, there is an opcartesian morphism f P

§ : P → Q in E

  • ver f
  • U : E → B is a bifibration if it is both a fibration and an opfibration
slide-78
SLIDE 78

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

  • U : E → B is an opfibration if for every object P of E and every

f : UP → Y in B, there is an opcartesian morphism f P

§ : P → Q in E

  • ver f
  • U : E → B is a bifibration if it is both a fibration and an opfibration
  • If U : E → B is a fibration, opfibration, or bifibration, then an object

P in E is over its image UP and similarly for morphisms

slide-79
SLIDE 79

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

  • U : E → B is an opfibration if for every object P of E and every

f : UP → Y in B, there is an opcartesian morphism f P

§ : P → Q in E

  • ver f
  • U : E → B is a bifibration if it is both a fibration and an opfibration
  • If U : E → B is a fibration, opfibration, or bifibration, then an object

P in E is over its image UP and similarly for morphisms

  • A morphism is vertical if it is over id
slide-80
SLIDE 80

Fibrations and Opfibrations

  • U : E → B is a fibration if for every object P of E and every f : X →

UP in B, there is a cartesian morphism f §

P : Q → P in E over f

  • U : E → B is an opfibration if for every object P of E and every

f : UP → Y in B, there is an opcartesian morphism f P

§ : P → Q in E

  • ver f
  • U : E → B is a bifibration if it is both a fibration and an opfibration
  • If U : E → B is a fibration, opfibration, or bifibration, then an object

P in E is over its image UP and similarly for morphisms

  • A morphism is vertical if it is over id
  • The fibre EX over an object X in B is the subcategory of E of objects
  • ver X and morphisms over id X
slide-81
SLIDE 81

Indexing and Reindexing Functors

  • The function mapping each object P of E to f ∗P extends to the rein-

dexing functor f ∗ : EY → EX along f mapping each k : P → P ′ in EY to the (unique) morphism f ∗k such that k ◦ f §

P = f § P ′ ◦ f ∗k

U E f ∗ B f X Y

slide-82
SLIDE 82

Indexing and Reindexing Functors

  • The function mapping each object P of E to f ∗P extends to the rein-

dexing functor f ∗ : EY → EX along f mapping each k : P → P ′ in EY to the (unique) morphism f ∗k such that k ◦ f §

P = f § P ′ ◦ f ∗k

  • The function mapping each object P of E to ΣfP extends to the oprein-

dexing functor Σf : EX → EY along f mapping each k : P → P ′ in EX to the (unique) morphism Σfk such that Σfk ◦ f P

§ = f P ′ §

  • k

U E f ∗ Σf B f X Y

slide-83
SLIDE 83

New Fibrations from Old

  • |C| is the discrete category of C
slide-84
SLIDE 84

New Fibrations from Old

  • |C| is the discrete category of C
  • The discrete functor |U| : |E| → |B| is induced by the restriction of

U : E → B to |E|

slide-85
SLIDE 85

New Fibrations from Old

  • |C| is the discrete category of C
  • The discrete functor |U| : |E| → |B| is induced by the restriction of

U : E → B to |E|

  • Cn is the n-fold product of C (in Cat)
slide-86
SLIDE 86

New Fibrations from Old

  • |C| is the discrete category of C
  • The discrete functor |U| : |E| → |B| is induced by the restriction of

U : E → B to |E|

  • Cn is the n-fold product of C (in Cat)
  • The n-fold product of U : E → B, denoted U n : En → Bn, is given by

U n(X1, ..., Xn) = (UX1, ..., UXn) and U n(f1, ..., fn) = (Uf1, ..., Ufn)

slide-87
SLIDE 87

New Fibrations from Old

  • |C| is the discrete category of C
  • The discrete functor |U| : |E| → |B| is induced by the restriction of

U : E → B to |E|

  • Cn is the n-fold product of C (in Cat)
  • The n-fold product of U : E → B, denoted U n : En → Bn, is given by

U n(X1, ..., Xn) = (UX1, ..., UXn) and U n(f1, ..., fn) = (Uf1, ..., Ufn)

  • Lemma
  • 1. If U : E → B is a functor, then |U| : |E| → |B| is a bifibration,

called the discrete fibration for U

  • 2. If U is a (bi)fibration then so is U n : En → Bn for any n ∈ Nat
slide-88
SLIDE 88

Fibred Functors

  • Let U : E → B and U ′ : E′ → B′ be fibrations
slide-89
SLIDE 89

Fibred Functors

  • Let U : E → B and U ′ : E′ → B′ be fibrations
  • A fibred functor F : U ′ → U comprises two functors

Fo : B′ → B and Fr : E′ → E such that

slide-90
SLIDE 90

Fibred Functors

  • Let U : E → B and U ′ : E′ → B′ be fibrations
  • A fibred functor F : U ′ → U comprises two functors

Fo : B′ → B and Fr : E′ → E such that – U ◦ Fr = Fo ◦ U ′ E′

Fr

  • U′
  • E

U

  • B′

Fo

B

slide-91
SLIDE 91

Fibred Functors

  • Let U : E → B and U ′ : E′ → B′ be fibrations
  • A fibred functor F : U ′ → U comprises two functors

Fo : B′ → B and Fr : E′ → E such that – U ◦ Fr = Fo ◦ U ′ E′

Fr

  • U′
  • E

U

  • B′

Fo

B

– cartesian morphisms are preserved, i.e., if f in E′ is cartesian over g in B′ then Frf in E is cartesian over Fog in B

slide-92
SLIDE 92

Fibred Natural Transformations

  • Let F, F ′ : U ′ → U be fibred functors
slide-93
SLIDE 93

Fibred Natural Transformations

  • Let F, F ′ : U ′ → U be fibred functors
  • A fibred natural transformation η : F ′ → F comprises two natural

transformations ηo : F ′

  • → Fo

and ηr : F ′

r → Fr

slide-94
SLIDE 94

Fibred Natural Transformations

  • Let F, F ′ : U ′ → U be fibred functors
  • A fibred natural transformation η : F ′ → F comprises two natural

transformations ηo : F ′

  • → Fo

and ηr : F ′

r → Fr

such that U ◦ ηr = ηo ◦ U ′

slide-95
SLIDE 95

Fibred Natural Transformations

  • Let F, F ′ : U ′ → U be fibred functors
  • A fibred natural transformation η : F ′ → F comprises two natural

transformations ηo : F ′

  • → Fo

and ηr : F ′

r → Fr

such that U ◦ ηr = ηo ◦ U ′ F ′

rX U′

  • ηrX
  • F ′

rf

  • FrX

U

  • Frf
  • F ′

rY ηrY

FrY

F ′

  • U ′X

ηoUX

  • F ′
  • U′f
  • FoUX

FoUf

  • F ′
  • U ′Y

ηoUY

FoUY

slide-96
SLIDE 96

Coming Up

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

slide-97
SLIDE 97

Coming Up

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

  • Generalize Reynolds’ constructions to (bi)fibrational models of Sys-

tem F for which we can prove (fibrational versions of) the IEL and Abstraction Theorem Reynolds’ construction is (ignoring size issues) an instance

slide-98
SLIDE 98

Coming Up

  • View Reynolds’ construction and results through the lens of the rela-

tions (bi)fibration on Set

  • Generalize Reynolds’ constructions to (bi)fibrational models of Sys-

tem F for which we can prove (fibrational versions of) the IEL and Abstraction Theorem Reynolds’ construction is (ignoring size issues) an instance

  • Reynolds’ construction is (ignoring size issues) such a model
slide-99
SLIDE 99

References

  • Categorical Logic and Type Theory. B. Jacobs. Elsevier, 1999.
  • Bifibrational functorial semantics for parametric polymorphism.

N. Ghani, P. Johann, F. Nordvall Forsberg, F. Orsanigo, and T. Revell. MFPS’15.