src/HOL/Datatype_Universe.thy
author webertj
Mon Mar 07 19:30:53 2005 +0100 (2005-03-07)
changeset 15584 3478bb4f93ff
parent 15413 901d1bfedf09
child 17084 fb0a80aef0be
permissions -rw-r--r--
refute_params: default value itself=1 added (for type classes)
     1 (*  Title:      HOL/Datatype_Universe.thy
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1993  University of Cambridge
     5 
     6 Could <*> be generalized to a general summation (Sigma)?
     7 *)
     8 
     9 header{*Analogues of the Cartesian Product and Disjoint Sum for Datatypes*}
    10 
    11 theory Datatype_Universe
    12 imports NatArith Sum_Type
    13 begin
    14 
    15 
    16 typedef (Node)
    17   ('a,'b) node = "{p. EX f x k. p = (f::nat=>'b+nat, x::'a+nat) & f k = Inr 0}"
    18     --{*it is a subtype of @{text "(nat=>'b+nat) * ('a+nat)"}*}
    19   by auto
    20 
    21 text{*Datatypes will be represented by sets of type @{text node}*}
    22 
    23 types 'a item        = "('a, unit) node set"
    24       ('a, 'b) dtree = "('a, 'b) node set"
    25 
    26 consts
    27   apfst     :: "['a=>'c, 'a*'b] => 'c*'b"
    28   Push      :: "[('b + nat), nat => ('b + nat)] => (nat => ('b + nat))"
    29 
    30   Push_Node :: "[('b + nat), ('a, 'b) node] => ('a, 'b) node"
    31   ndepth    :: "('a, 'b) node => nat"
    32 
    33   Atom      :: "('a + nat) => ('a, 'b) dtree"
    34   Leaf      :: "'a => ('a, 'b) dtree"
    35   Numb      :: "nat => ('a, 'b) dtree"
    36   Scons     :: "[('a, 'b) dtree, ('a, 'b) dtree] => ('a, 'b) dtree"
    37   In0       :: "('a, 'b) dtree => ('a, 'b) dtree"
    38   In1       :: "('a, 'b) dtree => ('a, 'b) dtree"
    39   Lim       :: "('b => ('a, 'b) dtree) => ('a, 'b) dtree"
    40 
    41   ntrunc    :: "[nat, ('a, 'b) dtree] => ('a, 'b) dtree"
    42 
    43   uprod     :: "[('a, 'b) dtree set, ('a, 'b) dtree set]=> ('a, 'b) dtree set"
    44   usum      :: "[('a, 'b) dtree set, ('a, 'b) dtree set]=> ('a, 'b) dtree set"
    45 
    46   Split     :: "[[('a, 'b) dtree, ('a, 'b) dtree]=>'c, ('a, 'b) dtree] => 'c"
    47   Case      :: "[[('a, 'b) dtree]=>'c, [('a, 'b) dtree]=>'c, ('a, 'b) dtree] => 'c"
    48 
    49   dprod     :: "[(('a, 'b) dtree * ('a, 'b) dtree)set, (('a, 'b) dtree * ('a, 'b) dtree)set]
    50                 => (('a, 'b) dtree * ('a, 'b) dtree)set"
    51   dsum      :: "[(('a, 'b) dtree * ('a, 'b) dtree)set, (('a, 'b) dtree * ('a, 'b) dtree)set]
    52                 => (('a, 'b) dtree * ('a, 'b) dtree)set"
    53 
    54 
    55 defs
    56 
    57   Push_Node_def:  "Push_Node == (%n x. Abs_Node (apfst (Push n) (Rep_Node x)))"
    58 
    59   (*crude "lists" of nats -- needed for the constructions*)
    60   apfst_def:  "apfst == (%f (x,y). (f(x),y))"
    61   Push_def:   "Push == (%b h. nat_case b h)"
    62 
    63   (** operations on S-expressions -- sets of nodes **)
    64 
    65   (*S-expression constructors*)
    66   Atom_def:   "Atom == (%x. {Abs_Node((%k. Inr 0, x))})"
    67   Scons_def:  "Scons M N == (Push_Node (Inr 1) ` M) Un (Push_Node (Inr (Suc 1)) ` N)"
    68 
    69   (*Leaf nodes, with arbitrary or nat labels*)
    70   Leaf_def:   "Leaf == Atom o Inl"
    71   Numb_def:   "Numb == Atom o Inr"
    72 
    73   (*Injections of the "disjoint sum"*)
    74   In0_def:    "In0(M) == Scons (Numb 0) M"
    75   In1_def:    "In1(M) == Scons (Numb 1) M"
    76 
    77   (*Function spaces*)
    78   Lim_def: "Lim f == Union {z. ? x. z = Push_Node (Inl x) ` (f x)}"
    79 
    80   (*the set of nodes with depth less than k*)
    81   ndepth_def: "ndepth(n) == (%(f,x). LEAST k. f k = Inr 0) (Rep_Node n)"
    82   ntrunc_def: "ntrunc k N == {n. n:N & ndepth(n)<k}"
    83 
    84   (*products and sums for the "universe"*)
    85   uprod_def:  "uprod A B == UN x:A. UN y:B. { Scons x y }"
    86   usum_def:   "usum A B == In0`A Un In1`B"
    87 
    88   (*the corresponding eliminators*)
    89   Split_def:  "Split c M == THE u. EX x y. M = Scons x y & u = c x y"
    90 
    91   Case_def:   "Case c d M == THE u.  (EX x . M = In0(x) & u = c(x))
    92                                   | (EX y . M = In1(y) & u = d(y))"
    93 
    94 
    95   (** equality for the "universe" **)
    96 
    97   dprod_def:  "dprod r s == UN (x,x'):r. UN (y,y'):s. {(Scons x y, Scons x' y')}"
    98 
    99   dsum_def:   "dsum r s == (UN (x,x'):r. {(In0(x),In0(x'))}) Un
   100                           (UN (y,y'):s. {(In1(y),In1(y'))})"
   101 
   102 
   103 
   104 (** apfst -- can be used in similar type definitions **)
   105 
   106 lemma apfst_conv [simp]: "apfst f (a,b) = (f(a),b)"
   107 by (simp add: apfst_def)
   108 
   109 
   110 lemma apfst_convE: 
   111     "[| q = apfst f p;  !!x y. [| p = (x,y);  q = (f(x),y) |] ==> R  
   112      |] ==> R"
   113 by (force simp add: apfst_def)
   114 
   115 (** Push -- an injection, analogous to Cons on lists **)
   116 
   117 lemma Push_inject1: "Push i f = Push j g  ==> i=j"
   118 apply (simp add: Push_def expand_fun_eq) 
   119 apply (drule_tac x=0 in spec, simp) 
   120 done
   121 
   122 lemma Push_inject2: "Push i f = Push j g  ==> f=g"
   123 apply (auto simp add: Push_def expand_fun_eq) 
   124 apply (drule_tac x="Suc x" in spec, simp) 
   125 done
   126 
   127 lemma Push_inject:
   128     "[| Push i f =Push j g;  [| i=j;  f=g |] ==> P |] ==> P"
   129 by (blast dest: Push_inject1 Push_inject2) 
   130 
   131 lemma Push_neq_K0: "Push (Inr (Suc k)) f = (%z. Inr 0) ==> P"
   132 by (auto simp add: Push_def expand_fun_eq split: nat.split_asm)
   133 
   134 lemmas Abs_Node_inj = Abs_Node_inject [THEN [2] rev_iffD1, standard]
   135 
   136 
   137 (*** Introduction rules for Node ***)
   138 
   139 lemma Node_K0_I: "(%k. Inr 0, a) : Node"
   140 by (simp add: Node_def)
   141 
   142 lemma Node_Push_I: "p: Node ==> apfst (Push i) p : Node"
   143 apply (simp add: Node_def Push_def) 
   144 apply (fast intro!: apfst_conv nat_case_Suc [THEN trans])
   145 done
   146 
   147 
   148 subsubsection{*Freeness: Distinctness of Constructors*}
   149 
   150 (** Scons vs Atom **)
   151 
   152 lemma Scons_not_Atom [iff]: "Scons M N \<noteq> Atom(a)"
   153 apply (simp add: Atom_def Scons_def Push_Node_def One_nat_def)
   154 apply (blast intro: Node_K0_I Rep_Node [THEN Node_Push_I] 
   155          dest!: Abs_Node_inj 
   156          elim!: apfst_convE sym [THEN Push_neq_K0])  
   157 done
   158 
   159 lemmas Atom_not_Scons = Scons_not_Atom [THEN not_sym, standard, iff]
   160 
   161 
   162 (*** Injectiveness ***)
   163 
   164 (** Atomic nodes **)
   165 
   166 lemma inj_Atom: "inj(Atom)"
   167 apply (simp add: Atom_def)
   168 apply (blast intro!: inj_onI Node_K0_I dest!: Abs_Node_inj)
   169 done
   170 lemmas Atom_inject = inj_Atom [THEN injD, standard]
   171 
   172 lemma Atom_Atom_eq [iff]: "(Atom(a)=Atom(b)) = (a=b)"
   173 by (blast dest!: Atom_inject)
   174 
   175 lemma inj_Leaf: "inj(Leaf)"
   176 apply (simp add: Leaf_def o_def)
   177 apply (rule inj_onI)
   178 apply (erule Atom_inject [THEN Inl_inject])
   179 done
   180 
   181 lemmas Leaf_inject = inj_Leaf [THEN injD, standard, dest!]
   182 
   183 lemma inj_Numb: "inj(Numb)"
   184 apply (simp add: Numb_def o_def)
   185 apply (rule inj_onI)
   186 apply (erule Atom_inject [THEN Inr_inject])
   187 done
   188 
   189 lemmas Numb_inject = inj_Numb [THEN injD, standard, dest!]
   190 
   191 
   192 (** Injectiveness of Push_Node **)
   193 
   194 lemma Push_Node_inject:
   195     "[| Push_Node i m =Push_Node j n;  [| i=j;  m=n |] ==> P  
   196      |] ==> P"
   197 apply (simp add: Push_Node_def)
   198 apply (erule Abs_Node_inj [THEN apfst_convE])
   199 apply (rule Rep_Node [THEN Node_Push_I])+
   200 apply (erule sym [THEN apfst_convE]) 
   201 apply (blast intro: Rep_Node_inject [THEN iffD1] trans sym elim!: Push_inject)
   202 done
   203 
   204 
   205 (** Injectiveness of Scons **)
   206 
   207 lemma Scons_inject_lemma1: "Scons M N <= Scons M' N' ==> M<=M'"
   208 apply (simp add: Scons_def One_nat_def)
   209 apply (blast dest!: Push_Node_inject)
   210 done
   211 
   212 lemma Scons_inject_lemma2: "Scons M N <= Scons M' N' ==> N<=N'"
   213 apply (simp add: Scons_def One_nat_def)
   214 apply (blast dest!: Push_Node_inject)
   215 done
   216 
   217 lemma Scons_inject1: "Scons M N = Scons M' N' ==> M=M'"
   218 apply (erule equalityE)
   219 apply (rules intro: equalityI Scons_inject_lemma1)
   220 done
   221 
   222 lemma Scons_inject2: "Scons M N = Scons M' N' ==> N=N'"
   223 apply (erule equalityE)
   224 apply (rules intro: equalityI Scons_inject_lemma2)
   225 done
   226 
   227 lemma Scons_inject:
   228     "[| Scons M N = Scons M' N';  [| M=M';  N=N' |] ==> P |] ==> P"
   229 by (rules dest: Scons_inject1 Scons_inject2)
   230 
   231 lemma Scons_Scons_eq [iff]: "(Scons M N = Scons M' N') = (M=M' & N=N')"
   232 by (blast elim!: Scons_inject)
   233 
   234 (*** Distinctness involving Leaf and Numb ***)
   235 
   236 (** Scons vs Leaf **)
   237 
   238 lemma Scons_not_Leaf [iff]: "Scons M N \<noteq> Leaf(a)"
   239 by (simp add: Leaf_def o_def Scons_not_Atom)
   240 
   241 lemmas Leaf_not_Scons = Scons_not_Leaf [THEN not_sym, standard, iff]
   242 
   243 
   244 (** Scons vs Numb **)
   245 
   246 lemma Scons_not_Numb [iff]: "Scons M N \<noteq> Numb(k)"
   247 by (simp add: Numb_def o_def Scons_not_Atom)
   248 
   249 lemmas Numb_not_Scons = Scons_not_Numb [THEN not_sym, standard, iff]
   250 
   251 
   252 
   253 (** Leaf vs Numb **)
   254 
   255 lemma Leaf_not_Numb [iff]: "Leaf(a) \<noteq> Numb(k)"
   256 by (simp add: Leaf_def Numb_def)
   257 
   258 lemmas Numb_not_Leaf = Leaf_not_Numb [THEN not_sym, standard, iff]
   259 
   260 
   261 
   262 (*** ndepth -- the depth of a node ***)
   263 
   264 lemma ndepth_K0: "ndepth (Abs_Node(%k. Inr 0, x)) = 0"
   265 by (simp add: ndepth_def  Node_K0_I [THEN Abs_Node_inverse] Least_equality)
   266 
   267 lemma ndepth_Push_Node_aux:
   268      "nat_case (Inr (Suc i)) f k = Inr 0 --> Suc(LEAST x. f x = Inr 0) <= k"
   269 apply (induct_tac "k", auto)
   270 apply (erule Least_le)
   271 done
   272 
   273 lemma ndepth_Push_Node: 
   274     "ndepth (Push_Node (Inr (Suc i)) n) = Suc(ndepth(n))"
   275 apply (insert Rep_Node [of n, unfolded Node_def])
   276 apply (auto simp add: ndepth_def Push_Node_def
   277                  Rep_Node [THEN Node_Push_I, THEN Abs_Node_inverse])
   278 apply (rule Least_equality)
   279 apply (auto simp add: Push_def ndepth_Push_Node_aux)
   280 apply (erule LeastI)
   281 done
   282 
   283 
   284 (*** ntrunc applied to the various node sets ***)
   285 
   286 lemma ntrunc_0 [simp]: "ntrunc 0 M = {}"
   287 by (simp add: ntrunc_def)
   288 
   289 lemma ntrunc_Atom [simp]: "ntrunc (Suc k) (Atom a) = Atom(a)"
   290 by (auto simp add: Atom_def ntrunc_def ndepth_K0)
   291 
   292 lemma ntrunc_Leaf [simp]: "ntrunc (Suc k) (Leaf a) = Leaf(a)"
   293 by (simp add: Leaf_def o_def ntrunc_Atom)
   294 
   295 lemma ntrunc_Numb [simp]: "ntrunc (Suc k) (Numb i) = Numb(i)"
   296 by (simp add: Numb_def o_def ntrunc_Atom)
   297 
   298 lemma ntrunc_Scons [simp]: 
   299     "ntrunc (Suc k) (Scons M N) = Scons (ntrunc k M) (ntrunc k N)"
   300 by (auto simp add: Scons_def ntrunc_def One_nat_def ndepth_Push_Node) 
   301 
   302 
   303 
   304 (** Injection nodes **)
   305 
   306 lemma ntrunc_one_In0 [simp]: "ntrunc (Suc 0) (In0 M) = {}"
   307 apply (simp add: In0_def)
   308 apply (simp add: Scons_def)
   309 done
   310 
   311 lemma ntrunc_In0 [simp]: "ntrunc (Suc(Suc k)) (In0 M) = In0 (ntrunc (Suc k) M)"
   312 by (simp add: In0_def)
   313 
   314 lemma ntrunc_one_In1 [simp]: "ntrunc (Suc 0) (In1 M) = {}"
   315 apply (simp add: In1_def)
   316 apply (simp add: Scons_def)
   317 done
   318 
   319 lemma ntrunc_In1 [simp]: "ntrunc (Suc(Suc k)) (In1 M) = In1 (ntrunc (Suc k) M)"
   320 by (simp add: In1_def)
   321 
   322 
   323 subsection{*Set Constructions*}
   324 
   325 
   326 (*** Cartesian Product ***)
   327 
   328 lemma uprodI [intro!]: "[| M:A;  N:B |] ==> Scons M N : uprod A B"
   329 by (simp add: uprod_def)
   330 
   331 (*The general elimination rule*)
   332 lemma uprodE [elim!]:
   333     "[| c : uprod A B;   
   334         !!x y. [| x:A;  y:B;  c = Scons x y |] ==> P  
   335      |] ==> P"
   336 by (auto simp add: uprod_def) 
   337 
   338 
   339 (*Elimination of a pair -- introduces no eigenvariables*)
   340 lemma uprodE2: "[| Scons M N : uprod A B;  [| M:A;  N:B |] ==> P |] ==> P"
   341 by (auto simp add: uprod_def)
   342 
   343 
   344 (*** Disjoint Sum ***)
   345 
   346 lemma usum_In0I [intro]: "M:A ==> In0(M) : usum A B"
   347 by (simp add: usum_def)
   348 
   349 lemma usum_In1I [intro]: "N:B ==> In1(N) : usum A B"
   350 by (simp add: usum_def)
   351 
   352 lemma usumE [elim!]: 
   353     "[| u : usum A B;   
   354         !!x. [| x:A;  u=In0(x) |] ==> P;  
   355         !!y. [| y:B;  u=In1(y) |] ==> P  
   356      |] ==> P"
   357 by (auto simp add: usum_def)
   358 
   359 
   360 (** Injection **)
   361 
   362 lemma In0_not_In1 [iff]: "In0(M) \<noteq> In1(N)"
   363 by (auto simp add: In0_def In1_def One_nat_def)
   364 
   365 lemmas In1_not_In0 = In0_not_In1 [THEN not_sym, standard, iff]
   366 
   367 lemma In0_inject: "In0(M) = In0(N) ==>  M=N"
   368 by (simp add: In0_def)
   369 
   370 lemma In1_inject: "In1(M) = In1(N) ==>  M=N"
   371 by (simp add: In1_def)
   372 
   373 lemma In0_eq [iff]: "(In0 M = In0 N) = (M=N)"
   374 by (blast dest!: In0_inject)
   375 
   376 lemma In1_eq [iff]: "(In1 M = In1 N) = (M=N)"
   377 by (blast dest!: In1_inject)
   378 
   379 lemma inj_In0: "inj In0"
   380 by (blast intro!: inj_onI)
   381 
   382 lemma inj_In1: "inj In1"
   383 by (blast intro!: inj_onI)
   384 
   385 
   386 (*** Function spaces ***)
   387 
   388 lemma Lim_inject: "Lim f = Lim g ==> f = g"
   389 apply (simp add: Lim_def)
   390 apply (rule ext)
   391 apply (blast elim!: Push_Node_inject)
   392 done
   393 
   394 
   395 (*** proving equality of sets and functions using ntrunc ***)
   396 
   397 lemma ntrunc_subsetI: "ntrunc k M <= M"
   398 by (auto simp add: ntrunc_def)
   399 
   400 lemma ntrunc_subsetD: "(!!k. ntrunc k M <= N) ==> M<=N"
   401 by (auto simp add: ntrunc_def)
   402 
   403 (*A generalized form of the take-lemma*)
   404 lemma ntrunc_equality: "(!!k. ntrunc k M = ntrunc k N) ==> M=N"
   405 apply (rule equalityI)
   406 apply (rule_tac [!] ntrunc_subsetD)
   407 apply (rule_tac [!] ntrunc_subsetI [THEN [2] subset_trans], auto) 
   408 done
   409 
   410 lemma ntrunc_o_equality: 
   411     "[| !!k. (ntrunc(k) o h1) = (ntrunc(k) o h2) |] ==> h1=h2"
   412 apply (rule ntrunc_equality [THEN ext])
   413 apply (simp add: expand_fun_eq) 
   414 done
   415 
   416 
   417 (*** Monotonicity ***)
   418 
   419 lemma uprod_mono: "[| A<=A';  B<=B' |] ==> uprod A B <= uprod A' B'"
   420 by (simp add: uprod_def, blast)
   421 
   422 lemma usum_mono: "[| A<=A';  B<=B' |] ==> usum A B <= usum A' B'"
   423 by (simp add: usum_def, blast)
   424 
   425 lemma Scons_mono: "[| M<=M';  N<=N' |] ==> Scons M N <= Scons M' N'"
   426 by (simp add: Scons_def, blast)
   427 
   428 lemma In0_mono: "M<=N ==> In0(M) <= In0(N)"
   429 by (simp add: In0_def subset_refl Scons_mono)
   430 
   431 lemma In1_mono: "M<=N ==> In1(M) <= In1(N)"
   432 by (simp add: In1_def subset_refl Scons_mono)
   433 
   434 
   435 (*** Split and Case ***)
   436 
   437 lemma Split [simp]: "Split c (Scons M N) = c M N"
   438 by (simp add: Split_def)
   439 
   440 lemma Case_In0 [simp]: "Case c d (In0 M) = c(M)"
   441 by (simp add: Case_def)
   442 
   443 lemma Case_In1 [simp]: "Case c d (In1 N) = d(N)"
   444 by (simp add: Case_def)
   445 
   446 
   447 
   448 (**** UN x. B(x) rules ****)
   449 
   450 lemma ntrunc_UN1: "ntrunc k (UN x. f(x)) = (UN x. ntrunc k (f x))"
   451 by (simp add: ntrunc_def, blast)
   452 
   453 lemma Scons_UN1_x: "Scons (UN x. f x) M = (UN x. Scons (f x) M)"
   454 by (simp add: Scons_def, blast)
   455 
   456 lemma Scons_UN1_y: "Scons M (UN x. f x) = (UN x. Scons M (f x))"
   457 by (simp add: Scons_def, blast)
   458 
   459 lemma In0_UN1: "In0(UN x. f(x)) = (UN x. In0(f(x)))"
   460 by (simp add: In0_def Scons_UN1_y)
   461 
   462 lemma In1_UN1: "In1(UN x. f(x)) = (UN x. In1(f(x)))"
   463 by (simp add: In1_def Scons_UN1_y)
   464 
   465 
   466 (*** Equality for Cartesian Product ***)
   467 
   468 lemma dprodI [intro!]: 
   469     "[| (M,M'):r;  (N,N'):s |] ==> (Scons M N, Scons M' N') : dprod r s"
   470 by (auto simp add: dprod_def)
   471 
   472 (*The general elimination rule*)
   473 lemma dprodE [elim!]: 
   474     "[| c : dprod r s;   
   475         !!x y x' y'. [| (x,x') : r;  (y,y') : s;  
   476                         c = (Scons x y, Scons x' y') |] ==> P  
   477      |] ==> P"
   478 by (auto simp add: dprod_def)
   479 
   480 
   481 (*** Equality for Disjoint Sum ***)
   482 
   483 lemma dsum_In0I [intro]: "(M,M'):r ==> (In0(M), In0(M')) : dsum r s"
   484 by (auto simp add: dsum_def)
   485 
   486 lemma dsum_In1I [intro]: "(N,N'):s ==> (In1(N), In1(N')) : dsum r s"
   487 by (auto simp add: dsum_def)
   488 
   489 lemma dsumE [elim!]: 
   490     "[| w : dsum r s;   
   491         !!x x'. [| (x,x') : r;  w = (In0(x), In0(x')) |] ==> P;  
   492         !!y y'. [| (y,y') : s;  w = (In1(y), In1(y')) |] ==> P  
   493      |] ==> P"
   494 by (auto simp add: dsum_def)
   495 
   496 
   497 (*** Monotonicity ***)
   498 
   499 lemma dprod_mono: "[| r<=r';  s<=s' |] ==> dprod r s <= dprod r' s'"
   500 by blast
   501 
   502 lemma dsum_mono: "[| r<=r';  s<=s' |] ==> dsum r s <= dsum r' s'"
   503 by blast
   504 
   505 
   506 (*** Bounding theorems ***)
   507 
   508 lemma dprod_Sigma: "(dprod (A <*> B) (C <*> D)) <= (uprod A C) <*> (uprod B D)"
   509 by blast
   510 
   511 lemmas dprod_subset_Sigma = subset_trans [OF dprod_mono dprod_Sigma, standard]
   512 
   513 (*Dependent version*)
   514 lemma dprod_subset_Sigma2:
   515      "(dprod (Sigma A B) (Sigma C D)) <= 
   516       Sigma (uprod A C) (Split (%x y. uprod (B x) (D y)))"
   517 by auto
   518 
   519 lemma dsum_Sigma: "(dsum (A <*> B) (C <*> D)) <= (usum A C) <*> (usum B D)"
   520 by blast
   521 
   522 lemmas dsum_subset_Sigma = subset_trans [OF dsum_mono dsum_Sigma, standard]
   523 
   524 
   525 (*** Domain ***)
   526 
   527 lemma Domain_dprod [simp]: "Domain (dprod r s) = uprod (Domain r) (Domain s)"
   528 by auto
   529 
   530 lemma Domain_dsum [simp]: "Domain (dsum r s) = usum (Domain r) (Domain s)"
   531 by auto
   532 
   533 ML
   534 {*
   535 val apfst_conv = thm "apfst_conv";
   536 val apfst_convE = thm "apfst_convE";
   537 val Push_inject1 = thm "Push_inject1";
   538 val Push_inject2 = thm "Push_inject2";
   539 val Push_inject = thm "Push_inject";
   540 val Push_neq_K0 = thm "Push_neq_K0";
   541 val Abs_Node_inj = thm "Abs_Node_inj";
   542 val Node_K0_I = thm "Node_K0_I";
   543 val Node_Push_I = thm "Node_Push_I";
   544 val Scons_not_Atom = thm "Scons_not_Atom";
   545 val Atom_not_Scons = thm "Atom_not_Scons";
   546 val inj_Atom = thm "inj_Atom";
   547 val Atom_inject = thm "Atom_inject";
   548 val Atom_Atom_eq = thm "Atom_Atom_eq";
   549 val inj_Leaf = thm "inj_Leaf";
   550 val Leaf_inject = thm "Leaf_inject";
   551 val inj_Numb = thm "inj_Numb";
   552 val Numb_inject = thm "Numb_inject";
   553 val Push_Node_inject = thm "Push_Node_inject";
   554 val Scons_inject1 = thm "Scons_inject1";
   555 val Scons_inject2 = thm "Scons_inject2";
   556 val Scons_inject = thm "Scons_inject";
   557 val Scons_Scons_eq = thm "Scons_Scons_eq";
   558 val Scons_not_Leaf = thm "Scons_not_Leaf";
   559 val Leaf_not_Scons = thm "Leaf_not_Scons";
   560 val Scons_not_Numb = thm "Scons_not_Numb";
   561 val Numb_not_Scons = thm "Numb_not_Scons";
   562 val Leaf_not_Numb = thm "Leaf_not_Numb";
   563 val Numb_not_Leaf = thm "Numb_not_Leaf";
   564 val ndepth_K0 = thm "ndepth_K0";
   565 val ndepth_Push_Node_aux = thm "ndepth_Push_Node_aux";
   566 val ndepth_Push_Node = thm "ndepth_Push_Node";
   567 val ntrunc_0 = thm "ntrunc_0";
   568 val ntrunc_Atom = thm "ntrunc_Atom";
   569 val ntrunc_Leaf = thm "ntrunc_Leaf";
   570 val ntrunc_Numb = thm "ntrunc_Numb";
   571 val ntrunc_Scons = thm "ntrunc_Scons";
   572 val ntrunc_one_In0 = thm "ntrunc_one_In0";
   573 val ntrunc_In0 = thm "ntrunc_In0";
   574 val ntrunc_one_In1 = thm "ntrunc_one_In1";
   575 val ntrunc_In1 = thm "ntrunc_In1";
   576 val uprodI = thm "uprodI";
   577 val uprodE = thm "uprodE";
   578 val uprodE2 = thm "uprodE2";
   579 val usum_In0I = thm "usum_In0I";
   580 val usum_In1I = thm "usum_In1I";
   581 val usumE = thm "usumE";
   582 val In0_not_In1 = thm "In0_not_In1";
   583 val In1_not_In0 = thm "In1_not_In0";
   584 val In0_inject = thm "In0_inject";
   585 val In1_inject = thm "In1_inject";
   586 val In0_eq = thm "In0_eq";
   587 val In1_eq = thm "In1_eq";
   588 val inj_In0 = thm "inj_In0";
   589 val inj_In1 = thm "inj_In1";
   590 val Lim_inject = thm "Lim_inject";
   591 val ntrunc_subsetI = thm "ntrunc_subsetI";
   592 val ntrunc_subsetD = thm "ntrunc_subsetD";
   593 val ntrunc_equality = thm "ntrunc_equality";
   594 val ntrunc_o_equality = thm "ntrunc_o_equality";
   595 val uprod_mono = thm "uprod_mono";
   596 val usum_mono = thm "usum_mono";
   597 val Scons_mono = thm "Scons_mono";
   598 val In0_mono = thm "In0_mono";
   599 val In1_mono = thm "In1_mono";
   600 val Split = thm "Split";
   601 val Case_In0 = thm "Case_In0";
   602 val Case_In1 = thm "Case_In1";
   603 val ntrunc_UN1 = thm "ntrunc_UN1";
   604 val Scons_UN1_x = thm "Scons_UN1_x";
   605 val Scons_UN1_y = thm "Scons_UN1_y";
   606 val In0_UN1 = thm "In0_UN1";
   607 val In1_UN1 = thm "In1_UN1";
   608 val dprodI = thm "dprodI";
   609 val dprodE = thm "dprodE";
   610 val dsum_In0I = thm "dsum_In0I";
   611 val dsum_In1I = thm "dsum_In1I";
   612 val dsumE = thm "dsumE";
   613 val dprod_mono = thm "dprod_mono";
   614 val dsum_mono = thm "dsum_mono";
   615 val dprod_Sigma = thm "dprod_Sigma";
   616 val dprod_subset_Sigma = thm "dprod_subset_Sigma";
   617 val dprod_subset_Sigma2 = thm "dprod_subset_Sigma2";
   618 val dsum_Sigma = thm "dsum_Sigma";
   619 val dsum_subset_Sigma = thm "dsum_subset_Sigma";
   620 val Domain_dprod = thm "Domain_dprod";
   621 val Domain_dsum = thm "Domain_dsum";
   622 *}
   623 
   624 end