From 2feb56660700af107abb5a28a7120052ac405518 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sun, 31 Jan 2021 02:54:51 +0000 Subject: rename things + some small changes --- hott/Equivalence.thy | 4 +-- hott/Identity.thy | 77 ++++++++++++++++++++++++---------------------------- hott/List_HoTT.thy | 2 +- 3 files changed, 38 insertions(+), 45 deletions(-) (limited to 'hott') diff --git a/hott/Equivalence.thy b/hott/Equivalence.thy index 9fe11a7..745bc67 100644 --- a/hott/Equivalence.thy +++ b/hott/Equivalence.thy @@ -400,8 +400,8 @@ Lemma by (eq p) (rule equivalence_refl) text \ - The following proof is wordy because (1) the typechecker doesn't normalize, - and (2) we don't yet have universe level inference. + The following proof is wordy because (1) typechecker normalization is still + rudimentary, and (2) we don't yet have universe level inference. \ Lemma (def) equiv_if_equal: diff --git a/hott/Identity.thy b/hott/Identity.thy index caab2e3..0531b74 100644 --- a/hott/Identity.thy +++ b/hott/Identity.thy @@ -6,7 +6,7 @@ text \ \ theory Identity -imports Spartan +imports MLTT begin @@ -109,7 +109,7 @@ method pathcomp for p q :: o = rule pathcomp[where ?p=p and ?q=q] section \Notation\ definition Id_i (infix "=" 110) - where [implicit]: "Id_i x y \ x =\<^bsub>{}\<^esub> y" + where [implicit]: "x = y \ x =\<^bsub>{}\<^esub> y" definition pathinv_i ("_\" [1000]) where [implicit]: "pathinv_i p \ pathinv {} {} {} p" @@ -532,47 +532,40 @@ method right_whisker = (rule right_whisker) section \Horizontal path-composition\ -locale horiz_pathcomposable = -\ \Conditions under which horizontal path-composition is defined.\ -fixes - i A a b c p q r s -assumes [type]: - "A: U i" "a: A" "b: A" "c: A" - "p: a =\<^bsub>A\<^esub> b" "q: a =\<^bsub>A\<^esub> b" - "r: b =\<^bsub>A\<^esub> c" "s: b =\<^bsub>A\<^esub> c" +locale horiz_pathcomposable = \ \Conditions under which horizontal path-composition is defined.\ +fixes i A a b c p q r s +assumes [type]: "A: U i" "a: A" "b: A" "c: A" + "p: a =\<^bsub>A\<^esub> b" "q: a =\<^bsub>A\<^esub> b" "r: b =\<^bsub>A\<^esub> c" "s: b =\<^bsub>A\<^esub> c" begin - -Lemma (def) horiz_pathcomp: - assumes "\: p = q" "\: r = s" - shows "p \ r = q \ s" -proof (rule pathcomp) - show "p \ r = q \ r" by right_whisker fact - show ".. = q \ s" by left_whisker fact -qed typechk - -text \A second horizontal composition:\ - -Lemma (def) horiz_pathcomp': - assumes "\: p = q" "\: r = s" - shows "p \ r = q \ s" -proof (rule pathcomp) - show "p \ r = p \ s" by left_whisker fact - show ".. = q \ s" by right_whisker fact -qed typechk - -notation horiz_pathcomp (infix "\" 121) -notation horiz_pathcomp' (infix "\''" 121) - -Lemma (def) horiz_pathcomp_eq_horiz_pathcomp': - assumes "\: p = q" "\: r = s" - shows "\ \ \ = \ \' \" - unfolding horiz_pathcomp_def horiz_pathcomp'_def - apply (eq \, eq \) - focus vars p apply (eq p) - focus vars a _ _ _ r by (eq r) (compute, refl) - done - done - + Lemma (def) horiz_pathcomp: + assumes "\: p = q" "\: r = s" shows "p \ r = q \ s" + proof (rule pathcomp) + show "p \ r = q \ r" by right_whisker fact + show ".. = q \ s" by left_whisker fact + qed typechk + + Lemma (def) horiz_pathcomp': + assumes "\: p = q" "\: r = s" shows "p \ r = q \ s" + proof (rule pathcomp) + show "p \ r = p \ s" by left_whisker fact + show ".. = q \ s" by right_whisker fact + qed typechk + + notation horiz_pathcomp (infix "\" 121) + notation horiz_pathcomp' (infix "\''" 121) + + Lemma (def) horiz_pathcomp_eq_horiz_pathcomp': + assumes "\: p = q" "\: r = s" shows "\ \ \ = \ \' \" + unfolding horiz_pathcomp_def horiz_pathcomp'_def + proof (eq \, eq \) + fix p q assuming "p: a = b" "q: b = c" + show "refl p \\<^sub>r q \ (p \\<^sub>l refl q) = p \\<^sub>l refl q \ (refl p \\<^sub>r q)" + proof (eq p) + fix a r assuming "a: A" "r: a = c" + show "refl (refl a) \\<^sub>r r \ (refl a \\<^sub>l refl r) = refl a \\<^sub>l refl r \ (refl (refl a) \\<^sub>r r)" + by (eq r) (compute, refl) + qed + qed end diff --git a/hott/List_HoTT.thy b/hott/List_HoTT.thy index 9bd1517..d866f59 100644 --- a/hott/List_HoTT.thy +++ b/hott/List_HoTT.thy @@ -1,6 +1,6 @@ theory List_HoTT imports - Spartan.List + MLTT.List Nat begin -- cgit v1.2.3