(* 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" and inr :: "Term \ Term" and indCoprod :: "[Term \ Term, Term \ Term, Term] \ Term" ("(1ind\<^sub>+)") where Coprod_form: "\A: U(i); B: U(i)\ \ A + B: U(i)" and Coprod_intro1: "\a: A; B: U(i)\ \ inl(a): A + B" and Coprod_intro2: "\b: B; A: U(i)\ \ inr(b): A + B" and Coprod_elim: "\ C: A + B \ U(i); \x. x: A \ c(x): C(inl(x)); \y. y: B \ d(y): C(inr(y)); u: A + B \ \ ind\<^sub>+(c)(d)(u) : C(u)" and Coprod_comp1: "\ 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>+(c)(d)(inl(a)) \ c(a)" and Coprod_comp2: "\ 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>+(c)(d)(inr(b)) \ d(b)" text "Admissible formation inference rules:" axiomatization where Coprod_form_cond1: "A + B: U(i) \ A: U(i)" and Coprod_form_cond2: "A + B: U(i) \ B: U(i)" text "Rule declarations:" lemmas Coprod_intro = Coprod_intro1 Coprod_intro2 lemmas Coprod_rules [intro] = Coprod_form Coprod_intro Coprod_elim Coprod_comp1 Coprod_comp2 lemmas Coprod_form_conds [wellform] = Coprod_form_cond1 Coprod_form_cond2 lemmas Coprod_comps [comp] = Coprod_comp1 Coprod_comp2 end