From 593faab277de53cbe2cb0c2feca5de307d9334ac Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sat, 9 Jun 2018 00:11:39 +0200 Subject: Reorganize code --- HoTT_Base.thy | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 HoTT_Base.thy (limited to 'HoTT_Base.thy') diff --git a/HoTT_Base.thy b/HoTT_Base.thy new file mode 100644 index 0000000..9650c4c --- /dev/null +++ b/HoTT_Base.thy @@ -0,0 +1,52 @@ +(* Title: HoTT/HoTT_Base.thy + Author: Josh Chen + +Basic setup and definitions of a homotopy type theory object logic. +*) + +theory HoTT_Base + imports Pure + +begin + +section \Basic definitions\ + +text "A single meta-level type \Term\ suffices to implement the object-level types and terms. +We do not implement universes, but simply follow the informal notation in the HoTT book." + +typedecl Term + +section \Judgments\ + +consts +is_a_type :: "Term \ prop" ("(_ : U)" [0] 1000) +is_of_type :: "[Term, Term] \ prop" ("(3_ :/ _)" [0, 0] 1000) + + +section \Definitional equality\ + +text "We use the Pure equality \\\ for definitional/judgmental equality of types and terms in our theory." + +theorem equal_types: + assumes "A \ B" and "A : U" + shows "B : U" using assms by simp + +theorem equal_type_element: + assumes "A \ B" and "x : A" + shows "x : B" using assms by simp + +lemmas type_equality [intro, simp] = + equal_types + equal_types[rotated] + equal_type_element + equal_type_element[rotated] + + +section \Type families\ + +text "A type family is a meta lambda term \P :: Term \ Term\ that further satisfies the following property." + +abbreviation is_type_family :: "[Term \ Term, Term] \ prop" ("(3_:/ _ \ U)") + where "P: A \ U \ (\x. x : A \ P(x) : U)" + +end \ No newline at end of file -- cgit v1.2.3