aboutsummaryrefslogtreecommitdiff
path: root/test.thy
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test.thy29
1 files changed, 18 insertions, 11 deletions
diff --git a/test.thy b/test.thy
index 94ba900..d22e710 100644
--- a/test.thy
+++ b/test.thy
@@ -2,12 +2,19 @@ theory test
imports HoTT
begin
+text \<open>Check trivial stuff:\<close>
lemma "Null : U"
by (rule Null_form)
+text \<open>
+Do functions behave like we expect them to?
+(Or, is my implementation at least somewhat correct?...
+\<close>
+
lemma "A \<equiv> B \<Longrightarrow> (\<^bold>\<lambda>x. x) : B\<rightarrow>A"
proof -
- have "\<And>x. A \<equiv> B \<Longrightarrow> x : B \<Longrightarrow> x : A" by (rule equal_types)
+ have "A \<equiv> B \<Longrightarrow> B \<equiv> A" by (rule DefEq_symmetry)
+ then have "\<And>x. A \<equiv> B \<Longrightarrow> x : B \<Longrightarrow> x : A" by (rule equal_types)
thus "A \<equiv> B \<Longrightarrow> (\<^bold>\<lambda>x. x) : B\<rightarrow>A" by (rule Function_intro)
qed
@@ -17,19 +24,19 @@ proof -
thus "\<^bold>\<lambda>x. \<^bold>\<lambda>y. x : A\<rightarrow>B\<rightarrow>A" by (rule Function_intro)
qed
-(* The previous proofs are nice, BUT I want to be able to do something like the following:
-lemma "x : A \<Longrightarrow> \<^bold>\<lambda>x. x : B\<rightarrow>B" <Fail>
-i.e. I want to be able to associate a type to variables, and have the type remembered by any
-binding I define later.
-
-Do I need to give up using the \<open>binder\<close> syntax in order to do this?
-*)
-
+text \<open>Here's a dumb proof that 2 is a natural number:\<close>
lemma "succ(succ 0) : Nat"
proof -
- have "(succ 0) : Nat" by (rule Nat_intro2)
- from this have "succ(succ 0) : Nat" by (rule Nat_intro2)
+ have "0 : Nat" by (rule Nat_intro1)
+ from this have "(succ 0) : Nat" by (rule Nat_intro2)
+ thus "succ(succ 0) : Nat" by (rule Nat_intro2)
qed
+text \<open>
+We can of course iterate the above for as many applications of \<open>succ\<close> as we like.
+The next thing to do is to implement some kind of induction tactic to automate such proofs.
+
+When we get more stuff working, I'd like to aim for formalizing the encode-decode method.
+\<close>
end \ No newline at end of file