SLIDE 1
Internal Parametricity for Cubical Type Theory Evan Cavallo Robert - - PowerPoint PPT Presentation
Internal Parametricity for Cubical Type Theory Evan Cavallo Robert - - PowerPoint PPT Presentation
Internal Parametricity for Cubical Type Theory Evan Cavallo Robert Harper Carnegie Mellon University CSL 2020 JAN 16 0 Mar n-Lf type theory Mar n-Lf 82: judgments explained by as speci fi ca ons on untyped programs ( A ,
SLIDE 2
SLIDE 3
CSL 2020 · JAN 16 2
Cubical type theories
coercion operaon ensures everything respects paths univalence: type paths are equivalences
SLIDE 4
CSL 2020 · JAN 16 3
intervals might be given by:
De Morgan cubes
Cohen, Coquand, Huber, & Mörtberg 2015
Cartesian cubes
Angiuli, Favonia, & Harper 2018 Angiuli, Brunerie, Coquand, Favonia, Licata, & Harper 2018
structural
Substructural cubes
Bezem, Coquand, & Huber 2013&2017
no contracon (diagonals)
Cubical type theories
SLIDE 5
CSL 2020 · JAN 16 4
Cartesian cubical type theory
SLIDE 6
CSL 2020 · JAN 16 4
Cartesian cubical type theory
SLIDE 7
CSL 2020 · JAN 16 5
Higher inducve types
combine inducve definions and quoents
SLIDE 8
CSL 2020 · JAN 16 6
Higher inducve types
define higher-dimensional objects (synthec homotopy theory)
SLIDE 9
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
SLIDE 10
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
SLIDE 11
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
2-d
SLIDE 12
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
2-d
is the associator an isomorphism? 3-d
▰
SLIDE 13
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
2-d
is the associator an isomorphism? 3-d
▰
Mac Lane's pentagon? 4-d
▰
SLIDE 14
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
2-d
is the associator an isomorphism? 3-d
▰
Mac Lane's pentagon? 4-d
▰
(van Doorn 2018, Brunerie 2018)
SLIDE 15
CSL 2020 · JAN 16 7
Higher inducve types
when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8)
associave?
▰
2-d
is the associator an isomorphism? 3-d
▰
Mac Lane's pentagon? 4-d
▰
(van Doorn 2018, Brunerie 2018)
can we avoid this complexity?
SLIDE 16
CSL 2020 · JAN 16 8
Parametricity
“Parametric” funcons are uniform in type variables: Contrast with “ad-hoc” polymorphic funcons:
Restrict ourselves to write only parametric funcons Parametric funcons sasfy many properes “automacally”
SLIDE 17
CSL 2020 · JAN 16 9
Reynolds’ abstracon theorem (’83)
Def: A family of (set-theorec) funcons is parametric when it acts on relaons. e.g., Abstracon theorem: the denotaon of any term in simply-typed λ-calculus (with ×, bool) is parametric. Key idea: λ-calculus has a relaonal interpretaon.
SLIDE 18
CSL 2020 · JAN 16 10
Reynolds’ abstracon theorem (’83)
Def: A family of (set-theorec) funcons is parametric when it acts on relaons. e.g., “theorems for free” (Wadler ’89)
SLIDE 19
CSL 2020 · JAN 16 11
Make relaonal interp. visible inside type theory
Internal parametricity (Bernardy & Moulin ’12)
SLIDE 20
CSL 2020 · JAN 16 11
Make relaonal interp. visible inside type theory
Internal parametricity (Bernardy & Moulin ’12)
cubical type theory parametric type theory construcons act on isomorphisms construcons act on relaons equal over iso x.A related by rel x.A univalence: relavity:
SLIDE 21
CSL 2020 · JAN 16 12
Parametric Cubical Type Theory
bridge dimensions path dimensions structural substructural
SLIDE 22
CSL 2020 · JAN 16 12
Parametric Cubical Type Theory
bridge dimensions path dimensions structural substructural
Use parametricity to prove results about HITs Use good properes of cubical type theory to get beer results from / simplify internal parametricity Compare and contrast internal parametricity and cubical type theory
SLIDE 23
CSL 2020 · JAN 16 13
Parametric Cubical Type Theory
SLIDE 24
CSL 2020 · JAN 16 13
Parametric Cubical Type Theory
SLIDE 25
CSL 2020 · JAN 16 13
Parametric Cubical Type Theory
SLIDE 26
CSL 2020 · JAN 16 13
Parametric Cubical Type Theory
SLIDE 27
CSL 2020 · JAN 16 13
Parametric Cubical Type Theory
SLIDE 28
CSL 2020 · JAN 16 14
Internal parametricity: affine dimensions
SLIDE 29
CSL 2020 · JAN 16 14
Internal parametricity: affine dimensions
SLIDE 30
CSL 2020 · JAN 16 14
Internal parametricity: affine dimensions
SLIDE 31
CSL 2020 · JAN 16 15
Internal parametricity: Bridge-types
SLIDE 32
CSL 2020 · JAN 16 16
Internal parametricity: “relavity”
Forward: Backward:
▰ Parallels structural Glue/V
SLIDE 33
CSL 2020 · JAN 16 17
Internal parametricity: funcon types
paths: funcon extensionality bridges: relaonal interpretaon (difference invisible for paths because of coercion)
SLIDE 34
CSL 2020 · JAN 16 18
Internal parametricity: funcon types
Forward: Backward:
SLIDE 35
CSL 2020 · JAN 16 18
Internal parametricity: funcon types
Forward: Backward:
SLIDE 36
CSL 2020 · JAN 16 18
Internal parametricity: funcon types
Forward: Backward:
“case analysis for interval terms”
SLIDE 37
CSL 2020 · JAN 16 19
Internal parametricity: funcon types
Stability of abstracon under substuon relies on absence of diagonals:
SLIDE 38
CSL 2020 · JAN 16 19
Internal parametricity: funcon types
Stability of abstracon under substuon relies on absence of diagonals:
SLIDE 39
CSL 2020 · JAN 16 19
Internal parametricity: funcon types
Stability of abstracon under substuon relies on absence of diagonals:
SLIDE 40
CSL 2020 · JAN 16 19
Internal parametricity: funcon types
Stability of abstracon under substuon relies on absence of diagonals:
SLIDE 41
CSL 2020 · JAN 16 20
Cubical equality for internal parametricity
Funcon extensionality & univalence
▰ ▰ ▰
SLIDE 42
CSL 2020 · JAN 16 21
Internal parametricity for cubical equality
Movang example: smash product
In the paper: any map
▰
is constant or the polymorphic identy. Implies any non-constant map
▰
is an isomorphism. Key: scales to characterize maps
▰
SLIDE 43