From 9723fc3ffc55b22a2a8ec09cbba80f14c40d7991 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Wed, 11 Jul 2018 19:37:07 +0200 Subject: Universes implemented. Type rules modified accordingly. No more automatic derivation of "A:U" from "a:A". --- HoTT_Base.thy | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'HoTT_Base.thy') diff --git a/HoTT_Base.thy b/HoTT_Base.thy index 610e5d8..703f1aa 100644 --- a/HoTT_Base.thy +++ b/HoTT_Base.thy @@ -30,21 +30,12 @@ named_theorems comp section \Judgments\ -text "Formalize the basic judgments. +text "Formalize the context and typing judgments \a : A\. -For judgmental equality we use the existing Pure equality \\\ and hence do not need to define a separate judgment for it. - -The judgment \is_a_type A\ expresses the statement ``A is an inhabitant of some universe type'', i.e. ``A is a type''." +For judgmental equality we use the existing Pure equality \\\ and hence do not need to define a separate judgment for it." consts - is_of_type :: "[Term, Term] \ prop" ("(1_ : _)" [0, 1000] 1000) - is_a_type :: "Term \ prop" ("(1_ : U)" [0] 1000) - - -text "The following fact is used to make explicit the assumption of well-formed contexts." - -axiomatization where - inhabited_implies_type [intro, elim, wellform]: "\a A. a : A \ A : U" + is_of_type :: "[Term, Term] \ prop" ("(1_ : _)" [0, 0] 1000) section \Universes\ @@ -62,31 +53,29 @@ where and Numeral_lt_trans: "\m n. m <- n \ S m <- S n" -\ \This lets \standard\ prove ordering statements on Numerals.\ -lemmas Numeral_lt_rules [intro] = Numeral_lt_min Numeral_lt_trans +lemmas Numeral_rules [intro] = Numeral_lt_min Numeral_lt_trans + \ \Lets \standard\ automatically solve inequalities.\ text "Universe types:" axiomatization - U :: "Numeral \ Term" ("U_") + U :: "Numeral \ Term" ("U _") where Universe_hierarchy: "\i j. i <- j \ U(i) : U(j)" and - Universe_cumulative: "\a i j. \a : U(i); i <- j\ \ a : U(j)" - -lemmas Universe_rules [intro] = Universe_hierarchy Universe_cumulative + Universe_cumulative: "\A i j. \A : U(i); i <- j\ \ A : U(j)" section \Type families\ -text "A (one-variable) type family is a meta lambda term \P :: Term \ Term\ that further satisfies the following property." +text "We define the following abbreviation constraining the output type of a meta lambda expression when given input of certain type." -type_synonym Typefam = "Term \ Term" +abbreviation (input) constrained :: "[Term \ Term, Term, Term] \ prop" ("_: _ \ _") + where "f: A \ B \ (\x. x : A \ f x : B)" -abbreviation (input) is_type_family :: "[Typefam, Term] \ prop" ("(3_:/ _ \ U)") - where "P: A \ U \ (\x. x : A \ P x : U)" +text "The above is used to define type families, which are just constrained meta-lambdas \P: A \ B\ where \A\ and \B\ are elements of some universe type." -\ \There is an obvious generalization to multivariate type families, but implementing such an abbreviation would probably involve writing ML code, and is for the moment not really crucial.\ +type_synonym Typefam = "Term \ Term" end \ No newline at end of file -- cgit v1.2.3