From 150f7eb27880a0081b8ec86d775dd626f507e779 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Wed, 19 Sep 2018 15:06:44 +0200 Subject: Renaming --- HoTT.thy | 4 ++-- Projections.thy | 43 +++++++++++++++++++++++++++++++++++++++++++ Univalence.thy | 2 +- 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 Projections.thy diff --git a/HoTT.thy b/HoTT.thy index 38097b1..6c6ad21 100644 --- a/HoTT.thy +++ b/HoTT.thy @@ -22,8 +22,8 @@ Sum Unit (* Derived definitions and properties *) -EqualProps -Proj +Equality +Projections Univalence begin diff --git a/Projections.thy b/Projections.thy new file mode 100644 index 0000000..509402b --- /dev/null +++ b/Projections.thy @@ -0,0 +1,43 @@ +(* +Title: Projections.thy +Author: Joshua Chen +Date: 2018 + +Projection functions \fst\ and \snd\ for the dependent sum type. +*) + +theory Projections +imports HoTT_Methods Prod Sum + +begin + + +definition fst :: "t \ t" where "fst p \ ind\<^sub>\ (\x y. x) p" +definition snd :: "t \ t" where "snd p \ ind\<^sub>\ (\x y. y) p" + +lemma fst_type: + assumes "A: U i" and "B: A \ U i" and "p: \x:A. B x" shows "fst p: A" +unfolding fst_def by (derive lems: assms) + +lemma fst_comp: + assumes "A: U i" and "B: A \ U i" and "a: A" and "b: B a" shows "fst \ a" +unfolding fst_def by compute (derive lems: assms) + +lemma snd_type: + assumes "A: U i" and "B: A \ U i" and "p: \x:A. B x" shows "snd p: B (fst p)" +unfolding snd_def proof (derive lems: assms) + show "\p. p: \x:A. B x \ fst p: A" using assms(1-2) by (rule fst_type) + + fix x y assume asm: "x: A" "y: B x" + show "y: B (fst )" by (derive lems: asm assms fst_comp) +qed + +lemma snd_comp: + assumes "A: U i" and "B: A \ U i" and "a: A" and "b: B a" shows "snd \ b" +unfolding snd_def by (derive lems: assms) + +lemmas Proj_types [intro] = fst_type snd_type +lemmas Proj_comps [comp] = fst_comp snd_comp + + +end diff --git a/Univalence.thy b/Univalence.thy index 3c9b520..c6733c6 100644 --- a/Univalence.thy +++ b/Univalence.thy @@ -7,7 +7,7 @@ Definitions of homotopy, equivalence and the univalence axiom. *) theory Univalence -imports HoTT_Methods EqualProps Prod Sum +imports HoTT_Methods Equality Prod Sum begin -- cgit v1.2.3