use selector
authorblanchet
Thu, 18 Sep 2014 16:47:40 +0200
changeset 58378 cf6f16bc11a7
parent 58377 c6f93b8d2d8e
child 58379 c044539a2bda
use selector
src/HOL/Library/Phantom_Type.thy
--- a/src/HOL/Library/Phantom_Type.thy	Thu Sep 18 16:47:40 2014 +0200
+++ b/src/HOL/Library/Phantom_Type.thy	Thu Sep 18 16:47:40 2014 +0200
@@ -8,13 +8,7 @@
 imports Main
 begin
 
-datatype ('a, 'b) phantom = phantom 'b
-
-primrec of_phantom :: "('a, 'b) phantom \<Rightarrow> 'b" 
-where "of_phantom (phantom x) = x"
-
-lemma of_phantom_phantom [simp]: "phantom (of_phantom x) = x"
-by(cases x) simp
+datatype ('a, 'b) phantom = phantom (of_phantom: 'b)
 
 lemma type_definition_phantom': "type_definition of_phantom phantom UNIV"
 by(unfold_locales) simp_all