src/HOL/Datatype.thy
changeset 13635 c41e88151b54
parent 12918 bca45be2d25b
child 14187 26dfcd0ac436
     1.1 --- a/src/HOL/Datatype.thy	Wed Oct 09 11:07:13 2002 +0200
     1.2 +++ b/src/HOL/Datatype.thy	Thu Oct 10 14:18:01 2002 +0200
     1.3 @@ -8,13 +8,6 @@
     1.4  
     1.5  theory Datatype = Datatype_Universe:
     1.6  
     1.7 -subsection {* Finishing the datatype package setup *}
     1.8 -
     1.9 -text {* Belongs to theory @{text Datatype_Universe}; hides popular names. *}
    1.10 -hide const Node Atom Leaf Numb Lim Funs Split Case
    1.11 -hide type node item
    1.12 -
    1.13 -
    1.14  subsection {* Representing primitive types *}
    1.15  
    1.16  rep_datatype bool
    1.17 @@ -70,6 +63,26 @@
    1.18      done
    1.19  qed
    1.20  
    1.21 +constdefs
    1.22 +  Suml :: "('a => 'c) => 'a + 'b => 'c"
    1.23 +  "Suml == (%f. sum_case f arbitrary)"
    1.24 +
    1.25 +  Sumr :: "('b => 'c) => 'a + 'b => 'c"
    1.26 +  "Sumr == sum_case arbitrary"
    1.27 +
    1.28 +lemma Suml_inject: "Suml f = Suml g ==> f = g"
    1.29 +  by (unfold Suml_def) (erule sum_case_inject)
    1.30 +
    1.31 +lemma Sumr_inject: "Sumr f = Sumr g ==> f = g"
    1.32 +  by (unfold Sumr_def) (erule sum_case_inject)
    1.33 +
    1.34 +
    1.35 +subsection {* Finishing the datatype package setup *}
    1.36 +
    1.37 +text {* Belongs to theory @{text Datatype_Universe}; hides popular names. *}
    1.38 +hide const Node Atom Leaf Numb Lim Split Case Suml Sumr
    1.39 +hide type node item
    1.40 +
    1.41  
    1.42  subsection {* Further cases/induct rules for tuples *}
    1.43