FSCD 2019 Cubical Syntax for Reflection-Free Extensional Equality Jonathan Sterling 1 Carlo Angiuli 1 Daniel Gratzer 2 1 Carnegie Mellon University 2 Aarhus University 1 / 32
π¦ βΆ π΅ β’ πΆ(π¦) type need to consider equality of types: if π΅ = πΆ type , then elements of π΅ should be elements of πΆ . types depend on elements, so equality of elements necessary too. not all equations can be made automatic, so a language of proofs must account for coercions . π¦ βΆ π΅ β’ π(π¦) βΆ πΆ(π¦) dependent type theory ... is about families ! 2 / 32
need to consider equality of types: if π΅ = πΆ type , then elements of π΅ should be elements of πΆ . types depend on elements, so equality of elements necessary too. not all equations can be made automatic, so a language of proofs must account for coercions . π¦ βΆ π΅ β’ π(π¦) βΆ πΆ(π¦) dependent type theory ... is about families ! π¦ βΆ π΅ β’ πΆ(π¦) type 2 / 32
need to consider equality of types: if π΅ = πΆ type , then elements of π΅ should be elements of πΆ . types depend on elements, so equality of elements necessary too. not all equations can be made automatic, so a language of proofs must account for coercions . π¦ βΆ π΅ β’ π(π¦) βΆ πΆ(π¦) dependent type theory ... is about families ! π¦ βΆ π΅ β’ πΆ(π¦) type 2 / 32
types depend on elements, so equality of elements necessary too. not all equations can be made automatic, so a language of proofs must account for coercions . π¦ βΆ π΅ β’ π(π¦) βΆ πΆ(π¦) dependent type theory ... is about families ! π¦ βΆ π΅ β’ πΆ(π¦) type need to consider equality of types: if π΅ = πΆ type , then elements of π΅ should be elements of πΆ . 2 / 32
π¦ βΆ π΅ β’ π(π¦) βΆ πΆ(π¦) dependent type theory ... is about families ! π¦ βΆ π΅ β’ πΆ(π¦) type need to consider equality of types: if π΅ = πΆ type , then elements of π΅ should be elements of πΆ . types depend on elements, so equality of elements necessary too. not all equations can be made automatic, so a language of proofs must account for coercions . 2 / 32
π¦ βΆ π΅ Γ πΆ β’ π βΆ πΊ(π¦) ifg π¦ βΆ π΅ Γ πΆ β’ π βΆ πΊ(β¨π¦.1, π¦.2β©) equality in type theory what equations can be made automatic? surely π½/π/πΎ , and type theorists also know how to automate π/π/π/ β¦ 3 / 32
π¦ βΆ π΅ Γ πΆ β’ π βΆ πΊ(π¦) ifg π¦ βΆ π΅ Γ πΆ β’ π βΆ πΊ(β¨π¦.1, π¦.2β©) equality in type theory what equations can be made automatic? surely π½/π/πΎ , and type theorists also know how to automate π/π/π/ β¦ 3 / 32
1. is π equal to coe πΊ(β) (π, π) ? yes, up to a coercion equality in type theory other equations may require explicit coercion. 1 consider a family π βΆ nat β’ πΊ(π) type β¦ 1 βequality reflectionβ just pushes the problem elsewhere and makes it worse! unlike many, I speak from experience. 4 / 32
1. is π equal to coe πΊ(β) (π, π) ? yes, up to a coercion ifg??? equality in type theory other equations may require explicit coercion. 1 consider a family π βΆ nat β’ πΊ(π) type β¦ π βΆ nat β’ π βΆ πΊ(π + 1) π βΆ nat β’ π βΆ πΊ(1 + π) 1 βequality reflectionβ just pushes the problem elsewhere and makes it worse! unlike many, I speak from experience. 4 / 32
1. is π equal to coe πΊ(β) (π, π) ? yes, up to a coercion ifg equality in type theory other equations may require explicit coercion. 1 consider a family π βΆ nat β’ πΊ(π) type β¦ π βΆ nat β’ π βΆ πΊ(π + 1) π βΆ nat β’ coe πΊ(β) (π, π) βΆ πΊ(1 + π) 1 βequality reflectionβ just pushes the problem elsewhere and makes it worse! unlike many, I speak from experience. 4 / 32
ifg equality in type theory other equations may require explicit coercion. 1 consider a family π βΆ nat β’ πΊ(π) type β¦ π βΆ nat β’ π βΆ πΊ(π + 1) π βΆ nat β’ coe πΊ(β) (π, π) βΆ πΊ(1 + π) 1. is π equal to coe πΊ(β) (π, π) ? yes, up to a coercion 1 βequality reflectionβ just pushes the problem elsewhere and makes it worse! unlike many, I speak from experience. 4 / 32
ifg equality in type theory other equations may require explicit coercion. 1 consider a family π βΆ nat β’ πΊ(π) type β¦ π βΆ nat β’ π βΆ πΊ(π + 1) π βΆ nat β’ coe πΊ(β) (π, π) βΆ πΊ(1 + π) 1. is π equal to coe πΊ(β) (π, π) ? yes, up to a coercion 2. is coe πΊ(β) (π, π) equal to coe πΊ(β) (π , π) ? maybe 1 βequality reflectionβ just pushes the problem elsewhere and makes it worse! unlike many, I speak from experience. 4 / 32
β’ hierarchy of closed / inductive universes of sets, props β’ heterogeneous equality type Eq (π βΆ π΅, π βΆ πΆ) defined as generic program , by recursion on type codes π΅, πΆ Eq (πΊ 0 βΆ π΅ 0 β πΆ 0 , πΊ 1 βΆ π΅ 1 β πΆ 1 ) = π¦ βΆ Eq (π¦ 0 βΆ π΅ 0 , π¦ 1 βΆ π΅ 1 )) (funext) (π¦ 0 βΆ π΅ 0 )(π¦ 1 βΆ π΅ 1 )(Μ β Eq (πΊ 0 (π¦ 0 ) βΆ πΆ 0 , πΊ 1 (π¦ 1 ) βΆ πΆ 1 ) β’ judgmental UIP (proof irrelevance): always have π = π βΆ Eq (π 0 βΆ π΅ 0 , π 1 βΆ π΅ 1 ) β’ many primitives: reflexivity, respect, coercion, coherence, heterogeneous irrelevance (see Altenkirch, McBride, and Swierstra [AMS07]) Altenkirch, McBride, and Swierstra [AMS07]. βObservational Equality, Now!β Observational Type Theory Altenkirch and McBride [AM06]. Towards Observational Type Theory . 5 / 32
β’ heterogeneous equality type Eq (π βΆ π΅, π βΆ πΆ) defined as generic program , by recursion on type codes π΅, πΆ Eq (πΊ 0 βΆ π΅ 0 β πΆ 0 , πΊ 1 βΆ π΅ 1 β πΆ 1 ) = π¦ βΆ Eq (π¦ 0 βΆ π΅ 0 , π¦ 1 βΆ π΅ 1 )) (funext) (π¦ 0 βΆ π΅ 0 )(π¦ 1 βΆ π΅ 1 )(Μ β Eq (πΊ 0 (π¦ 0 ) βΆ πΆ 0 , πΊ 1 (π¦ 1 ) βΆ πΆ 1 ) β’ judgmental UIP (proof irrelevance): always have π = π βΆ Eq (π 0 βΆ π΅ 0 , π 1 βΆ π΅ 1 ) β’ many primitives: reflexivity, respect, coercion, coherence, heterogeneous irrelevance (see Altenkirch, McBride, and Swierstra [AMS07]) Altenkirch, McBride, and Swierstra [AMS07]. βObservational Equality, Now!β Observational Type Theory Altenkirch and McBride [AM06]. Towards Observational Type Theory . β’ hierarchy of closed / inductive universes of sets, props 5 / 32
β’ judgmental UIP (proof irrelevance): always have π = π βΆ Eq (π 0 βΆ π΅ 0 , π 1 βΆ π΅ 1 ) β’ many primitives: reflexivity, respect, coercion, coherence, heterogeneous irrelevance (see Altenkirch, McBride, and Swierstra [AMS07]) Altenkirch, McBride, and Swierstra [AMS07]. βObservational Equality, Now!β Observational Type Theory Altenkirch and McBride [AM06]. Towards Observational Type Theory . β’ hierarchy of closed / inductive universes of sets, props β’ heterogeneous equality type Eq (π βΆ π΅, π βΆ πΆ) defined as generic program , by recursion on type codes π΅, πΆ Eq (πΊ 0 βΆ π΅ 0 β πΆ 0 , πΊ 1 βΆ π΅ 1 β πΆ 1 ) = π¦ βΆ Eq (π¦ 0 βΆ π΅ 0 , π¦ 1 βΆ π΅ 1 )) (funext) (π¦ 0 βΆ π΅ 0 )(π¦ 1 βΆ π΅ 1 )(Μ β Eq (πΊ 0 (π¦ 0 ) βΆ πΆ 0 , πΊ 1 (π¦ 1 ) βΆ πΆ 1 ) 5 / 32
β’ many primitives: reflexivity, respect, coercion, coherence, heterogeneous irrelevance (see Altenkirch, McBride, and Swierstra [AMS07]) Altenkirch, McBride, and Swierstra [AMS07]. βObservational Equality, Now!β Observational Type Theory Altenkirch and McBride [AM06]. Towards Observational Type Theory . β’ hierarchy of closed / inductive universes of sets, props β’ heterogeneous equality type Eq (π βΆ π΅, π βΆ πΆ) defined as generic program , by recursion on type codes π΅, πΆ Eq (πΊ 0 βΆ π΅ 0 β πΆ 0 , πΊ 1 βΆ π΅ 1 β πΆ 1 ) = π¦ βΆ Eq (π¦ 0 βΆ π΅ 0 , π¦ 1 βΆ π΅ 1 )) (funext) (π¦ 0 βΆ π΅ 0 )(π¦ 1 βΆ π΅ 1 )(Μ β Eq (πΊ 0 (π¦ 0 ) βΆ πΆ 0 , πΊ 1 (π¦ 1 ) βΆ πΆ 1 ) β’ judgmental UIP (proof irrelevance): always have π = π βΆ Eq (π 0 βΆ π΅ 0 , π 1 βΆ π΅ 1 ) 5 / 32
Altenkirch, McBride, and Swierstra [AMS07]. βObservational Equality, Now!β Observational Type Theory Altenkirch and McBride [AM06]. Towards Observational Type Theory . β’ hierarchy of closed / inductive universes of sets, props β’ heterogeneous equality type Eq (π βΆ π΅, π βΆ πΆ) defined as generic program , by recursion on type codes π΅, πΆ Eq (πΊ 0 βΆ π΅ 0 β πΆ 0 , πΊ 1 βΆ π΅ 1 β πΆ 1 ) = π¦ βΆ Eq (π¦ 0 βΆ π΅ 0 , π¦ 1 βΆ π΅ 1 )) (funext) (π¦ 0 βΆ π΅ 0 )(π¦ 1 βΆ π΅ 1 )(Μ β Eq (πΊ 0 (π¦ 0 ) βΆ πΆ 0 , πΊ 1 (π¦ 1 ) βΆ πΆ 1 ) β’ judgmental UIP (proof irrelevance): always have π = π βΆ Eq (π 0 βΆ π΅ 0 , π 1 βΆ π΅ 1 ) β’ many primitives: reflexivity, respect, coercion, coherence, heterogeneous irrelevance (see Altenkirch, McBride, and Swierstra [AMS07]) 5 / 32
cubical reconstruction: XTT goal: find smaller set of primitives which systematically generate (something in the spirit of) OTT idea: start with Cartesian cubical type theory [ABCFHL], restrict to Bishop sets Γ la Coquand [Coq17] the XTT paper Sterling, Angiuli, and Gratzer [SAG19]. βCubical Syntax for Reflection-Free Extensional Equalityβ. Formal Structures for Computation and Deduction (FSCD 2019). 6 / 32
Recommend
More recommend