Skip to content
Snippets Groups Projects
universes.mmt 1.64 KiB
Newer Older
  • Learn to ignore specific revisions
  • namespace latin:/❚
    
    fixmeta ur:?LF❚
    
    
    Florian Rabe's avatar
    Florian Rabe committed
    /T Universes as a soft typing relation (level) on types
       tp is now no longer the base universe -- instead, it is the union of all universes
       We define a universe to be any type that occurs on the left of the level relation.❚
    
    theory SoftUniverses =
      include ?TypedLogic❙
      level : tp ⟶ tp ⟶ prop❘ # 1 ⋳ 2 prec 30❙
      univTm: {A,U} ⊦A⋳U ⟶ tm U❙
    
    
    
    Florian Rabe's avatar
    Florian Rabe committed
    /T single universes of types and kinds❚
    
    theory TwoUniverses = 
      include ?SoftUniverses❙
      utp: tp❙
      ukd: tp❙
      utp_kd: ⊦ utp⋳ukd❙
    
    
    /T natural number-based hierarchy of universes❚
    theory UniverseHierarchy =
      include ?SoftUniverses❙
      univ: type❙
      univ_zero: univ❙
      univ_next: univ ⟶ univ❙
      
      univTp: univ ⟶ tp❙
      
      univ_in: {U} ⊦ univTp U ⋳ univTp (univ_next U)❙
      
      realize ?TwoUniverses❙
      utp = univTp univ_zero❙
      ukd = univTp (univ_next univ_zero)❙
      utp_kd = univ_in❙
    
    
    /T Universes as a soft element typing relation on types❚
    theory InclusiveUniverses =
      include ?UniverseHierarchy❙
      inclusive : {A,U} ⊦ A ⋳ univTp U ⟶ ⊦ A ⋳ univTp (univ_next U)❙
    
    
    theory UniverseDepFunExample =
      include ?SoftUniverses❙ 
      Pi_legal : tp ⟶ tp ⟶ type❙
      Pi     : {A} (tm A ⟶ tp) ⟶ tp❘ # Π 2 prec 50❙
      Pi_univ: {U,V,A,B}⊦ A⋳U ⟶ ({x:tm A} ⊦ B x ⋳ V) ⟶ Pi_legal U V ⟶ ⊦ Π B ⋳ V❙
      // lambda, apply, etc. as usual❙
      
      // LF as a λ-cube example❙
      include ?TwoUniverses❙
      function_types: Pi_legal utp utp❙
      dependent_types: Pi_legal utp ukd❙
    
    
    Florian Rabe's avatar
    Florian Rabe committed
    
    // TODO these universes should be realized by corresponding theories of set-theoretical universe❚