From 76b57317d7568f4dcd673b1b8085601c6c723355 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 11 Feb 2019 22:44:21 +0100 Subject: Organize this commit as a backup of the work on type inference done so far; learnt that I probably need to take a different approach. In particular, should first make the constants completely monomorphic, and then work on full proper type inference, rather than the heuristic approach taken here. --- Sum.thy | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'Sum.thy') diff --git a/Sum.thy b/Sum.thy index 2646c97..9549a5e 100644 --- a/Sum.thy +++ b/Sum.thy @@ -1,59 +1,56 @@ -(* -Title: Sum.thy -Author: Joshua Chen -Date: 2018 +(******** +Isabelle/HoTT: Dependent sum (dependent pair) +Feb 2019 -Dependent sum type -*) +********) theory Sum imports HoTT_Base begin - axiomatization - Sum :: "[t, tf] \ t" and + Sum :: "[t, t \ t] \ t" and pair :: "[t, t] \ t" ("(1<_,/ _>)") and - indSum :: "[[t, t] \ t, t] \ t" ("(1ind\<^sub>\)") + indSum :: "[t \ t, [t, t] \ t, t] \ t" syntax - "_sum" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 20) - "_sum_ascii" :: "[idt, t, t] \ t" ("(3SUM _:_./ _)" 20) - + "_Sum" :: "[idt, t, t] \ t" ("(3\'(_: _')./ _)" 20) + "_Sum'" :: "[idt, t, t] \ t" ("(3\_: _./ _)" 20) translations - "\x:A. B" \ "CONST Sum A (\x. B)" - "SUM x:A. B" \ "CONST Sum A (\x. B)" + "\(x: A). B" \ "CONST Sum A (\x. B)" + "\x: A. B" \ "CONST Sum A (\x. B)" abbreviation Pair :: "[t, t] \ t" (infixr "\" 50) - where "A \ B \ \_:A. B" + where "A \ B \ \_: A. B" axiomatization where \ \Type rules\ - Sum_form: "\A: U i; B: A \ U i\ \ \x:A. B x: U i" and + Sum_form: "\A: U i; \x. x: A \ B x: 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_intro: "\\x. x: A \ B x: U i; a: A; b: B a\ \ : \x: A. B x" and Sum_elim: "\ - p: \x:A. B x; - C: \x:A. B x \ U i; - \x y. \x: A; y: B x\ \ f x y: C \ \ ind\<^sub>\ f p: C p" and + p: \x: A. B x; + C: \x: A. B x \ U i; + \x y. \x: A; y: B x\ \ f x y: C \ \ indSum C f p: C p" and - Sum_comp: "\ + Sum_cmp: "\ a: A; b: B a; - B: A \ U i; - C: \x:A. B x \ U i; - \x y. \x: A; y: B(x)\ \ f x y: C \ \ ind\<^sub>\ f \ f a b" and + B: A \ U i; + C: \x: A. B x \ U i; + \x y. \x: A; y: B x\ \ f x y: C \ \ indSum C f \ f a b" and \ \Congruence rules\ - 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" + 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_form [form] lemmas Sum_routine [intro] = Sum_form Sum_intro Sum_elim -lemmas Sum_comp [comp] - +lemmas Sum_comp [comp] = Sum_cmp +lemmas Sum_cong [cong] = Sum_form_eq end -- cgit v1.2.3