From f07e0e2349a222130209ada9c029eea3d1fe8144 Mon Sep 17 00:00:00 2001 From: Lars Hupel Date: Tue, 18 Sep 2018 16:52:08 +0200 Subject: add ROOT file --- EqualProps.thy | 1 - ROOT | 10 ++++++++++ ex/Book/Ch1.thy | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ ex/HoTT book/Ch1.thy | 50 -------------------------------------------------- 4 files changed, 60 insertions(+), 51 deletions(-) create mode 100644 ROOT create mode 100644 ex/Book/Ch1.thy delete mode 100644 ex/HoTT book/Ch1.thy diff --git a/EqualProps.thy b/EqualProps.thy index abb2623..f7a8d91 100644 --- a/EqualProps.thy +++ b/EqualProps.thy @@ -117,7 +117,6 @@ proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) fix x assume "x: A" show "refl (q \ r): (refl x) \ (q \ r) =[x =\<^sub>A w] ((refl x) \ q) \ r" \ \This requires substitution of *propositional* equality. \ - sorry oops diff --git a/ROOT b/ROOT new file mode 100644 index 0000000..7e76f86 --- /dev/null +++ b/ROOT @@ -0,0 +1,10 @@ +session HoTT = Pure + + sessions + "HOL-Eisbach" + theories + HoTT_Base + HoTT + "tests/Test" + "ex/Methods" + "ex/Synthesis" + "ex/Book/Ch1" \ No newline at end of file diff --git a/ex/Book/Ch1.thy b/ex/Book/Ch1.thy new file mode 100644 index 0000000..dfb1879 --- /dev/null +++ b/ex/Book/Ch1.thy @@ -0,0 +1,50 @@ +(* +Title: ex/Book/Ch1.thy +Author: Josh Chen +Date: 2018 + +A formalization of some content of Chapter 1 of the Homotopy Type Theory book. +*) + +theory Ch1 +imports "../../HoTT" + +begin + +chapter \HoTT Book, Chapter 1\ + +section \1.6 Dependent pair types (\-types)\ + +paragraph \Propositional uniqueness principle.\ + +schematic_goal + assumes "A: U i" and "B: A \ U i" and "p: \x:A. B x" + shows "?a: p =[\x:A. B x] " + +text \Proof by induction on @{term "p: \x:A. B x"}:\ + +proof (rule Sum_elim[where ?p=p]) + text \We prove the base case.\ + fix x y assume asm: "x: A" "y: B x" show "refl : =[\x:A. B x] , snd >" + proof compute + show "x: A" and "y: B x" by (fact asm)+ \ \Hint the correct types.\ + + text \And now @{method derive} takes care of the rest. +\ + qed (derive lems: assms asm) +qed (derive lems: assms) + + +section \Exercises\ + +paragraph \Exercise 1.13\ + +abbreviation "not" ("\_") where "\A \ A \ \" + +text "This proof requires the use of universe cumulativity." + +proposition assumes "A: U i" shows "\<^bold>\f. f`(inr(\<^bold>\a. f`(inl a))): \(\(A + \A))" +by (derive lems: assms) + + +end diff --git a/ex/HoTT book/Ch1.thy b/ex/HoTT book/Ch1.thy deleted file mode 100644 index 263f43d..0000000 --- a/ex/HoTT book/Ch1.thy +++ /dev/null @@ -1,50 +0,0 @@ -(* -Title: ex/HoTT book/Ch1.thy -Author: Josh Chen -Date: 2018 - -A formalization of some content of Chapter 1 of the Homotopy Type Theory book. -*) - -theory Ch1 -imports "../../HoTT" - -begin - -chapter \HoTT Book, Chapter 1\ - -section \1.6 Dependent pair types (\-types)\ - -paragraph \Propositional uniqueness principle.\ - -schematic_goal - assumes "A: U i" and "B: A \ U i" and "p: \x:A. B x" - shows "?a: p =[\x:A. B x] " - -text \Proof by induction on @{term "p: \x:A. B x"}:\ - -proof (rule Sum_elim[where ?p=p]) - text \We prove the base case.\ - fix x y assume asm: "x: A" "y: B x" show "refl : =[\x:A. B x] , snd >" - proof compute - show "x: A" and "y: B x" by (fact asm)+ \ \Hint the correct types.\ - - text \And now @{method derive} takes care of the rest. -\ - qed (derive lems: assms asm) -qed (derive lems: assms) - - -section \Exercises\ - -paragraph \Exercise 1.13\ - -abbreviation "not" ("\_") where "\A \ A \ \" - -text "This proof requires the use of universe cumulativity." - -proposition assumes "A: U i" shows "\<^bold>\f. f`(inr(\<^bold>\a. f`(inl a))): \(\(A + \A))" -by (derive lems: assms) - - -end -- cgit v1.2.3 From f9bbcffd4a45599c306815104dccb6b549b306ee Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Tue, 18 Sep 2018 21:18:33 +0200 Subject: Add ROOT. No eta-contraction --- HoTT_Base.thy | 2 ++ ROOT | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/HoTT_Base.thy b/HoTT_Base.thy index 2ad0ac5..69cc1b1 100644 --- a/HoTT_Base.thy +++ b/HoTT_Base.thy @@ -14,6 +14,8 @@ begin section \Basic setup\ +declare[[eta_contract=false]] + typedecl t \ \Type of object types and terms\ typedecl ord \ \Type of meta-level numerals\ diff --git a/ROOT b/ROOT index 7e76f86..cecdd32 100644 --- a/ROOT +++ b/ROOT @@ -1,10 +1,24 @@ +chapter HoTT + session HoTT = Pure + + description {* + Homotopy type theory based on intensional Martin-Löf type theory, with a cumulative universe + hierarchy à la Russell. + + Follows the development of the theory in + The Univalent Foundations Program, Homotopy Type Theory: Univalent Foundations of Mathematics, + Institute for Advanced Study, (2013). + Available online at https://homotopytypetheory.org/book. + + Author: Joshua Chen, University of Bonn (2018) + *} sessions "HOL-Eisbach" theories + HoTT (global) HoTT_Base - HoTT + HoTT_Methods "tests/Test" "ex/Methods" "ex/Synthesis" - "ex/Book/Ch1" \ No newline at end of file + "ex/Book/Ch1" -- cgit v1.2.3