src/HOL/Datatype.thy
changeset 25836 f7771e4f7064
parent 25672 5850301e83c7
child 26072 f65a7fa2da6c
     1.1 --- a/src/HOL/Datatype.thy	Sat Jan 05 09:16:11 2008 +0100
     1.2 +++ b/src/HOL/Datatype.thy	Sat Jan 05 09:16:27 2008 +0100
     1.3 @@ -610,8 +610,13 @@
     1.4  lemma insert_None_conv_UNIV: "insert None (range Some) = UNIV"
     1.5    by (rule set_ext, case_tac x) auto
     1.6  
     1.7 -instance option :: (finite) finite
     1.8 -proof
     1.9 +instantiation option :: (finite) finite
    1.10 +begin
    1.11 +
    1.12 +definition
    1.13 +  "Finite_Set.itself = TYPE('a option)"
    1.14 +
    1.15 +instance proof
    1.16    have "finite (UNIV :: 'a set)" by (rule finite)
    1.17    hence "finite (insert None (Some ` (UNIV :: 'a set)))" by simp
    1.18    also have "insert None (Some ` (UNIV :: 'a set)) = UNIV"
    1.19 @@ -619,6 +624,8 @@
    1.20    finally show "finite (UNIV :: 'a option set)" .
    1.21  qed
    1.22  
    1.23 +end
    1.24 +
    1.25  lemma univ_option [noatp, code func]:
    1.26    "UNIV = insert (None \<Colon> 'a\<Colon>finite option) (image Some UNIV)"
    1.27    unfolding insert_None_conv_UNIV ..