From ae909b21905be847a2ce01388e34708c9d0246c0 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sun, 19 Aug 2018 17:29:25 +0200 Subject: Trying to atomize universal quantification --- Prod.thy | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index b0408b9..3b74531 100644 --- a/Prod.thy +++ b/Prod.thy @@ -81,4 +81,13 @@ syntax "_COMPOSE" :: "[Term, Term] \ Term" (infixr "\" 70) translations "g \ f" \ "g o f" +section \Atomization\ + +text " + Universal statements can be internalized within the theory; the following rule is admissible. +" (* PROOF NEEDED *) + +axiomatization where Prod_atomize: "(\<^bold>\x. b(x): \x:A. B(x)) \ (\x. x: A \ b(x): B(x))" + + end -- cgit v1.2.3 From ea0c0c5427888982adce10ab25cebe445997f08b Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 17 Sep 2018 13:13:08 +0200 Subject: Moved function composition lemmas into Prod.thy --- Prod.thy | 102 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index a3cc347..db18454 100644 --- a/Prod.thy +++ b/Prod.thy @@ -1,89 +1,89 @@ -(* Title: HoTT/Prod.thy - Author: Josh Chen +(* +Title: Prod.thy +Author: Joshua Chen +Date: 2018 -Dependent product (function) type +Dependent product type *) theory Prod - imports HoTT_Base +imports HoTT_Base HoTT_Methods + begin -section \Constants and syntax\ +section \Basic definitions\ axiomatization - Prod :: "[t, tf] \ t" and + Prod :: "[t, tf] \ t" and lambda :: "(t \ t) \ t" (binder "\<^bold>\" 30) and - appl :: "[t, t] \ t" (infixl "`" 60) - \ \Application binds tighter than abstraction.\ + appl :: "[t, t] \ t" ("(1_`/_)" [60, 61] 60) \ \Application binds tighter than abstraction.\ syntax - "_PROD" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 30) - "_PROD_ASCII" :: "[idt, t, t] \ t" ("(3PROD _:_./ _)" 30) + "_prod" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 30) + "_prod_ascii" :: "[idt, t, t] \ t" ("(3II _:_./ _)" 30) -text "The translations below bind the variable \x\ in the expressions \B\ and \b\." +text \The translations below bind the variable @{term x} in the expressions @{term B} and @{term b}.\ translations "\x:A. B" \ "CONST Prod A (\x. B)" - "PROD x:A. B" \ "CONST Prod A (\x. B)" + "II x:A. B" \ "CONST Prod A (\x. B)" -text "Nondependent functions are a special case." +text \Non-dependent functions are a special case.\ -abbreviation Function :: "[t, t] \ t" (infixr "\" 40) +abbreviation Fun :: "[t, t] \ t" (infixr "\" 40) where "A \ B \ \_: A. B" +axiomatization where +\ \Type rules\ -section \Type rules\ + Prod_form: "\A: U i; B: A \ U i\ \ \x:A. B x: U i" and -axiomatization where - Prod_form: "\A: U i; B: A \ U i\ \ \x:A. B x: U i" -and - Prod_intro: "\\x. x: A \ b x: B x; A: U i\ \ \<^bold>\x. b x: \x:A. B x" -and - Prod_elim: "\f: \x:A. B x; a: A\ \ f`a: B a" -and - Prod_appl: "\\x. x: A \ b x: B x; a: A\ \ (\<^bold>\x. b x)`a \ b a" -and - Prod_uniq: "f : \x:A. B x \ \<^bold>\x. (f`x) \ f" -and - Prod_eq: "\\x. x: A \ b x \ c x; A: U i\ \ \<^bold>\x. b x \ \<^bold>\x. c x" - -text " - The Pure rules for \\\ only let us judge strict syntactic equality of object lambda expressions; Prod_eq is the actual definitional equality rule. - - Note that the syntax \\<^bold>\\ (bold lambda) used for dependent functions clashes with the proof term syntax (cf. \
2.5.2 of the Isabelle/Isar Implementation). -" - -text " - In addition to the usual type rules, it is a meta-theorem that whenever \\x:A. B x: U i\ is derivable from some set of premises \, then so are \A: U i\ and \B: A \ U i\. - - That is to say, the following inference rules are admissible, and it simplifies proofs greatly to axiomatize them directly. -" + Prod_intro: "\\x. x: A \ b x: B x; A: U i\ \ \<^bold>\x. b x: \x:A. B x" and -axiomatization where - Prod_wellform1: "(\x:A. B x: U i) \ A: U i" -and - Prod_wellform2: "(\x:A. B x: U i) \ B: A \ U i" + Prod_elim: "\f: \x:A. B x; a: A\ \ f`a: B a" and + + Prod_comp: "\\x. x: A \ b x: B x; a: A\ \ (\<^bold>\x. b x)`a \ b a" and + + Prod_uniq: "f: \x:A. B x \ \<^bold>\x. f`x \ f" and +\ \Congruence rules\ -text "Rule attribute declarations---set up various methods to use the type rules." + Prod_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" and + + Prod_intro_eq: "\\x. x: A \ b x \ c x; A: U i\ \ \<^bold>\x. b x \ \<^bold>\x. c x" + +text \ +The Pure rules for \\\ only let us judge strict syntactic equality of object lambda expressions. +The actual definitional equality rule is @{thm Prod_intro_eq}. +Note that this is a separate rule from function extensionality. + +Note that the bold lambda symbol \\<^bold>\\ used for dependent functions clashes with the proof term syntax (cf. \
2.5.2 of the Isabelle/Isar Implementation). +\ -lemmas Prod_comp [comp] = Prod_appl Prod_uniq -lemmas Prod_wellform [wellform] = Prod_wellform1 Prod_wellform2 lemmas Prod_routine [intro] = Prod_form Prod_intro Prod_elim +lemmas Prod_comps [comp] = Prod_comp Prod_uniq -section \Function composition\ +section \Additional definitions\ definition compose :: "[t, t] \ t" (infixr "o" 110) where "g o f \ \<^bold>\x. g`(f`x)" - -syntax "_COMPOSE" :: "[t, t] \ t" (infixr "\" 110) +syntax "_compose" :: "[t, t] \ t" (infixr "\" 110) translations "g \ f" \ "g o f" +declare compose_def [comp] + +lemma compose_assoc: + assumes "A: U i" and "f: A \ B" "g: B \ C" "h: \x:C. D x" + shows "(h \ g) \ f \ h \ (g \ f)" +by (derive lems: assms Prod_intro_eq) -section \Polymorphic identity function\ +lemma compose_comp: + assumes "A: U i" and "\x. x: A \ b x: B" and "\x. x: B \ c x: C x" + shows "(\<^bold>\x. c x) \ (\<^bold>\x. b x) \ \<^bold>\x. c (b x)" +by (derive lems: assms Prod_intro_eq) -abbreviation id :: t where "id \ \<^bold>\x. x" +abbreviation id :: t where "id \ \<^bold>\x. x" \ \Polymorphic identity function\ end -- cgit v1.2.3 From dcf87145a1059659099bbecde55973de0d36d43f Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Tue, 18 Sep 2018 03:04:37 +0200 Subject: Theories fully reorganized. Well-formedness rules removed. New methods etc. --- Prod.thy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index db18454..4aa7119 100644 --- a/Prod.thy +++ b/Prod.thy @@ -17,7 +17,7 @@ section \Basic definitions\ axiomatization Prod :: "[t, tf] \ t" and lambda :: "(t \ t) \ t" (binder "\<^bold>\" 30) and - appl :: "[t, t] \ t" ("(1_`/_)" [60, 61] 60) \ \Application binds tighter than abstraction.\ + appl :: "[t, t] \ t" ("(1_`/_)" [105, 106] 105) \ \Application binds tighter than abstraction.\ syntax "_prod" :: "[idt, t, t] \ t" ("(3\_:_./ _)" 30) @@ -43,7 +43,7 @@ axiomatization where Prod_elim: "\f: \x:A. B x; a: A\ \ f`a: B a" and - Prod_comp: "\\x. x: A \ b x: B x; a: A\ \ (\<^bold>\x. b x)`a \ b a" and + Prod_comp: "\a: A; \x. x: A \ b x: B x\ \ (\<^bold>\x. b x)`a \ b a" and Prod_uniq: "f: \x:A. B x \ \<^bold>\x. f`x \ f" and @@ -68,6 +68,7 @@ lemmas Prod_comps [comp] = Prod_comp Prod_uniq section \Additional definitions\ definition compose :: "[t, t] \ t" (infixr "o" 110) where "g o f \ \<^bold>\x. g`(f`x)" + syntax "_compose" :: "[t, t] \ t" (infixr "\" 110) translations "g \ f" \ "g o f" -- cgit v1.2.3 From 6857e783fa5cb91f058be322a18fb9ea583f2aad Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Tue, 18 Sep 2018 11:38:54 +0200 Subject: Overhaul of the theory presentations. New methods in HoTT_Methods.thy for handling universes. Commit for release 0.1.0! --- Prod.thy | 1 + 1 file changed, 1 insertion(+) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index 4aa7119..f90ee9c 100644 --- a/Prod.thy +++ b/Prod.thy @@ -61,6 +61,7 @@ Note that this is a separate rule from function extensionality. Note that the bold lambda symbol \\<^bold>\\ used for dependent functions clashes with the proof term syntax (cf. \
2.5.2 of the Isabelle/Isar Implementation). \ +lemmas Prod_form [form] lemmas Prod_routine [intro] = Prod_form Prod_intro Prod_elim lemmas Prod_comps [comp] = Prod_comp Prod_uniq -- cgit v1.2.3