removed old HOL4 import -- corresponding exporter is lost, code is broken, no users known, maintenance nightmare
authorkrauss
Sun, 01 Apr 2012 22:03:45 +0200
changeset 47259 2d4ea84278da
parent 47258 880e587eee9f
child 47260 3b9eeb4a2967
removed old HOL4 import -- corresponding exporter is lost, code is broken, no users known, maintenance nightmare
etc/settings
src/HOL/Import/HOL4/Compatibility.thy
src/HOL/Import/HOL4/Generate.thy
src/HOL/Import/HOL4/Generated/HOL4Base.thy
src/HOL/Import/HOL4/Generated/HOL4Prob.thy
src/HOL/Import/HOL4/Generated/HOL4Real.thy
src/HOL/Import/HOL4/Generated/HOL4Vec.thy
src/HOL/Import/HOL4/Generated/HOL4Word32.thy
src/HOL/Import/HOL4/Generated/arithmetic.imp
src/HOL/Import/HOL4/Generated/bits.imp
src/HOL/Import/HOL4/Generated/bool.imp
src/HOL/Import/HOL4/Generated/boolean_sequence.imp
src/HOL/Import/HOL4/Generated/bword_arith.imp
src/HOL/Import/HOL4/Generated/bword_bitop.imp
src/HOL/Import/HOL4/Generated/bword_num.imp
src/HOL/Import/HOL4/Generated/combin.imp
src/HOL/Import/HOL4/Generated/divides.imp
src/HOL/Import/HOL4/Generated/hrat.imp
src/HOL/Import/HOL4/Generated/hreal.imp
src/HOL/Import/HOL4/Generated/ind_type.imp
src/HOL/Import/HOL4/Generated/lim.imp
src/HOL/Import/HOL4/Generated/list.imp
src/HOL/Import/HOL4/Generated/marker.imp
src/HOL/Import/HOL4/Generated/nets.imp
src/HOL/Import/HOL4/Generated/num.imp
src/HOL/Import/HOL4/Generated/numeral.imp
src/HOL/Import/HOL4/Generated/one.imp
src/HOL/Import/HOL4/Generated/operator.imp
src/HOL/Import/HOL4/Generated/option.imp
src/HOL/Import/HOL4/Generated/pair.imp
src/HOL/Import/HOL4/Generated/poly.imp
src/HOL/Import/HOL4/Generated/powser.imp
src/HOL/Import/HOL4/Generated/pred_set.imp
src/HOL/Import/HOL4/Generated/prim_rec.imp
src/HOL/Import/HOL4/Generated/prime.imp
src/HOL/Import/HOL4/Generated/prob.imp
src/HOL/Import/HOL4/Generated/prob_algebra.imp
src/HOL/Import/HOL4/Generated/prob_canon.imp
src/HOL/Import/HOL4/Generated/prob_extra.imp
src/HOL/Import/HOL4/Generated/prob_indep.imp
src/HOL/Import/HOL4/Generated/prob_pseudo.imp
src/HOL/Import/HOL4/Generated/prob_uniform.imp
src/HOL/Import/HOL4/Generated/real.imp
src/HOL/Import/HOL4/Generated/realax.imp
src/HOL/Import/HOL4/Generated/relation.imp
src/HOL/Import/HOL4/Generated/res_quan.imp
src/HOL/Import/HOL4/Generated/rich_list.imp
src/HOL/Import/HOL4/Generated/seq.imp
src/HOL/Import/HOL4/Generated/state_transformer.imp
src/HOL/Import/HOL4/Generated/sum.imp
src/HOL/Import/HOL4/Generated/topology.imp
src/HOL/Import/HOL4/Generated/transc.imp
src/HOL/Import/HOL4/Generated/word32.imp
src/HOL/Import/HOL4/Generated/word_base.imp
src/HOL/Import/HOL4/Generated/word_bitop.imp
src/HOL/Import/HOL4/Generated/word_num.imp
src/HOL/Import/HOL4/Imported.thy
src/HOL/Import/HOL4/Importer.thy
src/HOL/Import/HOL4/README
src/HOL/Import/HOL4/ROOT.ML
src/HOL/Import/HOL4/Template/GenHOL4Base.thy
src/HOL/Import/HOL4/Template/GenHOL4Prob.thy
src/HOL/Import/HOL4/Template/GenHOL4Real.thy
src/HOL/Import/HOL4/Template/GenHOL4Vec.thy
src/HOL/Import/HOL4/Template/GenHOL4Word32.thy
src/HOL/Import/HOL4/generate.ML
src/HOL/Import/HOL4/import.ML
src/HOL/Import/HOL4/import_rews.ML
src/HOL/Import/HOL4/imported.ML
src/HOL/Import/HOL4/proof_kernel.ML
src/HOL/Import/HOL4/replay.ML
src/HOL/Import/HOL4/shuffler.ML
src/HOL/IsaMakefile
--- a/etc/settings	Sun Apr 01 14:50:47 2012 +0200
+++ b/etc/settings	Sun Apr 01 22:03:45 2012 +0200
@@ -190,9 +190,6 @@
 
 ## Set HOME only for tools you have installed!
 
-# HOL4 proof objects (cf. src/HOL/Import)
-#HOL4_PROOFS="$ISABELLE_HOME_USER/proofs:$ISABELLE_HOME/proofs"
-
 # SVC (Stanford Validity Checker)
 #SVC_HOME=
 #SVC_MACHINE=i386-redhat-linux
--- a/src/HOL/Import/HOL4/Compatibility.thy	Sun Apr 01 14:50:47 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,504 +0,0 @@
-(*  Title:      HOL/Import/HOL4/Compatibility.thy
-    Author:     Sebastian Skalberg (TU Muenchen)
-*)
-
-theory Compatibility
-imports
-  Complex_Main
-  "~~/src/HOL/Old_Number_Theory/Primes"
-  "~~/src/HOL/Library/ContNotDenum"
-  "~~/src/HOL/Import/Importer"
-begin
-
-abbreviation (input) mem (infixl "mem" 55) where "x mem xs \<equiv> List.member xs x"
-no_notation differentiable (infixl "differentiable" 60)
-no_notation sums (infixr "sums" 80)
-
-lemma EXISTS_UNIQUE_DEF: "(Ex1 P) = (Ex P & (ALL x y. P x & P y --> (x = y)))"
-  by auto
-
-lemma COND_DEF:"(If b t f) = (@x. ((b = True) --> (x = t)) & ((b = False) --> (x = f)))"
-  by auto
-
-definition LET :: "['a \<Rightarrow> 'b,'a] \<Rightarrow> 'b" where
-  "LET f s == f s"
-
-lemma [import_rew]: "LET f s = Let s f"
-  by (simp add: LET_def Let_def)
-
-lemmas [import_rew] = ONE_ONE_rew
-
-lemma bool_case_DEF: "(bool_case x y b) = (if b then x else y)"
-  by simp
-
-lemma INR_INL_11: "(ALL y x. (Inl x = Inl y) = (x = y)) & (ALL y x. (Inr x = Inr y) = (x = y))"
-  by safe
-
-(*lemma INL_neq_INR: "ALL v1 v2. Sum_Type.Inr v2 ~= Sum_Type.Inl v1"
-  by simp*)
-
-primrec ISL :: "'a + 'b => bool" where
-  "ISL (Inl x) = True"
-| "ISL (Inr x) = False"
-
-primrec ISR :: "'a + 'b => bool" where
-  "ISR (Inl x) = False"
-| "ISR (Inr x) = True"
-
-lemma ISL: "(ALL x. ISL (Inl x)) & (ALL y. ~ISL (Inr y))"
-  by simp
-
-lemma ISR: "(ALL x. ISR (Inr x)) & (ALL y. ~ISR (Inl y))"
-  by simp
-
-primrec OUTL :: "'a + 'b => 'a" where
-  "OUTL (Inl x) = x"
-
-primrec OUTR :: "'a + 'b => 'b" where
-  "OUTR (Inr x) = x"
-
-lemma OUTL: "OUTL (Inl x) = x"
-  by simp
-
-lemma OUTR: "OUTR (Inr x) = x"
-  by simp
-
-lemma sum_axiom: "EX! h. h o Inl = f & h o Inr = g"
-  apply (intro allI ex1I[of _ "sum_case f g"] conjI)
-  apply (simp_all add: o_def fun_eq_iff)
-  apply (rule)
-  apply (induct_tac x)
-  apply simp_all
-  done
-
-lemma sum_case_def: "(ALL f g x. sum_case f g (Inl x) = f x) & (ALL f g y. sum_case f g (Inr y) = g y)"
-  by simp
-
-lemma one: "ALL v. v = ()"
-  by simp
-
-lemma option_case_def: "(!u f. option_case u f None = u) & (!u f x. option_case u f (Some x) = f x)"
-  by simp
-
-lemma OPTION_MAP_DEF: "(!f x. Option.map f (Some x) = Some (f x)) & (!f. Option.map f None = None)"
-  by simp
-
-primrec IS_SOME :: "'a option => bool" where
-  "IS_SOME (Some x) = True"
-| "IS_SOME None = False"
-
-primrec IS_NONE :: "'a option => bool" where
-  "IS_NONE (Some x) = False"
-| "IS_NONE None = True"
-
-lemma IS_NONE_DEF: "(!x. IS_NONE (Some x) = False) & (IS_NONE None = True)"
-  by simp
-
-lemma IS_SOME_DEF: "(!x. IS_SOME (Some x) = True) & (IS_SOME None = False)"
-  by simp
-
-primrec OPTION_JOIN :: "'a option option => 'a option" where
-  "OPTION_JOIN None = None"
-| "OPTION_JOIN (Some x) = x"
-
-lemma OPTION_JOIN_DEF: "(OPTION_JOIN None = None) & (ALL x. OPTION_JOIN (Some x) = x)"
-  by simp
-
-lemma PAIR: "(fst x,snd x) = x"
-  by simp
-
-lemma PAIR_MAP: "map_pair f g p = (f (fst p),g (snd p))"
-  by (simp add: map_pair_def split_def)
-
-lemma pair_case_def: "split = split"
-  ..
-
-lemma LESS_OR_EQ: "m <= (n::nat) = (m < n | m = n)"
-  by auto
-
-definition nat_gt :: "nat => nat => bool" where
-  "nat_gt == %m n. n < m"
-
-definition nat_ge :: "nat => nat => bool" where
-  "nat_ge == %m n. nat_gt m n | m = n"
-
-lemma [import_rew]: "nat_gt m n = (n < m)"
-  by (simp add: nat_gt_def)
-
-lemma [import_rew]: "nat_ge m n = (n <= m)"
-  by (auto simp add: nat_ge_def nat_gt_def)
-
-lemma GREATER_DEF: "ALL m n. (n < m) = (n < m)"
-  by simp
-
-lemma GREATER_OR_EQ: "ALL m n. n <= (m::nat) = (n < m | m = n)"
-  by auto
-
-lemma LESS_DEF: "m < n = (? P. (!n. P (Suc n) --> P n) & P m & ~P n)"
-proof safe
-  assume 1: "m < n"
-  def P == "%n. n <= m"
-  have "(!n. P (Suc n) \<longrightarrow> P n) & P m & ~P n"
-  proof (auto simp add: P_def)
-    assume "n <= m"
-    with 1
-    show False
-      by auto
-  qed
-  thus "? P. (!n. P (Suc n) \<longrightarrow> P n) & P m & ~P n"
-    by auto
-next
-  fix P
-  assume alln: "!n. P (Suc n) \<longrightarrow> P n"
-  assume pm: "P m"
-  assume npn: "~P n"
-  have "!k q. q + k = m \<longrightarrow> P q"
-  proof
-    fix k
-    show "!q. q + k = m \<longrightarrow> P q"
-    proof (induct k,simp_all)
-      show "P m" by fact
-    next
-      fix k
-      assume ind: "!q. q + k = m \<longrightarrow> P q"
-      show "!q. Suc (q + k) = m \<longrightarrow> P q"
-      proof (rule+)
-        fix q
-        assume "Suc (q + k) = m"
-        hence "(Suc q) + k = m"
-          by simp
-        with ind
-        have psq: "P (Suc q)"
-          by simp
-        from alln
-        have "P (Suc q) --> P q"
-          ..
-        with psq
-        show "P q"
-          by simp
-      qed
-    qed
-  qed
-  hence "!q. q + (m - n) = m \<longrightarrow> P q"
-    ..
-  hence hehe: "n + (m - n) = m \<longrightarrow> P n"
-    ..
-  show "m < n"
-  proof (rule classical)
-    assume "~(m<n)"
-    hence "n <= m"
-      by simp
-    with hehe
-    have "P n"
-      by simp
-    with npn
-    show "m < n"
-      ..
-  qed
-qed
-
-definition FUNPOW :: "('a => 'a) => nat => 'a => 'a" where
-  "FUNPOW f n == f ^^ n"
-
-lemma FUNPOW: "(ALL f x. (f ^^ 0) x = x) &
-  (ALL f n x. (f ^^ Suc n) x = (f ^^ n) (f x))"
-  by (simp add: funpow_swap1)
-
-lemma [import_rew]: "FUNPOW f n = f ^^ n"
-  by (simp add: FUNPOW_def)
-
-lemma ADD: "(!n. (0::nat) + n = n) & (!m n. Suc m + n = Suc (m + n))"
-  by simp
-
-lemma MULT: "(!n. (0::nat) * n = 0) & (!m n. Suc m * n = m * n + n)"
-  by simp
-
-lemma SUB: "(!m. (0::nat) - m = 0) & (!m n. (Suc m) - n = (if m < n then 0 else Suc (m - n)))"
-  by (simp) arith
-
-lemma MAX_DEF: "max (m::nat) n = (if m < n then n else m)"
-  by (simp add: max_def)
-
-lemma MIN_DEF: "min (m::nat) n = (if m < n then m else n)"
-  by (simp add: min_def)
-
-lemma DIVISION: "(0::nat) < n --> (!k. (k = k div n * n + k mod n) & k mod n < n)"
-  by simp
-
-definition ALT_ZERO :: nat where 
-  "ALT_ZERO == 0"
-
-definition NUMERAL_BIT1 :: "nat \<Rightarrow> nat" where 
-  "NUMERAL_BIT1 n == n + (n + Suc 0)"
-
-definition NUMERAL_BIT2 :: "nat \<Rightarrow> nat" where 
-  "NUMERAL_BIT2 n == n + (n + Suc (Suc 0))"
-
-definition NUMERAL :: "nat \<Rightarrow> nat" where 
-  "NUMERAL x == x"
-
-lemma [import_rew]: "NUMERAL ALT_ZERO = 0"
-  by (simp add: ALT_ZERO_def NUMERAL_def)
-
-lemma [import_rew]: "NUMERAL (NUMERAL_BIT1 ALT_ZERO) = 1"
-  by (simp add: ALT_ZERO_def NUMERAL_BIT1_def NUMERAL_def)
-
-lemma [import_rew]: "NUMERAL (NUMERAL_BIT2 ALT_ZERO) = 2"
-  by (simp add: ALT_ZERO_def NUMERAL_BIT2_def NUMERAL_def)
-
-lemma EXP: "(!m. m ^ 0 = (1::nat)) & (!m n. m ^ Suc n = m * (m::nat) ^ n)"
-  by auto
-
-lemma num_case_def: "(!b f. nat_case b f 0 = b) & (!b f n. nat_case b f (Suc n) = f n)"
-  by simp
-
-lemma divides_def: "(a::nat) dvd b = (? q. b = q * a)"
-  by (auto simp add: dvd_def)
-
-lemma list_case_def: "(!v f. list_case v f [] = v) & (!v f a0 a1. list_case v f (a0#a1) = f a0 a1)"
-  by simp
-
-primrec list_size :: "('a \<Rightarrow> nat) \<Rightarrow> 'a list \<Rightarrow> nat" where
-  "list_size f [] = 0"
-| "list_size f (a0#a1) = 1 + (f a0 + list_size f a1)"
-
-lemma list_size_def': "(!f. list_size f [] = 0) &
-         (!f a0 a1. list_size f (a0#a1) = 1 + (f a0 + list_size f a1))"
-  by simp
-
-lemma list_case_cong: "! M M' v f. M = M' & (M' = [] \<longrightarrow>  v = v') &
-           (!a0 a1. (M' = a0#a1) \<longrightarrow> (f a0 a1 = f' a0 a1)) -->
-           (list_case v f M = list_case v' f' M')"
-proof clarify
-  fix M M' v f
-  assume 1: "M' = [] \<longrightarrow> v = v'"
-    and 2: "!a0 a1. M' = a0 # a1 \<longrightarrow> f a0 a1 = f' a0 a1"
-  show "list_case v f M' = list_case v' f' M'"
-  proof (rule List.list.case_cong)
-    show "M' = M'"
-      ..
-  next
-    assume "M' = []"
-    with 1 2
-    show "v = v'"
-      by auto
-  next
-    fix a0 a1
-    assume "M' = a0 # a1"
-    with 1 2
-    show "f a0 a1 = f' a0 a1"
-      by auto
-  qed
-qed
-
-lemma list_Axiom: "ALL f0 f1. EX fn. (fn [] = f0) & (ALL a0 a1. fn (a0#a1) = f1 a0 a1 (fn a1))"
-proof safe
-  fix f0 f1
-  def fn == "list_rec f0 f1"
-  have "fn [] = f0 & (ALL a0 a1. fn (a0 # a1) = f1 a0 a1 (fn a1))"
-    by (simp add: fn_def)
-  thus "EX fn. fn [] = f0 & (ALL a0 a1. fn (a0 # a1) = f1 a0 a1 (fn a1))"
-    by auto
-qed
-
-lemma list_Axiom_old: "EX! fn. (fn [] = x) & (ALL h t. fn (h#t) = f (fn t) h t)"
-proof safe
-  def fn == "list_rec x (%h t r. f r h t)"
-  have "fn [] = x & (ALL h t. fn (h # t) = f (fn t) h t)"
-    by (simp add: fn_def)
-  thus "EX fn. fn [] = x & (ALL h t. fn (h # t) = f (fn t) h t)"
-    by auto
-next
-  fix fn1 fn2
-  assume 1: "ALL h t. fn1 (h # t) = f (fn1 t) h t"
-  assume 2: "ALL h t. fn2 (h # t) = f (fn2 t) h t"
-  assume 3: "fn2 [] = fn1 []"
-  show "fn1 = fn2"
-  proof
-    fix xs
-    show "fn1 xs = fn2 xs"
-      by (induct xs) (simp_all add: 1 2 3) 
-  qed
-qed
-
-lemma NULL_DEF: "(List.null [] = True) & (!h t. List.null (h # t) = False)"
-  by (simp add: null_def)
-
-definition sum :: "nat list \<Rightarrow> nat" where
-  "sum l == foldr (op +) l 0"
-
-lemma SUM: "(sum [] = 0) & (!h t. sum (h#t) = h + sum t)"
-  by (simp add: sum_def)
-
-lemma APPEND: "(!l. [] @ l = l) & (!l1 l2 h. (h#l1) @ l2 = h# l1 @ l2)"
-  by simp
-
-lemma FLAT: "(concat [] = []) & (!h t. concat (h#t) = h @ (concat t))"
-  by simp
-
-lemma LENGTH: "(length [] = 0) & (!h t. length (h#t) = Suc (length t))"
-  by simp
-
-lemma MAP: "(!f. map f [] = []) & (!f h t. map f (h#t) = f h#map f t)"
-  by simp
-
-lemma MEM: "(!x. List.member [] x = False) & (!x h t. List.member (h#t) x = ((x = h) | List.member t x))"
-  by (simp add: member_def)
-
-lemma FILTER: "(!P. filter P [] = []) & (!P h t.
-           filter P (h#t) = (if P h then h#filter P t else filter P t))"
-  by simp
-
-lemma REPLICATE: "(ALL x. replicate 0 x = []) &
-  (ALL n x. replicate (Suc n) x = x # replicate n x)"
-  by simp
-
-definition FOLDR :: "[['a,'b]\<Rightarrow>'b,'b,'a list] \<Rightarrow> 'b" where
-  "FOLDR f e l == foldr f l e"
-
-lemma [import_rew]: "FOLDR f e l = foldr f l e"
-  by (simp add: FOLDR_def)
-
-lemma FOLDR: "(!f e. foldr f [] e = e) & (!f e x l. foldr f (x#l) e = f x (foldr f l e))"
-  by simp
-
-lemma FOLDL: "(!f e. foldl f e [] = e) & (!f e x l. foldl f e (x#l) = foldl f (f e x) l)"
-  by simp
-
-lemma EVERY_DEF: "(!P. list_all P [] = True) & (!P h t. list_all P (h#t) = (P h & list_all P t))"
-  by simp
-
-lemma list_exists_DEF: "(!P. list_ex P [] = False) & (!P h t. list_ex P (h#t) = (P h | list_ex P t))"
-  by simp
-
-primrec map2 :: "[['a,'b]\<Rightarrow>'c,'a list,'b list] \<Rightarrow> 'c list" where
-  map2_Nil: "map2 f [] l2 = []"
-| map2_Cons: "map2 f (x#xs) l2 = f x (hd l2) # map2 f xs (tl l2)"
-
-lemma MAP2: "(!f. map2 f [] [] = []) & (!f h1 t1 h2 t2. map2 f (h1#t1) (h2#t2) = f h1 h2#map2 f t1 t2)"
-  by simp
-
-lemma list_INDUCT: "\<lbrakk> P [] ; !t. P t \<longrightarrow> (!h. P (h#t)) \<rbrakk> \<Longrightarrow> !l. P l"
-proof
-  fix l
-  assume "P []"
-  assume allt: "!t. P t \<longrightarrow> (!h. P (h # t))"
-  show "P l"
-  proof (induct l)
-    show "P []" by fact
-  next
-    fix h t
-    assume "P t"
-    with allt
-    have "!h. P (h # t)"
-      by auto
-    thus "P (h # t)"
-      ..
-  qed
-qed
-
-lemma list_CASES: "(l = []) | (? t h. l = h#t)"
-  by (induct l,auto)
-
-definition ZIP :: "'a list * 'b list \<Rightarrow> ('a * 'b) list" where
-  "ZIP == %(a,b). zip a b"
-
-lemma ZIP: "(zip [] [] = []) &
-  (!x1 l1 x2 l2. zip (x1#l1) (x2#l2) = (x1,x2)#zip l1 l2)"
-  by simp
-
-lemma [import_rew]: "ZIP (a,b) = zip a b"
-  by (simp add: ZIP_def)
-
-primrec unzip :: "('a * 'b) list \<Rightarrow> 'a list * 'b list" where
-  unzip_Nil: "unzip [] = ([],[])"
-| unzip_Cons: "unzip (xy#xys) = (let zs = unzip xys in (fst xy # fst zs,snd xy # snd zs))"
-
-lemma UNZIP: "(unzip [] = ([],[])) &
-         (!x l. unzip (x#l) = (fst x#fst (unzip l),snd x#snd (unzip l)))"
-  by (simp add: Let_def)
-
-lemma REVERSE: "(rev [] = []) & (!h t. rev (h#t) = (rev t) @ [h])"
-  by simp
-
-lemma REAL_SUP_ALLPOS: "\<lbrakk> ALL x. P (x::real) \<longrightarrow> 0 < x ; EX x. P x; EX z. ALL x. P x \<longrightarrow> x < z \<rbrakk> \<Longrightarrow> EX s. ALL y. (EX x. P x & y < x) = (y < s)"
-proof safe
-  fix x z
-  assume allx: "ALL x. P x \<longrightarrow> 0 < x"
-  assume px: "P x"
-  assume allx': "ALL x. P x \<longrightarrow> x < z"
-  have "EX s. ALL y. (EX x : Collect P. y < x) = (y < s)"
-  proof (rule posreal_complete)
-    from px
-    show "EX x. x : Collect P"
-      by auto
-  next
-    from allx'
-    show "EX y. ALL x : Collect P. x < y"
-      apply simp
-      ..
-  qed
-  thus "EX s. ALL y. (EX x. P x & y < x) = (y < s)"
-    by simp
-qed
-
-lemma REAL_10: "~((1::real) = 0)"
-  by simp
-
-lemma REAL_ADD_ASSOC: "(x::real) + (y + z) = x + y + z"
-  by simp
-
-lemma REAL_MUL_ASSOC: "(x::real) * (y * z) = x * y * z"
-  by simp
-
-lemma REAL_ADD_LINV:  "-x + x = (0::real)"
-  by simp
-
-lemma REAL_MUL_LINV: "x ~= (0::real) ==> inverse x * x = 1"
-  by simp
-
-lemma REAL_LT_TOTAL: "((x::real) = y) | x < y | y < x"
-  by auto
-
-lemma [import_rew]: "real (0::nat) = 0"
-  by simp
-
-lemma [import_rew]: "real (1::nat) = 1"
-  by simp
-
-lemma [import_rew]: "real (2::nat) = 2"
-  by simp
-
-lemma real_lte: "((x::real) <= y) = (~(y < x))"
-  by auto
-
-lemma real_of_num: "((0::real) = 0) & (!n. real (Suc n) = real n + 1)"
-  by (simp add: real_of_nat_Suc)
-
-lemma abs: "abs (x::real) = (if 0 <= x then x else -x)"
-  by (simp add: abs_if)
-
-lemma pow: "(!x::real. x ^ 0 = 1) & (!x::real. ALL n. x ^ (Suc n) = x * x ^ n)"
-  by simp
-
-definition real_gt :: "real => real => bool" where 
-  "real_gt == %x y. y < x"
-
-lemma [import_rew]: "real_gt x y = (y < x)"
-  by (simp add: real_gt_def)
-
-lemma real_gt: "ALL x (y::real). (y < x) = (y < x)"
-  by simp
-
-definition real_ge :: "real => real => bool" where
-  "real_ge x y == y <= x"
-
-lemma [import_rew]: "real_ge x y = (y <= x)"
-  by (simp add: real_ge_def)
-
-lemma real_ge: "ALL x y. (y <= x) = (y <= x)"
-  by simp
-
-definition [import_rew]: "list_mem x xs = List.member xs x"
-
-end
--- a/src/HOL/Import/HOL4/Generate.thy	Sun Apr 01 14:50:47 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-theory Generate
-imports "Template/GenHOL4Prob" "Template/GenHOL4Vec" "Template/GenHOL4Word32"
-begin
-
-end
--- a/src/HOL/Import/HOL4/Generated/HOL4Base.thy	Sun Apr 01 14:50:47 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4501 +0,0 @@
-(* AUTOMATICALLY GENERATED, DO NOT EDIT! *)
-
-theory HOL4Base
-imports "../../Importer" "../Compatibility"
-begin
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" bool
-
-definition
-  ARB :: "'a"  where
-  "ARB == SOME x. True"
-
-lemma ARB_DEF: "ARB = (SOME x. True)"
-  sorry
-
-definition
-  IN :: "'a => ('a => bool) => bool"  where
-  "IN == %x f. f x"
-
-lemma IN_DEF: "IN = (%x f. f x)"
-  sorry
-
-definition
-  RES_FORALL :: "('a => bool) => ('a => bool) => bool"  where
-  "RES_FORALL == %p m. ALL x. IN x p --> m x"
-
-lemma RES_FORALL_DEF: "RES_FORALL = (%p m. ALL x. IN x p --> m x)"
-  sorry
-
-definition
-  RES_EXISTS :: "('a => bool) => ('a => bool) => bool"  where
-  "RES_EXISTS == %p m. EX x. IN x p & m x"
-
-lemma RES_EXISTS_DEF: "RES_EXISTS = (%p m. EX x. IN x p & m x)"
-  sorry
-
-definition
-  RES_EXISTS_UNIQUE :: "('a => bool) => ('a => bool) => bool"  where
-  "RES_EXISTS_UNIQUE ==
-%p m. RES_EXISTS p m &
-      RES_FORALL p (%x. RES_FORALL p (%y. m x & m y --> x = y))"
-
-lemma RES_EXISTS_UNIQUE_DEF: "RES_EXISTS_UNIQUE =
-(%p m. RES_EXISTS p m &
-       RES_FORALL p (%x. RES_FORALL p (%y. m x & m y --> x = y)))"
-  sorry
-
-definition
-  RES_SELECT :: "('a => bool) => ('a => bool) => 'a"  where
-  "RES_SELECT == %p m. SOME x. IN x p & m x"
-
-lemma RES_SELECT_DEF: "RES_SELECT = (%p m. SOME x. IN x p & m x)"
-  sorry
-
-lemma EXCLUDED_MIDDLE: "t | ~ t"
-  sorry
-
-lemma FORALL_THM: "All f = All f"
-  sorry
-
-lemma EXISTS_THM: "Ex f = Ex f"
-  sorry
-
-lemma F_IMP: "[| ~ t; t |] ==> False"
-  sorry
-
-lemma NOT_AND: "~ (t & ~ t)"
-  sorry
-
-lemma AND_CLAUSES: "(True & t) = t &
-(t & True) = t & (False & t) = False & (t & False) = False & (t & t) = t"
-  sorry
-
-lemma OR_CLAUSES: "(True | t) = True &
-(t | True) = True & (False | t) = t & (t | False) = t & (t | t) = t"
-  sorry
-
-lemma IMP_CLAUSES: "(True --> t) = t &
-(t --> True) = True &
-(False --> t) = True & (t --> t) = True & (t --> False) = (~ t)"
-  sorry
-
-lemma NOT_CLAUSES: "(ALL t. (~ ~ t) = t) & (~ True) = False & (~ False) = True"
-  sorry
-
-lemma BOOL_EQ_DISTINCT: "True ~= False & False ~= True"
-  sorry
-
-lemma EQ_CLAUSES: "(True = t) = t & (t = True) = t & (False = t) = (~ t) & (t = False) = (~ t)"
-  sorry
-
-lemma COND_CLAUSES: "(if True then t1 else t2) = t1 & (if False then t1 else t2) = t2"
-  sorry
-
-lemma SELECT_UNIQUE: "(!!y. P y = (y = x)) ==> Eps P = x"
-  sorry
-
-lemma BOTH_EXISTS_AND_THM: "(EX x::'a. (P::bool) & (Q::bool)) = ((EX x::'a. P) & (EX x::'a. Q))"
-  sorry
-
-lemma BOTH_FORALL_OR_THM: "(ALL x::'a. (P::bool) | (Q::bool)) = ((ALL x::'a. P) | (ALL x::'a. Q))"
-  sorry
-
-lemma BOTH_FORALL_IMP_THM: "(ALL x::'a. (P::bool) --> (Q::bool)) = ((EX x::'a. P) --> (ALL x::'a. Q))"
-  sorry
-
-lemma BOTH_EXISTS_IMP_THM: "(EX x::'a. (P::bool) --> (Q::bool)) = ((ALL x::'a. P) --> (EX x::'a. Q))"
-  sorry
-
-lemma OR_IMP_THM: "(A = (B | A)) = (B --> A)"
-  sorry
-
-lemma DE_MORGAN_THM: "(~ (A & B)) = (~ A | ~ B) & (~ (A | B)) = (~ A & ~ B)"
-  sorry
-
-lemma IMP_F_EQ_F: "(t --> False) = (t = False)"
-  sorry
-
-lemma COND_RATOR: "(if b::bool then f::'a => 'b else (g::'a => 'b)) (x::'a) =
-(if b then f x else g x)"
-  sorry
-
-lemma COND_ABS: "(%x. if b then f x else g x) = (if b then f else g)"
-  sorry
-
-lemma COND_EXPAND: "(if b then t1 else t2) = ((~ b | t1) & (b | t2))"
-  sorry
-
-lemma ONE_ONE_THM: "inj f = (ALL x1 x2. f x1 = f x2 --> x1 = x2)"
-  sorry
-
-lemma ABS_REP_THM: "(op ==>::prop => prop => prop)
- ((Trueprop::bool => prop)
-   ((Ex::(('b::type => 'a::type) => bool) => bool)
-     ((TYPE_DEFINITION::('a::type => bool)
-                        => ('b::type => 'a::type) => bool)
-       (P::'a::type => bool))))
- ((Trueprop::bool => prop)
-   ((Ex::(('b::type => 'a::type) => bool) => bool)
-     (%x::'b::type => 'a::type.
-         (Ex::(('a::type => 'b::type) => bool) => bool)
-          (%abs::'a::type => 'b::type.
-              (op &::bool => bool => bool)
-               ((All::('b::type => bool) => bool)
-                 (%a::'b::type.
-                     (op =::'b::type => 'b::type => bool) (abs (x a)) a))
-               ((All::('a::type => bool) => bool)
-                 (%r::'a::type.
-                     (op =::bool => bool => bool) (P r)
-                      ((op =::'a::type => 'a::type => bool) (x (abs r))
-                        r)))))))"
-  sorry
-
-lemma LET_RAND: "(P::'b => bool) (Let (M::'a) (N::'a => 'b)) = (let x::'a = M in P (N x))"
-  sorry
-
-lemma LET_RATOR: "Let (M::'a) (N::'a => 'b => 'c) (b::'b) = (let x::'a = M in N x b)"
-  sorry
-
-lemma AND_CONG: "(Q --> P = P') & (P' --> Q = Q') ==> (P & Q) = (P' & Q')"
-  sorry
-
-lemma OR_CONG: "(~ Q --> P = P') & (~ P' --> Q = Q') ==> (P | Q) = (P' | Q')"
-  sorry
-
-lemma COND_CONG: "P = Q & (Q --> x = x') & (~ Q --> y = y')
-==> (if P then x else y) = (if Q then x' else y')"
-  sorry
-
-lemma MONO_COND: "[| x ==> y; z ==> w; if b then x else z |] ==> if b then y else w"
-  sorry
-
-lemma SKOLEM_THM: "(ALL x. Ex (P x)) = (EX f. ALL x. P x (f x))"
-  sorry
-
-lemma bool_case_thm: "(ALL (e0::'a) e1::'a. (case True of True => e0 | False => e1) = e0) &
-(ALL (e0::'a) e1::'a. (case False of True => e0 | False => e1) = e1)"
-  sorry
-
-lemma bool_case_ID: "(case b of True => x | _ => x) = x"
-  sorry
-
-lemma boolAxiom: "EX x. x True = e0 & x False = e1"
-  sorry
-
-lemma UEXISTS_OR_THM: "EX! x. P x | Q x ==> Ex1 P | Ex1 Q"
-  sorry
-
-lemma UEXISTS_SIMP: "(EX! x::'a. (t::bool)) = (t & (ALL x::'a. All (op = x)))"
-  sorry
-
-consts
-  RES_ABSTRACT :: "('a => bool) => ('a => 'b) => 'a => 'b" 
-
-specification (RES_ABSTRACT) RES_ABSTRACT_DEF: "(ALL (p::'a => bool) (m::'a => 'b) x::'a.
-    IN x p --> RES_ABSTRACT p m x = m x) &
-(ALL (p::'a => bool) (m1::'a => 'b) m2::'a => 'b.
-    (ALL x::'a. IN x p --> m1 x = m2 x) -->
-    RES_ABSTRACT p m1 = RES_ABSTRACT p m2)"
-  sorry
-
-lemma BOOL_FUN_CASES_THM: "f = (%b. True) | f = (%b. False) | f = (%b. b) | f = Not"
-  sorry
-
-lemma BOOL_FUN_INDUCT: "P (%b. True) & P (%b. False) & P (%b. b) & P Not ==> P x"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" combin
-
-definition
-  K :: "'a => 'b => 'a"  where
-  "K == %x y. x"
-
-lemma K_DEF: "K = (%x y. x)"
-  sorry
-
-definition
-  S :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"  where
-  "S == %f g x. f x (g x)"
-
-lemma S_DEF: "S = (%f g x. f x (g x))"
-  sorry
-
-definition
-  I :: "'a => 'a"  where
-  "(op ==::('a::type => 'a::type) => ('a::type => 'a::type) => prop)
- (I::'a::type => 'a::type)
- ((S::('a::type => ('a::type => 'a::type) => 'a::type)
-      => ('a::type => 'a::type => 'a::type) => 'a::type => 'a::type)
-   (K::'a::type => ('a::type => 'a::type) => 'a::type)
-   (K::'a::type => 'a::type => 'a::type))"
-
-lemma I_DEF: "(op =::('a::type => 'a::type) => ('a::type => 'a::type) => bool)
- (I::'a::type => 'a::type)
- ((S::('a::type => ('a::type => 'a::type) => 'a::type)
-      => ('a::type => 'a::type => 'a::type) => 'a::type => 'a::type)
-   (K::'a::type => ('a::type => 'a::type) => 'a::type)
-   (K::'a::type => 'a::type => 'a::type))"
-  sorry
-
-definition
-  C :: "('a => 'b => 'c) => 'b => 'a => 'c"  where
-  "C == %f x y. f y x"
-
-lemma C_DEF: "C = (%f x y. f y x)"
-  sorry
-
-definition
-  W :: "('a => 'a => 'b) => 'a => 'b"  where
-  "W == %f x. f x x"
-
-lemma W_DEF: "W = (%f x. f x x)"
-  sorry
-
-lemma I_THM: "I x = x"
-  sorry
-
-lemma I_o_ID: "I o f = f & f o I = f"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" sum
-
-lemma ISL_OR_ISR: "ISL x | ISR x"
-  sorry
-
-lemma INL: "ISL x ==> Inl (OUTL x) = x"
-  sorry
-
-lemma INR: "ISR x ==> Inr (OUTR x) = x"
-  sorry
-
-lemma sum_case_cong: "(M::'b + 'c) = (M'::'b + 'c) &
-(ALL x::'b. M' = Inl x --> (f::'b => 'a) x = (f'::'b => 'a) x) &
-(ALL y::'c. M' = Inr y --> (g::'c => 'a) y = (g'::'c => 'a) y)
-==> sum_case f g M = sum_case f' g' M'"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" one
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" option
-
-lemma option_CLAUSES: "(op &::bool => bool => bool)
- ((All::('a::type => bool) => bool)
-   (%x::'a::type.
-       (All::('a::type => bool) => bool)
-        (%y::'a::type.
-            (op =::bool => bool => bool)
-             ((op =::'a::type option => 'a::type option => bool)
-               ((Some::'a::type => 'a::type option) x)
-               ((Some::'a::type => 'a::type option) y))
-             ((op =::'a::type => 'a::type => bool) x y))))
- ((op &::bool => bool => bool)
-   ((All::('a::type => bool) => bool)
-     (%x::'a::type.
-         (op =::'a::type => 'a::type => bool)
-          ((the::'a::type option => 'a::type)
-            ((Some::'a::type => 'a::type option) x))
-          x))
-   ((op &::bool => bool => bool)
-     ((All::('a::type => bool) => bool)
-       (%x::'a::type.
-           (op ~=::'a::type option => 'a::type option => bool)
-            (None::'a::type option)
-            ((Some::'a::type => 'a::type option) x)))
-     ((op &::bool => bool => bool)
-       ((All::('a::type => bool) => bool)
-         (%x::'a::type.
-             (op ~=::'a::type option => 'a::type option => bool)
-              ((Some::'a::type => 'a::type option) x)
-              (None::'a::type option)))
-       ((op &::bool => bool => bool)
-         ((All::('a::type => bool) => bool)
-           (%x::'a::type.
-               (op =::bool => bool => bool)
-                ((IS_SOME::'a::type option => bool)
-                  ((Some::'a::type => 'a::type option) x))
-                (True::bool)))
-         ((op &::bool => bool => bool)
-           ((op =::bool => bool => bool)
-             ((IS_SOME::'a::type option => bool) (None::'a::type option))
-             (False::bool))
-           ((op &::bool => bool => bool)
-             ((All::('a::type option => bool) => bool)
-               (%x::'a::type option.
-                   (op =::bool => bool => bool)
-                    ((IS_NONE::'a::type option => bool) x)
-                    ((op =::'a::type option => 'a::type option => bool) x
-                      (None::'a::type option))))
-             ((op &::bool => bool => bool)
-               ((All::('a::type option => bool) => bool)
-                 (%x::'a::type option.
-                     (op =::bool => bool => bool)
-                      ((Not::bool => bool)
-                        ((IS_SOME::'a::type option => bool) x))
-                      ((op =::'a::type option => 'a::type option => bool) x
-                        (None::'a::type option))))
-               ((op &::bool => bool => bool)
-                 ((All::('a::type option => bool) => bool)
-                   (%x::'a::type option.
-                       (op -->::bool => bool => bool)
-                        ((IS_SOME::'a::type option => bool) x)
-                        ((op =::'a::type option => 'a::type option => bool)
-                          ((Some::'a::type => 'a::type option)
-                            ((the::'a::type option => 'a::type) x))
-                          x)))
-                 ((op &::bool => bool => bool)
-                   ((All::('a::type option => bool) => bool)
-                     (%x::'a::type option.
-                         (op =::'a::type option => 'a::type option => bool)
-                          ((option_case::'a::type option
-   => ('a::type => 'a::type option) => 'a::type option => 'a::type option)
-                            (None::'a::type option)
-                            (Some::'a::type => 'a::type option) x)
-                          x))
-                   ((op &::bool => bool => bool)
-                     ((All::('a::type option => bool) => bool)
-                       (%x::'a::type option.
-                           (op =::'a::type option
-                                  => 'a::type option => bool)
-                            ((option_case::'a::type option
-     => ('a::type => 'a::type option) => 'a::type option => 'a::type option)
-                              x (Some::'a::type => 'a::type option) x)
-                            x))
-                     ((op &::bool => bool => bool)
-                       ((All::('a::type option => bool) => bool)
-                         (%x::'a::type option.
-                             (op -->::bool => bool => bool)
-                              ((IS_NONE::'a::type option => bool) x)
-                              ((op =::'b::type => 'b::type => bool)
-                                ((option_case::'b::type
-         => ('a::type => 'b::type) => 'a::type option => 'b::type)
-                                  (e::'b::type) (f::'a::type => 'b::type) x)
-                                e)))
-                       ((op &::bool => bool => bool)
-                         ((All::('a::type option => bool) => bool)
-                           (%x::'a::type option.
-                               (op -->::bool => bool => bool)
-                                ((IS_SOME::'a::type option => bool) x)
-                                ((op =::'b::type => 'b::type => bool)
-                                  ((option_case::'b::type
-           => ('a::type => 'b::type) => 'a::type option => 'b::type)
-                                    e f x)
-                                  (f ((the::'a::type option => 'a::type)
- x)))))
-                         ((op &::bool => bool => bool)
-                           ((All::('a::type option => bool) => bool)
-                             (%x::'a::type option.
-                                 (op -->::bool => bool => bool)
-                                  ((IS_SOME::'a::type option => bool) x)
-                                  ((op =::'a::type option
-    => 'a::type option => bool)
-                                    ((option_case::'a::type option
-             => ('a::type => 'a::type option)
-                => 'a::type option => 'a::type option)
-(ea::'a::type option) (Some::'a::type => 'a::type option) x)
-                                    x)))
-                           ((op &::bool => bool => bool)
-                             ((All::('b::type => bool) => bool)
-                               (%u::'b::type.
-                                   (All::(('a::type => 'b::type) => bool)
-   => bool)
-                                    (%f::'a::type => 'b::type.
-  (op =::'b::type => 'b::type => bool)
-   ((option_case::'b::type
-                  => ('a::type => 'b::type) => 'a::type option => 'b::type)
-     u f (None::'a::type option))
-   u)))
-                             ((op &::bool => bool => bool)
-                               ((All::('b::type => bool) => bool)
-                                 (%u::'b::type.
-                                     (All::(('a::type => 'b::type) => bool)
-     => bool)
-(%f::'a::type => 'b::type.
-    (All::('a::type => bool) => bool)
-     (%x::'a::type.
-         (op =::'b::type => 'b::type => bool)
-          ((option_case::'b::type
-                         => ('a::type => 'b::type)
-                            => 'a::type option => 'b::type)
-            u f ((Some::'a::type => 'a::type option) x))
-          (f x)))))
-                               ((op &::bool => bool => bool)
-                                 ((All::(('a::type => 'b::type) => bool)
-  => bool)
-                                   (%f::'a::type => 'b::type.
- (All::('a::type => bool) => bool)
-  (%x::'a::type.
-      (op =::'b::type option => 'b::type option => bool)
-       ((Option.map::('a::type => 'b::type)
-                     => 'a::type option => 'b::type option)
-         f ((Some::'a::type => 'a::type option) x))
-       ((Some::'b::type => 'b::type option) (f x)))))
-                                 ((op &::bool => bool => bool)
-                                   ((All::(('a::type => 'b::type) => bool)
-    => bool)
-                                     (%f::'a::type => 'b::type.
-   (op =::'b::type option => 'b::type option => bool)
-    ((Option.map::('a::type => 'b::type)
-                  => 'a::type option => 'b::type option)
-      f (None::'a::type option))
-    (None::'b::type option)))
-                                   ((op &::bool => bool => bool)
-                                     ((op =::'a::type option
-       => 'a::type option => bool)
- ((OPTION_JOIN::'a::type option option => 'a::type option)
-   (None::'a::type option option))
- (None::'a::type option))
-                                     ((All::('a::type option => bool)
-      => bool)
- (%x::'a::type option.
-     (op =::'a::type option => 'a::type option => bool)
-      ((OPTION_JOIN::'a::type option option => 'a::type option)
-        ((Some::'a::type option => 'a::type option option) x))
-      x))))))))))))))))))))"
-  sorry
-
-lemma option_case_compute: "option_case (e::'b) (f::'a => 'b) (x::'a option) =
-(if IS_SOME x then f (the x) else e)"
-  sorry
-
-lemma OPTION_MAP_EQ_SOME: "(Option.map (f::'a => 'b) (x::'a option) = Some (y::'b)) =
-(EX z::'a. x = Some z & y = f z)"
-  sorry
-
-lemma OPTION_JOIN_EQ_SOME: "(OPTION_JOIN x = Some xa) = (x = Some (Some xa))"
-  sorry
-
-lemma option_case_cong: "M = M' & (M' = None --> u = u') & (ALL x. M' = Some x --> f x = f' x)
-==> option_case u f M = option_case u' f' M'"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" marker
-
-consts
-  stmarker :: "'a => 'a" 
-
-defs
-  stmarker_primdef: "stmarker == %x. x"
-
-lemma stmarker_def: "stmarker x = x"
-  sorry
-
-lemma move_left_conj: "(x & stmarker xb) = (stmarker xb & x) &
-((stmarker xb & x) & xa) = (stmarker xb & x & xa) &
-(x & stmarker xb & xa) = (stmarker xb & x & xa)"
-  sorry
-
-lemma move_right_conj: "(stmarker xb & x) = (x & stmarker xb) &
-(x & xa & stmarker xb) = ((x & xa) & stmarker xb) &
-((x & stmarker xb) & xa) = ((x & xa) & stmarker xb)"
-  sorry
-
-lemma move_left_disj: "(x | stmarker xb) = (stmarker xb | x) &
-((stmarker xb | x) | xa) = (stmarker xb | x | xa) &
-(x | stmarker xb | xa) = (stmarker xb | x | xa)"
-  sorry
-
-lemma move_right_disj: "(stmarker xb | x) = (x | stmarker xb) &
-(x | xa | stmarker xb) = ((x | xa) | stmarker xb) &
-((x | stmarker xb) | xa) = ((x | xa) | stmarker xb)"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" relation
-
-definition
-  TC :: "('a => 'a => bool) => 'a => 'a => bool"  where
-  "TC ==
-%R a b.
-   ALL P.
-      (ALL x y. R x y --> P x y) & (ALL x y z. P x y & P y z --> P x z) -->
-      P a b"
-
-lemma TC_DEF: "TC R a b =
-(ALL P.
-    (ALL x y. R x y --> P x y) & (ALL x y z. P x y & P y z --> P x z) -->
-    P a b)"
-  sorry
-
-definition
-  RTC :: "('a => 'a => bool) => 'a => 'a => bool"  where
-  "RTC ==
-%R a b.
-   ALL P. (ALL x. P x x) & (ALL x y z. R x y & P y z --> P x z) --> P a b"
-
-lemma RTC_DEF: "RTC R a b =
-(ALL P. (ALL x. P x x) & (ALL x y z. R x y & P y z --> P x z) --> P a b)"
-  sorry
-
-consts
-  RC :: "('a => 'a => bool) => 'a => 'a => bool" 
-
-defs
-  RC_primdef: "RC == %R x y. x = y | R x y"
-
-lemma RC_def: "RC R x y = (x = y | R x y)"
-  sorry
-
-consts
-  transitive :: "('a => 'a => bool) => bool" 
-
-defs
-  transitive_primdef: "transitive == %R. ALL x y z. R x y & R y z --> R x z"
-
-lemma transitive_def: "transitive R = (ALL x y z. R x y & R y z --> R x z)"
-  sorry
-
-definition
-  pred_reflexive :: "('a => 'a => bool) => bool"  where
-  "pred_reflexive == %R. ALL x. R x x"
-
-lemma reflexive_def: "pred_reflexive R = (ALL x. R x x)"
-  sorry
-
-lemma TC_TRANSITIVE: "transitive (TC x)"
-  sorry
-
-lemma RTC_INDUCT: "[| (ALL x. xa x x) & (ALL xb y z. x xb y & xa y z --> xa xb z);
-   RTC x xb xc |]
-==> xa xb xc"
-  sorry
-
-lemma TC_RULES: "(ALL xa xb. x xa xb --> TC x xa xb) &
-(ALL xa xb xc. TC x xa xb & TC x xb xc --> TC x xa xc)"
-  sorry
-
-lemma RTC_RULES: "(ALL xa. RTC x xa xa) &
-(ALL xa xb xc. x xa xb & RTC x xb xc --> RTC x xa xc)"
-  sorry
-
-lemma RTC_STRONG_INDUCT: "[| (ALL x. P x x) & (ALL x y z. R x y & RTC R y z & P y z --> P x z);
-   RTC R x y |]
-==> P x y"
-  sorry
-
-lemma RTC_RTC: "[| RTC R x y; RTC R y z |] ==> RTC R x z"
-  sorry
-
-lemma RTC_TRANSITIVE: "transitive (RTC x)"
-  sorry
-
-lemma RTC_REFLEXIVE: "pred_reflexive (RTC R)"
-  sorry
-
-lemma RC_REFLEXIVE: "pred_reflexive (RC R)"
-  sorry
-
-lemma TC_SUBSET: "x xa xb ==> TC x xa xb"
-  sorry
-
-lemma RTC_SUBSET: "R x y ==> RTC R x y"
-  sorry
-
-lemma RC_SUBSET: "R x y ==> RC R x y"
-  sorry
-
-lemma RC_RTC: "RC R x y ==> RTC R x y"
-  sorry
-
-lemma TC_INDUCT: "[| (ALL xb y. x xb y --> xa xb y) & (ALL x y z. xa x y & xa y z --> xa x z);
-   TC x xb xc |]
-==> xa xb xc"
-  sorry
-
-lemma TC_INDUCT_LEFT1: "[| (ALL xb y. x xb y --> xa xb y) &
-   (ALL xb y z. x xb y & xa y z --> xa xb z);
-   TC x xb xc |]
-==> xa xb xc"
-  sorry
-
-lemma TC_STRONG_INDUCT: "[| (ALL x y. R x y --> P x y) &
-   (ALL x y z. P x y & P y z & TC R x y & TC R y z --> P x z);
-   TC R u v |]
-==> P u v"
-  sorry
-
-lemma TC_STRONG_INDUCT_LEFT1: "[| (ALL x y. R x y --> P x y) &
-   (ALL x y z. R x y & P y z & TC R y z --> P x z);
-   TC R u v |]
-==> P u v"
-  sorry
-
-lemma TC_RTC: "TC R x y ==> RTC R x y"
-  sorry
-
-lemma RTC_TC_RC: "RTC R x y ==> RC R x y | TC R x y"
-  sorry
-
-lemma TC_RC_EQNS: "RC (TC R) = RTC R & TC (RC R) = RTC R"
-  sorry
-
-lemma RC_IDEM: "RC (RC R) = RC R"
-  sorry
-
-lemma TC_IDEM: "TC (TC R) = TC R"
-  sorry
-
-lemma RTC_IDEM: "RTC (RTC R) = RTC R"
-  sorry
-
-lemma RTC_CASES1: "RTC x xa xb = (xa = xb | (EX u. x xa u & RTC x u xb))"
-  sorry
-
-lemma RTC_CASES2: "RTC x xa xb = (xa = xb | (EX u. RTC x xa u & x u xb))"
-  sorry
-
-lemma RTC_CASES_RTC_TWICE: "RTC x xa xb = (EX u. RTC x xa u & RTC x u xb)"
-  sorry
-
-lemma TC_CASES1: "TC R x z ==> R x z | (EX y. R x y & TC R y z)"
-  sorry
-
-lemma TC_CASES2: "TC R x z ==> R x z | (EX y. TC R x y & R y z)"
-  sorry
-
-lemma TC_MONOTONE: "[| !!x y. R x y ==> Q x y; TC R x y |] ==> TC Q x y"
-  sorry
-
-lemma RTC_MONOTONE: "[| !!x y. R x y ==> Q x y; RTC R x y |] ==> RTC Q x y"
-  sorry
-
-definition
-  WF :: "('a => 'a => bool) => bool"  where
-  "WF == %R. ALL B. Ex B --> (EX min. B min & (ALL b. R b min --> ~ B b))"
-
-lemma WF_DEF: "WF R = (ALL B. Ex B --> (EX min. B min & (ALL b. R b min --> ~ B b)))"
-  sorry
-
-lemma WF_INDUCTION_THM: "[| WF R; !!x. (!!y. R y x ==> P y) ==> P x |] ==> P x"
-  sorry
-
-lemma WF_NOT_REFL: "[| WF x; x xa xb |] ==> xa ~= xb"
-  sorry
-
-definition
-  EMPTY_REL :: "'a => 'a => bool"  where
-  "EMPTY_REL == %x y. False"
-
-lemma EMPTY_REL_DEF: "EMPTY_REL x y = False"
-  sorry
-
-lemma WF_EMPTY_REL: "WF EMPTY_REL"
-  sorry
-
-lemma WF_SUBSET: "WF x & (ALL xb y. xa xb y --> x xb y) ==> WF xa"
-  sorry
-
-lemma WF_TC: "WF R ==> WF (TC R)"
-  sorry
-
-consts
-  inv_image :: "('b => 'b => bool) => ('a => 'b) => 'a => 'a => bool" 
-
-defs
-  inv_image_primdef: "relation.inv_image ==
-%(R::'b => 'b => bool) (f::'a => 'b) (x::'a) y::'a. R (f x) (f y)"
-
-lemma inv_image_def: "relation.inv_image R f = (%x y. R (f x) (f y))"
-  sorry
-
-lemma WF_inv_image: "WF (R::'b => 'b => bool) ==> WF (relation.inv_image R (f::'a => 'b))"
-  sorry
-
-definition
-  RESTRICT :: "('a => 'b) => ('a => 'a => bool) => 'a => 'a => 'b"  where
-  "RESTRICT == %f R x y. if R y x then f y else ARB"
-
-lemma RESTRICT_DEF: "RESTRICT f R x = (%y. if R y x then f y else ARB)"
-  sorry
-
-lemma RESTRICT_LEMMA: "xa xb xc ==> RESTRICT x xa xc xb = x xb"
-  sorry
-
-consts
-  approx :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => ('a => 'b) => bool" 
-
-defs
-  approx_primdef: "approx == %R M x f. f = RESTRICT (%y. M (RESTRICT f R y) y) R x"
-
-lemma approx_def: "approx R M x f = (f = RESTRICT (%y. M (RESTRICT f R y) y) R x)"
-  sorry
-
-consts
-  the_fun :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'a => 'b" 
-
-defs
-  the_fun_primdef: "the_fun == %R M x. Eps (approx R M x)"
-
-lemma the_fun_def: "the_fun R M x = Eps (approx R M x)"
-  sorry
-
-definition
-  WFREC :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'b"  where
-  "WFREC ==
-%R M x. M (RESTRICT (the_fun (TC R) (%f v. M (RESTRICT f R v) v) x) R x) x"
-
-lemma WFREC_DEF: "WFREC R M =
-(%x. M (RESTRICT (the_fun (TC R) (%f v. M (RESTRICT f R v) v) x) R x) x)"
-  sorry
-
-lemma WFREC_THM: "WF R ==> WFREC R M x = M (RESTRICT (WFREC R M) R x) x"
-  sorry
-
-lemma WFREC_COROLLARY: "[| f = WFREC R M; WF R |] ==> f x = M (RESTRICT f R x) x"
-  sorry
-
-lemma WF_RECURSION_THM: "WF R ==> EX! f. ALL x. f x = M (RESTRICT f R x) x"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" pair
-
-lemma CURRY_ONE_ONE_THM: "(curry f = curry g) = (f = g)"
-  sorry
-
-lemma UNCURRY_ONE_ONE_THM: "((%(x, y). f x y) = (%(x, y). g x y)) = (f = g)"
-  sorry
-
-lemma pair_Axiom: "EX x. ALL xa y. x (xa, y) = f xa y"
-  sorry
-
-lemma UNCURRY_CONG: "M = M' & (ALL x y. M' = (x, y) --> f x y = f' x y)
-==> prod_case f M = prod_case f' M'"
-  sorry
-
-lemma ELIM_PEXISTS: "(EX p. P (fst p) (snd p)) = (EX p1. Ex (P p1))"
-  sorry
-
-lemma ELIM_PFORALL: "(ALL p. P (fst p) (snd p)) = (ALL p1. All (P p1))"
-  sorry
-
-lemma PFORALL_THM: "(ALL xa. All (x xa)) = All (%(xa, y). x xa y)"
-  sorry
-
-lemma PEXISTS_THM: "(EX xa. Ex (x xa)) = Ex (%(xa, y). x xa y)"
-  sorry
-
-lemma LET2_RAND: "(x::'c => 'd)
- (let (x::'a, y::'b) = xa::'a * 'b in (xb::'a => 'b => 'c) x y) =
-(let (xa::'a, y::'b) = xa in x (xb xa y))"
-  sorry
-
-lemma LET2_RATOR: "(let (x::'a1, y::'a2) = x::'a1 * 'a2 in (xa::'a1 => 'a2 => 'b => 'c) x y)
- (xb::'b) =
-(let (x::'a1, y::'a2) = x in xa x y xb)"
-  sorry
-
-lemma pair_case_cong: "x = xa & (ALL x y. xa = (x, y) --> xb x y = f' x y)
-==> prod_case xb x = prod_case f' xa"
-  sorry
-
-definition
-  LEX :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool"  where
-  "LEX == %R1 R2 (s, t) (u, v). R1 s u | s = u & R2 t v"
-
-lemma LEX_DEF: "LEX R1 R2 = (%(s, t) (u, v). R1 s u | s = u & R2 t v)"
-  sorry
-
-lemma WF_LEX: "WF x & WF xa ==> WF (LEX x xa)"
-  sorry
-
-definition
-  RPROD :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool"  where
-  "RPROD == %R1 R2 (s, t) (u, v). R1 s u & R2 t v"
-
-lemma RPROD_DEF: "RPROD R1 R2 = (%(s, t) (u, v). R1 s u & R2 t v)"
-  sorry
-
-lemma WF_RPROD: "WF R & WF Q ==> WF (RPROD R Q)"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" num
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prim_rec
-
-lemma LESS_0_0: "0 < Suc 0"
-  sorry
-
-lemma LESS_LEMMA1: "x < Suc xa ==> x = xa | x < xa"
-  sorry
-
-lemma LESS_LEMMA2: "m = n | m < n ==> m < Suc n"
-  sorry
-
-lemma LESS_THM: "(m < Suc n) = (m = n | m < n)"
-  sorry
-
-lemma LESS_SUC_IMP: "[| x < Suc xa; x ~= xa |] ==> x < xa"
-  sorry
-
-lemma EQ_LESS: "Suc m = n ==> m < n"
-  sorry
-
-lemma NOT_LESS_EQ: "(m::nat) = (n::nat) ==> ~ m < n"
-  sorry
-
-definition
-  SIMP_REC_REL :: "(nat => 'a) => 'a => ('a => 'a) => nat => bool"  where
-  "SIMP_REC_REL == %fun x f n. fun 0 = x & (ALL m<n. fun (Suc m) = f (fun m))"
-
-lemma SIMP_REC_REL: "SIMP_REC_REL fun x f n = (fun 0 = x & (ALL m<n. fun (Suc m) = f (fun m)))"
-  sorry
-
-lemma SIMP_REC_EXISTS: "EX fun. SIMP_REC_REL fun x f n"
-  sorry
-
-lemma SIMP_REC_REL_UNIQUE: "[| SIMP_REC_REL xb x xa xd & SIMP_REC_REL xc x xa xe; n < xd & n < xe |]
-==> xb n = xc n"
-  sorry
-
-lemma SIMP_REC_REL_UNIQUE_RESULT: "EX! y. EX g. SIMP_REC_REL g x f (Suc n) & y = g n"
-  sorry
-
-consts
-  SIMP_REC :: "'a => ('a => 'a) => nat => 'a" 
-
-specification (SIMP_REC) SIMP_REC: "ALL x f' n. EX g. SIMP_REC_REL g x f' (Suc n) & SIMP_REC x f' n = g n"
-  sorry
-
-lemma LESS_SUC_SUC: "m < Suc m & m < Suc (Suc m)"
-  sorry
-
-lemma SIMP_REC_THM: "SIMP_REC x f 0 = x & (ALL m. SIMP_REC x f (Suc m) = f (SIMP_REC x f m))"
-  sorry
-
-definition
-  PRE :: "nat => nat"  where
-  "PRE == %m. if m = 0 then 0 else SOME n. m = Suc n"
-
-lemma PRE_DEF: "PRE m = (if m = 0 then 0 else SOME n. m = Suc n)"
-  sorry
-
-lemma PRE: "PRE 0 = 0 & (ALL m. PRE (Suc m) = m)"
-  sorry
-
-definition
-  PRIM_REC_FUN :: "'a => ('a => nat => 'a) => nat => nat => 'a"  where
-  "PRIM_REC_FUN == %x f. SIMP_REC (%n. x) (%fun n. f (fun (PRE n)) n)"
-
-lemma PRIM_REC_FUN: "PRIM_REC_FUN x f = SIMP_REC (%n. x) (%fun n. f (fun (PRE n)) n)"
-  sorry
-
-lemma PRIM_REC_EQN: "(ALL n. PRIM_REC_FUN x f 0 n = x) &
-(ALL m n. PRIM_REC_FUN x f (Suc m) n = f (PRIM_REC_FUN x f m (PRE n)) n)"
-  sorry
-
-definition
-  PRIM_REC :: "'a => ('a => nat => 'a) => nat => 'a"  where
-  "PRIM_REC == %x f m. PRIM_REC_FUN x f m (PRE m)"
-
-lemma PRIM_REC: "PRIM_REC x f m = PRIM_REC_FUN x f m (PRE m)"
-  sorry
-
-lemma PRIM_REC_THM: "PRIM_REC x f 0 = x & (ALL m. PRIM_REC x f (Suc m) = f (PRIM_REC x f m) m)"
-  sorry
-
-lemma DC: "P a & (ALL x. P x --> (EX y. P y & R x y))
-==> EX x. x 0 = a & (ALL n. P (x n) & R (x n) (x (Suc n)))"
-  sorry
-
-lemma num_Axiom_old: "EX! fn1. fn1 0 = e & (ALL n. fn1 (Suc n) = f (fn1 n) n)"
-  sorry
-
-lemma num_Axiom: "EX x. x 0 = e & (ALL n. x (Suc n) = f n (x n))"
-  sorry
-
-consts
-  wellfounded :: "('a => 'a => bool) => bool" 
-
-defs
-  wellfounded_primdef: "wellfounded == %R. ~ (EX f. ALL n. R (f (Suc n)) (f n))"
-
-lemma wellfounded_def: "wellfounded R = (~ (EX f. ALL n. R (f (Suc n)) (f n)))"
-  sorry
-
-lemma WF_IFF_WELLFOUNDED: "WF R = wellfounded R"
-  sorry
-
-lemma WF_PRED: "WF (%x y. y = Suc x)"
-  sorry
-
-lemma WF_LESS: "(WF::(nat => nat => bool) => bool) (op <::nat => nat => bool)"
-  sorry
-
-consts
-  measure :: "('a => nat) => 'a => 'a => bool" 
-
-defs
-  measure_primdef: "prim_rec.measure == relation.inv_image op <"
-
-lemma measure_def: "prim_rec.measure = relation.inv_image op <"
-  sorry
-
-lemma WF_measure: "WF (prim_rec.measure x)"
-  sorry
-
-lemma measure_thm: "prim_rec.measure x xa xb = (x xa < x xb)"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" arithmetic
-
-definition
-  nat_elim__magic :: "nat => nat"  where
-  "nat_elim__magic == %n. n"
-
-lemma nat_elim__magic: "nat_elim__magic n = n"
-  sorry
-
-consts
-  EVEN :: "nat => bool" 
-
-specification (EVEN) EVEN: "EVEN 0 = True & (ALL n. EVEN (Suc n) = (~ EVEN n))"
-  sorry
-
-consts
-  ODD :: "nat => bool" 
-
-specification (ODD) ODD: "ODD 0 = False & (ALL n. ODD (Suc n) = (~ ODD n))"
-  sorry
-
-lemma TWO: "2 = Suc 1"
-  sorry
-
-lemma NORM_0: "(0::nat) = (0::nat)"
-  sorry
-
-lemma num_case_compute: "nat_case f g n = (if n = 0 then f else g (PRE n))"
-  sorry
-
-lemma ADD_CLAUSES: "0 + m = m & m + 0 = m & Suc m + n = Suc (m + n) & m + Suc n = Suc (m + n)"
-  sorry
-
-lemma LESS_ADD: "(n::nat) < (m::nat) ==> EX p::nat. p + n = m"
-  sorry
-
-lemma LESS_ANTISYM: "~ ((m::nat) < (n::nat) & n < m)"
-  sorry
-
-lemma LESS_LESS_SUC: "~ (x < xa & xa < Suc x)"
-  sorry
-
-lemma FUN_EQ_LEMMA: "f x1 & ~ f x2 ==> x1 ~= x2"
-  sorry
-
-lemma LESS_NOT_SUC: "m < n & n ~= Suc m ==> Suc m < n"
-  sorry
-
-lemma LESS_0_CASES: "(0::nat) = (m::nat) | (0::nat) < m"
-  sorry
-
-lemma LESS_CASES_IMP: "~ (m::nat) < (n::nat) & m ~= n ==> n < m"
-  sorry
-
-lemma LESS_CASES: "(m::nat) < (n::nat) | n <= m"
-  sorry
-
-lemma LESS_EQ_SUC_REFL: "m <= Suc m"
-  sorry
-
-lemma LESS_ADD_NONZERO: "(n::nat) ~= (0::nat) ==> (m::nat) < m + n"
-  sorry
-
-lemma LESS_EQ_ANTISYM: "~ ((x::nat) < (xa::nat) & xa <= x)"
-  sorry
-
-lemma SUB_0: "(0::nat) - (m::nat) = (0::nat) & m - (0::nat) = m"
-  sorry
-
-lemma PRE_SUB1: "PRE m = m - 1"
-  sorry
-
-lemma MULT_CLAUSES: "0 * x = 0 &
-x * 0 = 0 &
-1 * x = x & x * 1 = x & Suc x * xa = x * xa + xa & x * Suc xa = x + x * xa"
-  sorry
-
-lemma PRE_SUB: "PRE (m - n) = PRE m - n"
-  sorry
-
-lemma ADD_EQ_1: "((m::nat) + (n::nat) = (1::nat)) =
-(m = (1::nat) & n = (0::nat) | m = (0::nat) & n = (1::nat))"
-  sorry
-
-lemma ADD_INV_0_EQ: "((m::nat) + (n::nat) = m) = (n = (0::nat))"
-  sorry
-
-lemma PRE_SUC_EQ: "0 < n ==> (m = PRE n) = (Suc m = n)"
-  sorry
-
-lemma INV_PRE_EQ: "0 < m & 0 < n ==> (PRE m = PRE n) = (m = n)"
-  sorry
-
-lemma LESS_SUC_NOT: "m < n ==> ~ n < Suc m"
-  sorry
-
-lemma ADD_EQ_SUB: "(n::nat) <= (p::nat) ==> ((m::nat) + n = p) = (m = p - n)"
-  sorry
-
-lemma LESS_ADD_1: "(xa::nat) < (x::nat) ==> EX xb::nat. x = xa + (xb + (1::nat))"
-  sorry
-
-lemma NOT_ODD_EQ_EVEN: "Suc (n + n) ~= m + m"
-  sorry
-
-lemma MULT_SUC_EQ: "(n * Suc p = m * Suc p) = (n = m)"
-  sorry
-
-lemma MULT_EXP_MONO: "(n * Suc q ^ p = m * Suc q ^ p) = (n = m)"
-  sorry
-
-lemma LESS_ADD_SUC: "m < m + Suc n"
-  sorry
-
-lemma LESS_OR_EQ_ADD: "(n::nat) < (m::nat) | (EX p::nat. n = p + m)"
-  sorry
-
-lemma WOP: "Ex (P::nat => bool) ==> EX n::nat. P n & (ALL m<n. ~ P m)"
-  sorry
-
-lemma INV_PRE_LESS: "0 < m ==> (PRE m < PRE n) = (m < n)"
-  sorry
-
-lemma INV_PRE_LESS_EQ: "0 < n ==> (PRE m <= PRE n) = (m <= n)"
-  sorry
-
-lemma SUB_EQ_EQ_0: "((m::nat) - (n::nat) = m) = (m = (0::nat) | n = (0::nat))"
-  sorry
-
-lemma SUB_LESS_OR: "(n::nat) < (m::nat) ==> n <= m - (1::nat)"
-  sorry
-
-lemma LESS_SUB_ADD_LESS: "(i::nat) < (n::nat) - (m::nat) ==> i + m < n"
-  sorry
-
-lemma LESS_EQ_SUB_LESS: "(xa::nat) <= (x::nat) ==> (x - xa < (c::nat)) = (x < xa + c)"
-  sorry
-
-lemma NOT_SUC_LESS_EQ: "(~ Suc x <= xa) = (xa <= x)"
-  sorry
-
-lemma SUB_LESS_EQ_ADD: "(m::nat) <= (p::nat) ==> (p - m <= (n::nat)) = (p <= m + n)"
-  sorry
-
-lemma SUB_CANCEL: "(xa::nat) <= (x::nat) & (xb::nat) <= x ==> (x - xa = x - xb) = (xa = xb)"
-  sorry
-
-lemma NOT_EXP_0: "Suc n ^ m ~= 0"
-  sorry
-
-lemma ZERO_LESS_EXP: "0 < Suc n ^ m"
-  sorry
-
-lemma ODD_OR_EVEN: "EX xa. x = Suc (Suc 0) * xa | x = Suc (Suc 0) * xa + 1"
-  sorry
-
-lemma LESS_EXP_SUC_MONO: "Suc (Suc m) ^ n < Suc (Suc m) ^ Suc n"
-  sorry
-
-lemma LESS_LESS_CASES: "(m::nat) = (n::nat) | m < n | n < m"
-  sorry
-
-consts
-  FACT :: "nat => nat" 
-
-specification (FACT) FACT: "FACT 0 = 1 & (ALL n. FACT (Suc n) = Suc n * FACT n)"
-  sorry
-
-lemma FACT_LESS: "0 < FACT n"
-  sorry
-
-lemma EVEN_ODD: "EVEN n = (~ ODD n)"
-  sorry
-
-lemma ODD_EVEN: "ODD x = (~ EVEN x)"
-  sorry
-
-lemma EVEN_OR_ODD: "EVEN x | ODD x"
-  sorry
-
-lemma EVEN_AND_ODD: "~ (EVEN x & ODD x)"
-  sorry
-
-lemma EVEN_ADD: "EVEN (m + n) = (EVEN m = EVEN n)"
-  sorry
-
-lemma EVEN_MULT: "EVEN (m * n) = (EVEN m | EVEN n)"
-  sorry
-
-lemma ODD_ADD: "ODD (m + n) = (ODD m ~= ODD n)"
-  sorry
-
-lemma ODD_MULT: "ODD (m * n) = (ODD m & ODD n)"
-  sorry
-
-lemma EVEN_DOUBLE: "EVEN (2 * n)"
-  sorry
-
-lemma ODD_DOUBLE: "ODD (Suc (2 * x))"
-  sorry
-
-lemma EVEN_ODD_EXISTS: "(EVEN x --> (EX m. x = 2 * m)) & (ODD x --> (EX m. x = Suc (2 * m)))"
-  sorry
-
-lemma EVEN_EXISTS: "EVEN n = (EX m. n = 2 * m)"
-  sorry
-
-lemma ODD_EXISTS: "ODD n = (EX m. n = Suc (2 * m))"
-  sorry
-
-lemma NOT_SUC_LESS_EQ_0: "~ Suc x <= 0"
-  sorry
-
-lemma NOT_NUM_EQ: "(x ~= xa) = (Suc x <= xa | Suc xa <= x)"
-  sorry
-
-lemma SUC_ADD_SYM: "Suc (m + n) = Suc n + m"
-  sorry
-
-lemma NOT_SUC_ADD_LESS_EQ: "~ Suc (m + n) <= m"
-  sorry
-
-lemma SUB_LEFT_ADD: "(m::nat) + ((n::nat) - (p::nat)) = (if n <= p then m else m + n - p)"
-  sorry
-
-lemma SUB_RIGHT_ADD: "(m::nat) - (n::nat) + (p::nat) = (if m <= n then p else m + p - n)"
-  sorry
-
-lemma SUB_LEFT_SUB: "(m::nat) - ((n::nat) - (p::nat)) = (if n <= p then m else m + p - n)"
-  sorry
-
-lemma SUB_LEFT_SUC: "Suc (m - n) = (if m <= n then Suc 0 else Suc m - n)"
-  sorry
-
-lemma SUB_LEFT_LESS_EQ: "((m::nat) <= (n::nat) - (p::nat)) = (m + p <= n | m <= (0::nat))"
-  sorry
-
-lemma SUB_RIGHT_LESS_EQ: "((m::nat) - (n::nat) <= (p::nat)) = (m <= n + p)"
-  sorry
-
-lemma SUB_RIGHT_LESS: "((m::nat) - (n::nat) < (p::nat)) = (m < n + p & (0::nat) < p)"
-  sorry
-
-lemma SUB_RIGHT_GREATER_EQ: "((p::nat) <= (m::nat) - (n::nat)) = (n + p <= m | p <= (0::nat))"
-  sorry
-
-lemma SUB_LEFT_GREATER: "((n::nat) - (p::nat) < (m::nat)) = (n < m + p & (0::nat) < m)"
-  sorry
-
-lemma SUB_RIGHT_GREATER: "((p::nat) < (m::nat) - (n::nat)) = (n + p < m)"
-  sorry
-
-lemma SUB_LEFT_EQ: "((m::nat) = (n::nat) - (p::nat)) = (m + p = n | m <= (0::nat) & n <= p)"
-  sorry
-
-lemma SUB_RIGHT_EQ: "((m::nat) - (n::nat) = (p::nat)) = (m = n + p | m <= n & p <= (0::nat))"
-  sorry
-
-lemma LE: "(ALL n::nat. (n <= (0::nat)) = (n = (0::nat))) &
-(ALL (m::nat) n::nat. (m <= Suc n) = (m = Suc n | m <= n))"
-  sorry
-
-lemma DA: "(0::nat) < (n::nat) ==> EX (x::nat) q::nat. (k::nat) = q * n + x & x < n"
-  sorry
-
-lemma DIV_LESS_EQ: "(0::nat) < (n::nat) ==> (k::nat) div n <= k"
-  sorry
-
-lemma DIV_UNIQUE: "EX r::nat. (k::nat) = (q::nat) * (n::nat) + r & r < n ==> k div n = q"
-  sorry
-
-lemma MOD_UNIQUE: "EX q::nat. (k::nat) = q * (n::nat) + (r::nat) & r < n ==> k mod n = r"
-  sorry
-
-lemma DIV_MULT: "(r::nat) < (n::nat) ==> ((q::nat) * n + r) div n = q"
-  sorry
-
-lemma MOD_EQ_0: "(0::nat) < (n::nat) ==> (k::nat) * n mod n = (0::nat)"
-  sorry
-
-lemma ZERO_MOD: "(0::nat) < (n::nat) ==> (0::nat) mod n = (0::nat)"
-  sorry
-
-lemma ZERO_DIV: "(0::nat) < (n::nat) ==> (0::nat) div n = (0::nat)"
-  sorry
-
-lemma MOD_MULT: "(r::nat) < (n::nat) ==> ((q::nat) * n + r) mod n = r"
-  sorry
-
-lemma MOD_TIMES: "(0::nat) < (n::nat) ==> ((q::nat) * n + (r::nat)) mod n = r mod n"
-  sorry
-
-lemma MOD_PLUS: "(0::nat) < (n::nat)
-==> ((j::nat) mod n + (k::nat) mod n) mod n = (j + k) mod n"
-  sorry
-
-lemma MOD_MOD: "(0::nat) < (n::nat) ==> (k::nat) mod n mod n = k mod n"
-  sorry
-
-lemma ADD_DIV_ADD_DIV: "(0::nat) < (x::nat) ==> ((xa::nat) * x + (r::nat)) div x = xa + r div x"
-  sorry
-
-lemma MOD_MULT_MOD: "(0::nat) < (n::nat) & (0::nat) < (m::nat)
-==> (x::nat) mod (n * m) mod n = x mod n"
-  sorry
-
-lemma DIVMOD_ID: "(0::nat) < (n::nat) ==> n div n = (1::nat) & n mod n = (0::nat)"
-  sorry
-
-lemma DIV_DIV_DIV_MULT: "(0::nat) < (x::nat) & (0::nat) < (xa::nat)
-==> (xb::nat) div x div xa = xb div (x * xa)"
-  sorry
-
-lemma DIV_P: "(0::nat) < (q::nat)
-==> (P::nat => bool) ((p::nat) div q) =
-    (EX (k::nat) r::nat. p = k * q + r & r < q & P k)"
-  sorry
-
-lemma MOD_P: "(0::nat) < (q::nat)
-==> (P::nat => bool) ((p::nat) mod q) =
-    (EX (k::nat) r::nat. p = k * q + r & r < q & P r)"
-  sorry
-
-lemma MOD_TIMES2: "(0::nat) < (n::nat)
-==> (j::nat) mod n * ((k::nat) mod n) mod n = j * k mod n"
-  sorry
-
-lemma MOD_COMMON_FACTOR: "(0::nat) < (n::nat) & (0::nat) < (q::nat)
-==> n * ((p::nat) mod q) = n * p mod (n * q)"
-  sorry
-
-lemma num_case_cong: "M = M' & (M' = 0 --> b = b') & (ALL n. M' = Suc n --> f n = f' n)
-==> nat_case b f M = nat_case b' f' M'"
-  sorry
-
-lemma SUC_ELIM_THM: "(ALL n. P (Suc n) n) = (ALL n>0. P n (n - 1))"
-  sorry
-
-lemma SUB_ELIM_THM: "(P::nat => bool) ((a::nat) - (b::nat)) =
-(ALL x::nat. (b = a + x --> P (0::nat)) & (a = b + x --> P x))"
-  sorry
-
-lemma PRE_ELIM_THM: "P (PRE n) = (ALL m. (n = 0 --> P 0) & (n = Suc m --> P m))"
-  sorry
-
-lemma MULT_INCREASES: "1 < m & 0 < n ==> Suc n <= m * n"
-  sorry
-
-lemma EXP_ALWAYS_BIG_ENOUGH: "(1::nat) < (b::nat) ==> EX m::nat. (n::nat) <= b ^ m"
-  sorry
-
-lemma EXP_EQ_0: "((n::nat) ^ (m::nat) = (0::nat)) = (n = (0::nat) & (0::nat) < m)"
-  sorry
-
-lemma EXP_1: "(1::nat) ^ (x::nat) = (1::nat) & x ^ (1::nat) = x"
-  sorry
-
-lemma MIN_MAX_EQ: "(min (x::nat) (xa::nat) = max x xa) = (x = xa)"
-  sorry
-
-lemma MIN_MAX_LT: "(min (x::nat) (xa::nat) < max x xa) = (x ~= xa)"
-  sorry
-
-lemma MIN_MAX_PRED: "(P::nat => bool) (m::nat) & P (n::nat) ==> P (min m n) & P (max m n)"
-  sorry
-
-lemma MIN_LT: "(min (xa::nat) (x::nat) < xa) = (xa ~= x & min xa x = x) &
-(min xa x < x) = (xa ~= x & min xa x = xa) &
-(xa < min xa x) = False & (x < min xa x) = False"
-  sorry
-
-lemma MAX_LT: "((xa::nat) < max xa (x::nat)) = (xa ~= x & max xa x = x) &
-(x < max xa x) = (xa ~= x & max xa x = xa) &
-(max xa x < xa) = False & (max xa x < x) = False"
-  sorry
-
-lemma MIN_LE: "min (xa::nat) (x::nat) <= xa & min xa x <= x"
-  sorry
-
-lemma MAX_LE: "(xa::nat) <= max xa (x::nat) & x <= max xa x"
-  sorry
-
-lemma MIN_0: "min (x::nat) (0::nat) = (0::nat) & min (0::nat) x = (0::nat)"
-  sorry
-
-lemma MAX_0: "max (x::nat) (0::nat) = x & max (0::nat) x = x"
-  sorry
-
-lemma EXISTS_GREATEST: "(Ex (P::nat => bool) & (EX x::nat. ALL y>x. ~ P y)) =
-(EX x::nat. P x & (ALL y>x. ~ P y))"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" hrat
-
-definition
-  trat_1 :: "nat * nat"  where
-  "trat_1 == (0, 0)"
-
-lemma trat_1: "trat_1 = (0, 0)"
-  sorry
-
-definition
-  trat_inv :: "nat * nat => nat * nat"  where
-  "trat_inv == %(x, y). (y, x)"
-
-lemma trat_inv: "trat_inv (x, y) = (y, x)"
-  sorry
-
-definition
-  trat_add :: "nat * nat => nat * nat => nat * nat"  where
-  "trat_add ==
-%(x, y) (x', y').
-   (PRE (Suc x * Suc y' + Suc x' * Suc y), PRE (Suc y * Suc y'))"
-
-lemma trat_add: "trat_add (x, y) (x', y') =
-(PRE (Suc x * Suc y' + Suc x' * Suc y), PRE (Suc y * Suc y'))"
-  sorry
-
-definition
-  trat_mul :: "nat * nat => nat * nat => nat * nat"  where
-  "trat_mul == %(x, y) (x', y'). (PRE (Suc x * Suc x'), PRE (Suc y * Suc y'))"
-
-lemma trat_mul: "trat_mul (x, y) (x', y') = (PRE (Suc x * Suc x'), PRE (Suc y * Suc y'))"
-  sorry
-
-consts
-  trat_sucint :: "nat => nat * nat" 
-
-specification (trat_sucint) trat_sucint: "trat_sucint 0 = trat_1 &
-(ALL n. trat_sucint (Suc n) = trat_add (trat_sucint n) trat_1)"
-  sorry
-
-definition
-  trat_eq :: "nat * nat => nat * nat => bool"  where
-  "trat_eq == %(x, y) (x', y'). Suc x * Suc y' = Suc x' * Suc y"
-
-lemma trat_eq: "trat_eq (x, y) (x', y') = (Suc x * Suc y' = Suc x' * Suc y)"
-  sorry
-
-lemma TRAT_EQ_REFL: "trat_eq p p"
-  sorry
-
-lemma TRAT_EQ_SYM: "trat_eq p q = trat_eq q p"
-  sorry
-
-lemma TRAT_EQ_TRANS: "trat_eq p q & trat_eq q r ==> trat_eq p r"
-  sorry
-
-lemma TRAT_EQ_AP: "p = q ==> trat_eq p q"
-  sorry
-
-lemma TRAT_ADD_SYM_EQ: "trat_add h i = trat_add i h"
-  sorry
-
-lemma TRAT_MUL_SYM_EQ: "trat_mul h i = trat_mul i h"
-  sorry
-
-lemma TRAT_INV_WELLDEFINED: "trat_eq p q ==> trat_eq (trat_inv p) (trat_inv q)"
-  sorry
-
-lemma TRAT_ADD_WELLDEFINED: "trat_eq p q ==> trat_eq (trat_add p r) (trat_add q r)"
-  sorry
-
-lemma TRAT_ADD_WELLDEFINED2: "trat_eq p1 p2 & trat_eq q1 q2 ==> trat_eq (trat_add p1 q1) (trat_add p2 q2)"
-  sorry
-
-lemma TRAT_MUL_WELLDEFINED: "trat_eq p q ==> trat_eq (trat_mul p r) (trat_mul q r)"
-  sorry
-
-lemma TRAT_MUL_WELLDEFINED2: "trat_eq p1 p2 & trat_eq q1 q2 ==> trat_eq (trat_mul p1 q1) (trat_mul p2 q2)"
-  sorry
-
-lemma TRAT_ADD_SYM: "trat_eq (trat_add h i) (trat_add i h)"
-  sorry
-
-lemma TRAT_ADD_ASSOC: "trat_eq (trat_add h (trat_add i j)) (trat_add (trat_add h i) j)"
-  sorry
-
-lemma TRAT_MUL_SYM: "trat_eq (trat_mul h i) (trat_mul i h)"
-  sorry
-
-lemma TRAT_MUL_ASSOC: "trat_eq (trat_mul h (trat_mul i j)) (trat_mul (trat_mul h i) j)"
-  sorry
-
-lemma TRAT_LDISTRIB: "trat_eq (trat_mul h (trat_add i j)) (trat_add (trat_mul h i) (trat_mul h j))"
-  sorry
-
-lemma TRAT_MUL_LID: "trat_eq (trat_mul trat_1 h) h"
-  sorry
-
-lemma TRAT_MUL_LINV: "trat_eq (trat_mul (trat_inv h) h) trat_1"
-  sorry
-
-lemma TRAT_NOZERO: "~ trat_eq (trat_add h i) h"
-  sorry
-
-lemma TRAT_ADD_TOTAL: "trat_eq h i |
-(EX d. trat_eq h (trat_add i d)) | (EX d. trat_eq i (trat_add h d))"
-  sorry
-
-lemma TRAT_SUCINT_0: "trat_eq (trat_sucint n) (n, 0)"
-  sorry
-
-lemma TRAT_ARCH: "EX n d. trat_eq (trat_sucint n) (trat_add h d)"
-  sorry
-
-lemma TRAT_SUCINT: "trat_eq (trat_sucint 0) trat_1 &
-(ALL n. trat_eq (trat_sucint (Suc n)) (trat_add (trat_sucint n) trat_1))"
-  sorry
-
-lemma TRAT_EQ_EQUIV: "trat_eq p q = (trat_eq p = trat_eq q)"
-  sorry
-
-typedef (open) hrat = "{x. EX xa. x = trat_eq xa}" 
-  sorry
-
-lemmas hrat_TY_DEF = typedef_hol2hol4 [OF type_definition_hrat]
-
-consts
-  mk_hrat :: "(nat * nat => bool) => hrat" 
-  dest_hrat :: "hrat => nat * nat => bool" 
-
-specification (dest_hrat mk_hrat) hrat_tybij: "(ALL a. mk_hrat (dest_hrat a) = a) &
-(ALL r. (EX x. r = trat_eq x) = (dest_hrat (mk_hrat r) = r))"
-  sorry
-
-definition
-  hrat_1 :: "hrat"  where
-  "hrat_1 == mk_hrat (trat_eq trat_1)"
-
-lemma hrat_1: "hrat_1 = mk_hrat (trat_eq trat_1)"
-  sorry
-
-definition
-  hrat_inv :: "hrat => hrat"  where
-  "hrat_inv == %T1. mk_hrat (trat_eq (trat_inv (Eps (dest_hrat T1))))"
-
-lemma hrat_inv: "hrat_inv T1 = mk_hrat (trat_eq (trat_inv (Eps (dest_hrat T1))))"
-  sorry
-
-definition
-  hrat_add :: "hrat => hrat => hrat"  where
-  "hrat_add ==
-%T1 T2.
-   mk_hrat (trat_eq (trat_add (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
-
-lemma hrat_add: "hrat_add T1 T2 =
-mk_hrat (trat_eq (trat_add (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
-  sorry
-
-definition
-  hrat_mul :: "hrat => hrat => hrat"  where
-  "hrat_mul ==
-%T1 T2.
-   mk_hrat (trat_eq (trat_mul (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
-
-lemma hrat_mul: "hrat_mul T1 T2 =
-mk_hrat (trat_eq (trat_mul (Eps (dest_hrat T1)) (Eps (dest_hrat T2))))"
-  sorry
-
-definition
-  hrat_sucint :: "nat => hrat"  where
-  "hrat_sucint == %T1. mk_hrat (trat_eq (trat_sucint T1))"
-
-lemma hrat_sucint: "hrat_sucint T1 = mk_hrat (trat_eq (trat_sucint T1))"
-  sorry
-
-lemma HRAT_ADD_SYM: "hrat_add h i = hrat_add i h"
-  sorry
-
-lemma HRAT_ADD_ASSOC: "hrat_add h (hrat_add i j) = hrat_add (hrat_add h i) j"
-  sorry
-
-lemma HRAT_MUL_SYM: "hrat_mul h i = hrat_mul i h"
-  sorry
-
-lemma HRAT_MUL_ASSOC: "hrat_mul h (hrat_mul i j) = hrat_mul (hrat_mul h i) j"
-  sorry
-
-lemma HRAT_LDISTRIB: "hrat_mul h (hrat_add i j) = hrat_add (hrat_mul h i) (hrat_mul h j)"
-  sorry
-
-lemma HRAT_MUL_LID: "hrat_mul hrat_1 h = h"
-  sorry
-
-lemma HRAT_MUL_LINV: "hrat_mul (hrat_inv h) h = hrat_1"
-  sorry
-
-lemma HRAT_NOZERO: "hrat_add h i ~= h"
-  sorry
-
-lemma HRAT_ADD_TOTAL: "h = i | (EX x. h = hrat_add i x) | (EX x. i = hrat_add h x)"
-  sorry
-
-lemma HRAT_ARCH: "EX x xa. hrat_sucint x = hrat_add h xa"
-  sorry
-
-lemma HRAT_SUCINT: "hrat_sucint 0 = hrat_1 &
-(ALL x. hrat_sucint (Suc x) = hrat_add (hrat_sucint x) hrat_1)"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" hreal
-
-definition
-  hrat_lt :: "hrat => hrat => bool"  where
-  "hrat_lt == %x y. EX d. y = hrat_add x d"
-
-lemma hrat_lt: "hrat_lt x y = (EX d. y = hrat_add x d)"
-  sorry
-
-lemma HRAT_LT_REFL: "~ hrat_lt x x"
-  sorry
-
-lemma HRAT_LT_TRANS: "hrat_lt x y & hrat_lt y z ==> hrat_lt x z"
-  sorry
-
-lemma HRAT_LT_ANTISYM: "~ (hrat_lt x y & hrat_lt y x)"
-  sorry
-
-lemma HRAT_LT_TOTAL: "x = y | hrat_lt x y | hrat_lt y x"
-  sorry
-
-lemma HRAT_MUL_RID: "hrat_mul x hrat_1 = x"
-  sorry
-
-lemma HRAT_MUL_RINV: "hrat_mul x (hrat_inv x) = hrat_1"
-  sorry
-
-lemma HRAT_RDISTRIB: "hrat_mul (hrat_add x y) z = hrat_add (hrat_mul x z) (hrat_mul y z)"
-  sorry
-
-lemma HRAT_LT_ADDL: "hrat_lt x (hrat_add x y)"
-  sorry
-
-lemma HRAT_LT_ADDR: "hrat_lt xa (hrat_add x xa)"
-  sorry
-
-lemma HRAT_LT_GT: "hrat_lt x y ==> ~ hrat_lt y x"
-  sorry
-
-lemma HRAT_LT_NE: "hrat_lt x y ==> x ~= y"
-  sorry
-
-lemma HRAT_EQ_LADD: "(hrat_add x y = hrat_add x z) = (y = z)"
-  sorry
-
-lemma HRAT_EQ_LMUL: "(hrat_mul x y = hrat_mul x z) = (y = z)"
-  sorry
-
-lemma HRAT_LT_ADD2: "hrat_lt u x & hrat_lt v y ==> hrat_lt (hrat_add u v) (hrat_add x y)"
-  sorry
-
-lemma HRAT_LT_LADD: "hrat_lt (hrat_add z x) (hrat_add z y) = hrat_lt x y"
-  sorry
-
-lemma HRAT_LT_RADD: "hrat_lt (hrat_add x z) (hrat_add y z) = hrat_lt x y"
-  sorry
-
-lemma HRAT_LT_MUL2: "hrat_lt u x & hrat_lt v y ==> hrat_lt (hrat_mul u v) (hrat_mul x y)"
-  sorry
-
-lemma HRAT_LT_LMUL: "hrat_lt (hrat_mul z x) (hrat_mul z y) = hrat_lt x y"
-  sorry
-
-lemma HRAT_LT_RMUL: "hrat_lt (hrat_mul x z) (hrat_mul y z) = hrat_lt x y"
-  sorry
-
-lemma HRAT_LT_LMUL1: "hrat_lt (hrat_mul x y) y = hrat_lt x hrat_1"
-  sorry
-
-lemma HRAT_LT_RMUL1: "hrat_lt (hrat_mul x y) x = hrat_lt y hrat_1"
-  sorry
-
-lemma HRAT_GT_LMUL1: "hrat_lt y (hrat_mul x y) = hrat_lt hrat_1 x"
-  sorry
-
-lemma HRAT_LT_L1: "hrat_lt (hrat_mul (hrat_inv x) y) hrat_1 = hrat_lt y x"
-  sorry
-
-lemma HRAT_LT_R1: "hrat_lt (hrat_mul x (hrat_inv y)) hrat_1 = hrat_lt x y"
-  sorry
-
-lemma HRAT_GT_L1: "hrat_lt hrat_1 (hrat_mul (hrat_inv x) y) = hrat_lt x y"
-  sorry
-
-lemma HRAT_INV_MUL: "hrat_inv (hrat_mul x y) = hrat_mul (hrat_inv x) (hrat_inv y)"
-  sorry
-
-lemma HRAT_UP: "Ex (hrat_lt x)"
-  sorry
-
-lemma HRAT_DOWN: "EX xa. hrat_lt xa x"
-  sorry
-
-lemma HRAT_DOWN2: "EX xa. hrat_lt xa x & hrat_lt xa y"
-  sorry
-
-lemma HRAT_MEAN: "hrat_lt x y ==> EX xa. hrat_lt x xa & hrat_lt xa y"
-  sorry
-
-definition
-  isacut :: "(hrat => bool) => bool"  where
-  "isacut ==
-%C. Ex C &
-    (EX x. ~ C x) &
-    (ALL x y. C x & hrat_lt y x --> C y) &
-    (ALL x. C x --> (EX y. C y & hrat_lt x y))"
-
-lemma isacut: "isacut (CC::hrat => bool) =
-(Ex CC &
- (EX x::hrat. ~ CC x) &
- (ALL (x::hrat) y::hrat. CC x & hrat_lt y x --> CC y) &
- (ALL x::hrat. CC x --> (EX y::hrat. CC y & hrat_lt x y)))"
-  sorry
-
-definition
-  cut_of_hrat :: "hrat => hrat => bool"  where
-  "cut_of_hrat == %x y. hrat_lt y x"
-
-lemma cut_of_hrat: "cut_of_hrat x = (%y. hrat_lt y x)"
-  sorry
-
-lemma ISACUT_HRAT: "isacut (cut_of_hrat h)"
-  sorry
-
-typedef (open) hreal = "Collect isacut" 
-  sorry
-
-lemmas hreal_TY_DEF = typedef_hol2hol4 [OF type_definition_hreal]
-
-consts
-  hreal :: "(hrat => bool) => hreal" 
-  cut :: "hreal => hrat => bool" 
-
-specification (cut hreal) hreal_tybij: "(ALL a. hreal (cut a) = a) & (ALL r. isacut r = (cut (hreal r) = r))"
-  sorry
-
-lemma EQUAL_CUTS: "cut X = cut Y ==> X = Y"
-  sorry
-
-lemma CUT_ISACUT: "isacut (cut x)"
-  sorry
-
-lemma CUT_NONEMPTY: "Ex (cut x)"
-  sorry
-
-lemma CUT_BOUNDED: "EX xa. ~ cut x xa"
-  sorry
-
-lemma CUT_DOWN: "cut x xa & hrat_lt xb xa ==> cut x xb"
-  sorry
-
-lemma CUT_UP: "cut x xa ==> EX y. cut x y & hrat_lt xa y"
-  sorry
-
-lemma CUT_UBOUND: "~ cut x xa & hrat_lt xa xb ==> ~ cut x xb"
-  sorry
-
-lemma CUT_STRADDLE: "cut X x & ~ cut X y ==> hrat_lt x y"
-  sorry
-
-lemma CUT_NEARTOP_ADD: "EX x. cut X x & ~ cut X (hrat_add x e)"
-  sorry
-
-lemma CUT_NEARTOP_MUL: "hrat_lt hrat_1 u ==> EX x. cut X x & ~ cut X (hrat_mul u x)"
-  sorry
-
-definition
-  hreal_1 :: "hreal"  where
-  "hreal_1 == hreal (cut_of_hrat hrat_1)"
-
-lemma hreal_1: "hreal_1 = hreal (cut_of_hrat hrat_1)"
-  sorry
-
-definition
-  hreal_add :: "hreal => hreal => hreal"  where
-  "hreal_add == %X Y. hreal (%w. EX x y. w = hrat_add x y & cut X x & cut Y y)"
-
-lemma hreal_add: "hreal_add X Y = hreal (%w. EX x y. w = hrat_add x y & cut X x & cut Y y)"
-  sorry
-
-definition
-  hreal_mul :: "hreal => hreal => hreal"  where
-  "hreal_mul == %X Y. hreal (%w. EX x y. w = hrat_mul x y & cut X x & cut Y y)"
-
-lemma hreal_mul: "hreal_mul X Y = hreal (%w. EX x y. w = hrat_mul x y & cut X x & cut Y y)"
-  sorry
-
-definition
-  hreal_inv :: "hreal => hreal"  where
-  "hreal_inv ==
-%X. hreal
-     (%w. EX d. hrat_lt d hrat_1 &
-                (ALL x. cut X x --> hrat_lt (hrat_mul w x) d))"
-
-lemma hreal_inv: "hreal_inv X =
-hreal
- (%w. EX d. hrat_lt d hrat_1 &
-            (ALL x. cut X x --> hrat_lt (hrat_mul w x) d))"
-  sorry
-
-definition
-  hreal_sup :: "(hreal => bool) => hreal"  where
-  "hreal_sup == %P. hreal (%w. EX X. P X & cut X w)"
-
-lemma hreal_sup: "hreal_sup P = hreal (%w. EX X. P X & cut X w)"
-  sorry
-
-definition
-  hreal_lt :: "hreal => hreal => bool"  where
-  "hreal_lt == %X Y. X ~= Y & (ALL x. cut X x --> cut Y x)"
-
-lemma hreal_lt: "hreal_lt X Y = (X ~= Y & (ALL x. cut X x --> cut Y x))"
-  sorry
-
-lemma HREAL_INV_ISACUT: "isacut
- (%w. EX d. hrat_lt d hrat_1 &
-            (ALL x. cut X x --> hrat_lt (hrat_mul w x) d))"
-  sorry
-
-lemma HREAL_ADD_ISACUT: "isacut (%w. EX x y. w = hrat_add x y & cut X x & cut Y y)"
-  sorry
-
-lemma HREAL_MUL_ISACUT: "isacut (%w. EX x y. w = hrat_mul x y & cut X x & cut Y y)"
-  sorry
-
-lemma HREAL_ADD_SYM: "hreal_add X Y = hreal_add Y X"
-  sorry
-
-lemma HREAL_MUL_SYM: "hreal_mul X Y = hreal_mul Y X"
-  sorry
-
-lemma HREAL_ADD_ASSOC: "hreal_add X (hreal_add Y Z) = hreal_add (hreal_add X Y) Z"
-  sorry
-
-lemma HREAL_MUL_ASSOC: "hreal_mul X (hreal_mul Y Z) = hreal_mul (hreal_mul X Y) Z"
-  sorry
-
-lemma HREAL_LDISTRIB: "hreal_mul X (hreal_add Y Z) = hreal_add (hreal_mul X Y) (hreal_mul X Z)"
-  sorry
-
-lemma HREAL_MUL_LID: "hreal_mul hreal_1 X = X"
-  sorry
-
-lemma HREAL_MUL_LINV: "hreal_mul (hreal_inv X) X = hreal_1"
-  sorry
-
-lemma HREAL_NOZERO: "hreal_add X Y ~= X"
-  sorry
-
-definition
-  hreal_sub :: "hreal => hreal => hreal"  where
-  "hreal_sub == %Y X. hreal (%w. EX x. ~ cut X x & cut Y (hrat_add x w))"
-
-lemma hreal_sub: "hreal_sub Y X = hreal (%w. EX x. ~ cut X x & cut Y (hrat_add x w))"
-  sorry
-
-lemma HREAL_LT_LEMMA: "hreal_lt X Y ==> EX x. ~ cut X x & cut Y x"
-  sorry
-
-lemma HREAL_SUB_ISACUT: "hreal_lt X Y ==> isacut (%w. EX x. ~ cut X x & cut Y (hrat_add x w))"
-  sorry
-
-lemma HREAL_SUB_ADD: "hreal_lt X Y ==> hreal_add (hreal_sub Y X) X = Y"
-  sorry
-
-lemma HREAL_LT_TOTAL: "X = Y | hreal_lt X Y | hreal_lt Y X"
-  sorry
-
-lemma HREAL_LT: "hreal_lt X Y = (EX D. Y = hreal_add X D)"
-  sorry
-
-lemma HREAL_ADD_TOTAL: "X = Y | (EX D. Y = hreal_add X D) | (EX D. X = hreal_add Y D)"
-  sorry
-
-lemma HREAL_SUP_ISACUT: "Ex P & (EX Y. ALL X. P X --> hreal_lt X Y)
-==> isacut (%w. EX X. P X & cut X w)"
-  sorry
-
-lemma HREAL_SUP: "Ex P & (EX Y. ALL X. P X --> hreal_lt X Y)
-==> (EX X. P X & hreal_lt Y X) = hreal_lt Y (hreal_sup P)"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" numeral
-
-lemma numeral_suc: "Suc ALT_ZERO = NUMERAL_BIT1 ALT_ZERO &
-(ALL x. Suc (NUMERAL_BIT1 x) = NUMERAL_BIT2 x) &
-(ALL x. Suc (NUMERAL_BIT2 x) = NUMERAL_BIT1 (Suc x))"
-  sorry
-
-definition
-  iZ :: "nat => nat"  where
-  "iZ == %x. x"
-
-lemma iZ: "iZ x = x"
-  sorry
-
-definition
-  iiSUC :: "nat => nat"  where
-  "iiSUC == %n. Suc (Suc n)"
-
-lemma iiSUC: "iiSUC n = Suc (Suc n)"
-  sorry
-
-lemma numeral_distrib: "(ALL x::nat. (0::nat) + x = x) &
-(ALL x::nat. x + (0::nat) = x) &
-(ALL (x::nat) xa::nat. NUMERAL x + NUMERAL xa = NUMERAL (iZ (x + xa))) &
-(ALL x::nat. (0::nat) * x = (0::nat)) &
-(ALL x::nat. x * (0::nat) = (0::nat)) &
-(ALL (x::nat) xa::nat. NUMERAL x * NUMERAL xa = NUMERAL (x * xa)) &
-(ALL x::nat. (0::nat) - x = (0::nat)) &
-(ALL x::nat. x - (0::nat) = x) &
-(ALL (x::nat) xa::nat. NUMERAL x - NUMERAL xa = NUMERAL (x - xa)) &
-(ALL x::nat. (0::nat) ^ NUMERAL (NUMERAL_BIT1 x) = (0::nat)) &
-(ALL x::nat. (0::nat) ^ NUMERAL (NUMERAL_BIT2 x) = (0::nat)) &
-(ALL x::nat. x ^ (0::nat) = (1::nat)) &
-(ALL (x::nat) xa::nat. NUMERAL x ^ NUMERAL xa = NUMERAL (x ^ xa)) &
-Suc (0::nat) = (1::nat) &
-(ALL x::nat. Suc (NUMERAL x) = NUMERAL (Suc x)) &
-PRE (0::nat) = (0::nat) &
-(ALL x::nat. PRE (NUMERAL x) = NUMERAL (PRE x)) &
-(ALL x::nat. (NUMERAL x = (0::nat)) = (x = ALT_ZERO)) &
-(ALL x::nat. ((0::nat) = NUMERAL x) = (x = ALT_ZERO)) &
-(ALL (x::nat) xa::nat. (NUMERAL x = NUMERAL xa) = (x = xa)) &
-(ALL x::nat. (x < (0::nat)) = False) &
-(ALL x::nat. ((0::nat) < NUMERAL x) = (ALT_ZERO < x)) &
-(ALL (x::nat) xa::nat. (NUMERAL x < NUMERAL xa) = (x < xa)) &
-(ALL x::nat. (x < (0::nat)) = False) &
-(ALL x::nat. ((0::nat) < NUMERAL x) = (ALT_ZERO < x)) &
-(ALL (x::nat) xa::nat. (NUMERAL xa < NUMERAL x) = (xa < x)) &
-(ALL x::nat. ((0::nat) <= x) = True) &
-(ALL x::nat. (NUMERAL x <= (0::nat)) = (x <= ALT_ZERO)) &
-(ALL (x::nat) xa::nat. (NUMERAL x <= NUMERAL xa) = (x <= xa)) &
-(ALL x::nat. ((0::nat) <= x) = True) &
-(ALL x::nat. (x <= (0::nat)) = (x = (0::nat))) &
-(ALL (x::nat) xa::nat. (NUMERAL xa <= NUMERAL x) = (xa <= x)) &
-(ALL x::nat. ODD (NUMERAL x) = ODD x) &
-(ALL x::nat. EVEN (NUMERAL x) = EVEN x) & ~ ODD (0::nat) & EVEN (0::nat)"
-  sorry
-
-lemma numeral_iisuc: "iiSUC ALT_ZERO = NUMERAL_BIT2 ALT_ZERO &
-iiSUC (NUMERAL_BIT1 n) = NUMERAL_BIT1 (Suc n) &
-iiSUC (NUMERAL_BIT2 n) = NUMERAL_BIT2 (Suc n)"
-  sorry
-
-lemma numeral_add: "iZ (ALT_ZERO + x) = x &
-iZ (x + ALT_ZERO) = x &
-iZ (NUMERAL_BIT1 x + NUMERAL_BIT1 xa) = NUMERAL_BIT2 (iZ (x + xa)) &
-iZ (NUMERAL_BIT1 x + NUMERAL_BIT2 xa) = NUMERAL_BIT1 (Suc (x + xa)) &
-iZ (NUMERAL_BIT2 x + NUMERAL_BIT1 xa) = NUMERAL_BIT1 (Suc (x + xa)) &
-iZ (NUMERAL_BIT2 x + NUMERAL_BIT2 xa) = NUMERAL_BIT2 (Suc (x + xa)) &
-Suc (ALT_ZERO + x) = Suc x &
-Suc (x + ALT_ZERO) = Suc x &
-Suc (NUMERAL_BIT1 x + NUMERAL_BIT1 xa) = NUMERAL_BIT1 (Suc (x + xa)) &
-Suc (NUMERAL_BIT1 x + NUMERAL_BIT2 xa) = NUMERAL_BIT2 (Suc (x + xa)) &
-Suc (NUMERAL_BIT2 x + NUMERAL_BIT1 xa) = NUMERAL_BIT2 (Suc (x + xa)) &
-Suc (NUMERAL_BIT2 x + NUMERAL_BIT2 xa) = NUMERAL_BIT1 (iiSUC (x + xa)) &
-iiSUC (ALT_ZERO + x) = iiSUC x &
-iiSUC (x + ALT_ZERO) = iiSUC x &
-iiSUC (NUMERAL_BIT1 x + NUMERAL_BIT1 xa) = NUMERAL_BIT2 (Suc (x + xa)) &
-iiSUC (NUMERAL_BIT1 x + NUMERAL_BIT2 xa) = NUMERAL_BIT1 (iiSUC (x + xa)) &
-iiSUC (NUMERAL_BIT2 x + NUMERAL_BIT1 xa) = NUMERAL_BIT1 (iiSUC (x + xa)) &
-iiSUC (NUMERAL_BIT2 x + NUMERAL_BIT2 xa) = NUMERAL_BIT2 (iiSUC (x + xa))"
-  sorry
-
-lemma numeral_eq: "(ALT_ZERO = NUMERAL_BIT1 x) = False &
-(NUMERAL_BIT1 x = ALT_ZERO) = False &
-(ALT_ZERO = NUMERAL_BIT2 x) = False &
-(NUMERAL_BIT2 x = ALT_ZERO) = False &
-(NUMERAL_BIT1 x = NUMERAL_BIT2 xa) = False &
-(NUMERAL_BIT2 x = NUMERAL_BIT1 xa) = False &
-(NUMERAL_BIT1 x = NUMERAL_BIT1 xa) = (x = xa) &
-(NUMERAL_BIT2 x = NUMERAL_BIT2 xa) = (x = xa)"
-  sorry
-
-lemma numeral_lt: "(ALT_ZERO < NUMERAL_BIT1 x) = True &
-(ALT_ZERO < NUMERAL_BIT2 x) = True &
-(x < ALT_ZERO) = False &
-(NUMERAL_BIT1 x < NUMERAL_BIT1 xa) = (x < xa) &
-(NUMERAL_BIT2 x < NUMERAL_BIT2 xa) = (x < xa) &
-(NUMERAL_BIT1 x < NUMERAL_BIT2 xa) = (~ xa < x) &
-(NUMERAL_BIT2 x < NUMERAL_BIT1 xa) = (x < xa)"
-  sorry
-
-lemma numeral_lte: "(ALT_ZERO <= x) = True &
-(NUMERAL_BIT1 x <= ALT_ZERO) = False &
-(NUMERAL_BIT2 x <= ALT_ZERO) = False &
-(NUMERAL_BIT1 x <= NUMERAL_BIT1 xa) = (x <= xa) &
-(NUMERAL_BIT1 x <= NUMERAL_BIT2 xa) = (x <= xa) &
-(NUMERAL_BIT2 x <= NUMERAL_BIT1 xa) = (~ xa <= x) &
-(NUMERAL_BIT2 x <= NUMERAL_BIT2 xa) = (x <= xa)"
-  sorry
-
-lemma numeral_pre: "PRE ALT_ZERO = ALT_ZERO &
-PRE (NUMERAL_BIT1 ALT_ZERO) = ALT_ZERO &
-(ALL x.
-    PRE (NUMERAL_BIT1 (NUMERAL_BIT1 x)) =
-    NUMERAL_BIT2 (PRE (NUMERAL_BIT1 x))) &
-(ALL x.
-    PRE (NUMERAL_BIT1 (NUMERAL_BIT2 x)) = NUMERAL_BIT2 (NUMERAL_BIT1 x)) &
-(ALL x. PRE (NUMERAL_BIT2 x) = NUMERAL_BIT1 x)"
-  sorry
-
-lemma bit_initiality: "EX x. x ALT_ZERO = zf &
-      (ALL n. x (NUMERAL_BIT1 n) = b1f n (x n)) &
-      (ALL n. x (NUMERAL_BIT2 n) = b2f n (x n))"
-  sorry
-
-consts
-  iBIT_cases :: "nat => 'a => (nat => 'a) => (nat => 'a) => 'a" 
-
-specification (iBIT_cases) iBIT_cases: "(ALL (zf::'a) (bf1::nat => 'a) bf2::nat => 'a.
-    iBIT_cases ALT_ZERO zf bf1 bf2 = zf) &
-(ALL (n::nat) (zf::'a) (bf1::nat => 'a) bf2::nat => 'a.
-    iBIT_cases (NUMERAL_BIT1 n) zf bf1 bf2 = bf1 n) &
-(ALL (n::nat) (zf::'a) (bf1::nat => 'a) bf2::nat => 'a.
-    iBIT_cases (NUMERAL_BIT2 n) zf bf1 bf2 = bf2 n)"
-  sorry
-
-definition
-  iDUB :: "nat => nat"  where
-  "iDUB == %x. x + x"
-
-lemma iDUB: "iDUB x = x + x"
-  sorry
-
-consts
-  iSUB :: "bool => nat => nat => nat" 
-
-specification (iSUB) iSUB_DEF: "(ALL b x. iSUB b ALT_ZERO x = ALT_ZERO) &
-(ALL b n x.
-    iSUB b (NUMERAL_BIT1 n) x =
-    (if b
-     then iBIT_cases x (NUMERAL_BIT1 n) (%m. iDUB (iSUB True n m))
-           (%m. NUMERAL_BIT1 (iSUB False n m))
-     else iBIT_cases x (iDUB n) (%m. NUMERAL_BIT1 (iSUB False n m))
-           (%m. iDUB (iSUB False n m)))) &
-(ALL b n x.
-    iSUB b (NUMERAL_BIT2 n) x =
-    (if b
-     then iBIT_cases x (NUMERAL_BIT2 n) (%m. NUMERAL_BIT1 (iSUB True n m))
-           (%m. iDUB (iSUB True n m))
-     else iBIT_cases x (NUMERAL_BIT1 n) (%m. iDUB (iSUB True n m))
-           (%m. NUMERAL_BIT1 (iSUB False n m))))"
-  sorry
-
-lemma bit_induction: "P ALT_ZERO &
-(ALL n. P n --> P (NUMERAL_BIT1 n)) & (ALL n. P n --> P (NUMERAL_BIT2 n))
-==> P x"
-  sorry
-
-lemma iSUB_THM: "iSUB (x::bool) ALT_ZERO (xn::nat) = ALT_ZERO &
-iSUB True (xa::nat) ALT_ZERO = xa &
-iSUB False (NUMERAL_BIT1 xa) ALT_ZERO = iDUB xa &
-iSUB True (NUMERAL_BIT1 xa) (NUMERAL_BIT1 (xb::nat)) =
-iDUB (iSUB True xa xb) &
-iSUB False (NUMERAL_BIT1 xa) (NUMERAL_BIT1 xb) =
-NUMERAL_BIT1 (iSUB False xa xb) &
-iSUB True (NUMERAL_BIT1 xa) (NUMERAL_BIT2 xb) =
-NUMERAL_BIT1 (iSUB False xa xb) &
-iSUB False (NUMERAL_BIT1 xa) (NUMERAL_BIT2 xb) = iDUB (iSUB False xa xb) &
-iSUB False (NUMERAL_BIT2 xa) ALT_ZERO = NUMERAL_BIT1 xa &
-iSUB True (NUMERAL_BIT2 xa) (NUMERAL_BIT1 xb) =
-NUMERAL_BIT1 (iSUB True xa xb) &
-iSUB False (NUMERAL_BIT2 xa) (NUMERAL_BIT1 xb) = iDUB (iSUB True xa xb) &
-iSUB True (NUMERAL_BIT2 xa) (NUMERAL_BIT2 xb) = iDUB (iSUB True xa xb) &
-iSUB False (NUMERAL_BIT2 xa) (NUMERAL_BIT2 xb) =
-NUMERAL_BIT1 (iSUB False xa xb)"
-  sorry
-
-lemma numeral_sub: "NUMERAL (x - xa) = (if xa < x then NUMERAL (iSUB True x xa) else 0)"
-  sorry
-
-lemma iDUB_removal: "iDUB (NUMERAL_BIT1 x) = NUMERAL_BIT2 (iDUB x) &
-iDUB (NUMERAL_BIT2 x) = NUMERAL_BIT2 (NUMERAL_BIT1 x) &
-iDUB ALT_ZERO = ALT_ZERO"
-  sorry
-
-lemma numeral_mult: "ALT_ZERO * x = ALT_ZERO &
-x * ALT_ZERO = ALT_ZERO &
-NUMERAL_BIT1 x * xa = iZ (iDUB (x * xa) + xa) &
-NUMERAL_BIT2 x * xa = iDUB (iZ (x * xa + xa))"
-  sorry
-
-definition
-  iSQR :: "nat => nat"  where
-  "iSQR == %x. x * x"
-
-lemma iSQR: "iSQR x = x * x"
-  sorry
-
-lemma numeral_exp: "(ALL x. x ^ ALT_ZERO = NUMERAL_BIT1 ALT_ZERO) &
-(ALL x xa. x ^ NUMERAL_BIT1 xa = x * iSQR (x ^ xa)) &
-(ALL x xa. x ^ NUMERAL_BIT2 xa = iSQR x * iSQR (x ^ xa))"
-  sorry
-
-lemma numeral_evenodd: "EVEN ALT_ZERO &
-EVEN (NUMERAL_BIT2 x) &
-~ EVEN (NUMERAL_BIT1 x) &
-~ ODD ALT_ZERO & ~ ODD (NUMERAL_BIT2 x) & ODD (NUMERAL_BIT1 x)"
-  sorry
-
-lemma numeral_fact: "FACT n = (if n = 0 then 1 else n * FACT (PRE n))"
-  sorry
-
-lemma numeral_funpow: "(f ^^ n) x = (if n = 0 then x else (f ^^ (n - 1)) (f x))"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" ind_type
-
-lemma INJ_INVERSE2: "(!!(x1::'A) (y1::'B) (x2::'A) y2::'B.
-    ((P::'A => 'B => 'C) x1 y1 = P x2 y2) = (x1 = x2 & y1 = y2))
-==> EX (x::'C => 'A) Y::'C => 'B.
-       ALL (xa::'A) y::'B. x (P xa y) = xa & Y (P xa y) = y"
-  sorry
-
-definition
-  NUMPAIR :: "nat => nat => nat"  where
-  "NUMPAIR == %x y. 2 ^ x * (2 * y + 1)"
-
-lemma NUMPAIR: "NUMPAIR x y = 2 ^ x * (2 * y + 1)"
-  sorry
-
-lemma NUMPAIR_INJ_LEMMA: "NUMPAIR x xa = NUMPAIR xb xc ==> x = xb"
-  sorry
-
-lemma NUMPAIR_INJ: "(NUMPAIR x1 y1 = NUMPAIR x2 y2) = (x1 = x2 & y1 = y2)"
-  sorry
-
-consts
-  NUMSND :: "nat => nat" 
-  NUMFST :: "nat => nat" 
-
-specification (NUMFST NUMSND) NUMPAIR_DEST: "ALL x y. NUMFST (NUMPAIR x y) = x & NUMSND (NUMPAIR x y) = y"
-  sorry
-
-definition
-  NUMSUM :: "bool => nat => nat"  where
-  "NUMSUM == %b x. if b then Suc (2 * x) else 2 * x"
-
-lemma NUMSUM: "NUMSUM b x = (if b then Suc (2 * x) else 2 * x)"
-  sorry
-
-lemma NUMSUM_INJ: "(NUMSUM b1 x1 = NUMSUM b2 x2) = (b1 = b2 & x1 = x2)"
-  sorry
-
-consts
-  NUMRIGHT :: "nat => nat" 
-  NUMLEFT :: "nat => bool" 
-
-specification (NUMLEFT NUMRIGHT) NUMSUM_DEST: "ALL x y. NUMLEFT (NUMSUM x y) = x & NUMRIGHT (NUMSUM x y) = y"
-  sorry
-
-definition
-  INJN :: "nat => nat => 'a => bool"  where
-  "INJN == %m n a. n = m"
-
-lemma INJN: "INJN m = (%n a. n = m)"
-  sorry
-
-lemma INJN_INJ: "(INJN n1 = INJN n2) = (n1 = n2)"
-  sorry
-
-definition
-  INJA :: "'a => nat => 'a => bool"  where
-  "INJA == %a n b. b = a"
-
-lemma INJA: "INJA a = (%n b. b = a)"
-  sorry
-
-lemma INJA_INJ: "(INJA a1 = INJA a2) = (a1 = a2)"
-  sorry
-
-definition
-  INJF :: "(nat => nat => 'a => bool) => nat => 'a => bool"  where
-  "INJF == %f n. f (NUMFST n) (NUMSND n)"
-
-lemma INJF: "INJF f = (%n. f (NUMFST n) (NUMSND n))"
-  sorry
-
-lemma INJF_INJ: "(INJF f1 = INJF f2) = (f1 = f2)"
-  sorry
-
-definition
-  INJP :: "(nat => 'a => bool) => (nat => 'a => bool) => nat => 'a => bool"  where
-  "INJP ==
-%f1 f2 n a. if NUMLEFT n then f1 (NUMRIGHT n) a else f2 (NUMRIGHT n) a"
-
-lemma INJP: "INJP f1 f2 =
-(%n a. if NUMLEFT n then f1 (NUMRIGHT n) a else f2 (NUMRIGHT n) a)"
-  sorry
-
-lemma INJP_INJ: "(INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
-  sorry
-
-definition
-  ZCONSTR :: "nat => 'a => (nat => nat => 'a => bool) => nat => 'a => bool"  where
-  "ZCONSTR == %c i r. INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
-
-lemma ZCONSTR: "ZCONSTR c i r = INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
-  sorry
-
-definition
-  ZBOT :: "nat => 'a => bool"  where
-  "ZBOT == INJP (INJN 0) (SOME z. True)"
-
-lemma ZBOT: "ZBOT = INJP (INJN 0) (SOME z. True)"
-  sorry
-
-lemma ZCONSTR_ZBOT: "ZCONSTR x xa xb ~= ZBOT"
-  sorry
-
-definition
-  ZRECSPACE :: "(nat => 'a => bool) => bool"  where
-  "ZRECSPACE ==
-%a0. ALL ZRECSPACE'.
-        (ALL a0.
-            a0 = ZBOT |
-            (EX c i r. a0 = ZCONSTR c i r & (ALL n. ZRECSPACE' (r n))) -->
-            ZRECSPACE' a0) -->
-        ZRECSPACE' a0"
-
-lemma ZRECSPACE: "ZRECSPACE =
-(%a0. ALL ZRECSPACE'.
-         (ALL a0.
-             a0 = ZBOT |
-             (EX c i r. a0 = ZCONSTR c i r & (ALL n. ZRECSPACE' (r n))) -->
-             ZRECSPACE' a0) -->
-         ZRECSPACE' a0)"
-  sorry
-
-lemma ZRECSPACE_rules: "(op &::bool => bool => bool)
- ((ZRECSPACE::(nat => 'a::type => bool) => bool)
-   (ZBOT::nat => 'a::type => bool))
- ((All::(nat => bool) => bool)
-   (%c::nat.
-       (All::('a::type => bool) => bool)
-        (%i::'a::type.
-            (All::((nat => nat => 'a::type => bool) => bool) => bool)
-             (%r::nat => nat => 'a::type => bool.
-                 (op -->::bool => bool => bool)
-                  ((All::(nat => bool) => bool)
-                    (%n::nat.
-                        (ZRECSPACE::(nat => 'a::type => bool) => bool)
-                         (r n)))
-                  ((ZRECSPACE::(nat => 'a::type => bool) => bool)
-                    ((ZCONSTR::nat
-                               => 'a::type
-                                  => (nat => nat => 'a::type => bool)
-                                     => nat => 'a::type => bool)
-                      c i r))))))"
-  sorry
-
-lemma ZRECSPACE_ind: "[| x ZBOT & (ALL c i r. (ALL n. x (r n)) --> x (ZCONSTR c i r));
-   ZRECSPACE a0 |]
-==> x a0"
-  sorry
-
-lemma ZRECSPACE_cases: "ZRECSPACE a0 =
-(a0 = ZBOT | (EX c i r. a0 = ZCONSTR c i r & (ALL n. ZRECSPACE (r n))))"
-  sorry
-
-typedef (open) ('a) recspace = "Collect ZRECSPACE :: (nat \<Rightarrow> 'a\<Colon>type \<Rightarrow> bool) set"
-  sorry
-
-lemmas recspace_TY_DEF = typedef_hol2hol4 [OF type_definition_recspace]
-
-consts
-  mk_rec :: "(nat => 'a => bool) => 'a recspace" 
-  dest_rec :: "'a recspace => nat => 'a => bool" 
-
-specification (dest_rec mk_rec) recspace_repfns: "(ALL a::'a recspace. mk_rec (dest_rec a) = a) &
-(ALL r::nat => 'a => bool. ZRECSPACE r = (dest_rec (mk_rec r) = r))"
-  sorry
-
-definition
-  BOTTOM :: "'a recspace"  where
-  "BOTTOM == mk_rec ZBOT"
-
-lemma BOTTOM: "BOTTOM = mk_rec ZBOT"
-  sorry
-
-definition
-  CONSTR :: "nat => 'a => (nat => 'a recspace) => 'a recspace"  where
-  "CONSTR == %c i r. mk_rec (ZCONSTR c i (%n. dest_rec (r n)))"
-
-lemma CONSTR: "CONSTR c i r = mk_rec (ZCONSTR c i (%n. dest_rec (r n)))"
-  sorry
-
-lemma MK_REC_INJ: "[| mk_rec x = mk_rec y; ZRECSPACE x & ZRECSPACE y |] ==> x = y"
-  sorry
-
-lemma DEST_REC_INJ: "(dest_rec x = dest_rec y) = (x = y)"
-  sorry
-
-lemma CONSTR_BOT: "CONSTR c i r ~= BOTTOM"
-  sorry
-
-lemma CONSTR_INJ: "(CONSTR c1 i1 r1 = CONSTR c2 i2 r2) = (c1 = c2 & i1 = i2 & r1 = r2)"
-  sorry
-
-lemma CONSTR_IND: "P BOTTOM & (ALL c i r. (ALL n. P (r n)) --> P (CONSTR c i r)) ==> P x"
-  sorry
-
-lemma CONSTR_REC: "EX f. ALL c i r. f (CONSTR c i r) = Fn c i r (%n. f (r n))"
-  sorry
-
-consts
-  FCONS :: "'a => (nat => 'a) => nat => 'a" 
-
-specification (FCONS) FCONS: "(ALL (a::'a) f::nat => 'a. FCONS a f (0::nat) = a) &
-(ALL (a::'a) (f::nat => 'a) n::nat. FCONS a f (Suc n) = f n)"
-  sorry
-
-definition
-  FNIL :: "nat => 'a"  where
-  "FNIL == %n. SOME x. True"
-
-lemma FNIL: "FNIL n = (SOME x. True)"
-  sorry
-
-definition
-  ISO :: "('a => 'b) => ('b => 'a) => bool"  where
-  "ISO == %f g. (ALL x. f (g x) = x) & (ALL y. g (f y) = y)"
-
-lemma ISO: "ISO f g = ((ALL x. f (g x) = x) & (ALL y. g (f y) = y))"
-  sorry
-
-lemma ISO_REFL: "ISO (%x. x) (%x. x)"
-  sorry
-
-lemma ISO_FUN: "ISO (f::'a => 'c) (f'::'c => 'a) & ISO (g::'b => 'd) (g'::'d => 'b)
-==> ISO (%(h::'a => 'b) a'::'c. g (h (f' a')))
-     (%(h::'c => 'd) a::'a. g' (h (f a)))"
-  sorry
-
-lemma ISO_USAGE: "ISO f g
-==> (ALL P. All P = (ALL x. P (g x))) &
-    (ALL P. Ex P = (EX x. P (g x))) & (ALL a b. (a = g b) = (f a = b))"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" divides
-
-lemma DIVIDES_FACT: "0 < b ==> b dvd FACT b"
-  sorry
-
-lemma DIVIDES_MULT_LEFT: "((x::nat) * (xa::nat) dvd xa) = (xa = (0::nat) | x = (1::nat))"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prime
-
-consts
-  prime :: "nat => bool" 
-
-defs
-  prime_primdef: "prime.prime == %a. a ~= 1 & (ALL b. b dvd a --> b = a | b = 1)"
-
-lemma prime_def: "prime.prime a = (a ~= 1 & (ALL b. b dvd a --> b = a | b = 1))"
-  sorry
-
-lemma NOT_PRIME_0: "~ prime.prime 0"
-  sorry
-
-lemma NOT_PRIME_1: "~ prime.prime 1"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" list
-
-consts
-  EL :: "nat => 'a list => 'a" 
-
-specification (EL) EL: "(ALL l::'a list. EL (0::nat) l = hd l) &
-(ALL (l::'a list) n::nat. EL (Suc n) l = EL n (tl l))"
-  sorry
-
-lemma NULL: "(op &::bool => bool => bool)
- ((List.null::'a::type list => bool) ([]::'a::type list))
- ((All::('a::type => bool) => bool)
-   (%x::'a::type.
-       (All::('a::type list => bool) => bool)
-        (%xa::'a::type list.
-            (Not::bool => bool)
-             ((List.null::'a::type list => bool)
-               ((op #::'a::type => 'a::type list => 'a::type list) x xa)))))"
-  sorry
-
-lemma list_case_compute: "list_case (b::'b) (f::'a => 'a list => 'b) (l::'a list) =
-(if List.null l then b else f (hd l) (tl l))"
-  sorry
-
-lemma LIST_NOT_EQ: "l1 ~= l2 ==> x # l1 ~= xa # l2"
-  sorry
-
-lemma NOT_EQ_LIST: "h1 ~= h2 ==> h1 # x ~= h2 # xa"
-  sorry
-
-lemma EQ_LIST: "[| h1 = h2; l1 = l2 |] ==> h1 # l1 = h2 # l2"
-  sorry
-
-lemma CONS: "~ List.null l ==> hd l # tl l = l"
-  sorry
-
-lemma MAP_EQ_NIL: "(map (f::'a => 'b) (l::'a list) = []) = (l = []) & ([] = map f l) = (l = [])"
-  sorry
-
-lemma EVERY_EL: "list_all P l = (ALL n<length l. P (EL n l))"
-  sorry
-
-lemma EVERY_CONJ: "list_all (%x. P x & Q x) l = (list_all P l & list_all Q l)"
-  sorry
-
-lemma EVERY_MEM: "list_all P l = (ALL e. List.member l e --> P e)"
-  sorry
-
-lemma EXISTS_MEM: "list_ex P l = (EX e. List.member l e & P e)"
-  sorry
-
-lemma MEM_APPEND: "List.member (l1 @ l2) e = (List.member l1 e | List.member l2 e)"
-  sorry
-
-lemma NOT_EVERY: "(~ list_all P l) = list_ex (Not o P) l"
-  sorry
-
-lemma NOT_EXISTS: "(~ list_ex P l) = list_all (Not o P) l"
-  sorry
-
-lemma MEM_MAP: "List.member (map (f::'a => 'b) (l::'a list)) (x::'b) =
-(EX y::'a. x = f y & List.member l y)"
-  sorry
-
-lemma LENGTH_CONS: "(length l = Suc n) = (EX h l'. length l' = n & l = h # l')"
-  sorry
-
-lemma LENGTH_EQ_CONS: "(ALL l. length l = Suc n --> P l) =
-(ALL l. length l = n --> (ALL x. P (x # l)))"
-  sorry
-
-lemma LENGTH_EQ_NIL: "(ALL l. length l = 0 --> P l) = P []"
-  sorry
-
-lemma CONS_ACYCLIC: "l ~= x # l & x # l ~= l"
-  sorry
-
-lemma APPEND_eq_NIL: "(ALL (l1::'a list) l2::'a list. ([] = l1 @ l2) = (l1 = [] & l2 = [])) &
-(ALL (l1::'a list) l2::'a list. (l1 @ l2 = []) = (l1 = [] & l2 = []))"
-  sorry
-
-lemma APPEND_11: "(ALL (l1::'a list) (l2::'a list) l3::'a list.
-    (l1 @ l2 = l1 @ l3) = (l2 = l3)) &
-(ALL (l1::'a list) (l2::'a list) l3::'a list.
-    (l2 @ l1 = l3 @ l1) = (l2 = l3))"
-  sorry
-
-lemma EL_compute: "EL n l = (if n = 0 then hd l else EL (PRE n) (tl l))"
-  sorry
-
-lemma WF_LIST_PRED: "WF (%L1 L2. EX h. L2 = h # L1)"
-  sorry
-
-lemma list_size_cong: "M = N & (ALL x. List.member N x --> f x = f' x)
-==> Compatibility.list_size f M = Compatibility.list_size f' N"
-  sorry
-
-lemma FOLDR_CONG: "l = l' & b = b' & (ALL x a. List.member l' x --> f x a = f' x a)
-==> foldr f l b = foldr f' l' b'"
-  sorry
-
-lemma FOLDL_CONG: "l = l' & b = b' & (ALL x a. List.member l' x --> f a x = f' a x)
-==> foldl f b l = foldl f' b' l'"
-  sorry
-
-lemma MAP_CONG: "l1 = l2 & (ALL x. List.member l2 x --> f x = f' x) ==> map f l1 = map f' l2"
-  sorry
-
-lemma EXISTS_CONG: "l1 = l2 & (ALL x. List.member l2 x --> P x = P' x)
-==> list_ex P l1 = list_ex P' l2"
-  sorry
-
-lemma EVERY_CONG: "l1 = l2 & (ALL x. List.member l2 x --> P x = P' x)
-==> list_all P l1 = list_all P' l2"
-  sorry
-
-lemma EVERY_MONOTONIC: "[| !!x. P x ==> Q x; list_all P l |] ==> list_all Q l"
-  sorry
-
-lemma LENGTH_ZIP: "length l1 = length l2
-==> length (zip l1 l2) = length l1 & length (zip l1 l2) = length l2"
-  sorry
-
-lemma LENGTH_UNZIP: "length (fst (unzip pl)) = length pl & length (snd (unzip pl)) = length pl"
-  sorry
-
-lemma ZIP_UNZIP: "ZIP (unzip l) = l"
-  sorry
-
-lemma UNZIP_ZIP: "length l1 = length l2 ==> unzip (zip l1 l2) = (l1, l2)"
-  sorry
-
-lemma ZIP_MAP: "length l1 = length l2
-==> zip (map f1 l1) l2 = map (%p. (f1 (fst p), snd p)) (zip l1 l2) &
-    zip l1 (map f2 l2) = map (%p. (fst p, f2 (snd p))) (zip l1 l2)"
-  sorry
-
-lemma MEM_ZIP: "length l1 = length l2
-==> List.member (zip l1 l2) p = (EX n<length l1. p = (EL n l1, EL n l2))"
-  sorry
-
-lemma EL_ZIP: "length l1 = length l2 & n < length l1
-==> EL n (zip l1 l2) = (EL n l1, EL n l2)"
-  sorry
-
-lemma MAP2_ZIP: "length l1 = length l2 ==> map2 f l1 l2 = map (%(x, y). f x y) (zip l1 l2)"
-  sorry
-
-lemma MEM_EL: "List.member l x = (EX n<length l. x = EL n l)"
-  sorry
-
-lemma LAST_CONS: "(ALL x::'a. last [x] = x) &
-(ALL (x::'a) (xa::'a) xb::'a list. last (x # xa # xb) = last (xa # xb))"
-  sorry
-
-lemma FRONT_CONS: "(ALL x::'a. butlast [x] = []) &
-(ALL (x::'a) (xa::'a) xb::'a list.
-    butlast (x # xa # xb) = x # butlast (xa # xb))"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" pred_set
-
-lemma EXTENSION: "(s = t) = (ALL x. IN x s = IN x t)"
-  sorry
-
-lemma NOT_EQUAL_SETS: "(x ~= xa) = (EX xb. IN xb xa = (~ IN xb x))"
-  sorry
-
-lemma NUM_SET_WOP: "(EX n::nat. IN n (s::nat => bool)) =
-(EX n::nat. IN n s & (ALL m::nat. IN m s --> n <= m))"
-  sorry
-
-consts
-  GSPEC :: "('b => 'a * bool) => 'a => bool" 
-
-specification (GSPEC) GSPECIFICATION: "ALL (f::'b => 'a * bool) v::'a. IN v (GSPEC f) = (EX x::'b. (v, True) = f x)"
-  sorry
-
-lemma SET_MINIMUM: "(EX x::'a. IN x (s::'a => bool)) =
-(EX x::'a. IN x s & (ALL y::'a. IN y s --> (M::'a => nat) x <= M y))"
-  sorry
-
-definition
-  EMPTY :: "'a => bool"  where
-  "EMPTY == %x. False"
-
-lemma EMPTY_DEF: "EMPTY = (%x. False)"
-  sorry
-
-lemma NOT_IN_EMPTY: "~ IN x EMPTY"
-  sorry
-
-lemma MEMBER_NOT_EMPTY: "(EX xa. IN xa x) = (x ~= EMPTY)"
-  sorry
-
-definition
-  UNIV :: "'a => bool"  where
-  "UNIV == %x. True"
-
-lemma UNIV_DEF: "pred_set.UNIV = (%x. True)"
-  sorry
-
-lemma IN_UNIV: "IN x pred_set.UNIV"
-  sorry
-
-lemma UNIV_NOT_EMPTY: "pred_set.UNIV ~= EMPTY"
-  sorry
-
-lemma EMPTY_NOT_UNIV: "EMPTY ~= pred_set.UNIV"
-  sorry
-
-lemma EQ_UNIV: "(ALL x. IN x s) = (s = pred_set.UNIV)"
-  sorry
-
-definition
-  SUBSET :: "('a => bool) => ('a => bool) => bool"  where
-  "SUBSET == %s t. ALL x. IN x s --> IN x t"
-
-lemma SUBSET_DEF: "SUBSET s t = (ALL x. IN x s --> IN x t)"
-  sorry
-
-lemma SUBSET_TRANS: "SUBSET x xa & SUBSET xa xb ==> SUBSET x xb"
-  sorry
-
-lemma SUBSET_REFL: "SUBSET x x"
-  sorry
-
-lemma SUBSET_ANTISYM: "SUBSET x xa & SUBSET xa x ==> x = xa"
-  sorry
-
-lemma EMPTY_SUBSET: "SUBSET EMPTY x"
-  sorry
-
-lemma SUBSET_EMPTY: "SUBSET x EMPTY = (x = EMPTY)"
-  sorry
-
-lemma SUBSET_UNIV: "SUBSET x pred_set.UNIV"
-  sorry
-
-lemma UNIV_SUBSET: "SUBSET pred_set.UNIV x = (x = pred_set.UNIV)"
-  sorry
-
-definition
-  PSUBSET :: "('a => bool) => ('a => bool) => bool"  where
-  "PSUBSET == %s t. SUBSET s t & s ~= t"
-
-lemma PSUBSET_DEF: "PSUBSET s t = (SUBSET s t & s ~= t)"
-  sorry
-
-lemma PSUBSET_TRANS: "PSUBSET x xa & PSUBSET xa xb ==> PSUBSET x xb"
-  sorry
-
-lemma PSUBSET_IRREFL: "~ PSUBSET x x"
-  sorry
-
-lemma NOT_PSUBSET_EMPTY: "~ PSUBSET x EMPTY"
-  sorry
-
-lemma NOT_UNIV_PSUBSET: "~ PSUBSET pred_set.UNIV x"
-  sorry
-
-lemma PSUBSET_UNIV: "PSUBSET x pred_set.UNIV = (EX xa. ~ IN xa x)"
-  sorry
-
-definition
-  UNION :: "('a => bool) => ('a => bool) => 'a => bool"  where
-  "UNION == %s t. GSPEC (%x. (x, IN x s | IN x t))"
-
-lemma UNION_DEF: "pred_set.UNION s t = GSPEC (%x. (x, IN x s | IN x t))"
-  sorry
-
-lemma IN_UNION: "IN xb (pred_set.UNION x xa) = (IN xb x | IN xb xa)"
-  sorry
-
-lemma UNION_ASSOC: "pred_set.UNION x (pred_set.UNION xa xb) =
-pred_set.UNION (pred_set.UNION x xa) xb"
-  sorry
-
-lemma UNION_IDEMPOT: "pred_set.UNION x x = x"
-  sorry
-
-lemma UNION_COMM: "pred_set.UNION x xa = pred_set.UNION xa x"
-  sorry
-
-lemma SUBSET_UNION: "(ALL (x::'a => bool) xa::'a => bool. SUBSET x (pred_set.UNION x xa)) &
-(ALL (x::'a => bool) xa::'a => bool. SUBSET x (pred_set.UNION xa x))"
-  sorry
-
-lemma UNION_SUBSET: "SUBSET (pred_set.UNION s t) u = (SUBSET s u & SUBSET t u)"
-  sorry
-
-lemma SUBSET_UNION_ABSORPTION: "SUBSET x xa = (pred_set.UNION x xa = xa)"
-  sorry
-
-lemma UNION_EMPTY: "(ALL x::'a => bool. pred_set.UNION EMPTY x = x) &
-(ALL x::'a => bool. pred_set.UNION x EMPTY = x)"
-  sorry
-
-lemma UNION_UNIV: "(ALL x::'a => bool. pred_set.UNION pred_set.UNIV x = pred_set.UNIV) &
-(ALL x::'a => bool. pred_set.UNION x pred_set.UNIV = pred_set.UNIV)"
-  sorry
-
-lemma EMPTY_UNION: "(pred_set.UNION x xa = EMPTY) = (x = EMPTY & xa = EMPTY)"
-  sorry
-
-definition
-  INTER :: "('a => bool) => ('a => bool) => 'a => bool"  where
-  "INTER == %s t. GSPEC (%x. (x, IN x s & IN x t))"
-
-lemma INTER_DEF: "pred_set.INTER s t = GSPEC (%x. (x, IN x s & IN x t))"
-  sorry
-
-lemma IN_INTER: "IN xb (pred_set.INTER x xa) = (IN xb x & IN xb xa)"
-  sorry
-
-lemma INTER_ASSOC: "pred_set.INTER x (pred_set.INTER xa xb) =
-pred_set.INTER (pred_set.INTER x xa) xb"
-  sorry
-
-lemma INTER_IDEMPOT: "pred_set.INTER x x = x"
-  sorry
-
-lemma INTER_COMM: "pred_set.INTER x xa = pred_set.INTER xa x"
-  sorry
-
-lemma INTER_SUBSET: "(ALL (x::'a => bool) xa::'a => bool. SUBSET (pred_set.INTER x xa) x) &
-(ALL (x::'a => bool) xa::'a => bool. SUBSET (pred_set.INTER xa x) x)"
-  sorry
-
-lemma SUBSET_INTER: "SUBSET s (pred_set.INTER t u) = (SUBSET s t & SUBSET s u)"
-  sorry
-
-lemma SUBSET_INTER_ABSORPTION: "SUBSET x xa = (pred_set.INTER x xa = x)"
-  sorry
-
-lemma INTER_EMPTY: "(ALL x::'a => bool. pred_set.INTER EMPTY x = EMPTY) &
-(ALL x::'a => bool. pred_set.INTER x EMPTY = EMPTY)"
-  sorry
-
-lemma INTER_UNIV: "(ALL x::'a => bool. pred_set.INTER pred_set.UNIV x = x) &
-(ALL x::'a => bool. pred_set.INTER x pred_set.UNIV = x)"
-  sorry
-
-lemma UNION_OVER_INTER: "pred_set.INTER x (pred_set.UNION xa xb) =
-pred_set.UNION (pred_set.INTER x xa) (pred_set.INTER x xb)"
-  sorry
-
-lemma INTER_OVER_UNION: "pred_set.UNION x (pred_set.INTER xa xb) =
-pred_set.INTER (pred_set.UNION x xa) (pred_set.UNION x xb)"
-  sorry
-
-definition
-  DISJOINT :: "('a => bool) => ('a => bool) => bool"  where
-  "DISJOINT == %s t. pred_set.INTER s t = EMPTY"
-
-lemma DISJOINT_DEF: "DISJOINT s t = (pred_set.INTER s t = EMPTY)"
-  sorry
-
-lemma IN_DISJOINT: "DISJOINT x xa = (~ (EX xb. IN xb x & IN xb xa))"
-  sorry
-
-lemma DISJOINT_SYM: "DISJOINT x xa = DISJOINT xa x"
-  sorry
-
-lemma DISJOINT_EMPTY: "DISJOINT EMPTY x & DISJOINT x EMPTY"
-  sorry
-
-lemma DISJOINT_EMPTY_REFL: "(x = EMPTY) = DISJOINT x x"
-  sorry
-
-lemma DISJOINT_UNION: "DISJOINT (pred_set.UNION x xa) xb = (DISJOINT x xb & DISJOINT xa xb)"
-  sorry
-
-lemma DISJOINT_UNION_BOTH: "DISJOINT (pred_set.UNION s t) u = (DISJOINT s u & DISJOINT t u) &
-DISJOINT u (pred_set.UNION s t) = (DISJOINT s u & DISJOINT t u)"
-  sorry
-
-definition
-  DIFF :: "('a => bool) => ('a => bool) => 'a => bool"  where
-  "DIFF == %s t. GSPEC (%x. (x, IN x s & ~ IN x t))"
-
-lemma DIFF_DEF: "DIFF s t = GSPEC (%x. (x, IN x s & ~ IN x t))"
-  sorry
-
-lemma IN_DIFF: "IN x (DIFF s t) = (IN x s & ~ IN x t)"
-  sorry
-
-lemma DIFF_EMPTY: "DIFF s EMPTY = s"
-  sorry
-
-lemma EMPTY_DIFF: "DIFF EMPTY s = EMPTY"
-  sorry
-
-lemma DIFF_UNIV: "DIFF s pred_set.UNIV = EMPTY"
-  sorry
-
-lemma DIFF_DIFF: "DIFF (DIFF x xa) xa = DIFF x xa"
-  sorry
-
-lemma DIFF_EQ_EMPTY: "DIFF x x = EMPTY"
-  sorry
-
-definition
-  INSERT :: "'a => ('a => bool) => 'a => bool"  where
-  "INSERT == %x s. GSPEC (%y. (y, y = x | IN y s))"
-
-lemma INSERT_DEF: "INSERT x s = GSPEC (%y. (y, y = x | IN y s))"
-  sorry
-
-lemma IN_INSERT: "IN x (INSERT xa xb) = (x = xa | IN x xb)"
-  sorry
-
-lemma COMPONENT: "IN x (INSERT x xa)"
-  sorry
-
-lemma SET_CASES: "x = EMPTY | (EX xa xb. x = INSERT xa xb & ~ IN xa xb)"
-  sorry
-
-lemma DECOMPOSITION: "IN x s = (EX t. s = INSERT x t & ~ IN x t)"
-  sorry
-
-lemma ABSORPTION: "IN x xa = (INSERT x xa = xa)"
-  sorry
-
-lemma INSERT_INSERT: "INSERT x (INSERT x xa) = INSERT x xa"
-  sorry
-
-lemma INSERT_COMM: "INSERT x (INSERT xa xb) = INSERT xa (INSERT x xb)"
-  sorry
-
-lemma INSERT_UNIV: "INSERT x pred_set.UNIV = pred_set.UNIV"
-  sorry
-
-lemma NOT_INSERT_EMPTY: "INSERT x xa ~= EMPTY"
-  sorry
-
-lemma NOT_EMPTY_INSERT: "EMPTY ~= INSERT x xa"
-  sorry
-
-lemma INSERT_UNION: "pred_set.UNION (INSERT x s) t =
-(if IN x t then pred_set.UNION s t else INSERT x (pred_set.UNION s t))"
-  sorry
-
-lemma INSERT_UNION_EQ: "pred_set.UNION (INSERT x s) t = INSERT x (pred_set.UNION s t)"
-  sorry
-
-lemma INSERT_INTER: "pred_set.INTER (INSERT x s) t =
-(if IN x t then INSERT x (pred_set.INTER s t) else pred_set.INTER s t)"
-  sorry
-
-lemma DISJOINT_INSERT: "DISJOINT (INSERT x xa) xb = (DISJOINT xa xb & ~ IN x xb)"
-  sorry
-
-lemma INSERT_SUBSET: "SUBSET (INSERT x xa) xb = (IN x xb & SUBSET xa xb)"
-  sorry
-
-lemma SUBSET_INSERT: "~ IN x xa ==> SUBSET xa (INSERT x xb) = SUBSET xa xb"
-  sorry
-
-lemma INSERT_DIFF: "DIFF (INSERT x s) t = (if IN x t then DIFF s t else INSERT x (DIFF s t))"
-  sorry
-
-definition
-  DELETE :: "('a => bool) => 'a => 'a => bool"  where
-  "DELETE == %s x. DIFF s (INSERT x EMPTY)"
-
-lemma DELETE_DEF: "DELETE s x = DIFF s (INSERT x EMPTY)"
-  sorry
-
-lemma IN_DELETE: "IN xa (DELETE x xb) = (IN xa x & xa ~= xb)"
-  sorry
-
-lemma DELETE_NON_ELEMENT: "(~ IN x xa) = (DELETE xa x = xa)"
-  sorry
-
-lemma IN_DELETE_EQ: "(IN x s = IN x' s) = (IN x (DELETE s x') = IN x' (DELETE s x))"
-  sorry
-
-lemma EMPTY_DELETE: "DELETE EMPTY x = EMPTY"
-  sorry
-
-lemma DELETE_DELETE: "DELETE (DELETE xa x) x = DELETE xa x"
-  sorry
-
-lemma DELETE_COMM: "DELETE (DELETE xb x) xa = DELETE (DELETE xb xa) x"
-  sorry
-
-lemma DELETE_SUBSET: "SUBSET (DELETE xa x) xa"
-  sorry
-
-lemma SUBSET_DELETE: "SUBSET xa (DELETE xb x) = (~ IN x xa & SUBSET xa xb)"
-  sorry
-
-lemma SUBSET_INSERT_DELETE: "SUBSET s (INSERT x t) = SUBSET (DELETE s x) t"
-  sorry
-
-lemma DIFF_INSERT: "DIFF x (INSERT xb xa) = DIFF (DELETE x xb) xa"
-  sorry
-
-lemma PSUBSET_INSERT_SUBSET: "PSUBSET x xa = (EX xb. ~ IN xb x & SUBSET (INSERT xb x) xa)"
-  sorry
-
-lemma PSUBSET_MEMBER: "PSUBSET s t = (SUBSET s t & (EX y. IN y t & ~ IN y s))"
-  sorry
-
-lemma DELETE_INSERT: "DELETE (INSERT x xb) xa =
-(if x = xa then DELETE xb xa else INSERT x (DELETE xb xa))"
-  sorry
-
-lemma INSERT_DELETE: "IN x xa ==> INSERT x (DELETE xa x) = xa"
-  sorry
-
-lemma DELETE_INTER: "pred_set.INTER (DELETE x xb) xa = DELETE (pred_set.INTER x xa) xb"
-  sorry
-
-lemma DISJOINT_DELETE_SYM: "DISJOINT (DELETE x xb) xa = DISJOINT (DELETE xa xb) x"
-  sorry
-
-consts
-  CHOICE :: "('a => bool) => 'a" 
-
-specification (CHOICE) CHOICE_DEF: "ALL x. x ~= EMPTY --> IN (CHOICE x) x"
-  sorry
-
-definition
-  REST :: "('a => bool) => 'a => bool"  where
-  "REST == %s. DELETE s (CHOICE s)"
-
-lemma REST_DEF: "REST s = DELETE s (CHOICE s)"
-  sorry
-
-lemma CHOICE_NOT_IN_REST: "~ IN (CHOICE x) (REST x)"
-  sorry
-
-lemma CHOICE_INSERT_REST: "s ~= EMPTY ==> INSERT (CHOICE s) (REST s) = s"
-  sorry
-
-lemma REST_SUBSET: "SUBSET (REST x) x"
-  sorry
-
-lemma REST_PSUBSET: "x ~= EMPTY ==> PSUBSET (REST x) x"
-  sorry
-
-definition
-  SING :: "('a => bool) => bool"  where
-  "SING == %s. EX x. s = INSERT x EMPTY"
-
-lemma SING_DEF: "SING s = (EX x. s = INSERT x EMPTY)"
-  sorry
-
-lemma SING: "SING (INSERT x EMPTY)"
-  sorry
-
-lemma IN_SING: "IN x (INSERT xa EMPTY) = (x = xa)"
-  sorry
-
-lemma NOT_SING_EMPTY: "INSERT x EMPTY ~= EMPTY"
-  sorry
-
-lemma NOT_EMPTY_SING: "EMPTY ~= INSERT x EMPTY"
-  sorry
-
-lemma EQUAL_SING: "(INSERT x EMPTY = INSERT xa EMPTY) = (x = xa)"
-  sorry
-
-lemma DISJOINT_SING_EMPTY: "DISJOINT (INSERT x EMPTY) EMPTY"
-  sorry
-
-lemma INSERT_SING_UNION: "INSERT xa x = pred_set.UNION (INSERT xa EMPTY) x"
-  sorry
-
-lemma SING_DELETE: "DELETE (INSERT x EMPTY) x = EMPTY"
-  sorry
-
-lemma DELETE_EQ_SING: "IN xa x ==> (DELETE x xa = EMPTY) = (x = INSERT xa EMPTY)"
-  sorry
-
-lemma CHOICE_SING: "CHOICE (INSERT x EMPTY) = x"
-  sorry
-
-lemma REST_SING: "REST (INSERT x EMPTY) = EMPTY"
-  sorry
-
-lemma SING_IFF_EMPTY_REST: "SING x = (x ~= EMPTY & REST x = EMPTY)"
-  sorry
-
-definition
-  IMAGE :: "('a => 'b) => ('a => bool) => 'b => bool"  where
-  "IMAGE == %f s. GSPEC (%x. (f x, IN x s))"
-
-lemma IMAGE_DEF: "IMAGE (f::'a => 'b) (s::'a => bool) = GSPEC (%x::'a. (f x, IN x s))"
-  sorry
-
-lemma IN_IMAGE: "IN (x::'b) (IMAGE (xb::'a => 'b) (xa::'a => bool)) =
-(EX xc::'a. x = xb xc & IN xc xa)"
-  sorry
-
-lemma IMAGE_IN: "IN x xa ==> IN (xb x) (IMAGE xb xa)"
-  sorry
-
-lemma IMAGE_EMPTY: "IMAGE (x::'a => 'b) EMPTY = EMPTY"
-  sorry
-
-lemma IMAGE_ID: "IMAGE (%x. x) x = x"
-  sorry
-
-lemma IMAGE_COMPOSE: "IMAGE ((x::'b => 'c) o (xa::'a => 'b)) (xb::'a => bool) =
-IMAGE x (IMAGE xa xb)"
-  sorry
-
-lemma IMAGE_INSERT: "IMAGE (x::'a => 'b) (INSERT (xa::'a) (xb::'a => bool)) =
-INSERT (x xa) (IMAGE x xb)"
-  sorry
-
-lemma IMAGE_EQ_EMPTY: "(IMAGE (x::'a => 'b) (s::'a => bool) = EMPTY) = (s = EMPTY)"
-  sorry
-
-lemma IMAGE_DELETE: "~ IN x s ==> IMAGE f (DELETE s x) = IMAGE f s"
-  sorry
-
-lemma IMAGE_UNION: "IMAGE (x::'a => 'b) (pred_set.UNION (xa::'a => bool) (xb::'a => bool)) =
-pred_set.UNION (IMAGE x xa) (IMAGE x xb)"
-  sorry
-
-lemma IMAGE_SUBSET: "SUBSET x xa ==> SUBSET (IMAGE xb x) (IMAGE xb xa)"
-  sorry
-
-lemma IMAGE_INTER: "SUBSET
- (IMAGE (f::'a => 'b) (pred_set.INTER (s::'a => bool) (t::'a => bool)))
- (pred_set.INTER (IMAGE f s) (IMAGE f t))"
-  sorry
-
-definition
-  INJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool"  where
-  "INJ ==
-%f s t.
-   (ALL x. IN x s --> IN (f x) t) &
-   (ALL x y. IN x s & IN y s --> f x = f y --> x = y)"
-
-lemma INJ_DEF: "INJ f s t =
-((ALL x. IN x s --> IN (f x) t) &
- (ALL x y. IN x s & IN y s --> f x = f y --> x = y))"
-  sorry
-
-lemma INJ_ID: "INJ (%x. x) x x"
-  sorry
-
-lemma INJ_COMPOSE: "INJ x xb xc & INJ xa xc xd ==> INJ (xa o x) xb xd"
-  sorry
-
-lemma INJ_EMPTY: "All (INJ (x::'a => 'b) EMPTY) &
-(ALL xa::'a => bool. INJ x xa EMPTY = (xa = EMPTY))"
-  sorry
-
-definition
-  SURJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool"  where
-  "SURJ ==
-%f s t.
-   (ALL x. IN x s --> IN (f x) t) &
-   (ALL x. IN x t --> (EX y. IN y s & f y = x))"
-
-lemma SURJ_DEF: "SURJ f s t =
-((ALL x. IN x s --> IN (f x) t) &
- (ALL x. IN x t --> (EX y. IN y s & f y = x)))"
-  sorry
-
-lemma SURJ_ID: "SURJ (%x. x) x x"
-  sorry
-
-lemma SURJ_COMPOSE: "SURJ x xb xc & SURJ xa xc xd ==> SURJ (xa o x) xb xd"
-  sorry
-
-lemma SURJ_EMPTY: "(ALL xa::'b => bool. SURJ (x::'a => 'b) EMPTY xa = (xa = EMPTY)) &
-(ALL xa::'a => bool. SURJ x xa EMPTY = (xa = EMPTY))"
-  sorry
-
-lemma IMAGE_SURJ: "SURJ x xa xb = (IMAGE x xa = xb)"
-  sorry
-
-definition
-  BIJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool"  where
-  "BIJ == %f s t. INJ f s t & SURJ f s t"
-
-lemma BIJ_DEF: "BIJ f s t = (INJ f s t & SURJ f s t)"
-  sorry
-
-lemma BIJ_ID: "BIJ (%x. x) x x"
-  sorry
-
-lemma BIJ_EMPTY: "(ALL xa::'b => bool. BIJ (x::'a => 'b) EMPTY xa = (xa = EMPTY)) &
-(ALL xa::'a => bool. BIJ x xa EMPTY = (xa = EMPTY))"
-  sorry
-
-lemma BIJ_COMPOSE: "BIJ x xb xc & BIJ xa xc xd ==> BIJ (xa o x) xb xd"
-  sorry
-
-consts
-  LINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
-
-specification (LINV) LINV_DEF: "ALL f s t. INJ f s t --> (ALL x. IN x s --> LINV f s (f x) = x)"
-  sorry
-
-consts
-  RINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
-
-specification (RINV) RINV_DEF: "ALL f s t. SURJ f s t --> (ALL x. IN x t --> f (RINV f s x) = x)"
-  sorry
-
-definition
-  FINITE :: "('a => bool) => bool"  where
-  "FINITE ==
-%s. ALL P. P EMPTY & (ALL s. P s --> (ALL e. P (INSERT e s))) --> P s"
-
-lemma FINITE_DEF: "FINITE s =
-(ALL P. P EMPTY & (ALL s. P s --> (ALL e. P (INSERT e s))) --> P s)"
-  sorry
-
-lemma FINITE_EMPTY: "FINITE EMPTY"
-  sorry
-
-lemma FINITE_INDUCT: "[| P EMPTY &
-   (ALL s. FINITE s & P s --> (ALL e. ~ IN e s --> P (INSERT e s)));
-   FINITE s |]
-==> P s"
-  sorry
-
-lemma FINITE_INSERT: "FINITE (INSERT x s) = FINITE s"
-  sorry
-
-lemma FINITE_DELETE: "FINITE (DELETE s x) = FINITE s"
-  sorry
-
-lemma FINITE_UNION: "FINITE (pred_set.UNION s t) = (FINITE s & FINITE t)"
-  sorry
-
-lemma INTER_FINITE: "FINITE s ==> FINITE (pred_set.INTER s t)"
-  sorry
-
-lemma SUBSET_FINITE: "[| FINITE s; SUBSET t s |] ==> FINITE t"
-  sorry
-
-lemma PSUBSET_FINITE: "[| FINITE x; PSUBSET xa x |] ==> FINITE xa"
-  sorry
-
-lemma FINITE_DIFF: "FINITE s ==> FINITE (DIFF s t)"
-  sorry
-
-lemma FINITE_SING: "FINITE (INSERT x EMPTY)"
-  sorry
-
-lemma SING_FINITE: "SING x ==> FINITE x"
-  sorry
-
-lemma IMAGE_FINITE: "FINITE s ==> FINITE (IMAGE f s)"
-  sorry
-
-consts
-  CARD :: "('a => bool) => nat" 
-
-specification (CARD) CARD_DEF: "(op &::bool => bool => bool)
- ((op =::nat => nat => bool)
-   ((CARD::('a::type => bool) => nat) (EMPTY::'a::type => bool)) (0::nat))
- ((All::(('a::type => bool) => bool) => bool)
-   (%s::'a::type => bool.
-       (op -->::bool => bool => bool)
-        ((FINITE::('a::type => bool) => bool) s)
-        ((All::('a::type => bool) => bool)
-          (%x::'a::type.
-              (op =::nat => nat => bool)
-               ((CARD::('a::type => bool) => nat)
-                 ((INSERT::'a::type
-                           => ('a::type => bool) => 'a::type => bool)
-                   x s))
-               ((If::bool => nat => nat => nat)
-                 ((IN::'a::type => ('a::type => bool) => bool) x s)
-                 ((CARD::('a::type => bool) => nat) s)
-                 ((Suc::nat => nat)
-                   ((CARD::('a::type => bool) => nat) s)))))))"
-  sorry
-
-lemma CARD_EMPTY: "CARD EMPTY = 0"
-  sorry
-
-lemma CARD_INSERT: "FINITE s ==> CARD (INSERT x s) = (if IN x s then CARD s else Suc (CARD s))"
-  sorry
-
-lemma CARD_EQ_0: "FINITE s ==> (CARD s = 0) = (s = EMPTY)"
-  sorry
-
-lemma CARD_DELETE: "FINITE s ==> CARD (DELETE s x) = (if IN x s then CARD s - 1 else CARD s)"
-  sorry
-
-lemma CARD_INTER_LESS_EQ: "FINITE s ==> CARD (pred_set.INTER s t) <= CARD s"
-  sorry
-
-lemma CARD_UNION: "[| FINITE s; FINITE t |]
-==> CARD (pred_set.UNION s t) + CARD (pred_set.INTER s t) = CARD s + CARD t"
-  sorry
-
-lemma CARD_SUBSET: "[| FINITE s; SUBSET t s |] ==> CARD t <= CARD s"
-  sorry
-
-lemma CARD_PSUBSET: "[| FINITE s; PSUBSET t s |] ==> CARD t < CARD s"
-  sorry
-
-lemma CARD_SING: "CARD (INSERT x EMPTY) = 1"
-  sorry
-
-lemma SING_IFF_CARD1: "SING x = (CARD x = 1 & FINITE x)"
-  sorry
-
-lemma CARD_DIFF: "[| FINITE t; FINITE s |]
-==> CARD (DIFF s t) = CARD s - CARD (pred_set.INTER s t)"
-  sorry
-
-lemma LESS_CARD_DIFF: "[| FINITE t; FINITE s; CARD t < CARD s |] ==> 0 < CARD (DIFF s t)"
-  sorry
-
-lemma FINITE_COMPLETE_INDUCTION: "[| !!x. [| !!y. PSUBSET y x ==> P y; FINITE x |] ==> P x; FINITE x |]
-==> P x"
-  sorry
-
-definition
-  INFINITE :: "('a => bool) => bool"  where
-  "INFINITE == %s. ~ FINITE s"
-
-lemma INFINITE_DEF: "INFINITE s = (~ FINITE s)"
-  sorry
-
-lemma NOT_IN_FINITE: "(op =::bool => bool => bool)
- ((INFINITE::('a::type => bool) => bool) (pred_set.UNIV::'a::type => bool))
- ((All::(('a::type => bool) => bool) => bool)
-   (%s::'a::type => bool.
-       (op -->::bool => bool => bool)
-        ((FINITE::('a::type => bool) => bool) s)
-        ((Ex::('a::type => bool) => bool)
-          (%x::'a::type.
-              (Not::bool => bool)
-               ((IN::'a::type => ('a::type => bool) => bool) x s)))))"
-  sorry
-
-lemma INFINITE_INHAB: "INFINITE x ==> EX xa. IN xa x"
-  sorry
-
-lemma IMAGE_11_INFINITE: "[| !!x y. f x = f y ==> x = y; INFINITE s |] ==> INFINITE (IMAGE f s)"
-  sorry
-
-lemma INFINITE_SUBSET: "[| INFINITE x; SUBSET x xa |] ==> INFINITE xa"
-  sorry
-
-lemma IN_INFINITE_NOT_FINITE: "INFINITE x & FINITE xa ==> EX xb. IN xb x & ~ IN xb xa"
-  sorry
-
-lemma INFINITE_UNIV: "(op =::bool => bool => bool)
- ((INFINITE::('a::type => bool) => bool) (pred_set.UNIV::'a::type => bool))
- ((Ex::(('a::type => 'a::type) => bool) => bool)
-   (%f::'a::type => 'a::type.
-       (op &::bool => bool => bool)
-        ((All::('a::type => bool) => bool)
-          (%x::'a::type.
-              (All::('a::type => bool) => bool)
-               (%y::'a::type.
-                   (op -->::bool => bool => bool)
-                    ((op =::'a::type => 'a::type => bool) (f x) (f y))
-                    ((op =::'a::type => 'a::type => bool) x y))))
-        ((Ex::('a::type => bool) => bool)
-          (%y::'a::type.
-              (All::('a::type => bool) => bool)
-               (%x::'a::type.
-                   (op ~=::'a::type => 'a::type => bool) (f x) y)))))"
-  sorry
-
-lemma FINITE_PSUBSET_INFINITE: "INFINITE x = (ALL xa. FINITE xa --> SUBSET xa x --> PSUBSET xa x)"
-  sorry
-
-lemma FINITE_PSUBSET_UNIV: "(op =::bool => bool => bool)
- ((INFINITE::('a::type => bool) => bool) (pred_set.UNIV::'a::type => bool))
- ((All::(('a::type => bool) => bool) => bool)
-   (%s::'a::type => bool.
-       (op -->::bool => bool => bool)
-        ((FINITE::('a::type => bool) => bool) s)
-        ((PSUBSET::('a::type => bool) => ('a::type => bool) => bool) s
-          (pred_set.UNIV::'a::type => bool))))"
-  sorry
-
-lemma INFINITE_DIFF_FINITE: "INFINITE s & FINITE t ==> DIFF s t ~= EMPTY"
-  sorry
-
-lemma FINITE_ISO_NUM: "FINITE s
-==> EX f. (ALL n m. n < CARD s & m < CARD s --> f n = f m --> n = m) &
-          s = GSPEC (%n. (f n, n < CARD s))"
-  sorry
-
-lemma FINITE_WEAK_ENUMERATE: "FINITE (x::'a => bool) =
-(EX (f::nat => 'a) b::nat. ALL e::'a. IN e x = (EX n<b. e = f n))"
-  sorry
-
-definition
-  BIGUNION :: "(('a => bool) => bool) => 'a => bool"  where
-  "BIGUNION == %P. GSPEC (%x. (x, EX p. IN p P & IN x p))"
-
-lemma BIGUNION: "BIGUNION P = GSPEC (%x. (x, EX p. IN p P & IN x p))"
-  sorry
-
-lemma IN_BIGUNION: "IN x (BIGUNION xa) = (EX s. IN x s & IN s xa)"
-  sorry
-
-lemma BIGUNION_EMPTY: "BIGUNION EMPTY = EMPTY"
-  sorry
-
-lemma BIGUNION_SING: "BIGUNION (INSERT x EMPTY) = x"
-  sorry
-
-lemma BIGUNION_UNION: "BIGUNION (pred_set.UNION x xa) = pred_set.UNION (BIGUNION x) (BIGUNION xa)"
-  sorry
-
-lemma DISJOINT_BIGUNION: "(ALL (s::('a => bool) => bool) t::'a => bool.
-    DISJOINT (BIGUNION s) t =
-    (ALL s'::'a => bool. IN s' s --> DISJOINT s' t)) &
-(ALL (x::('a => bool) => bool) xa::'a => bool.
-    DISJOINT xa (BIGUNION x) =
-    (ALL xb::'a => bool. IN xb x --> DISJOINT xa xb))"
-  sorry
-
-lemma BIGUNION_INSERT: "BIGUNION (INSERT x xa) = pred_set.UNION x (BIGUNION xa)"
-  sorry
-
-lemma BIGUNION_SUBSET: "SUBSET (BIGUNION P) X = (ALL Y. IN Y P --> SUBSET Y X)"
-  sorry
-
-lemma FINITE_BIGUNION: "FINITE x & (ALL s. IN s x --> FINITE s) ==> FINITE (BIGUNION x)"
-  sorry
-
-definition
-  BIGINTER :: "(('a => bool) => bool) => 'a => bool"  where
-  "BIGINTER == %B. GSPEC (%x. (x, ALL P. IN P B --> IN x P))"
-
-lemma BIGINTER: "BIGINTER B = GSPEC (%x. (x, ALL P. IN P B --> IN x P))"
-  sorry
-
-lemma IN_BIGINTER: "IN x (BIGINTER B) = (ALL P. IN P B --> IN x P)"
-  sorry
-
-lemma BIGINTER_INSERT: "BIGINTER (INSERT P B) = pred_set.INTER P (BIGINTER B)"
-  sorry
-
-lemma BIGINTER_EMPTY: "BIGINTER EMPTY = pred_set.UNIV"
-  sorry
-
-lemma BIGINTER_INTER: "BIGINTER (INSERT x (INSERT xa EMPTY)) = pred_set.INTER x xa"
-  sorry
-
-lemma BIGINTER_SING: "BIGINTER (INSERT x EMPTY) = x"
-  sorry
-
-lemma SUBSET_BIGINTER: "SUBSET X (BIGINTER P) = (ALL x. IN x P --> SUBSET X x)"
-  sorry
-
-lemma DISJOINT_BIGINTER: "IN xa xb & DISJOINT xa x
-==> DISJOINT x (BIGINTER xb) & DISJOINT (BIGINTER xb) x"
-  sorry
-
-definition
-  CROSS :: "('a => bool) => ('b => bool) => 'a * 'b => bool"  where
-  "CROSS == %P Q. GSPEC (%p. (p, IN (fst p) P & IN (snd p) Q))"
-
-lemma CROSS_DEF: "CROSS P Q = GSPEC (%p. (p, IN (fst p) P & IN (snd p) Q))"
-  sorry
-
-lemma IN_CROSS: "IN xb (CROSS x xa) = (IN (fst xb) x & IN (snd xb) xa)"
-  sorry
-
-lemma CROSS_EMPTY: "CROSS x EMPTY = EMPTY & CROSS EMPTY x = EMPTY"
-  sorry
-
-lemma CROSS_INSERT_LEFT: "CROSS (INSERT xb x) xa =
-pred_set.UNION (CROSS (INSERT xb EMPTY) xa) (CROSS x xa)"
-  sorry
-
-lemma CROSS_INSERT_RIGHT: "CROSS x (INSERT xb xa) =
-pred_set.UNION (CROSS x (INSERT xb EMPTY)) (CROSS x xa)"
-  sorry
-
-lemma FINITE_CROSS: "FINITE x & FINITE xa ==> FINITE (CROSS x xa)"
-  sorry
-
-lemma CROSS_SINGS: "CROSS (INSERT x EMPTY) (INSERT xa EMPTY) = INSERT (x, xa) EMPTY"
-  sorry
-
-lemma CARD_SING_CROSS: "FINITE (s::'b => bool) ==> CARD (CROSS (INSERT (x::'a) EMPTY) s) = CARD s"
-  sorry
-
-lemma CARD_CROSS: "FINITE x & FINITE xa ==> CARD (CROSS x xa) = CARD x * CARD xa"
-  sorry
-
-lemma CROSS_SUBSET: "SUBSET (CROSS xb xc) (CROSS x xa) =
-(xb = EMPTY | xc = EMPTY | SUBSET xb x & SUBSET xc xa)"
-  sorry
-
-lemma FINITE_CROSS_EQ: "FINITE (CROSS P Q) = (P = EMPTY | Q = EMPTY | FINITE P & FINITE Q)"
-  sorry
-
-definition
-  COMPL :: "('a => bool) => 'a => bool"  where
-  "COMPL == DIFF pred_set.UNIV"
-
-lemma COMPL_DEF: "COMPL P = DIFF pred_set.UNIV P"
-  sorry
-
-lemma IN_COMPL: "IN x (COMPL xa) = (~ IN x xa)"
-  sorry
-
-lemma COMPL_COMPL: "COMPL (COMPL x) = x"
-  sorry
-
-lemma COMPL_CLAUSES: "pred_set.INTER (COMPL x) x = EMPTY &
-pred_set.UNION (COMPL x) x = pred_set.UNIV"
-  sorry
-
-lemma COMPL_SPLITS: "pred_set.UNION (pred_set.INTER x xa) (pred_set.INTER (COMPL x) xa) = xa"
-  sorry
-
-lemma INTER_UNION_COMPL: "pred_set.INTER x xa = COMPL (pred_set.UNION (COMPL x) (COMPL xa))"
-  sorry
-
-lemma COMPL_EMPTY: "COMPL EMPTY = pred_set.UNIV"
-  sorry
-
-consts
-  count :: "nat => nat => bool" 
-
-defs
-  count_primdef: "count == %n. GSPEC (%m. (m, m < n))"
-
-lemma count_def: "count n = GSPEC (%m. (m, m < n))"
-  sorry
-
-lemma IN_COUNT: "IN m (count n) = (m < n)"
-  sorry
-
-lemma COUNT_ZERO: "count 0 = EMPTY"
-  sorry
-
-lemma COUNT_SUC: "count (Suc n) = INSERT n (count n)"
-  sorry
-
-lemma FINITE_COUNT: "FINITE (count n)"
-  sorry
-
-lemma CARD_COUNT: "CARD (count n) = n"
-  sorry
-
-definition
-  ITSET_tupled :: "('a => 'b => 'b) => ('a => bool) * 'b => 'b"  where
-  "ITSET_tupled ==
-%f. WFREC
-     (SOME R.
-         WF R &
-         (ALL b s.
-             FINITE s & s ~= EMPTY --> R (REST s, f (CHOICE s) b) (s, b)))
-     (%ITSET_tupled (v, v1).
-         if FINITE v
-         then if v = EMPTY then v1
-              else ITSET_tupled (REST v, f (CHOICE v) v1)
-         else ARB)"
-
-lemma ITSET_tupled_primitive_def: "ITSET_tupled f =
-WFREC
- (SOME R.
-     WF R &
-     (ALL b s. FINITE s & s ~= EMPTY --> R (REST s, f (CHOICE s) b) (s, b)))
- (%ITSET_tupled (v, v1).
-     if FINITE v
-     then if v = EMPTY then v1 else ITSET_tupled (REST v, f (CHOICE v) v1)
-     else ARB)"
-  sorry
-
-definition
-  ITSET :: "('a => 'b => 'b) => ('a => bool) => 'b => 'b"  where
-  "ITSET == %f x x1. ITSET_tupled f (x, x1)"
-
-lemma ITSET_curried_def: "ITSET (f::'a => 'b => 'b) (x::'a => bool) (x1::'b) = ITSET_tupled f (x, x1)"
-  sorry
-
-lemma ITSET_IND: "(!!(s::'a => bool) b::'b.
-    (FINITE s & s ~= EMPTY
-     ==> (P::('a => bool) => 'b => bool) (REST s)
-          ((f::'a => 'b => 'b) (CHOICE s) b))
-    ==> P s b)
-==> P (v::'a => bool) (x::'b)"
-  sorry
-
-lemma ITSET_THM: "FINITE s
-==> ITSET f s b =
-    (if s = EMPTY then b else ITSET f (REST s) (f (CHOICE s) b))"
-  sorry
-
-lemma ITSET_EMPTY: "ITSET (x::'a => 'b => 'b) EMPTY (xa::'b) = xa"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" operator
-
-definition
-  ASSOC :: "('a => 'a => 'a) => bool"  where
-  "ASSOC == %f. ALL x y z. f x (f y z) = f (f x y) z"
-
-lemma ASSOC_DEF: "ASSOC f = (ALL x y z. f x (f y z) = f (f x y) z)"
-  sorry
-
-definition
-  COMM :: "('a => 'a => 'b) => bool"  where
-  "COMM == %f. ALL x y. f x y = f y x"
-
-lemma COMM_DEF: "COMM f = (ALL x y. f x y = f y x)"
-  sorry
-
-definition
-  FCOMM :: "('a => 'b => 'a) => ('c => 'a => 'a) => bool"  where
-  "FCOMM == %f g. ALL x y z. g x (f y z) = f (g x y) z"
-
-lemma FCOMM_DEF: "FCOMM f g = (ALL x y z. g x (f y z) = f (g x y) z)"
-  sorry
-
-definition
-  RIGHT_ID :: "('a => 'b => 'a) => 'b => bool"  where
-  "RIGHT_ID == %f e. ALL x. f x e = x"
-
-lemma RIGHT_ID_DEF: "RIGHT_ID f e = (ALL x. f x e = x)"
-  sorry
-
-definition
-  LEFT_ID :: "('a => 'b => 'b) => 'a => bool"  where
-  "LEFT_ID == %f e. ALL x. f e x = x"
-
-lemma LEFT_ID_DEF: "LEFT_ID f e = (ALL x. f e x = x)"
-  sorry
-
-definition
-  MONOID :: "('a => 'a => 'a) => 'a => bool"  where
-  "MONOID == %f e. ASSOC f & RIGHT_ID f e & LEFT_ID f e"
-
-lemma MONOID_DEF: "MONOID f e = (ASSOC f & RIGHT_ID f e & LEFT_ID f e)"
-  sorry
-
-lemma ASSOC_CONJ: "ASSOC op &"
-  sorry
-
-lemma ASSOC_DISJ: "ASSOC op |"
-  sorry
-
-lemma FCOMM_ASSOC: "FCOMM x x = ASSOC x"
-  sorry
-
-lemma MONOID_CONJ_T: "MONOID op & True"
-  sorry
-
-lemma MONOID_DISJ_F: "MONOID op | False"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" rich_list
-
-consts
-  SNOC :: "'a => 'a list => 'a list" 
-
-specification (SNOC) SNOC: "(ALL x::'a. SNOC x [] = [x]) &
-(ALL (x::'a) (x'::'a) l::'a list. SNOC x (x' # l) = x' # SNOC x l)"
-  sorry
-
-consts
-  SCANL :: "('b => 'a => 'b) => 'b => 'a list => 'b list" 
-
-specification (SCANL) SCANL: "(ALL (f::'b => 'a => 'b) e::'b. SCANL f e [] = [e]) &
-(ALL (f::'b => 'a => 'b) (e::'b) (x::'a) l::'a list.
-    SCANL f e (x # l) = e # SCANL f (f e x) l)"
-  sorry
-
-consts
-  SCANR :: "('a => 'b => 'b) => 'b => 'a list => 'b list" 
-
-specification (SCANR) SCANR: "(ALL (f::'a => 'b => 'b) e::'b. SCANR f e [] = [e]) &
-(ALL (f::'a => 'b => 'b) (e::'b) (x::'a) l::'a list.
-    SCANR f e (x # l) = f x (hd (SCANR f e l)) # SCANR f e l)"
-  sorry
-
-lemma IS_EL_DEF: "List.member l x = list_ex (op = x) l"
-  sorry
-
-definition
-  AND_EL :: "bool list => bool"  where
-  "AND_EL == list_all I"
-
-lemma AND_EL_DEF: "AND_EL = list_all I"
-  sorry
-
-definition
-  OR_EL :: "bool list => bool"  where
-  "OR_EL == list_ex I"
-
-lemma OR_EL_DEF: "OR_EL = list_ex I"
-  sorry
-
-consts
-  FIRSTN :: "nat => 'a list => 'a list" 
-
-specification (FIRSTN) FIRSTN: "(ALL l::'a list. FIRSTN (0::nat) l = []) &
-(ALL (n::nat) (x::'a) l::'a list. FIRSTN (Suc n) (x # l) = x # FIRSTN n l)"
-  sorry
-
-consts
-  BUTFIRSTN :: "nat => 'a list => 'a list" 
-
-specification (BUTFIRSTN) BUTFIRSTN: "(ALL l::'a list. BUTFIRSTN (0::nat) l = l) &
-(ALL (n::nat) (x::'a) l::'a list. BUTFIRSTN (Suc n) (x # l) = BUTFIRSTN n l)"
-  sorry
-
-consts
-  SEG :: "nat => nat => 'a list => 'a list" 
-
-specification (SEG) SEG: "(ALL (k::nat) l::'a list. SEG (0::nat) k l = []) &
-(ALL (m::nat) (x::'a) l::'a list.
-    SEG (Suc m) (0::nat) (x # l) = x # SEG m (0::nat) l) &
-(ALL (m::nat) (k::nat) (x::'a) l::'a list.
-    SEG (Suc m) (Suc k) (x # l) = SEG (Suc m) k l)"
-  sorry
-
-lemma LAST: "last (SNOC x l) = x"
-  sorry
-
-lemma BUTLAST: "butlast (SNOC x l) = l"
-  sorry
-
-consts
-  LASTN :: "nat => 'a list => 'a list" 
-
-specification (LASTN) LASTN: "(ALL l::'a list. LASTN (0::nat) l = []) &
-(ALL (n::nat) (x::'a) l::'a list.
-    LASTN (Suc n) (SNOC x l) = SNOC x (LASTN n l))"
-  sorry
-
-consts
-  BUTLASTN :: "nat => 'a list => 'a list" 
-
-specification (BUTLASTN) BUTLASTN: "(ALL l::'a list. BUTLASTN (0::nat) l = l) &
-(ALL (n::nat) (x::'a) l::'a list.
-    BUTLASTN (Suc n) (SNOC x l) = BUTLASTN n l)"
-  sorry
-
-lemma EL: "(ALL x::'a list. EL (0::nat) x = hd x) &
-(ALL (x::nat) xa::'a list. EL (Suc x) xa = EL x (tl xa))"
-  sorry
-
-consts
-  ELL :: "nat => 'a list => 'a" 
-
-specification (ELL) ELL: "(ALL l::'a list. ELL (0::nat) l = last l) &
-(ALL (n::nat) l::'a list. ELL (Suc n) l = ELL n (butlast l))"
-  sorry
-
-consts
-  IS_PREFIX :: "'a list => 'a list => bool" 
-
-specification (IS_PREFIX) IS_PREFIX: "(ALL l::'a list. IS_PREFIX l [] = True) &
-(ALL (x::'a) l::'a list. IS_PREFIX [] (x # l) = False) &
-(ALL (x1::'a) (l1::'a list) (x2::'a) l2::'a list.
-    IS_PREFIX (x1 # l1) (x2 # l2) = (x1 = x2 & IS_PREFIX l1 l2))"
-  sorry
-
-lemma SNOC_APPEND: "SNOC x l = l @ [x]"
-  sorry
-
-lemma REVERSE: "rev [] = [] & (ALL (x::'a) xa::'a list. rev (x # xa) = SNOC x (rev xa))"
-  sorry
-
-lemma REVERSE_SNOC: "rev (SNOC x l) = x # rev l"
-  sorry
-
-lemma SNOC_Axiom: "EX x. x [] = e & (ALL xa l. x (SNOC xa l) = f xa l (x l))"
-  sorry
-
-consts
-  IS_SUFFIX :: "'a list => 'a list => bool" 
-
-specification (IS_SUFFIX) IS_SUFFIX: "(ALL l::'a list. IS_SUFFIX l [] = True) &
-(ALL (x::'a) l::'a list. IS_SUFFIX [] (SNOC x l) = False) &
-(ALL (x1::'a) (l1::'a list) (x2::'a) l2::'a list.
-    IS_SUFFIX (SNOC x1 l1) (SNOC x2 l2) = (x1 = x2 & IS_SUFFIX l1 l2))"
-  sorry
-
-consts
-  IS_SUBLIST :: "'a list => 'a list => bool" 
-
-specification (IS_SUBLIST) IS_SUBLIST: "(ALL l::'a list. IS_SUBLIST l [] = True) &
-(ALL (x::'a) l::'a list. IS_SUBLIST [] (x # l) = False) &
-(ALL (x1::'a) (l1::'a list) (x2::'a) l2::'a list.
-    IS_SUBLIST (x1 # l1) (x2 # l2) =
-    (x1 = x2 & IS_PREFIX l1 l2 | IS_SUBLIST l1 (x2 # l2)))"
-  sorry
-
-consts
-  SPLITP :: "('a => bool) => 'a list => 'a list * 'a list" 
-
-specification (SPLITP) SPLITP: "(ALL P::'a => bool. SPLITP P [] = ([], [])) &
-(ALL (P::'a => bool) (x::'a) l::'a list.
-    SPLITP P (x # l) =
-    (if P x then ([], x # l) else (x # fst (SPLITP P l), snd (SPLITP P l))))"
-  sorry
-
-definition
-  PREFIX :: "('a => bool) => 'a list => 'a list"  where
-  "PREFIX == %P l. fst (SPLITP (Not o P) l)"
-
-lemma PREFIX_DEF: "PREFIX P l = fst (SPLITP (Not o P) l)"
-  sorry
-
-definition
-  SUFFIX :: "('a => bool) => 'a list => 'a list"  where
-  "SUFFIX == %P. foldl (%l' x. if P x then SNOC x l' else []) []"
-
-lemma SUFFIX_DEF: "SUFFIX P l = foldl (%l' x. if P x then SNOC x l' else []) [] l"
-  sorry
-
-definition
-  UNZIP_FST :: "('a * 'b) list => 'a list"  where
-  "UNZIP_FST == %l. fst (unzip l)"
-
-lemma UNZIP_FST_DEF: "UNZIP_FST l = fst (unzip l)"
-  sorry
-
-definition
-  UNZIP_SND :: "('a * 'b) list => 'b list"  where
-  "UNZIP_SND == %l. snd (unzip l)"
-
-lemma UNZIP_SND_DEF: "UNZIP_SND (l::('a * 'b) list) = snd (unzip l)"
-  sorry
-
-consts
-  GENLIST :: "(nat => 'a) => nat => 'a list" 
-
-specification (GENLIST) GENLIST: "(ALL f::nat => 'a. GENLIST f (0::nat) = []) &
-(ALL (f::nat => 'a) n::nat. GENLIST f (Suc n) = SNOC (f n) (GENLIST f n))"
-  sorry
-
-consts
-  REPLICATE :: "nat => 'a => 'a list" 
-
-specification (REPLICATE) REPLICATE: "(ALL x::'a. REPLICATE (0::nat) x = []) &
-(ALL (n::nat) x::'a. REPLICATE (Suc n) x = x # REPLICATE n x)"
-  sorry
-
-lemma LENGTH_MAP2: "length l1 = length l2
-==> length (map2 f l1 l2) = length l1 & length (map2 f l1 l2) = length l2"
-  sorry
-
-lemma LENGTH_EQ: "x = y ==> length x = length y"
-  sorry
-
-lemma LENGTH_NOT_NULL: "(0 < length l) = (~ List.null l)"
-  sorry
-
-lemma SNOC_INDUCT: "P [] & (ALL l. P l --> (ALL x. P (SNOC x l))) ==> P x"
-  sorry
-
-lemma SNOC_CASES: "x' = [] | (EX x l. x' = SNOC x l)"
-  sorry
-
-lemma LENGTH_SNOC: "length (SNOC x l) = Suc (length l)"
-  sorry
-
-lemma NOT_NIL_SNOC: "[] ~= SNOC x xa"
-  sorry
-
-lemma NOT_SNOC_NIL: "SNOC x xa ~= []"
-  sorry
-
-lemma SNOC_11: "(SNOC x l = SNOC x' l') = (x = x' & l = l')"
-  sorry
-
-lemma SNOC_EQ_LENGTH_EQ: "SNOC x1 l1 = SNOC x2 l2 ==> length l1 = length l2"
-  sorry
-
-lemma SNOC_REVERSE_CONS: "SNOC x xa = rev (x # rev xa)"
-  sorry
-
-lemma MAP_SNOC: "map (x::'a => 'b) (SNOC (xa::'a) (xb::'a list)) = SNOC (x xa) (map x xb)"
-  sorry
-
-lemma FOLDR_SNOC: "foldr (f::'a => 'b => 'b) (SNOC (x::'a) (l::'a list)) (e::'b) =
-foldr f l (f x e)"
-  sorry
-
-lemma FOLDL_SNOC: "foldl (f::'b => 'a => 'b) (e::'b) (SNOC (x::'a) (l::'a list)) =
-f (foldl f e l) x"
-  sorry
-
-lemma FOLDR_FOLDL: "MONOID f e ==> foldr f l e = foldl f e l"
-  sorry
-
-lemma LENGTH_FOLDR: "length l = foldr (%x. Suc) l 0"
-  sorry
-
-lemma LENGTH_FOLDL: "length l = foldl (%l' x. Suc l') 0 l"
-  sorry
-
-lemma MAP_FOLDR: "map (f::'a => 'b) (l::'a list) = foldr (%x::'a. op # (f x)) l []"
-  sorry
-
-lemma MAP_FOLDL: "map (f::'a => 'b) (l::'a list) =
-foldl (%(l'::'b list) x::'a. SNOC (f x) l') [] l"
-  sorry
-
-lemma FILTER_FOLDR: "filter P l = foldr (%x l'. if P x then x # l' else l') l []"
-  sorry
-
-lemma FILTER_SNOC: "filter P (SNOC x l) = (if P x then SNOC x (filter P l) else filter P l)"
-  sorry
-
-lemma FILTER_FOLDL: "filter P l = foldl (%l' x. if P x then SNOC x l' else l') [] l"
-  sorry
-
-lemma FILTER_COMM: "filter f1 (filter f2 l) = filter f2 (filter f1 l)"
-  sorry
-
-lemma FILTER_IDEM: "filter f (filter f l) = filter f l"
-  sorry
-
-lemma LENGTH_SEG: "n + k <= length l ==> length (SEG n k l) = n"
-  sorry
-
-lemma APPEND_NIL: "(ALL l::'a list. l @ [] = l) & (ALL x::'a list. [] @ x = x)"
-  sorry
-
-lemma APPEND_SNOC: "l1 @ SNOC x l2 = SNOC x (l1 @ l2)"
-  sorry
-
-lemma APPEND_FOLDR: "l1 @ l2 = foldr op # l1 l2"
-  sorry
-
-lemma APPEND_FOLDL: "l1 @ l2 = foldl (%l' x. SNOC x l') l1 l2"
-  sorry
-
-lemma CONS_APPEND: "x # l = [x] @ l"
-  sorry
-
-lemma ASSOC_APPEND: "ASSOC op @"
-  sorry
-
-lemma MONOID_APPEND_NIL: "MONOID op @ []"
-  sorry
-
-lemma APPEND_LENGTH_EQ: "[| length l1 = length l1'; length l2 = length l2' |]
-==> (l1 @ l2 = l1' @ l2') = (l1 = l1' & l2 = l2')"
-  sorry
-
-lemma FLAT_SNOC: "concat (SNOC x l) = concat l @ x"
-  sorry
-
-lemma FLAT_FOLDR: "concat l = foldr op @ l []"
-  sorry
-
-lemma LENGTH_FLAT: "length (concat l) = Compatibility.sum (map length l)"
-  sorry
-
-lemma REVERSE_FOLDR: "rev l = foldr SNOC l []"
-  sorry
-
-lemma ALL_EL_SNOC: "list_all P (SNOC x l) = (list_all P l & P x)"
-  sorry
-
-lemma ALL_EL_MAP: "list_all (P::'b => bool) (map (f::'a => 'b) (l::'a list)) =
-list_all (P o f) l"
-  sorry
-
-lemma SOME_EL_SNOC: "list_ex P (SNOC x l) = (P x | list_ex P l)"
-  sorry
-
-lemma IS_EL_SNOC: "List.member (SNOC x l) y = (y = x | List.member l y)"
-  sorry
-
-lemma SUM_SNOC: "Compatibility.sum (SNOC x l) = Compatibility.sum l + x"
-  sorry
-
-lemma SUM_FOLDL: "Compatibility.sum l = foldl op + 0 l"
-  sorry
-
-lemma IS_PREFIX_APPEND: "IS_PREFIX l1 l2 = (EX l. l1 = l2 @ l)"
-  sorry
-
-lemma IS_SUFFIX_APPEND: "IS_SUFFIX l1 l2 = (EX l. l1 = l @ l2)"
-  sorry
-
-lemma IS_SUBLIST_APPEND: "IS_SUBLIST l1 l2 = (EX l l'. l1 = l @ l2 @ l')"
-  sorry
-
-lemma IS_PREFIX_IS_SUBLIST: "IS_PREFIX l1 l2 ==> IS_SUBLIST l1 l2"
-  sorry
-
-lemma IS_SUFFIX_IS_SUBLIST: "IS_SUFFIX l1 l2 ==> IS_SUBLIST l1 l2"
-  sorry
-
-lemma IS_PREFIX_REVERSE: "IS_PREFIX (rev l1) (rev l2) = IS_SUFFIX l1 l2"
-  sorry
-
-lemma IS_SUFFIX_REVERSE: "IS_SUFFIX (rev l1) (rev l2) = IS_PREFIX l1 l2"
-  sorry
-
-lemma IS_SUBLIST_REVERSE: "IS_SUBLIST (rev l1) (rev l2) = IS_SUBLIST l1 l2"
-  sorry
-
-lemma PREFIX_FOLDR: "PREFIX P x = foldr (%x l'. if P x then x # l' else []) x []"
-  sorry
-
-lemma PREFIX: "(ALL x::'a => bool. PREFIX x [] = []) &
-(ALL (x::'a => bool) (xa::'a) xb::'a list.
-    PREFIX x (xa # xb) = (if x xa then xa # PREFIX x xb else []))"
-  sorry
-
-lemma IS_PREFIX_PREFIX: "IS_PREFIX l (PREFIX P l)"
-  sorry
-
-lemma LENGTH_SCANL: "length (SCANL (f::'b => 'a => 'b) (e::'b) (l::'a list)) = Suc (length l)"
-  sorry
-
-lemma LENGTH_SCANR: "length (SCANR (f::'a => 'b => 'b) (e::'b) (l::'a list)) = Suc (length l)"
-  sorry
-
-lemma COMM_MONOID_FOLDL: "[| COMM x; MONOID x xa |] ==> foldl x e l = x e (foldl x xa l)"
-  sorry
-
-lemma COMM_MONOID_FOLDR: "[| COMM x; MONOID x xa |] ==> foldr x l e = x e (foldr x l xa)"
-  sorry
-
-lemma FCOMM_FOLDR_APPEND: "[| FCOMM x xa; LEFT_ID x xb |]
-==> foldr xa (l1 @ l2) xb = x (foldr xa l1 xb) (foldr xa l2 xb)"
-  sorry
-
-lemma FCOMM_FOLDL_APPEND: "[| FCOMM x xa; RIGHT_ID xa xb |]
-==> foldl x xb (l1 @ l2) = xa (foldl x xb l1) (foldl x xb l2)"
-  sorry
-
-lemma FOLDL_SINGLE: "foldl x xa [xb] = x xa xb"
-  sorry
-
-lemma FOLDR_SINGLE: "foldr (x::'a => 'b => 'b) [xb::'a] (xa::'b) = x xb xa"
-  sorry
-
-lemma FOLDR_CONS_NIL: "foldr op # l [] = l"
-  sorry
-
-lemma FOLDL_SNOC_NIL: "foldl (%xs x. SNOC x xs) [] l = l"
-  sorry
-
-lemma FOLDR_REVERSE: "foldr (x::'a => 'b => 'b) (rev (xb::'a list)) (xa::'b) =
-foldl (%(xa::'b) y::'a. x y xa) xa xb"
-  sorry
-
-lemma FOLDL_REVERSE: "foldl x xa (rev xb) = foldr (%xa y. x y xa) xb xa"
-  sorry
-
-lemma FOLDR_MAP: "foldr (f::'a => 'a => 'a) (map (g::'b => 'a) (l::'b list)) (e::'a) =
-foldr (%x::'b. f (g x)) l e"
-  sorry
-
-lemma ALL_EL_FOLDR: "list_all P l = foldr (%x. op & (P x)) l True"
-  sorry
-
-lemma ALL_EL_FOLDL: "list_all P l = foldl (%l' x. l' & P x) True l"
-  sorry
-
-lemma SOME_EL_FOLDR: "list_ex P l = foldr (%x. op | (P x)) l False"
-  sorry
-
-lemma SOME_EL_FOLDL: "list_ex P l = foldl (%l' x. l' | P x) False l"
-  sorry
-
-lemma ALL_EL_FOLDR_MAP: "list_all x xa = foldr op & (map x xa) True"
-  sorry
-
-lemma ALL_EL_FOLDL_MAP: "list_all x xa = foldl op & True (map x xa)"
-  sorry
-
-lemma SOME_EL_FOLDR_MAP: "list_ex x xa = foldr op | (map x xa) False"
-  sorry
-
-lemma SOME_EL_FOLDL_MAP: "list_ex x xa = foldl op | False (map x xa)"
-  sorry
-
-lemma FOLDR_FILTER: "foldr (f::'a => 'a => 'a) (filter (P::'a => bool) (l::'a list)) (e::'a) =
-foldr (%(x::'a) y::'a. if P x then f x y else y) l e"
-  sorry
-
-lemma FOLDL_FILTER: "foldl (f::'a => 'a => 'a) (e::'a) (filter (P::'a => bool) (l::'a list)) =
-foldl (%(x::'a) y::'a. if P y then f x y else x) e l"
-  sorry
-
-lemma ASSOC_FOLDR_FLAT: "[| ASSOC f; LEFT_ID f e |]
-==> foldr f (concat l) e = foldr f (map (FOLDR f e) l) e"
-  sorry
-
-lemma ASSOC_FOLDL_FLAT: "[| ASSOC f; RIGHT_ID f e |]
-==> foldl f e (concat l) = foldl f e (map (foldl f e) l)"
-  sorry
-
-lemma SOME_EL_MAP: "list_ex (P::'b => bool) (map (f::'a => 'b) (l::'a list)) = list_ex (P o f) l"
-  sorry
-
-lemma SOME_EL_DISJ: "list_ex (%x. P x | Q x) l = (list_ex P l | list_ex Q l)"
-  sorry
-
-lemma IS_EL_FOLDR: "List.member xa x = foldr (%xa. op | (x = xa)) xa False"
-  sorry
-
-lemma IS_EL_FOLDL: "List.member xa x = foldl (%l' xa. l' | x = xa) False xa"
-  sorry
-
-lemma NULL_FOLDR: "List.null l = foldr (%x l'. False) l True"
-  sorry
-
-lemma NULL_FOLDL: "List.null l = foldl (%x l'. False) True l"
-  sorry
-
-lemma SEG_LENGTH_ID: "SEG (length l) 0 l = l"
-  sorry
-
-lemma SEG_SUC_CONS: "SEG m (Suc n) (x # l) = SEG m n l"
-  sorry
-
-lemma SEG_0_SNOC: "m <= length l ==> SEG m 0 (SNOC x l) = SEG m 0 l"
-  sorry
-
-lemma BUTLASTN_SEG: "n <= length l ==> BUTLASTN n l = SEG (length l - n) 0 l"
-  sorry
-
-lemma LASTN_CONS: "n <= length l ==> LASTN n (x # l) = LASTN n l"
-  sorry
-
-lemma LENGTH_LASTN: "n <= length l ==> length (LASTN n l) = n"
-  sorry
-
-lemma LASTN_LENGTH_ID: "LASTN (length l) l = l"
-  sorry
-
-lemma LASTN_LASTN: "[| m <= length l; n <= m |] ==> LASTN n (LASTN m l) = LASTN n l"
-  sorry
-
-lemma FIRSTN_LENGTH_ID: "FIRSTN (length l) l = l"
-  sorry
-
-lemma FIRSTN_SNOC: "n <= length l ==> FIRSTN n (SNOC x l) = FIRSTN n l"
-  sorry
-
-lemma BUTLASTN_LENGTH_NIL: "BUTLASTN (length l) l = []"
-  sorry
-
-lemma BUTLASTN_SUC_BUTLAST: "n < length l ==> BUTLASTN (Suc n) l = BUTLASTN n (butlast l)"
-  sorry
-
-lemma BUTLASTN_BUTLAST: "n < length l ==> BUTLASTN n (butlast l) = butlast (BUTLASTN n l)"
-  sorry
-
-lemma LENGTH_BUTLASTN: "n <= length l ==> length (BUTLASTN n l) = length l - n"
-  sorry
-
-lemma BUTLASTN_BUTLASTN: "n + m <= length l ==> BUTLASTN n (BUTLASTN m l) = BUTLASTN (n + m) l"
-  sorry
-
-lemma APPEND_BUTLASTN_LASTN: "n <= length l ==> BUTLASTN n l @ LASTN n l = l"
-  sorry
-
-lemma APPEND_FIRSTN_LASTN: "m + n = length l ==> FIRSTN n l @ LASTN m l = l"
-  sorry
-
-lemma BUTLASTN_APPEND2: "n <= length l2 ==> BUTLASTN n (l1 @ l2) = l1 @ BUTLASTN n l2"
-  sorry
-
-lemma BUTLASTN_LENGTH_APPEND: "BUTLASTN (length l2) (l1 @ l2) = l1"
-  sorry
-
-lemma LASTN_LENGTH_APPEND: "LASTN (length l2) (l1 @ l2) = l2"
-  sorry
-
-lemma BUTLASTN_CONS: "n <= length l ==> BUTLASTN n (x # l) = x # BUTLASTN n l"
-  sorry
-
-lemma BUTLASTN_LENGTH_CONS: "BUTLASTN (length l) (x # l) = [x]"
-  sorry
-
-lemma LAST_LASTN_LAST: "[| n <= length l; 0 < n |] ==> last (LASTN n l) = last l"
-  sorry
-
-lemma BUTLASTN_LASTN_NIL: "n <= length l ==> BUTLASTN n (LASTN n l) = []"
-  sorry
-
-lemma LASTN_BUTLASTN: "n + m <= length l ==> LASTN n (BUTLASTN m l) = BUTLASTN m (LASTN (n + m) l)"
-  sorry
-
-lemma BUTLASTN_LASTN: "m <= n & n <= length l
-==> BUTLASTN m (LASTN n l) = LASTN (n - m) (BUTLASTN m l)"
-  sorry
-
-lemma LASTN_1: "l ~= [] ==> LASTN 1 l = [last l]"
-  sorry
-
-lemma BUTLASTN_1: "l ~= [] ==> BUTLASTN 1 l = butlast l"
-  sorry
-
-lemma BUTLASTN_APPEND1: "length l2 <= n ==> BUTLASTN n (l1 @ l2) = BUTLASTN (n - length l2) l1"
-  sorry
-
-lemma LASTN_APPEND2: "n <= length l2 ==> LASTN n (l1 @ l2) = LASTN n l2"
-  sorry
-
-lemma LASTN_APPEND1: "length l2 <= n ==> LASTN n (l1 @ l2) = LASTN (n - length l2) l1 @ l2"
-  sorry
-
-lemma LASTN_MAP: "n <= length l ==> LASTN n (map f l) = map f (LASTN n l)"
-  sorry
-
-lemma BUTLASTN_MAP: "n <= length l ==> BUTLASTN n (map f l) = map f (BUTLASTN n l)"
-  sorry
-
-lemma ALL_EL_LASTN: "[| list_all P l; m <= length l |] ==> list_all P (LASTN m l)"
-  sorry
-
-lemma ALL_EL_BUTLASTN: "[| list_all P l; m <= length l |] ==> list_all P (BUTLASTN m l)"
-  sorry
-
-lemma LENGTH_FIRSTN: "n <= length l ==> length (FIRSTN n l) = n"
-  sorry
-
-lemma FIRSTN_FIRSTN: "[| m <= length l; n <= m |] ==> FIRSTN n (FIRSTN m l) = FIRSTN n l"
-  sorry
-
-lemma LENGTH_BUTFIRSTN: "n <= length l ==> length (BUTFIRSTN n l) = length l - n"
-  sorry
-
-lemma BUTFIRSTN_LENGTH_NIL: "BUTFIRSTN (length l) l = []"
-  sorry
-
-lemma BUTFIRSTN_APPEND1: "n <= length l1 ==> BUTFIRSTN n (l1 @ l2) = BUTFIRSTN n l1 @ l2"
-  sorry
-
-lemma BUTFIRSTN_APPEND2: "length l1 <= n ==> BUTFIRSTN n (l1 @ l2) = BUTFIRSTN (n - length l1) l2"
-  sorry
-
-lemma BUTFIRSTN_BUTFIRSTN: "n + m <= length l ==> BUTFIRSTN n (BUTFIRSTN m l) = BUTFIRSTN (n + m) l"
-  sorry
-
-lemma APPEND_FIRSTN_BUTFIRSTN: "n <= length l ==> FIRSTN n l @ BUTFIRSTN n l = l"
-  sorry
-
-lemma LASTN_SEG: "n <= length l ==> LASTN n l = SEG n (length l - n) l"
-  sorry
-
-lemma FIRSTN_SEG: "n <= length l ==> FIRSTN n l = SEG n 0 l"
-  sorry
-
-lemma BUTFIRSTN_SEG: "n <= length l ==> BUTFIRSTN n l = SEG (length l - n) n l"
-  sorry
-
-lemma BUTFIRSTN_SNOC: "n <= length l ==> BUTFIRSTN n (SNOC x l) = SNOC x (BUTFIRSTN n l)"
-  sorry
-
-lemma APPEND_BUTLASTN_BUTFIRSTN: "m + n = length l ==> BUTLASTN m l @ BUTFIRSTN n l = l"
-  sorry
-
-lemma SEG_SEG: "n1 + m1 <= length l & n2 + m2 <= n1
-==> SEG n2 m2 (SEG n1 m1 l) = SEG n2 (m1 + m2) l"
-  sorry
-
-lemma SEG_APPEND1: "n + m <= length l1 ==> SEG n m (l1 @ l2) = SEG n m l1"
-  sorry
-
-lemma SEG_APPEND2: "length l1 <= m & n <= length l2
-==> SEG n m (l1 @ l2) = SEG n (m - length l1) l2"
-  sorry
-
-lemma SEG_FIRSTN_BUTFISTN: "n + m <= length l ==> SEG n m l = FIRSTN n (BUTFIRSTN m l)"
-  sorry
-
-lemma SEG_APPEND: "m < length l1 & length l1 <= n + m & n + m <= length l1 + length l2
-==> SEG n m (l1 @ l2) =
-    SEG (length l1 - m) m l1 @ SEG (n + m - length l1) 0 l2"
-  sorry
-
-lemma SEG_LENGTH_SNOC: "SEG 1 (length x) (SNOC xa x) = [xa]"
-  sorry
-
-lemma SEG_SNOC: "n + m <= length l ==> SEG n m (SNOC x l) = SEG n m l"
-  sorry
-
-lemma ELL_SEG: "n < length l ==> ELL n l = hd (SEG 1 (PRE (length l - n)) l)"
-  sorry
-
-lemma SNOC_FOLDR: "SNOC x l = foldr op # l [x]"
-  sorry
-
-lemma IS_EL_FOLDR_MAP: "List.member xa x = foldr op | (map (op = x) xa) False"
-  sorry
-
-lemma IS_EL_FOLDL_MAP: "List.member xa x = foldl op | False (map (op = x) xa)"
-  sorry
-
-lemma FILTER_FILTER: "filter P (filter Q l) = [x<-l. P x & Q x]"
-  sorry
-
-lemma FCOMM_FOLDR_FLAT: "[| FCOMM g f; LEFT_ID g e |]
-==> foldr f (concat l) e = foldr g (map (FOLDR f e) l) e"
-  sorry
-
-lemma FCOMM_FOLDL_FLAT: "[| FCOMM f g; RIGHT_ID g e |]
-==> foldl f e (concat l) = foldl g e (map (foldl f e) l)"
-  sorry
-
-lemma FOLDR_MAP_REVERSE: "(!!(a::'a) (b::'a) c::'a. (f::'a => 'a => 'a) a (f b c) = f b (f a c))
-==> foldr f (map (g::'b => 'a) (rev (l::'b list))) (e::'a) =
-    foldr f (map g l) e"
-  sorry
-
-lemma FOLDR_FILTER_REVERSE: "(!!(a::'a) (b::'a) c::'a. (f::'a => 'a => 'a) a (f b c) = f b (f a c))
-==> foldr f (filter (P::'a => bool) (rev (l::'a list))) (e::'a) =
-    foldr f (filter P l) e"
-  sorry
-
-lemma COMM_ASSOC_FOLDR_REVERSE: "[| COMM f; ASSOC f |] ==> foldr f (rev l) e = foldr f l e"
-  sorry
-
-lemma COMM_ASSOC_FOLDL_REVERSE: "[| COMM f; ASSOC f |] ==> foldl f e (rev l) = foldl f e l"
-  sorry
-
-lemma ELL_LAST: "~ List.null l ==> ELL 0 l = last l"
-  sorry
-
-lemma ELL_0_SNOC: "ELL 0 (SNOC x l) = x"
-  sorry
-
-lemma ELL_SNOC: "0 < n ==> ELL n (SNOC x l) = ELL (PRE n) l"
-  sorry
-
-lemma ELL_SUC_SNOC: "ELL (Suc n) (SNOC x xa) = ELL n xa"
-  sorry
-
-lemma ELL_CONS: "n < length l ==> ELL n (x # l) = ELL n l"
-  sorry
-
-lemma ELL_LENGTH_CONS: "ELL (length l) (x # l) = x"
-  sorry
-
-lemma ELL_LENGTH_SNOC: "ELL (length l) (SNOC x l) = (if List.null l then x else hd l)"
-  sorry
-
-lemma ELL_APPEND2: "n < length l2 ==> ELL n (l1 @ l2) = ELL n l2"
-  sorry
-
-lemma ELL_APPEND1: "length l2 <= n ==> ELL n (l1 @ l2) = ELL (n - length l2) l1"
-  sorry
-
-lemma ELL_PRE_LENGTH: "l ~= [] ==> ELL (PRE (length l)) l = hd l"
-  sorry
-
-lemma EL_LENGTH_SNOC: "EL (length l) (SNOC x l) = x"
-  sorry
-
-lemma EL_PRE_LENGTH: "l ~= [] ==> EL (PRE (length l)) l = last l"
-  sorry
-
-lemma EL_SNOC: "n < length l ==> EL n (SNOC x l) = EL n l"
-  sorry
-
-lemma EL_ELL: "n < length l ==> EL n l = ELL (PRE (length l - n)) l"
-  sorry
-
-lemma EL_LENGTH_APPEND: "~ List.null l2 ==> EL (length l1) (l1 @ l2) = hd l2"
-  sorry
-
-lemma ELL_EL: "n < length l ==> ELL n l = EL (PRE (length l - n)) l"
-  sorry
-
-lemma ELL_MAP: "n < length l ==> ELL n (map f l) = f (ELL n l)"
-  sorry
-
-lemma LENGTH_BUTLAST: "l ~= [] ==> length (butlast l) = PRE (length l)"
-  sorry
-
-lemma BUTFIRSTN_LENGTH_APPEND: "BUTFIRSTN (length l1) (l1 @ l2) = l2"
-  sorry
-
-lemma FIRSTN_APPEND1: "n <= length l1 ==> FIRSTN n (l1 @ l2) = FIRSTN n l1"
-  sorry
-
-lemma FIRSTN_APPEND2: "length l1 <= n ==> FIRSTN n (l1 @ l2) = l1 @ FIRSTN (n - length l1) l2"
-  sorry
-
-lemma FIRSTN_LENGTH_APPEND: "FIRSTN (length l1) (l1 @ l2) = l1"
-  sorry
-
-lemma REVERSE_FLAT: "rev (concat l) = concat (rev (map rev l))"
-  sorry
-
-lemma MAP_FILTER: "(!!x. P (f x) = P x) ==> map f (filter P l) = filter P (map f l)"
-  sorry
-
-lemma FLAT_REVERSE: "concat (rev l) = rev (concat (map rev l))"
-  sorry
-
-lemma FLAT_FLAT: "concat (concat l) = concat (map concat l)"
-  sorry
-
-lemma ALL_EL_SEG: "[| list_all P l; m + k <= length l |] ==> list_all P (SEG m k l)"
-  sorry
-
-lemma ALL_EL_FIRSTN: "[| list_all P l; m <= length l |] ==> list_all P (FIRSTN m l)"
-  sorry
-
-lemma ALL_EL_BUTFIRSTN: "[| list_all P l; m <= length l |] ==> list_all P (BUTFIRSTN m l)"
-  sorry
-
-lemma SOME_EL_SEG: "[| m + k <= length l; list_ex P (SEG m k l) |] ==> list_ex P l"
-  sorry
-
-lemma SOME_EL_FIRSTN: "[| m <= length l; list_ex P (FIRSTN m l) |] ==> list_ex P l"
-  sorry
-
-lemma SOME_EL_BUTFIRSTN: "[| m <= length l; list_ex P (BUTFIRSTN m l) |] ==> list_ex P l"
-  sorry
-
-lemma SOME_EL_LASTN: "[| m <= length l; list_ex P (LASTN m l) |] ==> list_ex P l"
-  sorry
-
-lemma SOME_EL_BUTLASTN: "[| m <= length l; list_ex P (BUTLASTN m l) |] ==> list_ex P l"
-  sorry
-
-lemma IS_EL_REVERSE: "List.member (rev l) x = List.member l x"
-  sorry
-
-lemma IS_EL_FILTER: "P x ==> List.member (filter P l) x = List.member l x"
-  sorry
-
-lemma IS_EL_SEG: "[| n + m <= length l; List.member (SEG n m l) x |] ==> List.member l x"
-  sorry
-
-lemma IS_EL_SOME_EL: "List.member l x = list_ex (op = x) l"
-  sorry
-
-lemma IS_EL_FIRSTN: "[| x <= length xa; List.member (FIRSTN x xa) xb |] ==> List.member xa xb"
-  sorry
-
-lemma IS_EL_BUTFIRSTN: "[| x <= length xa; List.member (BUTFIRSTN x xa) xb |] ==> List.member xa xb"
-  sorry
-
-lemma IS_EL_BUTLASTN: "[| x <= length xa; List.member (BUTLASTN x xa) xb |] ==> List.member xa xb"
-  sorry
-
-lemma IS_EL_LASTN: "[| x <= length xa; List.member (LASTN x xa) xb |] ==> List.member xa xb"
-  sorry
-
-lemma ZIP_SNOC: "length l1 = length l2
-==> zip (SNOC x1 l1) (SNOC x2 l2) = SNOC (x1, x2) (zip l1 l2)"
-  sorry
-
-lemma UNZIP_SNOC: "unzip (SNOC x l) =
-(SNOC (fst x) (fst (unzip l)), SNOC (snd x) (snd (unzip l)))"
-  sorry
-
-lemma LENGTH_UNZIP_FST: "length (UNZIP_FST x) = length x"
-  sorry
-
-lemma LENGTH_UNZIP_SND: "length (UNZIP_SND (x::('a * 'b) list)) = length x"
-  sorry
-
-lemma SUM_APPEND: "Compatibility.sum (l1 @ l2) = Compatibility.sum l1 + Compatibility.sum l2"
-  sorry
-
-lemma SUM_REVERSE: "Compatibility.sum (rev l) = Compatibility.sum l"
-  sorry
-
-lemma SUM_FLAT: "Compatibility.sum (concat l) = Compatibility.sum (map Compatibility.sum l)"
-  sorry
-
-lemma EL_APPEND1: "n < length l1 ==> EL n (l1 @ l2) = EL n l1"
-  sorry
-
-lemma EL_APPEND2: "length l1 <= n ==> EL n (l1 @ l2) = EL (n - length l1) l2"
-  sorry
-
-lemma EL_MAP: "n < length l ==> EL n (map f l) = f (EL n l)"
-  sorry
-
-lemma EL_CONS: "0 < n ==> EL n (x # l) = EL (PRE n) l"
-  sorry
-
-lemma EL_SEG: "n < length l ==> EL n l = hd (SEG 1 n l)"
-  sorry
-
-lemma EL_IS_EL: "n < length l ==> List.member l (EL n l)"
-  sorry
-
-lemma TL_SNOC: "tl (SNOC x l) = (if List.null l then [] else SNOC x (tl l))"
-  sorry
-
-lemma EL_REVERSE: "n < length l ==> EL n (rev l) = EL (PRE (length l - n)) l"
-  sorry
-
-lemma EL_REVERSE_ELL: "n < length l ==> EL n (rev l) = ELL n l"
-  sorry
-
-lemma ELL_LENGTH_APPEND: "~ List.null l1 ==> ELL (length l2) (l1 @ l2) = last l1"
-  sorry
-
-lemma ELL_IS_EL: "n < length l ==> List.member l (ELL n l)"
-  sorry
-
-lemma ELL_REVERSE: "n < length l ==> ELL n (rev l) = ELL (PRE (length l - n)) l"
-  sorry
-
-lemma ELL_REVERSE_EL: "n < length l ==> ELL n (rev l) = EL n l"
-  sorry
-
-lemma FIRSTN_BUTLASTN: "n <= length l ==> FIRSTN n l = BUTLASTN (length l - n) l"
-  sorry
-
-lemma BUTLASTN_FIRSTN: "n <= length l ==> BUTLASTN n l = FIRSTN (length l - n) l"
-  sorry
-
-lemma LASTN_BUTFIRSTN: "n <= length l ==> LASTN n l = BUTFIRSTN (length l - n) l"
-  sorry
-
-lemma BUTFIRSTN_LASTN: "n <= length l ==> BUTFIRSTN n l = LASTN (length l - n) l"
-  sorry
-
-lemma SEG_LASTN_BUTLASTN: "n + m <= length l ==> SEG n m l = LASTN n (BUTLASTN (length l - (n + m)) l)"
-  sorry
-
-lemma BUTFIRSTN_REVERSE: "n <= length l ==> BUTFIRSTN n (rev l) = rev (BUTLASTN n l)"
-  sorry
-
-lemma BUTLASTN_REVERSE: "n <= length l ==> BUTLASTN n (rev l) = rev (BUTFIRSTN n l)"
-  sorry
-
-lemma LASTN_REVERSE: "n <= length l ==> LASTN n (rev l) = rev (FIRSTN n l)"
-  sorry
-
-lemma FIRSTN_REVERSE: "n <= length l ==> FIRSTN n (rev l) = rev (LASTN n l)"
-  sorry
-
-lemma SEG_REVERSE: "n + m <= length l ==> SEG n m (rev l) = rev (SEG n (length l - (n + m)) l)"
-  sorry
-
-lemma LENGTH_GENLIST: "length (GENLIST f n) = n"
-  sorry
-
-lemma LENGTH_REPLICATE: "length (REPLICATE n x) = n"
-  sorry
-
-lemma IS_EL_REPLICATE: "0 < n ==> List.member (REPLICATE n x) x"
-  sorry
-
-lemma ALL_EL_REPLICATE: "list_all (op = x) (REPLICATE n x)"
-  sorry
-
-lemma AND_EL_FOLDL: "AND_EL l = foldl op & True l"
-  sorry
-
-lemma AND_EL_FOLDR: "AND_EL l = foldr op & l True"
-  sorry
-
-lemma OR_EL_FOLDL: "OR_EL l = foldl op | False l"
-  sorry
-
-lemma OR_EL_FOLDR: "OR_EL l = foldr op | l False"
-  sorry
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" state_transformer
-
-definition
-  UNIT :: "'b => 'a => 'b * 'a"  where
-  "(op ==::('b::type => 'a::type => 'b::type * 'a::type)
-        => ('b::type => 'a::type => 'b::type * 'a::type) => prop)
- (UNIT::'b::type => 'a::type => 'b::type * 'a::type)
- (Pair::'b::type => 'a::type => 'b::type * 'a::type)"
-
-lemma UNIT_DEF: "UNIT x = Pair x"
-  sorry
-
-definition
-  BIND :: "('a => 'b * 'a) => ('b => 'a => 'c * 'a) => 'a => 'c * 'a"  where
-  "BIND == %g f. (%(x, y). f x y) o g"
-
-lemma BIND_DEF: "BIND (g::'a => 'b * 'a) (f::'b => 'a => 'c * 'a) =
-(%(x::'b, y::'a). f x y) o g"
-  sorry
-
-definition
-  MMAP :: "('c => 'b) => ('a => 'c * 'a) => 'a => 'b * 'a"  where
-  "MMAP == %(f::'c => 'b) m::'a => 'c * 'a. BIND m (UNIT o f)"
-
-lemma MMAP_DEF: "MMAP f m = BIND m (UNIT o f)"
-  sorry
-
-definition
-  JOIN :: "('a => ('a => 'b * 'a) * 'a) => 'a => 'b * 'a"  where
-  "JOIN == %z. BIND z I"
-
-lemma JOIN_DEF: "JOIN z = BIND z I"
-  sorry
-
-lemma BIND_LEFT_UNIT: "BIND (UNIT (x::'a)) (k::'a => 'b => 'c * 'b) = k x"
-  sorry
-
-lemma UNIT_UNCURRY: "prod_case UNIT x = x"
-  sorry
-
-lemma BIND_RIGHT_UNIT: "BIND k UNIT = k"
-  sorry
-
-lemma BIND_ASSOC: "BIND (x::'a => 'b * 'a)
- (%a::'b. BIND ((xa::'b => 'a => 'c * 'a) a) (xb::'c => 'a => 'd * 'a)) =
-BIND (BIND x xa) xb"
-  sorry
-
-lemma MMAP_ID: "MMAP I = I"
-  sorry
-
-lemma MMAP_COMP: "MMAP ((f::'c => 'd) o (g::'b => 'c)) = MMAP f o MMAP g"
-  sorry
-
-lemma MMAP_UNIT: "MMAP (f::'b => 'c) o UNIT = UNIT o f"
-  sorry
-
-lemma MMAP_JOIN: "MMAP f o JOIN = JOIN o MMAP (MMAP f)"
-  sorry
-
-lemma JOIN_UNIT: "JOIN o UNIT = I"
-  sorry
-
-lemma JOIN_MMAP_UNIT: "JOIN o MMAP UNIT = I"
-  sorry
-
-lemma JOIN_MAP_JOIN: "JOIN o MMAP JOIN = JOIN o JOIN"
-  sorry
-
-lemma JOIN_MAP: "BIND (x::'a => 'b * 'a) (xa::'b => 'a => 'c * 'a) = JOIN (MMAP xa x)"
-  sorry
-
-lemma FST_o_UNIT: "fst o UNIT (x::'a) = K x"
-  sorry
-
-lemma SND_o_UNIT: "snd o UNIT (x::'a) = I"
-  sorry
-
-lemma FST_o_MMAP: "fst o MMAP (x::'a => 'b) (xa::'c => 'a * 'c) = x o (fst o xa)"
-  sorry
-
-;end_setup
-
-end
-
--- a/src/HOL/Import/HOL4/Generated/HOL4Prob.thy	Sun Apr 01 14:50:47 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1594 +0,0 @@
-(* AUTOMATICALLY GENERATED, DO NOT EDIT! *)
-
-theory HOL4Prob imports HOL4Real begin
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_extra
-
-lemma BOOL_BOOL_CASES_THM: "f = (%b. False) | f = (%b. True) | f = (%b. b) | f = Not"
-  by (import prob_extra BOOL_BOOL_CASES_THM)
-
-lemma EVEN_ODD_BASIC: "EVEN 0 & ~ EVEN 1 & EVEN 2 & ~ ODD 0 & ODD 1 & ~ ODD 2"
-  by (import prob_extra EVEN_ODD_BASIC)
-
-lemma EVEN_ODD_EXISTS_EQ: "EVEN n = (EX m. n = 2 * m) & ODD n = (EX m. n = Suc (2 * m))"
-  by (import prob_extra EVEN_ODD_EXISTS_EQ)
-
-lemma DIV_THEN_MULT: "Suc q * (p div Suc q) <= p"
-  by (import prob_extra DIV_THEN_MULT)
-
-lemma DIV_TWO_UNIQUE: "(n::nat) = (2::nat) * (q::nat) + (r::nat) & (r = (0::nat) | r = (1::nat))
-==> q = n div (2::nat) & r = n mod (2::nat)"
-  by (import prob_extra DIV_TWO_UNIQUE)
-
-lemma DIVISION_TWO: "(n::nat) = (2::nat) * (n div (2::nat)) + n mod (2::nat) &
-(n mod (2::nat) = (0::nat) | n mod (2::nat) = (1::nat))"
-  by (import prob_extra DIVISION_TWO)
-
-lemma DIV_TWO: "(n::nat) = (2::nat) * (n div (2::nat)) + n mod (2::nat)"
-  by (import prob_extra DIV_TWO)
-
-lemma MOD_TWO: "n mod 2 = (if EVEN n then 0 else 1)"
-  by (import prob_extra MOD_TWO)
-
-lemma DIV_TWO_BASIC: "(0::nat) div (2::nat) = (0::nat) &
-(1::nat) div (2::nat) = (0::nat) & (2::nat) div (2::nat) = (1::nat)"
-  by (import prob_extra DIV_TWO_BASIC)
-
-lemma DIV_TWO_MONO: "(m::nat) div (2::nat) < (n::nat) div (2::nat) ==> m < n"
-  by (import prob_extra DIV_TWO_MONO)
-
-lemma DIV_TWO_MONO_EVEN: "EVEN n ==> (m div 2 < n div 2) = (m < n)"
-  by (import prob_extra DIV_TWO_MONO_EVEN)
-
-lemma DIV_TWO_CANCEL: "2 * n div 2 = n & Suc (2 * n) div 2 = n"
-  by (import prob_extra DIV_TWO_CANCEL)
-
-lemma EXP_DIV_TWO: "(2::nat) ^ Suc (n::nat) div (2::nat) = (2::nat) ^ n"
-  by (import prob_extra EXP_DIV_TWO)
-
-lemma EVEN_EXP_TWO: "EVEN (2 ^ n) = (n ~= 0)"
-  by (import prob_extra EVEN_EXP_TWO)
-
-lemma DIV_TWO_EXP: "((k::nat) div (2::nat) < (2::nat) ^ (n::nat)) = (k < (2::nat) ^ Suc n)"
-  by (import prob_extra DIV_TWO_EXP)
-
-consts
-  inf :: "(real => bool) => real" 
-
-defs
-  inf_primdef: "prob_extra.inf == %P. - real.sup (IMAGE uminus P)"
-
-lemma inf_def: "prob_extra.inf P = - real.sup (IMAGE uminus P)"
-  by (import prob_extra inf_def)
-
-lemma INF_DEF_ALT: "prob_extra.inf P = - real.sup (%r. P (- r))"
-  by (import prob_extra INF_DEF_ALT)
-
-lemma REAL_SUP_EXISTS_UNIQUE: "Ex (P::real => bool) & (EX z::real. ALL x::real. P x --> x <= z)
-==> EX! s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s)"
-  by (import prob_extra REAL_SUP_EXISTS_UNIQUE)
-
-lemma REAL_SUP_MAX: "P z & (ALL x. P x --> x <= z) ==> real.sup P = z"
-  by (import prob_extra REAL_SUP_MAX)
-
-lemma REAL_INF_MIN: "P z & (ALL x. P x --> z <= x) ==> prob_extra.inf P = z"
-  by (import prob_extra REAL_INF_MIN)
-
-lemma HALF_CANCEL: "(2::real) * ((1::real) / (2::real)) = (1::real)"
-  by (import prob_extra HALF_CANCEL)
-
-lemma POW_HALF_POS: "(0::real) < ((1::real) / (2::real)) ^ (n::nat)"
-  by (import prob_extra POW_HALF_POS)
-
-lemma POW_HALF_MONO: "(m::nat) <= (n::nat)
-==> ((1::real) / (2::real)) ^ n <= ((1::real) / (2::real)) ^ m"
-  by (import prob_extra POW_HALF_MONO)
-
-lemma POW_HALF_TWICE: "((1::real) / (2::real)) ^ (n::nat) =
-(2::real) * ((1::real) / (2::real)) ^ Suc n"
-  by (import prob_extra POW_HALF_TWICE)
-
-lemma X_HALF_HALF: "(1::real) / (2::real) * (x::real) + (1::real) / (2::real) * x = x"
-  by (import prob_extra X_HALF_HALF)
-
-lemma REAL_SUP_LE_X: "Ex P & (ALL r. P r --> r <= x) ==> real.sup P <= x"
-  by (import prob_extra REAL_SUP_LE_X)
-
-lemma REAL_X_LE_SUP: "Ex P & (EX z. ALL r. P r --> r <= z) & (EX r. P r & x <= r)
-==> x <= real.sup P"
-  by (import prob_extra REAL_X_LE_SUP)
-
-lemma ABS_BETWEEN_LE: "((0::real) <= (d::real) & (x::real) - d <= (y::real) & y <= x + d) =
-(abs (y - x) <= d)"
-  by (import prob_extra ABS_BETWEEN_LE)
-
-lemma ONE_MINUS_HALF: "(1::real) - (1::real) / (2::real) = (1::real) / (2::real)"
-  by (import prob_extra ONE_MINUS_HALF)
-
-lemma HALF_LT_1: "(1::real) / (2::real) < (1::real)"
-  by (import prob_extra HALF_LT_1)
-
-lemma POW_HALF_EXP: "((1::real) / (2::real)) ^ (n::nat) = inverse (real ((2::nat) ^ n))"
-  by (import prob_extra POW_HALF_EXP)
-
-lemma INV_SUC_POS: "0 < 1 / real (Suc n)"
-  by (import prob_extra INV_SUC_POS)
-
-lemma INV_SUC_MAX: "1 / real (Suc x) <= 1"
-  by (import prob_extra INV_SUC_MAX)
-
-lemma INV_SUC: "0 < 1 / real (Suc n) & 1 / real (Suc n) <= 1"
-  by (import prob_extra INV_SUC)
-
-lemma ABS_UNIT_INTERVAL: "(0::real) <= (x::real) &
-x <= (1::real) & (0::real) <= (y::real) & y <= (1::real)
-==> abs (x - y) <= (1::real)"
-  by (import prob_extra ABS_UNIT_INTERVAL)
-
-lemma MEM_NIL: "(ALL x. ~ List.member l x) = (l = [])"
-  by (import prob_extra MEM_NIL)
-
-lemma MAP_MEM: "List.member (map (f::'a => 'b) (l::'a list)) (x::'b) =
-(EX y::'a. List.member l y & x = f y)"
-  by (import prob_extra MAP_MEM)
-
-lemma MEM_NIL_MAP_CONS: "~ List.member (map (op # x) l) []"
-  by (import prob_extra MEM_NIL_MAP_CONS)
-
-lemma FILTER_TRUE: "[x<-l. True] = l"
-  by (import prob_extra FILTER_TRUE)
-
-lemma FILTER_FALSE: "[x<-l. False] = []"
-  by (import prob_extra FILTER_FALSE)
-
-lemma FILTER_MEM: "List.member (filter P l) x ==> P x"
-  by (import prob_extra FILTER_MEM)
-
-lemma MEM_FILTER: "List.member (filter P l) x ==> List.member l x"
-  by (import prob_extra MEM_FILTER)
-
-lemma FILTER_OUT_ELT: "List.member l x | [y<-l. y ~= x] = l"
-  by (import prob_extra FILTER_OUT_ELT)
-
-lemma IS_PREFIX_NIL: "IS_PREFIX x [] & IS_PREFIX [] x = (x = [])"
-  by (import prob_extra IS_PREFIX_NIL)
-
-lemma IS_PREFIX_REFL: "IS_PREFIX x x"
-  by (import prob_extra IS_PREFIX_REFL)
-
-lemma IS_PREFIX_ANTISYM: "IS_PREFIX y x & IS_PREFIX x y ==> x = y"
-  by (import prob_extra IS_PREFIX_ANTISYM)
-
-lemma IS_PREFIX_TRANS: "IS_PREFIX x y & IS_PREFIX y z ==> IS_PREFIX x z"
-  by (import prob_extra IS_PREFIX_TRANS)
-
-lemma IS_PREFIX_BUTLAST: "IS_PREFIX (x # y) (butlast (x # y))"
-  by (import prob_extra IS_PREFIX_BUTLAST)
-
-lemma IS_PREFIX_LENGTH: "IS_PREFIX y x ==> length x <= length y"
-  by (import prob_extra IS_PREFIX_LENGTH)
-
-lemma IS_PREFIX_LENGTH_ANTI: "IS_PREFIX y x & length x = length y ==> x = y"
-  by (import prob_extra IS_PREFIX_LENGTH_ANTI)
-
-lemma IS_PREFIX_SNOC: "IS_PREFIX (SNOC x y) z = (IS_PREFIX y z | z = SNOC x y)"
-  by (import prob_extra IS_PREFIX_SNOC)
-
-lemma FOLDR_MAP: "foldr (f::'b => 'c => 'c) (map (g::'a => 'b) (l::'a list)) (e::'c) =
-foldr (%x::'a. f (g x)) l e"
-  by (import prob_extra FOLDR_MAP)
-
-lemma LAST_MEM: "List.member (h # t) (last (h # t))"
-  by (import prob_extra LAST_MEM)
-
-lemma LAST_MAP_CONS: "EX x::bool list.
-   last (map (op # (b::bool)) ((h::bool list) # (t::bool list list))) =
-   b # x"
-  by (import prob_extra LAST_MAP_CONS)
-
-lemma EXISTS_LONGEST: "EX z. List.member (x # y) z &
-      (ALL w. List.member (x # y) w --> length w <= length z)"
-  by (import prob_extra EXISTS_LONGEST)
-
-lemma UNION_DEF_ALT: "pred_set.UNION s t = (%x. s x | t x)"
-  by (import prob_extra UNION_DEF_ALT)
-
-lemma INTER_UNION_RDISTRIB: "pred_set.INTER (pred_set.UNION p q) r =
-pred_set.UNION (pred_set.INTER p r) (pred_set.INTER q r)"
-  by (import prob_extra INTER_UNION_RDISTRIB)
-
-lemma SUBSET_EQ: "(x = xa) = (SUBSET x xa & SUBSET xa x)"
-  by (import prob_extra SUBSET_EQ)
-
-lemma INTER_IS_EMPTY: "(pred_set.INTER s t = EMPTY) = (ALL x. ~ s x | ~ t x)"
-  by (import prob_extra INTER_IS_EMPTY)
-
-lemma UNION_DISJOINT_SPLIT: "pred_set.UNION s t = pred_set.UNION s u &
-pred_set.INTER s t = EMPTY & pred_set.INTER s u = EMPTY
-==> t = u"
-  by (import prob_extra UNION_DISJOINT_SPLIT)
-
-lemma GSPEC_DEF_ALT: "GSPEC (f::'a => 'b * bool) = (%v::'b. EX x::'a. (v, True) = f x)"
-  by (import prob_extra GSPEC_DEF_ALT)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_canon
-
-consts
-  alg_twin :: "bool list => bool list => bool" 
-
-defs
-  alg_twin_primdef: "alg_twin == %x y. EX l. x = SNOC True l & y = SNOC False l"
-
-lemma alg_twin_def: "alg_twin x y = (EX l. x = SNOC True l & y = SNOC False l)"
-  by (import prob_canon alg_twin_def)
-
-definition
-  alg_order_tupled :: "bool list * bool list => bool"  where
-  "alg_order_tupled ==
-WFREC (SOME R. WF R & (ALL h' h t' t. R (t, t') (h # t, h' # t')))
- (%alg_order_tupled (v, v1).
-     case v of [] => case v1 of [] => True | _ => True
-     | v4 # v5 =>
-         case v1 of [] => False
-         | v10 # v11 =>
-             v4 = True & v10 = False |
-             v4 = v10 & alg_order_tupled (v5, v11))"
-
-lemma alg_order_tupled_primitive_def: "alg_order_tupled =
-WFREC (SOME R. WF R & (ALL h' h t' t. R (t, t') (h # t, h' # t')))
- (%alg_order_tupled (v, v1).
-     case v of [] => case v1 of [] => True | _ => True
-     | v4 # v5 =>
-         case v1 of [] => False
-         | v10 # v11 =>
-             v4 = True & v10 = False |
-             v4 = v10 & alg_order_tupled (v5, v11))"
-  by (import prob_canon alg_order_tupled_primitive_def)
-
-consts
-  alg_order :: "bool list => bool list => bool" 
-
-defs
-  alg_order_primdef: "alg_order == %x x1. alg_order_tupled (x, x1)"
-
-lemma alg_order_curried_def: "alg_order x x1 = alg_order_tupled (x, x1)"
-  by (import prob_canon alg_order_curried_def)
-
-lemma alg_order_ind: "(ALL (x::bool) xa::bool list.
-    (P::bool list => bool list => bool) [] (x # xa)) &
-P [] [] &
-(ALL (x::bool) xa::bool list. P (x # xa) []) &
-(ALL (x::bool) (xa::bool list) (xb::bool) xc::bool list.
-    P xa xc --> P (x # xa) (xb # xc))
-==> P (x::bool list) (xa::bool list)"
-  by (import prob_canon alg_order_ind)
-
-lemma alg_order_def: "alg_order [] (v6 # v7) = True &
-alg_order [] [] = True &
-alg_order (v2 # v3) [] = False &
-alg_order (h # t) (h' # t') =
-(h = True & h' = False | h = h' & alg_order t t')"
-  by (import prob_canon alg_order_def)
-
-consts
-  alg_sorted :: "bool list list => bool" 
-
-defs
-  alg_sorted_primdef: "alg_sorted ==
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_sorted.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. alg_order v2 v6 & alg_sorted (v6 # v7))))"
-
-lemma alg_sorted_primitive_def: "alg_sorted =
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_sorted.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. alg_order v2 v6 & alg_sorted (v6 # v7))))"
-  by (import prob_canon alg_sorted_primitive_def)
-
-lemma alg_sorted_ind: "(ALL (x::bool list) (y::bool list) z::bool list list.
-    (P::bool list list => bool) (y # z) --> P (x # y # z)) &
-(ALL v::bool list. P [v]) & P []
-==> P (x::bool list list)"
-  by (import prob_canon alg_sorted_ind)
-
-lemma alg_sorted_def: "alg_sorted (x # y # z) = (alg_order x y & alg_sorted (y # z)) &
-alg_sorted [v] = True & alg_sorted [] = True"
-  by (import prob_canon alg_sorted_def)
-
-consts
-  alg_prefixfree :: "bool list list => bool" 
-
-defs
-  alg_prefixfree_primdef: "alg_prefixfree ==
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_prefixfree.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. ~ IS_PREFIX v6 v2 & alg_prefixfree (v6 # v7))))"
-
-lemma alg_prefixfree_primitive_def: "alg_prefixfree =
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_prefixfree.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. ~ IS_PREFIX v6 v2 & alg_prefixfree (v6 # v7))))"
-  by (import prob_canon alg_prefixfree_primitive_def)
-
-lemma alg_prefixfree_ind: "(ALL (x::bool list) (y::bool list) z::bool list list.
-    (P::bool list list => bool) (y # z) --> P (x # y # z)) &
-(ALL v::bool list. P [v]) & P []
-==> P (x::bool list list)"
-  by (import prob_canon alg_prefixfree_ind)
-
-lemma alg_prefixfree_def: "alg_prefixfree (x # y # z) = (~ IS_PREFIX y x & alg_prefixfree (y # z)) &
-alg_prefixfree [v] = True & alg_prefixfree [] = True"
-  by (import prob_canon alg_prefixfree_def)
-
-consts
-  alg_twinfree :: "bool list list => bool" 
-
-defs
-  alg_twinfree_primdef: "alg_twinfree ==
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_twinfree.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. ~ alg_twin v2 v6 & alg_twinfree (v6 # v7))))"
-
-lemma alg_twinfree_primitive_def: "alg_twinfree =
-WFREC (SOME R. WF R & (ALL x z y. R (y # z) (x # y # z)))
- (%alg_twinfree.
-     list_case True
-      (%v2. list_case True
-             (%v6 v7. ~ alg_twin v2 v6 & alg_twinfree (v6 # v7))))"
-  by (import prob_canon alg_twinfree_primitive_def)
-
-lemma alg_twinfree_ind: "(ALL (x::bool list) (y::bool list) z::bool list list.
-    (P::bool list list => bool) (y # z) --> P (x # y # z)) &
-(ALL v::bool list. P [v]) & P []
-==> P (x::bool list list)"
-  by (import prob_canon alg_twinfree_ind)
-
-lemma alg_twinfree_def: "alg_twinfree (x # y # z) = (~ alg_twin x y & alg_twinfree (y # z)) &
-alg_twinfree [v] = True & alg_twinfree [] = True"
-  by (import prob_canon alg_twinfree_def)
-
-consts
-  alg_longest :: "bool list list => nat" 
-
-defs
-  alg_longest_primdef: "alg_longest == FOLDR (%h t. if t <= length h then length h else t) 0"
-
-lemma alg_longest_def: "alg_longest = FOLDR (%h t. if t <= length h then length h else t) 0"
-  by (import prob_canon alg_longest_def)
-
-consts
-  alg_canon_prefs :: "bool list => bool list list => bool list list" 
-
-specification (alg_canon_prefs_primdef: alg_canon_prefs) alg_canon_prefs_def: "(ALL l. alg_canon_prefs l [] = [l]) &
-(ALL l h t.
-    alg_canon_prefs l (h # t) =
-    (if IS_PREFIX h l then alg_canon_prefs l t else l # h # t))"
-  by (import prob_canon alg_canon_prefs_def)
-
-consts
-  alg_canon_find :: "bool list => bool list list => bool list list" 
-
-specification (alg_canon_find_primdef: alg_canon_find) alg_canon_find_def: "(ALL l. alg_canon_find l [] = [l]) &
-(ALL l h t.
-    alg_canon_find l (h # t) =
-    (if alg_order h l
-     then if IS_PREFIX l h then h # t else h # alg_canon_find l t
-     else alg_canon_prefs l (h # t)))"
-  by (import prob_canon alg_canon_find_def)
-
-consts
-  alg_canon1 :: "bool list list => bool list list" 
-
-defs
-  alg_canon1_primdef: "alg_canon1 == FOLDR alg_canon_find []"
-
-lemma alg_canon1_def: "alg_canon1 = FOLDR alg_canon_find []"
-  by (import prob_canon alg_canon1_def)
-
-consts
-  alg_canon_merge :: "bool list => bool list list => bool list list" 
-
-specification (alg_canon_merge_primdef: alg_canon_merge) alg_canon_merge_def: "(ALL l. alg_canon_merge l [] = [l]) &
-(ALL l h t.
-    alg_canon_merge l (h # t) =
-    (if alg_twin l h then alg_canon_merge (butlast h) t else l # h # t))"
-  by (import prob_canon alg_canon_merge_def)
-
-consts
-  alg_canon2 :: "bool list list => bool list list" 
-
-defs
-  alg_canon2_primdef: "alg_canon2 == FOLDR alg_canon_merge []"
-
-lemma alg_canon2_def: "alg_canon2 = FOLDR alg_canon_merge []"
-  by (import prob_canon alg_canon2_def)
-
-consts
-  alg_canon :: "bool list list => bool list list" 
-
-defs
-  alg_canon_primdef: "alg_canon == %l. alg_canon2 (alg_canon1 l)"
-
-lemma alg_canon_def: "alg_canon l = alg_canon2 (alg_canon1 l)"
-  by (import prob_canon alg_canon_def)
-
-consts
-  algebra_canon :: "bool list list => bool" 
-
-defs
-  algebra_canon_primdef: "algebra_canon == %l. alg_canon l = l"
-
-lemma algebra_canon_def: "algebra_canon l = (alg_canon l = l)"
-  by (import prob_canon algebra_canon_def)
-
-lemma ALG_TWIN_NIL: "~ alg_twin l [] & ~ alg_twin [] l"
-  by (import prob_canon ALG_TWIN_NIL)
-
-lemma ALG_TWIN_SING: "alg_twin [x] l = (x = True & l = [False]) &
-alg_twin l [x] = (l = [True] & x = False)"
-  by (import prob_canon ALG_TWIN_SING)
-
-lemma ALG_TWIN_CONS: "alg_twin (x # y # z) (h # t) = (x = h & alg_twin (y # z) t) &
-alg_twin (h # t) (x # y # z) = (x = h & alg_twin t (y # z))"
-  by (import prob_canon ALG_TWIN_CONS)
-
-lemma ALG_TWIN_REDUCE: "alg_twin (h # t) (h # t') = alg_twin t t'"
-  by (import prob_canon ALG_TWIN_REDUCE)
-
-lemma ALG_TWINS_PREFIX: "IS_PREFIX x l
-==> x = l | IS_PREFIX x (SNOC True l) | IS_PREFIX x (SNOC False l)"
-  by (import prob_canon ALG_TWINS_PREFIX)
-
-lemma ALG_ORDER_NIL: "alg_order [] x & alg_order x [] = (x = [])"
-  by (import prob_canon ALG_ORDER_NIL)
-
-lemma ALG_ORDER_REFL: "alg_order x x"
-  by (import prob_canon ALG_ORDER_REFL)
-
-lemma ALG_ORDER_ANTISYM: "alg_order x y & alg_order y x ==> x = y"
-  by (import prob_canon ALG_ORDER_ANTISYM)
-
-lemma ALG_ORDER_TRANS: "alg_order x y & alg_order y z ==> alg_order x z"
-  by (import prob_canon ALG_ORDER_TRANS)
-
-lemma ALG_ORDER_TOTAL: "alg_order x y | alg_order y x"
-  by (import prob_canon ALG_ORDER_TOTAL)
-
-lemma ALG_ORDER_PREFIX: "IS_PREFIX y x ==> alg_order x y"
-  by (import prob_canon ALG_ORDER_PREFIX)
-
-lemma ALG_ORDER_PREFIX_ANTI: "alg_order x y & IS_PREFIX x y ==> x = y"
-  by (import prob_canon ALG_ORDER_PREFIX_ANTI)
-
-lemma ALG_ORDER_PREFIX_MONO: "alg_order x y & alg_order y z & IS_PREFIX z x ==> IS_PREFIX y x"
-  by (import prob_canon ALG_ORDER_PREFIX_MONO)
-
-lemma ALG_ORDER_PREFIX_TRANS: "alg_order x y & IS_PREFIX y z ==> alg_order x z | IS_PREFIX x z"
-  by (import prob_canon ALG_ORDER_PREFIX_TRANS)
-
-lemma ALG_ORDER_SNOC: "~ alg_order (SNOC x l) l"
-  by (import prob_canon ALG_ORDER_SNOC)
-
-lemma ALG_SORTED_MIN: "[| alg_sorted (h # t); List.member t x |] ==> alg_order h x"
-  by (import prob_canon ALG_SORTED_MIN)
-
-lemma ALG_SORTED_DEF_ALT: "alg_sorted (h # t) =
-((ALL x. List.member t x --> alg_order h x) & alg_sorted t)"
-  by (import prob_canon ALG_SORTED_DEF_ALT)
-
-lemma ALG_SORTED_TL: "alg_sorted (h # t) ==> alg_sorted t"
-  by (import prob_canon ALG_SORTED_TL)
-
-lemma ALG_SORTED_MONO: "alg_sorted (x # y # z) ==> alg_sorted (x # z)"
-  by (import prob_canon ALG_SORTED_MONO)
-
-lemma ALG_SORTED_TLS: "alg_sorted (map (op # b) l) = alg_sorted l"
-  by (import prob_canon ALG_SORTED_TLS)
-
-lemma ALG_SORTED_STEP: "alg_sorted (map (op # True) l1 @ map (op # False) l2) =
-(alg_sorted l1 & alg_sorted l2)"
-  by (import prob_canon ALG_SORTED_STEP)
-
-lemma ALG_SORTED_APPEND: "alg_sorted ((h # t) @ h' # t') =
-(alg_sorted (h # t) & alg_sorted (h' # t') & alg_order (last (h # t)) h')"
-  by (import prob_canon ALG_SORTED_APPEND)
-
-lemma ALG_SORTED_FILTER: "alg_sorted b ==> alg_sorted (filter P b)"
-  by (import prob_canon ALG_SORTED_FILTER)
-
-lemma ALG_PREFIXFREE_TL: "alg_prefixfree (h # t) ==> alg_prefixfree t"
-  by (import prob_canon ALG_PREFIXFREE_TL)
-
-lemma ALG_PREFIXFREE_MONO: "alg_sorted (x # y # z) & alg_prefixfree (x # y # z)
-==> alg_prefixfree (x # z)"
-  by (import prob_canon ALG_PREFIXFREE_MONO)
-
-lemma ALG_PREFIXFREE_ELT: "[| alg_sorted (h # t) & alg_prefixfree (h # t); List.member t x |]
-==> ~ IS_PREFIX x h & ~ IS_PREFIX h x"
-  by (import prob_canon ALG_PREFIXFREE_ELT)
-
-lemma ALG_PREFIXFREE_TLS: "alg_prefixfree (map (op # b) l) = alg_prefixfree l"
-  by (import prob_canon ALG_PREFIXFREE_TLS)
-
-lemma ALG_PREFIXFREE_STEP: "alg_prefixfree (map (op # True) l1 @ map (op # False) l2) =
-(alg_prefixfree l1 & alg_prefixfree l2)"
-  by (import prob_canon ALG_PREFIXFREE_STEP)
-
-lemma ALG_PREFIXFREE_APPEND: "alg_prefixfree ((h # t) @ h' # t') =
-(alg_prefixfree (h # t) &
- alg_prefixfree (h' # t') & ~ IS_PREFIX h' (last (h # t)))"
-  by (import prob_canon ALG_PREFIXFREE_APPEND)
-
-lemma ALG_PREFIXFREE_FILTER: "alg_sorted b & alg_prefixfree b ==> alg_prefixfree (filter P b)"
-  by (import prob_canon ALG_PREFIXFREE_FILTER)
-
-lemma ALG_TWINFREE_TL: "alg_twinfree (h # t) ==> alg_twinfree t"
-  by (import prob_canon ALG_TWINFREE_TL)
-
-lemma ALG_TWINFREE_TLS: "alg_twinfree (map (op # b) l) = alg_twinfree l"
-  by (import prob_canon ALG_TWINFREE_TLS)
-
-lemma ALG_TWINFREE_STEP1: "alg_twinfree (map (op # True) l1 @ map (op # False) l2)
-==> alg_twinfree l1 & alg_twinfree l2"
-  by (import prob_canon ALG_TWINFREE_STEP1)
-
-lemma ALG_TWINFREE_STEP2: "(~ List.member l1 [] | ~ List.member l2 []) &
-alg_twinfree l1 & alg_twinfree l2
-==> alg_twinfree (map (op # True) l1 @ map (op # False) l2)"
-  by (import prob_canon ALG_TWINFREE_STEP2)
-
-lemma ALG_TWINFREE_STEP: "~ List.member l1 [] | ~ List.member l2 []
-==> alg_twinfree (map (op # True) l1 @ map (op # False) l2) =
-    (alg_twinfree l1 & alg_twinfree l2)"
-  by (import prob_canon ALG_TWINFREE_STEP)
-
-lemma ALG_LONGEST_HD: "length h <= alg_longest (h # t)"
-  by (import prob_canon ALG_LONGEST_HD)
-
-lemma ALG_LONGEST_TL: "alg_longest t <= alg_longest (h # t)"
-  by (import prob_canon ALG_LONGEST_TL)
-
-lemma ALG_LONGEST_TLS: "alg_longest (map (op # b) (h # t)) = Suc (alg_longest (h # t))"
-  by (import prob_canon ALG_LONGEST_TLS)
-
-lemma ALG_LONGEST_APPEND: "alg_longest l1 <= alg_longest (l1 @ l2) &
-alg_longest l2 <= alg_longest (l1 @ l2)"
-  by (import prob_canon ALG_LONGEST_APPEND)
-
-lemma ALG_CANON_PREFS_HD: "hd (alg_canon_prefs l b) = l"
-  by (import prob_canon ALG_CANON_PREFS_HD)
-
-lemma ALG_CANON_PREFS_DELETES: "List.member (alg_canon_prefs l b) x ==> List.member (l # b) x"
-  by (import prob_canon ALG_CANON_PREFS_DELETES)
-
-lemma ALG_CANON_PREFS_SORTED: "alg_sorted (l # b) ==> alg_sorted (alg_canon_prefs l b)"
-  by (import prob_canon ALG_CANON_PREFS_SORTED)
-
-lemma ALG_CANON_PREFS_PREFIXFREE: "alg_sorted b & alg_prefixfree b ==> alg_prefixfree (alg_canon_prefs l b)"
-  by (import prob_canon ALG_CANON_PREFS_PREFIXFREE)
-
-lemma ALG_CANON_PREFS_CONSTANT: "alg_prefixfree (l # b) ==> alg_canon_prefs l b = l # b"
-  by (import prob_canon ALG_CANON_PREFS_CONSTANT)
-
-lemma ALG_CANON_FIND_HD: "hd (alg_canon_find l (h # t)) = l | hd (alg_canon_find l (h # t)) = h"
-  by (import prob_canon ALG_CANON_FIND_HD)
-
-lemma ALG_CANON_FIND_DELETES: "List.member (alg_canon_find l b) x ==> List.member (l # b) x"
-  by (import prob_canon ALG_CANON_FIND_DELETES)
-
-lemma ALG_CANON_FIND_SORTED: "alg_sorted b ==> alg_sorted (alg_canon_find l b)"
-  by (import prob_canon ALG_CANON_FIND_SORTED)
-
-lemma ALG_CANON_FIND_PREFIXFREE: "alg_sorted b & alg_prefixfree b ==> alg_prefixfree (alg_canon_find l b)"
-  by (import prob_canon ALG_CANON_FIND_PREFIXFREE)
-
-lemma ALG_CANON_FIND_CONSTANT: "alg_sorted (l # b) & alg_prefixfree (l # b) ==> alg_canon_find l b = l # b"
-  by (import prob_canon ALG_CANON_FIND_CONSTANT)
-
-lemma ALG_CANON1_SORTED: "alg_sorted (alg_canon1 x)"
-  by (import prob_canon ALG_CANON1_SORTED)
-
-lemma ALG_CANON1_PREFIXFREE: "alg_prefixfree (alg_canon1 l)"
-  by (import prob_canon ALG_CANON1_PREFIXFREE)
-
-lemma ALG_CANON1_CONSTANT: "alg_sorted l & alg_prefixfree l ==> alg_canon1 l = l"
-  by (import prob_canon ALG_CANON1_CONSTANT)
-
-lemma ALG_CANON_MERGE_SORTED_PREFIXFREE_TWINFREE: "alg_sorted (l # b) & alg_prefixfree (l # b) & alg_twinfree b
-==> alg_sorted (alg_canon_merge l b) &
-    alg_prefixfree (alg_canon_merge l b) &
-    alg_twinfree (alg_canon_merge l b)"
-  by (import prob_canon ALG_CANON_MERGE_SORTED_PREFIXFREE_TWINFREE)
-
-lemma ALG_CANON_MERGE_PREFIXFREE_PRESERVE: "[| !!x. List.member (l # b) x ==> ~ IS_PREFIX h x & ~ IS_PREFIX x h;
-   List.member (alg_canon_merge l b) x |]
-==> ~ IS_PREFIX h x & ~ IS_PREFIX x h"
-  by (import prob_canon ALG_CANON_MERGE_PREFIXFREE_PRESERVE)
-
-lemma ALG_CANON_MERGE_SHORTENS: "List.member (alg_canon_merge l b) x
-==> EX y. List.member (l # b) y & IS_PREFIX y x"
-  by (import prob_canon ALG_CANON_MERGE_SHORTENS)
-
-lemma ALG_CANON_MERGE_CONSTANT: "alg_twinfree (l # b) ==> alg_canon_merge l b = l # b"
-  by (import prob_canon ALG_CANON_MERGE_CONSTANT)
-
-lemma ALG_CANON2_PREFIXFREE_PRESERVE: "[| !!xb. List.member x xb ==> ~ IS_PREFIX xa xb & ~ IS_PREFIX xb xa;
-   List.member (alg_canon2 x) xb |]
-==> ~ IS_PREFIX xa xb & ~ IS_PREFIX xb xa"
-  by (import prob_canon ALG_CANON2_PREFIXFREE_PRESERVE)
-
-lemma ALG_CANON2_SHORTENS: "List.member (alg_canon2 x) xa ==> EX y. List.member x y & IS_PREFIX y xa"
-  by (import prob_canon ALG_CANON2_SHORTENS)
-
-lemma ALG_CANON2_SORTED_PREFIXFREE_TWINFREE: "alg_sorted x & alg_prefixfree x
-==> alg_sorted (alg_canon2 x) &
-    alg_prefixfree (alg_canon2 x) & alg_twinfree (alg_canon2 x)"
-  by (import prob_canon ALG_CANON2_SORTED_PREFIXFREE_TWINFREE)
-
-lemma ALG_CANON2_CONSTANT: "alg_twinfree l ==> alg_canon2 l = l"
-  by (import prob_canon ALG_CANON2_CONSTANT)
-
-lemma ALG_CANON_SORTED_PREFIXFREE_TWINFREE: "alg_sorted (alg_canon l) &
-alg_prefixfree (alg_canon l) & alg_twinfree (alg_canon l)"
-  by (import prob_canon ALG_CANON_SORTED_PREFIXFREE_TWINFREE)
-
-lemma ALG_CANON_CONSTANT: "alg_sorted l & alg_prefixfree l & alg_twinfree l ==> alg_canon l = l"
-  by (import prob_canon ALG_CANON_CONSTANT)
-
-lemma ALG_CANON_IDEMPOT: "alg_canon (alg_canon l) = alg_canon l"
-  by (import prob_canon ALG_CANON_IDEMPOT)
-
-lemma ALGEBRA_CANON_DEF_ALT: "algebra_canon l = (alg_sorted l & alg_prefixfree l & alg_twinfree l)"
-  by (import prob_canon ALGEBRA_CANON_DEF_ALT)
-
-lemma ALGEBRA_CANON_BASIC: "algebra_canon [] & algebra_canon [[]] & (ALL x. algebra_canon [x])"
-  by (import prob_canon ALGEBRA_CANON_BASIC)
-
-lemma ALG_CANON_BASIC: "alg_canon [] = [] & alg_canon [[]] = [[]] & (ALL x. alg_canon [x] = [x])"
-  by (import prob_canon ALG_CANON_BASIC)
-
-lemma ALGEBRA_CANON_TL: "algebra_canon (h # t) ==> algebra_canon t"
-  by (import prob_canon ALGEBRA_CANON_TL)
-
-lemma ALGEBRA_CANON_NIL_MEM: "(algebra_canon l & List.member l []) = (l = [[]])"
-  by (import prob_canon ALGEBRA_CANON_NIL_MEM)
-
-lemma ALGEBRA_CANON_TLS: "algebra_canon (map (op # b) l) = algebra_canon l"
-  by (import prob_canon ALGEBRA_CANON_TLS)
-
-lemma ALGEBRA_CANON_STEP1: "algebra_canon (map (op # True) l1 @ map (op # False) l2)
-==> algebra_canon l1 & algebra_canon l2"
-  by (import prob_canon ALGEBRA_CANON_STEP1)
-
-lemma ALGEBRA_CANON_STEP2: "(l1 ~= [[]] | l2 ~= [[]]) & algebra_canon l1 & algebra_canon l2
-==> algebra_canon (map (op # True) l1 @ map (op # False) l2)"
-  by (import prob_canon ALGEBRA_CANON_STEP2)
-
-lemma ALGEBRA_CANON_STEP: "l1 ~= [[]] | l2 ~= [[]]
-==> algebra_canon (map (op # True) l1 @ map (op # False) l2) =
-    (algebra_canon l1 & algebra_canon l2)"
-  by (import prob_canon ALGEBRA_CANON_STEP)
-
-lemma ALGEBRA_CANON_CASES_THM: "algebra_canon l
-==> l = [] |
-    l = [[]] |
-    (EX l1 l2.
-        algebra_canon l1 &
-        algebra_canon l2 & l = map (op # True) l1 @ map (op # False) l2)"
-  by (import prob_canon ALGEBRA_CANON_CASES_THM)
-
-lemma ALGEBRA_CANON_CASES: "[| P [] &
-   P [[]] &
-   (ALL l1 l2.
-       algebra_canon l1 &
-       algebra_canon l2 &
-       algebra_canon (map (op # True) l1 @ map (op # False) l2) -->
-       P (map (op # True) l1 @ map (op # False) l2));
-   algebra_canon l |]
-==> P l"
-  by (import prob_canon ALGEBRA_CANON_CASES)
-
-lemma ALGEBRA_CANON_INDUCTION: "[| P [] &
-   P [[]] &
-   (ALL l1 l2.
-       algebra_canon l1 &
-       algebra_canon l2 &
-       P l1 &
-       P l2 & algebra_canon (map (op # True) l1 @ map (op # False) l2) -->
-       P (map (op # True) l1 @ map (op # False) l2));
-   algebra_canon l |]
-==> P l"
-  by (import prob_canon ALGEBRA_CANON_INDUCTION)
-
-lemma MEM_NIL_STEP: "~ List.member (map (op # True) l1 @ map (op # False) l2) []"
-  by (import prob_canon MEM_NIL_STEP)
-
-lemma ALG_SORTED_PREFIXFREE_MEM_NIL: "(alg_sorted l & alg_prefixfree l & List.member l []) = (l = [[]])"
-  by (import prob_canon ALG_SORTED_PREFIXFREE_MEM_NIL)
-
-lemma ALG_SORTED_PREFIXFREE_EQUALITY: "(ALL x. List.member l x = List.member l' x) &
-alg_sorted l & alg_sorted l' & alg_prefixfree l & alg_prefixfree l'
-==> l = l'"
-  by (import prob_canon ALG_SORTED_PREFIXFREE_EQUALITY)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" boolean_sequence
-
-consts
-  SHD :: "(nat => bool) => bool" 
-
-defs
-  SHD_primdef: "SHD == %f. f 0"
-
-lemma SHD_def: "SHD f = f 0"
-  by (import boolean_sequence SHD_def)
-
-consts
-  STL :: "(nat => bool) => nat => bool" 
-
-defs
-  STL_primdef: "STL == %f n. f (Suc n)"
-
-lemma STL_def: "STL f n = f (Suc n)"
-  by (import boolean_sequence STL_def)
-
-consts
-  SCONS :: "bool => (nat => bool) => nat => bool" 
-
-specification (SCONS_primdef: SCONS) SCONS_def: "(ALL h t. SCONS h t 0 = h) & (ALL h t n. SCONS h t (Suc n) = t n)"
-  by (import boolean_sequence SCONS_def)
-
-consts
-  SDEST :: "(nat => bool) => bool * (nat => bool)" 
-
-defs
-  SDEST_primdef: "SDEST == %s. (SHD s, STL s)"
-
-lemma SDEST_def: "SDEST = (%s. (SHD s, STL s))"
-  by (import boolean_sequence SDEST_def)
-
-consts
-  SCONST :: "bool => nat => bool" 
-
-defs
-  SCONST_primdef: "SCONST == K"
-
-lemma SCONST_def: "SCONST = K"
-  by (import boolean_sequence SCONST_def)
-
-consts
-  STAKE :: "nat => (nat => bool) => bool list" 
-
-specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s. STAKE 0 s = []) &
-(ALL n s. STAKE (Suc n) s = SHD s # STAKE n (STL s))"
-  by (import boolean_sequence STAKE_def)
-
-consts
-  SDROP :: "nat => (nat => bool) => nat => bool" 
-
-specification (SDROP_primdef: SDROP) SDROP_def: "SDROP 0 = I & (ALL n. SDROP (Suc n) = SDROP n o STL)"
-  by (import boolean_sequence SDROP_def)
-
-lemma SCONS_SURJ: "EX xa t. x = SCONS xa t"
-  by (import boolean_sequence SCONS_SURJ)
-
-lemma SHD_STL_ISO: "EX x. SHD x = h & STL x = t"
-  by (import boolean_sequence SHD_STL_ISO)
-
-lemma SHD_SCONS: "SHD (SCONS h t) = h"
-  by (import boolean_sequence SHD_SCONS)
-
-lemma STL_SCONS: "STL (SCONS h t) = t"
-  by (import boolean_sequence STL_SCONS)
-
-lemma SHD_SCONST: "SHD (SCONST b) = b"
-  by (import boolean_sequence SHD_SCONST)
-
-lemma STL_SCONST: "STL (SCONST b) = SCONST b"
-  by (import boolean_sequence STL_SCONST)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_algebra
-
-consts
-  alg_embed :: "bool list => (nat => bool) => bool" 
-
-specification (alg_embed_primdef: alg_embed) alg_embed_def: "(ALL s. alg_embed [] s = True) &
-(ALL h t s. alg_embed (h # t) s = (h = SHD s & alg_embed t (STL s)))"
-  by (import prob_algebra alg_embed_def)
-
-consts
-  algebra_embed :: "bool list list => (nat => bool) => bool" 
-
-specification (algebra_embed_primdef: algebra_embed) algebra_embed_def: "algebra_embed [] = EMPTY &
-(ALL h t.
-    algebra_embed (h # t) = pred_set.UNION (alg_embed h) (algebra_embed t))"
-  by (import prob_algebra algebra_embed_def)
-
-consts
-  measurable :: "((nat => bool) => bool) => bool" 
-
-defs
-  measurable_primdef: "measurable == %s. EX b. s = algebra_embed b"
-
-lemma measurable_def: "measurable s = (EX b. s = algebra_embed b)"
-  by (import prob_algebra measurable_def)
-
-lemma HALVES_INTER: "pred_set.INTER (%x. SHD x = True) (%x. SHD x = False) = EMPTY"
-  by (import prob_algebra HALVES_INTER)
-
-lemma INTER_STL: "pred_set.INTER p q o STL = pred_set.INTER (p o STL) (q o STL)"
-  by (import prob_algebra INTER_STL)
-
-lemma COMPL_SHD: "COMPL (%x. SHD x = b) = (%x. SHD x = (~ b))"
-  by (import prob_algebra COMPL_SHD)
-
-lemma ALG_EMBED_BASIC: "alg_embed [] = pred_set.UNIV &
-(ALL h t.
-    alg_embed (h # t) = pred_set.INTER (%x. SHD x = h) (alg_embed t o STL))"
-  by (import prob_algebra ALG_EMBED_BASIC)
-
-lemma ALG_EMBED_NIL: "All (alg_embed c) = (c = [])"
-  by (import prob_algebra ALG_EMBED_NIL)
-
-lemma ALG_EMBED_POPULATED: "Ex (alg_embed b)"
-  by (import prob_algebra ALG_EMBED_POPULATED)
-
-lemma ALG_EMBED_PREFIX: "alg_embed b s & alg_embed c s ==> IS_PREFIX b c | IS_PREFIX c b"
-  by (import prob_algebra ALG_EMBED_PREFIX)
-
-lemma ALG_EMBED_PREFIX_SUBSET: "SUBSET (alg_embed b) (alg_embed c) = IS_PREFIX b c"
-  by (import prob_algebra ALG_EMBED_PREFIX_SUBSET)
-
-lemma ALG_EMBED_TWINS: "pred_set.UNION (alg_embed (SNOC True l)) (alg_embed (SNOC False l)) =
-alg_embed l"
-  by (import prob_algebra ALG_EMBED_TWINS)
-
-lemma ALGEBRA_EMBED_BASIC: "algebra_embed [] = EMPTY &
-algebra_embed [[]] = pred_set.UNIV &
-(ALL b. algebra_embed [[b]] = (%s. SHD s = b))"
-  by (import prob_algebra ALGEBRA_EMBED_BASIC)
-
-lemma ALGEBRA_EMBED_MEM: "algebra_embed b x ==> EX l. List.member b l & alg_embed l x"
-  by (import prob_algebra ALGEBRA_EMBED_MEM)
-
-lemma ALGEBRA_EMBED_APPEND: "algebra_embed (l1 @ l2) =
-pred_set.UNION (algebra_embed l1) (algebra_embed l2)"
-  by (import prob_algebra ALGEBRA_EMBED_APPEND)
-
-lemma ALGEBRA_EMBED_TLS: "algebra_embed (map (op # b) l) (SCONS h t) = (h = b & algebra_embed l t)"
-  by (import prob_algebra ALGEBRA_EMBED_TLS)
-
-lemma ALG_CANON_PREFS_EMBED: "algebra_embed (alg_canon_prefs l b) = algebra_embed (l # b)"
-  by (import prob_algebra ALG_CANON_PREFS_EMBED)
-
-lemma ALG_CANON_FIND_EMBED: "algebra_embed (alg_canon_find l b) = algebra_embed (l # b)"
-  by (import prob_algebra ALG_CANON_FIND_EMBED)
-
-lemma ALG_CANON1_EMBED: "algebra_embed (alg_canon1 x) = algebra_embed x"
-  by (import prob_algebra ALG_CANON1_EMBED)
-
-lemma ALG_CANON_MERGE_EMBED: "algebra_embed (alg_canon_merge l b) = algebra_embed (l # b)"
-  by (import prob_algebra ALG_CANON_MERGE_EMBED)
-
-lemma ALG_CANON2_EMBED: "algebra_embed (alg_canon2 x) = algebra_embed x"
-  by (import prob_algebra ALG_CANON2_EMBED)
-
-lemma ALG_CANON_EMBED: "algebra_embed (alg_canon l) = algebra_embed l"
-  by (import prob_algebra ALG_CANON_EMBED)
-
-lemma ALGEBRA_CANON_UNIV: "[| algebra_canon l; algebra_embed l = pred_set.UNIV |] ==> l = [[]]"
-  by (import prob_algebra ALGEBRA_CANON_UNIV)
-
-lemma ALG_CANON_REP: "(alg_canon b = alg_canon c) = (algebra_embed b = algebra_embed c)"
-  by (import prob_algebra ALG_CANON_REP)
-
-lemma ALGEBRA_CANON_EMBED_EMPTY: "algebra_canon l ==> (ALL v. ~ algebra_embed l v) = (l = [])"
-  by (import prob_algebra ALGEBRA_CANON_EMBED_EMPTY)
-
-lemma ALGEBRA_CANON_EMBED_UNIV: "algebra_canon l ==> All (algebra_embed l) = (l = [[]])"
-  by (import prob_algebra ALGEBRA_CANON_EMBED_UNIV)
-
-lemma MEASURABLE_ALGEBRA: "measurable (algebra_embed b)"
-  by (import prob_algebra MEASURABLE_ALGEBRA)
-
-lemma MEASURABLE_BASIC: "measurable EMPTY &
-measurable pred_set.UNIV & (ALL b. measurable (%s. SHD s = b))"
-  by (import prob_algebra MEASURABLE_BASIC)
-
-lemma MEASURABLE_SHD: "measurable (%s. SHD s = b)"
-  by (import prob_algebra MEASURABLE_SHD)
-
-lemma ALGEBRA_EMBED_COMPL: "EX l'. COMPL (algebra_embed l) = algebra_embed l'"
-  by (import prob_algebra ALGEBRA_EMBED_COMPL)
-
-lemma MEASURABLE_COMPL: "measurable (COMPL s) = measurable s"
-  by (import prob_algebra MEASURABLE_COMPL)
-
-lemma MEASURABLE_UNION: "measurable s & measurable t ==> measurable (pred_set.UNION s t)"
-  by (import prob_algebra MEASURABLE_UNION)
-
-lemma MEASURABLE_INTER: "measurable s & measurable t ==> measurable (pred_set.INTER s t)"
-  by (import prob_algebra MEASURABLE_INTER)
-
-lemma MEASURABLE_STL: "measurable (p o STL) = measurable p"
-  by (import prob_algebra MEASURABLE_STL)
-
-lemma MEASURABLE_SDROP: "measurable (p o SDROP n) = measurable p"
-  by (import prob_algebra MEASURABLE_SDROP)
-
-lemma MEASURABLE_INTER_HALVES: "(measurable (pred_set.INTER (%x. SHD x = True) p) &
- measurable (pred_set.INTER (%x. SHD x = False) p)) =
-measurable p"
-  by (import prob_algebra MEASURABLE_INTER_HALVES)
-
-lemma MEASURABLE_HALVES: "measurable
- (pred_set.UNION (pred_set.INTER (%x. SHD x = True) p)
-   (pred_set.INTER (%x. SHD x = False) q)) =
-(measurable (pred_set.INTER (%x. SHD x = True) p) &
- measurable (pred_set.INTER (%x. SHD x = False) q))"
-  by (import prob_algebra MEASURABLE_HALVES)
-
-lemma MEASURABLE_INTER_SHD: "measurable (pred_set.INTER (%x. SHD x = b) (p o STL)) = measurable p"
-  by (import prob_algebra MEASURABLE_INTER_SHD)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob
-
-consts
-  alg_measure :: "bool list list => real" 
-
-specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = 0 &
-(ALL l rest. alg_measure (l # rest) = (1 / 2) ^ length l + alg_measure rest)"
-  by (import prob alg_measure_def)
-
-consts
-  algebra_measure :: "bool list list => real" 
-
-defs
-  algebra_measure_primdef: "algebra_measure ==
-%b. prob_extra.inf
-     (%r. EX c. algebra_embed b = algebra_embed c & alg_measure c = r)"
-
-lemma algebra_measure_def: "algebra_measure b =
-prob_extra.inf
- (%r. EX c. algebra_embed b = algebra_embed c & alg_measure c = r)"
-  by (import prob algebra_measure_def)
-
-consts
-  prob :: "((nat => bool) => bool) => real" 
-
-defs
-  prob_primdef: "prob ==
-%s. real.sup (%r. EX b. algebra_measure b = r & SUBSET (algebra_embed b) s)"
-
-lemma prob_def: "prob s =
-real.sup (%r. EX b. algebra_measure b = r & SUBSET (algebra_embed b) s)"
-  by (import prob prob_def)
-
-lemma ALG_TWINS_MEASURE: "((1::real) / (2::real)) ^ length (SNOC True (l::bool list)) +
-((1::real) / (2::real)) ^ length (SNOC False l) =
-((1::real) / (2::real)) ^ length l"
-  by (import prob ALG_TWINS_MEASURE)
-
-lemma ALG_MEASURE_BASIC: "alg_measure [] = 0 &
-alg_measure [[]] = 1 & (ALL b. alg_measure [[b]] = 1 / 2)"
-  by (import prob ALG_MEASURE_BASIC)
-
-lemma ALG_MEASURE_POS: "0 <= alg_measure l"
-  by (import prob ALG_MEASURE_POS)
-
-lemma ALG_MEASURE_APPEND: "alg_measure (l1 @ l2) = alg_measure l1 + alg_measure l2"
-  by (import prob ALG_MEASURE_APPEND)
-
-lemma ALG_MEASURE_TLS: "2 * alg_measure (map (op # b) l) = alg_measure l"
-  by (import prob ALG_MEASURE_TLS)
-
-lemma ALG_CANON_PREFS_MONO: "alg_measure (alg_canon_prefs l b) <= alg_measure (l # b)"
-  by (import prob ALG_CANON_PREFS_MONO)
-
-lemma ALG_CANON_FIND_MONO: "alg_measure (alg_canon_find l b) <= alg_measure (l # b)"
-  by (import prob ALG_CANON_FIND_MONO)
-
-lemma ALG_CANON1_MONO: "alg_measure (alg_canon1 x) <= alg_measure x"
-  by (import prob ALG_CANON1_MONO)
-
-lemma ALG_CANON_MERGE_MONO: "alg_measure (alg_canon_merge l b) <= alg_measure (l # b)"
-  by (import prob ALG_CANON_MERGE_MONO)
-
-lemma ALG_CANON2_MONO: "alg_measure (alg_canon2 x) <= alg_measure x"
-  by (import prob ALG_CANON2_MONO)
-
-lemma ALG_CANON_MONO: "alg_measure (alg_canon l) <= alg_measure l"
-  by (import prob ALG_CANON_MONO)
-
-lemma ALGEBRA_MEASURE_DEF_ALT: "algebra_measure l = alg_measure (alg_canon l)"
-  by (import prob ALGEBRA_MEASURE_DEF_ALT)
-
-lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = 0 &
-algebra_measure [[]] = 1 & (ALL b. algebra_measure [[b]] = 1 / 2)"
-  by (import prob ALGEBRA_MEASURE_BASIC)
-
-lemma ALGEBRA_CANON_MEASURE_MAX: "algebra_canon l ==> alg_measure l <= 1"
-  by (import prob ALGEBRA_CANON_MEASURE_MAX)
-
-lemma ALGEBRA_MEASURE_MAX: "algebra_measure l <= 1"
-  by (import prob ALGEBRA_MEASURE_MAX)
-
-lemma ALGEBRA_MEASURE_MONO_EMBED: "SUBSET (algebra_embed x) (algebra_embed xa)
-==> algebra_measure x <= algebra_measure xa"
-  by (import prob ALGEBRA_MEASURE_MONO_EMBED)
-
-lemma ALG_MEASURE_COMPL: "[| algebra_canon l; algebra_canon c;
-   COMPL (algebra_embed l) = algebra_embed c |]
-==> alg_measure l + alg_measure c = 1"
-  by (import prob ALG_MEASURE_COMPL)
-
-lemma ALG_MEASURE_ADDITIVE: "[| algebra_canon l; algebra_canon c; algebra_canon d;
-   pred_set.INTER (algebra_embed c) (algebra_embed d) = EMPTY &
-   algebra_embed l = pred_set.UNION (algebra_embed c) (algebra_embed d) |]
-==> alg_measure l = alg_measure c + alg_measure d"
-  by (import prob ALG_MEASURE_ADDITIVE)
-
-lemma PROB_ALGEBRA: "prob (algebra_embed l) = algebra_measure l"
-  by (import prob PROB_ALGEBRA)
-
-lemma PROB_BASIC: "prob EMPTY = 0 &
-prob pred_set.UNIV = 1 & (ALL b. prob (%s. SHD s = b) = 1 / 2)"
-  by (import prob PROB_BASIC)
-
-lemma PROB_ADDITIVE: "measurable s & measurable t & pred_set.INTER s t = EMPTY
-==> prob (pred_set.UNION s t) = prob s + prob t"
-  by (import prob PROB_ADDITIVE)
-
-lemma PROB_COMPL: "measurable s ==> prob (COMPL s) = 1 - prob s"
-  by (import prob PROB_COMPL)
-
-lemma PROB_SUP_EXISTS1: "EX x b. algebra_measure b = x & SUBSET (algebra_embed b) s"
-  by (import prob PROB_SUP_EXISTS1)
-
-lemma PROB_SUP_EXISTS2: "EX x. ALL r.
-         (EX b. algebra_measure b = r & SUBSET (algebra_embed b) s) -->
-         r <= x"
-  by (import prob PROB_SUP_EXISTS2)
-
-lemma PROB_LE_X: "(!!s'. measurable s' & SUBSET s' s ==> prob s' <= x) ==> prob s <= x"
-  by (import prob PROB_LE_X)
-
-lemma X_LE_PROB: "EX s'. measurable s' & SUBSET s' s & x <= prob s' ==> x <= prob s"
-  by (import prob X_LE_PROB)
-
-lemma PROB_SUBSET_MONO: "SUBSET s t ==> prob s <= prob t"
-  by (import prob PROB_SUBSET_MONO)
-
-lemma PROB_ALG: "prob (alg_embed x) = (1 / 2) ^ length x"
-  by (import prob PROB_ALG)
-
-lemma PROB_STL: "measurable p ==> prob (p o STL) = prob p"
-  by (import prob PROB_STL)
-
-lemma PROB_SDROP: "measurable p ==> prob (p o SDROP n) = prob p"
-  by (import prob PROB_SDROP)
-
-lemma PROB_INTER_HALVES: "measurable p
-==> prob (pred_set.INTER (%x. SHD x = True) p) +
-    prob (pred_set.INTER (%x. SHD x = False) p) =
-    prob p"
-  by (import prob PROB_INTER_HALVES)
-
-lemma PROB_INTER_SHD: "measurable p
-==> prob (pred_set.INTER (%x. SHD x = b) (p o STL)) = 1 / 2 * prob p"
-  by (import prob PROB_INTER_SHD)
-
-lemma ALGEBRA_MEASURE_POS: "0 <= algebra_measure l"
-  by (import prob ALGEBRA_MEASURE_POS)
-
-lemma ALGEBRA_MEASURE_RANGE: "0 <= algebra_measure l & algebra_measure l <= 1"
-  by (import prob ALGEBRA_MEASURE_RANGE)
-
-lemma PROB_POS: "0 <= prob p"
-  by (import prob PROB_POS)
-
-lemma PROB_MAX: "prob p <= 1"
-  by (import prob PROB_MAX)
-
-lemma PROB_RANGE: "0 <= prob p & prob p <= 1"
-  by (import prob PROB_RANGE)
-
-lemma ABS_PROB: "abs (prob p) = prob p"
-  by (import prob ABS_PROB)
-
-lemma PROB_SHD: "prob (%s. SHD s = b) = 1 / 2"
-  by (import prob PROB_SHD)
-
-lemma PROB_COMPL_LE1: "measurable p ==> (prob (COMPL p) <= r) = (1 - r <= prob p)"
-  by (import prob PROB_COMPL_LE1)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_pseudo
-
-consts
-  pseudo_linear_hd :: "nat => bool" 
-
-defs
-  pseudo_linear_hd_primdef: "pseudo_linear_hd == EVEN"
-
-lemma pseudo_linear_hd_def: "pseudo_linear_hd = EVEN"
-  by (import prob_pseudo pseudo_linear_hd_def)
-
-consts
-  pseudo_linear_tl :: "nat => nat => nat => nat => nat" 
-
-defs
-  pseudo_linear_tl_primdef: "pseudo_linear_tl == %a b n x. (a * x + b) mod (2 * n + 1)"
-
-lemma pseudo_linear_tl_def: "pseudo_linear_tl a b n x = (a * x + b) mod (2 * n + 1)"
-  by (import prob_pseudo pseudo_linear_tl_def)
-
-lemma PSEUDO_LINEAR1_EXECUTE: "EX x. (ALL xa. SHD (x xa) = pseudo_linear_hd xa) &
-      (ALL xa.
-          STL (x xa) =
-          x (pseudo_linear_tl
-              (NUMERAL
-                (NUMERAL_BIT1
-                  (NUMERAL_BIT1
-                    (NUMERAL_BIT1
-                      (NUMERAL_BIT2
-                        (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
-              (NUMERAL
-                (NUMERAL_BIT1
-                  (NUMERAL_BIT1
-                    (NUMERAL_BIT1
-                      (NUMERAL_BIT1
-                        (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
-              (NUMERAL
-                (NUMERAL_BIT1
-                  (NUMERAL_BIT1
-                    (NUMERAL_BIT1
-                      (NUMERAL_BIT1
-                        (NUMERAL_BIT2 (NUMERAL_BIT1 ALT_ZERO)))))))
-              xa))"
-  by (import prob_pseudo PSEUDO_LINEAR1_EXECUTE)
-
-consts
-  pseudo_linear1 :: "nat => nat => bool" 
-
-specification (pseudo_linear1_primdef: pseudo_linear1) pseudo_linear1_def: "(ALL x. SHD (pseudo_linear1 x) = pseudo_linear_hd x) &
-(ALL x.
-    STL (pseudo_linear1 x) =
-    pseudo_linear1
-     (pseudo_linear_tl
-       (NUMERAL
-         (NUMERAL_BIT1
-           (NUMERAL_BIT1
-             (NUMERAL_BIT1
-               (NUMERAL_BIT2 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
-       (NUMERAL
-         (NUMERAL_BIT1
-           (NUMERAL_BIT1
-             (NUMERAL_BIT1
-               (NUMERAL_BIT1 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
-       (NUMERAL
-         (NUMERAL_BIT1
-           (NUMERAL_BIT1
-             (NUMERAL_BIT1
-               (NUMERAL_BIT1 (NUMERAL_BIT2 (NUMERAL_BIT1 ALT_ZERO)))))))
-       x))"
-  by (import prob_pseudo pseudo_linear1_def)
-
-consts
-  pseudo :: "nat => nat => bool" 
-
-defs
-  pseudo_primdef: "pseudo == pseudo_linear1"
-
-lemma pseudo_def: "pseudo = pseudo_linear1"
-  by (import prob_pseudo pseudo_def)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_indep
-
-consts
-  indep_set :: "((nat => bool) => bool) => ((nat => bool) => bool) => bool" 
-
-defs
-  indep_set_primdef: "indep_set ==
-%p q. measurable p &
-      measurable q & prob (pred_set.INTER p q) = prob p * prob q"
-
-lemma indep_set_def: "indep_set p q =
-(measurable p & measurable q & prob (pred_set.INTER p q) = prob p * prob q)"
-  by (import prob_indep indep_set_def)
-
-consts
-  alg_cover_set :: "bool list list => bool" 
-
-defs
-  alg_cover_set_primdef: "alg_cover_set ==
-%l. alg_sorted l & alg_prefixfree l & algebra_embed l = pred_set.UNIV"
-
-lemma alg_cover_set_def: "alg_cover_set l =
-(alg_sorted l & alg_prefixfree l & algebra_embed l = pred_set.UNIV)"
-  by (import prob_indep alg_cover_set_def)
-
-consts
-  alg_cover :: "bool list list => (nat => bool) => bool list" 
-
-defs
-  alg_cover_primdef: "alg_cover == %l x. SOME b. List.member l b & alg_embed b x"
-
-lemma alg_cover_def: "alg_cover l x = (SOME b. List.member l b & alg_embed b x)"
-  by (import prob_indep alg_cover_def)
-
-consts
-  indep :: "((nat => bool) => 'a * (nat => bool)) => bool" 
-
-defs
-  indep_primdef: "indep ==
-%f. EX l r.
-       alg_cover_set l &
-       (ALL s. f s = (let c = alg_cover l s in (r c, SDROP (length c) s)))"
-
-lemma indep_def: "indep f =
-(EX l r.
-    alg_cover_set l &
-    (ALL s. f s = (let c = alg_cover l s in (r c, SDROP (length c) s))))"
-  by (import prob_indep indep_def)
-
-lemma INDEP_SET_BASIC: "measurable p ==> indep_set EMPTY p & indep_set pred_set.UNIV p"
-  by (import prob_indep INDEP_SET_BASIC)
-
-lemma INDEP_SET_SYM: "indep_set p q = indep_set p q"
-  by (import prob_indep INDEP_SET_SYM)
-
-lemma INDEP_SET_DISJOINT_DECOMP: "indep_set p r & indep_set q r & pred_set.INTER p q = EMPTY
-==> indep_set (pred_set.UNION p q) r"
-  by (import prob_indep INDEP_SET_DISJOINT_DECOMP)
-
-lemma ALG_COVER_SET_BASIC: "~ alg_cover_set [] & alg_cover_set [[]] & alg_cover_set [[True], [False]]"
-  by (import prob_indep ALG_COVER_SET_BASIC)
-
-lemma ALG_COVER_WELL_DEFINED: "alg_cover_set l
-==> List.member l (alg_cover l x) & alg_embed (alg_cover l x) x"
-  by (import prob_indep ALG_COVER_WELL_DEFINED)
-
-lemma ALG_COVER_UNIV: "alg_cover [[]] = K []"
-  by (import prob_indep ALG_COVER_UNIV)
-
-lemma MAP_CONS_TL_FILTER: "~ List.member (l::bool list list) []
-==> map (op # (b::bool)) (map tl [x::bool list<-l. hd x = b]) =
-    [x::bool list<-l. hd x = b]"
-  by (import prob_indep MAP_CONS_TL_FILTER)
-
-lemma ALG_COVER_SET_CASES_THM: "alg_cover_set l =
-(l = [[]] |
- (EX x xa.
-     alg_cover_set x &
-     alg_cover_set xa & l = map (op # True) x @ map (op # False) xa))"
-  by (import prob_indep ALG_COVER_SET_CASES_THM)
-
-lemma ALG_COVER_SET_CASES: "[| P [[]] &
-   (ALL l1 l2.
-       alg_cover_set l1 &
-       alg_cover_set l2 &
-       alg_cover_set (map (op # True) l1 @ map (op # False) l2) -->
-       P (map (op # True) l1 @ map (op # False) l2));
-   alg_cover_set l |]
-==> P l"
-  by (import prob_indep ALG_COVER_SET_CASES)
-
-lemma ALG_COVER_SET_INDUCTION: "[| P [[]] &
-   (ALL l1 l2.
-       alg_cover_set l1 &
-       alg_cover_set l2 &
-       P l1 &
-       P l2 & alg_cover_set (map (op # True) l1 @ map (op # False) l2) -->
-       P (map (op # True) l1 @ map (op # False) l2));
-   alg_cover_set l |]
-==> P l"
-  by (import prob_indep ALG_COVER_SET_INDUCTION)
-
-lemma ALG_COVER_EXISTS_UNIQUE: "alg_cover_set l ==> EX! x. List.member l x & alg_embed x s"
-  by (import prob_indep ALG_COVER_EXISTS_UNIQUE)
-
-lemma ALG_COVER_UNIQUE: "alg_cover_set l & List.member l x & alg_embed x s ==> alg_cover l s = x"
-  by (import prob_indep ALG_COVER_UNIQUE)
-
-lemma ALG_COVER_STEP: "alg_cover_set l1 & alg_cover_set l2
-==> alg_cover (map (op # True) l1 @ map (op # False) l2) (SCONS h t) =
-    (if h then True # alg_cover l1 t else False # alg_cover l2 t)"
-  by (import prob_indep ALG_COVER_STEP)
-
-lemma ALG_COVER_HEAD: "alg_cover_set l ==> f o alg_cover l = algebra_embed (filter f l)"
-  by (import prob_indep ALG_COVER_HEAD)
-
-lemma ALG_COVER_TAIL_STEP: "alg_cover_set l1 & alg_cover_set l2
-==> q o
-    (%x. SDROP
-          (length (alg_cover (map (op # True) l1 @ map (op # False) l2) x))
-          x) =
-    pred_set.UNION
-     (pred_set.INTER (%x. SHD x = True)
-       (q o ((%x. SDROP (length (alg_cover l1 x)) x) o STL)))
-     (pred_set.INTER (%x. SHD x = False)
-       (q o ((%x. SDROP (length (alg_cover l2 x)) x) o STL)))"
-  by (import prob_indep ALG_COVER_TAIL_STEP)
-
-lemma ALG_COVER_TAIL_MEASURABLE: "alg_cover_set l
-==> measurable (q o (%x. SDROP (length (alg_cover l x)) x)) = measurable q"
-  by (import prob_indep ALG_COVER_TAIL_MEASURABLE)
-
-lemma ALG_COVER_TAIL_PROB: "[| alg_cover_set l; measurable q |]
-==> prob (q o (%x. SDROP (length (alg_cover l x)) x)) = prob q"
-  by (import prob_indep ALG_COVER_TAIL_PROB)
-
-lemma INDEP_INDEP_SET_LEMMA: "[| alg_cover_set l; measurable q; List.member l x |]
-==> prob
-     (pred_set.INTER (alg_embed x)
-       (q o (%x. SDROP (length (alg_cover l x)) x))) =
-    (1 / 2) ^ length x * prob q"
-  by (import prob_indep INDEP_INDEP_SET_LEMMA)
-
-lemma INDEP_SET_LIST: "alg_sorted l &
-alg_prefixfree l &
-measurable q & (ALL x. List.member l x --> indep_set (alg_embed x) q)
-==> indep_set (algebra_embed l) q"
-  by (import prob_indep INDEP_SET_LIST)
-
-lemma INDEP_INDEP_SET: "indep f & measurable q ==> indep_set (p o (fst o f)) (q o (snd o f))"
-  by (import prob_indep INDEP_INDEP_SET)
-
-lemma INDEP_UNIT: "indep (UNIT x)"
-  by (import prob_indep INDEP_UNIT)
-
-lemma INDEP_SDEST: "indep SDEST"
-  by (import prob_indep INDEP_SDEST)
-
-lemma BIND_STEP: "BIND SDEST (%k. f o SCONS k) = f"
-  by (import prob_indep BIND_STEP)
-
-lemma INDEP_BIND_SDEST: "(!!x. indep (f x)) ==> indep (BIND SDEST f)"
-  by (import prob_indep INDEP_BIND_SDEST)
-
-lemma INDEP_BIND: "indep f & (ALL x. indep (g x)) ==> indep (BIND f g)"
-  by (import prob_indep INDEP_BIND)
-
-lemma INDEP_PROB: "indep f & measurable q
-==> prob (pred_set.INTER (p o (fst o f)) (q o (snd o f))) =
-    prob (p o (fst o f)) * prob q"
-  by (import prob_indep INDEP_PROB)
-
-lemma INDEP_MEASURABLE1: "indep f ==> measurable (p o (fst o f))"
-  by (import prob_indep INDEP_MEASURABLE1)
-
-lemma INDEP_MEASURABLE2: "indep f & measurable q ==> measurable (q o (snd o f))"
-  by (import prob_indep INDEP_MEASURABLE2)
-
-lemma PROB_INDEP_BOUND: "indep f
-==> prob (%s. fst (f s) < Suc n) =
-    prob (%s. fst (f s) < n) + prob (%s. fst (f s) = n)"
-  by (import prob_indep PROB_INDEP_BOUND)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" prob_uniform
-
-consts
-  unif_bound :: "nat => nat" 
-
-defs
-  unif_bound_primdef: "unif_bound ==
-WFREC (SOME R. WF R & (ALL v. R (Suc v div 2) (Suc v)))
- (%unif_bound. nat_case 0 (%v1. Suc (unif_bound (Suc v1 div 2))))"
-
-lemma unif_bound_primitive_def: "unif_bound =
-WFREC (SOME R. WF R & (ALL v. R (Suc v div 2) (Suc v)))
- (%unif_bound. nat_case 0 (%v1. Suc (unif_bound (Suc v1 div 2))))"
-  by (import prob_uniform unif_bound_primitive_def)
-
-lemma unif_bound_def: "unif_bound 0 = 0 & unif_bound (Suc v) = Suc (unif_bound (Suc v div 2))"
-  by (import prob_uniform unif_bound_def)
-
-lemma unif_bound_ind: "P 0 & (ALL v. P (Suc v div 2) --> P (Suc v)) ==> P x"
-  by (import prob_uniform unif_bound_ind)
-
-definition
-  unif_tupled :: "nat * (nat => bool) => nat * (nat => bool)"  where
-  "unif_tupled ==
-WFREC (SOME R. WF R & (ALL s v2. R (Suc v2 div 2, s) (Suc v2, s)))
- (%unif_tupled (v, v1).
-     case v of 0 => (0, v1)
-     | Suc v3 =>
-         let (m, s') = unif_tupled (Suc v3 div 2, v1)
-         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
-
-lemma unif_tupled_primitive_def: "unif_tupled =
-WFREC (SOME R. WF R & (ALL s v2. R (Suc v2 div 2, s) (Suc v2, s)))
- (%unif_tupled (v, v1).
-     case v of 0 => (0, v1)
-     | Suc v3 =>
-         let (m, s') = unif_tupled (Suc v3 div 2, v1)
-         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
-  by (import prob_uniform unif_tupled_primitive_def)
-
-consts
-  unif :: "nat => (nat => bool) => nat * (nat => bool)" 
-
-defs
-  unif_primdef: "unif == %x x1. unif_tupled (x, x1)"
-
-lemma unif_curried_def: "unif x x1 = unif_tupled (x, x1)"
-  by (import prob_uniform unif_curried_def)
-
-lemma unif_def: "unif 0 s = (0, s) &
-unif (Suc v2) s =
-(let (m, s') = unif (Suc v2 div 2) s
- in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
-  by (import prob_uniform unif_def)
-
-lemma unif_ind: "All ((P::nat => (nat => bool) => bool) (0::nat)) &
-(ALL (v2::nat) s::nat => bool. P (Suc v2 div (2::nat)) s --> P (Suc v2) s)
-==> P (v::nat) (x::nat => bool)"
-  by (import prob_uniform unif_ind)
-
-definition
-  uniform_tupled :: "nat * nat * (nat => bool) => nat * (nat => bool)"  where
-  "uniform_tupled ==
-WFREC
- (SOME R.
-     WF R &
-     (ALL t s n res s'.
-         (res, s') = unif n s & ~ res < Suc n -->
-         R (t, Suc n, s') (Suc t, Suc n, s)))
- (%uniform_tupled (v, v1).
-     case v of 0 => case v1 of (0, v4) => ARB | (Suc v5, v4) => (0, v4)
-     | Suc v2 =>
-         case v1 of (0, v8) => ARB
-         | (Suc v9, v8) =>
-             let (res, s') = unif v9 v8
-             in if res < Suc v9 then (res, s')
-                else uniform_tupled (v2, Suc v9, s'))"
-
-lemma uniform_tupled_primitive_def: "uniform_tupled =
-WFREC
- (SOME R.
-     WF R &
-     (ALL t s n res s'.
-         (res, s') = unif n s & ~ res < Suc n -->
-         R (t, Suc n, s') (Suc t, Suc n, s)))
- (%uniform_tupled (v, v1).
-     case v of 0 => case v1 of (0, v4) => ARB | (Suc v5, v4) => (0, v4)
-     | Suc v2 =>
-         case v1 of (0, v8) => ARB
-         | (Suc v9, v8) =>
-             let (res, s') = unif v9 v8
-             in if res < Suc v9 then (res, s')
-                else uniform_tupled (v2, Suc v9, s'))"
-  by (import prob_uniform uniform_tupled_primitive_def)
-
-consts
-  uniform :: "nat => nat => (nat => bool) => nat * (nat => bool)" 
-
-defs
-  uniform_primdef: "uniform == %x x1 x2. uniform_tupled (x, x1, x2)"
-
-lemma uniform_curried_def: "uniform x x1 x2 = uniform_tupled (x, x1, x2)"
-  by (import prob_uniform uniform_curried_def)
-
-lemma uniform_ind: "(ALL x. All (P (Suc x) 0)) &
-All (P 0 0) &
-(ALL x. All (P 0 (Suc x))) &
-(ALL x xa xb.
-    (ALL xc xd.
-        (xc, xd) = unif xa xb & ~ xc < Suc xa --> P x (Suc xa) xd) -->
-    P (Suc x) (Suc xa) xb)
-==> P x xa xb"
-  by (import prob_uniform uniform_ind)
-
-lemma uniform_def: "uniform 0 (Suc n) s = (0, s) &
-uniform (Suc t) (Suc n) s =
-(let (xa, x) = unif n s
- in if xa < Suc n then (xa, x) else uniform t (Suc n) x)"
-  by (import prob_uniform uniform_def)
-
-lemma SUC_DIV_TWO_ZERO: "(Suc n div 2 = 0) = (n = 0)"
-  by (import prob_uniform SUC_DIV_TWO_ZERO)
-
-lemma UNIF_BOUND_LOWER: "n < 2 ^ unif_bound n"
-  by (import prob_uniform UNIF_BOUND_LOWER)
-
-lemma UNIF_BOUND_LOWER_SUC: "Suc n <= 2 ^ unif_bound n"
-  by (import prob_uniform UNIF_BOUND_LOWER_SUC)
-
-lemma UNIF_BOUND_UPPER: "n ~= 0 ==> 2 ^ unif_bound n <= 2 * n"
-  by (import prob_uniform UNIF_BOUND_UPPER)
-
-lemma UNIF_BOUND_UPPER_SUC: "2 ^ unif_bound n <= Suc (2 * n)"
-  by (import prob_uniform UNIF_BOUND_UPPER_SUC)
-
-lemma UNIF_DEF_MONAD: "unif 0 = UNIT 0 &
-(ALL n.
-    unif (Suc n) =
-    BIND (unif (Suc n div 2))
-     (%m. BIND SDEST (%b. UNIT (if b then 2 * m + 1 else 2 * m))))"
-  by (import prob_uniform UNIF_DEF_MONAD)
-
-lemma UNIFORM_DEF_MONAD: "(ALL x. uniform 0 (Suc x) = UNIT 0) &
-(ALL x xa.
-    uniform (Suc x) (Suc xa) =
-    BIND (unif xa) (%m. if m < Suc xa then UNIT m else uniform x (Suc xa)))"
-  by (import prob_uniform UNIFORM_DEF_MONAD)
-
-lemma INDEP_UNIF: "indep (unif n)"
-  by (import prob_uniform INDEP_UNIF)
-
-lemma INDEP_UNIFORM: "indep (uniform t (Suc n))"
-  by (import prob_uniform INDEP_UNIFORM)
-
-lemma PROB_UNIF: "prob (%s. fst (unif n s) = k) =
-(if k < 2 ^ unif_bound n then (1 / 2) ^ unif_bound n else 0)"
-  by (import prob_uniform PROB_UNIF)
-
-lemma UNIF_RANGE: "fst (unif n s) < 2 ^ unif_bound n"
-  by (import prob_uniform UNIF_RANGE)
-
-lemma PROB_UNIF_PAIR: "(prob (%s. fst (unif n s) = k) = prob (%s. fst (unif n s) = k')) =
-((k < 2 ^ unif_bound n) = (k' < 2 ^ unif_bound n))"
-  by (import prob_uniform PROB_UNIF_PAIR)
-
-lemma PROB_UNIF_BOUND: "k <= 2 ^ unif_bound n
-==> prob (%s. fst (unif n s) < k) = real k * (1 / 2) ^ unif_bound n"
-  by (import prob_uniform PROB_UNIF_BOUND)
-
-lemma PROB_UNIF_GOOD: "1 / 2 <= prob (%s. fst (unif n s) < Suc n)"
-  by (import prob_uniform PROB_UNIF_GOOD)
-
-lemma UNIFORM_RANGE: "fst (uniform t (Suc n) s) < Suc n"
-  by (import prob_uniform UNIFORM_RANGE)
-
-lemma PROB_UNIFORM_LOWER_BOUND: "[| !!k. k < Suc n ==> prob (%s. fst (uniform t (Suc n) s) = k) < b;
-   m < Suc n |]
-==> prob (%s. fst (uniform t (Suc n) s) < Suc m) < real (Suc m) * b"
-  by (import prob_uniform PROB_UNIFORM_LOWER_BOUND)
-
-lemma PROB_UNIFORM_UPPER_BOUND: "[| !!k. k < Suc n ==> b < prob (%s. fst (uniform t (Suc n) s) = k);
-   m < Suc n |]
-==> real (Suc m) * b < prob (%s. fst (uniform t (Suc n) s) < Suc m)"
-  by (import prob_uniform PROB_UNIFORM_UPPER_BOUND)
-
-lemma PROB_UNIFORM_PAIR_SUC: "k < Suc n & k' < Suc n
-==> abs (prob (%s. fst (uniform t (Suc n) s) = k) -
-         prob (%s. fst (uniform t (Suc n) s) = k'))
-    <= (1 / 2) ^ t"
-  by (import prob_uniform PROB_UNIFORM_PAIR_SUC)
-
-lemma PROB_UNIFORM_SUC: "k < Suc n
-==> abs (prob (%s. fst (uniform t (Suc n) s) = k) - 1 / real (Suc n))
-    <= (1 / 2) ^ t"
-  by (import prob_uniform PROB_UNIFORM_SUC)
-
-lemma PROB_UNIFORM: "k < n
-==> abs (prob (%s. fst (uniform t n s) = k) - 1 / real n) <= (1 / 2) ^ t"
-  by (import prob_uniform PROB_UNIFORM)
-
-;end_setup
-
-end
-
--- a/src/HOL/Import/HOL4/Generated/HOL4Real.thy	Sun Apr 01 14:50:47 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2950 +0,0 @@
-(* AUTOMATICALLY GENERATED, DO NOT EDIT! *)
-
-theory HOL4Real imports HOL4Base begin
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" realax
-
-lemma HREAL_RDISTRIB: "hreal_mul (hreal_add x y) z = hreal_add (hreal_mul x z) (hreal_mul y z)"
-  by (import realax HREAL_RDISTRIB)
-
-lemma HREAL_EQ_ADDL: "x ~= hreal_add x y"
-  by (import realax HREAL_EQ_ADDL)
-
-lemma HREAL_EQ_LADD: "(hreal_add x y = hreal_add x z) = (y = z)"
-  by (import realax HREAL_EQ_LADD)
-
-lemma HREAL_LT_REFL: "~ hreal_lt x x"
-  by (import realax HREAL_LT_REFL)
-
-lemma HREAL_LT_ADDL: "hreal_lt x (hreal_add x y)"
-  by (import realax HREAL_LT_ADDL)
-
-lemma HREAL_LT_NE: "hreal_lt x y ==> x ~= y"
-  by (import realax HREAL_LT_NE)
-
-lemma HREAL_LT_ADDR: "~ hreal_lt (hreal_add x y) x"
-  by (import realax HREAL_LT_ADDR)
-
-lemma HREAL_LT_GT: "hreal_lt x y ==> ~ hreal_lt y x"
-  by (import realax HREAL_LT_GT)
-
-lemma HREAL_LT_ADD2: "hreal_lt x1 y1 & hreal_lt x2 y2
-==> hreal_lt (hreal_add x1 x2) (hreal_add y1 y2)"
-  by (import realax HREAL_LT_ADD2)
-
-lemma HREAL_LT_LADD: "hreal_lt (hreal_add x y) (hreal_add x z) = hreal_lt y z"
-  by (import realax HREAL_LT_LADD)
-
-definition
-  treal_0 :: "hreal * hreal"  where
-  "treal_0 == (hreal_1, hreal_1)"
-
-lemma treal_0: "treal_0 = (hreal_1, hreal_1)"
-  by (import realax treal_0)
-
-definition
-  treal_1 :: "hreal * hreal"  where
-  "treal_1 == (hreal_add hreal_1 hreal_1, hreal_1)"
-
-lemma treal_1: "treal_1 = (hreal_add hreal_1 hreal_1, hreal_1)"
-  by (import realax treal_1)
-
-definition
-  treal_neg :: "hreal * hreal => hreal * hreal"  where
-  "treal_neg == %(x, y). (y, x)"
-
-lemma treal_neg: "treal_neg (x, y) = (y, x)"
-  by (import realax treal_neg)
-
-definition
-  treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal"  where
-  "treal_add == %(x1, y1) (x2, y2). (hreal_add x1 x2, hreal_add y1 y2)"
-
-lemma treal_add: "treal_add (x1, y1) (x2, y2) = (hreal_add x1 x2, hreal_add y1 y2)"
-  by (import realax treal_add)
-
-definition
-  treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal"  where
-  "treal_mul ==
-%(x1, y1) (x2, y2).
-   (hreal_add (hreal_mul x1 x2) (hreal_mul y1 y2),
-    hreal_add (hreal_mul x1 y2) (hreal_mul y1 x2))"
-
-lemma treal_mul: "treal_mul (x1, y1) (x2, y2) =
-(hreal_add (hreal_mul x1 x2) (hreal_mul y1 y2),
- hreal_add (hreal_mul x1 y2) (hreal_mul y1 x2))"
-  by (import realax treal_mul)
-
-definition
-  treal_lt :: "hreal * hreal => hreal * hreal => bool"  where
-  "treal_lt == %(x1, y1) (x2, y2). hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)"
-
-lemma treal_lt: "treal_lt (x1, y1) (x2, y2) = hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)"
-  by (import realax treal_lt)
-
-definition
-  treal_inv :: "hreal * hreal => hreal * hreal"  where
-  "treal_inv ==
-%(x, y).
-   if x = y then treal_0
-   else if hreal_lt y x
-        then (hreal_add (hreal_inv (hreal_sub x y)) hreal_1, hreal_1)
-        else (hreal_1, hreal_add (hreal_inv (hreal_sub y x)) hreal_1)"
-
-lemma treal_inv: "treal_inv (x, y) =
-(if x = y then treal_0
- else if hreal_lt y x
-      then (hreal_add (hreal_inv (hreal_sub x y)) hreal_1, hreal_1)
-      else (hreal_1, hreal_add (hreal_inv (hreal_sub y x)) hreal_1))"
-  by (import realax treal_inv)
-
-definition
-  treal_eq :: "hreal * hreal => hreal * hreal => bool"  where
-  "treal_eq == %(x1, y1) (x2, y2). hreal_add x1 y2 = hreal_add x2 y1"
-
-lemma treal_eq: "treal_eq (x1, y1) (x2, y2) = (hreal_add x1 y2 = hreal_add x2 y1)"
-  by (import realax treal_eq)
-
-lemma TREAL_EQ_REFL: "treal_eq x x"
-  by (import realax TREAL_EQ_REFL)
-
-lemma TREAL_EQ_SYM: "treal_eq x y = treal_eq y x"
-  by (import realax TREAL_EQ_SYM)
-
-lemma TREAL_EQ_TRANS: "treal_eq x y & treal_eq y z ==> treal_eq x z"
-  by (import realax TREAL_EQ_TRANS)
-
-lemma TREAL_EQ_EQUIV: "treal_eq p q = (treal_eq p = treal_eq q)"
-  by (import realax TREAL_EQ_EQUIV)
-
-lemma TREAL_EQ_AP: "p = q ==> treal_eq p q"
-  by (import realax TREAL_EQ_AP)
-
-lemma TREAL_10: "~ treal_eq treal_1 treal_0"
-  by (import realax TREAL_10)
-
-lemma TREAL_ADD_SYM: "treal_add x y = treal_add y x"
-  by (import realax TREAL_ADD_SYM)
-
-lemma TREAL_MUL_SYM: "treal_mul x y = treal_mul y x"
-  by (import realax TREAL_MUL_SYM)
-
-lemma TREAL_ADD_ASSOC: "treal_add x (treal_add y z) = treal_add (treal_add x y) z"
-  by (import realax TREAL_ADD_ASSOC)
-
-lemma TREAL_MUL_ASSOC: "treal_mul x (treal_mul y z) = treal_mul (treal_mul x y) z"
-  by (import realax TREAL_MUL_ASSOC)
-
-lemma TREAL_LDISTRIB: "treal_mul x (treal_add y z) = treal_add (treal_mul x y) (treal_mul x z)"
-  by (import realax TREAL_LDISTRIB)
-
-lemma TREAL_ADD_LID: "treal_eq (treal_add treal_0 x) x"
-  by (import realax TREAL_ADD_LID)
-
-lemma TREAL_MUL_LID: "treal_eq (treal_mul treal_1 x) x"
-  by (import realax TREAL_MUL_LID)
-
-lemma TREAL_ADD_LINV: "treal_eq (treal_add (treal_neg x) x) treal_0"
-  by (import realax TREAL_ADD_LINV)
-
-lemma TREAL_INV_0: "treal_eq (treal_inv treal_0) treal_0"
-  by (import realax TREAL_INV_0)
-
-lemma TREAL_MUL_LINV: "~ treal_eq x treal_0 ==> treal_eq (treal_mul (treal_inv x) x) treal_1"
-  by (import realax TREAL_MUL_LINV)
-
-lemma TREAL_LT_TOTAL: "treal_eq x y | treal_lt x y | treal_lt y x"
-  by (import realax TREAL_LT_TOTAL)
-
-lemma TREAL_LT_REFL: "~ treal_lt x x"
-  by (import realax TREAL_LT_REFL)
-
-lemma TREAL_LT_TRANS: "treal_lt x y & treal_lt y z ==> treal_lt x z"
-  by (import realax TREAL_LT_TRANS)
-
-lemma TREAL_LT_ADD: "treal_lt y z ==> treal_lt (treal_add x y) (treal_add x z)"
-  by (import realax TREAL_LT_ADD)
-
-lemma TREAL_LT_MUL: "treal_lt treal_0 x & treal_lt treal_0 y ==> treal_lt treal_0 (treal_mul x y)"
-  by (import realax TREAL_LT_MUL)
-
-definition
-  treal_of_hreal :: "hreal => hreal * hreal"  where
-  "treal_of_hreal == %x. (hreal_add x hreal_1, hreal_1)"
-
-lemma treal_of_hreal: "treal_of_hreal x = (hreal_add x hreal_1, hreal_1)"
-  by (import realax treal_of_hreal)
-
-definition
-  hreal_of_treal :: "hreal * hreal => hreal"  where
-  "hreal_of_treal == %(x, y). SOME d. x = hreal_add y d"
-
-lemma hreal_of_treal: "hreal_of_treal (x, y) = (SOME d. x = hreal_add y d)"
-  by (import realax hreal_of_treal)
-
-lemma TREAL_BIJ: "(ALL h. hreal_of_treal (treal_of_hreal h) = h) &
-(ALL r. treal_lt treal_0 r = treal_eq (treal_of_hreal (hreal_of_treal r)) r)"
-  by (import realax TREAL_BIJ)
-
-lemma TREAL_ISO: "hreal_lt h i ==> treal_lt (treal_of_hreal h) (treal_of_hreal i)"
-  by (import realax TREAL_ISO)
-
-lemma TREAL_BIJ_WELLDEF: "treal_eq h i ==> hreal_of_treal h = hreal_of_treal i"
-  by (import realax TREAL_BIJ_WELLDEF)
-
-lemma TREAL_NEG_WELLDEF: "treal_eq x1 x2 ==> treal_eq (treal_neg x1) (treal_neg x2)"
-  by (import realax TREAL_NEG_WELLDEF)
-
-lemma TREAL_ADD_WELLDEFR: "treal_eq x1 x2 ==> treal_eq (treal_add x1 y) (treal_add x2 y)"
-  by (import realax TREAL_ADD_WELLDEFR)
-
-lemma TREAL_ADD_WELLDEF: "treal_eq x1 x2 & treal_eq y1 y2
-==> treal_eq (treal_add x1 y1) (treal_add x2 y2)"
-  by (import realax TREAL_ADD_WELLDEF)
-
-lemma TREAL_MUL_WELLDEFR: "treal_eq x1 x2 ==> treal_eq (treal_mul x1 y) (treal_mul x2 y)"
-  by (import realax TREAL_MUL_WELLDEFR)
-
-lemma TREAL_MUL_WELLDEF: "treal_eq x1 x2 & treal_eq y1 y2
-==> treal_eq (treal_mul x1 y1) (treal_mul x2 y2)"
-  by (import realax TREAL_MUL_WELLDEF)
-
-lemma TREAL_LT_WELLDEFR: "treal_eq x1 x2 ==> treal_lt x1 y = treal_lt x2 y"
-  by (import realax TREAL_LT_WELLDEFR)
-
-lemma TREAL_LT_WELLDEFL: "treal_eq y1 y2 ==> treal_lt x y1 = treal_lt x y2"
-  by (import realax TREAL_LT_WELLDEFL)
-
-lemma TREAL_LT_WELLDEF: "treal_eq x1 x2 & treal_eq y1 y2 ==> treal_lt x1 y1 = treal_lt x2 y2"
-  by (import realax TREAL_LT_WELLDEF)
-
-lemma TREAL_INV_WELLDEF: "treal_eq x1 x2 ==> treal_eq (treal_inv x1) (treal_inv x2)"
-  by (import realax TREAL_INV_WELLDEF)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" real
-
-lemma REAL_0: "(0::real) = (0::real)"
-  by (import real REAL_0)
-
-lemma REAL_1: "(1::real) = (1::real)"
-  by (import real REAL_1)
-
-lemma REAL_ADD_LID_UNIQ: "((x::real) + (y::real) = y) = (x = (0::real))"
-  by (import real REAL_ADD_LID_UNIQ)
-
-lemma REAL_ADD_RID_UNIQ: "((x::real) + (y::real) = x) = (y = (0::real))"
-  by (import real REAL_ADD_RID_UNIQ)
-
-lemma REAL_LT_ANTISYM: "~ ((x::real) < (y::real) & y < x)"
-  by (import real REAL_LT_ANTISYM)
-
-lemma REAL_LTE_TOTAL: "(x::real) < (y::real) | y <= x"
-  by (import real REAL_LTE_TOTAL)
-
-lemma REAL_LET_ANTISYM: "~ ((x::real) < (y::real) & y <= x)"
-  by (import real REAL_LET_ANTISYM)
-
-lemma REAL_LTE_ANTSYM: "~ ((x::real) <= (y::real) & y < x)"
-  by (import real REAL_LTE_ANTSYM)
-
-lemma REAL_LT_NEGTOTAL: "(x::real) = (0::real) | (0::real) < x | (0::real) < - x"
-  by (import real REAL_LT_NEGTOTAL)
-
-lemma REAL_LE_NEGTOTAL: "(0::real) <= (x::real) | (0::real) <= - x"
-  by (import real REAL_LE_NEGTOTAL)
-
-lemma REAL_LT_ADDNEG: "((y::real) < (x::real) + - (z::real)) = (y + z < x)"
-  by (import real REAL_LT_ADDNEG)
-
-lemma REAL_LT_ADDNEG2: "((x::real) + - (y::real) < (z::real)) = (x < z + y)"
-  by (import real REAL_LT_ADDNEG2)
-
-lemma REAL_LT_ADD1: "(x::real) <= (y::real) ==> x < y + (1::real)"
-  by (import real REAL_LT_ADD1)
-
-lemma REAL_SUB_ADD2: "(y::real) + ((x::real) - y) = x"
-  by (import real REAL_SUB_ADD2)
-
-lemma REAL_SUB_LT: "((0::real) < (x::real) - (y::real)) = (y < x)"
-  by (import real REAL_SUB_LT)
-
-lemma REAL_SUB_LE: "((0::real) <= (x::real) - (y::real)) = (y <= x)"
-  by (import real REAL_SUB_LE)
-
-lemma REAL_ADD_SUB: "(x::real) + (y::real) - x = y"
-  by (import real REAL_ADD_SUB)
-
-lemma REAL_NEG_EQ: "(- (x::real) = (y::real)) = (x = - y)"
-  by (import real REAL_NEG_EQ)
-
-lemma REAL_LT_LMUL_0: "(0::real) < (x::real) ==> ((0::real) < x * (y::real)) = ((0::real) < y)"
-  by (import real REAL_LT_LMUL_0)
-
-lemma REAL_LT_RMUL_0: "(0::real) < (y::real) ==> ((0::real) < (x::real) * y) = ((0::real) < x)"
-  by (import real REAL_LT_RMUL_0)
-
-lemma REAL_LINV_UNIQ: "(x::real) * (y::real) = (1::real) ==> x = inverse y"
-  by (import real REAL_LINV_UNIQ)
-
-lemma REAL_LE_INV: "(0::real) <= (x::real) ==> (0::real) <= inverse x"
-  by (import real REAL_LE_INV)
-
-lemma REAL_LE_ADDR: "((x::real) <= x + (y::real)) = ((0::real) <= y)"
-  by (import real REAL_LE_ADDR)
-
-lemma REAL_LE_ADDL: "((y::real) <= (x::real) + y) = ((0::real) <= x)"
-  by (import real REAL_LE_ADDL)
-
-lemma REAL_LT_ADDR: "((x::real) < x + (y::real)) = ((0::real) < y)"
-  by (import real REAL_LT_ADDR)
-
-lemma REAL_LT_ADDL: "((y::real) < (x::real) + y) = ((0::real) < x)"
-  by (import real REAL_LT_ADDL)
-
-lemma REAL_LT_NZ: "(real (n::nat) ~= (0::real)) = ((0::real) < real n)"
-  by (import real REAL_LT_NZ)
-
-lemma REAL_NZ_IMP_LT: "(n::nat) ~= (0::nat) ==> (0::real) < real n"
-  by (import real REAL_NZ_IMP_LT)
-
-lemma REAL_LT_RDIV_0: "(0::real) < (z::real) ==> ((0::real) < (y::real) / z) = ((0::real) < y)"
-  by (import real REAL_LT_RDIV_0)
-
-lemma REAL_LT_RDIV: "(0::real) < (z::real) ==> ((x::real) / z < (y::real) / z) = (x < y)"
-  by (import real REAL_LT_RDIV)
-
-lemma REAL_LT_FRACTION_0: "(n::nat) ~= (0::nat) ==> ((0::real) < (d::real) / real n) = ((0::real) < d)"
-  by (import real REAL_LT_FRACTION_0)
-
-lemma REAL_LT_MULTIPLE: "(1::nat) < (x::nat) ==> ((xa::real) < real x * xa) = ((0::real) < xa)"
-  by (import real REAL_LT_MULTIPLE)
-
-lemma REAL_LT_FRACTION: "(1::nat) < (n::nat) ==> ((d::real) / real n < d) = ((0::real) < d)"
-  by (import real REAL_LT_FRACTION)
-
-lemma REAL_LT_HALF2: "((d::real) / (2::real) < d) = ((0::real) < d)"
-  by (import real REAL_LT_HALF2)
-
-lemma REAL_DIV_LMUL: "(y::real) ~= (0::real) ==> y * ((x::real) / y) = x"
-  by (import real REAL_DIV_LMUL)
-
-lemma REAL_DIV_RMUL: "(y::real) ~= (0::real) ==> (x::real) / y * y = x"
-  by (import real REAL_DIV_RMUL)
-
-lemma REAL_DOWN: "(0::real) < (x::real) ==> EX xa>0::real. xa < x"
-  by (import real REAL_DOWN)
-
-lemma REAL_SUB_SUB: "(x::real) - (y::real) - x = - y"
-  by (import real REAL_SUB_SUB)
-
-lemma REAL_SUB_LNEG: "- (x::real) - (y::real) = - (x + y)"
-  by (import real REAL_SUB_LNEG)
-
-lemma REAL_SUB_NEG2: "- (x::real) - - (y::real) = y - x"
-  by (import real REAL_SUB_NEG2)
-
-lemma REAL_SUB_TRIANGLE: "(a::real) - (b::real) + (b - (c::real)) = a - c"
-  by (import real REAL_SUB_TRIANGLE)
-
-lemma REAL_INV_MUL: "(x::real) ~= (0::real) & (y::real) ~= (0::real)
-==> inverse (x * y) = inverse x * inverse y"
-  by (import real REAL_INV_MUL)
-
-lemma REAL_SUB_INV2: "(x::real) ~= (0::real) & (y::real) ~= (0::real)
-==> inverse x - inverse y = (y - x) / (x * y)"
-  by (import real REAL_SUB_INV2)
-
-lemma REAL_SUB_SUB2: "(x::real) - (x - (y::real)) = y"
-  by (import real REAL_SUB_SUB2)
-
-lemma REAL_ADD_SUB2: "(x::real) - (x + (y::real)) = - y"
-  by (import real REAL_ADD_SUB2)
-
-lemma REAL_LE_DIV: "(0::real) <= (x::real) & (0::real) <= (xa::real) ==> (0::real) <= x / xa"
-  by (import real REAL_LE_DIV)
-
-lemma REAL_LT_1: "(0::real) <= (x::real) & x < (y::real) ==> x / y < (1::real)"
-  by (import real REAL_LT_1)
-
-lemma REAL_POS_NZ: "(0::real) < (x::real) ==> x ~= (0::real)"
-  by (import real REAL_POS_NZ)
-
-lemma REAL_EQ_RMUL_IMP: "(z::real) ~= (0::real) & (x::real) * z = (y::real) * z ==> x = y"
-  by (import real REAL_EQ_RMUL_IMP)
-
-lemma REAL_EQ_LMUL_IMP: "(x::real) ~= (0::real) & x * (xa::real) = x * (xb::real) ==> xa = xb"
-  by (import real REAL_EQ_LMUL_IMP)
-
-lemma REAL_FACT_NZ: "real (FACT n) ~= 0"
-  by (import real REAL_FACT_NZ)
-
-lemma REAL_POASQ: "((0::real) < (x::real) * x) = (x ~= (0::real))"
-  by (import real REAL_POASQ)
-
-lemma REAL_DIV_MUL2: "(x::real) ~= (0::real) & (z::real) ~= (0::real)
-==> (y::real) / z = x * y / (x * z)"
-  by (import real REAL_DIV_MUL2)
-
-lemma REAL_MIDDLE1: "(a::real) <= (b::real) ==> a <= (a + b) / (2::real)"
-  by (import real REAL_MIDDLE1)
-
-lemma REAL_MIDDLE2: "(a::real) <= (b::real) ==> (a + b) / (2::real) <= b"
-  by (import real REAL_MIDDLE2)
-
-lemma ABS_LT_MUL2: "abs (w::real) < (y::real) & abs (x::real) < (z::real)
-==> abs (w * x) < y * z"
-  by (import real ABS_LT_MUL2)
-
-lemma ABS_REFL: "(abs (x::real) = x) = ((0::real) <= x)"
-  by (import real ABS_REFL)
-
-lemma ABS_BETWEEN: "((0::real) < (d::real) & (x::real) - d < (y::real) & y < x + d) =
-(abs (y - x) < d)"
-  by (import real ABS_BETWEEN)
-
-lemma ABS_BOUND: "abs ((x::real) - (y::real)) < (d::real) ==> y < x + d"
-  by (import real ABS_BOUND)
-
-lemma ABS_STILLNZ: "abs ((x::real) - (y::real)) < abs y ==> x ~= (0::real)"
-  by (import real ABS_STILLNZ)
-
-lemma ABS_CASES: "(x::real) = (0::real) | (0::real) < abs x"
-  by (import real ABS_CASES)
-
-lemma ABS_BETWEEN1: "(x::real) < (z::real) & abs ((y::real) - x) < z - x ==> y < z"
-  by (import real ABS_BETWEEN1)
-
-lemma ABS_SIGN: "abs ((x::real) - (y::real)) < y ==> (0::real) < x"
-  by (import real ABS_SIGN)
-
-lemma ABS_SIGN2: "abs ((x::real) - (y::real)) < - y ==> x < (0::real)"
-  by (import real ABS_SIGN2)
-
-lemma ABS_CIRCLE: "abs (h::real) < abs (y::real) - abs (x::real) ==> abs (x + h) < abs y"
-  by (import real ABS_CIRCLE)
-
-lemma ABS_BETWEEN2: "(x0::real) < (y0::real) &
-abs ((x::real) - x0) < (y0 - x0) / (2::real) &
-abs ((y::real) - y0) < (y0 - x0) / (2::real)
-==> x < y"
-  by (import real ABS_BETWEEN2)
-
-lemma POW_PLUS1: "0 < e ==> 1 + real n * e <= (1 + e) ^ n"
-  by (import real POW_PLUS1)
-
-lemma POW_M1: "abs ((- (1::real)) ^ (n::nat)) = (1::real)"
-  by (import real POW_M1)
-
-lemma REAL_LE1_POW2: "(1::real) <= (x::real) ==> (1::real) <= x ^ (2::nat)"
-  by (import real REAL_LE1_POW2)
-
-lemma REAL_LT1_POW2: "(1::real) < (x::real) ==> (1::real) < x ^ (2::nat)"
-  by (import real REAL_LT1_POW2)
-
-lemma POW_POS_LT: "(0::real) < (x::real) ==> (0::real) < x ^ Suc (n::nat)"
-  by (import real POW_POS_LT)
-
-lemma POW_LT: "(0::real) <= (x::real) & x < (y::real) ==> x ^ Suc (n::nat) < y ^ Suc n"
-  by (import real POW_LT)
-
-lemma POW_ZERO: "(x::real) ^ (n::nat) = (0::real) ==> x = (0::real)"
-  by (import real POW_ZERO)
-
-lemma POW_ZERO_EQ: "((x::real) ^ Suc (n::nat) = (0::real)) = (x = (0::real))"
-  by (import real POW_ZERO_EQ)
-
-lemma REAL_POW_LT2: "(n::nat) ~= (0::nat) & (0::real) <= (x::real) & x < (y::real)
-==> x ^ n < y ^ n"
-  by (import real REAL_POW_LT2)
-
-lemma REAL_POW_MONO_LT: "(1::real) < (x::real) & (m::nat) < (n::nat) ==> x ^ m < x ^ n"
-  by (import real REAL_POW_MONO_LT)
-
-lemma REAL_SUP_SOMEPOS: "(EX x::real. (P::real => bool) x & (0::real) < x) &
-(EX z::real. ALL x::real. P x --> x < z)
-==> EX s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s)"
-  by (import real REAL_SUP_SOMEPOS)
-
-lemma SUP_LEMMA1: "(!!y::real.
-    (EX x::real. (P::real => bool) (x + (d::real)) & y < x) =
-    (y < (s::real)))
-==> (EX x::real. P x & (y::real) < x) = (y < s + d)"
-  by (import real SUP_LEMMA1)
-
-lemma SUP_LEMMA2: "Ex (P::real => bool) ==> EX (d::real) x::real. P (x + d) & (0::real) < x"
-  by (import real SUP_LEMMA2)
-
-lemma SUP_LEMMA3: "EX z::real. ALL x::real. (P::real => bool) x --> x < z
-==> EX x::real. ALL xa::real. P (xa + (d::real)) --> xa < x"
-  by (import real SUP_LEMMA3)
-
-lemma REAL_SUP_EXISTS: "Ex (P::real => bool) & (EX z::real. ALL x::real. P x --> x < z)
-==> EX x::real. ALL y::real. (EX x::real. P x & y < x) = (y < x)"
-  by (import real REAL_SUP_EXISTS)
-
-consts
-  sup :: "(real => bool) => real" 
-
-defs
-  sup_def: "real.sup == %P. SOME s. ALL y. (EX x. P x & y < x) = (y < s)"
-
-lemma sup: "real.sup P = (SOME s. ALL y. (EX x. P x & y < x) = (y < s))"
-  by (import real sup)
-
-lemma REAL_SUP: "Ex P & (EX z. ALL x. P x --> x < z)
-==> (EX x. P x & y < x) = (y < real.sup P)"
-  by (import real REAL_SUP)
-
-lemma REAL_SUP_UBOUND: "[| Ex P & (EX z. ALL x. P x --> x < z); P y |] ==> y <= real.sup P"
-  by (import real REAL_SUP_UBOUND)
-
-lemma SETOK_LE_LT: "(Ex (P::real => bool) & (EX z::real. ALL x::real. P x --> x <= z)) =
-(Ex P & (EX z::real. ALL x::real. P x --> x < z))"
-  by (import real SETOK_LE_LT)
-
-lemma REAL_SUP_LE: "Ex P & (EX z. ALL x. P x --> x <= z)
-==> (EX x. P x & y < x) = (y < real.sup P)"
-  by (import real REAL_SUP_LE)
-
-lemma REAL_SUP_UBOUND_LE: "[| Ex P & (EX z. ALL x. P x --> x <= z); P y |] ==> y <= real.sup P"
-  by (import real REAL_SUP_UBOUND_LE)
-
-consts
-  sumc :: "nat => nat => (nat => real) => real" 
-
-specification (sumc) sumc: "(ALL n f. sumc n 0 f = 0) &
-(ALL n m f. sumc n (Suc m) f = sumc n m f + f (n + m))"
-  by (import real sumc)
-
-consts
-  sum :: "nat * nat => (nat => real) => real" 
-
-defs
-  sum_def: "real.sum == %(x, y). sumc x y"
-
-lemma SUM_DEF: "real.sum (m, n) f = sumc m n f"
-  by (import real SUM_DEF)
-
-lemma sum: "real.sum (xa, 0) x = 0 &
-real.sum (xa, Suc xb) x = real.sum (xa, xb) x + x (xa + xb)"
-  by (import real sum)
-
-lemma SUM_TWO: "real.sum (0, n) f + real.sum (n, p) f = real.sum (0, n + p) f"
-  by (import real SUM_TWO)
-
-lemma SUM_DIFF: "real.sum (m, n) f = real.sum (0, m + n) f - real.sum (0, m) f"
-  by (import real SUM_DIFF)
-
-lemma ABS_SUM: "abs (real.sum (m, n) f) <= real.sum (m, n) (%n. abs (f n))"
-  by (import real ABS_SUM)
-
-lemma SUM_LE: "(!!r. m <= r & r < n + m ==> f r <= g r)
-==> real.sum (m, n) f <= real.sum (m, n) g"
-  by (import real SUM_LE)
-
-lemma SUM_EQ: "(!!r. m <= r & r < n + m ==> f r = g r)
-==> real.sum (m, n) f = real.sum (m, n) g"
-  by (import real SUM_EQ)
-
-lemma SUM_POS: "(!!n. 0 <= f n) ==> 0 <= real.sum (m, n) f"
-  by (import real SUM_POS)
-
-lemma SUM_POS_GEN: "(!!n. m <= n ==> 0 <= f n) ==> 0 <= real.sum (m, n) f"
-  by (import real SUM_POS_GEN)
-
-lemma SUM_ABS: "abs (real.sum (m, x) (%m. abs (f m))) = real.sum (m, x) (%m. abs (f m))"
-  by (import real SUM_ABS)
-
-lemma SUM_ABS_LE: "abs (real.sum (m, n) f) <= real.sum (m, n) (%n. abs (f n))"
-  by (import real SUM_ABS_LE)
-
-lemma SUM_ZERO: "[| !!n. N <= n ==> f n = 0; N <= m |] ==> real.sum (m, n) f = 0"
-  by (import real SUM_ZERO)
-
-lemma SUM_ADD: "real.sum (m, n) (%n. f n + g n) = real.sum (m, n) f + real.sum (m, n) g"
-  by (import real SUM_ADD)
-
-lemma SUM_CMUL: "real.sum (m, n) (%n. c * f n) = c * real.sum (m, n) f"
-  by (import real SUM_CMUL)
-
-lemma SUM_NEG: "real.sum (n, d) (%n. - f n) = - real.sum (n, d) f"
-  by (import real SUM_NEG)
-
-lemma SUM_SUB: "real.sum (m, n) (%x. f x - g x) = real.sum (m, n) f - real.sum (m, n) g"
-  by (import real SUM_SUB)
-
-lemma SUM_SUBST: "(!!p. m <= p & p < m + n ==> f p = g p)
-==> real.sum (m, n) f = real.sum (m, n) g"
-  by (import real SUM_SUBST)
-
-lemma SUM_NSUB: "real.sum (0, n) f - real n * c = real.sum (0, n) (%p. f p - c)"
-  by (import real SUM_NSUB)
-
-lemma SUM_BOUND: "(!!p. m <= p & p < m + n ==> f p <= k) ==> real.sum (m, n) f <= real n * k"
-  by (import real SUM_BOUND)
-
-lemma SUM_GROUP: "real.sum (0, n) (%m. real.sum (m * k, k) f) = real.sum (0, n * k) f"
-  by (import real SUM_GROUP)
-
-lemma SUM_1: "real.sum (n, 1) f = f n"
-  by (import real SUM_1)
-
-lemma SUM_2: "real.sum (n, 2) f = f n + f (n + 1)"
-  by (import real SUM_2)
-
-lemma SUM_OFFSET: "real.sum (0, n) (%m. f (m + k)) = real.sum (0, n + k) f - real.sum (0, k) f"
-  by (import real SUM_OFFSET)
-
-lemma SUM_REINDEX: "real.sum (m + k, n) f = real.sum (m, n) (%r. f (r + k))"
-  by (import real SUM_REINDEX)
-
-lemma SUM_0: "real.sum (m, n) (%r. 0) = 0"
-  by (import real SUM_0)
-
-lemma SUM_PERMUTE_0: "(!!y. y < n ==> EX! x. x < n & p x = y)
-==> real.sum (0, n) (%n. f (p n)) = real.sum (0, n) f"
-  by (import real SUM_PERMUTE_0)
-
-lemma SUM_CANCEL: "real.sum (n, d) (%n. f (Suc n) - f n) = f (n + d) - f n"
-  by (import real SUM_CANCEL)
-
-lemma REAL_LE_RNEG: "((x::real) <= - (y::real)) = (x + y <= (0::real))"
-  by (import real REAL_LE_RNEG)
-
-lemma REAL_EQ_RDIV_EQ: "(0::real) < (xb::real) ==> ((x::real) = (xa::real) / xb) = (x * xb = xa)"
-  by (import real REAL_EQ_RDIV_EQ)
-
-lemma REAL_EQ_LDIV_EQ: "(0::real) < (xb::real) ==> ((x::real) / xb = (xa::real)) = (x = xa * xb)"
-  by (import real REAL_EQ_LDIV_EQ)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" topology
-
-definition
-  re_Union :: "(('a => bool) => bool) => 'a => bool"  where
-  "re_Union == %P x. EX s. P s & s x"
-
-lemma re_Union: "re_Union P = (%x. EX s. P s & s x)"
-  by (import topology re_Union)
-
-definition
-  re_union :: "('a => bool) => ('a => bool) => 'a => bool"  where
-  "re_union == %P Q x. P x | Q x"
-
-lemma re_union: "re_union P Q = (%x. P x | Q x)"
-  by (import topology re_union)
-
-definition
-  re_intersect :: "('a => bool) => ('a => bool) => 'a => bool"  where
-  "re_intersect == %P Q x. P x & Q x"
-
-lemma re_intersect: "re_intersect P Q = (%x. P x & Q x)"
-  by (import topology re_intersect)
-
-definition
-  re_null :: "'a => bool"  where
-  "re_null == %x. False"
-
-lemma re_null: "re_null = (%x. False)"
-  by (import topology re_null)
-
-definition
-  re_universe :: "'a => bool"  where
-  "re_universe == %x. True"
-
-lemma re_universe: "re_universe = (%x. True)"
-  by (import topology re_universe)
-
-definition
-  re_subset :: "('a => bool) => ('a => bool) => bool"  where
-  "re_subset == %P Q. ALL x. P x --> Q x"
-
-lemma re_subset: "re_subset P Q = (ALL x. P x --> Q x)"
-  by (import topology re_subset)
-
-definition
-  re_compl :: "('a => bool) => 'a => bool"  where
-  "re_compl == %P x. ~ P x"
-
-lemma re_compl: "re_compl P = (%x. ~ P x)"
-  by (import topology re_compl)
-
-lemma SUBSET_REFL: "re_subset P P"
-  by (import topology SUBSET_REFL)
-
-lemma COMPL_MEM: "P x = (~ re_compl P x)"
-  by (import topology COMPL_MEM)
-
-lemma SUBSET_ANTISYM: "(re_subset P Q & re_subset Q P) = (P = Q)"
-  by (import topology SUBSET_ANTISYM)
-
-lemma SUBSET_TRANS: "re_subset P Q & re_subset Q R ==> re_subset P R"
-  by (import topology SUBSET_TRANS)
-
-definition
-  istopology :: "(('a => bool) => bool) => bool"  where
-  "istopology ==
-%L. L re_null &
-    L re_universe &
-    (ALL a b. L a & L b --> L (re_intersect a b)) &
-    (ALL P. re_subset P L --> L (re_Union P))"
-
-lemma istopology: "istopology L =
-(L re_null &
- L re_universe &
- (ALL a b. L a & L b --> L (re_intersect a b)) &
- (ALL P. re_subset P L --> L (re_Union P)))"
-  by (import topology istopology)
-
-typedef (open) ('a) topology = "Collect istopology::(('a::type => bool) => bool) set"
-  by (rule typedef_helper,import topology topology_TY_DEF)
-
-lemmas topology_TY_DEF = typedef_hol2hol4 [OF type_definition_topology]
-
-consts
-  topology :: "(('a => bool) => bool) => 'a topology" 
-  "open" :: "'a topology => ('a => bool) => bool" 
-
-specification ("open" topology) topology_tybij: "(ALL a::'a topology. topology (topology.open a) = a) &
-(ALL r::('a => bool) => bool.
-    istopology r = (topology.open (topology r) = r))"
-  by (import topology topology_tybij)
-
-lemma TOPOLOGY: "topology.open L re_null &
-topology.open L re_universe &
-(ALL a b.
-    topology.open L a & topology.open L b -->
-    topology.open L (re_intersect a b)) &
-(ALL P. re_subset P (topology.open L) --> topology.open L (re_Union P))"
-  by (import topology TOPOLOGY)
-
-lemma TOPOLOGY_UNION: "re_subset xa (topology.open x) ==> topology.open x (re_Union xa)"
-  by (import topology TOPOLOGY_UNION)
-
-definition
-  neigh :: "'a topology => ('a => bool) * 'a => bool"  where
-  "neigh == %tp (N, x). EX P. topology.open tp P & re_subset P N & P x"
-
-lemma neigh: "neigh (tp::'a::type topology) (N::'a::type => bool, x::'a::type) =
-(EX P::'a::type => bool. topology.open tp P & re_subset P N & P x)"
-  by (import topology neigh)
-
-lemma OPEN_OWN_NEIGH: "topology.open (tp::'a::type topology) (S'::'a::type => bool) &
-S' (x::'a::type)
-==> neigh tp (S', x)"
-  by (import topology OPEN_OWN_NEIGH)
-
-lemma OPEN_UNOPEN: "topology.open (tp::'a::type topology) (S'::'a::type => bool) =
-(re_Union (%P::'a::type => bool. topology.open tp P & re_subset P S') = S')"
-  by (import topology OPEN_UNOPEN)
-
-lemma OPEN_SUBOPEN: "topology.open (tp::'a::type topology) (S'::'a::type => bool) =
-(ALL x::'a::type.
-    S' x -->
-    (EX P::'a::type => bool. P x & topology.open tp P & re_subset P S'))"
-  by (import topology OPEN_SUBOPEN)
-
-lemma OPEN_NEIGH: "topology.open (tp::'a::type topology) (S'::'a::type => bool) =
-(ALL x::'a::type.
-    S' x --> (EX N::'a::type => bool. neigh tp (N, x) & re_subset N S'))"
-  by (import topology OPEN_NEIGH)
-
-consts
-  closed :: "'a topology => ('a => bool) => bool" 
-
-defs
-  closed_def: "topology.closed == %L S'. topology.open L (re_compl S')"
-
-lemma closed: "topology.closed L S' = topology.open L (re_compl S')"
-  by (import topology closed)
-
-definition
-  limpt :: "'a topology => 'a => ('a => bool) => bool"  where
-  "limpt == %tp x S'. ALL N. neigh tp (N, x) --> (EX y. x ~= y & S' y & N y)"
-
-lemma limpt: "limpt (tp::'a::type topology) (x::'a::type) (S'::'a::type => bool) =
-(ALL N::'a::type => bool.
-    neigh tp (N, x) --> (EX y::'a::type. x ~= y & S' y & N y))"
-  by (import topology limpt)
-
-lemma CLOSED_LIMPT: "topology.closed (tp::'a::type topology) (S'::'a::type => bool) =
-(ALL x::'a::type. limpt tp x S' --> S' x)"
-  by (import topology CLOSED_LIMPT)
-
-definition
-  ismet :: "('a * 'a => real) => bool"  where
-  "ismet ==
-%m. (ALL x y. (m (x, y) = 0) = (x = y)) &
-    (ALL x y z. m (y, z) <= m (x, y) + m (x, z))"
-
-lemma ismet: "ismet m =
-((ALL x y. (m (x, y) = 0) = (x = y)) &
- (ALL x y z. m (y, z) <= m (x, y) + m (x, z)))"
-  by (import topology ismet)
-
-typedef (open) ('a) metric = "Collect ismet :: ('a::type * 'a::type => real) set"
-  by (rule typedef_helper,import topology metric_TY_DEF)
-
-lemmas metric_TY_DEF = typedef_hol2hol4 [OF type_definition_metric]
-
-consts
-  metric :: "('a * 'a => real) => 'a metric" 
-  dist :: "'a metric => 'a * 'a => real" 
-
-specification (dist metric) metric_tybij: "(ALL a::'a metric. metric (topology.dist a) = a) &
-(ALL r::'a * 'a => real. ismet r = (topology.dist (metric r) = r))"
-  by (import topology metric_tybij)
-
-lemma METRIC_ISMET: "ismet (topology.dist m)"
-  by (import topology METRIC_ISMET)
-
-lemma METRIC_ZERO: "(topology.dist m (x, y) = 0) = (x = y)"
-  by (import topology METRIC_ZERO)
-
-lemma METRIC_SAME: "topology.dist m (x, x) = 0"
-  by (import topology METRIC_SAME)
-
-lemma METRIC_POS: "0 <= topology.dist m (x, y)"
-  by (import topology METRIC_POS)
-
-lemma METRIC_SYM: "topology.dist m (x, y) = topology.dist m (y, x)"
-  by (import topology METRIC_SYM)
-
-lemma METRIC_TRIANGLE: "topology.dist m (x, z) <= topology.dist m (x, y) + topology.dist m (y, z)"
-  by (import topology METRIC_TRIANGLE)
-
-lemma METRIC_NZ: "x ~= y ==> 0 < topology.dist m (x, y)"
-  by (import topology METRIC_NZ)
-
-definition
-  mtop :: "'a metric => 'a topology"  where
-  "mtop ==
-%m. topology
-     (%S'. ALL x.
-              S' x --> (EX e>0. ALL y. topology.dist m (x, y) < e --> S' y))"
-
-lemma mtop: "mtop m =
-topology
- (%S'. ALL x. S' x --> (EX e>0. ALL y. topology.dist m (x, y) < e --> S' y))"
-  by (import topology mtop)
-
-lemma mtop_istopology: "istopology
- (%S'. ALL x. S' x --> (EX e>0. ALL y. topology.dist m (x, y) < e --> S' y))"
-  by (import topology mtop_istopology)
-
-lemma MTOP_OPEN: "topology.open (mtop x) S' =
-(ALL xa. S' xa --> (EX e>0. ALL y. topology.dist x (xa, y) < e --> S' y))"
-  by (import topology MTOP_OPEN)
-
-definition
-  B :: "'a metric => 'a * real => 'a => bool"  where
-  "B == %m (x, e) y. topology.dist m (x, y) < e"
-
-lemma ball: "B m (x, e) = (%y. topology.dist m (x, y) < e)"
-  by (import topology ball)
-
-lemma BALL_OPEN: "0 < e ==> topology.open (mtop m) (B m (x, e))"
-  by (import topology BALL_OPEN)
-
-lemma BALL_NEIGH: "0 < e ==> neigh (mtop m) (B m (x, e), x)"
-  by (import topology BALL_NEIGH)
-
-lemma MTOP_LIMPT: "limpt (mtop m) x S' =
-(ALL e>0. EX y. x ~= y & S' y & topology.dist m (x, y) < e)"
-  by (import topology MTOP_LIMPT)
-
-lemma ISMET_R1: "ismet (%(x, y). abs (y - x))"
-  by (import topology ISMET_R1)
-
-definition
-  mr1 :: "real metric"  where
-  "mr1 == metric (%(x, y). abs (y - x))"
-
-lemma mr1: "mr1 = metric (%(x, y). abs (y - x))"
-  by (import topology mr1)
-
-lemma MR1_DEF: "topology.dist mr1 (x, y) = abs (y - x)"
-  by (import topology MR1_DEF)
-
-lemma MR1_ADD: "topology.dist mr1 (x, x + d) = abs d"
-  by (import topology MR1_ADD)
-
-lemma MR1_SUB: "topology.dist mr1 (x, x - d) = abs d"
-  by (import topology MR1_SUB)
-
-lemma MR1_ADD_POS: "0 <= d ==> topology.dist mr1 (x, x + d) = d"
-  by (import topology MR1_ADD_POS)
-
-lemma MR1_SUB_LE: "0 <= d ==> topology.dist mr1 (x, x - d) = d"
-  by (import topology MR1_SUB_LE)
-
-lemma MR1_ADD_LT: "0 < d ==> topology.dist mr1 (x, x + d) = d"
-  by (import topology MR1_ADD_LT)
-
-lemma MR1_SUB_LT: "0 < d ==> topology.dist mr1 (x, x - d) = d"
-  by (import topology MR1_SUB_LT)
-
-lemma MR1_BETWEEN1: "x < z & topology.dist mr1 (x, y) < z - x ==> y < z"
-  by (import topology MR1_BETWEEN1)
-
-lemma MR1_LIMPT: "limpt (mtop mr1) x re_universe"
-  by (import topology MR1_LIMPT)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" nets
-
-definition
-  dorder :: "('a => 'a => bool) => bool"  where
-  "dorder ==
-%g. ALL x y.
-       g x x & g y y --> (EX z. g z z & (ALL w. g w z --> g w x & g w y))"
-
-lemma dorder: "dorder g =
-(ALL x y.
-    g x x & g y y --> (EX z. g z z & (ALL w. g w z --> g w x & g w y)))"
-  by (import nets dorder)
-
-definition
-  tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool"  where
-  "tends ==
-%(s::'b => 'a) (l::'a) (tp::'a topology, g::'b => 'b => bool).
-   ALL N::'a => bool.
-      neigh tp (N, l) -->
-      (EX n::'b. g n n & (ALL m::'b. g m n --> N (s m)))"
-
-lemma tends: "tends (s::'b::type => 'a::type) (l::'a::type)
- (tp::'a::type topology, g::'b::type => 'b::type => bool) =
-(ALL N::'a::type => bool.
-    neigh tp (N, l) -->
-    (EX n::'b::type. g n n & (ALL m::'b::type. g m n --> N (s m))))"
-  by (import nets tends)
-
-definition
-  bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool"  where
-  "bounded ==
-%(m, g) f. EX k x N. g N N & (ALL n. g n N --> topology.dist m (f n, x) < k)"
-
-lemma bounded: "bounded (m, g) f =
-(EX k x N. g N N & (ALL n. g n N --> topology.dist m (f n, x) < k))"
-  by (import nets bounded)
-
-consts
-  tendsto :: "'a metric * 'a => 'a => 'a => bool" 
-
-defs
-  tendsto_def: "nets.tendsto ==
-%(m, x) y z.
-   0 < topology.dist m (x, y) &
-   topology.dist m (x, y) <= topology.dist m (x, z)"
-
-lemma tendsto: "nets.tendsto (m, x) y z =
-(0 < topology.dist m (x, y) &
- topology.dist m (x, y) <= topology.dist m (x, z))"
-  by (import nets tendsto)
-
-lemma DORDER_LEMMA: "[| dorder g;
-   (EX n. g n n & (ALL m. g m n --> P m)) &
-   (EX n. g n n & (ALL m. g m n --> Q m)) |]
-==> EX n. g n n & (ALL m. g m n --> P m & Q m)"
-  by (import nets DORDER_LEMMA)
-
-lemma DORDER_NGE: "dorder nat_ge"
-  by (import nets DORDER_NGE)
-
-lemma DORDER_TENDSTO: "dorder (nets.tendsto (m, x))"
-  by (import nets DORDER_TENDSTO)
-
-lemma MTOP_TENDS: "tends (x::'b => 'a) (x0::'a) (mtop (d::'a metric), g::'b => 'b => bool) =
-(ALL e>0::real.
-    EX n::'b. g n n & (ALL m::'b. g m n --> topology.dist d (x m, x0) < e))"
-  by (import nets MTOP_TENDS)
-
-lemma MTOP_TENDS_UNIQ: "[| dorder (g::'b => 'b => bool);
-   tends (x::'b => 'a) (x0::'a) (mtop (d::'a metric), g) &
-   tends x (x1::'a) (mtop d, g) |]
-==> x0 = x1"
-  by (import nets MTOP_TENDS_UNIQ)
-
-lemma SEQ_TENDS: "tends x x0 (mtop d, nat_ge) =
-(ALL xa>0. EX xb. ALL xc>=xb. topology.dist d (x xc, x0) < xa)"
-  by (import nets SEQ_TENDS)
-
-lemma LIM_TENDS: "limpt (mtop m1) x0 re_universe
-==> tends f y0 (mtop m2, nets.tendsto (m1, x0)) =
-    (ALL e>0.
-        EX d>0.
-           ALL x.
-              0 < topology.dist m1 (x, x0) &
-              topology.dist m1 (x, x0) <= d -->
-              topology.dist m2 (f x, y0) < e)"
-  by (import nets LIM_TENDS)
-
-lemma LIM_TENDS2: "limpt (mtop m1) x0 re_universe
-==> tends f y0 (mtop m2, nets.tendsto (m1, x0)) =
-    (ALL e>0.
-        EX d>0.
-           ALL x.
-              0 < topology.dist m1 (x, x0) &
-              topology.dist m1 (x, x0) < d -->
-              topology.dist m2 (f x, y0) < e)"
-  by (import nets LIM_TENDS2)
-
-lemma MR1_BOUNDED: "bounded (mr1, g) f = (EX k N. g N N & (ALL n. g n N --> abs (f n) < k))"
-  by (import nets MR1_BOUNDED)
-
-lemma NET_NULL: "tends x x0 (mtop mr1, g) = tends (%n. x n - x0) 0 (mtop mr1, g)"
-  by (import nets NET_NULL)
-
-lemma NET_CONV_BOUNDED: "tends x x0 (mtop mr1, g) ==> bounded (mr1, g) x"
-  by (import nets NET_CONV_BOUNDED)
-
-lemma NET_CONV_NZ: "tends x x0 (mtop mr1, g) & x0 ~= 0
-==> EX N. g N N & (ALL n. g n N --> x n ~= 0)"
-  by (import nets NET_CONV_NZ)
-
-lemma NET_CONV_IBOUNDED: "tends x x0 (mtop mr1, g) & x0 ~= 0 ==> bounded (mr1, g) (%n. inverse (x n))"
-  by (import nets NET_CONV_IBOUNDED)
-
-lemma NET_NULL_ADD: "[| dorder g; tends x 0 (mtop mr1, g) & tends y 0 (mtop mr1, g) |]
-==> tends (%n. x n + y n) 0 (mtop mr1, g)"
-  by (import nets NET_NULL_ADD)
-
-lemma NET_NULL_MUL: "[| dorder g; bounded (mr1, g) x & tends y 0 (mtop mr1, g) |]
-==> tends (%n. x n * y n) 0 (mtop mr1, g)"
-  by (import nets NET_NULL_MUL)
-
-lemma NET_NULL_CMUL: "tends x 0 (mtop mr1, g) ==> tends (%n. k * x n) 0 (mtop mr1, g)"
-  by (import nets NET_NULL_CMUL)
-
-lemma NET_ADD: "[| dorder g; tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) |]
-==> tends (%n. x n + y n) (x0 + y0) (mtop mr1, g)"
-  by (import nets NET_ADD)
-
-lemma NET_NEG: "dorder g
-==> tends x x0 (mtop mr1, g) = tends (%n. - x n) (- x0) (mtop mr1, g)"
-  by (import nets NET_NEG)
-
-lemma NET_SUB: "[| dorder g; tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) |]
-==> tends (%xa. x xa - y xa) (x0 - y0) (mtop mr1, g)"
-  by (import nets NET_SUB)
-
-lemma NET_MUL: "[| dorder g; tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) |]
-==> tends (%n. x n * y n) (x0 * y0) (mtop mr1, g)"
-  by (import nets NET_MUL)
-
-lemma NET_INV: "[| dorder g; tends x x0 (mtop mr1, g) & x0 ~= 0 |]
-==> tends (%n. inverse (x n)) (inverse x0) (mtop mr1, g)"
-  by (import nets NET_INV)
-
-lemma NET_DIV: "[| dorder g;
-   tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) & y0 ~= 0 |]
-==> tends (%xa. x xa / y xa) (x0 / y0) (mtop mr1, g)"
-  by (import nets NET_DIV)
-
-lemma NET_ABS: "tends x x0 (mtop mr1, g) ==> tends (%n. abs (x n)) (abs x0) (mtop mr1, g)"
-  by (import nets NET_ABS)
-
-lemma NET_LE: "[| dorder g;
-   tends x x0 (mtop mr1, g) &
-   tends y y0 (mtop mr1, g) &
-   (EX N. g N N & (ALL n. g n N --> x n <= y n)) |]
-==> x0 <= y0"
-  by (import nets NET_LE)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" seq
-
-consts
-  "hol4-->" :: "(nat => real) => real => bool" ("hol4-->")
-
-defs
-  "hol4-->_def": "hol4--> == %x x0. tends x x0 (mtop mr1, nat_ge)"
-
-lemma tends_num_real: "hol4--> x x0 = tends x x0 (mtop mr1, nat_ge)"
-  by (import seq tends_num_real)
-
-lemma SEQ: "hol4--> x x0 = (ALL e>0. EX N. ALL n>=N. abs (x n - x0) < e)"
-  by (import seq SEQ)
-
-lemma SEQ_CONST: "hol4--> (%x. k) k"
-  by (import seq SEQ_CONST)
-
-lemma SEQ_ADD: "hol4--> x x0 & hol4--> y y0 ==> hol4--> (%n. x n + y n) (x0 + y0)"
-  by (import seq SEQ_ADD)
-
-lemma SEQ_MUL: "hol4--> x x0 & hol4--> y y0 ==> hol4--> (%n. x n * y n) (x0 * y0)"
-  by (import seq SEQ_MUL)
-
-lemma SEQ_NEG: "hol4--> x x0 = hol4--> (%n. - x n) (- x0)"
-  by (import seq SEQ_NEG)
-
-lemma SEQ_INV: "hol4--> x x0 & x0 ~= 0 ==> hol4--> (%n. inverse (x n)) (inverse x0)"
-  by (import seq SEQ_INV)
-
-lemma SEQ_SUB: "hol4--> x x0 & hol4--> y y0 ==> hol4--> (%n. x n - y n) (x0 - y0)"
-  by (import seq SEQ_SUB)
-
-lemma SEQ_DIV: "hol4--> x x0 & hol4--> y y0 & y0 ~= 0 ==> hol4--> (%n. x n / y n) (x0 / y0)"
-  by (import seq SEQ_DIV)
-
-lemma SEQ_UNIQ: "hol4--> x x1 & hol4--> x x2 ==> x1 = x2"
-  by (import seq SEQ_UNIQ)
-
-consts
-  convergent :: "(nat => real) => bool" 
-
-defs
-  convergent_def: "seq.convergent == %f. Ex (hol4--> f)"
-
-lemma convergent: "seq.convergent f = Ex (hol4--> f)"
-  by (import seq convergent)
-
-definition
-  cauchy :: "(nat => real) => bool"  where
-  "cauchy ==
-%f. ALL e>0. EX N. ALL m n. N <= m & N <= n --> abs (f m - f n) < e"
-
-lemma cauchy: "cauchy f = (ALL e>0. EX N. ALL m n. N <= m & N <= n --> abs (f m - f n) < e)"
-  by (import seq cauchy)
-
-consts
-  lim :: "(nat => real) => real" 
-
-defs
-  lim_def: "seq.lim == %f. Eps (hol4--> f)"
-
-lemma lim: "seq.lim f = Eps (hol4--> f)"
-  by (import seq lim)
-
-lemma SEQ_LIM: "seq.convergent f = hol4--> f (seq.lim f)"
-  by (import seq SEQ_LIM)
-
-consts
-  subseq :: "(nat => nat) => bool" 
-
-defs
-  subseq_def: "seq.subseq == %f. ALL m n. m < n --> f m < f n"
-
-lemma subseq: "seq.subseq f = (ALL m n. m < n --> f m < f n)"
-  by (import seq subseq)
-
-lemma SUBSEQ_SUC: "seq.subseq f = (ALL n. f n < f (Suc n))"
-  by (import seq SUBSEQ_SUC)
-
-consts
-  mono :: "(nat => real) => bool" 
-
-defs
-  mono_def: "seq.mono ==
-%f. (ALL m n. m <= n --> f m <= f n) | (ALL m n. m <= n --> f n <= f m)"
-
-lemma mono: "seq.mono f =
-((ALL m n. m <= n --> f m <= f n) | (ALL m n. m <= n --> f n <= f m))"
-  by (import seq mono)
-
-lemma MONO_SUC: "seq.mono f = ((ALL x. f x <= f (Suc x)) | (ALL n. f (Suc n) <= f n))"
-  by (import seq MONO_SUC)
-
-lemma MAX_LEMMA: "EX k::real. ALL n<N::nat. abs ((s::nat => real) n) < k"
-  by (import seq MAX_LEMMA)
-
-lemma SEQ_BOUNDED: "bounded (mr1, nat_ge) s = (EX k. ALL n. abs (s n) < k)"
-  by (import seq SEQ_BOUNDED)
-
-lemma SEQ_BOUNDED_2: "(!!n. k <= f n & f n <= k') ==> bounded (mr1, nat_ge) f"
-  by (import seq SEQ_BOUNDED_2)
-
-lemma SEQ_CBOUNDED: "cauchy f ==> bounded (mr1, nat_ge) f"
-  by (import seq SEQ_CBOUNDED)
-
-lemma SEQ_ICONV: "bounded (mr1, nat_ge) f & (ALL m n. n <= m --> f n <= f m)
-==> seq.convergent f"
-  by (import seq SEQ_ICONV)
-
-lemma SEQ_NEG_CONV: "seq.convergent f = seq.convergent (%n. - f n)"
-  by (import seq SEQ_NEG_CONV)
-
-lemma SEQ_NEG_BOUNDED: "bounded (mr1, nat_ge) (%n. - f n) = bounded (mr1, nat_ge) f"
-  by (import seq SEQ_NEG_BOUNDED)
-
-lemma SEQ_BCONV: "bounded (mr1, nat_ge) f & seq.mono f ==> seq.convergent f"
-  by (import seq SEQ_BCONV)
-
-lemma SEQ_MONOSUB: "EX f. seq.subseq f & seq.mono (%n. s (f n))"
-  by (import seq SEQ_MONOSUB)
-
-lemma SEQ_SBOUNDED: "bounded (mr1, nat_ge) s ==> bounded (mr1, nat_ge) (%n. s (f n))"
-  by (import seq SEQ_SBOUNDED)
-
-lemma SEQ_SUBLE: "seq.subseq f ==> n <= f n"
-  by (import seq SEQ_SUBLE)
-
-lemma SEQ_DIRECT: "seq.subseq f ==> EX x>=N1. N2 <= f x"
-  by (import seq SEQ_DIRECT)
-
-lemma SEQ_CAUCHY: "cauchy f = seq.convergent f"
-  by (import seq SEQ_CAUCHY)
-
-lemma SEQ_LE: "hol4--> f l & hol4--> g m & (EX x. ALL xa>=x. f xa <= g xa) ==> l <= m"
-  by (import seq SEQ_LE)
-
-lemma SEQ_SUC: "hol4--> f l = hol4--> (%n. f (Suc n)) l"
-  by (import seq SEQ_SUC)
-
-lemma SEQ_ABS: "hol4--> (%n. abs (f n)) 0 = hol4--> f 0"
-  by (import seq SEQ_ABS)
-
-lemma SEQ_ABS_IMP: "hol4--> f l ==> hol4--> (%n. abs (f n)) (abs l)"
-  by (import seq SEQ_ABS_IMP)
-
-lemma SEQ_INV0: "(!!y. EX N. ALL n>=N. y < f n) ==> hol4--> (%n. inverse (f n)) 0"
-  by (import seq SEQ_INV0)
-
-lemma SEQ_POWER_ABS: "abs c < 1 ==> hol4--> (op ^ (abs c)) 0"
-  by (import seq SEQ_POWER_ABS)
-
-lemma SEQ_POWER: "abs c < 1 ==> hol4--> (op ^ c) 0"
-  by (import seq SEQ_POWER)
-
-lemma NEST_LEMMA: "(ALL n. f n <= f (Suc n)) & (ALL n. g (Suc n) <= g n) & (ALL n. f n <= g n)
-==> EX l m.
-       l <= m &
-       ((ALL n. f n <= l) & hol4--> f l) & (ALL n. m <= g n) & hol4--> g m"
-  by (import seq NEST_LEMMA)
-
-lemma NEST_LEMMA_UNIQ: "(ALL n. f n <= f (Suc n)) &
-(ALL n. g (Suc n) <= g n) & (ALL n. f n <= g n) & hol4--> (%n. f n - g n) 0
-==> EX x. ((ALL n. f n <= x) & hol4--> f x) &
-          (ALL n. x <= g n) & hol4--> g x"
-  by (import seq NEST_LEMMA_UNIQ)
-
-consts
-  sums :: "(nat => real) => real => bool" 
-
-defs
-  sums_def: "seq.sums == %f. hol4--> (%n. real.sum (0, n) f)"
-
-lemma sums: "seq.sums f s = hol4--> (%n. real.sum (0, n) f) s"
-  by (import seq sums)
-
-consts
-  summable :: "(nat => real) => bool" 
-
-defs
-  summable_def: "seq.summable == %f. Ex (seq.sums f)"
-
-lemma summable: "seq.summable f = Ex (seq.sums f)"
-  by (import seq summable)
-
-consts
-  suminf :: "(nat => real) => real" 
-
-defs
-  suminf_def: "seq.suminf == %f. Eps (seq.sums f)"
-
-lemma suminf: "seq.suminf f = Eps (seq.sums f)"
-  by (import seq suminf)
-
-lemma SUM_SUMMABLE: "seq.sums f l ==> seq.summable f"
-  by (import seq SUM_SUMMABLE)
-
-lemma SUMMABLE_SUM: "seq.summable f ==> seq.sums f (seq.suminf f)"
-  by (import seq SUMMABLE_SUM)
-
-lemma SUM_UNIQ: "seq.sums f x ==> x = seq.suminf f"
-  by (import seq SUM_UNIQ)
-
-lemma SER_0: "(!!m. n <= m ==> f m = 0) ==> seq.sums f (real.sum (0, n) f)"
-  by (import seq SER_0)
-
-lemma SER_POS_LE: "seq.summable f & (ALL m>=n. 0 <= f m) ==> real.sum (0, n) f <= seq.suminf f"
-  by (import seq SER_POS_LE)
-
-lemma SER_POS_LT: "seq.summable f & (ALL m>=n. 0 < f m) ==> real.sum (0, n) f < seq.suminf f"
-  by (import seq SER_POS_LT)
-
-lemma SER_GROUP: "seq.summable f & 0 < k
-==> seq.sums (%n. real.sum (n * k, k) f) (seq.suminf f)"
-  by (import seq SER_GROUP)
-
-lemma SER_PAIR: "seq.summable f ==> seq.sums (%n. real.sum (2 * n, 2) f) (seq.suminf f)"
-  by (import seq SER_PAIR)
-
-lemma SER_OFFSET: "seq.summable f
-==> seq.sums (%n. f (n + k)) (seq.suminf f - real.sum (0, k) f)"
-  by (import seq SER_OFFSET)
-
-lemma SER_POS_LT_PAIR: "seq.summable f & (ALL d. 0 < f (n + 2 * d) + f (n + (2 * d + 1)))
-==> real.sum (0, n) f < seq.suminf f"
-  by (import seq SER_POS_LT_PAIR)
-
-lemma SER_ADD: "seq.sums x x0 & seq.sums y y0 ==> seq.sums (%n. x n + y n) (x0 + y0)"
-  by (import seq SER_ADD)
-
-lemma SER_CMUL: "seq.sums x x0 ==> seq.sums (%n. c * x n) (c * x0)"
-  by (import seq SER_CMUL)
-
-lemma SER_NEG: "seq.sums x x0 ==> seq.sums (%xa. - x xa) (- x0)"
-  by (import seq SER_NEG)
-
-lemma SER_SUB: "seq.sums x x0 & seq.sums y y0 ==> seq.sums (%xa. x xa - y xa) (x0 - y0)"
-  by (import seq SER_SUB)
-
-lemma SER_CDIV: "seq.sums x x0 ==> seq.sums (%xa. x xa / c) (x0 / c)"
-  by (import seq SER_CDIV)
-
-lemma SER_CAUCHY: "seq.summable f =
-(ALL e>0. EX N. ALL m n. N <= m --> abs (real.sum (m, n) f) < e)"
-  by (import seq SER_CAUCHY)
-
-lemma SER_ZERO: "seq.summable f ==> hol4--> f 0"
-  by (import seq SER_ZERO)
-
-lemma SER_COMPAR: "(EX x. ALL xa>=x. abs (f xa) <= g xa) & seq.summable g ==> seq.summable f"
-  by (import seq SER_COMPAR)
-
-lemma SER_COMPARA: "(EX x. ALL xa>=x. abs (f xa) <= g xa) & seq.summable g
-==> seq.summable (%k. abs (f k))"
-  by (import seq SER_COMPARA)
-
-lemma SER_LE: "(ALL n. f n <= g n) & seq.summable f & seq.summable g
-==> seq.suminf f <= seq.suminf g"
-  by (import seq SER_LE)
-
-lemma SER_LE2: "(ALL n. abs (f n) <= g n) & seq.summable g
-==> seq.summable f & seq.suminf f <= seq.suminf g"
-  by (import seq SER_LE2)
-
-lemma SER_ACONV: "seq.summable (%n. abs (f n)) ==> seq.summable f"
-  by (import seq SER_ACONV)
-
-lemma SER_ABS: "seq.summable (%n. abs (f n))
-==> abs (seq.suminf f) <= seq.suminf (%n. abs (f n))"
-  by (import seq SER_ABS)
-
-lemma GP_FINITE: "x ~= 1 ==> real.sum (0, n) (op ^ x) = (x ^ n - 1) / (x - 1)"
-  by (import seq GP_FINITE)
-
-lemma GP: "abs x < 1 ==> seq.sums (op ^ x) (inverse (1 - x))"
-  by (import seq GP)
-
-lemma SER_RATIO: "c < 1 & (ALL n>=N. abs (f (Suc n)) <= c * abs (f n)) ==> seq.summable f"
-  by (import seq SER_RATIO)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" lim
-
-definition
-  tends_real_real :: "(real => real) => real => real => bool"  where
-  "tends_real_real == %f l x0. tends f l (mtop mr1, nets.tendsto (mr1, x0))"
-
-lemma tends_real_real: "tends_real_real f l x0 = tends f l (mtop mr1, nets.tendsto (mr1, x0))"
-  by (import lim tends_real_real)
-
-lemma LIM: "tends_real_real f y0 x0 =
-(ALL e>0.
-    EX d>0.
-       ALL x. 0 < abs (x - x0) & abs (x - x0) < d --> abs (f x - y0) < e)"
-  by (import lim LIM)
-
-lemma LIM_CONST: "tends_real_real (%x. k) k x"
-  by (import lim LIM_CONST)
-
-lemma LIM_ADD: "tends_real_real f l x & tends_real_real g m x
-==> tends_real_real (%x. f x + g x) (l + m) x"
-  by (import lim LIM_ADD)
-
-lemma LIM_MUL: "tends_real_real f l x & tends_real_real g m x
-==> tends_real_real (%x. f x * g x) (l * m) x"
-  by (import lim LIM_MUL)
-
-lemma LIM_NEG: "tends_real_real f l x = tends_real_real (%x. - f x) (- l) x"
-  by (import lim LIM_NEG)
-
-lemma LIM_INV: "tends_real_real f l x & l ~= 0
-==> tends_real_real (%x. inverse (f x)) (inverse l) x"
-  by (import lim LIM_INV)
-
-lemma LIM_SUB: "tends_real_real f l x & tends_real_real g m x
-==> tends_real_real (%x. f x - g x) (l - m) x"
-  by (import lim LIM_SUB)
-
-lemma LIM_DIV: "tends_real_real f l x & tends_real_real g m x & m ~= 0
-==> tends_real_real (%x. f x / g x) (l / m) x"
-  by (import lim LIM_DIV)
-
-lemma LIM_NULL: "tends_real_real f l x = tends_real_real (%x. f x - l) 0 x"
-  by (import lim LIM_NULL)
-
-lemma LIM_X: "tends_real_real (%x. x) x0 x0"
-  by (import lim LIM_X)
-
-lemma LIM_UNIQ: "tends_real_real f l x & tends_real_real f m x ==> l = m"
-  by (import lim LIM_UNIQ)
-
-lemma LIM_EQUAL: "(!!x. x ~= x0 ==> f x = g x)
-==> tends_real_real f l x0 = tends_real_real g l x0"
-  by (import lim LIM_EQUAL)
-
-lemma LIM_TRANSFORM: "tends_real_real (%x. f x - g x) 0 x0 & tends_real_real g l x0
-==> tends_real_real f l x0"
-  by (import lim LIM_TRANSFORM)
-
-definition
-  diffl :: "(real => real) => real => real => bool"  where
-  "diffl == %f l x. tends_real_real (%h. (f (x + h) - f x) / h) l 0"
-
-lemma diffl: "diffl f l x = tends_real_real (%h. (f (x + h) - f x) / h) l 0"
-  by (import lim diffl)
-
-definition
-  contl :: "(real => real) => real => bool"  where
-  "contl == %f x. tends_real_real (%h. f (x + h)) (f x) 0"
-
-lemma contl: "contl f x = tends_real_real (%h. f (x + h)) (f x) 0"
-  by (import lim contl)
-
-consts
-  differentiable :: "(real => real) => real => bool" 
-
-defs
-  differentiable_def: "lim.differentiable == %f x. EX l. diffl f l x"
-
-lemma differentiable: "lim.differentiable f x = (EX l. diffl f l x)"
-  by (import lim differentiable)
-
-lemma DIFF_UNIQ: "diffl f l x & diffl f m x ==> l = m"
-  by (import lim DIFF_UNIQ)
-
-lemma DIFF_CONT: "diffl f l x ==> contl f x"
-  by (import lim DIFF_CONT)
-
-lemma CONTL_LIM: "contl f x = tends_real_real f (f x) x"
-  by (import lim CONTL_LIM)
-
-lemma DIFF_CARAT: "diffl f l x =
-(EX g. (ALL z. f z - f x = g z * (z - x)) & contl g x & g x = l)"
-  by (import lim DIFF_CARAT)
-
-lemma CONT_CONST: "contl (%x. k) x"
-  by (import lim CONT_CONST)
-
-lemma CONT_ADD: "contl f x & contl g x ==> contl (%x. f x + g x) x"
-  by (import lim CONT_ADD)
-
-lemma CONT_MUL: "contl f x & contl g x ==> contl (%x. f x * g x) x"
-  by (import lim CONT_MUL)
-
-lemma CONT_NEG: "contl f x ==> contl (%x. - f x) x"
-  by (import lim CONT_NEG)
-
-lemma CONT_INV: "contl f x & f x ~= 0 ==> contl (%x. inverse (f x)) x"
-  by (import lim CONT_INV)
-
-lemma CONT_SUB: "contl f x & contl g x ==> contl (%x. f x - g x) x"
-  by (import lim CONT_SUB)
-
-lemma CONT_DIV: "contl f x & contl g x & g x ~= 0 ==> contl (%x. f x / g x) x"
-  by (import lim CONT_DIV)
-
-lemma CONT_COMPOSE: "contl f x & contl g (f x) ==> contl (%x. g (f x)) x"
-  by (import lim CONT_COMPOSE)
-
-lemma IVT: "a <= b & (f a <= y & y <= f b) & (ALL x. a <= x & x <= b --> contl f x)
-==> EX x>=a. x <= b & f x = y"
-  by (import lim IVT)
-
-lemma IVT2: "a <= b & (f b <= y & y <= f a) & (ALL x. a <= x & x <= b --> contl f x)
-==> EX x>=a. x <= b & f x = y"
-  by (import lim IVT2)
-
-lemma DIFF_CONST: "diffl (%x. k) 0 x"
-  by (import lim DIFF_CONST)
-
-lemma DIFF_ADD: "diffl f l x & diffl g m x ==> diffl (%x. f x + g x) (l + m) x"
-  by (import lim DIFF_ADD)
-
-lemma DIFF_MUL: "diffl f l x & diffl g m x ==> diffl (%x. f x * g x) (l * g x + m * f x) x"
-  by (import lim DIFF_MUL)
-
-lemma DIFF_CMUL: "diffl f l x ==> diffl (%x. c * f x) (c * l) x"
-  by (import lim DIFF_CMUL)
-
-lemma DIFF_NEG: "diffl f l x ==> diffl (%x. - f x) (- l) x"
-  by (import lim DIFF_NEG)
-
-lemma DIFF_SUB: "diffl f l x & diffl g m x ==> diffl (%x. f x - g x) (l - m) x"
-  by (import lim DIFF_SUB)
-
-lemma DIFF_CHAIN: "diffl f l (g x) & diffl g m x ==> diffl (%x. f (g x)) (l * m) x"
-  by (import lim DIFF_CHAIN)
-
-lemma DIFF_X: "diffl (%x. x) 1 x"
-  by (import lim DIFF_X)
-
-lemma DIFF_POW: "diffl (%x. x ^ n) (real n * x ^ (n - 1)) x"
-  by (import lim DIFF_POW)
-
-lemma DIFF_XM1: "x ~= 0 ==> diffl inverse (- (inverse x ^ 2)) x"
-  by (import lim DIFF_XM1)
-
-lemma DIFF_INV: "diffl f l x & f x ~= 0 ==> diffl (%x. inverse (f x)) (- (l / f x ^ 2)) x"
-  by (import lim DIFF_INV)
-
-lemma DIFF_DIV: "diffl f l x & diffl g m x & g x ~= 0
-==> diffl (%x. f x / g x) ((l * g x - m * f x) / g x ^ 2) x"
-  by (import lim DIFF_DIV)
-
-lemma DIFF_SUM: "(!!r. m <= r & r < m + n ==> diffl (f r) (f' r x) x)
-==> diffl (%x. real.sum (m, n) (%n. f n x)) (real.sum (m, n) (%r. f' r x)) x"
-  by (import lim DIFF_SUM)
-
-lemma CONT_BOUNDED: "a <= b & (ALL x. a <= x & x <= b --> contl f x)
-==> EX M. ALL x. a <= x & x <= b --> f x <= M"
-  by (import lim CONT_BOUNDED)
-
-lemma CONT_HASSUP: "a <= b & (ALL x. a <= x & x <= b --> contl f x)
-==> EX M. (ALL x. a <= x & x <= b --> f x <= M) &
-          (ALL N<M. EX x>=a. x <= b & N < f x)"
-  by (import lim CONT_HASSUP)
-
-lemma CONT_ATTAINS: "a <= b & (ALL x. a <= x & x <= b --> contl f x)
-==> EX x. (ALL xa. a <= xa & xa <= b --> f xa <= x) &
-          (EX xa>=a. xa <= b & f xa = x)"
-  by (import lim CONT_ATTAINS)
-
-lemma CONT_ATTAINS2: "a <= b & (ALL x. a <= x & x <= b --> contl f x)
-==> EX x. (ALL xa. a <= xa & xa <= b --> x <= f xa) &
-          (EX xa>=a. xa <= b & f xa = x)"
-  by (import lim CONT_ATTAINS2)
-
-lemma CONT_ATTAINS_ALL: "a <= b & (ALL x. a <= x & x <= b --> contl f x)
-==> EX x M.
-       x <= M &
-       (ALL y. x <= y & y <= M --> (EX x>=a. x <= b & f x = y)) &
-       (ALL xa. a <= xa & xa <= b --> x <= f xa & f xa <= M)"
-  by (import lim CONT_ATTAINS_ALL)
-
-lemma DIFF_LINC: "diffl f l x & 0 < l ==> EX d>0. ALL h. 0 < h & h < d --> f x < f (x + h)"
-  by (import lim DIFF_LINC)
-
-lemma DIFF_LDEC: "diffl f l x & l < 0 ==> EX d>0. ALL h. 0 < h & h < d --> f x < f (x - h)"
-  by (import lim DIFF_LDEC)
-
-lemma DIFF_LMAX: "diffl f l x & (EX d>0. ALL y. abs (x - y) < d --> f y <= f x) ==> l = 0"
-  by (import lim DIFF_LMAX)
-
-lemma DIFF_LMIN: "diffl f l x & (EX d>0. ALL y. abs (x - y) < d --> f x <= f y) ==> l = 0"
-  by (import lim DIFF_LMIN)
-
-lemma DIFF_LCONST: "diffl f l x & (EX d>0. ALL y. abs (x - y) < d --> f y = f x) ==> l = 0"
-  by (import lim DIFF_LCONST)
-
-lemma ROLLE: "a < b &
-f a = f b &
-(ALL x. a <= x & x <= b --> contl f x) &
-(ALL x. a < x & x < b --> lim.differentiable f x)
-==> EX z>a. z < b & diffl f 0 z"
-  by (import lim ROLLE)
-
-lemma MVT: "a < b &
-(ALL x. a <= x & x <= b --> contl f x) &
-(ALL x. a < x & x < b --> lim.differentiable f x)
-==> EX l z. a < z & z < b & diffl f l z & f b - f a = (b - a) * l"
-  by (import lim MVT)
-
-lemma DIFF_ISCONST_END: "a < b &
-(ALL x. a <= x & x <= b --> contl f x) &
-(ALL x. a < x & x < b --> diffl f 0 x)
-==> f b = f a"
-  by (import lim DIFF_ISCONST_END)
-
-lemma DIFF_ISCONST: "[| a < b &
-   (ALL x. a <= x & x <= b --> contl f x) &
-   (ALL x. a < x & x < b --> diffl f 0 x);
-   a <= x & x <= b |]
-==> f x = f a"
-  by (import lim DIFF_ISCONST)
-
-lemma DIFF_ISCONST_ALL: "(!!x. diffl f 0 x) ==> f x = f y"
-  by (import lim DIFF_ISCONST_ALL)
-
-lemma INTERVAL_ABS: "((x::real) - (d::real) <= (z::real) & z <= x + d) = (abs (z - x) <= d)"
-  by (import lim INTERVAL_ABS)
-
-lemma CONT_INJ_LEMMA: "0 < d &
-(ALL z. abs (z - x) <= d --> g (f z) = z) &
-(ALL z. abs (z - x) <= d --> contl f z)
-==> ~ (ALL z. abs (z - x) <= d --> f z <= f x)"
-  by (import lim CONT_INJ_LEMMA)
-
-lemma CONT_INJ_LEMMA2: "0 < d &
-(ALL z. abs (z - x) <= d --> g (f z) = z) &
-(ALL z. abs (z - x) <= d --> contl f z)
-==> ~ (ALL z. abs (z - x) <= d --> f x <= f z)"
-  by (import lim CONT_INJ_LEMMA2)
-
-lemma CONT_INJ_RANGE: "0 < d &
-(ALL z. abs (z - x) <= d --> g (f z) = z) &
-(ALL z. abs (z - x) <= d --> contl f z)
-==> EX e>0. ALL y. abs (y - f x) <= e --> (EX z. abs (z - x) <= d & f z = y)"
-  by (import lim CONT_INJ_RANGE)
-
-lemma CONT_INVERSE: "0 < d &
-(ALL z. abs (z - x) <= d --> g (f z) = z) &
-(ALL z. abs (z - x) <= d --> contl f z)
-==> contl g (f x)"
-  by (import lim CONT_INVERSE)
-
-lemma DIFF_INVERSE: "0 < d &
-(ALL z. abs (z - x) <= d --> g (f z) = z) &
-(ALL z. abs (z - x) <= d --> contl f z) & diffl f l x & l ~= 0
-==> diffl g (inverse l) (f x)"
-  by (import lim DIFF_INVERSE)
-
-lemma DIFF_INVERSE_LT: "0 < d &
-(ALL z. abs (z - x) < d --> g (f z) = z) &
-(ALL z. abs (z - x) < d --> contl f z) & diffl f l x & l ~= 0
-==> diffl g (inverse l) (f x)"
-  by (import lim DIFF_INVERSE_LT)
-
-lemma INTERVAL_CLEMMA: "(a::real) < (x::real) & x < (b::real)
-==> EX d>0::real. ALL y::real. abs (y - x) <= d --> a < y & y < b"
-  by (import lim INTERVAL_CLEMMA)
-
-lemma DIFF_INVERSE_OPEN: "a < x &
-x < b &
-(ALL z. a < z & z < b --> g (f z) = z & contl f z) & diffl f l x & l ~= 0
-==> diffl g (inverse l) (f x)"
-  by (import lim DIFF_INVERSE_OPEN)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" powser
-
-lemma POWDIFF_LEMMA: "real.sum (0, Suc n) (%p. x ^ p * y ^ (Suc n - p)) =
-y * real.sum (0, Suc n) (%p. x ^ p * y ^ (n - p))"
-  by (import powser POWDIFF_LEMMA)
-
-lemma POWDIFF: "x ^ Suc n - y ^ Suc n =
-(x - y) * real.sum (0, Suc n) (%p. x ^ p * y ^ (n - p))"
-  by (import powser POWDIFF)
-
-lemma POWREV: "real.sum (0, Suc n) (%xa. x ^ xa * y ^ (n - xa)) =
-real.sum (0, Suc n) (%xa. x ^ (n - xa) * y ^ xa)"
-  by (import powser POWREV)
-
-lemma POWSER_INSIDEA: "seq.summable (%n. f n * x ^ n) & abs z < abs x
-==> seq.summable (%n. abs (f n) * z ^ n)"
-  by (import powser POWSER_INSIDEA)
-
-lemma POWSER_INSIDE: "seq.summable (%n. f n * x ^ n) & abs z < abs x
-==> seq.summable (%n. f n * z ^ n)"
-  by (import powser POWSER_INSIDE)
-
-consts
-  diffs :: "(nat => real) => nat => real" 
-
-defs
-  diffs_def: "powser.diffs == %c n. real (Suc n) * c (Suc n)"
-
-lemma diffs: "powser.diffs c = (%n. real (Suc n) * c (Suc n))"
-  by (import powser diffs)
-
-lemma DIFFS_NEG: "powser.diffs (%n. - c n) = (%x. - powser.diffs c x)"
-  by (import powser DIFFS_NEG)
-
-lemma DIFFS_LEMMA: "real.sum (0, n) (%n. powser.diffs c n * x ^ n) =
-real.sum (0, n) (%n. real n * (c n * x ^ (n - 1))) +
-real n * (c n * x ^ (n - 1))"
-  by (import powser DIFFS_LEMMA)
-
-lemma DIFFS_LEMMA2: "real.sum (0, n) (%n. real n * (c n * x ^ (n - 1))) =
-real.sum (0, n) (%n. powser.diffs c n * x ^ n) -
-real n * (c n * x ^ (n - 1))"
-  by (import powser DIFFS_LEMMA2)
-
-lemma DIFFS_EQUIV: "seq.summable (%n. powser.diffs c n * x ^ n)
-==> seq.sums (%n. real n * (c n * x ^ (n - 1)))
-     (seq.suminf (%n. powser.diffs c n * x ^ n))"
-  by (import powser DIFFS_EQUIV)
-
-lemma TERMDIFF_LEMMA1: "real.sum (0, m) (%p. (z + h) ^ (m - p) * z ^ p - z ^ m) =
-real.sum (0, m) (%p. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))"
-  by (import powser TERMDIFF_LEMMA1)
-
-lemma TERMDIFF_LEMMA2: "h ~= 0
-==> ((z + h) ^ n - z ^ n) / h - real n * z ^ (n - 1) =
-    h *
-    real.sum (0, n - 1)
-     (%p. z ^ p *
-          real.sum (0, n - 1 - p) (%q. (z + h) ^ q * z ^ (n - 2 - p - q)))"
-  by (import powser TERMDIFF_LEMMA2)
-
-lemma TERMDIFF_LEMMA3: "h ~= 0 & abs z <= k' & abs (z + h) <= k'
-==> abs (((z + h) ^ n - z ^ n) / h - real n * z ^ (n - 1))
-    <= real n * (real (n - 1) * (k' ^ (n - 2) * abs h))"
-  by (import powser TERMDIFF_LEMMA3)
-
-lemma TERMDIFF_LEMMA4: "0 < k & (ALL h. 0 < abs h & abs h < k --> abs (f h) <= k' * abs h)
-==> tends_real_real f 0 0"
-  by (import powser TERMDIFF_LEMMA4)
-
-lemma TERMDIFF_LEMMA5: "0 < k &
-seq.summable f &
-(ALL h. 0 < abs h & abs h < k --> (ALL n. abs (g h n) <= f n * abs h))
-==> tends_real_real (%h. seq.suminf (g h)) 0 0"
-  by (import powser TERMDIFF_LEMMA5)
-
-lemma TERMDIFF: "seq.summable (%n. c n * k' ^ n) &
-seq.summable (%n. powser.diffs c n * k' ^ n) &
-seq.summable (%n. powser.diffs (powser.diffs c) n * k' ^ n) & abs x < abs k'
-==> diffl (%x. seq.suminf (%n. c n * x ^ n))
-     (seq.suminf (%n. powser.diffs c n * x ^ n)) x"
-  by (import powser TERMDIFF)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" transc
-
-consts
-  exp :: "real => real" 
-
-defs
-  exp_def: "transc.exp == %x. seq.suminf (%n. inverse (real (FACT n)) * x ^ n)"
-
-lemma exp: "transc.exp x = seq.suminf (%n. inverse (real (FACT n)) * x ^ n)"
-  by (import transc exp)
-
-consts
-  cos :: "real => real" 
-
-defs
-  cos_def: "transc.cos ==
-%x. seq.suminf
-     (%n. (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
-
-lemma cos: "transc.cos x =
-seq.suminf
- (%n. (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
-  by (import transc cos)
-
-consts
-  sin :: "real => real" 
-
-defs
-  sin_def: "transc.sin ==
-%x. seq.suminf
-     (%n. (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
-          x ^ n)"
-
-lemma sin: "transc.sin x =
-seq.suminf
- (%n. (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
-      x ^ n)"
-  by (import transc sin)
-
-lemma EXP_CONVERGES: "seq.sums (%n. inverse (real (FACT n)) * x ^ n) (transc.exp x)"
-  by (import transc EXP_CONVERGES)
-
-lemma SIN_CONVERGES: "seq.sums
- (%n. (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
-      x ^ n)
- (transc.sin x)"
-  by (import transc SIN_CONVERGES)
-
-lemma COS_CONVERGES: "seq.sums
- (%n. (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)
- (transc.cos x)"
-  by (import transc COS_CONVERGES)
-
-lemma EXP_FDIFF: "powser.diffs (%n. inverse (real (FACT n))) = (%n. inverse (real (FACT n)))"
-  by (import transc EXP_FDIFF)
-
-lemma SIN_FDIFF: "powser.diffs
- (%n. if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) =
-(%n. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0)"
-  by (import transc SIN_FDIFF)
-
-lemma COS_FDIFF: "powser.diffs (%n. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) =
-(%n. - (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)))"
-  by (import transc COS_FDIFF)
-
-lemma SIN_NEGLEMMA: "- transc.sin x =
-seq.suminf
- (%n. - ((if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
-         x ^ n))"
-  by (import transc SIN_NEGLEMMA)
-
-lemma DIFF_EXP: "diffl transc.exp (transc.exp x) x"
-  by (import transc DIFF_EXP)
-
-lemma DIFF_SIN: "diffl transc.sin (transc.cos x) x"
-  by (import transc DIFF_SIN)
-
-lemma DIFF_COS: "diffl transc.cos (- transc.sin x) x"
-  by (import transc DIFF_COS)
-
-lemma DIFF_COMPOSITE: "(diffl f l x & f x ~= 0 --> diffl (%x. inverse (f x)) (- (l / f x ^ 2)) x) &
-(diffl f l x & diffl g m x & g x ~= 0 -->
- diffl (%x. f x / g x) ((l * g x - m * f x) / g x ^ 2) x) &
-(diffl f l x & diffl g m x --> diffl (%x. f x + g x) (l + m) x) &
-(diffl f l x & diffl g m x -->
- diffl (%x. f x * g x) (l * g x + m * f x) x) &
-(diffl f l x & diffl g m x --> diffl (%x. f x - g x) (l - m) x) &
-(diffl f l x --> diffl (%x. - f x) (- l) x) &
-(diffl g m x --> diffl (%x. g x ^ n) (real n * g x ^ (n - 1) * m) x) &
-(diffl g m x --> diffl (%x. transc.exp (g x)) (transc.exp (g x) * m) x) &
-(diffl g m x --> diffl (%x. transc.sin (g x)) (transc.cos (g x) * m) x) &
-(diffl g m x --> diffl (%x. transc.cos (g x)) (- transc.sin (g x) * m) x)"
-  by (import transc DIFF_COMPOSITE)
-
-lemma EXP_0: "transc.exp 0 = 1"
-  by (import transc EXP_0)
-
-lemma EXP_LE_X: "0 <= x ==> 1 + x <= transc.exp x"
-  by (import transc EXP_LE_X)
-
-lemma EXP_LT_1: "0 < x ==> 1 < transc.exp x"
-  by (import transc EXP_LT_1)
-
-lemma EXP_ADD_MUL: "transc.exp (x + y) * transc.exp (- x) = transc.exp y"
-  by (import transc EXP_ADD_MUL)
-
-lemma EXP_NEG_MUL: "transc.exp x * transc.exp (- x) = 1"
-  by (import transc EXP_NEG_MUL)
-
-lemma EXP_NEG_MUL2: "transc.exp (- x) * transc.exp x = 1"
-  by (import transc EXP_NEG_MUL2)
-
-lemma EXP_NEG: "transc.exp (- x) = inverse (transc.exp x)"
-  by (import transc EXP_NEG)
-
-lemma EXP_ADD: "transc.exp (x + y) = transc.exp x * transc.exp y"
-  by (import transc EXP_ADD)
-
-lemma EXP_POS_LE: "0 <= transc.exp x"
-  by (import transc EXP_POS_LE)
-
-lemma EXP_NZ: "transc.exp x ~= 0"
-  by (import transc EXP_NZ)
-
-lemma EXP_POS_LT: "0 < transc.exp x"
-  by (import transc EXP_POS_LT)
-
-lemma EXP_N: "transc.exp (real n * x) = transc.exp x ^ n"
-  by (import transc EXP_N)
-
-lemma EXP_SUB: "transc.exp (x - y) = transc.exp x / transc.exp y"
-  by (import transc EXP_SUB)
-
-lemma EXP_MONO_IMP: "x < y ==> transc.exp x < transc.exp y"
-  by (import transc EXP_MONO_IMP)
-
-lemma EXP_MONO_LT: "(transc.exp x < transc.exp y) = (x < y)"
-  by (import transc EXP_MONO_LT)
-
-lemma EXP_MONO_LE: "(transc.exp x <= transc.exp y) = (x <= y)"
-  by (import transc EXP_MONO_LE)
-
-lemma EXP_INJ: "(transc.exp x = transc.exp y) = (x = y)"
-  by (import transc EXP_INJ)
-
-lemma EXP_TOTAL_LEMMA: "1 <= y ==> EX x>=0. x <= y - 1 & transc.exp x = y"
-  by (import transc EXP_TOTAL_LEMMA)
-
-lemma EXP_TOTAL: "0 < y ==> EX x. transc.exp x = y"
-  by (import transc EXP_TOTAL)
-
-consts
-  ln :: "real => real" 
-
-defs
-  ln_def: "transc.ln == %x. SOME u. transc.exp u = x"
-
-lemma ln: "transc.ln x = (SOME u. transc.exp u = x)"
-  by (import transc ln)
-
-lemma LN_EXP: "transc.ln (transc.exp x) = x"
-  by (import transc LN_EXP)
-
-lemma EXP_LN: "(transc.exp (transc.ln x) = x) = (0 < x)"
-  by (import transc EXP_LN)
-
-lemma LN_MUL: "0 < x & 0 < y ==> transc.ln (x * y) = transc.ln x + transc.ln y"
-  by (import transc LN_MUL)
-
-lemma LN_INJ: "0 < x & 0 < y ==> (transc.ln x = transc.ln y) = (x = y)"
-  by (import transc LN_INJ)
-
-lemma LN_1: "transc.ln 1 = 0"
-  by (import transc LN_1)
-
-lemma LN_INV: "0 < x ==> transc.ln (inverse x) = - transc.ln x"
-  by (import transc LN_INV)
-
-lemma LN_DIV: "0 < x & 0 < y ==> transc.ln (x / y) = transc.ln x - transc.ln y"
-  by (import transc LN_DIV)
-
-lemma LN_MONO_LT: "0 < x & 0 < y ==> (transc.ln x < transc.ln y) = (x < y)"
-  by (import transc LN_MONO_LT)
-
-lemma LN_MONO_LE: "0 < x & 0 < y ==> (transc.ln x <= transc.ln y) = (x <= y)"
-  by (import transc LN_MONO_LE)
-
-lemma LN_POW: "0 < x ==> transc.ln (x ^ n) = real n * transc.ln x"
-  by (import transc LN_POW)
-
-lemma LN_LE: "0 <= x ==> transc.ln (1 + x) <= x"
-  by (import transc LN_LE)
-
-lemma LN_LT_X: "0 < x ==> transc.ln x < x"
-  by (import transc LN_LT_X)
-
-lemma LN_POS: "1 <= x ==> 0 <= transc.ln x"
-  by (import transc LN_POS)
-
-consts
-  root :: "nat => real => real" 
-
-defs
-  root_def: "transc.root == %n x. SOME u. (0 < x --> 0 < u) & u ^ n = x"
-
-lemma root: "transc.root n x = (SOME u. (0 < x --> 0 < u) & u ^ n = x)"
-  by (import transc root)
-
-consts
-  sqrt :: "real => real" 
-
-defs
-  sqrt_def: "transc.sqrt == transc.root 2"
-
-lemma sqrt: "transc.sqrt x = transc.root 2 x"
-  by (import transc sqrt)
-
-lemma ROOT_LT_LEMMA: "0 < x ==> transc.exp (transc.ln x / real (Suc n)) ^ Suc n = x"
-  by (import transc ROOT_LT_LEMMA)
-
-lemma ROOT_LN: "0 < x ==> transc.root (Suc n) x = transc.exp (transc.ln x / real (Suc n))"
-  by (import transc ROOT_LN)
-
-lemma ROOT_0: "transc.root (Suc n) 0 = 0"
-  by (import transc ROOT_0)
-
-lemma ROOT_1: "transc.root (Suc n) 1 = 1"
-  by (import transc ROOT_1)
-
-lemma ROOT_POS_LT: "0 < x ==> 0 < transc.root (Suc n) x"
-  by (import transc ROOT_POS_LT)
-
-lemma ROOT_POW_POS: "0 <= x ==> transc.root (Suc n) x ^ Suc n = x"
-  by (import transc ROOT_POW_POS)
-
-lemma POW_ROOT_POS: "0 <= x ==> transc.root (Suc n) (x ^ Suc n) = x"
-  by (import transc POW_ROOT_POS)
-
-lemma ROOT_POS: "0 <= x ==> 0 <= transc.root (Suc n) x"
-  by (import transc ROOT_POS)
-
-lemma ROOT_POS_UNIQ: "0 <= x & 0 <= y & y ^ Suc n = x ==> transc.root (Suc n) x = y"
-  by (import transc ROOT_POS_UNIQ)
-
-lemma ROOT_MUL: "0 <= x & 0 <= y
-==> transc.root (Suc n) (x * y) =
-    transc.root (Suc n) x * transc.root (Suc n) y"
-  by (import transc ROOT_MUL)
-
-lemma ROOT_INV: "0 <= x ==> transc.root (Suc n) (inverse x) = inverse (transc.root (Suc n) x)"
-  by (import transc ROOT_INV)
-
-lemma ROOT_DIV: "0 <= xa & 0 <= xb
-==> transc.root (Suc x) (xa / xb) =
-    transc.root (Suc x) xa / transc.root (Suc x) xb"
-  by (import transc ROOT_DIV)
-
-lemma ROOT_MONO_LE: "0 <= x & x <= y ==> transc.root (Suc n) x <= transc.root (Suc n) y"
-  by (import transc ROOT_MONO_LE)
-
-lemma SQRT_0: "transc.sqrt 0 = 0"
-  by (import transc SQRT_0)
-
-lemma SQRT_1: "transc.sqrt 1 = 1"
-  by (import transc SQRT_1)
-
-lemma SQRT_POS_LT: "0 < x ==> 0 < transc.sqrt x"
-  by (import transc SQRT_POS_LT)
-
-lemma SQRT_POS_LE: "0 <= x ==> 0 <= transc.sqrt x"
-  by (import transc SQRT_POS_LE)
-
-lemma SQRT_POW2: "(transc.sqrt x ^ 2 = x) = (0 <= x)"
-  by (import transc SQRT_POW2)
-
-lemma SQRT_POW_2: "0 <= x ==> transc.sqrt x ^ 2 = x"
-  by (import transc SQRT_POW_2)
-
-lemma POW_2_SQRT: "0 <= x ==> transc.sqrt (x ^ 2) = x"
-  by (import transc POW_2_SQRT)
-
-lemma SQRT_POS_UNIQ: "0 <= x & 0 <= xa & xa ^ 2 = x ==> transc.sqrt x = xa"
-  by (import transc SQRT_POS_UNIQ)
-
-lemma SQRT_MUL: "0 <= x & 0 <= xa ==> transc.sqrt (x * xa) = transc.sqrt x * transc.sqrt xa"
-  by (import transc SQRT_MUL)
-
-lemma SQRT_INV: "0 <= x ==> transc.sqrt (inverse x) = inverse (transc.sqrt x)"
-  by (import transc SQRT_INV)
-
-lemma SQRT_DIV: "0 <= x & 0 <= xa ==> transc.sqrt (x / xa) = transc.sqrt x / transc.sqrt xa"
-  by (import transc SQRT_DIV)
-
-lemma SQRT_MONO_LE: "0 <= x & x <= xa ==> transc.sqrt x <= transc.sqrt xa"
-  by (import transc SQRT_MONO_LE)
-
-lemma SQRT_EVEN_POW2: "EVEN n ==> transc.sqrt (2 ^ n) = 2 ^ (n div 2)"
-  by (import transc SQRT_EVEN_POW2)
-
-lemma REAL_DIV_SQRT: "0 <= x ==> x / transc.sqrt x = transc.sqrt x"
-  by (import transc REAL_DIV_SQRT)
-
-lemma SQRT_EQ: "x ^ 2 = y & 0 <= x ==> x = transc.sqrt y"
-  by (import transc SQRT_EQ)
-
-lemma SIN_0: "transc.sin 0 = 0"
-  by (import transc SIN_0)
-
-lemma COS_0: "transc.cos 0 = 1"
-  by (import transc COS_0)
-
-lemma SIN_CIRCLE: "transc.sin x ^ 2 + transc.cos x ^ 2 = 1"
-  by (import transc SIN_CIRCLE)
-
-lemma SIN_BOUND: "abs (transc.sin x) <= 1"
-  by (import transc SIN_BOUND)
-
-lemma SIN_BOUNDS: "- 1 <= transc.sin x & transc.sin x <= 1"
-  by (import transc SIN_BOUNDS)
-
-lemma COS_BOUND: "abs (transc.cos x) <= 1"
-  by (import transc COS_BOUND)
-
-lemma COS_BOUNDS: "- 1 <= transc.cos x & transc.cos x <= 1"
-  by (import transc COS_BOUNDS)
-
-lemma SIN_COS_ADD: "(transc.sin (x + y) -
- (transc.sin x * transc.cos y + transc.cos x * transc.sin y)) ^
-2 +
-(transc.cos (x + y) -
- (transc.cos x * transc.cos y - transc.sin x * transc.sin y)) ^
-2 =
-0"
-  by (import transc SIN_COS_ADD)
-
-lemma SIN_COS_NEG: "(transc.sin (- x) + transc.sin x) ^ 2 +
-(transc.cos (- x) - transc.cos x) ^ 2 =
-0"
-  by (import transc SIN_COS_NEG)
-
-lemma SIN_ADD: "transc.sin (x + y) =
-transc.sin x * transc.cos y + transc.cos x * transc.sin y"
-  by (import transc SIN_ADD)
-
-lemma COS_ADD: "transc.cos (x + y) =
-transc.cos x * transc.cos y - transc.sin x * transc.sin y"
-  by (import transc COS_ADD)
-
-lemma SIN_NEG: "transc.sin (- x) = - transc.sin x"
-  by (import transc SIN_NEG)
-
-lemma COS_NEG: "transc.cos (- x) = transc.cos x"
-  by (import transc COS_NEG)
-
-lemma SIN_DOUBLE: "transc.sin (2 * x) = 2 * (transc.sin x * transc.cos x)"
-  by (import transc SIN_DOUBLE)
-
-lemma COS_DOUBLE: "transc.cos (2 * x) = transc.cos x ^ 2 - transc.sin x ^ 2"
-  by (import transc COS_DOUBLE)
-
-lemma SIN_PAIRED: "seq.sums (%n. (- 1) ^ n / real (FACT (2 * n + 1)) * x ^ (2 * n + 1))
- (transc.sin x)"
-  by (import transc SIN_PAIRED)
-
-lemma SIN_POS: "0 < x & x < 2 ==> 0 < transc.sin x"
-  by (import transc SIN_POS)
-
-lemma COS_PAIRED: "seq.sums (%n. (- 1) ^ n / real (FACT (2 * n)) * x ^ (2 * n)) (transc.cos x)"
-  by (import transc COS_PAIRED)
-
-lemma COS_2: "transc.cos 2 < 0"
-  by (import transc COS_2)
-
-lemma COS_ISZERO: "EX! x. 0 <= x & x <= 2 & transc.cos x = 0"
-  by (import transc COS_ISZERO)
-
-consts
-  pi :: "real" 
-
-defs
-  pi_def: "transc.pi == 2 * (SOME x. 0 <= x & x <= 2 & transc.cos x = 0)"
-
-lemma pi: "transc.pi = 2 * (SOME x. 0 <= x & x <= 2 & transc.cos x = 0)"
-  by (import transc pi)
-
-lemma PI2: "transc.pi / 2 = (SOME x. 0 <= x & x <= 2 & transc.cos x = 0)"
-  by (import transc PI2)
-
-lemma COS_PI2: "transc.cos (transc.pi / 2) = 0"
-  by (import transc COS_PI2)
-
-lemma PI2_BOUNDS: "0 < transc.pi / 2 & transc.pi / 2 < 2"
-  by (import transc PI2_BOUNDS)
-
-lemma PI_POS: "0 < transc.pi"
-  by (import transc PI_POS)
-
-lemma SIN_PI2: "transc.sin (transc.pi / 2) = 1"
-  by (import transc SIN_PI2)
-
-lemma COS_PI: "transc.cos transc.pi = - 1"
-  by (import transc COS_PI)
-
-lemma SIN_PI: "transc.sin transc.pi = 0"
-  by (import transc SIN_PI)
-
-lemma SIN_COS: "transc.sin x = transc.cos (transc.pi / 2 - x)"
-  by (import transc SIN_COS)
-
-lemma COS_SIN: "transc.cos x = transc.sin (transc.pi / 2 - x)"
-  by (import transc COS_SIN)
-
-lemma SIN_PERIODIC_PI: "transc.sin (x + transc.pi) = - transc.sin x"
-  by (import transc SIN_PERIODIC_PI)
-
-lemma COS_PERIODIC_PI: "transc.cos (x + transc.pi) = - transc.cos x"
-  by (import transc COS_PERIODIC_PI)
-
-lemma SIN_PERIODIC: "transc.sin (x + 2 * transc.pi) = transc.sin x"
-  by (import transc SIN_PERIODIC)
-
-lemma COS_PERIODIC: "transc.cos (x + 2 * transc.pi) = transc.cos x"
-  by (import transc COS_PERIODIC)
-
-lemma COS_NPI: "transc.cos (real n * transc.pi) = (- 1) ^ n"
-  by (import transc COS_NPI)
-
-lemma SIN_NPI: "transc.sin (real (n::nat) * transc.pi) = (0::real)"
-  by (import transc SIN_NPI)
-
-lemma SIN_POS_PI2: "0 < x & x < transc.pi / 2 ==> 0 < transc.sin x"
-  by (import transc SIN_POS_PI2)
-
-lemma COS_POS_PI2: "0 < x & x < transc.pi / 2 ==> 0 < transc.cos x"
-  by (import transc COS_POS_PI2)
-
-lemma COS_POS_PI: "- (transc.pi / 2) < x & x < transc.pi / 2 ==> 0 < transc.cos x"
-  by (import transc COS_POS_PI)
-
-lemma SIN_POS_PI: "0 < x & x < transc.pi ==> 0 < transc.sin x"
-  by (import transc SIN_POS_PI)
-
-lemma COS_POS_PI2_LE: "0 <= x & x <= transc.pi / 2 ==> 0 <= transc.cos x"
-  by (import transc COS_POS_PI2_LE)
-
-lemma COS_POS_PI_LE: "- (transc.pi / 2) <= x & x <= transc.pi / 2 ==> 0 <= transc.cos x"
-  by (import transc COS_POS_PI_LE)
-
-lemma SIN_POS_PI2_LE: "0 <= x & x <= transc.pi / 2 ==> 0 <= transc.sin x"
-  by (import transc SIN_POS_PI2_LE)
-
-lemma SIN_POS_PI_LE: "0 <= x & x <= transc.pi ==> 0 <= transc.sin x"
-  by (import transc SIN_POS_PI_LE)
-
-lemma COS_TOTAL: "- 1 <= y & y <= 1 ==> EX! x. 0 <= x & x <= transc.pi & transc.cos x = y"
-  by (import transc COS_TOTAL)
-
-lemma SIN_TOTAL: "- 1 <= y & y <= 1
-==> EX! x. - (transc.pi / 2) <= x & x <= transc.pi / 2 & transc.sin x = y"
-  by (import transc SIN_TOTAL)
-
-lemma COS_ZERO_LEMMA: "0 <= x & transc.cos x = 0 ==> EX n. ~ EVEN n & x = real n * (transc.pi / 2)"
-  by (import transc COS_ZERO_LEMMA)
-
-lemma SIN_ZERO_LEMMA: "0 <= x & transc.sin x = 0 ==> EX n. EVEN n & x = real n * (transc.pi / 2)"
-  by (import transc SIN_ZERO_LEMMA)
-
-lemma COS_ZERO: "(transc.cos x = 0) =
-((EX n. ~ EVEN n & x = real n * (transc.pi / 2)) |
- (EX n. ~ EVEN n & x = - (real n * (transc.pi / 2))))"
-  by (import transc COS_ZERO)
-
-lemma SIN_ZERO: "(transc.sin x = 0) =
-((EX n. EVEN n & x = real n * (transc.pi / 2)) |
- (EX n. EVEN n & x = - (real n * (transc.pi / 2))))"
-  by (import transc SIN_ZERO)
-
-consts
-  tan :: "real => real" 
-
-defs
-  tan_def: "transc.tan == %x. transc.sin x / transc.cos x"
-
-lemma tan: "transc.tan x = transc.sin x / transc.cos x"
-  by (import transc tan)
-
-lemma TAN_0: "transc.tan 0 = 0"
-  by (import transc TAN_0)
-
-lemma TAN_PI: "transc.tan transc.pi = 0"
-  by (import transc TAN_PI)
-
-lemma TAN_NPI: "transc.tan (real (n::nat) * transc.pi) = (0::real)"
-  by (import transc TAN_NPI)
-
-lemma TAN_NEG: "transc.tan (- x) = - transc.tan x"
-  by (import transc TAN_NEG)
-
-lemma TAN_PERIODIC: "transc.tan (x + 2 * transc.pi) = transc.tan x"
-  by (import transc TAN_PERIODIC)
-
-lemma TAN_ADD: "transc.cos x ~= 0 & transc.cos y ~= 0 & transc.cos (x + y) ~= 0
-==> transc.tan (x + y) =
-    (transc.tan x + transc.tan y) / (1 - transc.tan x * transc.tan y)"
-  by (import transc TAN_ADD)
-
-lemma TAN_DOUBLE: "transc.cos x ~= 0 & transc.cos (2 * x) ~= 0
-==> transc.tan (2 * x) = 2 * transc.tan x / (1 - transc.tan x ^ 2)"
-  by (import transc TAN_DOUBLE)
-
-lemma TAN_POS_PI2: "0 < x & x < transc.pi / 2 ==> 0 < transc.tan x"
-  by (import transc TAN_POS_PI2)
-
-lemma DIFF_TAN: "transc.cos x ~= 0 ==> diffl transc.tan (inverse (transc.cos x ^ 2)) x"
-  by (import transc DIFF_TAN)
-
-lemma TAN_TOTAL_LEMMA: "0 < y ==> EX x>0. x < transc.pi / 2 & y < transc.tan x"
-  by (import transc TAN_TOTAL_LEMMA)
-
-lemma TAN_TOTAL_POS: "0 <= y ==> EX x>=0. x < transc.pi / 2 & transc.tan x = y"
-  by (import transc TAN_TOTAL_POS)
-
-lemma TAN_TOTAL: "EX! x. - (transc.pi / 2) < x & x < transc.pi / 2 & transc.tan x = y"
-  by (import transc TAN_TOTAL)
-
-definition
-  asn :: "real => real"  where
-  "asn ==
-%y. SOME x. - (transc.pi / 2) <= x & x <= transc.pi / 2 & transc.sin x = y"
-
-lemma asn: "asn y =
-(SOME x. - (transc.pi / 2) <= x & x <= transc.pi / 2 & transc.sin x = y)"
-  by (import transc asn)
-
-definition
-  acs :: "real => real"  where
-  "acs == %y. SOME x. 0 <= x & x <= transc.pi & transc.cos x = y"
-
-lemma acs: "acs y = (SOME x. 0 <= x & x <= transc.pi & transc.cos x = y)"
-  by (import transc acs)
-
-definition
-  atn :: "real => real"  where
-  "atn ==
-%y. SOME x. - (transc.pi / 2) < x & x < transc.pi / 2 & transc.tan x = y"
-
-lemma atn: "atn y =
-(SOME x. - (transc.pi / 2) < x & x < transc.pi / 2 & transc.tan x = y)"
-  by (import transc atn)
-
-lemma ASN: "- 1 <= y & y <= 1
-==> - (transc.pi / 2) <= asn y &
-    asn y <= transc.pi / 2 & transc.sin (asn y) = y"
-  by (import transc ASN)
-
-lemma ASN_SIN: "- 1 <= y & y <= 1 ==> transc.sin (asn y) = y"
-  by (import transc ASN_SIN)
-
-lemma ASN_BOUNDS: "- 1 <= y & y <= 1 ==> - (transc.pi / 2) <= asn y & asn y <= transc.pi / 2"
-  by (import transc ASN_BOUNDS)
-
-lemma ASN_BOUNDS_LT: "- 1 < y & y < 1 ==> - (transc.pi / 2) < asn y & asn y < transc.pi / 2"
-  by (import transc ASN_BOUNDS_LT)
-
-lemma SIN_ASN: "- (transc.pi / 2) <= x & x <= transc.pi / 2 ==> asn (transc.sin x) = x"
-  by (import transc SIN_ASN)
-
-lemma ACS: "- 1 <= y & y <= 1
-==> 0 <= acs y & acs y <= transc.pi & transc.cos (acs y) = y"
-  by (import transc ACS)
-
-lemma ACS_COS: "- 1 <= y & y <= 1 ==> transc.cos (acs y) = y"
-  by (import transc ACS_COS)
-
-lemma ACS_BOUNDS: "- 1 <= y & y <= 1 ==> 0 <= acs y & acs y <= transc.pi"
-  by (import transc ACS_BOUNDS)
-
-lemma ACS_BOUNDS_LT: "- 1 < y & y < 1 ==> 0 < acs y & acs y < transc.pi"
-  by (import transc ACS_BOUNDS_LT)
-
-lemma COS_ACS: "0 <= x & x <= transc.pi ==> acs (transc.cos x) = x"
-  by (import transc COS_ACS)
-
-lemma ATN: "- (transc.pi / 2) < atn y & atn y < transc.pi / 2 & transc.tan (atn y) = y"
-  by (import transc ATN)
-
-lemma ATN_TAN: "transc.tan (atn x) = x"
-  by (import transc ATN_TAN)
-
-lemma ATN_BOUNDS: "- (transc.pi / 2) < atn x & atn x < transc.pi / 2"
-  by (import transc ATN_BOUNDS)
-
-lemma TAN_ATN: "- (transc.pi / 2) < x & x < transc.pi / 2 ==> atn (transc.tan x) = x"
-  by (import transc TAN_ATN)
-
-lemma TAN_SEC: "transc.cos x ~= 0 ==> 1 + transc.tan x ^ 2 = inverse (transc.cos x) ^ 2"
-  by (import transc TAN_SEC)
-
-lemma SIN_COS_SQ: "0 <= x & x <= transc.pi
-==> transc.sin x = transc.sqrt (1 - transc.cos x ^ 2)"
-  by (import transc SIN_COS_SQ)
-
-lemma COS_SIN_SQ: "- (transc.pi / 2) <= x & x <= transc.pi / 2
-==> transc.cos x = transc.sqrt (1 - transc.sin x ^ 2)"
-  by (import transc COS_SIN_SQ)
-
-lemma COS_ATN_NZ: "transc.cos (atn x) ~= 0"
-  by (import transc COS_ATN_NZ)
-
-lemma COS_ASN_NZ: "- 1 < x & x < 1 ==> transc.cos (asn x) ~= 0"
-  by (import transc COS_ASN_NZ)
-
-lemma SIN_ACS_NZ: "- 1 < x & x < 1 ==> transc.sin (acs x) ~= 0"
-  by (import transc SIN_ACS_NZ)
-
-lemma COS_SIN_SQRT: "0 <= transc.cos x ==> transc.cos x = transc.sqrt (1 - transc.sin x ^ 2)"
-  by (import transc COS_SIN_SQRT)
-
-lemma SIN_COS_SQRT: "0 <= transc.sin x ==> transc.sin x = transc.sqrt (1 - transc.cos x ^ 2)"
-  by (import transc SIN_COS_SQRT)
-
-lemma DIFF_LN: "0 < x ==> diffl transc.ln (inverse x) x"
-  by (import transc DIFF_LN)
-
-lemma DIFF_ASN_LEMMA: "- 1 < x & x < 1 ==> diffl asn (inverse (transc.cos (asn x))) x"
-  by (import transc DIFF_ASN_LEMMA)
-
-lemma DIFF_ASN: "- 1 < x & x < 1 ==> diffl asn (inverse (transc.sqrt (1 - x ^ 2))) x"
-  by (import transc DIFF_ASN)
-
-lemma DIFF_ACS_LEMMA: "- 1 < x & x < 1 ==> diffl acs (inverse (- transc.sin (acs x))) x"
-  by (import transc DIFF_ACS_LEMMA)
-
-lemma DIFF_ACS: "- 1 < x & x < 1 ==> diffl acs (- inverse (transc.sqrt (1 - x ^ 2))) x"
-  by (import transc DIFF_ACS)
-
-lemma DIFF_ATN: "diffl atn (inverse (1 + x ^ 2)) x"
-  by (import transc DIFF_ATN)
-
-definition
-  division :: "real * real => (nat => real) => bool"  where
-  "division ==
-%(a, b) D.
-   D 0 = a & (EX N. (ALL n<N. D n < D (Suc n)) & (ALL n>=N. D n = b))"
-
-lemma division: "division (a, b) D =
-(D 0 = a & (EX N. (ALL n<N. D n < D (Suc n)) & (ALL n>=N. D n = b)))"
-  by (import transc division)
-
-definition
-  dsize :: "(nat => real) => nat"  where
-  "dsize == %D. SOME N. (ALL n<N. D n < D (Suc n)) & (ALL n>=N. D n = D N)"
-
-lemma dsize: "dsize D = (SOME N. (ALL n<N. D n < D (Suc n)) & (ALL n>=N. D n = D N))"
-  by (import transc dsize)
-
-definition
-  tdiv :: "real * real => (nat => real) * (nat => real) => bool"  where
-  "tdiv ==
-%(a, b) (D, p). division (a, b) D & (ALL n. D n <= p n & p n <= D (Suc n))"
-
-lemma tdiv: "tdiv (a, b) (D, p) =
-(division (a, b) D & (ALL n. D n <= p n & p n <= D (Suc n)))"
-  by (import transc tdiv)
-
-definition
-  gauge :: "(real => bool) => (real => real) => bool"  where
-  "gauge == %E g. ALL x. E x --> 0 < g x"
-
-lemma gauge: "gauge E g = (ALL x. E x --> 0 < g x)"
-  by (import transc gauge)
-
-definition
-  fine :: "(real => real) => (nat => real) * (nat => real) => bool"  where
-  "fine == %g (D, p). ALL n<dsize D. D (Suc n) - D n < g (p n)"
-
-lemma fine: "fine g (D, p) = (ALL n<dsize D. D (Suc n) - D n < g (p n))"
-  by (import transc fine)
-
-definition
-  rsum :: "(nat => real) * (nat => real) => (real => real) => real"  where
-  "rsum == %(D, p) f. real.sum (0, dsize D) (%n. f (p n) * (D (Suc n) - D n))"
-
-lemma rsum: "rsum (D, p) f = real.sum (0, dsize D) (%n. f (p n) * (D (Suc n) - D n))"
-  by (import transc rsum)
-
-definition
-  Dint :: "real * real => (real => real) => real => bool"  where
-  "Dint ==
-%(a, b) f k.
-   ALL e>0.
-      EX g. gauge (%x. a <= x & x <= b) g &
-            (ALL D p.
-                tdiv (a, b) (D, p) & fine g (D, p) -->
-                abs (rsum (D, p) f - k) < e)"
-
-lemma Dint: "Dint (a, b) f k =
-(ALL e>0.
-    EX g. gauge (%x. a <= x & x <= b) g &
-          (ALL D p.
-              tdiv (a, b) (D, p) & fine g (D, p) -->
-              abs (rsum (D, p) f - k) < e))"
-  by (import transc Dint)
-
-lemma DIVISION_0: "a = b ==> dsize (%n. if n = 0 then a else b) = 0"
-  by (import transc DIVISION_0)
-
-lemma DIVISION_1: "a < b ==> dsize (%n. if n = 0 then a else b) = 1"
-  by (import transc DIVISION_1)
-
-lemma DIVISION_SINGLE: "a <= b ==> division (a, b) (%n. if n = 0 then a else b)"
-  by (import transc DIVISION_SINGLE)
-
-lemma DIVISION_LHS: "division (a, b) D ==> D 0 = a"
-  by (import transc DIVISION_LHS)
-
-lemma DIVISION_THM: "division (a, b) D =
-(D 0 = a & (ALL n<dsize D. D n < D (Suc n)) & (ALL n>=dsize D. D n = b))"
-  by (import transc DIVISION_THM)
-
-lemma DIVISION_RHS: "division (a, b) D ==> D (dsize D) = b"
-  by (import transc DIVISION_RHS)
-
-lemma DIVISION_LT_GEN: "division (a, b) D & m < n & n <= dsize D ==> D m < D n"
-  by (import transc DIVISION_LT_GEN)
-
-lemma DIVISION_LT: "[| division (a, b) D; n < dsize D |] ==> D 0 < D (Suc n)"
-  by (import transc DIVISION_LT)
-
-lemma DIVISION_LE: "division (a, b) D ==> a <= b"
-  by (import transc DIVISION_LE)
-
-lemma DIVISION_GT: "[| division (a, b) D; n < dsize D |] ==> D n < D (dsize D)"
-  by (import transc DIVISION_GT)
-
-lemma DIVISION_EQ: "division (a, b) D ==> (a = b) = (dsize D = 0)"
-  by (import transc DIVISION_EQ)
-
-lemma DIVISION_LBOUND: "division (a, b) D ==> a <= D r"
-  by (import transc DIVISION_LBOUND)
-
-lemma DIVISION_LBOUND_LT: "division (a, b) D & dsize D ~= 0 ==> a < D (Suc n)"
-  by (import transc DIVISION_LBOUND_LT)
-
-lemma DIVISION_UBOUND: "division (a, b) D ==> D r <= b"
-  by (import transc DIVISION_UBOUND)
-
-lemma DIVISION_UBOUND_LT: "division (a, b) D & n < dsize D ==> D n < b"
-  by (import transc DIVISION_UBOUND_LT)
-
-lemma DIVISION_APPEND: "(EX D1 p1. tdiv (a, b) (D1, p1) & fine g (D1, p1)) &
-(EX D2 p2. tdiv (b, c) (D2, p2) & fine g (D2, p2))
-==> EX x p. tdiv (a, c) (x, p) & fine g (x, p)"
-  by (import transc DIVISION_APPEND)
-
-lemma DIVISION_EXISTS: "a <= b & gauge (%x. a <= x & x <= b) g
-==> EX D p. tdiv (a, b) (D, p) & fine g (D, p)"
-  by (import transc DIVISION_EXISTS)
-
-lemma GAUGE_MIN: "gauge E g1 & gauge E g2 ==> gauge E (%x. if g1 x < g2 x then g1 x else g2 x)"
-  by (import transc GAUGE_MIN)
-
-lemma FINE_MIN: "fine (%x. if g1 x < g2 x then g1 x else g2 x) (D, p)
-==> fine g1 (D, p) & fine g2 (D, p)"
-  by (import transc FINE_MIN)
-
-lemma DINT_UNIQ: "a <= b & Dint (a, b) f k1 & Dint (a, b) f k2 ==> k1 = k2"
-  by (import transc DINT_UNIQ)
-
-lemma INTEGRAL_NULL: "Dint (a, a) f 0"
-  by (import transc INTEGRAL_NULL)
-
-lemma FTC1: "a <= b & (ALL x. a <= x & x <= b --> diffl f (f' x) x)
-==> Dint (a, b) f' (f b - f a)"
-  by (import transc FTC1)
-
-lemma MCLAURIN: "0 < h &
-0 < n &
-diff 0 = f &
-(ALL m t. m < n & 0 <= t & t <= h --> diffl (diff m) (diff (Suc m) t) t)
-==> EX t>0.
-       t < h &
-       f h =
-       real.sum (0, n) (%m. diff m 0 / real (FACT m) * h ^ m) +
-       diff n t / real (FACT n) * h ^ n"
-  by (import transc MCLAURIN)
-
-lemma MCLAURIN_NEG: "h < 0 &
-0 < n &
-diff 0 = f &
-(ALL m t. m < n & h <= t & t <= 0 --> diffl (diff m) (diff (Suc m) t) t)
-==> EX t>h.
-       t < 0 &
-       f h =
-       real.sum (0, n) (%m. diff m 0 / real (FACT m) * h ^ m) +
-       diff n t / real (FACT n) * h ^ n"
-  by (import transc MCLAURIN_NEG)
-
-lemma MCLAURIN_ALL_LT: "[| diff 0 = f & (ALL m x. diffl (diff m) (diff (Suc m) x) x);
-   x ~= 0 & 0 < n |]
-==> EX t. 0 < abs t &
-          abs t < abs x &
-          f x =
-          real.sum (0, n) (%m. diff m 0 / real (FACT m) * x ^ m) +
-          diff n t / real (FACT n) * x ^ n"
-  by (import transc MCLAURIN_ALL_LT)
-
-lemma MCLAURIN_ZERO: "(x::real) = (0::real) & (0::nat) < (n::nat)
-==> real.sum (0::nat, n)
-     (%m::nat.
-         (diff::nat => real => real) m (0::real) / real (FACT m) * x ^ m) =
-    diff (0::nat) (0::real)"
-  by (import transc MCLAURIN_ZERO)
-
-lemma MCLAURIN_ALL_LE: "diff 0 = f & (ALL m x. diffl (diff m) (diff (Suc m) x) x)
-==> EX t. abs t <= abs x &
-          f x =
-          real.sum (0, n) (%m. diff m 0 / real (FACT m) * x ^ m) +
-          diff n t / real (FACT n) * x ^ n"
-  by (import transc MCLAURIN_ALL_LE)
-
-lemma MCLAURIN_EXP_LT: "x ~= 0 & 0 < n
-==> EX xa.
-       0 < abs xa &
-       abs xa < abs x &
-       transc.exp x =
-       real.sum (0, n) (%m. x ^ m / real (FACT m)) +
-       transc.exp xa / real (FACT n) * x ^ n"
-  by (import transc MCLAURIN_EXP_LT)
-
-lemma MCLAURIN_EXP_LE: "EX xa.
-   abs xa <= abs x &
-   transc.exp x =
-   real.sum (0, n) (%m. x ^ m / real (FACT m)) +
-   transc.exp xa / real (FACT n) * x ^ n"
-  by (import transc MCLAURIN_EXP_LE)
-
-lemma DIFF_LN_COMPOSITE: "diffl g m x & 0 < g x ==> diffl (%x. transc.ln (g x)) (inverse (g x) * m) x"
-  by (import transc DIFF_LN_COMPOSITE)
-
-;end_setup
-
-setup_theory "~~/src/HOL/Import/HOL4/Generated" poly
-
-consts
-  poly :: "real list => real => real" 
-
-specification (poly_primdef: poly) poly_def: "(ALL x. poly [] x = 0) & (ALL h t x. poly (h # t) x = h + x * poly t x)"
-  by (import poly poly_def)
-
-consts
-  poly_add :: "real list => real list => real list" 
-
-specification (poly_add_primdef: poly_add) poly_add_def: "(ALL l2. poly_add [] l2 = l2) &
-(ALL h t l2.
-    poly_add (h # t) l2 =
-    (if l2 = [] then h # t else (h + hd l2) # poly_add t (tl l2)))"
-  by (import poly poly_add_def)
-
-consts
-  "##" :: "real => real list => real list" ("##")
-
-specification ("##") poly_cmul_def: "(ALL c. ## c [] = []) & (ALL c h t. ## c (h # t) = c * h # ## c t)"
-  by (import poly poly_cmul_def)
-
-consts
-  poly_neg :: "real list => real list" 
-
-defs
-  poly_neg_primdef: "poly_neg == ## (- 1)"
-
-lemma poly_neg_def: "poly_neg = ## (- 1)"
-  by (import poly poly_neg_def)
-
-consts
-  poly_mul :: "real list => real list => real list" 
-
-specification (poly_mul_primdef: poly_mul) poly_mul_def: "(ALL l2. poly_mul [] l2 = []) &
-(ALL h t l2.
-    poly_mul (h # t) l2 =
-    (if t = [] then ## h l2 else poly_add (## h l2) (0 # poly_mul t l2)))"
-  by (import poly poly_mul_def)
-
-consts
-  poly_exp :: "real list => nat => real list" 
-
-specification (poly_exp_primdef: poly_exp) poly_exp_def: "(ALL p. poly_exp p 0 = [1]) &
-(ALL p n. poly_exp p (Suc n) = poly_mul p (poly_exp p n))"
-  by (import poly poly_exp_def)
-
-consts
-  poly_diff_aux :: "nat => real list => real list" 
-
-specification (poly_diff_aux_primdef: poly_diff_aux) poly_diff_aux_def: "(ALL n. poly_diff_aux n [] = []) &
-(ALL n h t. poly_diff_aux n (h # t) = real n * h # poly_diff_aux (Suc n) t)"
-  by (import poly poly_diff_aux_def)
-
-definition
-  diff :: "real list => real list"  where
-  "diff == %l. if l = [] then [] else poly_diff_aux 1 (tl l)"
-
-lemma poly_diff_def: "diff l = (if l = [] then [] else poly_diff_aux 1 (tl l))"
-  by (import poly poly_diff_def)
-
-lemma POLY_ADD_CLAUSES: "poly_add [] p2 = p2 &
-poly_add p1 [] = p1 &
-poly_add (h1 # t1) (h2 # t2) = (h1 + h2) # poly_add t1 t2"
-  by (import poly POLY_ADD_CLAUSES)
-
-lemma POLY_CMUL_CLAUSES: "## c [] = [] & ## c (h # t) = c * h # ## c t"
-  by (import poly POLY_CMUL_CLAUSES)
-
-lemma POLY_NEG_CLAUSES: "poly_neg [] = [] & poly_neg (h # t) = - h # poly_neg t"
-  by (import poly POLY_NEG_CLAUSES)
-
-lemma POLY_MUL_CLAUSES: "poly_mul [] p2 = [] &
-poly_mul [h1] p2 = ## h1 p2 &
-poly_mul (h1 # k1 # t1) p2 = poly_add (## h1 p2) (0 # poly_mul (k1 # t1) p2)"
-  by (import poly POLY_MUL_CLAUSES)
-
-lemma POLY_DIFF_CLAUSES: "diff [] = [] & diff [c] = [] & diff (h # t) = poly_diff_aux 1 t"
-  by (import poly POLY_DIFF_CLAUSES)
-
-lemma POLY_ADD: "poly (poly_add t p2) x = poly t x + poly p2 x"
-  by (import poly POLY_ADD)
-
-lemma POLY_CMUL: "poly (## c t) x = c * poly t x"
-  by (import poly POLY_CMUL)
-
-lemma POLY_NEG: "poly (poly_neg x) xa = - poly x xa"
-  by (import poly POLY_NEG)
-
-lemma POLY_MUL: "poly (poly_mul t p2) x = poly t x * poly p2 x"
-  by (import poly POLY_MUL)
-
-lemma POLY_EXP: "poly (poly_exp p n) x = poly p x ^ n"
-  by (import poly POLY_EXP)
-
-lemma POLY_DIFF_LEMMA: "diffl (%x. x ^ Suc n * poly t x) (x ^ n * poly (poly_diff_aux (Suc n) t) x)
- x"
-  by (import poly POLY_DIFF_LEMMA)
-
-lemma POLY_DIFF: "diffl (poly t) (poly (diff t) x) x"
-  by (import poly POLY_DIFF)
-
-lemma POLY_DIFFERENTIABLE: "lim.differentiable (poly l) x"
-  by (import poly POLY_DIFFERENTIABLE)
-
-lemma POLY_CONT: "contl (poly l) x"
-  by (import poly POLY_CONT)
-
-lemma POLY_IVT_POS: "xa < xb & poly x xa < 0 & 0 < poly x xb
-==> EX xc>xa. xc < xb & poly x xc = 0"
-  by (import poly POLY_IVT_POS)
-
-lemma POLY_IVT_NEG: "a < b & 0 < poly p a & poly p b < 0 ==> EX x>a. x < b & poly p x = 0"
-  by (import poly POLY_IVT_NEG)
-
-lemma POLY_MVT: "a < b ==> EX x>a. x < b & poly p b - poly p a = (b - a) * poly (diff p) x"
-  by (import poly POLY_MVT)
-
-lemma POLY_ADD_RZERO: "poly (poly_add x []) = poly x"
-  by (import poly POLY_ADD_RZERO)
-
-lemma POLY_MUL_ASSOC: "poly (poly_mul x (poly_mul xa xb)) = poly (poly_mul (poly_mul x xa) xb)"
-  by (import poly POLY_MUL_ASSOC)
-
-lemma POLY_EXP_ADD: "poly (poly_exp xb (xa + x)) =
-poly (poly_mul (poly_exp xb xa) (poly_exp xb x))"
-  by (import poly POLY_EXP_ADD)
-
-lemma POLY_DIFF_AUX_ADD: "poly (poly_diff_aux n (poly_add t p2)) =
-poly (poly_add (poly_diff_aux n t) (poly_diff_aux n p2))"
-  by (import poly POLY_DIFF_AUX_ADD)
-
-lemma POLY_DIFF_AUX_CMUL: "poly (poly_diff_aux n (## c t)) = poly (## c (poly_diff_aux n t))"
-  by (import poly POLY_DIFF_AUX_CMUL)
-
-lemma POLY_DIFF_AUX_NEG: "poly (poly_diff_aux xa (poly_neg x)) = poly (poly_neg (poly_diff_aux xa x))"
-  by (import poly POLY_DIFF_AUX_NEG)
-
-lemma POLY_DIFF_AUX_MUL_LEMMA: "poly (poly_diff_aux (Suc n) t) = poly (poly_add (poly_diff_aux n t) t)"
-  by (import poly POLY_DIFF_AUX_MUL_LEMMA)
-
-lemma POLY_DIFF_ADD: "poly (diff (poly_add t p2)) = poly (poly_add (diff t) (diff p2))"
-  by (import poly POLY_DIFF_ADD)
-
-lemma POLY_DIFF_CMUL: "poly (diff (## c t)) = poly (## c (diff t))"
-  by (import poly POLY_DIFF_CMUL)
-
-lemma POLY_DIFF_NEG: "poly (diff (poly_neg x)) = poly (poly_neg (diff x))"
-  by (import poly POLY_DIFF_NEG)
-
-lemma POLY_DIFF_MUL_LEMMA: "poly (diff (xa # x)) = poly (poly_add (0 # diff x) x)"
-  by (import poly POLY_DIFF_MUL_LEMMA)
-
-lemma POLY_DIFF_MUL: "poly (diff (poly_mul t p2)) =
-poly (poly_add (poly_mul t (diff p2)) (poly_mul (diff t) p2))"
-  by (import poly POLY_DIFF_MUL)
-
-lemma POLY_DIFF_EXP: "poly (diff (poly_exp p (Suc n))) =
-poly (poly_mul (## (real (Suc n)) (poly_exp p n)) (diff p))"
-  by (import poly POLY_DIFF_EXP)
-
-lemma POLY_DIFF_EXP_PRIME: "poly (diff (poly_exp [- a, 1] (Suc n))) =
-poly (## (real (Suc n)) (poly_exp [- a, 1] n))"
-  by (import poly POLY_DIFF_EXP_PRIME)
-
-lemma POLY_LINEAR_REM: "EX q r. h # t = poly_add [r] (poly_mul [- a, 1] q)"
-  by (import poly POLY_LINEAR_REM)
-
-lemma POLY_LINEAR_DIVIDES: "(poly t a = 0) = (t = [] | (EX q. t = poly_mul [- a, 1] q))"
-  by (import poly POLY_LINEAR_DIVIDES)
-
-lemma POLY_LENGTH_MUL: "length (poly_mul [- a, 1] x) = Suc (length x)"
-  by (import poly POLY_LENGTH_MUL)
-
-lemma POLY_ROOTS_INDEX_LEMMA: "poly p ~= poly [] & length p = n
-==> EX i. ALL x. poly p x = 0 --> (EX m<=n. x = i m)"
-  by (import poly POLY_ROOTS_INDEX_LEMMA)
-
-lemma POLY_ROOTS_INDEX_LENGTH: "poly p ~= poly []
-==> EX i. ALL x. poly p x = 0 --> (EX n<=length p. x = i n)"
-  by (import poly POLY_ROOTS_INDEX_LENGTH)
-
-lemma POLY_ROOTS_FINITE_LEMMA: "poly (p::real list) ~= poly []
-==> EX (N::nat) i::nat => real.
-       ALL x::real. poly p x = (0::real) --> (EX n<N. x = i n)"
-  by (import poly POLY_ROOTS_FINITE_LEMMA)
-
-lemma FINITE_LEMMA: "(!!xb::real. (xa::real => bool) xb ==> EX n<x::nat. xb = (i::nat => real) n)
-==> EX a::real. ALL x::real. xa x --> x < a"
-  by (import poly FINITE_LEMMA)
-
-lemma POLY_ROOTS_FINITE: "(poly (p::real list) ~= poly []) =
-(EX (N::nat) i::nat => real.
-    ALL x::real. poly p x = (0::real) --> (EX n<N. x = i n))"
-  by (import poly POLY_ROOTS_FINITE)
-
-lemma POLY_ENTIRE_LEMMA: "poly p ~= poly [] & poly q ~= poly [] ==> poly (poly_mul p q) ~= poly []"
-  by (import poly POLY_ENTIRE_LEMMA)
-
-lemma POLY_ENTIRE: "(poly (poly_mul p q) = poly []) = (poly p = poly [] | poly q = poly [])"
-  by (import poly POLY_ENTIRE)
-
-lemma POLY_MUL_LCANCEL: "(poly (poly_mul x xa) = poly (poly_mul x xb)) =
-(poly x = poly [] | poly xa = poly xb)"
-  by (import poly POLY_MUL_LCANCEL)
-
-lemma POLY_EXP_EQ_0: "(poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= 0)"
-  by (import poly POLY_EXP_EQ_0)
-
-lemma POLY_PRIME_EQ_0: "poly [a, 1] ~= poly []"
-  by (import poly POLY_PRIME_EQ_0)
-
-lemma POLY_EXP_PRIME_EQ_0: "poly (poly_exp [a, 1] n) ~= poly []"
-  by (import poly POLY_EXP_PRIME_EQ_0)
-
-lemma POLY_ZERO_LEMMA: "poly (h # t) = poly [] ==> h = 0 & poly t = poly []"
-  by (import poly POLY_ZERO_LEMMA)
-
-lemma POLY_ZERO: "(poly t = poly []) = list_all (%c. c = 0) t"
-  by (import poly POLY_ZERO)
-
-lemma POLY_DIFF_AUX_ISZERO: "list_all (%c. c = 0) (poly_diff_aux (Suc n) t) = list_all (%c. c = 0) t"
-  by (import poly POLY_DIFF_AUX_ISZERO)
-
-lemma POLY_DIFF_ISZERO: "poly (diff x) = poly [] ==> EX h. poly x = poly [h]"
-  by (import poly POLY_DIFF_ISZERO)
-
-lemma POLY_DIFF_ZERO: "poly x = poly [] ==> poly (diff x) = poly []"
-  by (import poly POLY_DIFF_ZERO)
-
-lemma POLY_DIFF_WELLDEF: "poly p = poly q ==> poly (diff p) = poly (diff q)"
-  by (import poly POLY_DIFF_WELLDEF)
-
-definition
-  poly_divides :: "real list => real list => bool"  where
-  "poly_divides == %p1 p2. EX q. poly p2 = poly (poly_mul p1 q)"
-
-lemma poly_divides: "poly_divides p1 p2 = (EX q. poly p2 = poly (poly_mul p1 q))"
-  by (import poly poly_divides)
-
-lemma POLY_PRIMES: "poly_divides [a, 1] (poly_mul p q) =
-(poly_divides [a, 1] p | poly_divides [a, 1] q)"
-  by (import poly POLY_PRIMES)
-
-lemma POLY_DIVIDES_REFL: "poly_divides p p"
-  by (import poly POLY_DIVIDES_REFL)
-
-lemma POLY_DIVIDES_TRANS: "poly_divides p q & poly_divides q r ==> poly_divides p r"
-  by (import poly POLY_DIVIDES_TRANS)
-
-lemma POLY_DIVIDES_EXP: "m <= n ==> poly_divides (poly_exp p m) (poly_exp p n)"
-  by (import poly POLY_DIVIDES_EXP)
-
-lemma POLY_EXP_DIVIDES: "poly_divides (poly_exp p n) q & m <= n ==> poly_divides (poly_exp p m) q"
-  by (import poly POLY_EXP_DIVIDES)
-
-lemma POLY_DIVIDES_ADD: "poly_divides p q & poly_divides p r ==> poly_divides p (poly_add q r)"