itself is instance of eq
authorhaftmann
Wed, 13 May 2009 18:41:35 +0200
changeset 31132 bfafc204042a
parent 31130 94cb206f8f6a
child 31133 a9f728dc5c8e
itself is instance of eq
src/HOL/HOL.thy
--- a/src/HOL/HOL.thy	Tue May 12 21:39:19 2009 +0200
+++ b/src/HOL/HOL.thy	Wed May 13 18:41:35 2009 +0200
@@ -1836,6 +1836,22 @@
 
 lemmas [code, code unfold, symmetric, code post] = imp_conv_disj
 
+instantiation itself :: (type) eq
+begin
+
+definition eq_itself :: "'a itself \<Rightarrow> 'a itself \<Rightarrow> bool" where
+  "eq_itself x y \<longleftrightarrow> x = y"
+
+instance proof
+qed (fact eq_itself_def)
+
+end
+
+lemma eq_itself_code [code]:
+  "eq_class.eq TYPE('a) TYPE('a) \<longleftrightarrow> True"
+  by (simp add: eq)
+
+
 text {* Equality *}
 
 declare simp_thms(6) [code nbe]