reynolds parametricity
play

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:


  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

  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

  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

  4. Where Were We? • Last time we recalled Reynolds’ standard relational parametricity

  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

  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

  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

  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

  9. Motivation: Indexed Families of Sets • A fibration captures a family ( E B ) B ∈B of categories E B indexed over objects of a(nother) category B

  10. Motivation: Indexed Families of Sets • A fibration captures a family ( E B ) B ∈B of categories E B indexed over objects 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

  11. Motivation: Indexed Families of Sets • A fibration captures a family ( E B ) B ∈B of categories E B indexed over objects 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 E B

  12. Motivation: Indexed Families of Sets • A fibration captures a family ( E B ) B ∈B of categories E B indexed over objects 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 E B • U must have some additional properties for describing indexing

  13. Motivation: Indexed Families of Sets • A fibration captures a family ( E B ) B ∈B of categories E B indexed over objects 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 E B • U must have some additional properties for describing indexing • We are interested in indexing because Reynolds’ interpretations are type-indexed

  14. Display Maps • Simple case: Indexing for sets – B is a set I of indices, – E is X = � i ∈ I X i , where ( X i ) i ∈ I is a (wlog, disjoint) family of sets – U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ X i

  15. Display Maps • Simple case: Indexing for sets – B is a set I of indices, – E is X = � i ∈ I X i , where ( X i ) i ∈ I is a (wlog, disjoint) family of sets – U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ X i • U is called the display map for ( X i ) i ∈ I

  16. � Display Maps • Simple case: Indexing for sets – B is a set I of indices, – E is X = � i ∈ I X i , where ( X i ) i ∈ I is a (wlog, disjoint) family of sets – U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ X i • U is called the display map for ( X i ) i ∈ I • It is customary to draw it vertically, like this: X U I

  17. � Display Maps • Simple case: Indexing for sets – B is a set I of indices, – E is X = � i ∈ I X i , where ( X i ) i ∈ I is a (wlog, disjoint) family of sets – U : X → I maps each x ∈ X to the index i ∈ I such that x ∈ X i • U is called the display map for ( X i ) i ∈ I • It is customary to draw it vertically, like this: X U I • The set X i = U − 1 ( i ) = { x ∈ X | Ux = i } is called the fibre of X over i

  18. Categories from Indexed Families - Example I • The slice category Set /I

  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

  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 ′ g X ′ X U ′ U I

  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 ′ g X ′ X U ′ U I • We can view g as a family of functions ( g i ) i ∈ I , where g i : X ′ i → X i

  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 ′ g X ′ X U ′ U I • We can view g as a family of functions ( g i ) i ∈ I , where g i : X ′ i → X i • Identities and composition are inherited from Set

  23. Categories from Indexed Families - Example II • The arrow category Set →

  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

  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 ′ g Y X U ′ U f � I J

  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 ′ g Y X U ′ U f � I J • We can view g as a family of functions ( g j ) j ∈ J , where g j : Y j → X f ( j ) (since g ( y ) ∈ U − 1 ( f ( j )) for any y ∈ Y j = U ′− 1 ( j ) )

  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 ′ g Y X U ′ U f � I J • We can view g as a family of functions ( g j ) j ∈ J , where g j : Y j → X f ( j ) (since g ( y ) ∈ U − 1 ( f ( j )) for any y ∈ Y j = U ′− 1 ( j ) ) • Identities and composition are componentwise inherited from Set .

  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 ′ g Y X U ′ U f � I J • We can view g as a family of functions ( g j ) j ∈ J , where g j : Y j → X f ( j ) (since g ( y ) ∈ U − 1 ( f ( j )) for any y ∈ Y j = 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

  29. Substitution • Consider U : X → I for X = ( X i ) i ∈ I for some index set I

  30. Substitution • Consider U : X → I for X = ( X i ) i ∈ I for some index set I • Substitution along f : J → I turns the family ( X i ) i ∈ I into a family ( Y j ) j ∈ J such that Y j = X f ( j )

Recommend


More recommend