aboutsummaryrefslogtreecommitdiff
path: root/spartan/data
diff options
context:
space:
mode:
authorJosh Chen2020-06-03 13:10:35 +0200
committerJosh Chen2020-06-03 13:10:35 +0200
commit9050b7414021db31b23a034567ebc6da3f6c5f67 (patch)
tree2f5928e275c3e8ae7d99fef65e7fddf31f11d2f6 /spartan/data
parentccc26cf8073071698f333107fd7443a6af7fb3de (diff)
parent515c142828e66dcb1c273e53816ef8b6e1bb3f01 (diff)
Merge branch 'dev'
Diffstat (limited to '')
-rw-r--r--spartan/data/List.thy6
-rw-r--r--spartan/data/More_Types.thy8
2 files changed, 11 insertions, 3 deletions
diff --git a/spartan/data/List.thy b/spartan/data/List.thy
index 8fdaa1d..1798a23 100644
--- a/spartan/data/List.thy
+++ b/spartan/data/List.thy
@@ -52,14 +52,14 @@ abbreviation "ListRec A C \<equiv> ListInd A (\<lambda>_. C)"
Lemma (derive) ListCase:
assumes
- "A: U i" "\<And>xs. xs: List A \<Longrightarrow> C xs: U i" and
+ "xs: List A" and
nil_case: "c\<^sub>0: C (nil A)" and
cons_case: "\<And>x xs. \<lbrakk>x: A; xs: List A\<rbrakk> \<Longrightarrow> f x xs: C (cons A x xs)" and
- "xs: List A"
+ "\<And>xs. xs: List A \<Longrightarrow> C xs: U i"
shows "?List_cases A (\<lambda>xs. C xs) c\<^sub>0 (\<lambda>x xs. f x xs) xs: C xs"
by (elim xs) (fact nil_case, rule cons_case)
-lemmas List_cases [cases] = ListCase[rotated 4]
+lemmas List_cases [cases] = ListCase[unfolded ListCase_def]
section \<open>Notation\<close>
diff --git a/spartan/data/More_Types.thy b/spartan/data/More_Types.thy
index 625f639..1d7abb9 100644
--- a/spartan/data/More_Types.thy
+++ b/spartan/data/More_Types.thy
@@ -90,6 +90,14 @@ definition "Bool \<equiv> \<top> \<or> \<top>"
definition "true \<equiv> inl \<top> \<top> tt"
definition "false \<equiv> inr \<top> \<top> tt"
+Lemma
+ BoolF: "Bool: U i" and
+ Bool_true: "true: Bool" and
+ Bool_false: "false: Bool"
+ unfolding Bool_def true_def false_def by typechk+
+
+lemmas [intros] = BoolF Bool_true Bool_false
+
\<comment> \<open>Can define if-then-else etc.\<close>