From 6389f18fd17e4333aba3fcdcc9ed2810d4cb1da5 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 9 Jul 2018 11:17:50 +0200 Subject: Pre-universe implementation commit --- HoTT_Base.thy | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'HoTT_Base.thy') diff --git a/HoTT_Base.thy b/HoTT_Base.thy index 60e5167..d119c1f 100644 --- a/HoTT_Base.thy +++ b/HoTT_Base.thy @@ -10,7 +10,7 @@ theory HoTT_Base begin -section \Setup\ +section \Named theorems\ text "Named theorems to be used by proof methods later (see HoTT_Methods.thy). @@ -21,7 +21,7 @@ named_theorems wellform named_theorems comp -section \Metalogical definitions\ +section \Foundational definitions\ text "A single meta-type \Term\ suffices to implement the object-logic types and terms. We do not implement universes, and simply use \a : U\ as a convenient shorthand to mean ``\a\ is a type''." @@ -29,6 +29,27 @@ We do not implement universes, and simply use \a : U\ as a convenie typedecl Term +section \Universes\ + +ML \ +(* Produces universe terms and judgments on-the-fly *) +fun Ui_type_oracle (x: int) = + let + val f = Sign.declare_const @{context} ((Binding.name ("U" ^ Int.toString x), @{typ Term}), NoSyn); + val (trm, thy) = f @{theory}; + in + Theory.setup (fn thy => #2 (f thy)); + Thm.cterm_of (Proof_Context.init_global thy) (trm) + end +\ + +(* +Sign.add_consts: (binding * typ * mixfix) list -> theory -> theory +Thm.cterm_of: Proof.context -> term -> cterm +Thm.add_oracle: binding * (’a -> cterm) -> theory -> (string * (’a -> thm)) * theory +*) + + section \Judgments\ text "We formalize the judgments \a : A\ and \A : U\ separately, in contrast to the HoTT book where the latter is considered an instance of the former. -- cgit v1.2.3