cubical syntax for reflection free extensional equality
play

Cubical Syntax for Reflection-Free Extensional Equality Jonathan - PowerPoint PPT Presentation

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:


  1. 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

  2. 𝑦 ∢ 𝐡 ⊒ 𝐢(𝑦) 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

  3. 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

  4. 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

  5. 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

  6. 𝑦 ∢ 𝐡 ⊒ 𝑁(𝑦) ∢ 𝐢(𝑦) 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

  7. 𝑦 ∢ 𝐡 Γ— 𝐢 ⊒ 𝑁 ∢ 𝐺(𝑦) ifg 𝑦 ∢ 𝐡 Γ— 𝐢 ⊒ 𝑁 ∢ 𝐺(βŸ¨π‘¦.1, 𝑦.2⟩) equality in type theory what equations can be made automatic? surely 𝛽/πœ€/𝛾 , and type theorists also know how to automate πœƒ/𝜊/πœ‰/ … 3 / 32

  8. 𝑦 ∢ 𝐡 Γ— 𝐢 ⊒ 𝑁 ∢ 𝐺(𝑦) ifg 𝑦 ∢ 𝐡 Γ— 𝐢 ⊒ 𝑁 ∢ 𝐺(βŸ¨π‘¦.1, 𝑦.2⟩) equality in type theory what equations can be made automatic? surely 𝛽/πœ€/𝛾 , and type theorists also know how to automate πœƒ/𝜊/πœ‰/ … 3 / 32

  9. 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

  10. 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

  11. 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

  12. 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

  13. 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

  14. β€’ 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

  15. β€’ 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

  16. β€’ 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

  17. β€’ 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

  18. 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

  19. 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