HoTT-UF 2019
Cubical Indexed Inducve Types
Evan Cavallo
Carnegie Mellon University jww Robert Harper
Cubical Indexed Induc ve Types Evan Cavallo Carnegie Mellon - - PowerPoint PPT Presentation
Cubical Indexed Induc ve Types Evan Cavallo Carnegie Mellon University jww Robert Harper HoTT-UF 2019 0 Higher induc ve types HoTT-UF 2019 1 Higher induc ve types roll quo ents and induc ve types into one HoTT-UF 2019 1
HoTT-UF 2019
Cubical Indexed Inducve Types
Evan Cavallo
Carnegie Mellon University jww Robert Harper
HoTT-UF 2019 1
Higher inducve types
HoTT-UF 2019 1
Higher inducve types
roll quoents and inducve types into one
HoTT-UF 2019 1
Higher inducve types
roll quoents and inducve types into one
HoTT-UF 2019 1
Higher inducve types
roll quoents and inducve types into one Useful generality beyond ordinary quoents
HoTT-UF 2019 1
Higher inducve types
roll quoents and inducve types into one Useful generality beyond ordinary quoents In ordinary TT: Cauchy reals, QIITs, . . .
HoTT-UF 2019 1
Higher inducve types
roll quoents and inducve types into one Useful generality beyond ordinary quoents In ordinary TT: Cauchy reals, QIITs, . . . In higher-d TT: truncaons, . . .
HoTT-UF 2019 2
Higher inducve types: what are they?
HoTT-UF 2019 2
Higher inducve types: what are they?
HoTT: idea, many examples circles, pushouts, . . . ("ordinary" quoents) truncaons, localizaons (higher inducve types) Cauchy reals (higher inducve-inducve types)
HoTT-UF 2019 2
Higher inducve types: what are they?
HoTT: idea, many examples circles, pushouts, . . . ("ordinary" quoents) truncaons, localizaons (higher inducve types) Cauchy reals (higher inducve-inducve types) no precise syntacc schema what forms can constructors take? deriving eliminators
HoTT-UF 2019 2
Higher inducve types: what are they?
HoTT: idea, many examples circles, pushouts, . . . ("ordinary" quoents) truncaons, localizaons (higher inducve types) Cauchy reals (higher inducve-inducve types) no precise syntacc schema what forms can constructors take? deriving eliminators missing semancs for many how do programs with HITs compute? which HITs exist in denotaonal models? (pushouts?)
HoTT-UF 2019 3
Higher inducve types: what are they?
advances in syntax Sojakova 2014: W-suspensions Basold, Geuvers, & van der Weide 2017: 1-d HITs Dybjer & Moeneclaey 2017: 2-d HITs Kaposi & Kovács 2018: n-d HIITs
HoTT-UF 2019 4
Higher inducve types: what are they?
advances in semancs Lumsdaine & Shulman 2017: simplicial model cats syntax? HITs with parameters? Dybjer & Moeneclaey 2017: groupoid model Altenkirch, Kaposi, & Kovács 2019: w/ UIP
HoTT-UF 2019 4
Higher inducve types: what are they?
advances in semancs Lumsdaine & Shulman 2017: simplicial model cats syntax? HITs with parameters? Dybjer & Moeneclaey 2017: groupoid model Altenkirch, Kaposi, & Kovács 2019: w/ UIP the "edge of understanding": syntax + semancs DM, AKK (truncated) cubical type theories
HoTT-UF 2019 5
Cubical type theories
HoTT-UF 2019 5
Cubical type theories
Move: higher type theories w/ computaonal meaning
HoTT-UF 2019 5
Cubical type theories
Move: higher type theories w/ computaonal meaning Several variees: De Morgan cubes Cohen, Coquand, Huber, & Mörtberg 2015 Cartesian cubes Angiuli, Favonia, & Harper 2018 Angiuli, Brunerie, Coquand, Favonia, Licata, & Harper 2019 Substructural cubes Bezem, Coquand, & Huber 2013&2017
HoTT-UF 2019 6
Move: higher type theories w/ computaonal meaning
Cubical type theories
HoTT-UF 2019 6
Move: higher type theories w/ computaonal meaning
Cubical type theories
HoTT-UF 2019 7
Cubical type theories
Move: higher type theories w/ computaonal meaning
HoTT-UF 2019 8
Cubical type theories: why?
HoTT-UF 2019 8
Cubical type theories: why?
Developed to give computaonal meaning to HoTT
HoTT-UF 2019 8
Cubical type theories: why?
Developed to give computaonal meaning to HoTT also: construcve denotaonal models
HoTT-UF 2019 8
Cubical type theories: why?
Developed to give computaonal meaning to HoTT also: construcve denotaonal models also: any models for many HITs
HoTT-UF 2019 8
Cubical type theories: why?
Developed to give computaonal meaning to HoTT also: construcve denotaonal models also: any models for many HITs Useful for praccal formalizaon early movaon: Licata & Brunerie 2015
HoTT-UF 2019 8
Cubical type theories: why?
Developed to give computaonal meaning to HoTT also: construcve denotaonal models also: any models for many HITs Useful for praccal formalizaon early movaon: Licata & Brunerie 2015 For HoTT purists: laboratory of higher ideas
HoTT-UF 2019 9
Cubical inducve types: syntax
HoTT-UF 2019 9
Cubical inducve types: syntax
Higher constructors via dimension arguments
HoTT-UF 2019 9
Cubical inducve types: syntax
Higher constructors via dimension arguments Path constructors live in the inducve type
HoTT-UF 2019 9
Cubical inducve types: syntax
Higher constructors via dimension arguments Path constructors live in the inducve type Scales well to >1-d (spheres, torus, . . .)
HoTT-UF 2019 10
Cubical inducve types: syntax
Eliminaon: paern matching + coherence reqs
HoTT-UF 2019 10
Cubical inducve types: syntax
Eliminaon: paern matching + coherence reqs
HoTT-UF 2019 10
Cubical inducve types: syntax
Eliminaon: paern matching + coherence reqs
HoTT-UF 2019 10
Cubical inducve types: syntax
Eliminaon: paern matching + coherence reqs
reduces when applied to a constructor
HoTT-UF 2019 11
Cubical inducve types: syntax
Dealing with higher dimensions
HoTT-UF 2019 11
Cubical inducve types: syntax
Dealing with higher dimensions HITs with >1-d constructors
HoTT-UF 2019 11
Cubical inducve types: syntax
Dealing with higher dimensions HITs with >1-d constructors paern-matching on two HITs at once
HoTT-UF 2019 12
Cubical inducve types: syntax
C & Harper: schema for indexed cubical HITs
HoTT-UF 2019 12
Cubical inducve types: syntax
C & Harper: schema for indexed cubical HITs
← non-recursive ← recursive
HoTT-UF 2019 12
Cubical inducve types: syntax
C & Harper: schema for indexed cubical HITs
← non-recursive ← recursive
HoTT-UF 2019 12
Cubical inducve types: syntax
C & Harper: schema for indexed cubical HITs
← non-recursive ← recursive ← dimensions ← boundary
HoTT-UF 2019 12
Cubical inducve types: syntax
C & Harper: schema for indexed cubical HITs
← non-recursive ← recursive ← dimensions ← boundary
HoTT-UF 2019 13
Cubical inducve types: semancs
HoTT-UF 2019 13
Cubical inducve types: semancs
Ingredients of a cubical type
HoTT-UF 2019 13
Cubical inducve types: semancs
Ingredients of a cubical type Values
HoTT-UF 2019 13
Cubical inducve types: semancs
Ingredients of a cubical type Values
HoTT-UF 2019 13
Cubical inducve types: semancs
Ingredients of a cubical type Values Coercion and composion operaons
HoTT-UF 2019 14
Interlude: semancs of cubical type theory
HoTT-UF 2019 14
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths
HoTT-UF 2019 14
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths
HoTT-UF 2019 14
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths
HoTT-UF 2019 14
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths
HoTT-UF 2019 15
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 15
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 16
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 16
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 16
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 16
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 16
Interlude: semancs of cubical type theory
Coercion: all construcons respect paths Evaluate by cases on the type line
HoTT-UF 2019 17
Interlude: semancs of cubical type theory
Composion: strengthening the inducon hypothesis
HoTT-UF 2019 17
Interlude: semancs of cubical type theory
Composion: strengthening the inducon hypothesis add homogeneous composion
HoTT-UF 2019 17
Interlude: semancs of cubical type theory
Composion: strengthening the inducon hypothesis add homogeneous composion
HoTT-UF 2019 17
Interlude: semancs of cubical type theory
Composion: strengthening the inducon hypothesis add homogeneous composion
generalize coe to heterogeneous composion
( )
HoTT-UF 2019 18
Cubical inducve types: semancs
HoTT-UF 2019 18
Cubical inducve types: semancs
What are the values of a higher inducve type?
HoTT-UF 2019 18
Cubical inducve types: semancs
What are the values of a higher inducve type?
HoTT-UF 2019 18
Cubical inducve types: semancs
What are the values of a higher inducve type?
HoTT-UF 2019 19
Cubical inducve types: semancs
What are the values of a higher inducve type?
HoTT-UF 2019 19
Cubical inducve types: semancs
What are the values of a higher inducve type?
Can we implement coercion and composion?
HoTT-UF 2019 20
Cubical inducve types: semancs
What are the values of a higher inducve type?
HoTT-UF 2019 20
Cubical inducve types: semancs
What are the values of a higher inducve type? Unless R is symmetric and transive, ? may not exist
HoTT-UF 2019 20
Cubical inducve types: semancs
What are the values of a higher inducve type? Unless R is symmetric and transive, ? may not exist Must revise our choice of values
HoTT-UF 2019 21
Cubical inducve types: semancs
Idea: freely add homogeneous composion values
HoTT-UF 2019 21
Cubical inducve types: semancs
Idea: freely add homogeneous composion values
HoTT-UF 2019 21
Cubical inducve types: semancs
Idea: freely add homogeneous composion values
( + boundary reducons )
HoTT-UF 2019 21
Cubical inducve types: semancs
Idea: freely add homogeneous composion values
( + boundary reducons ) Eliminator maps hcom values to hcoms in the target
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases Why not free coercion values?
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases Why not free coercion values?
HoTT-UF 2019 22
Cubical inducve types: semancs
Implement coercion by cases Why not free coercion values?
HoTT-UF 2019 23
Cubical inducve types: semancs
Theorem (Canonicity). Any term in a HIT evaluates to a value.
HoTT-UF 2019 23
Cubical inducve types: semancs
Theorem (Canonicity). Any term in a HIT evaluates to a value. Are we sasfied with our choice of values?
HoTT-UF 2019 23
Cubical inducve types: semancs
Theorem (Canonicity). Any term in a HIT evaluates to a value. Are we sasfied with our choice of values? any int evaluates to pos, neg, seg, or hcom
HoTT-UF 2019 23
Cubical inducve types: semancs
Theorem (Canonicity). Any term in a HIT evaluates to a value. Are we sasfied with our choice of values? any int evaluates to pos, neg, seg, or hcom Angiuli, Favonia, & Harper: zero-d composions can be excluded
HoTT-UF 2019 23
Cubical inducve types: semancs
Theorem (Canonicity). Any term in a HIT evaluates to a value. Are we sasfied with our choice of values? any int evaluates to pos, neg, seg, or hcom Angiuli, Favonia, & Harper: zero-d composions can be excluded any zero-d int evaluates to pos or neg ✓
HoTT-UF 2019 24
Indexed inducve types
HoTT-UF 2019 24
Indexed inducve types
Simultaneously inducvely defined family of types
HoTT-UF 2019 24
Indexed inducve types
Simultaneously inducvely defined family of types Vectors of a given length
HoTT-UF 2019 24
Indexed inducve types
Simultaneously inducvely defined family of types Vectors of a given length Identy types
HoTT-UF 2019 25
Indexed inducve types
What are the values of an indexed inducve type?
HoTT-UF 2019 25
Indexed inducve types
What are the values of an indexed inducve type? Not only refl...
HoTT-UF 2019 25
Indexed inducve types
What are the values of an indexed inducve type? Not only refl... Add free coercion values for coercion between indices
HoTT-UF 2019 25
Indexed inducve types
What are the values of an indexed inducve type? Not only refl... Add free coercion values for coercion between indices Coercion in parameters sll reduces
HoTT-UF 2019 25
Indexed inducve types
What are the values of an indexed inducve type? Not only refl... Add free coercion values for coercion between indices Coercion in parameters sll reduces Size depends on size of indices, but not parameters
HoTT-UF 2019 26
Cubical type theory and the future of HITs
HoTT-UF 2019 26
Cubical type theory and the future of HITs
Gracefully scaling to higher-d is essenal for pracce
HoTT-UF 2019 26
Cubical type theory and the future of HITs
Gracefully scaling to higher-d is essenal for pracce where does cubical type theory have models?
HoTT-UF 2019 26
Cubical type theory and the future of HITs
Gracefully scaling to higher-d is essenal for pracce where does cubical type theory have models? Going further inducve-inducve types (Hugunin 2019) implementaon ( , Cubical Agda) more flexible schemata