From 746fab6476dc622a982d5ebaeb30a2e1426c3316 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sun, 19 Aug 2018 17:28:48 +0200 Subject: Higher groupoid structure of types --- EqualProps.thy | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/EqualProps.thy b/EqualProps.thy index a1d4c45..be8e53e 100644 --- a/EqualProps.thy +++ b/EqualProps.thy @@ -33,7 +33,7 @@ text " " lemma inv_comp: - assumes "A : U(i)" and "a : A" shows "(refl a)\ \ refl(a)" + assumes "A : U(i)" and "a : A" shows "(refl(a))\ \ refl(a)" unfolding inv_def proof compute show "\x. x: A \ refl x: x =\<^sub>A x" .. @@ -194,7 +194,7 @@ qed fact text "The raw object lambda term is cumbersome to use, so we define a simpler constant instead." -axiomatization pathcomp :: "[Term, Term] \ Term" (infixl "\" 60) where +axiomatization pathcomp :: "[Term, Term] \ Term" (infixl "\" 120) where pathcomp_def: "\ A: U(i); x: A; y: A; z: A; @@ -214,8 +214,71 @@ lemma pathcomp_comp: by (subst pathcomp_def) (routine lems: assms rpathcomp_comp) -lemmas EqualProps_type [intro] = inv_type pathcomp_type -lemmas EqualProps_comp [comp] = inv_comp pathcomp_comp +lemmas inv_type [intro] +lemmas pathcomp_type [intro] +lemmas inv_comp [comp] +lemmas pathcomp_comp [comp] + + +section \Weak higher groupoid structure of types\ + +schematic_goal whg1a: + assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y" + shows "?a: p =[x =\<^sub>A y] (p \ (refl(y)))" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + show "\x. x: A \ refl(refl(x)): refl(x) =[x =\<^sub>A x] (refl(x) \ refl(x))" + by compute (routine lems: assms) +qed (routine lems: assms) + +schematic_goal whg1b: + assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y" + shows "?a: p =[x =\<^sub>A y] (refl(x) \ p)" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + show "\x. x: A \ refl(refl(x)): refl(x) =[x =\<^sub>A x] (refl(x) \ refl(x))" + by compute (routine lems: assms) +qed (routine lems: assms) + +schematic_goal whg2a: + assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y" + shows "?a: (p\ \ p) =[y =\<^sub>A y] refl(y)" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + show "\x. x: A \ refl(refl(x)): ((refl(x))\ \ refl(x)) =[x =\<^sub>A x] refl(x)" + by (compute | routine lems: assms)+ +qed (routine lems: assms)+ + +schematic_goal whg2b: + assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y" + shows "?a: (p \ p\) =[x =\<^sub>A x] refl(x)" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + show "\x. x: A \ refl(refl(x)): (refl(x) \ (refl(x))\) =[x =\<^sub>A x] refl(x)" + by (compute | routine lems: assms)+ +qed (routine lems: assms)+ + +schematic_goal whg3: + assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y" + shows "?a: p\\ =[x =\<^sub>A y] p" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + show "\x. x: A \ refl(refl(x)): (refl(x))\\ =[x =\<^sub>A x] refl(x)" + by (compute | routine lems: assms)+ +qed (routine lems: assms) + + +lemma assumes "A: U(i)" shows "\x. x: A \ refl(x): x =\<^sub>A x" +by (rule Prod_atomize[where ?A=A and ?B="\x. x =\<^sub>A x"]) (routine lems: assms) + + +schematic_goal + assumes + "A: U(i)" and + "x: A" "y: A" "z: A" "w: A" and + "p: x =\<^sub>A y" "q: y =\<^sub>A z" "r: z =\<^sub>A w" + shows + "?a: p \ (q \ r) =[x =\<^sub>A w] (p \ q) \ r" +proof (rule Equal_elim[where ?x=x and ?y=y and ?p=p]) + fix y assume "y: A" + show "refl(q \ r): refl(y) \ (q \ r) =[y =\<^sub>A w] (refl(y) \ q) \ r" + proof (compute lems: whg1b) + end -- cgit v1.2.3