From f0234b685d09a801f83a7db91c94380873832bd5 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sat, 4 Aug 2018 22:59:51 +0200 Subject: Coproduct --- Coprod.thy | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Coprod.thy diff --git a/Coprod.thy b/Coprod.thy new file mode 100644 index 0000000..75e621a --- /dev/null +++ b/Coprod.thy @@ -0,0 +1,61 @@ +(* Title: HoTT/Coprod.thy + Author: Josh Chen + Date: Aug 2018 + +Coproduct type. +*) + +theory Coprod + imports HoTT_Base +begin + + +section \Constants and type rules\ + +axiomatization + Coprod :: "[Term, Term] \ Term" (infixr "+" 50) and + inl :: "Term \ Term" ("(1inl'(_'))") and + inr :: "Term \ Term" ("(1inr'(_'))") and + indCoprod :: "[Term, Term, Typefam, Term \ Term, Term \ Term, Term] \ Term" ("(1ind\<^sub>+[_,/ _])") +where + Coprod_form: "\i A B. \A : U(i); B : U(i)\ \ A + B : U(i)" +and + Coprod_intro1: "\A B a b. \a : A; b : B\ \ inl(a) : A + B" +and + Coprod_intro2: "\A B a b. \a : A; b : B\ \ inr(b) : A + B" +and + Coprod_elim: "\i A B C c d e. \ + C: A + B \ U(i); + \x. x : A \ c x : C inl(x); + \y. y : B \ d y : C inr(y); + e : A + B + \ \ ind\<^sub>+[A,B] C c d e : C e" +and + Coprod_comp1: "\i A B C c d a. \ + C: A + B \ U(i); + \x. x : A \ c x : C inl(x); + \y. y : B \ d y : C inr(y); + a : A + \ \ ind\<^sub>+[A,B] C c d inl(a) \ c a" +and + Coprod_comp2: "\i A B C c d b. \ + C: A + B \ U(i); + \x. x : A \ c x : C inl(x); + \y. y : B \ d y : C inr(y); + b : B + \ \ ind\<^sub>+[A,B] C c d inr(b) \ d b" + +text "Admissible formation inference rules:" + +axiomatization where + Coprod_form_cond1: "\i A B. A + B : U(i) \ A : U(i)" +and + Coprod_form_cond2: "\i A B. A + B : U(i) \ B : U(i)" + +lemmas Coprod_rules [intro] = Coprod_form Coprod_intro1 Coprod_intro2 + Coprod_elim Coprod_comp1 Coprod_comp2 +lemmas Coprod_form_conds [intro] = Coprod_form_cond1 Coprod_form_cond2 +lemmas Coprod_comps [comp] = Coprod_comp1 Coprod_comp2 + + +end \ No newline at end of file -- cgit v1.2.3