From 76ac8ed82317f3f62f26ecc88f412c61004bcffa Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 17 Sep 2018 13:13:55 +0200 Subject: Reorganizing theories --- Sum.thy | 57 +++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 34 deletions(-) (limited to 'Sum.thy') diff --git a/Sum.thy b/Sum.thy index 92375b9..422e01b 100644 --- a/Sum.thy +++ b/Sum.thy @@ -1,69 +1,58 @@ -(* Title: HoTT/Sum.thy - Author: Josh Chen +(* +Title: Sum.thy +Author: Joshua Chen +Date: 2018 Dependent sum type *) theory Sum - imports HoTT_Base -begin +imports HoTT_Base +begin -section \Constants and syntax\ axiomatization - Sum :: "[t, Typefam] \ t" and - pair :: "[t, t] \ t" ("(1<_,/ _>)") and + Sum :: "[t, tf] \ t" and + pair :: "[t, t] \ t" ("(1<_,/ _>)") and indSum :: "[[t, t] \ t, t] \ t" ("(1ind\<^sub>\)") syntax - "_SUM" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 20) - "_SUM_ASCII" :: "[idt, t, t] \ t" ("(3SUM _:_./ _)" 20) + "_sum" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 20) + "_sum_ascii" :: "[idt, t, t] \ t" ("(3SUM _:_./ _)" 20) translations "\x:A. B" \ "CONST Sum A (\x. B)" "SUM x:A. B" \ "CONST Sum A (\x. B)" -text "Nondependent pair." - abbreviation Pair :: "[t, t] \ t" (infixr "\" 50) where "A \ B \ \_:A. B" +axiomatization where +\ \Type rules\ -section \Type rules\ + Sum_form: "\A: U i; B: A \ U i\ \ \x:A. B x: U i" and + + Sum_intro: "\B: A \ U i; a: A; b: B a\ \ : \x:A. B x" and -axiomatization where - Sum_form: "\A: U i; B: A \ U i\ \ \x:A. B x: U i" -and - Sum_intro: "\B: A \ U i; a: A; b: B a\ \ : \x:A. B x" -and Sum_elim: "\ p: \x:A. B x; - \x y. \x: A; y: B x\ \ f x y: C ; - C: \x:A. B x \ U i - \ \ ind\<^sub>\ f p: C p" (* What does writing \x y. f(x, y) change? *) -and + C: \x:A. B x \ U i; + \x y. \x: A; y: B x\ \ f x y: C \ \ ind\<^sub>\ (\x y. f x y) p: C p" and + Sum_comp: "\ a: A; b: B a; - \x y. \x: A; y: B(x)\ \ f x y: C ; B: A \ U i; - C: \x:A. B x \ U i - \ \ ind\<^sub>\ f \ f a b" - -text "Admissible inference rules for sum formation:" - -axiomatization where - Sum_wellform1: "(\x:A. B x: U i) \ A: U i" -and - Sum_wellform2: "(\x:A. B x: U i) \ B: A \ U i" + C: \x:A. B x \ U i; + \x y. \x: A; y: B(x)\ \ f x y: C \ \ ind\<^sub>\ (\x y. f x y) \ f a b" and +\ \Congruence rules\ -text "Rule attribute declarations:" + Sum_form_eq: "\A: U i; B: A \ U i; C: A \ U i; \x. x: A \ B x \ C x\ \ \x:A. B x \ \x:A. C x" -lemmas Sum_comp [comp] -lemmas Sum_wellform [wellform] = Sum_wellform1 Sum_wellform2 lemmas Sum_routine [intro] = Sum_form Sum_intro Sum_elim +lemmas Sum_comp [comp] end -- cgit v1.2.3