objective metatheory of cubical type theory
play

Objective Metatheory of (Cubical) Type Theory Jonathan Sterling - PowerPoint PPT Presentation

Objective Metatheory of (Cubical) Type Theory Jonathan Sterling August 31, 2020 The implementation and semantics of dependent type theories can be studied in a syntax-independent way. Using the semantic techniques of the objective metatheory ,


  1. New computations! :-) Cubical type theory extends MLTT with new generic functions r , s : I A : I → U φ : F f : � � p :( i = I r ) ∨ φ A ( i ) i : I ( f ) : { ˜ f s : A ( s ) | ∀ p .˜ f s = f ( s , p ) } com r � s A C oercion/transport, symmetry, and transitivity are all special cases of com A . Resulting theory of equality much easier to use than ITT+J!

  2. New computations! :-( New computation rules branch on non-equality of r , s as well as the the value of A ( i ) for a fresh dimension i : I .

  3. New computations! :-( New computation rules branch on non-equality of r , s as well as the the value of A ( i ) for a fresh dimension i : I . ◮ Neither M val nor M �→ ∗ N closed under substitution!

  4. New computations! :-( New computation rules branch on non-equality of r , s as well as the the value of A ( i ) for a fresh dimension i : I . ◮ Neither M val nor M �→ ∗ N closed under substitution! ◮ Classic head expansion principle for operational model doesn’t make sense, needs to be generalized significantly.

  5. New computations! :-( New computation rules branch on non-equality of r , s as well as the the value of A ( i ) for a fresh dimension i : I . ◮ Neither M val nor M �→ ∗ N closed under substitution! ◮ Classic head expansion principle for operational model doesn’t make sense, needs to be generalized significantly. ⇒ Operational metatheory very hard: possible, with great = exertion, using coherent expansion principle contributed independently by Angiuli [Ang19] and Huber [Hub18].

  6. New computations! :-( New computation rules branch on non-equality of r , s as well as the the value of A ( i ) for a fresh dimension i : I . ◮ Neither M val nor M �→ ∗ N closed under substitution! ◮ Classic head expansion principle for operational model doesn’t make sense, needs to be generalized significantly. ⇒ Operational metatheory very hard: possible, with great = exertion, using coherent expansion principle contributed independently by Angiuli [Ang19] and Huber [Hub18]. Canonicity at the limits of operational tractability: normalization will require new techniques (this thesis!).

  7. New computations! (-: Simpler alternative to operational semantics + PERs with coherent expansion: equational theory + Artin gluing , as proposed by Awodey in 2015. S., Angiuli, Gratzer (2019). “Cubical Syntax for Reflection-Free Extensional Equality.” FSCD 2019. S., Angiuli, and Gratzer [SAG19] present an easy and complete proof of canonicity for a version of cubical type theory in less than 30 pages. Trial run of the “objective metatheory.”

  8. What is the objective metatheory? objective metatheory = local invariance + global invariance + proof relevance.

  9. What is the objective metatheory? objective metatheory = local invariance + global invariance + proof relevance. 1. local invariance: ◮ raw syntax / op-sem = ⇒ typed syntax in equational LF ◮ work invariantly over equiv. classes of typed terms

  10. What is the objective metatheory? objective metatheory = local invariance + global invariance + proof relevance. 1. local invariance: ◮ raw syntax / op-sem = ⇒ typed syntax in equational LF ◮ work invariantly over equiv. classes of typed terms 2. global invariance: ◮ “objective syntax” defined only up to categorical equivalence ◮ all statements respect weak equivalence of categories: freedom to choose presentations at will

  11. What is the objective metatheory? objective metatheory = local invariance + global invariance + proof relevance. 1. local invariance: ◮ raw syntax / op-sem = ⇒ typed syntax in equational LF ◮ work invariantly over equiv. classes of typed terms 2. global invariance: ◮ “objective syntax” defined only up to categorical equivalence ◮ all statements respect weak equivalence of categories: freedom to choose presentations at will 3. proof relevance: ◮ “property of raw syntax” = ⇒ “structure over objective syntax” ◮ generalization proof-relevant logical relations is forced!

  12. Local invariance of objective syntax Syntax of type theory with function types expressed as an equational LF signature: 1 Tp : Kind Tm : Tp → Type Fn : Tp × Tp → Tp A , B : Tp Tm ( Fn ( A , B )) ∼ α Fn : � = ( Tm ( A ) → Tm ( B )) Above: introduction, elimination, computation, and uniqueness rules bundled in α Fn . Local invariance: impossible to utter a distinction between judgmentally equal terms. (Anti-bureaucratic power move!) 1 Equational LF due to Uemura [Uem19] with universes Type ⊆ Kind ; kinds closed under dependent products along types as in Harper, Honsell, and Plotkin [HHP93].

  13. Global invariance of objective syntax Tp : Kind Tm : Tp → Type Fn : Tp × Tp → Tp A , B : Tp Tm ( Fn ( A , B )) ∼ α Fn : � = ( Tm ( A ) → Tm ( B )) The signature Σ above involves a choice of LF encoding, but metatheorems don’t depend on how we set up the function type (which is uniquely determined up to iso). Global invariance: Σ presents a classifying category C Σ of judgments and deductions, which we work with up to weak equivalence of categories .

  14. Proof relevance in the objective metatheory Let’s remember how logical relations work...

  15. (Unary) logical relations on closed terms is: for each sort A sort Σ , a subset ˜ A ⊆ { a | · ⊢ Σ a : A } / ≡ Σ respecting all the operations of Σ .

  16. (Unary) logical relations on closed terms is: for each sort A : C Σ , a subset ˜ A ⊆ Hom C Σ ( · , A ) respecting all the operations of Σ .

  17. (Unary) logical relations on closed terms is: for each sort A : C Σ , a subset ˜ A ⊆ ρ ( A ) respecting all the operations of Σ , where ρ : C Σ Set is the global sections functor.

  18. (Unary) logical relations on closed terms is: for each sort A : C Σ , a subset ˜ A ⊆ ρ ( A ) respecting all the operations of Σ , where ρ : C Σ Set is the global sections functor. Elements a ∈ ˜ A are called computable .

  19. (Unary) logical relations on closed terms is: for each sort A : C Σ , a subset ˜ A ⊆ ρ ( A ) respecting all the operations of Σ , where ρ : C Σ Set is the global sections functor. Elements a ∈ ˜ A are called computable . Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing .

  20. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing .

  21. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing . A morphism ( B , ˜ ( A , ˜ A ) : G Σ is a term/deduction B ) A that preserves computability, i.e. sends closed a : B terms in ˜ B to closed terms in ˜ A .

  22. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing . A morphism ( B , ˜ ( A , ˜ A ) : G Σ is a term/deduction B ) A that preserves computability, i.e. sends closed a : B terms in ˜ B to closed terms in ˜ A . Thinking of subsets as injective functions: ˜ ˜ B A ρ ( B ) ρ ( A ) ρ ( a )

  23. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing .

  24. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing . G Σ Sub ( Set ) C Σ Set ρ

  25. Logical relations ( A , ˜ A ⊆ ρ ( A )) have the structure of a category G Σ defined by Artin gluing . G Σ Sub ( Set ) C Σ Set ρ Fundamental Theorem of Logical Relations: prove that G Σ is a model of the theory Σ !

  26. FTLR Idea: interpret each type into G Σ in such a way that an element carries the proof of the desired metatheorem, e.g. canonicity at base type: { yes , no } G Σ Sub ( Set ) G Σ � ans � C Σ ρ ( ans ) Set ρ Connectives that have β/η laws are uniquely determined! No need (or ability) to be clever.

  27. Proof-relevant logical relations! What is the logical relation for the collection of types Tp ? Ought to be a “relation of relations”, but that’s nonsense.

  28. Proof-relevant logical relations! What is the logical relation for the collection of types Tp ? Ought to be a “relation of relations”, but that’s nonsense. Old solution: parameterize in complex inductive definition, prove dozens of technical lemmas [All87]

  29. Proof-relevant logical relations! What is the logical relation for the collection of types Tp ? Ought to be a “relation of relations”, but that’s nonsense. Old solution: parameterize in complex inductive definition, prove dozens of technical lemmas [All87] New solution: generalize from property to structure 2 1 Application to universes due to Shulman [Shu15], developed further by Coquand [Coq19]; main ingredients invented by the Grothendieck school in the 1970s [AGV72].

  30. Proof-relevant logical relations! What is the logical relation for the collection of types Tp ? Ought to be a “relation of relations”, but that’s nonsense. Old solution: parameterize in complex inductive definition, prove dozens of technical lemmas [All87] New solution: generalize from property to structure 2 ??? G Σ Sub ( Set ) G Σ � Tp � C Σ ρ ( Tp ) Set ρ 1 Application to universes due to Shulman [Shu15], developed further by Coquand [Coq19]; main ingredients invented by the Grothendieck school in the 1970s [AGV72].

  31. Proof-relevant logical relations! What is the logical relation for the collection of types Tp ? Ought to be a “relation of relations”, but that’s nonsense. Old solution: parameterize in complex inductive definition, prove dozens of technical lemmas [All87] New solution: generalize from property to structure 2 � � G Σ Fam ( Set ) � ρ ( Tm )( A ) → Set small A : ρ ( Tp ) G Σ � Tp � C Σ ρ ( Tp ) Set ρ 1 Application to universes due to Shulman [Shu15], developed further by Coquand [Coq19]; main ingredients invented by the Grothendieck school in the 1970s [AGV72].

  32. Abstract Artin gluing: logical relations as types! Constructing the logical relation in G Σ over C Σ still very technical! Trivialized by “synthetic Tait computability” (STC). 3 3 Based on an idea of Shulman [Shu11], STC is an “Orton-Pitts method” [OP16] for syntactic metatheory [SG20; SH20].

  33. Abstract Artin gluing: logical relations as types! Constructing the logical relation in G Σ over C Σ still very technical! Trivialized by “synthetic Tait computability” (STC). 3 Idea: replace “A logical relation is given by ...” with “A logical relation can be used to...”. 3 Based on an idea of Shulman [Shu11], STC is an “Orton-Pitts method” [OP16] for syntactic metatheory [SG20; SH20].

  34. Abstract Artin gluing: logical relations as types! Constructing the logical relation in G Σ over C Σ still very technical! Trivialized by “synthetic Tait computability” (STC). 3 Idea: replace “A logical relation is given by ...” with “A logical relation can be used to...”. Result: a rich type theory whose types denote generalized logical relations. Syntax and semantics accessed via modalities à la Rijke, Shulman, and Spitters [RSS17]. 3 Based on an idea of Shulman [Shu11], STC is an “Orton-Pitts method” [OP16] for syntactic metatheory [SG20; SH20].

  35. Abstract Artin gluing: logical relations as types! Constructing the logical relation in G Σ over C Σ still very technical! Trivialized by “synthetic Tait computability” (STC). 3 Idea: replace “A logical relation is given by ...” with “A logical relation can be used to...”. Result: a rich type theory whose types denote generalized logical relations. Syntax and semantics accessed via modalities à la Rijke, Shulman, and Spitters [RSS17]. A ∼ “A synthetic logical relation” � A ∼ “The syntactic part of A ” (acts like a sort) � A ∼ “The semantic part of A ” (acts like a set) 3 Based on an idea of Shulman [Shu11], STC is an “Orton-Pitts method” [OP16] for syntactic metatheory [SG20; SH20].

  36. Synthetic Tait computability Extensional type theory STC with an open modality � A , and a complementary closed modality � A , both monadic. A ∼ “A synthetic logical relation” � A ∼ “The syntactic part of A ” (acts like a sort) � A ∼ “The semantic part of A ” (acts like a set)

  37. Synthetic Tait computability Extensional type theory STC with an open modality � A , and a complementary closed modality � A , both monadic. A ∼ “A synthetic logical relation” � A ∼ “The syntactic part of A ” (acts like a sort) � A ∼ “The semantic part of A ” (acts like a set) Facts/Axioms: 1. The syntactic part of the semantic part of a logical relation is trivial: �� A ∼ = 1 .

  38. Synthetic Tait computability Extensional type theory STC with an open modality � A , and a complementary closed modality � A , both monadic. A ∼ “A synthetic logical relation” � A ∼ “The syntactic part of A ” (acts like a sort) � A ∼ “The semantic part of A ” (acts like a set) Facts/Axioms: 1. The syntactic part of the semantic part of a logical relation is trivial: �� A ∼ = 1 . 2. A logical relation can be reconstructed from its syntactic and semantic parts [AGV72; RSS17].

  39. Synthetic Tait computability Extensional type theory STC with an open modality � A , and a complementary closed modality � A , both monadic. A ∼ “A synthetic logical relation” � A ∼ “The syntactic part of A ” (acts like a sort) � A ∼ “The semantic part of A ” (acts like a set) Facts/Axioms: 1. The syntactic part of the semantic part of a logical relation is trivial: �� A ∼ = 1 . 2. A logical relation can be reconstructed from its syntactic and semantic parts [AGV72; RSS17]. 3. A logical relation can be realigned to have different (but isomorphic) syntactic part [OP16].

  40. Idea: axiomatize a Σ -algebra A ◦ Σ in the � -modal fragment of STC , then construct a Σ -algebra A ∗ Σ in STC such that � ( A ∗ = A ◦ ) holds.

  41. Idea: axiomatize a Σ -algebra A ◦ Σ in the � -modal fragment of STC , then construct a Σ -algebra A ∗ Σ in STC such that � ( A ∗ = A ◦ ) holds. Examples: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � = � � ans ∗ ∼ b ◦ : Tm ◦ ( ans ◦ ) � { b • : 2 | b ◦ = if b • then yes ◦ else no ◦ } ans ◦ , � =

  42. Idea: axiomatize a Σ -algebra A ◦ Σ in the � -modal fragment of STC , then construct a Σ -algebra A ∗ Σ in STC such that � ( A ∗ = A ◦ ) holds. Examples: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � = � � ans ∗ ∼ b ◦ : Tm ◦ ( ans ◦ ) � { b • : 2 | b ◦ = if b • then yes ◦ else no ◦ } ans ◦ , � = Payoff: painful construction of (e.g.) dependent product in logical relations made trivial, because open modalities commute with dependent products. No more technical lemmas!

  43. Show � Tp ∗ ∼ = Tp ◦ .

  44. Show � Tp ∗ ∼ = Tp ◦ . � Tp ∗

  45. Show � Tp ∗ ∼ = Tp ◦ . A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � �

  46. Show � Tp ∗ ∼ = Tp ◦ . A ◦ : � Tp ◦ � { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } �

  47. Show � Tp ∗ ∼ = Tp ◦ . A ◦ : � Tp ◦ � { A ∗ : U | Tm ◦ ( A ◦ ) = A ∗ } �

  48. Show � Tp ∗ ∼ = Tp ◦ . � A ◦ : � Tp ◦ � 1

  49. Show � Tp ∗ ∼ = Tp ◦ . � A ◦ : � Tp ◦ 1

  50. Show � Tp ∗ ∼ = Tp ◦ . � Tp ◦

  51. Show � Tp ∗ ∼ = Tp ◦ . Tp ◦

  52. Show � Tp ∗ ∼ = Tp ◦ . Tp ◦

  53. Closure under dependent products. Construct Π ∗ : ( A : Tp ∗ , B : A → Tp ∗ ) → Tp ∗ with � Π ∗ ( A , B ) = Π ◦ ( A ◦ , λx . B ◦ ( x )) .

  54. Closure under dependent products. Fix A : Tp ∗ , B : A → Tp ∗ to construct Π ∗ ( A , B ) with syntactic part Π ◦ ( A ◦ , λx . B ◦ ( x )) .

  55. Closure under dependent products. Fix A : Tp ∗ , B : A → Tp ∗ to construct Π ∗ ( A , B ) with syntactic part Π ◦ ( A ◦ , λx . B ◦ ( x )) . Recall: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � =

  56. Closure under dependent products. Fix A : Tp ∗ , B : A → Tp ∗ to construct Π ∗ ( A , B ) with syntactic part Π ◦ ( A ◦ , λx . B ◦ ( x )) . Recall: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � = 1. Choose first component: Π ◦ ( A ◦ , λx . B ◦ ( x )) .

  57. Closure under dependent products. Fix A : Tp ∗ , B : A → Tp ∗ to construct Π ∗ ( A , B ) with syntactic part Π ◦ ( A ◦ , λx . B ◦ ( x )) . Recall: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � = 1. Choose first component: Π ◦ ( A ◦ , λx . B ◦ ( x )) . 2. Choose second component: ( x : Tm ∗ ( A )) → Tm ∗ ( B ( x )) .

  58. Closure under dependent products. Fix A : Tp ∗ , B : A → Tp ∗ to construct Π ∗ ( A , B ) with syntactic part Π ◦ ( A ◦ , λx . B ◦ ( x )) . Recall: Tp ∗ ∼ A ◦ : Tp ◦ { A ∗ : U | � ( Tm ◦ ( A ◦ ) = A ∗ ) } � = 1. Choose first component: Π ◦ ( A ◦ , λx . B ◦ ( x )) . 2. Choose second component: ( x : Tm ∗ ( A )) → Tm ∗ ( B ( x )) , realigned by the following isomorphism: � � ∼ = Tm ◦ ( Π ◦ ( A ◦ , B ◦ ( x ))) ( x : Tm ∗ ( A )) → Tm ∗ ( B ( x )) �

  59. � � ( x : Tm ∗ ( A )) → Tm ∗ ( B ( x )) �

  60. ( x : � Tm ∗ ( A )) → � Tm ∗ ( B ( x ))

  61. ( x : Tm ◦ ( A ◦ )) → Tm ◦ ( B ◦ ( x ))

  62. ( x : Tm ◦ ( A ◦ )) → Tm ◦ ( B ◦ ( x ))

  63. S. & Harper introduced STC to give a trivial proof of a non-trivial parametricity result for effectful ML modules: S., Harper (2020). “Logical Relations as Types: Proof-Relevant Parametricity for Program Mod- ules” . Under review. This thesis: use STC to prove normalization of Cartesian cubical type theory / TT � .

  64. Proposed work Prove normalization for Cartesian cubical type theory (TT � ).

  65. Proposed work Prove normalization for Cartesian cubical type theory (TT � ). 1. Construct a model of STC extended by the syntax of TT � and its normal forms.

  66. Proposed work Prove normalization for Cartesian cubical type theory (TT � ). 1. Construct a model of STC extended by the syntax of TT � and its normal forms. 2. Define a “computability Σ � -algebra” in STC such that each sort A exhibits Tait’s Yoga [Tai67]: reify A reflect A A Ne A Nf A ∗ η � η � A ∗ η � Nf A A Ne A ◦

  67. Proposed work Prove normalization for Cartesian cubical type theory (TT � ). 1. Construct a model of STC extended by the syntax of TT � and its normal forms. 2. Define a “computability Σ � -algebra” in STC such that each sort A exhibits Tait’s Yoga [Tai67]: reify A reflect A A Ne A Nf A ∗ η � η � A ∗ η � Nf A A Ne A ◦ 3. That does it! Next: actually construct the model.

  68. Renamings & unstable normal forms, geometrically Let C be the category of judgments and deductions.

  69. Renamings & unstable normal forms, geometrically Let C be the category of judgments and deductions. ◮ By Yoneda, have a space(*) � C of (generalized) judgments and substitution functions.

  70. Renamings & unstable normal forms, geometrically Let C be the category of judgments and deductions. ◮ By Yoneda, have a space(*) � C of (generalized) judgments and substitution functions. ◮ Likewise, have a space of (generalized) formal contexts and renaming functions � R lying over � C . Idea: Kripke logical relations varying in � � C . R

  71. Renamings & unstable normal forms, geometrically Let C be the category of judgments and deductions. ◮ By Yoneda, have a space(*) � C of (generalized) judgments and substitution functions. ◮ Likewise, have a space of (generalized) formal contexts and renaming functions � R lying over � C . Idea: Kripke logical relations varying in � C . � R ◮ � R has monoidal closed structure ( ⊗ , ⊸ ) to implement bunches of non-equal dimensions and fresh binders: neutral coe i � j ψ : I ⊗ I A : I ⊸ Ne M : Nf coe ψ A ( M ) : Ne

  72. Renamings & unstable normal forms, geometrically Let C be the category of judgments and deductions. ◮ By Yoneda, have a space(*) � C of (generalized) judgments and substitution functions. ◮ Likewise, have a space of (generalized) formal contexts and renaming functions � R lying over � C . Idea: Kripke logical relations varying in � C . � R ◮ � R has monoidal closed structure ( ⊗ , ⊸ ) to implement bunches of non-equal dimensions and fresh binders: neutral coe i � j ψ : I ⊗ I A : I ⊸ Ne M : Nf coe ψ A ( M ) : Ne Foreseen difficulties: What to do with the inconsistent context ( Γ , p : 0 = I 1 ) ?

  73. Kripke logical relations, geometrically

  74. Kripke logical relations, geometrically ◮ Sierpiński interval: S = { ∅ , { ◦ } , { ◦ , • }} is the interface of a family . ◮ open point ◦ = coordinate of the base/index ◮ closed point • = coordinate of the total space

  75. Kripke logical relations, geometrically ◮ Sierpiński interval: S = { ∅ , { ◦ } , { ◦ , • }} is the interface of a family . ◮ open point ◦ = coordinate of the base/index ◮ closed point • = coordinate of the total space ◮ Sierpiński cylinder: � R × S is the interface of families of generalized contexts and renamings .

  76. Kripke logical relations, geometrically ◮ Sierpiński interval: S = { ∅ , { ◦ } , { ◦ , • }} is the interface of a family . ◮ open point ◦ = coordinate of the base/index ◮ closed point • = coordinate of the total space ◮ Sierpiński cylinder: � R × S is the interface of families of generalized contexts and renamings . ◮ Sierpiński cone(*)/gluing: K = � R × S is the interface of R � C ⊔ � families of generalized contexts and renamings indexed in generalized judgments and substitutions, i.e. Kripke logical relations! � � R C � R × ◦ � R × S K

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend