From dc2730916482bd230f9bd5244b8b2cc9d005f69a Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Tue, 7 Aug 2018 12:30:59 +0200 Subject: Old application syntax incompatible with Eisbach --- Coprod.thy | 40 ++++++++++++++++++++-------------------- Equal.thy | 34 +++++++++++++++++----------------- HoTT_Base.thy | 4 ---- Nat.thy | 30 +++++++++++++++--------------- Prod.thy | 12 ++++++------ Sum.thy | 28 ++++++++++++++-------------- scratch.thy | 4 ++-- 7 files changed, 74 insertions(+), 78 deletions(-) diff --git a/Coprod.thy b/Coprod.thy index 75e621a..a301e7e 100644 --- a/Coprod.thy +++ b/Coprod.thy @@ -14,43 +14,43 @@ section \Constants and type rules\ axiomatization Coprod :: "[Term, Term] \ Term" (infixr "+" 50) and - inl :: "Term \ Term" ("(1inl'(_'))") and - inr :: "Term \ Term" ("(1inr'(_'))") and - indCoprod :: "[Term, Term, Typefam, Term \ Term, Term \ Term, Term] \ Term" ("(1ind\<^sub>+[_,/ _])") + inl :: "Term \ Term" and + inr :: "Term \ Term" and + indCoprod :: "[Term \ Term, Term \ Term, Term] \ Term" ("(1ind\<^sub>+)") where - Coprod_form: "\i A B. \A : U(i); B : U(i)\ \ A + B : U(i)" + Coprod_form: "\i A B. \A : U(i); B : U(i)\ \ A + B: U(i)" and - Coprod_intro1: "\A B a b. \a : A; b : B\ \ inl(a) : A + B" + Coprod_intro1: "\A B a b. \a : A; b : B\ \ inl(a): A + B" and - Coprod_intro2: "\A B a b. \a : A; b : B\ \ inr(b) : A + B" + Coprod_intro2: "\A B a b. \a : A; b : B\ \ inr(b): A + B" and Coprod_elim: "\i A B C c d e. \ C: A + B \ U(i); - \x. x : A \ c x : C inl(x); - \y. y : B \ d y : C inr(y); - e : A + B - \ \ ind\<^sub>+[A,B] C c d e : C e" + \x. x: A \ c(x): C(inl(x)); + \y. y: B \ d(y): C(inr(y)); + e: A + B + \ \ ind\<^sub>+(c)(d)(e) : C(e)" and Coprod_comp1: "\i A B C c d a. \ C: A + B \ U(i); - \x. x : A \ c x : C inl(x); - \y. y : B \ d y : C inr(y); - a : A - \ \ ind\<^sub>+[A,B] C c d inl(a) \ c a" + \x. x: A \ c(x): C(inl(x)); + \y. y: B \ d(y): C(inr(y)); + a: A + \ \ ind\<^sub>+(c)(d)(inl(a)) \ c(a)" and Coprod_comp2: "\i A B C c d b. \ C: A + B \ U(i); - \x. x : A \ c x : C inl(x); - \y. y : B \ d y : C inr(y); - b : B - \ \ ind\<^sub>+[A,B] C c d inr(b) \ d b" + \x. x: A \ c(x): C(inl(x)); + \y. y: B \ d(y): C(inr(y)); + b: B + \ \ ind\<^sub>+(c)(d)(inr(b)) \ d(b)" text "Admissible formation inference rules:" axiomatization where - Coprod_form_cond1: "\i A B. A + B : U(i) \ A : U(i)" + Coprod_form_cond1: "\i A B. A + B: U(i) \ A: U(i)" and - Coprod_form_cond2: "\i A B. A + B : U(i) \ B : U(i)" + Coprod_form_cond2: "\i A B. A + B: U(i) \ B: U(i)" lemmas Coprod_rules [intro] = Coprod_form Coprod_intro1 Coprod_intro2 Coprod_elim Coprod_comp1 Coprod_comp2 diff --git a/Equal.thy b/Equal.thy index 2b49213..8bd7875 100644 --- a/Equal.thy +++ b/Equal.thy @@ -14,8 +14,8 @@ section \Constants and syntax\ axiomatization Equal :: "[Term, Term, Term] \ Term" and - refl :: "Term \ Term" ("(refl'(_'))" 1000) and - indEqual :: "[Term, [Term, Term] \ Typefam, Term \ Term, Term, Term, Term] \ Term" ("(1ind\<^sub>=[_])") + refl :: "Term \ Term" and + indEqual :: "[Term \ Term, Term, Term, Term] \ Term" ("(1ind\<^sub>=)") syntax "_EQUAL" :: "[Term, Term, Term] \ Term" ("(3_ =\<^sub>_/ _)" [101, 0, 101] 100) @@ -28,32 +28,32 @@ translations section \Type rules\ axiomatization where - Equal_form: "\i A a b. \A : U(i); a : A; b : A\ \ a =\<^sub>A b : U(i)" + Equal_form: "\i A a b. \A: U(i); a: A; b: A\ \ a =\<^sub>A b : U(i)" and - Equal_intro: "\A a. a : A \ refl(a) : a =\<^sub>A a" + Equal_intro: "\A a. a : A \ refl(a): a =\<^sub>A a" and Equal_elim: "\i A C f a b p. \ - \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; - b : A; - p : a =\<^sub>A b - \ \ ind\<^sub>=[A] C f a b p : C a b p" + \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; + b: A; + p: a =\<^sub>A b + \ \ ind\<^sub>=(f)(a)(b)(p) : C(a)(b)(p)" and Equal_comp: "\i A C f a. \ - \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>=[A] C f a a refl(a) \ f a" + \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)(a)(a)(refl(a)) \ f(a)" text "Admissible inference rules for equality type formation:" axiomatization where - Equal_form_cond1: "\i A a b. a =\<^sub>A b : U(i) \ A : U(i)" + Equal_form_cond1: "\i A a b. a =\<^sub>A b: U(i) \ A: U(i)" and - Equal_form_cond2: "\i A a b. a =\<^sub>A b : U(i) \ a : A" + Equal_form_cond2: "\i A a b. a =\<^sub>A b: U(i) \ a: A" and - Equal_form_cond3: "\i A a b. a =\<^sub>A b : U(i) \ b : A" + Equal_form_cond3: "\i A a b. a =\<^sub>A b: U(i) \ b: A" lemmas Equal_rules [intro] = Equal_form Equal_intro Equal_elim Equal_comp lemmas Equal_form_conds [intro] = Equal_form_cond1 Equal_form_cond2 Equal_form_cond3 diff --git a/HoTT_Base.thy b/HoTT_Base.thy index c2bb092..614419e 100644 --- a/HoTT_Base.thy +++ b/HoTT_Base.thy @@ -9,10 +9,6 @@ theory HoTT_Base imports Pure begin -text "Use the syntax \f(x)\ instead of \f x\ for function application." - -setup Pure_Thy.old_appl_syntax_setup - section \Foundational definitions\ diff --git a/Nat.thy b/Nat.thy index 93b7a2e..bd2c4ca 100644 --- a/Nat.thy +++ b/Nat.thy @@ -14,33 +14,33 @@ axiomatization Nat :: Term ("\") and zero :: Term ("0") and succ :: "Term \ Term" and - indNat :: "[Typefam, [Term, Term] \ Term, Term, Term] \ Term" ("(1ind\<^sub>\)") + indNat :: "[[Term, Term] \ Term, Term, Term] \ Term" ("(1ind\<^sub>\)") where - Nat_form: "\ : U(O)" + Nat_form: "\: U(O)" and - Nat_intro1: "0 : \" + Nat_intro1: "0: \" and - Nat_intro2: "\n. n : \ \ succ n : \" + Nat_intro2: "\n. n: \ \ succ(n): \" and Nat_elim: "\i C f a n. \ C: \ \ U(i); - \n c. \n : \; c : C n\ \ f n c : C (succ n); - a : C 0; - n : \ - \ \ ind\<^sub>\ C f a n : C n" + \n c. \n: \; c: C(n)\ \ f(n)(c): C(succ n); + a: C(0); + n: \ + \ \ ind\<^sub>\(f)(a)(n): C(n)" and Nat_comp1: "\i C f a. \ C: \ \ U(i); - \n c. \n : \; c : C n\ \ f n c : C (succ n); - a : C 0 - \ \ ind\<^sub>\ C f a 0 \ a" + \n c. \n: \; c: C(n)\ \ f(n)(c): C(succ n); + a: C(0) + \ \ ind\<^sub>\(f)(a)(0) \ a" and Nat_comp2: "\ i C f a n. \ C: \ \ U(i); - \n c. \n : \; c : C n\ \ f n c : C (succ n); - a : C 0; - n : \ - \ \ ind\<^sub>\ C f a (succ n) \ f n (ind\<^sub>\ C f a n)" + \n c. \n: \; c: C(n)\ \ f(n)(c): C(succ n); + a: C(0); + n: \ + \ \ ind\<^sub>\(f)(a)(succ n) \ f(n)(ind\<^sub>\ f a n)" lemmas Nat_rules [intro] = Nat_form Nat_intro1 Nat_intro2 Nat_elim Nat_comp1 Nat_comp2 lemmas Nat_comps [comp] = Nat_comp1 Nat_comp2 diff --git a/Prod.thy b/Prod.thy index 845de4b..01cd006 100644 --- a/Prod.thy +++ b/Prod.thy @@ -27,10 +27,10 @@ syntax text "The translations below bind the variable \x\ in the expressions \B\ and \b\." translations - "\x:A. B" \ "CONST Prod(A, \x. B)" - "\<^bold>\x:A. b" \ "CONST lambda(A, \x. b)" - "PROD x:A. B" \ "CONST Prod(A, \x. B)" - "%%x:A. b" \ "CONST lambda(A, \x. b)" + "\x:A. B" \ "CONST Prod A (\x. B)" + "\<^bold>\x:A. b" \ "CONST lambda A (\x. b)" + "PROD x:A. B" \ "CONST Prod A (\x. B)" + "%%x:A. b" \ "CONST lambda A (\x. b)" text "Nondependent functions are a special case." @@ -84,9 +84,9 @@ where and Unit_intro: "\: \" and - Unit_elim: "\i C c a. \C: \ \ U(i); c: C(\); a: \\ \ ind\<^sub>\(c, a) : C(a)" + Unit_elim: "\i C c a. \C: \ \ U(i); c: C(\); a: \\ \ ind\<^sub>\(c)(a) : C(a)" and - Unit_comp: "\i C c. \C: \ \ U(i); c: C(\)\ \ ind\<^sub>\(c, \) \ c" + Unit_comp: "\i C c. \C: \ \ U(i); c: C(\)\ \ ind\<^sub>\(c)(\) \ c" lemmas Unit_rules [intro] = Unit_form Unit_intro Unit_elim Unit_comp lemmas Unit_comps [comp] = Unit_comp diff --git a/Sum.thy b/Sum.thy index 2d6e64b..cdfe5bd 100644 --- a/Sum.thy +++ b/Sum.thy @@ -22,8 +22,8 @@ syntax "_SUM_ASCII" :: "[idt, Term, Term] \ Term" ("(3SUM _:_./ _)" 20) translations - "\x:A. B" \ "CONST Sum(A, \x. B)" - "SUM x:A. B" \ "CONST Sum(A, \x. B)" + "\x:A. B" \ "CONST Sum A (\x. B)" + "SUM x:A. B" \ "CONST Sum A (\x. B)" text "Nondependent pair." @@ -40,25 +40,25 @@ and and Sum_elim: "\i A B C f p. \ C: \x:A. B(x) \ U(i); - \x y. \x: A; y: B(x)\ \ f(x, y) : C((x,y)); + \x y. \x: A; y: B(x)\ \ f(x)(y) : C((x,y)); p : \x:A. B(x) - \ \ ind\<^sub>\(f, p) : C(p)" (* What does writing \x y. f(x, y) change? *) + \ \ ind\<^sub>\(f)(p) : C(p)" (* What does writing \x y. f(x, y) change? *) and Sum_comp: "\i A B C f a b. \ - A : U(i); + A: U(i); B: A \ U(i); - C: \x:A. B x \ U(i); - \x y. \x : A; y : B x\ \ f x y : C (x,y); - a : A; - b : B a - \ \ ind\<^sub>\[A,B] C f (a,b) \ f a b" + C: \x:A. B(x) \ U(i); + \x y. \x: A; y :B(x)\ \ f(x)(y) : C((x,y)); + a: A; + b: B(a) + \ \ ind\<^sub>\(f)((a,b)) \ f(a)(b)" text "Admissible inference rules for sum formation:" axiomatization where - Sum_form_cond1: "\i A B. (\x:A. B x : U(i)) \ A : U(i)" + Sum_form_cond1: "\i A B. (\x:A. B(x): U(i)) \ A: U(i)" and - Sum_form_cond2: "\i A B. (\x:A. B x : U(i)) \ B: A \ U(i)" + Sum_form_cond2: "\i A B. (\x:A. B(x): U(i)) \ B: A \ U(i)" lemmas Sum_rules [intro] = Sum_form Sum_intro Sum_elim Sum_comp lemmas Sum_form_conds [intro (*elim, wellform*)] = Sum_form_cond1 Sum_form_cond2 @@ -69,11 +69,11 @@ section \Empty type\ axiomatization Empty :: Term ("\") and - indEmpty :: "[Typefam, Term] \ Term" ("(1ind\<^sub>\)") + indEmpty :: "Term \ Term" ("(1ind\<^sub>\)") where Empty_form: "\ : U(O)" and - Empty_elim: "\i C z. \C: \ \ U(i); z : \\ \ ind\<^sub>\ C z : C z" + Empty_elim: "\i C z. \C: \ \ U(i); z: \\ \ ind\<^sub>\(z): C(z)" lemmas Empty_rules [intro] = Empty_form Empty_elim diff --git a/scratch.thy b/scratch.thy index b88a8fc..55e7023 100644 --- a/scratch.thy +++ b/scratch.thy @@ -3,9 +3,9 @@ theory scratch begin -abbreviation pred where "pred \ \<^bold>\n:\. (ind\<^sub>\ (\n. \) (\n c. n) 0 n)" +abbreviation pred where "pred \ \<^bold>\n:\. ind\<^sub>\(\n c. n, 0, n)" -schematic_goal "?a : (pred`0) =\<^sub>\ 0" +schematic_goal "?a: (pred`0) =\<^sub>\ 0" apply (subst comp) apply (rule Nat_form) prefer 4 apply (subst comp) -- cgit v1.2.3