(* Title: HoTT/Equal.thy Author: Josh Chen Date: Jun 2018 Equality type. *) theory Equal imports HoTT_Base begin section \Constants and syntax\ axiomatization Equal :: "[Term, Term, Term] \ Term" and refl :: "Term \ Term" and indEqual :: "[Term \ Term, Term] \ Term" ("(1ind\<^sub>=)") syntax "_EQUAL" :: "[Term, Term, Term] \ Term" ("(3_ =\<^sub>_/ _)" [101, 0, 101] 100) "_EQUAL_ASCII" :: "[Term, Term, Term] \ Term" ("(3_ =[_]/ _)" [101, 0, 101] 100) translations "a =[A] b" \ "CONST Equal A a b" "a =\<^sub>A b" \ "CONST Equal A a b" section \Type rules\ axiomatization where Equal_form: "\A: U(i); a: A; b: A\ \ a =\<^sub>A b : U(i)" and Equal_intro: "a : A \ refl(a): a =\<^sub>A a" and Equal_elim: "\ \x y. \x: A; y: A\ \ C(x)(y): x =\<^sub>A y \ U(i); \x. x: A \ f(x) : C(x)(x)(refl x); x: A; y: A; p: a =\<^sub>A b \ \ ind\<^sub>=(f)(p) : C(x)(y)(p)" and Equal_comp: "\ \x y. \x: A; y: A\ \ C(x)(y): x =\<^sub>A y \ U(i); \x. x: A \ f(x) : C(x)(x)(refl x); a: A \ \ ind\<^sub>=(f)(refl(a)) \ f(a)" text "Admissible inference rules for equality type formation:" axiomatization where Equal_form_cond1: "a =\<^sub>A b: U(i) \ A: U(i)" and Equal_form_cond2: "a =\<^sub>A b: U(i) \ a: A" and Equal_form_cond3: "a =\<^sub>A b: U(i) \ b: A" text "Rule declarations:" lemmas Equal_rules [intro] = Equal_form Equal_intro Equal_elim Equal_comp lemmas Equal_wellform [wellform] = Equal_form_cond1 Equal_form_cond2 Equal_form_cond3 lemmas Equal_comps [comp] = Equal_comp end