From 9ed05b8027122d9b5e450b811deb8897ffe78417 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Fri, 29 May 2020 19:59:22 +0200 Subject: proved a few oopses + minor tweaks --- hott/Equivalence.thy | 41 ++++++++++++++++++++++------------------- hott/More_List.thy | 12 +----------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/hott/Equivalence.thy b/hott/Equivalence.thy index 9c86a95..aa73ec8 100644 --- a/hott/Equivalence.thy +++ b/hott/Equivalence.thy @@ -75,7 +75,7 @@ Lemma (derive) commute_homotopy: "f: A \ B" "g: A \ B" "H: homotopy A (\_. B) f g" shows "(H x) \ g[p] = f[p] \ (H y)" - \ \Need this assumption unfolded for typechecking:\ + \ \Need this assumption unfolded for typechecking\ supply assms(8)[unfolded homotopy_def] apply (eq p) focus vars x @@ -167,8 +167,8 @@ Lemma (derive) id_qinv: unfolding qinv_def apply intro defer apply intro defer - apply (rule homotopy_id_right) - apply (rule homotopy_id_left) + apply htpy_id + apply id_htpy done Lemma (derive) quasiinv_qinv: @@ -176,14 +176,14 @@ Lemma (derive) quasiinv_qinv: shows "prf: qinv f \ qinv (fst prf)" unfolding qinv_def apply intro - \ by (rule \f:_\) - \ apply (elim "prf") - focus vars g HH - apply intro - \<^item> by reduce (snd HH) - \<^item> by reduce (fst HH) - done - done + \ by (rule \f:_\) + \ apply (elim "prf") + focus vars g HH + apply intro + \<^item> by reduce (snd HH) + \<^item> by reduce (fst HH) + done + done done Lemma (derive) funcomp_qinv: @@ -272,7 +272,7 @@ Lemma (derive) biinv_imp_qinv: also have ".. ~ (id A) \ h" by (subst funcomp_assoc[symmetric]) (htpy_o, fact) also have ".. ~ h" by reduce refl finally have "g ~ h" by this - then have "f \ g ~ f \ h" by (rule homotopy_funcomp_right) + then have "f \ g ~ f \ h" by o_htpy also note \H2:_\ finally show "f \ g ~ id B" by this qed @@ -281,7 +281,7 @@ Lemma (derive) biinv_imp_qinv: Lemma (derive) id_biinv: "A: U i \ biinv (id A)" - by (rule qinv_imp_biinv) (rule id_qinv) + by (rule qinv_imp_biinv) (rule id_qinv) Lemma (derive) funcomp_biinv: assumes @@ -290,9 +290,8 @@ Lemma (derive) funcomp_biinv: shows "biinv f \ biinv g \ biinv (g \ f)" apply intros focus vars biinv\<^sub>f biinv\<^sub>g - - text \Follows from \funcomp_qinv\.\ -oops + by (rule qinv_imp_biinv) (rule funcomp_qinv; rule biinv_imp_qinv) + done section \Equivalence\ @@ -343,9 +342,13 @@ Lemma (derive) equivalence_transitive: shows "A \ B \ B \ C \ A \ C" apply intros unfolding equivalence_def - - text \Use \funcomp_biinv\.\ -oops + focus vars p q apply (elim p, elim q) + focus vars f biinv\<^sub>f g biinv\<^sub>g apply intro + \ apply (rule funcompI) defer by assumption known + \ by (rule funcomp_biinv) + done + done + done text \ Equal types are equivalent. We give two proofs: the first by induction, and diff --git a/hott/More_List.thy b/hott/More_List.thy index c3d63f6..a216987 100644 --- a/hott/More_List.thy +++ b/hott/More_List.thy @@ -5,24 +5,14 @@ imports begin -experiment begin - Lemma "map (\n: Nat. suc n) [0, suc (suc 0), suc 0] \ ?xs" - unfolding map_def by (subst comps)+ -end - section \Length\ -definition [implicit]: - "len \ ListRec ? Nat 0 (\_ _ n. suc n)" +definition [implicit]: "len \ ListRec ? Nat 0 (\_ _ rec. suc rec)" experiment begin Lemma "len [] \ ?n" by (subst comps)+ Lemma "len [0, suc 0, suc (suc 0)] \ ?n" by (subst comps)+ end -section \Equality on lists\ - -(*Hmmm.*) - end -- cgit v1.2.3