From e12ef5b7216146513cbef0ed3c8d764e2e43c64e Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Thu, 7 Jun 2018 21:35:05 +0200 Subject: Symmetry and transitivity done. --- HoTT.thy | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'HoTT.thy') diff --git a/HoTT.thy b/HoTT.thy index 44f55e9..cfb29df 100644 --- a/HoTT.thy +++ b/HoTT.thy @@ -158,7 +158,7 @@ translations "a =[A] b" \ "CONST Equal A a b" axiomatization - refl :: "Term \ Term" and + refl :: "Term \ Term" ("(refl'(_'))") and indEqual :: "[Term, [Term, Term, Term] \ Term] \ Term" ("(indEqual[_])") where Equal_form: "\A a b::Term. \A : U; a : A; b : A\ \ a =\<^sub>A b : U" @@ -191,11 +191,34 @@ lemma inv_comp: "\A a::Term. a : A \ inv[A,a,a]`refl(a) \ Term" ("(1compose''[_])") +\ \"Raw" composition function\ +abbreviation compose' :: "Term \ Term" ("(1compose''[_])") where "compose'[A] \ indEqual[A](\x y _. \z:A. \q: y =\<^sub>A z. x =\<^sub>A z)`(indEqual[A](\x z _. x =\<^sub>A z)`(\<^bold>\x:A. refl(x)))" -lemma compose'_comp: "a : A \ compose'[A]`a`a`refl(a)`a`refl(a) \ refl(a)" unfolding compose'_def by simp +\ \"Natural" composition function\ +abbreviation compose :: "[Term, Term, Term, Term] \ Term" ("(1compose[_,/ _,/ _,/ _])") + where "compose[A,x,y,z] \ \<^bold>\p:x =\<^sub>A y. \<^bold>\q:y =\<^sub>A z. compose'[A]`x`y`p`z`q" +(**** GOOD CANDIDATE FOR AUTOMATION ****) +lemma compose_comp: + assumes "a : A" + shows "compose[A,a,a,a]`refl(a)`refl(a) \ refl(a)" using assms Equal_intro[OF assms] by simp + +text "The above proof is a good candidate for proof automation; in particular we would like the system to be able to automatically find the conditions of the \using\ clause in the proof. +This would likely involve something like: + 1. Recognizing that there is a function application that can be simplified. + 2. Noting that the obstruction to applying \Prod_comp\ is the requirement that \refl(a) : a =\<^sub>A a\. + 3. Obtaining such a condition, using the known fact \a : A\ and the introduction rule \Equal_intro\." + +lemmas Equal_simps [simp] = inv_comp compose_comp + +subsubsection \Pretty printing\ + +abbreviation inv_pretty :: "[Term, Term, Term, Term] \ Term" ("(1_\<^sup>-\<^sup>1\<^sub>_\<^sub>,\<^sub>_\<^sub>,\<^sub>_)" 500) + where "p\<^sup>-\<^sup>1\<^sub>A\<^sub>,\<^sub>x\<^sub>,\<^sub>y \ inv[A,x,y]`p" + +abbreviation compose_pretty :: "[Term, Term, Term, Term, Term, Term] \ Term" ("(1_ \\<^sub>_\<^sub>,\<^sub>_\<^sub>,\<^sub>_\<^sub>,\<^sub>_/ _)") + where "p \\<^sub>A\<^sub>,\<^sub>x\<^sub>,\<^sub>y\<^sub>,\<^sub>z q \ compose[A,x,y,z]`p`q" end -- cgit v1.2.3