Release HOL4 and HOLLight Importer.
authorobua
Mon, 26 Sep 2005 16:10:19 +0200
changeset 17652 b1ef33ebfa17
parent 17651 a6499b0c5a40
child 17653 34c41d9bd749
Release HOL4 and HOLLight Importer.
src/HOL/Import/HOL/HOL4Base.thy
src/HOL/Import/HOL/HOL4Prob.thy
src/HOL/Import/HOL/HOL4Real.thy
src/HOL/Import/HOL/HOL4Vec.thy
src/HOL/Import/HOL/HOL4Word32.thy
src/HOL/Import/HOL/bool.imp
src/HOL/Import/HOLLight/HOLLight.thy
src/HOL/Import/import_package.ML
src/HOL/Import/proof_kernel.ML
--- a/src/HOL/Import/HOL/HOL4Base.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/HOL4Base.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -5,21 +5,21 @@
 ;setup_theory bool
 
 constdefs
-  ARB :: "'a::type" 
+  ARB :: "'a" 
   "ARB == SOME x::'a::type. True"
 
 lemma ARB_DEF: "ARB = (SOME x::'a::type. True)"
   by (import bool ARB_DEF)
 
 constdefs
-  IN :: "'a::type => ('a::type => bool) => bool" 
+  IN :: "'a => ('a => bool) => bool" 
   "IN == %(x::'a::type) f::'a::type => bool. f x"
 
 lemma IN_DEF: "IN = (%(x::'a::type) f::'a::type => bool. f x)"
   by (import bool IN_DEF)
 
 constdefs
-  RES_FORALL :: "('a::type => bool) => ('a::type => bool) => bool" 
+  RES_FORALL :: "('a => bool) => ('a => bool) => bool" 
   "RES_FORALL ==
 %(p::'a::type => bool) m::'a::type => bool. ALL x::'a::type. IN x p --> m x"
 
@@ -29,7 +29,7 @@
   by (import bool RES_FORALL_DEF)
 
 constdefs
-  RES_EXISTS :: "('a::type => bool) => ('a::type => bool) => bool" 
+  RES_EXISTS :: "('a => bool) => ('a => bool) => bool" 
   "RES_EXISTS ==
 %(p::'a::type => bool) m::'a::type => bool. EX x::'a::type. IN x p & m x"
 
@@ -38,7 +38,7 @@
   by (import bool RES_EXISTS_DEF)
 
 constdefs
-  RES_EXISTS_UNIQUE :: "('a::type => bool) => ('a::type => bool) => bool" 
+  RES_EXISTS_UNIQUE :: "('a => bool) => ('a => bool) => bool" 
   "RES_EXISTS_UNIQUE ==
 %(p::'a::type => bool) m::'a::type => bool.
    RES_EXISTS p m &
@@ -53,7 +53,7 @@
   by (import bool RES_EXISTS_UNIQUE_DEF)
 
 constdefs
-  RES_SELECT :: "('a::type => bool) => ('a::type => bool) => 'a::type" 
+  RES_SELECT :: "('a => bool) => ('a => bool) => 'a" 
   "RES_SELECT ==
 %(p::'a::type => bool) m::'a::type => bool. SOME x::'a::type. IN x p & m x"
 
@@ -240,7 +240,7 @@
   by (import bool UEXISTS_SIMP)
 
 consts
-  RES_ABSTRACT :: "('a::type => bool) => ('a::type => 'b::type) => 'a::type => 'b::type" 
+  RES_ABSTRACT :: "('a => bool) => ('a => 'b) => 'a => 'b" 
 
 specification (RES_ABSTRACT) RES_ABSTRACT_DEF: "(ALL (p::'a::type => bool) (m::'a::type => 'b::type) x::'a::type.
     IN x p --> RES_ABSTRACT p m x = m x) &
@@ -265,15 +265,14 @@
 ;setup_theory combin
 
 constdefs
-  K :: "'a::type => 'b::type => 'a::type" 
+  K :: "'a => 'b => 'a" 
   "K == %(x::'a::type) y::'b::type. x"
 
 lemma K_DEF: "K = (%(x::'a::type) y::'b::type. x)"
   by (import combin K_DEF)
 
 constdefs
-  S :: "('a::type => 'b::type => 'c::type)
-=> ('a::type => 'b::type) => 'a::type => 'c::type" 
+  S :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c" 
   "S ==
 %(f::'a::type => 'b::type => 'c::type) (g::'a::type => 'b::type)
    x::'a::type. f x (g x)"
@@ -284,7 +283,7 @@
   by (import combin S_DEF)
 
 constdefs
-  I :: "'a::type => 'a::type" 
+  I :: "'a => 'a" 
   "(op ==::('a::type => 'a::type) => ('a::type => 'a::type) => prop)
  (I::'a::type => 'a::type)
  ((S::('a::type => ('a::type => 'a::type) => 'a::type)
@@ -301,7 +300,7 @@
   by (import combin I_DEF)
 
 constdefs
-  C :: "('a::type => 'b::type => 'c::type) => 'b::type => 'a::type => 'c::type" 
+  C :: "('a => 'b => 'c) => 'b => 'a => 'c" 
   "C == %(f::'a::type => 'b::type => 'c::type) (x::'b::type) y::'a::type. f y x"
 
 lemma C_DEF: "C =
@@ -309,7 +308,7 @@
   by (import combin C_DEF)
 
 constdefs
-  W :: "('a::type => 'a::type => 'b::type) => 'a::type => 'b::type" 
+  W :: "('a => 'a => 'b) => 'a => 'b" 
   "W == %(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x"
 
 lemma W_DEF: "W = (%(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x)"
@@ -547,7 +546,7 @@
 ;setup_theory marker
 
 consts
-  stmarker :: "'a::type => 'a::type" 
+  stmarker :: "'a => 'a" 
 
 defs
   stmarker_primdef: "stmarker == %x::'a::type. x"
@@ -584,7 +583,7 @@
 ;setup_theory relation
 
 constdefs
-  TC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
+  TC :: "('a => 'a => bool) => 'a => 'a => bool" 
   "TC ==
 %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
    ALL P::'a::type => 'a::type => bool.
@@ -603,7 +602,7 @@
   by (import relation TC_DEF)
 
 constdefs
-  RTC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
+  RTC :: "('a => 'a => bool) => 'a => 'a => bool" 
   "RTC ==
 %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
    ALL P::'a::type => 'a::type => bool.
@@ -622,7 +621,7 @@
   by (import relation RTC_DEF)
 
 consts
-  RC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
+  RC :: "('a => 'a => bool) => 'a => 'a => bool" 
 
 defs
   RC_primdef: "RC ==
@@ -633,7 +632,7 @@
   by (import relation RC_def)
 
 consts
-  transitive :: "('a::type => 'a::type => bool) => bool" 
+  transitive :: "('a => 'a => bool) => bool" 
 
 defs
   transitive_primdef: "transitive ==
@@ -646,7 +645,7 @@
   by (import relation transitive_def)
 
 constdefs
-  pred_reflexive :: "('a::type => 'a::type => bool) => bool" 
+  pred_reflexive :: "('a => 'a => bool) => bool" 
   "pred_reflexive == %R::'a::type => 'a::type => bool. ALL x::'a::type. R x x"
 
 lemma reflexive_def: "ALL R::'a::type => 'a::type => bool.
@@ -790,7 +789,7 @@
   by (import relation RTC_MONOTONE)
 
 constdefs
-  WF :: "('a::type => 'a::type => bool) => bool" 
+  WF :: "('a => 'a => bool) => bool" 
   "WF ==
 %R::'a::type => 'a::type => bool.
    ALL B::'a::type => bool.
@@ -816,7 +815,7 @@
   by (import relation WF_NOT_REFL)
 
 constdefs
-  EMPTY_REL :: "'a::type => 'a::type => bool" 
+  EMPTY_REL :: "'a => 'a => bool" 
   "EMPTY_REL == %(x::'a::type) y::'a::type. False"
 
 lemma EMPTY_REL_DEF: "ALL (x::'a::type) y::'a::type. EMPTY_REL x y = False"
@@ -833,8 +832,7 @@
   by (import relation WF_TC)
 
 consts
-  inv_image :: "('b::type => 'b::type => bool)
-=> ('a::type => 'b::type) => 'a::type => 'a::type => bool" 
+  inv_image :: "('b => 'b => bool) => ('a => 'b) => 'a => 'a => bool" 
 
 defs
   inv_image_primdef: "relation.inv_image ==
@@ -850,8 +848,7 @@
   by (import relation WF_inv_image)
 
 constdefs
-  RESTRICT :: "('a::type => 'b::type)
-=> ('a::type => 'a::type => bool) => 'a::type => 'a::type => 'b::type" 
+  RESTRICT :: "('a => 'b) => ('a => 'a => bool) => 'a => 'a => 'b" 
   "RESTRICT ==
 %(f::'a::type => 'b::type) (R::'a::type => 'a::type => bool) (x::'a::type)
    y::'a::type. if R y x then f y else ARB"
@@ -865,9 +862,7 @@
   by (import relation RESTRICT_LEMMA)
 
 consts
-  approx :: "('a::type => 'a::type => bool)
-=> (('a::type => 'b::type) => 'a::type => 'b::type)
-   => 'a::type => ('a::type => 'b::type) => bool" 
+  approx :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => ('a => 'b) => bool" 
 
 defs
   approx_primdef: "approx ==
@@ -883,9 +878,7 @@
   by (import relation approx_def)
 
 consts
-  the_fun :: "('a::type => 'a::type => bool)
-=> (('a::type => 'b::type) => 'a::type => 'b::type)
-   => 'a::type => 'a::type => 'b::type" 
+  the_fun :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'a => 'b" 
 
 defs
   the_fun_primdef: "the_fun ==
@@ -899,8 +892,7 @@
   by (import relation the_fun_def)
 
 constdefs
-  WFREC :: "('a::type => 'a::type => bool)
-=> (('a::type => 'b::type) => 'a::type => 'b::type) => 'a::type => 'b::type" 
+  WFREC :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'b" 
   "WFREC ==
 %(R::'a::type => 'a::type => bool)
    (M::('a::type => 'b::type) => 'a::type => 'b::type) x::'a::type.
@@ -1061,9 +1053,7 @@
   by (import pair pair_case_cong)
 
 constdefs
-  LEX :: "('a::type => 'a::type => bool)
-=> ('b::type => 'b::type => bool)
-   => 'a::type * 'b::type => 'a::type * 'b::type => bool" 
+  LEX :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
   "LEX ==
 %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
    (s::'a::type, t::'b::type) (u::'a::type, v::'b::type).
@@ -1080,9 +1070,7 @@
   by (import pair WF_LEX)
 
 constdefs
-  RPROD :: "('a::type => 'a::type => bool)
-=> ('b::type => 'b::type => bool)
-   => 'a::type * 'b::type => 'a::type * 'b::type => bool" 
+  RPROD :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
   "RPROD ==
 %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
    (s::'a::type, t::'b::type) (u::'a::type, v::'b::type). R1 s u & R2 t v"
@@ -1104,7 +1092,7 @@
 
 ;setup_theory prim_rec
 
-lemma LESS_0_0: "(0::nat) < Suc (0::nat)"
+lemma LESS_0_0: "0 < Suc 0"
   by (import prim_rec LESS_0_0)
 
 lemma LESS_LEMMA1: "ALL (x::nat) xa::nat. x < Suc xa --> x = xa | x < xa"
@@ -1126,7 +1114,7 @@
   by (import prim_rec NOT_LESS_EQ)
 
 constdefs
-  SIMP_REC_REL :: "(nat => 'a::type) => 'a::type => ('a::type => 'a::type) => nat => bool" 
+  SIMP_REC_REL :: "(nat => 'a) => 'a => ('a => 'a) => nat => bool" 
   "(op ==::((nat => 'a::type)
          => 'a::type => ('a::type => 'a::type) => nat => bool)
         => ((nat => 'a::type)
@@ -1184,7 +1172,7 @@
   by (import prim_rec SIMP_REC_REL_UNIQUE_RESULT)
 
 consts
-  SIMP_REC :: "'a::type => ('a::type => 'a::type) => nat => 'a::type" 
+  SIMP_REC :: "'a => ('a => 'a) => nat => 'a" 
 
 specification (SIMP_REC) SIMP_REC: "ALL (x::'a::type) (f'::'a::type => 'a::type) n::nat.
    EX g::nat => 'a::type.
@@ -1195,23 +1183,22 @@
   by (import prim_rec LESS_SUC_SUC)
 
 lemma SIMP_REC_THM: "ALL (x::'a::type) f::'a::type => 'a::type.
-   SIMP_REC x f (0::nat) = x &
+   SIMP_REC x f 0 = x &
    (ALL m::nat. SIMP_REC x f (Suc m) = f (SIMP_REC x f m))"
   by (import prim_rec SIMP_REC_THM)
 
 constdefs
   PRE :: "nat => nat" 
-  "PRE == %m::nat. if m = (0::nat) then 0::nat else SOME n::nat. m = Suc n"
-
-lemma PRE_DEF: "ALL m::nat.
-   PRE m = (if m = (0::nat) then 0::nat else SOME n::nat. m = Suc n)"
+  "PRE == %m::nat. if m = 0 then 0 else SOME n::nat. m = Suc n"
+
+lemma PRE_DEF: "ALL m::nat. PRE m = (if m = 0 then 0 else SOME n::nat. m = Suc n)"
   by (import prim_rec PRE_DEF)
 
-lemma PRE: "PRE (0::nat) = (0::nat) & (ALL m::nat. PRE (Suc m) = m)"
+lemma PRE: "PRE 0 = 0 & (ALL m::nat. PRE (Suc m) = m)"
   by (import prim_rec PRE)
 
 constdefs
-  PRIM_REC_FUN :: "'a::type => ('a::type => nat => 'a::type) => nat => nat => 'a::type" 
+  PRIM_REC_FUN :: "'a => ('a => nat => 'a) => nat => nat => 'a" 
   "PRIM_REC_FUN ==
 %(x::'a::type) f::'a::type => nat => 'a::type.
    SIMP_REC (%n::nat. x) (%(fun::nat => 'a::type) n::nat. f (fun (PRE n)) n)"
@@ -1222,13 +1209,13 @@
   by (import prim_rec PRIM_REC_FUN)
 
 lemma PRIM_REC_EQN: "ALL (x::'a::type) f::'a::type => nat => 'a::type.
-   (ALL n::nat. PRIM_REC_FUN x f (0::nat) n = x) &
+   (ALL n::nat. PRIM_REC_FUN x f 0 n = x) &
    (ALL (m::nat) n::nat.
        PRIM_REC_FUN x f (Suc m) n = f (PRIM_REC_FUN x f m (PRE n)) n)"
   by (import prim_rec PRIM_REC_EQN)
 
 constdefs
-  PRIM_REC :: "'a::type => ('a::type => nat => 'a::type) => nat => 'a::type" 
+  PRIM_REC :: "'a => ('a => nat => 'a) => nat => 'a" 
   "PRIM_REC ==
 %(x::'a::type) (f::'a::type => nat => 'a::type) m::nat.
    PRIM_REC_FUN x f m (PRE m)"
@@ -1238,28 +1225,27 @@
   by (import prim_rec PRIM_REC)
 
 lemma PRIM_REC_THM: "ALL (x::'a::type) f::'a::type => nat => 'a::type.
-   PRIM_REC x f (0::nat) = x &
+   PRIM_REC x f 0 = x &
    (ALL m::nat. PRIM_REC x f (Suc m) = f (PRIM_REC x f m) m)"
   by (import prim_rec PRIM_REC_THM)
 
 lemma DC: "ALL (P::'a::type => bool) (R::'a::type => 'a::type => bool) a::'a::type.
    P a & (ALL x::'a::type. P x --> (EX y::'a::type. P y & R x y)) -->
    (EX x::nat => 'a::type.
-       x (0::nat) = a & (ALL n::nat. P (x n) & R (x n) (x (Suc n))))"
+       x 0 = a & (ALL n::nat. P (x n) & R (x n) (x (Suc n))))"
   by (import prim_rec DC)
 
 lemma num_Axiom_old: "ALL (e::'a::type) f::'a::type => nat => 'a::type.
    EX! fn1::nat => 'a::type.
-      fn1 (0::nat) = e & (ALL n::nat. fn1 (Suc n) = f (fn1 n) n)"
+      fn1 0 = e & (ALL n::nat. fn1 (Suc n) = f (fn1 n) n)"
   by (import prim_rec num_Axiom_old)
 
 lemma num_Axiom: "ALL (e::'a::type) f::nat => 'a::type => 'a::type.
-   EX x::nat => 'a::type.
-      x (0::nat) = e & (ALL n::nat. x (Suc n) = f n (x n))"
+   EX x::nat => 'a::type. x 0 = e & (ALL n::nat. x (Suc n) = f n (x n))"
   by (import prim_rec num_Axiom)
 
 consts
-  wellfounded :: "('a::type => 'a::type => bool) => bool" 
+  wellfounded :: "('a => 'a => bool) => bool" 
 
 defs
   wellfounded_primdef: "wellfounded ==
@@ -1281,7 +1267,7 @@
   by (import prim_rec WF_LESS)
 
 consts
-  measure :: "('a::type => nat) => 'a::type => 'a::type => bool" 
+  measure :: "('a => nat) => 'a => 'a => bool" 
 
 defs
   measure_primdef: "prim_rec.measure == relation.inv_image op <"
@@ -1310,28 +1296,28 @@
 consts
   EVEN :: "nat => bool" 
 
-specification (EVEN) EVEN: "EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
+specification (EVEN) EVEN: "EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   by (import arithmetic EVEN)
 
 consts
   ODD :: "nat => bool" 
 
-specification (ODD) ODD: "ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
+specification (ODD) ODD: "ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   by (import arithmetic ODD)
 
-lemma TWO: "(2::nat) = Suc (1::nat)"
+lemma TWO: "2 = Suc 1"
   by (import arithmetic TWO)
 
-lemma NORM_0: "(0::nat) = (0::nat)"
+lemma NORM_0: "(op =::nat => nat => bool) (0::nat) (0::nat)"
   by (import arithmetic NORM_0)
 
 lemma num_case_compute: "ALL n::nat.
    nat_case (f::'a::type) (g::nat => 'a::type) n =
-   (if n = (0::nat) then f else g (PRE n))"
+   (if n = 0 then f else g (PRE n))"
   by (import arithmetic num_case_compute)
 
-lemma ADD_CLAUSES: "(0::nat) + (m::nat) = m &
-m + (0::nat) = m & Suc m + (n::nat) = Suc (m + n) & m + Suc n = Suc (m + n)"
+lemma ADD_CLAUSES: "0 + (m::nat) = m &
+m + 0 = m & Suc m + (n::nat) = Suc (m + n) & m + Suc n = Suc (m + n)"
   by (import arithmetic ADD_CLAUSES)
 
 lemma LESS_ADD: "ALL (m::nat) n::nat. n < m --> (EX p::nat. p + n = m)"
@@ -1350,7 +1336,7 @@
 lemma LESS_NOT_SUC: "ALL (m::nat) n::nat. m < n & n ~= Suc m --> Suc m < n"
   by (import arithmetic LESS_NOT_SUC)
 
-lemma LESS_0_CASES: "ALL m::nat. (0::nat) = m | (0::nat) < m"
+lemma LESS_0_CASES: "ALL m::nat. 0 = m | 0 < m"
   by (import arithmetic LESS_0_CASES)
 
 lemma LESS_CASES_IMP: "ALL (m::nat) n::nat. ~ m < n & m ~= n --> n < m"
@@ -1362,44 +1348,41 @@
 lemma LESS_EQ_SUC_REFL: "ALL m::nat. m <= Suc m"
   by (import arithmetic LESS_EQ_SUC_REFL)
 
-lemma LESS_ADD_NONZERO: "ALL (m::nat) n::nat. n ~= (0::nat) --> m < m + n"
+lemma LESS_ADD_NONZERO: "ALL (m::nat) n::nat. n ~= 0 --> m < m + n"
   by (import arithmetic LESS_ADD_NONZERO)
 
 lemma LESS_EQ_ANTISYM: "ALL (x::nat) xa::nat. ~ (x < xa & xa <= x)"
   by (import arithmetic LESS_EQ_ANTISYM)
 
-lemma SUB_0: "ALL m::nat. (0::nat) - m = (0::nat) & m - (0::nat) = m"
+lemma SUB_0: "ALL m::nat. 0 - m = 0 & m - 0 = m"
   by (import arithmetic SUB_0)
 
-lemma SUC_SUB1: "ALL m::nat. Suc m - (1::nat) = m"
+lemma SUC_SUB1: "ALL m::nat. Suc m - 1 = m"
   by (import arithmetic SUC_SUB1)
 
-lemma PRE_SUB1: "ALL m::nat. PRE m = m - (1::nat)"
+lemma PRE_SUB1: "ALL m::nat. PRE m = m - 1"
   by (import arithmetic PRE_SUB1)
 
 lemma MULT_CLAUSES: "ALL (x::nat) xa::nat.
-   (0::nat) * x = (0::nat) &
-   x * (0::nat) = (0::nat) &
-   (1::nat) * x = x &
-   x * (1::nat) = x & Suc x * xa = x * xa + xa & x * Suc xa = x + x * xa"
+   0 * x = 0 &
+   x * 0 = 0 &
+   1 * x = x &
+   x * 1 = x & Suc x * xa = x * xa + xa & x * Suc xa = x + x * xa"
   by (import arithmetic MULT_CLAUSES)
 
 lemma PRE_SUB: "ALL (m::nat) n::nat. PRE (m - n) = PRE m - n"
   by (import arithmetic PRE_SUB)
 
-lemma ADD_EQ_1: "ALL (m::nat) n::nat.
-   (m + n = (1::nat)) =
-   (m = (1::nat) & n = (0::nat) | m = (0::nat) & n = (1::nat))"
+lemma ADD_EQ_1: "ALL (m::nat) n::nat. (m + n = 1) = (m = 1 & n = 0 | m = 0 & n = 1)"
   by (import arithmetic ADD_EQ_1)
 
-lemma ADD_INV_0_EQ: "ALL (m::nat) n::nat. (m + n = m) = (n = (0::nat))"
+lemma ADD_INV_0_EQ: "ALL (m::nat) n::nat. (m + n = m) = (n = 0)"
   by (import arithmetic ADD_INV_0_EQ)
 
-lemma PRE_SUC_EQ: "ALL (m::nat) n::nat. (0::nat) < n --> (m = PRE n) = (Suc m = n)"
+lemma PRE_SUC_EQ: "ALL (m::nat) n::nat. 0 < n --> (m = PRE n) = (Suc m = n)"
   by (import arithmetic PRE_SUC_EQ)
 
-lemma INV_PRE_EQ: "ALL (m::nat) n::nat.
-   (0::nat) < m & (0::nat) < n --> (PRE m = PRE n) = (m = n)"
+lemma INV_PRE_EQ: "ALL (m::nat) n::nat. 0 < m & 0 < n --> (PRE m = PRE n) = (m = n)"
   by (import arithmetic INV_PRE_EQ)
 
 lemma LESS_SUC_NOT: "ALL (m::nat) n::nat. m < n --> ~ n < Suc m"
@@ -1408,7 +1391,7 @@
 lemma ADD_EQ_SUB: "ALL (m::nat) (n::nat) p::nat. n <= p --> (m + n = p) = (m = p - n)"
   by (import arithmetic ADD_EQ_SUB)
 
-lemma LESS_ADD_1: "ALL (x::nat) xa::nat. xa < x --> (EX xb::nat. x = xa + (xb + (1::nat)))"
+lemma LESS_ADD_1: "ALL (x::nat) xa::nat. xa < x --> (EX xb::nat. x = xa + (xb + 1))"
   by (import arithmetic LESS_ADD_1)
 
 lemma NOT_ODD_EQ_EVEN: "ALL (n::nat) m::nat. Suc (n + n) ~= m + m"
@@ -1440,16 +1423,16 @@
                     ((Not::bool => bool) (P m)))))))"
   by (import arithmetic WOP)
 
-lemma INV_PRE_LESS: "ALL m>0::nat. ALL n::nat. (PRE m < PRE n) = (m < n)"
+lemma INV_PRE_LESS: "ALL m>0. ALL n::nat. (PRE m < PRE n) = (m < n)"
   by (import arithmetic INV_PRE_LESS)
 
-lemma INV_PRE_LESS_EQ: "ALL n>0::nat. ALL m::nat. (PRE m <= PRE n) = (m <= n)"
+lemma INV_PRE_LESS_EQ: "ALL n>0. ALL m::nat. (PRE m <= PRE n) = (m <= n)"
   by (import arithmetic INV_PRE_LESS_EQ)
 
-lemma SUB_EQ_EQ_0: "ALL (m::nat) n::nat. (m - n = m) = (m = (0::nat) | n = (0::nat))"
+lemma SUB_EQ_EQ_0: "ALL (m::nat) n::nat. (m - n = m) = (m = 0 | n = 0)"
   by (import arithmetic SUB_EQ_EQ_0)
 
-lemma SUB_LESS_OR: "ALL (m::nat) n::nat. n < m --> n <= m - (1::nat)"
+lemma SUB_LESS_OR: "ALL (m::nat) n::nat. n < m --> n <= m - 1"
   by (import arithmetic SUB_LESS_OR)
 
 lemma LESS_SUB_ADD_LESS: "ALL (n::nat) (m::nat) i::nat. i < n - m --> i + m < n"
@@ -1468,15 +1451,13 @@
    xa <= x & xb <= x --> (x - xa = x - xb) = (xa = xb)"
   by (import arithmetic SUB_CANCEL)
 
-lemma NOT_EXP_0: "ALL (m::nat) n::nat. Suc n ^ m ~= (0::nat)"
+lemma NOT_EXP_0: "ALL (m::nat) n::nat. Suc n ^ m ~= 0"
   by (import arithmetic NOT_EXP_0)
 
-lemma ZERO_LESS_EXP: "ALL (m::nat) n::nat. (0::nat) < Suc n ^ m"
+lemma ZERO_LESS_EXP: "ALL (m::nat) n::nat. 0 < Suc n ^ m"
   by (import arithmetic ZERO_LESS_EXP)
 
-lemma ODD_OR_EVEN: "ALL x::nat.
-   EX xa::nat.
-      x = Suc (Suc (0::nat)) * xa | x = Suc (Suc (0::nat)) * xa + (1::nat)"
+lemma ODD_OR_EVEN: "ALL x::nat. EX xa::nat. x = Suc (Suc 0) * xa | x = Suc (Suc 0) * xa + 1"
   by (import arithmetic ODD_OR_EVEN)
 
 lemma LESS_EXP_SUC_MONO: "ALL (n::nat) m::nat. Suc (Suc m) ^ n < Suc (Suc m) ^ Suc n"
@@ -1491,16 +1472,16 @@
 lemma LESS_EQ_EXISTS: "ALL (m::nat) n::nat. (m <= n) = (EX p::nat. n = m + p)"
   by (import arithmetic LESS_EQ_EXISTS)
 
-lemma MULT_EQ_1: "ALL (x::nat) y::nat. (x * y = (1::nat)) = (x = (1::nat) & y = (1::nat))"
+lemma MULT_EQ_1: "ALL (x::nat) y::nat. (x * y = 1) = (x = 1 & y = 1)"
   by (import arithmetic MULT_EQ_1)
 
 consts
   FACT :: "nat => nat" 
 
-specification (FACT) FACT: "FACT (0::nat) = (1::nat) & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
+specification (FACT) FACT: "FACT 0 = 1 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   by (import arithmetic FACT)
 
-lemma FACT_LESS: "ALL n::nat. (0::nat) < FACT n"
+lemma FACT_LESS: "ALL n::nat. 0 < FACT n"
   by (import arithmetic FACT_LESS)
 
 lemma EVEN_ODD: "ALL n::nat. EVEN n = (~ ODD n)"
@@ -1527,24 +1508,24 @@
 lemma ODD_MULT: "ALL (m::nat) n::nat. ODD (m * n) = (ODD m & ODD n)"
   by (import arithmetic ODD_MULT)
 
-lemma EVEN_DOUBLE: "ALL n::nat. EVEN ((2::nat) * n)"
+lemma EVEN_DOUBLE: "ALL n::nat. EVEN (2 * n)"
   by (import arithmetic EVEN_DOUBLE)
 
-lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc ((2::nat) * x))"
+lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (2 * x))"
   by (import arithmetic ODD_DOUBLE)
 
 lemma EVEN_ODD_EXISTS: "ALL x::nat.
-   (EVEN x --> (EX m::nat. x = (2::nat) * m)) &
-   (ODD x --> (EX m::nat. x = Suc ((2::nat) * m)))"
+   (EVEN x --> (EX m::nat. x = 2 * m)) &
+   (ODD x --> (EX m::nat. x = Suc (2 * m)))"
   by (import arithmetic EVEN_ODD_EXISTS)
 
-lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = (2::nat) * m)"
+lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = 2 * m)"
   by (import arithmetic EVEN_EXISTS)
 
-lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc ((2::nat) * m))"
+lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc (2 * m))"
   by (import arithmetic ODD_EXISTS)
 
-lemma NOT_SUC_LESS_EQ_0: "ALL x::nat. ~ Suc x <= (0::nat)"
+lemma NOT_SUC_LESS_EQ_0: "ALL x::nat. ~ Suc x <= 0"
   by (import arithmetic NOT_SUC_LESS_EQ_0)
 
 lemma NOT_LEQ: "ALL (x::nat) xa::nat. (~ x <= xa) = (Suc xa <= x)"
@@ -1573,45 +1554,41 @@
    m - (n - p) = (if n <= p then m else m + p - n)"
   by (import arithmetic SUB_LEFT_SUB)
 
-lemma SUB_LEFT_SUC: "ALL (m::nat) n::nat.
-   Suc (m - n) = (if m <= n then Suc (0::nat) else Suc m - n)"
+lemma SUB_LEFT_SUC: "ALL (m::nat) n::nat. Suc (m - n) = (if m <= n then Suc 0 else Suc m - n)"
   by (import arithmetic SUB_LEFT_SUC)
 
-lemma SUB_LEFT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m <= n - p) = (m + p <= n | m <= (0::nat))"
+lemma SUB_LEFT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m <= n - p) = (m + p <= n | m <= 0)"
   by (import arithmetic SUB_LEFT_LESS_EQ)
 
 lemma SUB_RIGHT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m - n <= p) = (m <= n + p)"
   by (import arithmetic SUB_RIGHT_LESS_EQ)
 
-lemma SUB_RIGHT_LESS: "ALL (m::nat) (n::nat) p::nat. (m - n < p) = (m < n + p & (0::nat) < p)"
+lemma SUB_RIGHT_LESS: "ALL (m::nat) (n::nat) p::nat. (m - n < p) = (m < n + p & 0 < p)"
   by (import arithmetic SUB_RIGHT_LESS)
 
-lemma SUB_RIGHT_GREATER_EQ: "ALL (m::nat) (n::nat) p::nat. (p <= m - n) = (n + p <= m | p <= (0::nat))"
+lemma SUB_RIGHT_GREATER_EQ: "ALL (m::nat) (n::nat) p::nat. (p <= m - n) = (n + p <= m | p <= 0)"
   by (import arithmetic SUB_RIGHT_GREATER_EQ)
 
-lemma SUB_LEFT_GREATER: "ALL (m::nat) (n::nat) p::nat. (n - p < m) = (n < m + p & (0::nat) < m)"
+lemma SUB_LEFT_GREATER: "ALL (m::nat) (n::nat) p::nat. (n - p < m) = (n < m + p & 0 < m)"
   by (import arithmetic SUB_LEFT_GREATER)
 
 lemma SUB_RIGHT_GREATER: "ALL (m::nat) (n::nat) p::nat. (p < m - n) = (n + p < m)"
   by (import arithmetic SUB_RIGHT_GREATER)
 
-lemma SUB_LEFT_EQ: "ALL (m::nat) (n::nat) p::nat.
-   (m = n - p) = (m + p = n | m <= (0::nat) & n <= p)"
+lemma SUB_LEFT_EQ: "ALL (m::nat) (n::nat) p::nat. (m = n - p) = (m + p = n | m <= 0 & n <= p)"
   by (import arithmetic SUB_LEFT_EQ)
 
-lemma SUB_RIGHT_EQ: "ALL (m::nat) (n::nat) p::nat.
-   (m - n = p) = (m = n + p | m <= n & p <= (0::nat))"
+lemma SUB_RIGHT_EQ: "ALL (m::nat) (n::nat) p::nat. (m - n = p) = (m = n + p | m <= n & p <= 0)"
   by (import arithmetic SUB_RIGHT_EQ)
 
-lemma LE: "(ALL n::nat. (n <= (0::nat)) = (n = (0::nat))) &
+lemma LE: "(ALL n::nat. (n <= 0) = (n = 0)) &
 (ALL (m::nat) n::nat. (m <= Suc n) = (m = Suc n | m <= n))"
   by (import arithmetic LE)
 
-lemma DA: "ALL (k::nat) n::nat.
-   (0::nat) < n --> (EX (x::nat) q::nat. k = q * n + x & x < n)"
+lemma DA: "ALL (k::nat) n::nat. 0 < n --> (EX (x::nat) q::nat. k = q * n + x & x < n)"
   by (import arithmetic DA)
 
-lemma DIV_LESS_EQ: "ALL n>0::nat. ALL k::nat. k div n <= k"
+lemma DIV_LESS_EQ: "ALL n>0. ALL k::nat. k div n <= k"
   by (import arithmetic DIV_LESS_EQ)
 
 lemma DIV_UNIQUE: "ALL (n::nat) (k::nat) q::nat.
@@ -1625,92 +1602,108 @@
 lemma DIV_MULT: "ALL (n::nat) r::nat. r < n --> (ALL q::nat. (q * n + r) div n = q)"
   by (import arithmetic DIV_MULT)
 
-lemma MOD_EQ_0: "ALL n>0::nat. ALL k::nat. k * n mod n = (0::nat)"
+lemma MOD_EQ_0: "ALL n>0. ALL k::nat. k * n mod n = 0"
   by (import arithmetic MOD_EQ_0)
 
-lemma ZERO_MOD: "ALL n>0::nat. (0::nat) mod n = (0::nat)"
+lemma ZERO_MOD: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
+      ((op =::nat => nat => bool) ((op mod::nat => nat => nat) (0::nat) n)
+        (0::nat)))"
   by (import arithmetic ZERO_MOD)
 
-lemma ZERO_DIV: "ALL n>0::nat. (0::nat) div n = (0::nat)"
+lemma ZERO_DIV: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
+      ((op =::nat => nat => bool) ((op div::nat => nat => nat) (0::nat) n)
+        (0::nat)))"
   by (import arithmetic ZERO_DIV)
 
 lemma MOD_MULT: "ALL (n::nat) r::nat. r < n --> (ALL q::nat. (q * n + r) mod n = r)"
   by (import arithmetic MOD_MULT)
 
-lemma MOD_TIMES: "ALL n>0::nat. ALL (q::nat) r::nat. (q * n + r) mod n = r mod n"
+lemma MOD_TIMES: "ALL n>0. ALL (q::nat) r::nat. (q * n + r) mod n = r mod n"
   by (import arithmetic MOD_TIMES)
 
-lemma MOD_PLUS: "ALL n>0::nat. ALL (j::nat) k::nat. (j mod n + k mod n) mod n = (j + k) mod n"
+lemma MOD_PLUS: "ALL n>0. ALL (j::nat) k::nat. (j mod n + k mod n) mod n = (j + k) mod n"
   by (import arithmetic MOD_PLUS)
 
-lemma MOD_MOD: "ALL n>0::nat. ALL k::nat. k mod n mod n = k mod n"
+lemma MOD_MOD: "ALL n>0. ALL k::nat. k mod n mod n = k mod n"
   by (import arithmetic MOD_MOD)
 
-lemma ADD_DIV_ADD_DIV: "ALL x>0::nat. ALL (xa::nat) r::nat. (xa * x + r) div x = xa + r div x"
+lemma ADD_DIV_ADD_DIV: "ALL x>0. ALL (xa::nat) r::nat. (xa * x + r) div x = xa + r div x"
   by (import arithmetic ADD_DIV_ADD_DIV)
 
 lemma MOD_MULT_MOD: "ALL (m::nat) n::nat.
-   (0::nat) < n & (0::nat) < m -->
-   (ALL x::nat. x mod (n * m) mod n = x mod n)"
+   0 < n & 0 < m --> (ALL x::nat. x mod (n * m) mod n = x mod n)"
   by (import arithmetic MOD_MULT_MOD)
 
-lemma DIVMOD_ID: "ALL n>0::nat. n div n = (1::nat) & n mod n = (0::nat)"
+lemma DIVMOD_ID: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
+      ((op &::bool => bool => bool)
+        ((op =::nat => nat => bool) ((op div::nat => nat => nat) n n)
+          (1::nat))
+        ((op =::nat => nat => bool) ((op mod::nat => nat => nat) n n)
+          (0::nat))))"
   by (import arithmetic DIVMOD_ID)
 
 lemma DIV_DIV_DIV_MULT: "ALL (x::nat) xa::nat.
-   (0::nat) < x & (0::nat) < xa -->
-   (ALL xb::nat. xb div x div xa = xb div (x * xa))"
+   0 < x & 0 < xa --> (ALL xb::nat. xb div x div xa = xb div (x * xa))"
   by (import arithmetic DIV_DIV_DIV_MULT)
 
 lemma DIV_P: "ALL (P::nat => bool) (p::nat) q::nat.
-   (0::nat) < q -->
-   P (p div q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P k)"
+   0 < q --> P (p div q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P k)"
   by (import arithmetic DIV_P)
 
 lemma MOD_P: "ALL (P::nat => bool) (p::nat) q::nat.
-   (0::nat) < q -->
-   P (p mod q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P r)"
+   0 < q --> P (p mod q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P r)"
   by (import arithmetic MOD_P)
 
-lemma MOD_TIMES2: "ALL n>0::nat. ALL (j::nat) k::nat. j mod n * (k mod n) mod n = j * k mod n"
+lemma MOD_TIMES2: "ALL n>0. ALL (j::nat) k::nat. j mod n * (k mod n) mod n = j * k mod n"
   by (import arithmetic MOD_TIMES2)
 
 lemma MOD_COMMON_FACTOR: "ALL (n::nat) (p::nat) q::nat.
-   (0::nat) < n & (0::nat) < q --> n * (p mod q) = n * p mod (n * q)"
+   0 < n & 0 < q --> n * (p mod q) = n * p mod (n * q)"
   by (import arithmetic MOD_COMMON_FACTOR)
 
 lemma num_case_cong: "ALL (M::nat) (M'::nat) (b::'a::type) f::nat => 'a::type.
    M = M' &
-   (M' = (0::nat) --> b = (b'::'a::type)) &
+   (M' = 0 --> b = (b'::'a::type)) &
    (ALL n::nat. M' = Suc n --> f n = (f'::nat => 'a::type) n) -->
    nat_case b f M = nat_case b' f' M'"
   by (import arithmetic num_case_cong)
 
 lemma SUC_ELIM_THM: "ALL P::nat => nat => bool.
-   (ALL n::nat. P (Suc n) n) = (ALL n>0::nat. P n (n - (1::nat)))"
+   (ALL n::nat. P (Suc n) n) = (ALL n>0. P n (n - 1))"
   by (import arithmetic SUC_ELIM_THM)
 
 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))"
+(ALL x::nat. (b = a + x --> P 0) & (a = b + x --> P x))"
   by (import arithmetic SUB_ELIM_THM)
 
 lemma PRE_ELIM_THM: "(P::nat => bool) (PRE (n::nat)) =
-(ALL m::nat. (n = (0::nat) --> P (0::nat)) & (n = Suc m --> P m))"
+(ALL m::nat. (n = 0 --> P 0) & (n = Suc m --> P m))"
   by (import arithmetic PRE_ELIM_THM)
 
-lemma MULT_INCREASES: "ALL (m::nat) n::nat. (1::nat) < m & (0::nat) < n --> Suc n <= m * n"
+lemma MULT_INCREASES: "ALL (m::nat) n::nat. 1 < m & 0 < n --> Suc n <= m * n"
   by (import arithmetic MULT_INCREASES)
 
-lemma EXP_ALWAYS_BIG_ENOUGH: "ALL b>1::nat. ALL n::nat. EX m::nat. n <= b ^ m"
+lemma EXP_ALWAYS_BIG_ENOUGH: "ALL b>1. ALL n::nat. EX m::nat. n <= b ^ m"
   by (import arithmetic EXP_ALWAYS_BIG_ENOUGH)
 
-lemma EXP_EQ_0: "ALL (n::nat) m::nat. (n ^ m = (0::nat)) = (n = (0::nat) & (0::nat) < m)"
+lemma EXP_EQ_0: "ALL (n::nat) m::nat. (n ^ m = 0) = (n = 0 & 0 < m)"
   by (import arithmetic EXP_EQ_0)
 
-lemma EXP_1: "ALL x::nat. (1::nat) ^ x = (1::nat) & x ^ (1::nat) = x"
+lemma EXP_1: "(All::(nat => bool) => bool)
+ (%x::nat.
+     (op &::bool => bool => bool)
+      ((op =::nat => nat => bool) ((op ^::nat => nat => nat) (1::nat) x)
+        (1::nat))
+      ((op =::nat => nat => bool) ((op ^::nat => nat => nat) x (1::nat)) x))"
   by (import arithmetic EXP_1)
 
-lemma EXP_EQ_1: "ALL (n::nat) m::nat. (n ^ m = (1::nat)) = (n = (1::nat) | m = (0::nat))"
+lemma EXP_EQ_1: "ALL (n::nat) m::nat. (n ^ m = 1) = (n = 1 | m = 0)"
   by (import arithmetic EXP_EQ_1)
 
 lemma MIN_MAX_EQ: "ALL (x::nat) xa::nat. (min x xa = max x xa) = (x = xa)"
@@ -1741,10 +1734,10 @@
 lemma MAX_LE: "ALL (x::nat) xa::nat. xa <= max xa x & x <= max xa x"
   by (import arithmetic MAX_LE)
 
-lemma MIN_0: "ALL x::nat. min x (0::nat) = (0::nat) & min (0::nat) x = (0::nat)"
+lemma MIN_0: "ALL x::nat. min x 0 = 0 & min 0 x = 0"
   by (import arithmetic MIN_0)
 
-lemma MAX_0: "ALL x::nat. max x (0::nat) = x & max (0::nat) x = x"
+lemma MAX_0: "ALL x::nat. max x 0 = x & max 0 x = x"
   by (import arithmetic MAX_0)
 
 lemma EXISTS_GREATEST: "ALL P::nat => bool.
@@ -1758,9 +1751,9 @@
 
 constdefs
   trat_1 :: "nat * nat" 
-  "trat_1 == (0::nat, 0::nat)"
-
-lemma trat_1: "trat_1 = (0::nat, 0::nat)"
+  "trat_1 == (0, 0)"
+
+lemma trat_1: "trat_1 = (0, 0)"
   by (import hrat trat_1)
 
 constdefs
@@ -1794,7 +1787,7 @@
 consts
   trat_sucint :: "nat => nat * nat" 
 
-specification (trat_sucint) trat_sucint: "trat_sucint (0::nat) = trat_1 &
+specification (trat_sucint) trat_sucint: "trat_sucint 0 = trat_1 &
 (ALL n::nat. trat_sucint (Suc n) = trat_add (trat_sucint n) trat_1)"
   by (import hrat trat_sucint)
 
@@ -1882,14 +1875,14 @@
    (EX d::nat * nat. trat_eq i (trat_add h d))"
   by (import hrat TRAT_ADD_TOTAL)
 
-lemma TRAT_SUCINT_0: "ALL n::nat. trat_eq (trat_sucint n) (n, 0::nat)"
+lemma TRAT_SUCINT_0: "ALL n::nat. trat_eq (trat_sucint n) (n, 0)"
   by (import hrat TRAT_SUCINT_0)
 
 lemma TRAT_ARCH: "ALL h::nat * nat.
    EX (n::nat) d::nat * nat. trat_eq (trat_sucint n) (trat_add h d)"
   by (import hrat TRAT_ARCH)
 
-lemma TRAT_SUCINT: "trat_eq (trat_sucint (0::nat)) trat_1 &
+lemma TRAT_SUCINT: "trat_eq (trat_sucint 0) trat_1 &
 (ALL n::nat.
     trat_eq (trat_sucint (Suc n)) (trat_add (trat_sucint n) trat_1))"
   by (import hrat TRAT_SUCINT)
@@ -1989,7 +1982,7 @@
 lemma HRAT_ARCH: "ALL h::hrat. EX (x::nat) xa::hrat. hrat_sucint x = hrat_add h xa"
   by (import hrat HRAT_ARCH)
 
-lemma HRAT_SUCINT: "hrat_sucint (0::nat) = hrat_1 &
+lemma HRAT_SUCINT: "hrat_sucint 0 = hrat_1 &
 (ALL x::nat. hrat_sucint (Suc x) = hrat_add (hrat_sucint x) hrat_1)"
   by (import hrat HRAT_SUCINT)
 
@@ -2382,40 +2375,243 @@
 lemma iiSUC: "ALL n::nat. iiSUC n = Suc (Suc n)"
   by (import numeral iiSUC)
 
-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)"
+lemma numeral_distrib: "(op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (op =::nat => nat => bool) ((op +::nat => nat => nat) (0::nat) x) x))
+ ((op &::bool => bool => bool)
+   ((All::(nat => bool) => bool)
+     (%x::nat.
+         (op =::nat => nat => bool) ((op +::nat => nat => nat) x (0::nat))
+          x))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (All::(nat => bool) => bool)
+            (%xa::nat.
+                (op =::nat => nat => bool)
+                 ((op +::nat => nat => nat) ((NUMERAL::nat => nat) x)
+                   ((NUMERAL::nat => nat) xa))
+                 ((NUMERAL::nat => nat)
+                   ((iZ::nat => nat) ((op +::nat => nat => nat) x xa))))))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (op =::nat => nat => bool)
+              ((op *::nat => nat => nat) (0::nat) x) (0::nat)))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::nat => nat => bool)
+                ((op *::nat => nat => nat) x (0::nat)) (0::nat)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (All::(nat => bool) => bool)
+                  (%xa::nat.
+                      (op =::nat => nat => bool)
+                       ((op *::nat => nat => nat) ((NUMERAL::nat => nat) x)
+                         ((NUMERAL::nat => nat) xa))
+                       ((NUMERAL::nat => nat)
+                         ((op *::nat => nat => nat) x xa)))))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%x::nat.
+                   (op =::nat => nat => bool)
+                    ((op -::nat => nat => nat) (0::nat) x) (0::nat)))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%x::nat.
+                     (op =::nat => nat => bool)
+                      ((op -::nat => nat => nat) x (0::nat)) x))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::nat => nat => bool)
+                             ((op -::nat => nat => nat)
+                               ((NUMERAL::nat => nat) x)
+                               ((NUMERAL::nat => nat) xa))
+                             ((NUMERAL::nat => nat)
+                               ((op -::nat => nat => nat) x xa)))))
+                 ((op &::bool => bool => bool)
+                   ((All::(nat => bool) => bool)
+                     (%x::nat.
+                         (op =::nat => nat => bool)
+                          ((op ^::nat => nat => nat) (0::nat)
+                            ((NUMERAL::nat => nat)
+                              ((NUMERAL_BIT1::nat => nat) x)))
+                          (0::nat)))
+                   ((op &::bool => bool => bool)
+                     ((All::(nat => bool) => bool)
+                       (%x::nat.
+                           (op =::nat => nat => bool)
+                            ((op ^::nat => nat => nat) (0::nat)
+                              ((NUMERAL::nat => nat)
+                                ((NUMERAL_BIT2::nat => nat) x)))
+                            (0::nat)))
+                     ((op &::bool => bool => bool)
+                       ((All::(nat => bool) => bool)
+                         (%x::nat.
+                             (op =::nat => nat => bool)
+                              ((op ^::nat => nat => nat) x (0::nat))
+                              (1::nat)))
+                       ((op &::bool => bool => bool)
+                         ((All::(nat => bool) => bool)
+                           (%x::nat.
+                               (All::(nat => bool) => bool)
+                                (%xa::nat.
+                                    (op =::nat => nat => bool)
+                                     ((op ^::nat => nat => nat)
+ ((NUMERAL::nat => nat) x) ((NUMERAL::nat => nat) xa))
+                                     ((NUMERAL::nat => nat)
+ ((op ^::nat => nat => nat) x xa)))))
+                         ((op &::bool => bool => bool)
+                           ((op =::nat => nat => bool)
+                             ((Suc::nat => nat) (0::nat)) (1::nat))
+                           ((op &::bool => bool => bool)
+                             ((All::(nat => bool) => bool)
+                               (%x::nat.
+                                   (op =::nat => nat => bool)
+                                    ((Suc::nat => nat)
+((NUMERAL::nat => nat) x))
+                                    ((NUMERAL::nat => nat)
+((Suc::nat => nat) x))))
+                             ((op &::bool => bool => bool)
+                               ((op =::nat => nat => bool)
+                                 ((PRE::nat => nat) (0::nat)) (0::nat))
+                               ((op &::bool => bool => bool)
+                                 ((All::(nat => bool) => bool)
+                                   (%x::nat.
+ (op =::nat => nat => bool) ((PRE::nat => nat) ((NUMERAL::nat => nat) x))
+  ((NUMERAL::nat => nat) ((PRE::nat => nat) x))))
+                                 ((op &::bool => bool => bool)
+                                   ((All::(nat => bool) => bool)
+                                     (%x::nat.
+   (op =::bool => bool => bool)
+    ((op =::nat => nat => bool) ((NUMERAL::nat => nat) x) (0::nat))
+    ((op =::nat => nat => bool) x (ALT_ZERO::nat))))
+                                   ((op &::bool => bool => bool)
+                                     ((All::(nat => bool) => bool)
+ (%x::nat.
+     (op =::bool => bool => bool)
+      ((op =::nat => nat => bool) (0::nat) ((NUMERAL::nat => nat) x))
+      ((op =::nat => nat => bool) x (ALT_ZERO::nat))))
+                                     ((op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (All::(nat => bool) => bool)
+        (%xa::nat.
+            (op =::bool => bool => bool)
+             ((op =::nat => nat => bool) ((NUMERAL::nat => nat) x)
+               ((NUMERAL::nat => nat) xa))
+             ((op =::nat => nat => bool) x xa))))
+ ((op &::bool => bool => bool)
+   ((All::(nat => bool) => bool)
+     (%x::nat.
+         (op =::bool => bool => bool)
+          ((op <::nat => nat => bool) x (0::nat)) (False::bool)))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (op =::bool => bool => bool)
+            ((op <::nat => nat => bool) (0::nat) ((NUMERAL::nat => nat) x))
+            ((op <::nat => nat => bool) (ALT_ZERO::nat) x)))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (All::(nat => bool) => bool)
+              (%xa::nat.
+                  (op =::bool => bool => bool)
+                   ((op <::nat => nat => bool) ((NUMERAL::nat => nat) x)
+                     ((NUMERAL::nat => nat) xa))
+                   ((op <::nat => nat => bool) x xa))))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::bool => bool => bool)
+                ((op <::nat => nat => bool) x (0::nat)) (False::bool)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::bool => bool => bool)
+                  ((op <::nat => nat => bool) (0::nat)
+                    ((NUMERAL::nat => nat) x))
+                  ((op <::nat => nat => bool) (ALT_ZERO::nat) x)))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%x::nat.
+                   (All::(nat => bool) => bool)
+                    (%xa::nat.
+                        (op =::bool => bool => bool)
+                         ((op <::nat => nat => bool)
+                           ((NUMERAL::nat => nat) xa)
+                           ((NUMERAL::nat => nat) x))
+                         ((op <::nat => nat => bool) xa x))))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%x::nat.
+                     (op =::bool => bool => bool)
+                      ((op <=::nat => nat => bool) (0::nat) x)
+                      (True::bool)))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (op =::bool => bool => bool)
+                        ((op <=::nat => nat => bool)
+                          ((NUMERAL::nat => nat) x) (0::nat))
+                        ((op <=::nat => nat => bool) x (ALT_ZERO::nat))))
+                 ((op &::bool => bool => bool)
+                   ((All::(nat => bool) => bool)
+                     (%x::nat.
+                         (All::(nat => bool) => bool)
+                          (%xa::nat.
+                              (op =::bool => bool => bool)
+                               ((op <=::nat => nat => bool)
+                                 ((NUMERAL::nat => nat) x)
+                                 ((NUMERAL::nat => nat) xa))
+                               ((op <=::nat => nat => bool) x xa))))
+                   ((op &::bool => bool => bool)
+                     ((All::(nat => bool) => bool)
+                       (%x::nat.
+                           (op =::bool => bool => bool)
+                            ((op <=::nat => nat => bool) (0::nat) x)
+                            (True::bool)))
+                     ((op &::bool => bool => bool)
+                       ((All::(nat => bool) => bool)
+                         (%x::nat.
+                             (op =::bool => bool => bool)
+                              ((op <=::nat => nat => bool) x (0::nat))
+                              ((op =::nat => nat => bool) x (0::nat))))
+                       ((op &::bool => bool => bool)
+                         ((All::(nat => bool) => bool)
+                           (%x::nat.
+                               (All::(nat => bool) => bool)
+                                (%xa::nat.
+                                    (op =::bool => bool => bool)
+                                     ((op <=::nat => nat => bool)
+ ((NUMERAL::nat => nat) xa) ((NUMERAL::nat => nat) x))
+                                     ((op <=::nat => nat => bool) xa x))))
+                         ((op &::bool => bool => bool)
+                           ((All::(nat => bool) => bool)
+                             (%x::nat.
+                                 (op =::bool => bool => bool)
+                                  ((ODD::nat => bool)
+                                    ((NUMERAL::nat => nat) x))
+                                  ((ODD::nat => bool) x)))
+                           ((op &::bool => bool => bool)
+                             ((All::(nat => bool) => bool)
+                               (%x::nat.
+                                   (op =::bool => bool => bool)
+                                    ((EVEN::nat => bool)
+((NUMERAL::nat => nat) x))
+                                    ((EVEN::nat => bool) x)))
+                             ((op &::bool => bool => bool)
+                               ((Not::bool => bool)
+                                 ((ODD::nat => bool) (0::nat)))
+                               ((EVEN::nat => bool)
+                                 (0::nat))))))))))))))))))))))))))))))))))))"
   by (import numeral numeral_distrib)
 
 lemma numeral_iisuc: "iiSUC ALT_ZERO = NUMERAL_BIT2 ALT_ZERO &
@@ -2496,7 +2692,7 @@
   by (import numeral bit_initiality)
 
 consts
-  iBIT_cases :: "nat => 'a::type => (nat => 'a::type) => (nat => 'a::type) => 'a::type" 
+  iBIT_cases :: "nat => 'a => (nat => 'a) => (nat => 'a) => 'a" 
 
 specification (iBIT_cases) iBIT_cases: "(ALL (zf::'a::type) (bf1::nat => 'a::type) bf2::nat => 'a::type.
     iBIT_cases ALT_ZERO zf bf1 bf2 = zf) &
@@ -2561,17 +2757,8 @@
    NUMERAL_BIT1 (iSUB False xb xc)"
   by (import numeral iSUB_THM)
 
-lemma numeral_sub: "(All::(nat => bool) => bool)
- (%x::nat.
-     (All::(nat => bool) => bool)
-      (%xa::nat.
-          (op =::nat => nat => bool)
-           ((NUMERAL::nat => nat) ((op -::nat => nat => nat) x xa))
-           ((If::bool => nat => nat => nat)
-             ((op <::nat => nat => bool) xa x)
-             ((NUMERAL::nat => nat)
-               ((iSUB::bool => nat => nat => nat) (True::bool) x xa))
-             (0::nat))))"
+lemma numeral_sub: "ALL (x::nat) xa::nat.
+   NUMERAL (x - xa) = (if xa < x then NUMERAL (iSUB True x xa) else 0)"
   by (import numeral numeral_sub)
 
 lemma iDUB_removal: "ALL x::nat.
@@ -2606,12 +2793,12 @@
    ~ ODD ALT_ZERO & ~ ODD (NUMERAL_BIT2 x) & ODD (NUMERAL_BIT1 x)"
   by (import numeral numeral_evenodd)
 
-lemma numeral_fact: "ALL n::nat. FACT n = (if n = (0::nat) then 1::nat else n * FACT (PRE n))"
+lemma numeral_fact: "ALL n::nat. FACT n = (if n = 0 then 1 else n * FACT (PRE n))"
   by (import numeral numeral_fact)
 
 lemma numeral_funpow: "ALL n::nat.
    ((f::'a::type => 'a::type) ^ n) (x::'a::type) =
-   (if n = (0::nat) then x else (f ^ (n - (1::nat))) (f x))"
+   (if n = 0 then x else (f ^ (n - 1)) (f x))"
   by (import numeral numeral_funpow)
 
 ;end_setup
@@ -2627,9 +2814,9 @@
 
 constdefs
   NUMPAIR :: "nat => nat => nat" 
-  "NUMPAIR == %(x::nat) y::nat. (2::nat) ^ x * ((2::nat) * y + (1::nat))"
-
-lemma NUMPAIR: "ALL (x::nat) y::nat. NUMPAIR x y = (2::nat) ^ x * ((2::nat) * y + (1::nat))"
+  "NUMPAIR == %(x::nat) y::nat. 2 ^ x * (2 * y + 1)"
+
+lemma NUMPAIR: "ALL (x::nat) y::nat. NUMPAIR x y = 2 ^ x * (2 * y + 1)"
   by (import ind_type NUMPAIR)
 
 lemma NUMPAIR_INJ_LEMMA: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
@@ -2649,10 +2836,9 @@
 
 constdefs
   NUMSUM :: "bool => nat => nat" 
-  "NUMSUM == %(b::bool) x::nat. if b then Suc ((2::nat) * x) else (2::nat) * x"
-
-lemma NUMSUM: "ALL (b::bool) x::nat.
-   NUMSUM b x = (if b then Suc ((2::nat) * x) else (2::nat) * x)"
+  "NUMSUM == %(b::bool) x::nat. if b then Suc (2 * x) else 2 * x"
+
+lemma NUMSUM: "ALL (b::bool) x::nat. NUMSUM b x = (if b then Suc (2 * x) else 2 * x)"
   by (import ind_type NUMSUM)
 
 lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
@@ -2667,7 +2853,7 @@
   by (import ind_type NUMSUM_DEST)
 
 constdefs
-  INJN :: "nat => nat => 'a::type => bool" 
+  INJN :: "nat => nat => 'a => bool" 
   "INJN == %(m::nat) (n::nat) a::'a::type. n = m"
 
 lemma INJN: "ALL m::nat. INJN m = (%(n::nat) a::'a::type. n = m)"
@@ -2677,7 +2863,7 @@
   by (import ind_type INJN_INJ)
 
 constdefs
-  INJA :: "'a::type => nat => 'a::type => bool" 
+  INJA :: "'a => nat => 'a => bool" 
   "INJA == %(a::'a::type) (n::nat) b::'a::type. b = a"
 
 lemma INJA: "ALL a::'a::type. INJA a = (%(n::nat) b::'a::type. b = a)"
@@ -2687,7 +2873,7 @@
   by (import ind_type INJA_INJ)
 
 constdefs
-  INJF :: "(nat => nat => 'a::type => bool) => nat => 'a::type => bool" 
+  INJF :: "(nat => nat => 'a => bool) => nat => 'a => bool" 
   "INJF == %(f::nat => nat => 'a::type => bool) n::nat. f (NUMFST n) (NUMSND n)"
 
 lemma INJF: "ALL f::nat => nat => 'a::type => bool.
@@ -2699,8 +2885,7 @@
   by (import ind_type INJF_INJ)
 
 constdefs
-  INJP :: "(nat => 'a::type => bool)
-=> (nat => 'a::type => bool) => nat => 'a::type => bool" 
+  INJP :: "(nat => 'a => bool) => (nat => 'a => bool) => nat => 'a => bool" 
   "INJP ==
 %(f1::nat => 'a::type => bool) (f2::nat => 'a::type => bool) (n::nat)
    a::'a::type. if NUMLEFT n then f1 (NUMRIGHT n) a else f2 (NUMRIGHT n) a"
@@ -2717,8 +2902,7 @@
   by (import ind_type INJP_INJ)
 
 constdefs
-  ZCONSTR :: "nat
-=> 'a::type => (nat => nat => 'a::type => bool) => nat => 'a::type => bool" 
+  ZCONSTR :: "nat => 'a => (nat => nat => 'a => bool) => nat => 'a => bool" 
   "ZCONSTR ==
 %(c::nat) (i::'a::type) r::nat => nat => 'a::type => bool.
    INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
@@ -2728,10 +2912,10 @@
   by (import ind_type ZCONSTR)
 
 constdefs
-  ZBOT :: "nat => 'a::type => bool" 
-  "ZBOT == INJP (INJN (0::nat)) (SOME z::nat => 'a::type => bool. True)"
-
-lemma ZBOT: "ZBOT = INJP (INJN (0::nat)) (SOME z::nat => 'a::type => bool. True)"
+  ZBOT :: "nat => 'a => bool" 
+  "ZBOT == INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
+
+lemma ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
   by (import ind_type ZBOT)
 
 lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'a::type) xb::nat => nat => 'a::type => bool.
@@ -2739,7 +2923,7 @@
   by (import ind_type ZCONSTR_ZBOT)
 
 constdefs
-  ZRECSPACE :: "(nat => 'a::type => bool) => bool" 
+  ZRECSPACE :: "(nat => 'a => bool) => bool" 
   "ZRECSPACE ==
 %a0::nat => 'a::type => bool.
    ALL ZRECSPACE'::(nat => 'a::type => bool) => bool.
@@ -2805,22 +2989,22 @@
 lemmas recspace_TY_DEF = typedef_hol2hol4 [OF type_definition_recspace]
 
 consts
-  mk_rec :: "(nat => 'a::type => bool) => 'a::type recspace" 
-  dest_rec :: "'a::type recspace => nat => 'a::type => bool" 
+  mk_rec :: "(nat => 'a => bool) => 'a recspace" 
+  dest_rec :: "'a recspace => nat => 'a => bool" 
 
 specification (dest_rec mk_rec) recspace_repfns: "(ALL a::'a::type recspace. mk_rec (dest_rec a) = a) &
 (ALL r::nat => 'a::type => bool. ZRECSPACE r = (dest_rec (mk_rec r) = r))"
   by (import ind_type recspace_repfns)
 
 constdefs
-  BOTTOM :: "'a::type recspace" 
+  BOTTOM :: "'a recspace" 
   "BOTTOM == mk_rec ZBOT"
 
 lemma BOTTOM: "BOTTOM = mk_rec ZBOT"
   by (import ind_type BOTTOM)
 
 constdefs
-  CONSTR :: "nat => 'a::type => (nat => 'a::type recspace) => 'a::type recspace" 
+  CONSTR :: "nat => 'a => (nat => 'a recspace) => 'a recspace" 
   "CONSTR ==
 %(c::nat) (i::'a::type) r::nat => 'a::type recspace.
    mk_rec (ZCONSTR c i (%n::nat. dest_rec (r n)))"
@@ -2862,21 +3046,21 @@
   by (import ind_type CONSTR_REC)
 
 consts
-  FCONS :: "'a::type => (nat => 'a::type) => nat => 'a::type" 
-
-specification (FCONS) FCONS: "(ALL (a::'a::type) f::nat => 'a::type. FCONS a f (0::nat) = a) &
+  FCONS :: "'a => (nat => 'a) => nat => 'a" 
+
+specification (FCONS) FCONS: "(ALL (a::'a::type) f::nat => 'a::type. FCONS a f 0 = a) &
 (ALL (a::'a::type) (f::nat => 'a::type) n::nat. FCONS a f (Suc n) = f n)"
   by (import ind_type FCONS)
 
 constdefs
-  FNIL :: "nat => 'a::type" 
+  FNIL :: "nat => 'a" 
   "FNIL == %n::nat. SOME x::'a::type. True"
 
 lemma FNIL: "ALL n::nat. FNIL n = (SOME x::'a::type. True)"
   by (import ind_type FNIL)
 
 constdefs
-  ISO :: "('a::type => 'b::type) => ('b::type => 'a::type) => bool" 
+  ISO :: "('a => 'b) => ('b => 'a) => bool" 
   "ISO ==
 %(f::'a::type => 'b::type) g::'b::type => 'a::type.
    (ALL x::'b::type. f (g x) = x) & (ALL y::'a::type. g (f y) = y)"
@@ -2905,16 +3089,16 @@
 
 ;setup_theory divides
 
-lemma ONE_DIVIDES_ALL: "All (op dvd (1::nat))"
+lemma ONE_DIVIDES_ALL: "(All::(nat => bool) => bool) ((op dvd::nat => nat => bool) (1::nat))"
   by (import divides ONE_DIVIDES_ALL)
 
 lemma DIVIDES_ADD_2: "ALL (a::nat) (b::nat) c::nat. a dvd b & a dvd b + c --> a dvd c"
   by (import divides DIVIDES_ADD_2)
 
-lemma DIVIDES_FACT: "ALL b>0::nat. b dvd FACT b"
+lemma DIVIDES_FACT: "ALL b>0. b dvd FACT b"
   by (import divides DIVIDES_FACT)
 
-lemma DIVIDES_MULT_LEFT: "ALL (x::nat) xa::nat. (x * xa dvd xa) = (xa = (0::nat) | x = (1::nat))"
+lemma DIVIDES_MULT_LEFT: "ALL (x::nat) xa::nat. (x * xa dvd xa) = (xa = 0 | x = 1)"
   by (import divides DIVIDES_MULT_LEFT)
 
 ;end_setup
@@ -2925,18 +3109,16 @@
   prime :: "nat => bool" 
 
 defs
-  prime_primdef: "prime.prime ==
-%a::nat. a ~= (1::nat) & (ALL b::nat. b dvd a --> b = a | b = (1::nat))"
+  prime_primdef: "prime.prime == %a::nat. a ~= 1 & (ALL b::nat. b dvd a --> b = a | b = 1)"
 
 lemma prime_def: "ALL a::nat.
-   prime.prime a =
-   (a ~= (1::nat) & (ALL b::nat. b dvd a --> b = a | b = (1::nat)))"
+   prime.prime a = (a ~= 1 & (ALL b::nat. b dvd a --> b = a | b = 1))"
   by (import prime prime_def)
 
-lemma NOT_PRIME_0: "~ prime.prime (0::nat)"
+lemma NOT_PRIME_0: "~ prime.prime 0"
   by (import prime NOT_PRIME_0)
 
-lemma NOT_PRIME_1: "~ prime.prime (1::nat)"
+lemma NOT_PRIME_1: "~ prime.prime 1"
   by (import prime NOT_PRIME_1)
 
 ;end_setup
@@ -2944,9 +3126,9 @@
 ;setup_theory list
 
 consts
-  EL :: "nat => 'a::type list => 'a::type" 
-
-specification (EL) EL: "(ALL l::'a::type list. EL (0::nat) l = hd l) &
+  EL :: "nat => 'a list => 'a" 
+
+specification (EL) EL: "(ALL l::'a::type list. EL 0 l = hd l) &
 (ALL (l::'a::type list) n::nat. EL (Suc n) l = EL n (tl l))"
   by (import list EL)
 
@@ -3047,7 +3229,7 @@
   by (import list LENGTH_EQ_CONS)
 
 lemma LENGTH_EQ_NIL: "ALL P::'a::type list => bool.
-   (ALL l::'a::type list. length l = (0::nat) --> P l) = P []"
+   (ALL l::'a::type list. length l = 0 --> P l) = P []"
   by (import list LENGTH_EQ_NIL)
 
 lemma CONS_ACYCLIC: "ALL (l::'a::type list) x::'a::type. l ~= x # l & x # l ~= l"
@@ -3066,8 +3248,7 @@
   by (import list APPEND_11)
 
 lemma EL_compute: "ALL n::nat.
-   EL n (l::'a::type list) =
-   (if n = (0::nat) then hd l else EL (PRE n) (tl l))"
+   EL n (l::'a::type list) = (if n = 0 then hd l else EL (PRE n) (tl l))"
   by (import list EL_compute)
 
 lemma WF_LIST_PRED: "WF (%(L1::'a::type list) L2::'a::type list. EX h::'a::type. L2 = h # L1)"
@@ -3245,7 +3426,7 @@
   by (import pred_set NUM_SET_WOP)
 
 consts
-  GSPEC :: "('b::type => 'a::type * bool) => 'a::type => bool" 
+  GSPEC :: "('b => 'a * bool) => 'a => bool" 
 
 specification (GSPEC) GSPECIFICATION: "ALL (f::'b::type => 'a::type * bool) v::'a::type.
    IN v (GSPEC f) = (EX x::'b::type. (v, True) = f x)"
@@ -3257,7 +3438,7 @@
   by (import pred_set SET_MINIMUM)
 
 constdefs
-  EMPTY :: "'a::type => bool" 
+  EMPTY :: "'a => bool" 
   "EMPTY == %x::'a::type. False"
 
 lemma EMPTY_DEF: "EMPTY = (%x::'a::type. False)"
@@ -3270,7 +3451,7 @@
   by (import pred_set MEMBER_NOT_EMPTY)
 
 consts
-  UNIV :: "'a::type => bool" 
+  UNIV :: "'a => bool" 
 
 defs
   UNIV_def: "pred_set.UNIV == %x::'a::type. True"
@@ -3291,7 +3472,7 @@
   by (import pred_set EQ_UNIV)
 
 constdefs
-  SUBSET :: "('a::type => bool) => ('a::type => bool) => bool" 
+  SUBSET :: "('a => bool) => ('a => bool) => bool" 
   "SUBSET ==
 %(s::'a::type => bool) t::'a::type => bool.
    ALL x::'a::type. IN x s --> IN x t"
@@ -3324,7 +3505,7 @@
   by (import pred_set UNIV_SUBSET)
 
 constdefs
-  PSUBSET :: "('a::type => bool) => ('a::type => bool) => bool" 
+  PSUBSET :: "('a => bool) => ('a => bool) => bool" 
   "PSUBSET == %(s::'a::type => bool) t::'a::type => bool. SUBSET s t & s ~= t"
 
 lemma PSUBSET_DEF: "ALL (s::'a::type => bool) t::'a::type => bool.
@@ -3349,7 +3530,7 @@
   by (import pred_set PSUBSET_UNIV)
 
 consts
-  UNION :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
+  UNION :: "('a => bool) => ('a => bool) => 'a => bool" 
 
 defs
   UNION_def: "pred_set.UNION ==
@@ -3403,7 +3584,7 @@
   by (import pred_set EMPTY_UNION)
 
 consts
-  INTER :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
+  INTER :: "('a => bool) => ('a => bool) => 'a => bool" 
 
 defs
   INTER_def: "pred_set.INTER ==
@@ -3463,7 +3644,7 @@
   by (import pred_set INTER_OVER_UNION)
 
 constdefs
-  DISJOINT :: "('a::type => bool) => ('a::type => bool) => bool" 
+  DISJOINT :: "('a => bool) => ('a => bool) => bool" 
   "DISJOINT ==
 %(s::'a::type => bool) t::'a::type => bool. pred_set.INTER s t = EMPTY"
 
@@ -3495,7 +3676,7 @@
   by (import pred_set DISJOINT_UNION_BOTH)
 
 constdefs
-  DIFF :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
+  DIFF :: "('a => bool) => ('a => bool) => 'a => bool" 
   "DIFF ==
 %(s::'a::type => bool) t::'a::type => bool.
    GSPEC (%x::'a::type. (x, IN x s & ~ IN x t))"
@@ -3525,7 +3706,7 @@
   by (import pred_set DIFF_EQ_EMPTY)
 
 constdefs
-  INSERT :: "'a::type => ('a::type => bool) => 'a::type => bool" 
+  INSERT :: "'a => ('a => bool) => 'a => bool" 
   "INSERT ==
 %(x::'a::type) s::'a::type => bool.
    GSPEC (%y::'a::type. (y, y = x | IN y s))"
@@ -3601,7 +3782,7 @@
   by (import pred_set INSERT_DIFF)
 
 constdefs
-  DELETE :: "('a::type => bool) => 'a::type => 'a::type => bool" 
+  DELETE :: "('a => bool) => 'a => 'a => bool" 
   "DELETE == %(s::'a::type => bool) x::'a::type. DIFF s (INSERT x EMPTY)"
 
 lemma DELETE_DEF: "ALL (s::'a::type => bool) x::'a::type. DELETE s x = DIFF s (INSERT x EMPTY)"
@@ -3669,13 +3850,13 @@
   by (import pred_set DISJOINT_DELETE_SYM)
 
 consts
-  CHOICE :: "('a::type => bool) => 'a::type" 
+  CHOICE :: "('a => bool) => 'a" 
 
 specification (CHOICE) CHOICE_DEF: "ALL x::'a::type => bool. x ~= EMPTY --> IN (CHOICE x) x"
   by (import pred_set CHOICE_DEF)
 
 constdefs
-  REST :: "('a::type => bool) => 'a::type => bool" 
+  REST :: "('a => bool) => 'a => bool" 
   "REST == %s::'a::type => bool. DELETE s (CHOICE s)"
 
 lemma REST_DEF: "ALL s::'a::type => bool. REST s = DELETE s (CHOICE s)"
@@ -3694,7 +3875,7 @@
   by (import pred_set REST_PSUBSET)
 
 constdefs
-  SING :: "('a::type => bool) => bool" 
+  SING :: "('a => bool) => bool" 
   "SING == %s::'a::type => bool. EX x::'a::type. s = INSERT x EMPTY"
 
 lemma SING_DEF: "ALL s::'a::type => bool. SING s = (EX x::'a::type. s = INSERT x EMPTY)"
@@ -3740,7 +3921,7 @@
   by (import pred_set SING_IFF_EMPTY_REST)
 
 constdefs
-  IMAGE :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => bool" 
+  IMAGE :: "('a => 'b) => ('a => bool) => 'b => bool" 
   "IMAGE ==
 %(f::'a::type => 'b::type) s::'a::type => bool.
    GSPEC (%x::'a::type. (f x, IN x s))"
@@ -3794,7 +3975,7 @@
   by (import pred_set IMAGE_INTER)
 
 constdefs
-  INJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
+  INJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
   "INJ ==
 %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
    (ALL x::'a::type. IN x s --> IN (f x) t) &
@@ -3821,7 +4002,7 @@
   by (import pred_set INJ_EMPTY)
 
 constdefs
-  SURJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
+  SURJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
   "SURJ ==
 %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
    (ALL x::'a::type. IN x s --> IN (f x) t) &
@@ -3851,7 +4032,7 @@
   by (import pred_set IMAGE_SURJ)
 
 constdefs
-  BIJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
+  BIJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
   "BIJ ==
 %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
    INJ f s t & SURJ f s t"
@@ -3874,21 +4055,21 @@
   by (import pred_set BIJ_COMPOSE)
 
 consts
-  LINV :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => 'a::type" 
+  LINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
 
 specification (LINV) LINV_DEF: "ALL (f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
    INJ f s t --> (ALL x::'a::type. IN x s --> LINV f s (f x) = x)"
   by (import pred_set LINV_DEF)
 
 consts
-  RINV :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => 'a::type" 
+  RINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
 
 specification (RINV) RINV_DEF: "ALL (f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
    SURJ f s t --> (ALL x::'b::type. IN x t --> f (RINV f s x) = x)"
   by (import pred_set RINV_DEF)
 
 constdefs
-  FINITE :: "('a::type => bool) => bool" 
+  FINITE :: "('a => bool) => bool" 
   "FINITE ==
 %s::'a::type => bool.
    ALL P::('a::type => bool) => bool.
@@ -3954,7 +4135,7 @@
   by (import pred_set IMAGE_FINITE)
 
 consts
-  CARD :: "('a::type => bool) => nat" 
+  CARD :: "('a => bool) => nat" 
 
 specification (CARD) CARD_DEF: "(op &::bool => bool => bool)
  ((op =::nat => nat => bool)
@@ -3977,7 +4158,7 @@
                    ((CARD::('a::type => bool) => nat) s)))))))"
   by (import pred_set CARD_DEF)
 
-lemma CARD_EMPTY: "CARD EMPTY = (0::nat)"
+lemma CARD_EMPTY: "CARD EMPTY = 0"
   by (import pred_set CARD_EMPTY)
 
 lemma CARD_INSERT: "ALL s::'a::type => bool.
@@ -3986,13 +4167,13 @@
        CARD (INSERT x s) = (if IN x s then CARD s else Suc (CARD s)))"
   by (import pred_set CARD_INSERT)
 
-lemma CARD_EQ_0: "ALL s::'a::type => bool. FINITE s --> (CARD s = (0::nat)) = (s = EMPTY)"
+lemma CARD_EQ_0: "ALL s::'a::type => bool. FINITE s --> (CARD s = 0) = (s = EMPTY)"
   by (import pred_set CARD_EQ_0)
 
 lemma CARD_DELETE: "ALL s::'a::type => bool.
    FINITE s -->
    (ALL x::'a::type.
-       CARD (DELETE s x) = (if IN x s then CARD s - (1::nat) else CARD s))"
+       CARD (DELETE s x) = (if IN x s then CARD s - 1 else CARD s))"
   by (import pred_set CARD_DELETE)
 
 lemma CARD_INTER_LESS_EQ: "ALL s::'a::type => bool.
@@ -4016,10 +4197,10 @@
    FINITE s --> (ALL t::'a::type => bool. PSUBSET t s --> CARD t < CARD s)"
   by (import pred_set CARD_PSUBSET)
 
-lemma CARD_SING: "ALL x::'a::type. CARD (INSERT x EMPTY) = (1::nat)"
+lemma CARD_SING: "ALL x::'a::type. CARD (INSERT x EMPTY) = 1"
   by (import pred_set CARD_SING)
 
-lemma SING_IFF_CARD1: "ALL x::'a::type => bool. SING x = (CARD x = (1::nat) & FINITE x)"
+lemma SING_IFF_CARD1: "ALL x::'a::type => bool. SING x = (CARD x = 1 & FINITE x)"
   by (import pred_set SING_IFF_CARD1)
 
 lemma CARD_DIFF: "ALL t::'a::type => bool.
@@ -4031,7 +4212,7 @@
 lemma LESS_CARD_DIFF: "ALL t::'a::type => bool.
    FINITE t -->
    (ALL s::'a::type => bool.
-       FINITE s --> CARD t < CARD s --> (0::nat) < CARD (DIFF s t))"
+       FINITE s --> CARD t < CARD s --> 0 < CARD (DIFF s t))"
   by (import pred_set LESS_CARD_DIFF)
 
 lemma FINITE_COMPLETE_INDUCTION: "ALL P::('a::type => bool) => bool.
@@ -4042,7 +4223,7 @@
   by (import pred_set FINITE_COMPLETE_INDUCTION)
 
 constdefs
-  INFINITE :: "('a::type => bool) => bool" 
+  INFINITE :: "('a => bool) => bool" 
   "INFINITE == %s::'a::type => bool. ~ FINITE s"
 
 lemma INFINITE_DEF: "ALL s::'a::type => bool. INFINITE s = (~ FINITE s)"
@@ -4143,7 +4324,7 @@
   by (import pred_set FINITE_WEAK_ENUMERATE)
 
 constdefs
-  BIGUNION :: "(('a::type => bool) => bool) => 'a::type => bool" 
+  BIGUNION :: "(('a => bool) => bool) => 'a => bool" 
   "BIGUNION ==
 %P::('a::type => bool) => bool.
    GSPEC (%x::'a::type. (x, EX p::'a::type => bool. IN p P & IN x p))"
@@ -4190,7 +4371,7 @@
   by (import pred_set FINITE_BIGUNION)
 
 constdefs
-  BIGINTER :: "(('a::type => bool) => bool) => 'a::type => bool" 
+  BIGINTER :: "(('a => bool) => bool) => 'a => bool" 
   "BIGINTER ==
 %B::('a::type => bool) => bool.
    GSPEC (%x::'a::type. (x, ALL P::'a::type => bool. IN P B --> IN x P))"
@@ -4229,7 +4410,7 @@
   by (import pred_set DISJOINT_BIGINTER)
 
 constdefs
-  CROSS :: "('a::type => bool) => ('b::type => bool) => 'a::type * 'b::type => bool" 
+  CROSS :: "('a => bool) => ('b => bool) => 'a * 'b => bool" 
   "CROSS ==
 %(P::'a::type => bool) Q::'b::type => bool.
    GSPEC (%p::'a::type * 'b::type. (p, IN (fst p) P & IN (snd p) Q))"
@@ -4283,7 +4464,7 @@
   by (import pred_set FINITE_CROSS_EQ)
 
 constdefs
-  COMPL :: "('a::type => bool) => 'a::type => bool" 
+  COMPL :: "('a => bool) => 'a => bool" 
   "COMPL == DIFF pred_set.UNIV"
 
 lemma COMPL_DEF: "ALL P::'a::type => bool. COMPL P = DIFF pred_set.UNIV P"
@@ -4323,7 +4504,7 @@
 lemma IN_COUNT: "ALL (m::nat) n::nat. IN m (count n) = (m < n)"
   by (import pred_set IN_COUNT)
 
-lemma COUNT_ZERO: "count (0::nat) = EMPTY"
+lemma COUNT_ZERO: "count 0 = EMPTY"
   by (import pred_set COUNT_ZERO)
 
 lemma COUNT_SUC: "ALL n::nat. count (Suc n) = INSERT n (count n)"
@@ -4336,8 +4517,7 @@
   by (import pred_set CARD_COUNT)
 
 constdefs
-  ITSET_tupled :: "('a::type => 'b::type => 'b::type)
-=> ('a::type => bool) * 'b::type => 'b::type" 
+  ITSET_tupled :: "('a => 'b => 'b) => ('a => bool) * 'b => 'b" 
   "ITSET_tupled ==
 %f::'a::type => 'b::type => 'b::type.
    WFREC
@@ -4370,8 +4550,7 @@
   by (import pred_set ITSET_tupled_primitive_def)
 
 constdefs
-  ITSET :: "('a::type => 'b::type => 'b::type)
-=> ('a::type => bool) => 'b::type => 'b::type" 
+  ITSET :: "('a => 'b => 'b) => ('a => bool) => 'b => 'b" 
   "ITSET ==
 %(f::'a::type => 'b::type => 'b::type) (x::'a::type => bool) x1::'b::type.
    ITSET_tupled f (x, x1)"
@@ -4403,7 +4582,7 @@
 ;setup_theory operator
 
 constdefs
-  ASSOC :: "('a::type => 'a::type => 'a::type) => bool" 
+  ASSOC :: "('a => 'a => 'a) => bool" 
   "ASSOC ==
 %f::'a::type => 'a::type => 'a::type.
    ALL (x::'a::type) (y::'a::type) z::'a::type. f x (f y z) = f (f x y) z"
@@ -4414,7 +4593,7 @@
   by (import operator ASSOC_DEF)
 
 constdefs
-  COMM :: "('a::type => 'a::type => 'b::type) => bool" 
+  COMM :: "('a => 'a => 'b) => bool" 
   "COMM ==
 %f::'a::type => 'a::type => 'b::type.
    ALL (x::'a::type) y::'a::type. f x y = f y x"
@@ -4424,8 +4603,7 @@
   by (import operator COMM_DEF)
 
 constdefs
-  FCOMM :: "('a::type => 'b::type => 'a::type)
-=> ('c::type => 'a::type => 'a::type) => bool" 
+  FCOMM :: "('a => 'b => 'a) => ('c => 'a => 'a) => bool" 
   "FCOMM ==
 %(f::'a::type => 'b::type => 'a::type) g::'c::type => 'a::type => 'a::type.
    ALL (x::'c::type) (y::'a::type) z::'b::type. g x (f y z) = f (g x y) z"
@@ -4437,7 +4615,7 @@
   by (import operator FCOMM_DEF)
 
 constdefs
-  RIGHT_ID :: "('a::type => 'b::type => 'a::type) => 'b::type => bool" 
+  RIGHT_ID :: "('a => 'b => 'a) => 'b => bool" 
   "RIGHT_ID ==
 %(f::'a::type => 'b::type => 'a::type) e::'b::type.
    ALL x::'a::type. f x e = x"
@@ -4447,7 +4625,7 @@
   by (import operator RIGHT_ID_DEF)
 
 constdefs
-  LEFT_ID :: "('a::type => 'b::type => 'b::type) => 'a::type => bool" 
+  LEFT_ID :: "('a => 'b => 'b) => 'a => bool" 
   "LEFT_ID ==
 %(f::'a::type => 'b::type => 'b::type) e::'a::type.
    ALL x::'b::type. f e x = x"
@@ -4457,7 +4635,7 @@
   by (import operator LEFT_ID_DEF)
 
 constdefs
-  MONOID :: "('a::type => 'a::type => 'a::type) => 'a::type => bool" 
+  MONOID :: "('a => 'a => 'a) => 'a => bool" 
   "MONOID ==
 %(f::'a::type => 'a::type => 'a::type) e::'a::type.
    ASSOC f & RIGHT_ID f e & LEFT_ID f e"
@@ -4486,7 +4664,7 @@
 ;setup_theory rich_list
 
 consts
-  SNOC :: "'a::type => 'a::type list => 'a::type list" 
+  SNOC :: "'a => 'a list => 'a list" 
 
 specification (SNOC) SNOC: "(ALL x::'a::type. SNOC x [] = [x]) &
 (ALL (x::'a::type) (x'::'a::type) l::'a::type list.
@@ -4494,8 +4672,7 @@
   by (import rich_list SNOC)
 
 consts
-  SCANL :: "('b::type => 'a::type => 'b::type)
-=> 'b::type => 'a::type list => 'b::type list" 
+  SCANL :: "('b => 'a => 'b) => 'b => 'a list => 'b list" 
 
 specification (SCANL) SCANL: "(ALL (f::'b::type => 'a::type => 'b::type) e::'b::type.
     SCANL f e [] = [e]) &
@@ -4504,8 +4681,7 @@
   by (import rich_list SCANL)
 
 consts
-  SCANR :: "('a::type => 'b::type => 'b::type)
-=> 'b::type => 'a::type list => 'b::type list" 
+  SCANR :: "('a => 'b => 'b) => 'b => 'a list => 'b list" 
 
 specification (SCANR) SCANR: "(ALL (f::'a::type => 'b::type => 'b::type) e::'b::type.
     SCANR f e [] = [e]) &
@@ -4532,27 +4708,27 @@
   by (import rich_list OR_EL_DEF)
 
 consts
-  FIRSTN :: "nat => 'a::type list => 'a::type list" 
-
-specification (FIRSTN) FIRSTN: "(ALL l::'a::type list. FIRSTN (0::nat) l = []) &
+  FIRSTN :: "nat => 'a list => 'a list" 
+
+specification (FIRSTN) FIRSTN: "(ALL l::'a::type list. FIRSTN 0 l = []) &
 (ALL (n::nat) (x::'a::type) l::'a::type list.
     FIRSTN (Suc n) (x # l) = x # FIRSTN n l)"
   by (import rich_list FIRSTN)
 
 consts
-  BUTFIRSTN :: "nat => 'a::type list => 'a::type list" 
-
-specification (BUTFIRSTN) BUTFIRSTN: "(ALL l::'a::type list. BUTFIRSTN (0::nat) l = l) &
+  BUTFIRSTN :: "nat => 'a list => 'a list" 
+
+specification (BUTFIRSTN) BUTFIRSTN: "(ALL l::'a::type list. BUTFIRSTN 0 l = l) &
 (ALL (n::nat) (x::'a::type) l::'a::type list.
     BUTFIRSTN (Suc n) (x # l) = BUTFIRSTN n l)"
   by (import rich_list BUTFIRSTN)
 
 consts
-  SEG :: "nat => nat => 'a::type list => 'a::type list" 
-
-specification (SEG) SEG: "(ALL (k::nat) l::'a::type list. SEG (0::nat) k l = []) &
+  SEG :: "nat => nat => 'a list => 'a list" 
+
+specification (SEG) SEG: "(ALL (k::nat) l::'a::type list. SEG 0 k l = []) &
 (ALL (m::nat) (x::'a::type) l::'a::type list.
-    SEG (Suc m) (0::nat) (x # l) = x # SEG m (0::nat) l) &
+    SEG (Suc m) 0 (x # l) = x # SEG m 0 l) &
 (ALL (m::nat) (k::nat) (x::'a::type) l::'a::type list.
     SEG (Suc m) (Suc k) (x # l) = SEG (Suc m) k l)"
   by (import rich_list SEG)
@@ -4564,34 +4740,34 @@
   by (import rich_list BUTLAST)
 
 consts
-  LASTN :: "nat => 'a::type list => 'a::type list" 
-
-specification (LASTN) LASTN: "(ALL l::'a::type list. LASTN (0::nat) l = []) &
+  LASTN :: "nat => 'a list => 'a list" 
+
+specification (LASTN) LASTN: "(ALL l::'a::type list. LASTN 0 l = []) &
 (ALL (n::nat) (x::'a::type) l::'a::type list.
     LASTN (Suc n) (SNOC x l) = SNOC x (LASTN n l))"
   by (import rich_list LASTN)
 
 consts
-  BUTLASTN :: "nat => 'a::type list => 'a::type list" 
-
-specification (BUTLASTN) BUTLASTN: "(ALL l::'a::type list. BUTLASTN (0::nat) l = l) &
+  BUTLASTN :: "nat => 'a list => 'a list" 
+
+specification (BUTLASTN) BUTLASTN: "(ALL l::'a::type list. BUTLASTN 0 l = l) &
 (ALL (n::nat) (x::'a::type) l::'a::type list.
     BUTLASTN (Suc n) (SNOC x l) = BUTLASTN n l)"
   by (import rich_list BUTLASTN)
 
-lemma EL: "(ALL x::'a::type list. EL (0::nat) x = hd x) &
+lemma EL: "(ALL x::'a::type list. EL 0 x = hd x) &
 (ALL (x::nat) xa::'a::type list. EL (Suc x) xa = EL x (tl xa))"
   by (import rich_list EL)
 
 consts
-  ELL :: "nat => 'a::type list => 'a::type" 
-
-specification (ELL) ELL: "(ALL l::'a::type list. ELL (0::nat) l = last l) &
+  ELL :: "nat => 'a list => 'a" 
+
+specification (ELL) ELL: "(ALL l::'a::type list. ELL 0 l = last l) &
 (ALL (n::nat) l::'a::type list. ELL (Suc n) l = ELL n (butlast l))"
   by (import rich_list ELL)
 
 consts
-  IS_PREFIX :: "'a::type list => 'a::type list => bool" 
+  IS_PREFIX :: "'a list => 'a list => bool" 
 
 specification (IS_PREFIX) IS_PREFIX: "(ALL l::'a::type list. IS_PREFIX l [] = True) &
 (ALL (x::'a::type) l::'a::type list. IS_PREFIX [] (x # l) = False) &
@@ -4616,7 +4792,7 @@
   by (import rich_list SNOC_Axiom)
 
 consts
-  IS_SUFFIX :: "'a::type list => 'a::type list => bool" 
+  IS_SUFFIX :: "'a list => 'a list => bool" 
 
 specification (IS_SUFFIX) IS_SUFFIX: "(ALL l::'a::type list. IS_SUFFIX l [] = True) &
 (ALL (x::'a::type) l::'a::type list. IS_SUFFIX [] (SNOC x l) = False) &
@@ -4625,7 +4801,7 @@
   by (import rich_list IS_SUFFIX)
 
 consts
-  IS_SUBLIST :: "'a::type list => 'a::type list => bool" 
+  IS_SUBLIST :: "'a list => 'a list => bool" 
 
 specification (IS_SUBLIST) IS_SUBLIST: "(ALL l::'a::type list. IS_SUBLIST l [] = True) &
 (ALL (x::'a::type) l::'a::type list. IS_SUBLIST [] (x # l) = False) &
@@ -4635,7 +4811,7 @@
   by (import rich_list IS_SUBLIST)
 
 consts
-  SPLITP :: "('a::type => bool) => 'a::type list => 'a::type list * 'a::type list" 
+  SPLITP :: "('a => bool) => 'a list => 'a list * 'a list" 
 
 specification (SPLITP) SPLITP: "(ALL P::'a::type => bool. SPLITP P [] = ([], [])) &
 (ALL (P::'a::type => bool) (x::'a::type) l::'a::type list.
@@ -4644,7 +4820,7 @@
   by (import rich_list SPLITP)
 
 constdefs
-  PREFIX :: "('a::type => bool) => 'a::type list => 'a::type list" 
+  PREFIX :: "('a => bool) => 'a list => 'a list" 
   "PREFIX == %(P::'a::type => bool) l::'a::type list. fst (SPLITP (Not o P) l)"
 
 lemma PREFIX_DEF: "ALL (P::'a::type => bool) l::'a::type list.
@@ -4652,7 +4828,7 @@
   by (import rich_list PREFIX_DEF)
 
 constdefs
-  SUFFIX :: "('a::type => bool) => 'a::type list => 'a::type list" 
+  SUFFIX :: "('a => bool) => 'a list => 'a list" 
   "SUFFIX ==
 %P::'a::type => bool.
    foldl (%(l'::'a::type list) x::'a::type. if P x then SNOC x l' else [])
@@ -4665,31 +4841,31 @@
   by (import rich_list SUFFIX_DEF)
 
 constdefs
-  UNZIP_FST :: "('a::type * 'b::type) list => 'a::type list" 
+  UNZIP_FST :: "('a * 'b) list => 'a list" 
   "UNZIP_FST == %l::('a::type * 'b::type) list. fst (unzip l)"
 
 lemma UNZIP_FST_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_FST l = fst (unzip l)"
   by (import rich_list UNZIP_FST_DEF)
 
 constdefs
-  UNZIP_SND :: "('a::type * 'b::type) list => 'b::type list" 
+  UNZIP_SND :: "('a * 'b) list => 'b list" 
   "UNZIP_SND == %l::('a::type * 'b::type) list. snd (unzip l)"
 
 lemma UNZIP_SND_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_SND l = snd (unzip l)"
   by (import rich_list UNZIP_SND_DEF)
 
 consts
-  GENLIST :: "(nat => 'a::type) => nat => 'a::type list" 
-
-specification (GENLIST) GENLIST: "(ALL f::nat => 'a::type. GENLIST f (0::nat) = []) &
+  GENLIST :: "(nat => 'a) => nat => 'a list" 
+
+specification (GENLIST) GENLIST: "(ALL f::nat => 'a::type. GENLIST f 0 = []) &
 (ALL (f::nat => 'a::type) n::nat.
     GENLIST f (Suc n) = SNOC (f n) (GENLIST f n))"
   by (import rich_list GENLIST)
 
 consts
-  REPLICATE :: "nat => 'a::type => 'a::type list" 
-
-specification (REPLICATE) REPLICATE: "(ALL x::'a::type. REPLICATE (0::nat) x = []) &
+  REPLICATE :: "nat => 'a => 'a list" 
+
+specification (REPLICATE) REPLICATE: "(ALL x::'a::type. REPLICATE 0 x = []) &
 (ALL (n::nat) x::'a::type. REPLICATE (Suc n) x = x # REPLICATE n x)"
   by (import rich_list REPLICATE)
 
@@ -4706,7 +4882,7 @@
 lemma LENGTH_EQ: "ALL (x::'a::type list) y::'a::type list. x = y --> length x = length y"
   by (import rich_list LENGTH_EQ)
 
-lemma LENGTH_NOT_NULL: "ALL l::'a::type list. ((0::nat) < length l) = (~ null l)"
+lemma LENGTH_NOT_NULL: "ALL l::'a::type list. (0 < length l) = (~ null l)"
   by (import rich_list LENGTH_NOT_NULL)
 
 lemma SNOC_INDUCT: "ALL P::'a::type list => bool.
@@ -4755,11 +4931,10 @@
    MONOID f e --> (ALL l::'a::type list. foldr f l e = foldl f e l)"
   by (import rich_list FOLDR_FOLDL)
 
-lemma LENGTH_FOLDR: "ALL l::'a::type list. length l = foldr (%x::'a::type. Suc) l (0::nat)"
+lemma LENGTH_FOLDR: "ALL l::'a::type list. length l = foldr (%x::'a::type. Suc) l 0"
   by (import rich_list LENGTH_FOLDR)
 
-lemma LENGTH_FOLDL: "ALL l::'a::type list.
-   length l = foldl (%(l'::nat) x::'a::type. Suc l') (0::nat) l"
+lemma LENGTH_FOLDL: "ALL l::'a::type list. length l = foldl (%(l'::nat) x::'a::type. Suc l') 0 l"
   by (import rich_list LENGTH_FOLDL)
 
 lemma MAP_FOLDR: "ALL (f::'a::type => 'b::type) l::'a::type list.
@@ -4870,7 +5045,7 @@
 lemma SUM_SNOC: "ALL (x::nat) l::nat list. sum (SNOC x l) = sum l + x"
   by (import rich_list SUM_SNOC)
 
-lemma SUM_FOLDL: "ALL l::nat list. sum l = foldl op + (0::nat) l"
+lemma SUM_FOLDL: "ALL l::nat list. sum l = foldl op + 0 l"
   by (import rich_list SUM_FOLDL)
 
 lemma IS_PREFIX_APPEND: "ALL (l1::'a::type list) l2::'a::type list.
@@ -5077,7 +5252,7 @@
 lemma NULL_FOLDL: "ALL l::'a::type list. null l = foldl (%(x::bool) l'::'a::type. False) True l"
   by (import rich_list NULL_FOLDL)
 
-lemma SEG_LENGTH_ID: "ALL l::'a::type list. SEG (length l) (0::nat) l = l"
+lemma SEG_LENGTH_ID: "ALL l::'a::type list. SEG (length l) 0 l = l"
   by (import rich_list SEG_LENGTH_ID)
 
 lemma SEG_SUC_CONS: "ALL (m::nat) (n::nat) (l::'a::type list) x::'a::type.
@@ -5085,11 +5260,11 @@
   by (import rich_list SEG_SUC_CONS)
 
 lemma SEG_0_SNOC: "ALL (m::nat) (l::'a::type list) x::'a::type.
-   m <= length l --> SEG m (0::nat) (SNOC x l) = SEG m (0::nat) l"
+   m <= length l --> SEG m 0 (SNOC x l) = SEG m 0 l"
   by (import rich_list SEG_0_SNOC)
 
 lemma BUTLASTN_SEG: "ALL (n::nat) l::'a::type list.
-   n <= length l --> BUTLASTN n l = SEG (length l - n) (0::nat) l"
+   n <= length l --> BUTLASTN n l = SEG (length l - n) 0 l"
   by (import rich_list BUTLASTN_SEG)
 
 lemma LASTN_CONS: "ALL (n::nat) l::'a::type list.
@@ -5160,7 +5335,7 @@
   by (import rich_list BUTLASTN_LENGTH_CONS)
 
 lemma LAST_LASTN_LAST: "ALL (n::nat) l::'a::type list.
-   n <= length l --> (0::nat) < n --> last (LASTN n l) = last l"
+   n <= length l --> 0 < n --> last (LASTN n l) = last l"
   by (import rich_list LAST_LASTN_LAST)
 
 lemma BUTLASTN_LASTN_NIL: "ALL (n::nat) l::'a::type list. n <= length l --> BUTLASTN n (LASTN n l) = []"
@@ -5176,10 +5351,10 @@
    BUTLASTN m (LASTN n l) = LASTN (n - m) (BUTLASTN m l)"
   by (import rich_list BUTLASTN_LASTN)
 
-lemma LASTN_1: "ALL l::'a::type list. l ~= [] --> LASTN (1::nat) l = [last l]"
+lemma LASTN_1: "ALL l::'a::type list. l ~= [] --> LASTN 1 l = [last l]"
   by (import rich_list LASTN_1)
 
-lemma BUTLASTN_1: "ALL l::'a::type list. l ~= [] --> BUTLASTN (1::nat) l = butlast l"
+lemma BUTLASTN_1: "ALL l::'a::type list. l ~= [] --> BUTLASTN 1 l = butlast l"
   by (import rich_list BUTLASTN_1)
 
 lemma BUTLASTN_APPEND1: "ALL (l2::'a::type list) n::nat.
@@ -5292,8 +5467,7 @@
    n <= length l --> LASTN n l = SEG n (length l - n) l"
   by (import rich_list LASTN_SEG)
 
-lemma FIRSTN_SEG: "ALL (n::nat) l::'a::type list.
-   n <= length l --> FIRSTN n l = SEG n (0::nat) l"
+lemma FIRSTN_SEG: "ALL (n::nat) l::'a::type list. n <= length l --> FIRSTN n l = SEG n 0 l"
   by (import rich_list FIRSTN_SEG)
 
 lemma BUTFIRSTN_SEG: "ALL (n::nat) l::'a::type list.
@@ -5331,11 +5505,10 @@
 lemma SEG_APPEND: "ALL (m::nat) (l1::'a::type list) (n::nat) l2::'a::type list.
    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::nat) l2"
+   SEG (length l1 - m) m l1 @ SEG (n + m - length l1) 0 l2"
   by (import rich_list SEG_APPEND)
 
-lemma SEG_LENGTH_SNOC: "ALL (x::'a::type list) xa::'a::type.
-   SEG (1::nat) (length x) (SNOC xa x) = [xa]"
+lemma SEG_LENGTH_SNOC: "ALL (x::'a::type list) xa::'a::type. SEG 1 (length x) (SNOC xa x) = [xa]"
   by (import rich_list SEG_LENGTH_SNOC)
 
 lemma SEG_SNOC: "ALL (n::nat) (m::nat) l::'a::type list.
@@ -5343,7 +5516,7 @@
   by (import rich_list SEG_SNOC)
 
 lemma ELL_SEG: "ALL (n::nat) l::'a::type list.
-   n < length l --> ELL n l = hd (SEG (1::nat) (PRE (length l - n)) l)"
+   n < length l --> ELL n l = hd (SEG 1 (PRE (length l - n)) l)"
   by (import rich_list ELL_SEG)
 
 lemma SNOC_FOLDR: "ALL (x::'a::type) l::'a::type list. SNOC x l = foldr op # l [x]"
@@ -5405,13 +5578,13 @@
    (ALL (e::'a::type) l::'a::type list. foldl f e (rev l) = foldl f e l)"
   by (import rich_list COMM_ASSOC_FOLDL_REVERSE)
 
-lemma ELL_LAST: "ALL l::'a::type list. ~ null l --> ELL (0::nat) l = last l"
+lemma ELL_LAST: "ALL l::'a::type list. ~ null l --> ELL 0 l = last l"
   by (import rich_list ELL_LAST)
 
-lemma ELL_0_SNOC: "ALL (l::'a::type list) x::'a::type. ELL (0::nat) (SNOC x l) = x"
+lemma ELL_0_SNOC: "ALL (l::'a::type list) x::'a::type. ELL 0 (SNOC x l) = x"
   by (import rich_list ELL_0_SNOC)
 
-lemma ELL_SNOC: "ALL n>0::nat.
+lemma ELL_SNOC: "ALL n>0.
    ALL (x::'a::type) l::'a::type list. ELL n (SNOC x l) = ELL (PRE n) l"
   by (import rich_list ELL_SNOC)
 
@@ -5642,12 +5815,10 @@
    (ALL f::'a::type => 'b::type. EL n (map f l) = f (EL n l))"
   by (import rich_list EL_MAP)
 
-lemma EL_CONS: "ALL n>0::nat.
-   ALL (x::'a::type) l::'a::type list. EL n (x # l) = EL (PRE n) l"
+lemma EL_CONS: "ALL n>0. ALL (x::'a::type) l::'a::type list. EL n (x # l) = EL (PRE n) l"
   by (import rich_list EL_CONS)
 
-lemma EL_SEG: "ALL (n::nat) l::'a::type list.
-   n < length l --> EL n l = hd (SEG (1::nat) n l)"
+lemma EL_SEG: "ALL (n::nat) l::'a::type list. n < length l --> EL n l = hd (SEG 1 n l)"
   by (import rich_list EL_SEG)
 
 lemma EL_IS_EL: "ALL (n::nat) l::'a::type list. n < length l --> EL n l mem l"
@@ -5726,7 +5897,7 @@
 lemma LENGTH_REPLICATE: "ALL (n::nat) x::'a::type. length (REPLICATE n x) = n"
   by (import rich_list LENGTH_REPLICATE)
 
-lemma IS_EL_REPLICATE: "ALL n>0::nat. ALL x::'a::type. x mem REPLICATE n x"
+lemma IS_EL_REPLICATE: "ALL n>0. ALL x::'a::type. x mem REPLICATE n x"
   by (import rich_list IS_EL_REPLICATE)
 
 lemma ALL_EL_REPLICATE: "ALL (x::'a::type) n::nat. list_all (op = x) (REPLICATE n x)"
@@ -5749,7 +5920,7 @@
 ;setup_theory state_transformer
 
 constdefs
-  UNIT :: "'b::type => 'a::type => 'b::type * 'a::type" 
+  UNIT :: "'b => 'a => 'b * 'a" 
   "(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)
@@ -5759,9 +5930,7 @@
   by (import state_transformer UNIT_DEF)
 
 constdefs
-  BIND :: "('a::type => 'b::type * 'a::type)
-=> ('b::type => 'a::type => 'c::type * 'a::type)
-   => 'a::type => 'c::type * 'a::type" 
+  BIND :: "('a => 'b * 'a) => ('b => 'a => 'c * 'a) => 'a => 'c * 'a" 
   "(op ==::(('a::type => 'b::type * 'a::type)
          => ('b::type => 'a::type => 'c::type * 'a::type)
             => 'a::type => 'c::type * 'a::type)
@@ -5802,8 +5971,7 @@
   by (import state_transformer BIND_DEF)
 
 constdefs
-  MMAP :: "('c::type => 'b::type)
-=> ('a::type => 'c::type * 'a::type) => 'a::type => 'b::type * 'a::type" 
+  MMAP :: "('c => 'b) => ('a => 'c * 'a) => 'a => 'b * 'a" 
   "MMAP ==
 %(f::'c::type => 'b::type) m::'a::type => 'c::type * 'a::type.
    BIND m (UNIT o f)"
@@ -5813,8 +5981,7 @@
   by (import state_transformer MMAP_DEF)
 
 constdefs
-  JOIN :: "('a::type => ('a::type => 'b::type * 'a::type) * 'a::type)
-=> 'a::type => 'b::type * 'a::type" 
+  JOIN :: "('a => ('a => 'b * 'a) * 'a) => 'a => 'b * 'a" 
   "JOIN ==
 %z::'a::type => ('a::type => 'b::type * 'a::type) * 'a::type. BIND z I"
 
--- a/src/HOL/Import/HOL/HOL4Prob.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/HOL4Prob.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -9,14 +9,11 @@
    f = (%b::bool. True) | f = (%b::bool. b) | f = Not"
   by (import prob_extra BOOL_BOOL_CASES_THM)
 
-lemma EVEN_ODD_BASIC: "EVEN (0::nat) &
-~ EVEN (1::nat) &
-EVEN (2::nat) & ~ ODD (0::nat) & ODD (1::nat) & ~ ODD (2::nat)"
+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: "ALL n::nat.
-   EVEN n = (EX m::nat. n = (2::nat) * m) &
-   ODD n = (EX m::nat. n = Suc ((2::nat) * m))"
+   EVEN n = (EX m::nat. n = 2 * m) & ODD n = (EX m::nat. n = Suc (2 * m))"
   by (import prob_extra EVEN_ODD_EXISTS_EQ)
 
 lemma DIV_THEN_MULT: "ALL (p::nat) q::nat. Suc q * (p div Suc q) <= p"
@@ -60,20 +57,42 @@
                           (bit.B0::bit)))))))))"
   by (import prob_extra DIV_TWO_UNIQUE)
 
-lemma DIVISION_TWO: "ALL n::nat.
-   n = (2::nat) * (n div (2::nat)) + n mod (2::nat) &
-   (n mod (2::nat) = (0::nat) | n mod (2::nat) = (1::nat))"
+lemma DIVISION_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2 & (n mod 2 = 0 | n mod 2 = 1)"
   by (import prob_extra DIVISION_TWO)
 
-lemma DIV_TWO: "ALL n::nat. n = (2::nat) * (n div (2::nat)) + n mod (2::nat)"
+lemma DIV_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2"
   by (import prob_extra DIV_TWO)
 
-lemma MOD_TWO: "(ALL (n::nat).
-    ((n mod (2::nat)) = (if (EVEN n) then (0::nat) else (1::nat))))"
+lemma MOD_TWO: "ALL n::nat. 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)"
+lemma DIV_TWO_BASIC: "(op &::bool => bool => bool)
+ ((op =::nat => nat => bool)
+   ((op div::nat => nat => nat) (0::nat)
+     ((number_of::bin => nat)
+       ((op BIT::bin => bit => bin)
+         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+         (bit.B0::bit))))
+   (0::nat))
+ ((op &::bool => bool => bool)
+   ((op =::nat => nat => bool)
+     ((op div::nat => nat => nat) (1::nat)
+       ((number_of::bin => nat)
+         ((op BIT::bin => bit => bin)
+           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+           (bit.B0::bit))))
+     (0::nat))
+   ((op =::nat => nat => bool)
+     ((op div::nat => nat => nat)
+       ((number_of::bin => nat)
+         ((op BIT::bin => bit => bin)
+           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+           (bit.B0::bit)))
+       ((number_of::bin => nat)
+         ((op BIT::bin => bit => bin)
+           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+           (bit.B0::bit))))
+     (1::nat)))"
   by (import prob_extra DIV_TWO_BASIC)
 
 lemma DIV_TWO_MONO: "(All::(nat => bool) => bool)
@@ -119,18 +138,35 @@
              ((op <::nat => nat => bool) m n))))"
   by (import prob_extra DIV_TWO_MONO_EVEN)
 
-lemma DIV_TWO_CANCEL: "ALL n::nat.
-   (2::nat) * n div (2::nat) = n & Suc ((2::nat) * n) div (2::nat) = n"
+lemma DIV_TWO_CANCEL: "ALL n::nat. 2 * n div 2 = n & Suc (2 * n) div 2 = n"
   by (import prob_extra DIV_TWO_CANCEL)
 
-lemma EXP_DIV_TWO: "ALL n::nat. (2::nat) ^ Suc n div (2::nat) = (2::nat) ^ n"
+lemma EXP_DIV_TWO: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op =::nat => nat => bool)
+      ((op div::nat => nat => nat)
+        ((op ^::nat => nat => nat)
+          ((number_of::bin => nat)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit)))
+          ((Suc::nat => nat) n))
+        ((number_of::bin => nat)
+          ((op BIT::bin => bit => bin)
+            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+            (bit.B0::bit))))
+      ((op ^::nat => nat => nat)
+        ((number_of::bin => nat)
+          ((op BIT::bin => bit => bin)
+            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+            (bit.B0::bit)))
+        n))"
   by (import prob_extra EXP_DIV_TWO)
 
-lemma EVEN_EXP_TWO: "ALL n::nat. EVEN ((2::nat) ^ n) = (n ~= (0::nat))"
+lemma EVEN_EXP_TWO: "ALL n::nat. EVEN (2 ^ n) = (n ~= 0)"
   by (import prob_extra EVEN_EXP_TWO)
 
-lemma DIV_TWO_EXP: "ALL (n::nat) k::nat.
-   (k div (2::nat) < (2::nat) ^ n) = (k < (2::nat) ^ Suc n)"
+lemma DIV_TWO_EXP: "ALL (n::nat) k::nat. (k div 2 < 2 ^ n) = (k < 2 ^ Suc n)"
   by (import prob_extra DIV_TWO_EXP)
 
 consts
@@ -195,13 +231,38 @@
              z)))"
   by (import prob_extra REAL_INF_MIN)
 
-lemma HALF_POS: "(0::real) < (1::real) / (2::real)"
+lemma HALF_POS: "(op <::real => real => bool) (0::real)
+ ((op /::real => real => real) (1::real)
+   ((number_of::bin => real)
+     ((op BIT::bin => bit => bin)
+       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+       (bit.B0::bit))))"
   by (import prob_extra HALF_POS)
 
-lemma HALF_CANCEL: "(2::real) * ((1::real) / (2::real)) = (1::real)"
+lemma HALF_CANCEL: "(op =::real => real => bool)
+ ((op *::real => real => real)
+   ((number_of::bin => real)
+     ((op BIT::bin => bit => bin)
+       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+       (bit.B0::bit)))
+   ((op /::real => real => real) (1::real)
+     ((number_of::bin => real)
+       ((op BIT::bin => bit => bin)
+         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+         (bit.B0::bit)))))
+ (1::real)"
   by (import prob_extra HALF_CANCEL)
 
-lemma POW_HALF_POS: "ALL n::nat. (0::real) < ((1::real) / (2::real)) ^ n"
+lemma POW_HALF_POS: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op <::real => real => bool) (0::real)
+      ((op ^::real => nat => real)
+        ((op /::real => real => real) (1::real)
+          ((number_of::bin => real)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))
+        n))"
   by (import prob_extra POW_HALF_POS)
 
 lemma POW_HALF_MONO: "(All::(nat => bool) => bool)
@@ -228,11 +289,32 @@
                m))))"
   by (import prob_extra POW_HALF_MONO)
 
-lemma POW_HALF_TWICE: "ALL n::nat.
-   ((1::real) / (2::real)) ^ n = (2::real) * ((1::real) / (2::real)) ^ Suc n"
+lemma POW_HALF_TWICE: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op =::real => real => bool)
+      ((op ^::real => nat => real)
+        ((op /::real => real => real) (1::real)
+          ((number_of::bin => real)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))
+        n)
+      ((op *::real => real => real)
+        ((number_of::bin => real)
+          ((op BIT::bin => bit => bin)
+            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+            (bit.B0::bit)))
+        ((op ^::real => nat => real)
+          ((op /::real => real => real) (1::real)
+            ((number_of::bin => real)
+              ((op BIT::bin => bit => bin)
+                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                  (bit.B1::bit))
+                (bit.B0::bit))))
+          ((Suc::nat => nat) n))))"
   by (import prob_extra POW_HALF_TWICE)
 
-lemma X_HALF_HALF: "ALL x::real. (1::real) / (2::real) * x + (1::real) / (2::real) * x = x"
+lemma X_HALF_HALF: "ALL x::real. 1 / 2 * x + 1 / 2 * x = x"
   by (import prob_extra X_HALF_HALF)
 
 lemma REAL_SUP_LE_X: "(All::((real => bool) => bool) => bool)
@@ -271,27 +353,60 @@
   by (import prob_extra REAL_X_LE_SUP)
 
 lemma ABS_BETWEEN_LE: "ALL (x::real) (y::real) d::real.
-   ((0::real) <= d & x - d <= y & y <= x + d) = (abs (y - x) <= d)"
+   (0 <= d & x - d <= y & 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)"
+lemma ONE_MINUS_HALF: "(op =::real => real => bool)
+ ((op -::real => real => real) (1::real)
+   ((op /::real => real => real) (1::real)
+     ((number_of::bin => real)
+       ((op BIT::bin => bit => bin)
+         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+         (bit.B0::bit)))))
+ ((op /::real => real => real) (1::real)
+   ((number_of::bin => real)
+     ((op BIT::bin => bit => bin)
+       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+       (bit.B0::bit))))"
   by (import prob_extra ONE_MINUS_HALF)
 
-lemma HALF_LT_1: "(1::real) / (2::real) < (1::real)"
+lemma HALF_LT_1: "(op <::real => real => bool)
+ ((op /::real => real => real) (1::real)
+   ((number_of::bin => real)
+     ((op BIT::bin => bit => bin)
+       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+       (bit.B0::bit))))
+ (1::real)"
   by (import prob_extra HALF_LT_1)
 
-lemma POW_HALF_EXP: "ALL n::nat. ((1::real) / (2::real)) ^ n = inverse (real ((2::nat) ^ n))"
+lemma POW_HALF_EXP: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op =::real => real => bool)
+      ((op ^::real => nat => real)
+        ((op /::real => real => real) (1::real)
+          ((number_of::bin => real)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))
+        n)
+      ((inverse::real => real)
+        ((real::nat => real)
+          ((op ^::nat => nat => nat)
+            ((number_of::bin => nat)
+              ((op BIT::bin => bit => bin)
+                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                  (bit.B1::bit))
+                (bit.B0::bit)))
+            n))))"
   by (import prob_extra POW_HALF_EXP)
 
-lemma INV_SUC_POS: "ALL n::nat. (0::real) < (1::real) / real (Suc n)"
+lemma INV_SUC_POS: "ALL n::nat. 0 < 1 / real (Suc n)"
   by (import prob_extra INV_SUC_POS)
 
-lemma INV_SUC_MAX: "ALL x::nat. (1::real) / real (Suc x) <= (1::real)"
+lemma INV_SUC_MAX: "ALL x::nat. 1 / real (Suc x) <= 1"
   by (import prob_extra INV_SUC_MAX)
 
-lemma INV_SUC: "ALL n::nat.
-   (0::real) < (1::real) / real (Suc n) &
-   (1::real) / real (Suc n) <= (1::real)"
+lemma INV_SUC: "ALL n::nat. 0 < 1 / real (Suc n) & 1 / real (Suc n) <= 1"
   by (import prob_extra INV_SUC)
 
 lemma ABS_UNIT_INTERVAL: "(All::(real => bool) => bool)
@@ -894,12 +1009,10 @@
 
 defs
   alg_longest_primdef: "alg_longest ==
-FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t)
- (0::nat)"
+FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
 
 lemma alg_longest_def: "alg_longest =
-FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t)
- (0::nat)"
+FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
   by (import prob_canon alg_longest_def)
 
 consts
@@ -1948,9 +2061,9 @@
   SHD :: "(nat => bool) => bool" 
 
 defs
-  SHD_primdef: "SHD == %f::nat => bool. f (0::nat)"
-
-lemma SHD_def: "ALL f::nat => bool. SHD f = f (0::nat)"
+  SHD_primdef: "SHD == %f::nat => bool. f 0"
+
+lemma SHD_def: "ALL f::nat => bool. SHD f = f 0"
   by (import boolean_sequence SHD_def)
 
 consts
@@ -1965,7 +2078,7 @@
 consts
   SCONS :: "bool => (nat => bool) => nat => bool" 
 
-specification (SCONS_primdef: SCONS) SCONS_def: "(ALL (h::bool) t::nat => bool. SCONS h t (0::nat) = h) &
+specification (SCONS_primdef: SCONS) SCONS_def: "(ALL (h::bool) t::nat => bool. SCONS h t 0 = h) &
 (ALL (h::bool) (t::nat => bool) n::nat. SCONS h t (Suc n) = t n)"
   by (import boolean_sequence SCONS_def)
 
@@ -1990,14 +2103,14 @@
 consts
   STAKE :: "nat => (nat => bool) => bool list" 
 
-specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s::nat => bool. STAKE (0::nat) s = []) &
+specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s::nat => bool. STAKE 0 s = []) &
 (ALL (n::nat) s::nat => bool. 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::nat) = I & (ALL n::nat. SDROP (Suc n) = SDROP n o STL)"
+specification (SDROP_primdef: SDROP) SDROP_def: "SDROP 0 = I & (ALL n::nat. SDROP (Suc n) = SDROP n o STL)"
   by (import boolean_sequence SDROP_def)
 
 lemma SCONS_SURJ: "ALL x::nat => bool. EX (xa::bool) t::nat => bool. x = SCONS xa t"
@@ -2271,10 +2384,9 @@
 consts
   alg_measure :: "bool list list => real" 
 
-specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = (0::real) &
+specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = 0 &
 (ALL (l::bool list) rest::bool list list.
-    alg_measure (l # rest) =
-    ((1::real) / (2::real)) ^ length l + alg_measure rest)"
+    alg_measure (l # rest) = (1 / 2) ^ length l + alg_measure rest)"
   by (import prob alg_measure_def)
 
 consts
@@ -2311,18 +2423,42 @@
               algebra_measure b = r & SUBSET (algebra_embed b) s)"
   by (import prob prob_def)
 
-lemma ALG_TWINS_MEASURE: "ALL l::bool list.
-   ((1::real) / (2::real)) ^ length (SNOC True l) +
-   ((1::real) / (2::real)) ^ length (SNOC False l) =
-   ((1::real) / (2::real)) ^ length l"
+lemma ALG_TWINS_MEASURE: "(All::(bool list => bool) => bool)
+ (%l::bool list.
+     (op =::real => real => bool)
+      ((op +::real => real => real)
+        ((op ^::real => nat => real)
+          ((op /::real => real => real) (1::real)
+            ((number_of::bin => real)
+              ((op BIT::bin => bit => bin)
+                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                  (bit.B1::bit))
+                (bit.B0::bit))))
+          ((size::bool list => nat)
+            ((SNOC::bool => bool list => bool list) (True::bool) l)))
+        ((op ^::real => nat => real)
+          ((op /::real => real => real) (1::real)
+            ((number_of::bin => real)
+              ((op BIT::bin => bit => bin)
+                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                  (bit.B1::bit))
+                (bit.B0::bit))))
+          ((size::bool list => nat)
+            ((SNOC::bool => bool list => bool list) (False::bool) l))))
+      ((op ^::real => nat => real)
+        ((op /::real => real => real) (1::real)
+          ((number_of::bin => real)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))
+        ((size::bool list => nat) l)))"
   by (import prob ALG_TWINS_MEASURE)
 
-lemma ALG_MEASURE_BASIC: "alg_measure [] = (0::real) &
-alg_measure [[]] = (1::real) &
-(ALL b::bool. alg_measure [[b]] = (1::real) / (2::real))"
+lemma ALG_MEASURE_BASIC: "alg_measure [] = 0 &
+alg_measure [[]] = 1 & (ALL b::bool. alg_measure [[b]] = 1 / 2)"
   by (import prob ALG_MEASURE_BASIC)
 
-lemma ALG_MEASURE_POS: "ALL l::bool list list. (0::real) <= alg_measure l"
+lemma ALG_MEASURE_POS: "ALL l::bool list list. 0 <= alg_measure l"
   by (import prob ALG_MEASURE_POS)
 
 lemma ALG_MEASURE_APPEND: "ALL (l1::bool list list) l2::bool list list.
@@ -2330,7 +2466,7 @@
   by (import prob ALG_MEASURE_APPEND)
 
 lemma ALG_MEASURE_TLS: "ALL (l::bool list list) b::bool.
-   (2::real) * alg_measure (map (op # b) l) = alg_measure l"
+   2 * alg_measure (map (op # b) l) = alg_measure l"
   by (import prob ALG_MEASURE_TLS)
 
 lemma ALG_CANON_PREFS_MONO: "ALL (l::bool list) b::bool list list.
@@ -2357,9 +2493,8 @@
 lemma ALGEBRA_MEASURE_DEF_ALT: "ALL l::bool list list. algebra_measure l = alg_measure (alg_canon l)"
   by (import prob ALGEBRA_MEASURE_DEF_ALT)
 
-lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = (0::real) &
-algebra_measure [[]] = (1::real) &
-(ALL b::bool. algebra_measure [[b]] = (1::real) / (2::real))"
+lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = 0 &
+algebra_measure [[]] = 1 & (ALL b::bool. algebra_measure [[b]] = 1 / 2)"
   by (import prob ALGEBRA_MEASURE_BASIC)
 
 lemma ALGEBRA_CANON_MEASURE_MAX: "(All::(bool list list => bool) => bool)
@@ -2370,7 +2505,7 @@
         ((alg_measure::bool list list => real) l) (1::real)))"
   by (import prob ALGEBRA_CANON_MEASURE_MAX)
 
-lemma ALGEBRA_MEASURE_MAX: "ALL l::bool list list. algebra_measure l <= (1::real)"
+lemma ALGEBRA_MEASURE_MAX: "ALL l::bool list list. algebra_measure l <= 1"
   by (import prob ALGEBRA_MEASURE_MAX)
 
 lemma ALGEBRA_MEASURE_MONO_EMBED: "(All::(bool list list => bool) => bool)
@@ -2458,9 +2593,9 @@
 lemma PROB_ALGEBRA: "ALL l::bool list list. prob (algebra_embed l) = algebra_measure l"
   by (import prob PROB_ALGEBRA)
 
-lemma PROB_BASIC: "prob EMPTY = (0::real) &
-prob pred_set.UNIV = (1::real) &
-(ALL b::bool. prob (%s::nat => bool. SHD s = b) = (1::real) / (2::real))"
+lemma PROB_BASIC: "prob EMPTY = 0 &
+prob pred_set.UNIV = 1 &
+(ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2)"
   by (import prob PROB_BASIC)
 
 lemma PROB_ADDITIVE: "(All::(((nat => bool) => bool) => bool) => bool)
@@ -2578,7 +2713,7 @@
              ((prob::((nat => bool) => bool) => real) t))))"
   by (import prob PROB_SUBSET_MONO)
 
-lemma PROB_ALG: "ALL x::bool list. prob (alg_embed x) = ((1::real) / (2::real)) ^ length x"
+lemma PROB_ALG: "ALL x::bool list. prob (alg_embed x) = (1 / 2) ^ length x"
   by (import prob PROB_ALG)
 
 lemma PROB_STL: "(All::(((nat => bool) => bool) => bool) => bool)
@@ -2662,26 +2797,25 @@
                ((prob::((nat => bool) => bool) => real) p)))))"
   by (import prob PROB_INTER_SHD)
 
-lemma ALGEBRA_MEASURE_POS: "ALL l::bool list list. (0::real) <= algebra_measure l"
+lemma ALGEBRA_MEASURE_POS: "ALL l::bool list list. 0 <= algebra_measure l"
   by (import prob ALGEBRA_MEASURE_POS)
 
-lemma ALGEBRA_MEASURE_RANGE: "ALL l::bool list list.
-   (0::real) <= algebra_measure l & algebra_measure l <= (1::real)"
+lemma ALGEBRA_MEASURE_RANGE: "ALL l::bool list list. 0 <= algebra_measure l & algebra_measure l <= 1"
   by (import prob ALGEBRA_MEASURE_RANGE)
 
-lemma PROB_POS: "ALL p::(nat => bool) => bool. (0::real) <= prob p"
+lemma PROB_POS: "ALL p::(nat => bool) => bool. 0 <= prob p"
   by (import prob PROB_POS)
 
-lemma PROB_MAX: "ALL p::(nat => bool) => bool. prob p <= (1::real)"
+lemma PROB_MAX: "ALL p::(nat => bool) => bool. prob p <= 1"
   by (import prob PROB_MAX)
 
-lemma PROB_RANGE: "ALL p::(nat => bool) => bool. (0::real) <= prob p & prob p <= (1::real)"
+lemma PROB_RANGE: "ALL p::(nat => bool) => bool. 0 <= prob p & prob p <= 1"
   by (import prob PROB_RANGE)
 
 lemma ABS_PROB: "ALL p::(nat => bool) => bool. abs (prob p) = prob p"
   by (import prob ABS_PROB)
 
-lemma PROB_SHD: "ALL b::bool. prob (%s::nat => bool. SHD s = b) = (1::real) / (2::real)"
+lemma PROB_SHD: "ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2"
   by (import prob PROB_SHD)
 
 lemma PROB_COMPL_LE1: "(All::(((nat => bool) => bool) => bool) => bool)
@@ -2719,11 +2853,10 @@
 
 defs
   pseudo_linear_tl_primdef: "pseudo_linear_tl ==
-%(a::nat) (b::nat) (n::nat) x::nat.
-   (a * x + b) mod ((2::nat) * n + (1::nat))"
+%(a::nat) (b::nat) (n::nat) x::nat. (a * x + b) mod (2 * n + 1)"
 
 lemma pseudo_linear_tl_def: "ALL (a::nat) (b::nat) (n::nat) x::nat.
-   pseudo_linear_tl a b n x = (a * x + b) mod ((2::nat) * n + (1::nat))"
+   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::nat => nat => bool.
@@ -2828,7 +2961,7 @@
   by (import prob_indep alg_cover_def)
 
 consts
-  indep :: "((nat => bool) => 'a::type * (nat => bool)) => bool" 
+  indep :: "((nat => bool) => 'a * (nat => bool)) => bool" 
 
 defs
   indep_primdef: "indep ==
@@ -3520,21 +3653,19 @@
 defs
   unif_bound_primdef: "unif_bound ==
 WFREC
- (SOME R::nat => nat => bool.
-     WF R & (ALL v::nat. R (Suc v div (2::nat)) (Suc v)))
+ (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
  (%unif_bound::nat => nat.
-     nat_case (0::nat) (%v1::nat. Suc (unif_bound (Suc v1 div (2::nat)))))"
+     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
 
 lemma unif_bound_primitive_def: "unif_bound =
 WFREC
- (SOME R::nat => nat => bool.
-     WF R & (ALL v::nat. R (Suc v div (2::nat)) (Suc v)))
+ (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
  (%unif_bound::nat => nat.
-     nat_case (0::nat) (%v1::nat. Suc (unif_bound (Suc v1 div (2::nat)))))"
+     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
   by (import prob_uniform unif_bound_primitive_def)
 
-lemma unif_bound_def: "unif_bound (0::nat) = (0::nat) &
-unif_bound (Suc (v::nat)) = Suc (unif_bound (Suc v div (2::nat)))"
+lemma unif_bound_def: "unif_bound 0 = 0 &
+unif_bound (Suc (v::nat)) = Suc (unif_bound (Suc v div 2))"
   by (import prob_uniform unif_bound_def)
 
 lemma unif_bound_ind: "(All::((nat => bool) => bool) => bool)
@@ -3559,30 +3690,24 @@
   "unif_tupled ==
 WFREC
  (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
-     WF R &
-     (ALL (s::nat => bool) v2::nat. R (Suc v2 div (2::nat), s) (Suc v2, s)))
+     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
  (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
      v1::nat => bool).
-     case v of 0 => (0::nat, v1)
+     case v of 0 => (0, v1)
      | Suc (v3::nat) =>
-         let (m::nat, s'::nat => bool) =
-               unif_tupled (Suc v3 div (2::nat), v1)
-         in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m,
-             STL s'))"
+         let (m::nat, s'::nat => bool) = 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::nat * (nat => bool) => nat * (nat => bool) => bool.
-     WF R &
-     (ALL (s::nat => bool) v2::nat. R (Suc v2 div (2::nat), s) (Suc v2, s)))
+     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
  (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
      v1::nat => bool).
-     case v of 0 => (0::nat, v1)
+     case v of 0 => (0, v1)
      | Suc (v3::nat) =>
-         let (m::nat, s'::nat => bool) =
-               unif_tupled (Suc v3 div (2::nat), v1)
-         in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m,
-             STL s'))"
+         let (m::nat, s'::nat => bool) = 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
@@ -3594,10 +3719,10 @@
 lemma unif_curried_def: "ALL (x::nat) x1::nat => bool. unif x x1 = unif_tupled (x, x1)"
   by (import prob_uniform unif_curried_def)
 
-lemma unif_def: "unif (0::nat) (s::nat => bool) = (0::nat, s) &
+lemma unif_def: "unif 0 (s::nat => bool) = (0, s) &
 unif (Suc (v2::nat)) s =
-(let (m::nat, s'::nat => bool) = unif (Suc v2 div (2::nat)) s
- in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m, STL s'))"
+(let (m::nat, s'::nat => bool) = 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::((nat => (nat => bool) => bool) => bool) => bool)
@@ -3871,19 +3996,19 @@
              (%xa::nat. (All::((nat => bool) => bool) => bool) (P x xa)))))"
   by (import prob_uniform uniform_ind)
 
-lemma uniform_def: "uniform (0::nat) (Suc (n::nat)) (s::nat => bool) = (0::nat, s) &
+lemma uniform_def: "uniform 0 (Suc (n::nat)) (s::nat => bool) = (0, s) &
 uniform (Suc (t::nat)) (Suc n) s =
 (let (xa::nat, x::nat => bool) = 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: "ALL n::nat. (Suc n div (2::nat) = (0::nat)) = (n = (0::nat))"
+lemma SUC_DIV_TWO_ZERO: "ALL n::nat. (Suc n div 2 = 0) = (n = 0)"
   by (import prob_uniform SUC_DIV_TWO_ZERO)
 
-lemma UNIF_BOUND_LOWER: "ALL n::nat. n < (2::nat) ^ unif_bound n"
+lemma UNIF_BOUND_LOWER: "ALL n::nat. n < 2 ^ unif_bound n"
   by (import prob_uniform UNIF_BOUND_LOWER)
 
-lemma UNIF_BOUND_LOWER_SUC: "ALL n::nat. Suc n <= (2::nat) ^ unif_bound n"
+lemma UNIF_BOUND_LOWER_SUC: "ALL n::nat. Suc n <= 2 ^ unif_bound n"
   by (import prob_uniform UNIF_BOUND_LOWER_SUC)
 
 lemma UNIF_BOUND_UPPER: "(All::(nat => bool) => bool)
@@ -3905,20 +4030,18 @@
           n)))"
   by (import prob_uniform UNIF_BOUND_UPPER)
 
-lemma UNIF_BOUND_UPPER_SUC: "ALL n::nat. (2::nat) ^ unif_bound n <= Suc ((2::nat) * n)"
+lemma UNIF_BOUND_UPPER_SUC: "ALL n::nat. 2 ^ unif_bound n <= Suc (2 * n)"
   by (import prob_uniform UNIF_BOUND_UPPER_SUC)
 
-lemma UNIF_DEF_MONAD: "unif (0::nat) = UNIT (0::nat) &
+lemma UNIF_DEF_MONAD: "unif 0 = UNIT 0 &
 (ALL n::nat.
     unif (Suc n) =
-    BIND (unif (Suc n div (2::nat)))
+    BIND (unif (Suc n div 2))
      (%m::nat.
-         BIND SDEST
-          (%b::bool.
-              UNIT (if b then (2::nat) * m + (1::nat) else (2::nat) * m))))"
+         BIND SDEST (%b::bool. UNIT (if b then 2 * m + 1 else 2 * m))))"
   by (import prob_uniform UNIF_DEF_MONAD)
 
-lemma UNIFORM_DEF_MONAD: "(ALL x::nat. uniform (0::nat) (Suc x) = UNIT (0::nat)) &
+lemma UNIFORM_DEF_MONAD: "(ALL x::nat. uniform 0 (Suc x) = UNIT 0) &
 (ALL (x::nat) xa::nat.
     uniform (Suc x) (Suc xa) =
     BIND (unif xa)
@@ -3931,45 +4054,18 @@
 lemma INDEP_UNIFORM: "ALL (t::nat) n::nat. indep (uniform t (Suc n))"
   by (import prob_uniform INDEP_UNIFORM)
 
-lemma PROB_UNIF: "(All::(nat => bool) => bool)
- (%n::nat.
-     (All::(nat => bool) => bool)
-      (%k::nat.
-          (op =::real => real => bool)
-           ((prob::((nat => bool) => bool) => real)
-             (%s::nat => bool.
-                 (op =::nat => nat => bool)
-                  ((fst::nat * (nat => bool) => nat)
-                    ((unif::nat => (nat => bool) => nat * (nat => bool)) n
-                      s))
-                  k))
-           ((If::bool => real => real => real)
-             ((op <::nat => nat => bool) k
-               ((op ^::nat => nat => nat)
-                 ((number_of::bin => nat)
-                   ((op BIT::bin => bit => bin)
-                     ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
-                       (bit.B1::bit))
-                     (bit.B0::bit)))
-                 ((unif_bound::nat => nat) n)))
-             ((op ^::real => nat => real)
-               ((op /::real => real => real) (1::real)
-                 ((number_of::bin => real)
-                   ((op BIT::bin => bit => bin)
-                     ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
-                       (bit.B1::bit))
-                     (bit.B0::bit))))
-               ((unif_bound::nat => nat) n))
-             (0::real))))"
+lemma PROB_UNIF: "ALL (n::nat) k::nat.
+   prob (%s::nat => bool. 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: "ALL (n::nat) s::nat => bool. fst (unif n s) < (2::nat) ^ unif_bound n"
+lemma UNIF_RANGE: "ALL (n::nat) s::nat => bool. fst (unif n s) < 2 ^ unif_bound n"
   by (import prob_uniform UNIF_RANGE)
 
 lemma PROB_UNIF_PAIR: "ALL (n::nat) (k::nat) k'::nat.
    (prob (%s::nat => bool. fst (unif n s) = k) =
     prob (%s::nat => bool. fst (unif n s) = k')) =
-   ((k < (2::nat) ^ unif_bound n) = (k' < (2::nat) ^ unif_bound n))"
+   ((k < 2 ^ unif_bound n) = (k' < 2 ^ unif_bound n))"
   by (import prob_uniform PROB_UNIF_PAIR)
 
 lemma PROB_UNIF_BOUND: "(All::(nat => bool) => bool)
@@ -4004,8 +4100,7 @@
                  ((unif_bound::nat => nat) n))))))"
   by (import prob_uniform PROB_UNIF_BOUND)
 
-lemma PROB_UNIF_GOOD: "ALL n::nat.
-   (1::real) / (2::real) <= prob (%s::nat => bool. fst (unif n s) < Suc n)"
+lemma PROB_UNIF_GOOD: "ALL n::nat. 1 / 2 <= prob (%s::nat => bool. fst (unif n s) < Suc n)"
   by (import prob_uniform PROB_UNIF_GOOD)
 
 lemma UNIFORM_RANGE: "ALL (t::nat) (n::nat) s::nat => bool. fst (uniform t (Suc n) s) < Suc n"
--- a/src/HOL/Import/HOL/HOL4Real.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/HOL4Real.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -267,19 +267,19 @@
 
 ;setup_theory real
 
-lemma REAL_0: "(0::real) = (0::real)"
+lemma REAL_0: "(op =::real => real => bool) (0::real) (0::real)"
   by (import real REAL_0)
 
-lemma REAL_1: "(1::real) = (1::real)"
+lemma REAL_1: "(op =::real => real => bool) (1::real) (1::real)"
   by (import real REAL_1)
 
-lemma REAL_ADD_LID_UNIQ: "ALL (x::real) y::real. (x + y = y) = (x = (0::real))"
+lemma REAL_ADD_LID_UNIQ: "ALL (x::real) y::real. (x + y = y) = (x = 0)"
   by (import real REAL_ADD_LID_UNIQ)
 
-lemma REAL_ADD_RID_UNIQ: "ALL (x::real) y::real. (x + y = x) = (y = (0::real))"
+lemma REAL_ADD_RID_UNIQ: "ALL (x::real) y::real. (x + y = x) = (y = 0)"
   by (import real REAL_ADD_RID_UNIQ)
 
-lemma REAL_LNEG_UNIQ: "ALL (x::real) y::real. (x + y = (0::real)) = (x = - y)"
+lemma REAL_LNEG_UNIQ: "ALL (x::real) y::real. (x + y = 0) = (x = - y)"
   by (import real REAL_LNEG_UNIQ)
 
 lemma REAL_LT_ANTISYM: "ALL (x::real) y::real. ~ (x < y & y < x)"
@@ -294,10 +294,10 @@
 lemma REAL_LTE_ANTSYM: "ALL (x::real) y::real. ~ (x <= y & y < x)"
   by (import real REAL_LTE_ANTSYM)
 
-lemma REAL_LT_NEGTOTAL: "ALL x::real. x = (0::real) | (0::real) < x | (0::real) < - x"
+lemma REAL_LT_NEGTOTAL: "ALL x::real. x = 0 | 0 < x | 0 < - x"
   by (import real REAL_LT_NEGTOTAL)
 
-lemma REAL_LE_NEGTOTAL: "ALL x::real. (0::real) <= x | (0::real) <= - x"
+lemma REAL_LE_NEGTOTAL: "ALL x::real. 0 <= x | 0 <= - x"
   by (import real REAL_LE_NEGTOTAL)
 
 lemma REAL_LT_ADDNEG: "ALL (x::real) (y::real) z::real. (y < x + - z) = (y + z < x)"
@@ -306,16 +306,16 @@
 lemma REAL_LT_ADDNEG2: "ALL (x::real) (y::real) z::real. (x + - y < z) = (x < z + y)"
   by (import real REAL_LT_ADDNEG2)
 
-lemma REAL_LT_ADD1: "ALL (x::real) y::real. x <= y --> x < y + (1::real)"
+lemma REAL_LT_ADD1: "ALL (x::real) y::real. x <= y --> x < y + 1"
   by (import real REAL_LT_ADD1)
 
 lemma REAL_SUB_ADD2: "ALL (x::real) y::real. y + (x - y) = x"
   by (import real REAL_SUB_ADD2)
 
-lemma REAL_SUB_LT: "ALL (x::real) y::real. ((0::real) < x - y) = (y < x)"
+lemma REAL_SUB_LT: "ALL (x::real) y::real. (0 < x - y) = (y < x)"
   by (import real REAL_SUB_LT)
 
-lemma REAL_SUB_LE: "ALL (x::real) y::real. ((0::real) <= x - y) = (y <= x)"
+lemma REAL_SUB_LE: "ALL (x::real) y::real. (0 <= x - y) = (y <= x)"
   by (import real REAL_SUB_LE)
 
 lemma REAL_ADD_SUB: "ALL (x::real) y::real. x + y - x = y"
@@ -324,72 +324,79 @@
 lemma REAL_NEG_EQ: "ALL (x::real) y::real. (- x = y) = (x = - y)"
   by (import real REAL_NEG_EQ)
 
-lemma REAL_NEG_MINUS1: "ALL x::real. - x = - (1::real) * x"
+lemma REAL_NEG_MINUS1: "ALL x::real. - x = - 1 * x"
   by (import real REAL_NEG_MINUS1)
 
-lemma REAL_LT_LMUL_0: "ALL (x::real) y::real.
-   (0::real) < x --> ((0::real) < x * y) = ((0::real) < y)"
+lemma REAL_LT_LMUL_0: "ALL (x::real) y::real. 0 < x --> (0 < x * y) = (0 < y)"
   by (import real REAL_LT_LMUL_0)
 
-lemma REAL_LT_RMUL_0: "ALL (x::real) y::real.
-   (0::real) < y --> ((0::real) < x * y) = ((0::real) < x)"
+lemma REAL_LT_RMUL_0: "ALL (x::real) y::real. 0 < y --> (0 < x * y) = (0 < x)"
   by (import real REAL_LT_RMUL_0)
 
-lemma REAL_LT_LMUL: "ALL (x::real) (y::real) z::real. (0::real) < x --> (x * y < x * z) = (y < z)"
+lemma REAL_LT_LMUL: "ALL (x::real) (y::real) z::real. 0 < x --> (x * y < x * z) = (y < z)"
   by (import real REAL_LT_LMUL)
 
-lemma REAL_LINV_UNIQ: "ALL (x::real) y::real. x * y = (1::real) --> x = inverse y"
+lemma REAL_LINV_UNIQ: "ALL (x::real) y::real. x * y = 1 --> x = inverse y"
   by (import real REAL_LINV_UNIQ)
 
-lemma REAL_LE_INV: "ALL x>=0::real. (0::real) <= inverse x"
+lemma REAL_LE_INV: "(All::(real => bool) => bool)
+ (%x::real.
+     (op -->::bool => bool => bool)
+      ((op <=::real => real => bool) (0::real) x)
+      ((op <=::real => real => bool) (0::real) ((inverse::real => real) x)))"
   by (import real REAL_LE_INV)
 
-lemma REAL_LE_ADDR: "ALL (x::real) y::real. (x <= x + y) = ((0::real) <= y)"
+lemma REAL_LE_ADDR: "ALL (x::real) y::real. (x <= x + y) = (0 <= y)"
   by (import real REAL_LE_ADDR)
 
-lemma REAL_LE_ADDL: "ALL (x::real) y::real. (y <= x + y) = ((0::real) <= x)"
+lemma REAL_LE_ADDL: "ALL (x::real) y::real. (y <= x + y) = (0 <= x)"
   by (import real REAL_LE_ADDL)
 
-lemma REAL_LT_ADDR: "ALL (x::real) y::real. (x < x + y) = ((0::real) < y)"
+lemma REAL_LT_ADDR: "ALL (x::real) y::real. (x < x + y) = (0 < y)"
   by (import real REAL_LT_ADDR)
 
-lemma REAL_LT_ADDL: "ALL (x::real) y::real. (y < x + y) = ((0::real) < x)"
+lemma REAL_LT_ADDL: "ALL (x::real) y::real. (y < x + y) = (0 < x)"
   by (import real REAL_LT_ADDL)
 
-lemma REAL_LT_NZ: "ALL n::nat. (real n ~= (0::real)) = ((0::real) < real n)"
+lemma REAL_LT_NZ: "ALL n::nat. (real n ~= 0) = (0 < real n)"
   by (import real REAL_LT_NZ)
 
-lemma REAL_NZ_IMP_LT: "ALL n::nat. n ~= (0::nat) --> (0::real) < real n"
+lemma REAL_NZ_IMP_LT: "ALL n::nat. n ~= 0 --> 0 < real n"
   by (import real REAL_NZ_IMP_LT)
 
-lemma REAL_LT_RDIV_0: "ALL (y::real) z::real.
-   (0::real) < z --> ((0::real) < y / z) = ((0::real) < y)"
+lemma REAL_LT_RDIV_0: "ALL (y::real) z::real. 0 < z --> (0 < y / z) = (0 < y)"
   by (import real REAL_LT_RDIV_0)
 
-lemma REAL_LT_RDIV: "ALL (x::real) (y::real) z::real. (0::real) < z --> (x / z < y / z) = (x < y)"
+lemma REAL_LT_RDIV: "ALL (x::real) (y::real) z::real. 0 < z --> (x / z < y / z) = (x < y)"
   by (import real REAL_LT_RDIV)
 
-lemma REAL_LT_FRACTION_0: "ALL (n::nat) d::real.
-   n ~= (0::nat) --> ((0::real) < d / real n) = ((0::real) < d)"
+lemma REAL_LT_FRACTION_0: "ALL (n::nat) d::real. n ~= 0 --> (0 < d / real n) = (0 < d)"
   by (import real REAL_LT_FRACTION_0)
 
-lemma REAL_LT_MULTIPLE: "ALL (x::nat) xa::real.
-   (1::nat) < x --> (xa < real x * xa) = ((0::real) < xa)"
+lemma REAL_LT_MULTIPLE: "ALL (x::nat) xa::real. 1 < x --> (xa < real x * xa) = (0 < xa)"
   by (import real REAL_LT_MULTIPLE)
 
-lemma REAL_LT_FRACTION: "ALL (n::nat) d::real. (1::nat) < n --> (d / real n < d) = ((0::real) < d)"
+lemma REAL_LT_FRACTION: "ALL (n::nat) d::real. 1 < n --> (d / real n < d) = (0 < d)"
   by (import real REAL_LT_FRACTION)
 
-lemma REAL_LT_HALF2: "ALL d::real. (d / (2::real) < d) = ((0::real) < d)"
+lemma REAL_LT_HALF2: "ALL d::real. (d / 2 < d) = (0 < d)"
   by (import real REAL_LT_HALF2)
 
-lemma REAL_DIV_LMUL: "ALL (x::real) y::real. y ~= (0::real) --> y * (x / y) = x"
+lemma REAL_DIV_LMUL: "ALL (x::real) y::real. y ~= 0 --> y * (x / y) = x"
   by (import real REAL_DIV_LMUL)
 
-lemma REAL_DIV_RMUL: "ALL (x::real) y::real. y ~= (0::real) --> x / y * y = x"
+lemma REAL_DIV_RMUL: "ALL (x::real) y::real. y ~= 0 --> x / y * y = x"
   by (import real REAL_DIV_RMUL)
 
-lemma REAL_DOWN: "ALL x>0::real. EX xa>0::real. xa < x"
+lemma REAL_DOWN: "(All::(real => bool) => bool)
+ (%x::real.
+     (op -->::bool => bool => bool)
+      ((op <::real => real => bool) (0::real) x)
+      ((Ex::(real => bool) => bool)
+        (%xa::real.
+            (op &::bool => bool => bool)
+             ((op <::real => real => bool) (0::real) xa)
+             ((op <::real => real => bool) xa x))))"
   by (import real REAL_DOWN)
 
 lemma REAL_SUB_SUB: "ALL (x::real) y::real. x - y - x = - y"
@@ -408,13 +415,11 @@
   by (import real REAL_SUB_TRIANGLE)
 
 lemma REAL_INV_MUL: "ALL (x::real) y::real.
-   x ~= (0::real) & y ~= (0::real) -->
-   inverse (x * y) = inverse x * inverse y"
+   x ~= 0 & y ~= 0 --> inverse (x * y) = inverse x * inverse y"
   by (import real REAL_INV_MUL)
 
 lemma REAL_SUB_INV2: "ALL (x::real) y::real.
-   x ~= (0::real) & y ~= (0::real) -->
-   inverse x - inverse y = (y - x) / (x * y)"
+   x ~= 0 & y ~= 0 --> inverse x - inverse y = (y - x) / (x * y)"
   by (import real REAL_SUB_INV2)
 
 lemma REAL_SUB_SUB2: "ALL (x::real) y::real. x - (x - y) = y"
@@ -424,75 +429,74 @@
   by (import real REAL_ADD_SUB2)
 
 lemma REAL_LE_MUL2: "ALL (x1::real) (x2::real) (y1::real) y2::real.
-   (0::real) <= x1 & (0::real) <= y1 & x1 <= x2 & y1 <= y2 -->
-   x1 * y1 <= x2 * y2"
+   0 <= x1 & 0 <= y1 & x1 <= x2 & y1 <= y2 --> x1 * y1 <= x2 * y2"
   by (import real REAL_LE_MUL2)
 
-lemma REAL_LE_DIV: "ALL (x::real) xa::real.
-   (0::real) <= x & (0::real) <= xa --> (0::real) <= x / xa"
+lemma REAL_LE_DIV: "ALL (x::real) xa::real. 0 <= x & 0 <= xa --> 0 <= x / xa"
   by (import real REAL_LE_DIV)
 
-lemma REAL_LT_1: "ALL (x::real) y::real. (0::real) <= x & x < y --> x / y < (1::real)"
+lemma REAL_LT_1: "ALL (x::real) y::real. 0 <= x & x < y --> x / y < 1"
   by (import real REAL_LT_1)
 
-lemma REAL_POS_NZ: "ALL x>0::real. x ~= (0::real)"
+lemma REAL_POS_NZ: "(All::(real => bool) => bool)
+ (%x::real.
+     (op -->::bool => bool => bool)
+      ((op <::real => real => bool) (0::real) x)
+      ((Not::bool => bool) ((op =::real => real => bool) x (0::real))))"
   by (import real REAL_POS_NZ)
 
-lemma REAL_EQ_LMUL_IMP: "ALL (x::real) (xa::real) xb::real.
-   x ~= (0::real) & x * xa = x * xb --> xa = xb"
+lemma REAL_EQ_LMUL_IMP: "ALL (x::real) (xa::real) xb::real. x ~= 0 & x * xa = x * xb --> xa = xb"
   by (import real REAL_EQ_LMUL_IMP)
 
-lemma REAL_FACT_NZ: "ALL n::nat. real (FACT n) ~= (0::real)"
+lemma REAL_FACT_NZ: "ALL n::nat. real (FACT n) ~= 0"
   by (import real REAL_FACT_NZ)
 
 lemma REAL_DIFFSQ: "ALL (x::real) y::real. (x + y) * (x - y) = x * x - y * y"
   by (import real REAL_DIFFSQ)
 
-lemma REAL_POASQ: "ALL x::real. ((0::real) < x * x) = (x ~= (0::real))"
+lemma REAL_POASQ: "ALL x::real. (0 < x * x) = (x ~= 0)"
   by (import real REAL_POASQ)
 
-lemma REAL_SUMSQ: "ALL (x::real) y::real.
-   (x * x + y * y = (0::real)) = (x = (0::real) & y = (0::real))"
+lemma REAL_SUMSQ: "ALL (x::real) y::real. (x * x + y * y = 0) = (x = 0 & y = 0)"
   by (import real REAL_SUMSQ)
 
 lemma REAL_DIV_MUL2: "ALL (x::real) z::real.
-   x ~= (0::real) & z ~= (0::real) -->
-   (ALL y::real. y / z = x * y / (x * z))"
+   x ~= 0 & z ~= 0 --> (ALL y::real. y / z = x * y / (x * z))"
   by (import real REAL_DIV_MUL2)
 
-lemma REAL_MIDDLE1: "ALL (a::real) b::real. a <= b --> a <= (a + b) / (2::real)"
+lemma REAL_MIDDLE1: "ALL (a::real) b::real. a <= b --> a <= (a + b) / 2"
   by (import real REAL_MIDDLE1)
 
-lemma REAL_MIDDLE2: "ALL (a::real) b::real. a <= b --> (a + b) / (2::real) <= b"
+lemma REAL_MIDDLE2: "ALL (a::real) b::real. a <= b --> (a + b) / 2 <= b"
   by (import real REAL_MIDDLE2)
 
 lemma ABS_LT_MUL2: "ALL (w::real) (x::real) (y::real) z::real.
    abs w < y & abs x < z --> abs (w * x) < y * z"
   by (import real ABS_LT_MUL2)
 
-lemma ABS_REFL: "ALL x::real. (abs x = x) = ((0::real) <= x)"
+lemma ABS_REFL: "ALL x::real. (abs x = x) = (0 <= x)"
   by (import real ABS_REFL)
 
 lemma ABS_BETWEEN: "ALL (x::real) (y::real) d::real.
-   ((0::real) < d & x - d < y & y < x + d) = (abs (y - x) < d)"
+   (0 < d & x - d < y & y < x + d) = (abs (y - x) < d)"
   by (import real ABS_BETWEEN)
 
 lemma ABS_BOUND: "ALL (x::real) (y::real) d::real. abs (x - y) < d --> y < x + d"
   by (import real ABS_BOUND)
 
-lemma ABS_STILLNZ: "ALL (x::real) y::real. abs (x - y) < abs y --> x ~= (0::real)"
+lemma ABS_STILLNZ: "ALL (x::real) y::real. abs (x - y) < abs y --> x ~= 0"
   by (import real ABS_STILLNZ)
 
-lemma ABS_CASES: "ALL x::real. x = (0::real) | (0::real) < abs x"
+lemma ABS_CASES: "ALL x::real. x = 0 | 0 < abs x"
   by (import real ABS_CASES)
 
 lemma ABS_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & abs (y - x) < z - x --> y < z"
   by (import real ABS_BETWEEN1)
 
-lemma ABS_SIGN: "ALL (x::real) y::real. abs (x - y) < y --> (0::real) < x"
+lemma ABS_SIGN: "ALL (x::real) y::real. abs (x - y) < y --> 0 < x"
   by (import real ABS_SIGN)
 
-lemma ABS_SIGN2: "ALL (x::real) y::real. abs (x - y) < - y --> x < (0::real)"
+lemma ABS_SIGN2: "ALL (x::real) y::real. abs (x - y) < - y --> x < 0"
   by (import real ABS_SIGN2)
 
 lemma ABS_CIRCLE: "ALL (x::real) (y::real) h::real.
@@ -500,44 +504,62 @@
   by (import real ABS_CIRCLE)
 
 lemma ABS_BETWEEN2: "ALL (x0::real) (x::real) (y0::real) y::real.
-   x0 < y0 &
-   abs (x - x0) < (y0 - x0) / (2::real) &
-   abs (y - y0) < (y0 - x0) / (2::real) -->
+   x0 < y0 & abs (x - x0) < (y0 - x0) / 2 & abs (y - y0) < (y0 - x0) / 2 -->
    x < y"
   by (import real ABS_BETWEEN2)
 
-lemma POW_PLUS1: "ALL e>0::real. ALL n::nat. (1::real) + real n * e <= ((1::real) + e) ^ n"
+lemma POW_PLUS1: "ALL e>0. ALL n::nat. 1 + real n * e <= (1 + e) ^ n"
   by (import real POW_PLUS1)
 
-lemma POW_M1: "ALL n::nat. abs ((- (1::real)) ^ n) = (1::real)"
+lemma POW_M1: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op =::real => real => bool)
+      ((abs::real => real)
+        ((op ^::real => nat => real) ((uminus::real => real) (1::real)) n))
+      (1::real))"
   by (import real POW_M1)
 
-lemma REAL_LE1_POW2: "ALL x>=1::real. (1::real) <= x ^ 2"
+lemma REAL_LE1_POW2: "(All::(real => bool) => bool)
+ (%x::real.
+     (op -->::bool => bool => bool)
+      ((op <=::real => real => bool) (1::real) x)
+      ((op <=::real => real => bool) (1::real)
+        ((op ^::real => nat => real) x
+          ((number_of::bin => nat)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))))"
   by (import real REAL_LE1_POW2)
 
-lemma REAL_LT1_POW2: "ALL x>1::real. (1::real) < x ^ 2"
+lemma REAL_LT1_POW2: "(All::(real => bool) => bool)
+ (%x::real.
+     (op -->::bool => bool => bool)
+      ((op <::real => real => bool) (1::real) x)
+      ((op <::real => real => bool) (1::real)
+        ((op ^::real => nat => real) x
+          ((number_of::bin => nat)
+            ((op BIT::bin => bit => bin)
+              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+              (bit.B0::bit))))))"
   by (import real REAL_LT1_POW2)
 
-lemma POW_POS_LT: "ALL (x::real) n::nat. (0::real) < x --> (0::real) < x ^ Suc n"
+lemma POW_POS_LT: "ALL (x::real) n::nat. 0 < x --> 0 < x ^ Suc n"
   by (import real POW_POS_LT)
 
-lemma POW_LT: "ALL (n::nat) (x::real) y::real.
-   (0::real) <= x & x < y --> x ^ Suc n < y ^ Suc n"
+lemma POW_LT: "ALL (n::nat) (x::real) y::real. 0 <= x & x < y --> x ^ Suc n < y ^ Suc n"
   by (import real POW_LT)
 
-lemma POW_ZERO_EQ: "ALL (n::nat) x::real. (x ^ Suc n = (0::real)) = (x = (0::real))"
+lemma POW_ZERO_EQ: "ALL (n::nat) x::real. (x ^ Suc n = 0) = (x = 0)"
   by (import real POW_ZERO_EQ)
 
-lemma REAL_POW_LT2: "ALL (n::nat) (x::real) y::real.
-   n ~= (0::nat) & (0::real) <= x & x < y --> x ^ n < y ^ n"
+lemma REAL_POW_LT2: "ALL (n::nat) (x::real) y::real. n ~= 0 & 0 <= x & x < y --> x ^ n < y ^ n"
   by (import real REAL_POW_LT2)
 
-lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::real. (1::real) < x & m < n --> x ^ m < x ^ n"
+lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::real. 1 < x & m < n --> x ^ m < x ^ n"
   by (import real REAL_POW_MONO_LT)
 
 lemma REAL_SUP_SOMEPOS: "ALL P::real => bool.
-   (EX x::real. P x & (0::real) < x) &
-   (EX z::real. ALL x::real. P x --> x < z) -->
+   (EX x::real. P x & 0 < 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)
 
@@ -546,8 +568,7 @@
    (ALL y::real. (EX x::real. P x & y < x) = (y < s + d))"
   by (import real SUP_LEMMA1)
 
-lemma SUP_LEMMA2: "ALL P::real => bool.
-   Ex P --> (EX (d::real) x::real. P (x + d) & (0::real) < x)"
+lemma SUP_LEMMA2: "ALL P::real => bool. Ex P --> (EX (d::real) x::real. P (x + d) & 0 < x)"
   by (import real SUP_LEMMA2)
 
 lemma SUP_LEMMA3: "ALL d::real.
@@ -595,14 +616,13 @@
    (ALL y::real. P y --> y <= sup P)"
   by (import real REAL_SUP_UBOUND_LE)
 
-lemma REAL_ARCH_LEAST: "ALL y>0::real.
-   ALL x>=0::real. EX n::nat. real n * y <= x & x < real (Suc n) * y"
+lemma REAL_ARCH_LEAST: "ALL y>0. ALL x>=0. EX n::nat. real n * y <= x & x < real (Suc n) * y"
   by (import real REAL_ARCH_LEAST)
 
 consts
   sumc :: "nat => nat => (nat => real) => real" 
 
-specification (sumc) sumc: "(ALL (n::nat) f::nat => real. sumc n (0::nat) f = (0::real)) &
+specification (sumc) sumc: "(ALL (n::nat) f::nat => real. sumc n 0 f = 0) &
 (ALL (n::nat) (m::nat) f::nat => real.
     sumc n (Suc m) f = sumc n m f + f (n + m))"
   by (import real sumc)
@@ -622,16 +642,16 @@
   by (import real SUM_DEF)
 
 lemma sum: "ALL (x::nat => real) (xa::nat) xb::nat.
-   real.sum (xa, 0::nat) x = (0::real) &
+   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: "ALL (f::nat => real) (n::nat) p::nat.
-   real.sum (0::nat, n) f + real.sum (n, p) f = real.sum (0::nat, n + p) f"
+   real.sum (0, n) f + real.sum (n, p) f = real.sum (0, n + p) f"
   by (import real SUM_TWO)
 
 lemma SUM_DIFF: "ALL (f::nat => real) (m::nat) n::nat.
-   real.sum (m, n) f = real.sum (0::nat, m + n) f - real.sum (0::nat, m) f"
+   real.sum (m, n) f = real.sum (0, m + n) f - real.sum (0, m) f"
   by (import real SUM_DIFF)
 
 lemma ABS_SUM: "ALL (f::nat => real) (m::nat) n::nat.
@@ -649,13 +669,12 @@
   by (import real SUM_EQ)
 
 lemma SUM_POS: "ALL f::nat => real.
-   (ALL n::nat. (0::real) <= f n) -->
-   (ALL (m::nat) n::nat. (0::real) <= real.sum (m, n) f)"
+   (ALL n::nat. 0 <= f n) --> (ALL (m::nat) n::nat. 0 <= real.sum (m, n) f)"
   by (import real SUM_POS)
 
 lemma SUM_POS_GEN: "ALL (f::nat => real) m::nat.
-   (ALL n::nat. m <= n --> (0::real) <= f n) -->
-   (ALL n::nat. (0::real) <= real.sum (m, n) f)"
+   (ALL n::nat. m <= n --> 0 <= f n) -->
+   (ALL n::nat. 0 <= real.sum (m, n) f)"
   by (import real SUM_POS_GEN)
 
 lemma SUM_ABS: "ALL (f::nat => real) (m::nat) x::nat.
@@ -668,8 +687,8 @@
   by (import real SUM_ABS_LE)
 
 lemma SUM_ZERO: "ALL (f::nat => real) N::nat.
-   (ALL n::nat. N <= n --> f n = (0::real)) -->
-   (ALL (m::nat) n::nat. N <= m --> real.sum (m, n) f = (0::real))"
+   (ALL n::nat. N <= n --> f n = 0) -->
+   (ALL (m::nat) n::nat. N <= m --> real.sum (m, n) f = 0)"
   by (import real SUM_ZERO)
 
 lemma SUM_ADD: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat.
@@ -696,8 +715,7 @@
   by (import real SUM_SUBST)
 
 lemma SUM_NSUB: "ALL (n::nat) (f::nat => real) c::real.
-   real.sum (0::nat, n) f - real n * c =
-   real.sum (0::nat, n) (%p::nat. f p - c)"
+   real.sum (0, n) f - real n * c = real.sum (0, n) (%p::nat. f p - c)"
   by (import real SUM_NSUB)
 
 lemma SUM_BOUND: "ALL (f::nat => real) (k::real) (m::nat) n::nat.
@@ -706,26 +724,25 @@
   by (import real SUM_BOUND)
 
 lemma SUM_GROUP: "ALL (n::nat) (k::nat) f::nat => real.
-   real.sum (0::nat, n) (%m::nat. real.sum (m * k, k) f) =
-   real.sum (0::nat, n * k) f"
+   real.sum (0, n) (%m::nat. real.sum (m * k, k) f) = real.sum (0, n * k) f"
   by (import real SUM_GROUP)
 
-lemma SUM_1: "ALL (f::nat => real) n::nat. real.sum (n, 1::nat) f = f n"
+lemma SUM_1: "ALL (f::nat => real) n::nat. real.sum (n, 1) f = f n"
   by (import real SUM_1)
 
-lemma SUM_2: "ALL (f::nat => real) n::nat. real.sum (n, 2::nat) f = f n + f (n + (1::nat))"
+lemma SUM_2: "ALL (f::nat => real) n::nat. real.sum (n, 2) f = f n + f (n + 1)"
   by (import real SUM_2)
 
 lemma SUM_OFFSET: "ALL (f::nat => real) (n::nat) k::nat.
-   real.sum (0::nat, n) (%m::nat. f (m + k)) =
-   real.sum (0::nat, n + k) f - real.sum (0::nat, k) f"
+   real.sum (0, n) (%m::nat. f (m + k)) =
+   real.sum (0, n + k) f - real.sum (0, k) f"
   by (import real SUM_OFFSET)
 
 lemma SUM_REINDEX: "ALL (f::nat => real) (m::nat) (k::nat) n::nat.
    real.sum (m + k, n) f = real.sum (m, n) (%r::nat. f (r + k))"
   by (import real SUM_REINDEX)
 
-lemma SUM_0: "ALL (m::nat) n::nat. real.sum (m, n) (%r::nat. 0::real) = (0::real)"
+lemma SUM_0: "ALL (m::nat) n::nat. real.sum (m, n) (%r::nat. 0) = 0"
   by (import real SUM_0)
 
 lemma SUM_PERMUTE_0: "(All::(nat => bool) => bool)
@@ -756,12 +773,10 @@
    real.sum (n, d) (%n::nat. f (Suc n) - f n) = f (n + d) - f n"
   by (import real SUM_CANCEL)
 
-lemma REAL_EQ_RDIV_EQ: "ALL (x::real) (xa::real) xb::real.
-   (0::real) < xb --> (x = xa / xb) = (x * xb = xa)"
+lemma REAL_EQ_RDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x = xa / xb) = (x * xb = xa)"
   by (import real REAL_EQ_RDIV_EQ)
 
-lemma REAL_EQ_LDIV_EQ: "ALL (x::real) (xa::real) xb::real.
-   (0::real) < xb --> (x / xb = xa) = (x = xa * xb)"
+lemma REAL_EQ_LDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x / xb = xa) = (x = xa * xb)"
   by (import real REAL_EQ_LDIV_EQ)
 
 ;end_setup
@@ -769,7 +784,7 @@
 ;setup_theory topology
 
 constdefs
-  re_Union :: "(('a::type => bool) => bool) => 'a::type => bool" 
+  re_Union :: "(('a => bool) => bool) => 'a => bool" 
   "re_Union ==
 %(P::('a::type => bool) => bool) x::'a::type.
    EX s::'a::type => bool. P s & s x"
@@ -779,7 +794,7 @@
   by (import topology re_Union)
 
 constdefs
-  re_union :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
+  re_union :: "('a => bool) => ('a => bool) => 'a => bool" 
   "re_union ==
 %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x | Q x"
 
@@ -788,7 +803,7 @@
   by (import topology re_union)
 
 constdefs
-  re_intersect :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
+  re_intersect :: "('a => bool) => ('a => bool) => 'a => bool" 
   "re_intersect ==
 %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x & Q x"
 
@@ -797,21 +812,21 @@
   by (import topology re_intersect)
 
 constdefs
-  re_null :: "'a::type => bool" 
+  re_null :: "'a => bool" 
   "re_null == %x::'a::type. False"
 
 lemma re_null: "re_null = (%x::'a::type. False)"
   by (import topology re_null)
 
 constdefs
-  re_universe :: "'a::type => bool" 
+  re_universe :: "'a => bool" 
   "re_universe == %x::'a::type. True"
 
 lemma re_universe: "re_universe = (%x::'a::type. True)"
   by (import topology re_universe)
 
 constdefs
-  re_subset :: "('a::type => bool) => ('a::type => bool) => bool" 
+  re_subset :: "('a => bool) => ('a => bool) => bool" 
   "re_subset ==
 %(P::'a::type => bool) Q::'a::type => bool. ALL x::'a::type. P x --> Q x"
 
@@ -820,7 +835,7 @@
   by (import topology re_subset)
 
 constdefs
-  re_compl :: "('a::type => bool) => 'a::type => bool" 
+  re_compl :: "('a => bool) => 'a => bool" 
   "re_compl == %(P::'a::type => bool) x::'a::type. ~ P x"
 
 lemma re_compl: "ALL P::'a::type => bool. re_compl P = (%x::'a::type. ~ P x)"
@@ -841,7 +856,7 @@
   by (import topology SUBSET_TRANS)
 
 constdefs
-  istopology :: "(('a::type => bool) => bool) => bool" 
+  istopology :: "(('a => bool) => bool) => bool" 
   "istopology ==
 %L::('a::type => bool) => bool.
    L re_null &
@@ -867,8 +882,8 @@
 lemmas topology_TY_DEF = typedef_hol2hol4 [OF type_definition_topology]
 
 consts
-  topology :: "(('a::type => bool) => bool) => 'a::type topology" 
-  "open" :: "'a::type topology => ('a::type => bool) => bool" 
+  topology :: "(('a => bool) => bool) => 'a topology" 
+  "open" :: "'a topology => ('a => bool) => bool" 
 
 specification ("open" topology) topology_tybij: "(ALL a::'a::type topology. topology (open a) = a) &
 (ALL r::('a::type => bool) => bool. istopology r = (open (topology r) = r))"
@@ -888,7 +903,7 @@
   by (import topology TOPOLOGY_UNION)
 
 constdefs
-  neigh :: "'a::type topology => ('a::type => bool) * 'a::type => bool" 
+  neigh :: "'a topology => ('a => bool) * 'a => bool" 
   "neigh ==
 %(top::'a::type topology) (N::'a::type => bool, x::'a::type).
    EX P::'a::type => bool. open top P & re_subset P N & P x"
@@ -920,7 +935,7 @@
   by (import topology OPEN_NEIGH)
 
 constdefs
-  closed :: "'a::type topology => ('a::type => bool) => bool" 
+  closed :: "'a topology => ('a => bool) => bool" 
   "closed == %(L::'a::type topology) S'::'a::type => bool. open L (re_compl S')"
 
 lemma closed: "ALL (L::'a::type topology) S'::'a::type => bool.
@@ -928,7 +943,7 @@
   by (import topology closed)
 
 constdefs
-  limpt :: "'a::type topology => 'a::type => ('a::type => bool) => bool" 
+  limpt :: "'a topology => 'a => ('a => bool) => bool" 
   "limpt ==
 %(top::'a::type topology) (x::'a::type) S'::'a::type => bool.
    ALL N::'a::type => bool.
@@ -945,16 +960,16 @@
   by (import topology CLOSED_LIMPT)
 
 constdefs
-  ismet :: "('a::type * 'a::type => real) => bool" 
+  ismet :: "('a * 'a => real) => bool" 
   "ismet ==
 %m::'a::type * 'a::type => real.
-   (ALL (x::'a::type) y::'a::type. (m (x, y) = (0::real)) = (x = y)) &
+   (ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) &
    (ALL (x::'a::type) (y::'a::type) z::'a::type.
        m (y, z) <= m (x, y) + m (x, z))"
 
 lemma ismet: "ALL m::'a::type * 'a::type => real.
    ismet m =
-   ((ALL (x::'a::type) y::'a::type. (m (x, y) = (0::real)) = (x = y)) &
+   ((ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) &
     (ALL (x::'a::type) (y::'a::type) z::'a::type.
         m (y, z) <= m (x, y) + m (x, z)))"
   by (import topology ismet)
@@ -967,8 +982,8 @@
 lemmas metric_TY_DEF = typedef_hol2hol4 [OF type_definition_metric]
 
 consts
-  metric :: "('a::type * 'a::type => real) => 'a::type metric" 
-  dist :: "'a::type metric => 'a::type * 'a::type => real" 
+  metric :: "('a * 'a => real) => 'a metric" 
+  dist :: "'a metric => 'a * 'a => real" 
 
 specification (dist metric) metric_tybij: "(ALL a::'a::type metric. metric (dist a) = a) &
 (ALL r::'a::type * 'a::type => real. ismet r = (dist (metric r) = r))"
@@ -978,14 +993,13 @@
   by (import topology METRIC_ISMET)
 
 lemma METRIC_ZERO: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
-   (dist m (x, y) = (0::real)) = (x = y)"
+   (dist m (x, y) = 0) = (x = y)"
   by (import topology METRIC_ZERO)
 
-lemma METRIC_SAME: "ALL (m::'a::type metric) x::'a::type. dist m (x, x) = (0::real)"
+lemma METRIC_SAME: "ALL (m::'a::type metric) x::'a::type. dist m (x, x) = 0"
   by (import topology METRIC_SAME)
 
-lemma METRIC_POS: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
-   (0::real) <= dist m (x, y)"
+lemma METRIC_POS: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. 0 <= dist m (x, y)"
   by (import topology METRIC_POS)
 
 lemma METRIC_SYM: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
@@ -997,45 +1011,41 @@
   by (import topology METRIC_TRIANGLE)
 
 lemma METRIC_NZ: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
-   x ~= y --> (0::real) < dist m (x, y)"
+   x ~= y --> 0 < dist m (x, y)"
   by (import topology METRIC_NZ)
 
 constdefs
-  mtop :: "'a::type metric => 'a::type topology" 
+  mtop :: "'a metric => 'a topology" 
   "mtop ==
 %m::'a::type metric.
    topology
     (%S'::'a::type => bool.
         ALL x::'a::type.
-           S' x -->
-           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
+           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
 
 lemma mtop: "ALL m::'a::type metric.
    mtop m =
    topology
     (%S'::'a::type => bool.
         ALL x::'a::type.
-           S' x -->
-           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
+           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   by (import topology mtop)
 
 lemma mtop_istopology: "ALL m::'a::type metric.
    istopology
     (%S'::'a::type => bool.
         ALL x::'a::type.
-           S' x -->
-           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
+           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   by (import topology mtop_istopology)
 
 lemma MTOP_OPEN: "ALL (S'::'a::type => bool) x::'a::type metric.
    open (mtop x) S' =
    (ALL xa::'a::type.
-       S' xa -->
-       (EX e>0::real. ALL y::'a::type. dist x (xa, y) < e --> S' y))"
+       S' xa --> (EX e>0. ALL y::'a::type. dist x (xa, y) < e --> S' y))"
   by (import topology MTOP_OPEN)
 
 constdefs
-  B :: "'a::type metric => 'a::type * real => 'a::type => bool" 
+  B :: "'a metric => 'a * real => 'a => bool" 
   "B ==
 %(m::'a::type metric) (x::'a::type, e::real) y::'a::type. dist m (x, y) < e"
 
@@ -1044,16 +1054,16 @@
   by (import topology ball)
 
 lemma BALL_OPEN: "ALL (m::'a::type metric) (x::'a::type) e::real.
-   (0::real) < e --> open (mtop m) (B m (x, e))"
+   0 < e --> open (mtop m) (B m (x, e))"
   by (import topology BALL_OPEN)
 
 lemma BALL_NEIGH: "ALL (m::'a::type metric) (x::'a::type) e::real.
-   (0::real) < e --> neigh (mtop m) (B m (x, e), x)"
+   0 < e --> neigh (mtop m) (B m (x, e), x)"
   by (import topology BALL_NEIGH)
 
 lemma MTOP_LIMPT: "ALL (m::'a::type metric) (x::'a::type) S'::'a::type => bool.
    limpt (mtop m) x S' =
-   (ALL e>0::real. EX y::'a::type. x ~= y & S' y & dist m (x, y) < e)"
+   (ALL e>0. EX y::'a::type. x ~= y & S' y & dist m (x, y) < e)"
   by (import topology MTOP_LIMPT)
 
 lemma ISMET_R1: "ismet (%(x::real, y::real). abs (y - x))"
@@ -1075,16 +1085,16 @@
 lemma MR1_SUB: "ALL (x::real) d::real. dist mr1 (x, x - d) = abs d"
   by (import topology MR1_SUB)
 
-lemma MR1_ADD_POS: "ALL (x::real) d::real. (0::real) <= d --> dist mr1 (x, x + d) = d"
+lemma MR1_ADD_POS: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x + d) = d"
   by (import topology MR1_ADD_POS)
 
-lemma MR1_SUB_LE: "ALL (x::real) d::real. (0::real) <= d --> dist mr1 (x, x - d) = d"
+lemma MR1_SUB_LE: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x - d) = d"
   by (import topology MR1_SUB_LE)
 
-lemma MR1_ADD_LT: "ALL (x::real) d::real. (0::real) < d --> dist mr1 (x, x + d) = d"
+lemma MR1_ADD_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x + d) = d"
   by (import topology MR1_ADD_LT)
 
-lemma MR1_SUB_LT: "ALL (x::real) d::real. (0::real) < d --> dist mr1 (x, x - d) = d"
+lemma MR1_SUB_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x - d) = d"
   by (import topology MR1_SUB_LT)
 
 lemma MR1_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & dist mr1 (x, y) < z - x --> y < z"
@@ -1098,7 +1108,7 @@
 ;setup_theory nets
 
 constdefs
-  dorder :: "('a::type => 'a::type => bool) => bool" 
+  dorder :: "('a => 'a => bool) => bool" 
   "dorder ==
 %g::'a::type => 'a::type => bool.
    ALL (x::'a::type) y::'a::type.
@@ -1113,8 +1123,7 @@
   by (import nets dorder)
 
 constdefs
-  tends :: "('b::type => 'a::type)
-=> 'a::type => 'a::type topology * ('b::type => 'b::type => bool) => bool" 
+  tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool" 
   "tends ==
 %(s::'b::type => 'a::type) (l::'a::type) (top::'a::type topology,
    g::'b::type => 'b::type => bool).
@@ -1131,8 +1140,7 @@
   by (import nets tends)
 
 constdefs
-  bounded :: "'a::type metric * ('b::type => 'b::type => bool)
-=> ('b::type => 'a::type) => bool" 
+  bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool" 
   "bounded ==
 %(m::'a::type metric, g::'b::type => 'b::type => bool)
    f::'b::type => 'a::type.
@@ -1147,14 +1155,13 @@
   by (import nets bounded)
 
 constdefs
-  tendsto :: "'a::type metric * 'a::type => 'a::type => 'a::type => bool" 
+  tendsto :: "'a metric * 'a => 'a => 'a => bool" 
   "tendsto ==
 %(m::'a::type metric, x::'a::type) (y::'a::type) z::'a::type.
-   (0::real) < dist m (x, y) & dist m (x, y) <= dist m (x, z)"
+   0 < dist m (x, y) & dist m (x, y) <= dist m (x, z)"
 
 lemma tendsto: "ALL (m::'a::type metric) (x::'a::type) (y::'a::type) z::'a::type.
-   tendsto (m, x) y z =
-   ((0::real) < dist m (x, y) & dist m (x, y) <= dist m (x, z))"
+   tendsto (m, x) y z = (0 < dist m (x, y) & dist m (x, y) <= dist m (x, z))"
   by (import nets tendsto)
 
 lemma DORDER_LEMMA: "ALL g::'a::type => 'a::type => bool.
@@ -1174,7 +1181,7 @@
 lemma MTOP_TENDS: "ALL (d::'a::type metric) (g::'b::type => 'b::type => bool)
    (x::'b::type => 'a::type) x0::'a::type.
    tends x x0 (mtop d, g) =
-   (ALL e>0::real.
+   (ALL e>0.
        EX n::'b::type.
           g n n & (ALL m::'b::type. g m n --> dist d (x m, x0) < e))"
   by (import nets MTOP_TENDS)
@@ -1188,18 +1195,17 @@
 
 lemma SEQ_TENDS: "ALL (d::'a::type metric) (x::nat => 'a::type) x0::'a::type.
    tends x x0 (mtop d, nat_ge) =
-   (ALL xa>0::real.
-       EX xb::nat. ALL xc::nat. xb <= xc --> dist d (x xc, x0) < xa)"
+   (ALL xa>0. EX xb::nat. ALL xc::nat. xb <= xc --> dist d (x xc, x0) < xa)"
   by (import nets SEQ_TENDS)
 
 lemma LIM_TENDS: "ALL (m1::'a::type metric) (m2::'b::type metric) (f::'a::type => 'b::type)
    (x0::'a::type) y0::'b::type.
    limpt (mtop m1) x0 re_universe -->
    tends f y0 (mtop m2, tendsto (m1, x0)) =
-   (ALL e>0::real.
-       EX d>0::real.
+   (ALL e>0.
+       EX d>0.
           ALL x::'a::type.
-             (0::real) < dist m1 (x, x0) & dist m1 (x, x0) <= d -->
+             0 < dist m1 (x, x0) & dist m1 (x, x0) <= d -->
              dist m2 (f x, y0) < e)"
   by (import nets LIM_TENDS)
 
@@ -1207,10 +1213,10 @@
    (x0::'a::type) y0::'b::type.
    limpt (mtop m1) x0 re_universe -->
    tends f y0 (mtop m2, tendsto (m1, x0)) =
-   (ALL e>0::real.
-       EX d>0::real.
+   (ALL e>0.
+       EX d>0.
           ALL x::'a::type.
-             (0::real) < dist m1 (x, x0) & dist m1 (x, x0) < d -->
+             0 < dist m1 (x, x0) & dist m1 (x, x0) < d -->
              dist m2 (f x, y0) < e)"
   by (import nets LIM_TENDS2)
 
@@ -1221,8 +1227,7 @@
   by (import nets MR1_BOUNDED)
 
 lemma NET_NULL: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
-   tends x x0 (mtop mr1, g) =
-   tends (%n::'a::type. x n - x0) (0::real) (mtop mr1, g)"
+   tends x x0 (mtop mr1, g) = tends (%n::'a::type. x n - x0) 0 (mtop mr1, g)"
   by (import nets NET_NULL)
 
 lemma NET_CONV_BOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
@@ -1230,32 +1235,31 @@
   by (import nets NET_CONV_BOUNDED)
 
 lemma NET_CONV_NZ: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
-   tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
-   (EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n ~= (0::real)))"
+   tends x x0 (mtop mr1, g) & x0 ~= 0 -->
+   (EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n ~= 0))"
   by (import nets NET_CONV_NZ)
 
 lemma NET_CONV_IBOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
-   tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
+   tends x x0 (mtop mr1, g) & x0 ~= 0 -->
    bounded (mr1, g) (%n::'a::type. inverse (x n))"
   by (import nets NET_CONV_IBOUNDED)
 
 lemma NET_NULL_ADD: "ALL g::'a::type => 'a::type => bool.
    dorder g -->
    (ALL (x::'a::type => real) y::'a::type => real.
-       tends x (0::real) (mtop mr1, g) & tends y (0::real) (mtop mr1, g) -->
-       tends (%n::'a::type. x n + y n) (0::real) (mtop mr1, g))"
+       tends x 0 (mtop mr1, g) & tends y 0 (mtop mr1, g) -->
+       tends (%n::'a::type. x n + y n) 0 (mtop mr1, g))"
   by (import nets NET_NULL_ADD)
 
 lemma NET_NULL_MUL: "ALL g::'a::type => 'a::type => bool.
    dorder g -->
    (ALL (x::'a::type => real) y::'a::type => real.
-       bounded (mr1, g) x & tends y (0::real) (mtop mr1, g) -->
-       tends (%n::'a::type. x n * y n) (0::real) (mtop mr1, g))"
+       bounded (mr1, g) x & tends y 0 (mtop mr1, g) -->
+       tends (%n::'a::type. x n * y n) 0 (mtop mr1, g))"
   by (import nets NET_NULL_MUL)
 
 lemma NET_NULL_CMUL: "ALL (g::'a::type => 'a::type => bool) (k::real) x::'a::type => real.
-   tends x (0::real) (mtop mr1, g) -->
-   tends (%n::'a::type. k * x n) (0::real) (mtop mr1, g)"
+   tends x 0 (mtop mr1, g) --> tends (%n::'a::type. k * x n) 0 (mtop mr1, g)"
   by (import nets NET_NULL_CMUL)
 
 lemma NET_ADD: "ALL g::'a::type => 'a::type => bool.
@@ -1289,15 +1293,14 @@
 lemma NET_INV: "ALL g::'a::type => 'a::type => bool.
    dorder g -->
    (ALL (x::'a::type => real) x0::real.
-       tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
+       tends x x0 (mtop mr1, g) & x0 ~= 0 -->
        tends (%n::'a::type. inverse (x n)) (inverse x0) (mtop mr1, g))"
   by (import nets NET_INV)
 
 lemma NET_DIV: "ALL g::'a::type => 'a::type => bool.
    dorder g -->
    (ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real.
-       tends x x0 (mtop mr1, g) &
-       tends y y0 (mtop mr1, g) & y0 ~= (0::real) -->
+       tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) & y0 ~= 0 -->
        tends (%xa::'a::type. x xa / y xa) (x0 / y0) (mtop mr1, g))"
   by (import nets NET_DIV)
 
@@ -1764,7 +1767,7 @@
 lemma SEQ_SUC: "ALL (f::nat => real) l::real. --> f l = --> (%n::nat. f (Suc n)) l"
   by (import seq SEQ_SUC)
 
-lemma SEQ_ABS: "ALL f::nat => real. --> (%n::nat. abs (f n)) (0::real) = --> f (0::real)"
+lemma SEQ_ABS: "ALL f::nat => real. --> (%n::nat. abs (f n)) 0 = --> f 0"
   by (import seq SEQ_ABS)
 
 lemma SEQ_ABS_IMP: "(All::((nat => real) => bool) => bool)
@@ -1929,10 +1932,9 @@
 
 constdefs
   sums :: "(nat => real) => real => bool" 
-  "sums == %f::nat => real. --> (%n::nat. real.sum (0::nat, n) f)"
-
-lemma sums: "ALL (f::nat => real) s::real.
-   sums f s = --> (%n::nat. real.sum (0::nat, n) f) s"
+  "sums == %f::nat => real. --> (%n::nat. real.sum (0, n) f)"
+
+lemma sums: "ALL (f::nat => real) s::real. sums f s = --> (%n::nat. real.sum (0, n) f) s"
   by (import seq sums)
 
 constdefs
@@ -2538,7 +2540,7 @@
   by (import lim LIM_DIV)
 
 lemma LIM_NULL: "ALL (f::real => real) (l::real) x::real.
-   tends_real_real f l x = tends_real_real (%x::real. f x - l) (0::real) x"
+   tends_real_real f l x = tends_real_real (%x::real. f x - l) 0 x"
   by (import lim LIM_NULL)
 
 lemma LIM_X: "ALL x0::real. tends_real_real (%x::real. x) x0 x0"
@@ -2614,21 +2616,19 @@
   diffl :: "(real => real) => real => real => bool" 
   "diffl ==
 %(f::real => real) (l::real) x::real.
-   tends_real_real (%h::real. (f (x + h) - f x) / h) l (0::real)"
+   tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
 
 lemma diffl: "ALL (f::real => real) (l::real) x::real.
-   diffl f l x =
-   tends_real_real (%h::real. (f (x + h) - f x) / h) l (0::real)"
+   diffl f l x = tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
   by (import lim diffl)
 
 constdefs
   contl :: "(real => real) => real => bool" 
   "contl ==
-%(f::real => real) x::real.
-   tends_real_real (%h::real. f (x + h)) (f x) (0::real)"
+%(f::real => real) x::real. tends_real_real (%h::real. f (x + h)) (f x) 0"
 
 lemma contl: "ALL (f::real => real) x::real.
-   contl f x = tends_real_real (%h::real. f (x + h)) (f x) (0::real)"
+   contl f x = tends_real_real (%h::real. f (x + h)) (f x) 0"
   by (import lim contl)
 
 constdefs
@@ -2839,7 +2839,7 @@
                               ((op =::real => real => bool) (f x) y))))))))"
   by (import lim IVT2)
 
-lemma DIFF_CONST: "ALL k::real. All (diffl (%x::real. k) (0::real))"
+lemma DIFF_CONST: "ALL k::real. All (diffl (%x::real. k) 0)"
   by (import lim DIFF_CONST)
 
 lemma DIFF_ADD: "(All::((real => real) => bool) => bool)
@@ -2960,11 +2960,10 @@
                             ((op *::real => real => real) l m) x))))))"
   by (import lim DIFF_CHAIN)
 
-lemma DIFF_X: "All (diffl (%x::real. x) (1::real))"
+lemma DIFF_X: "All (diffl (%x::real. x) 1)"
   by (import lim DIFF_X)
 
-lemma DIFF_POW: "ALL (n::nat) x::real.
-   diffl (%x::real. x ^ n) (real n * x ^ (n - (1::nat))) x"
+lemma DIFF_POW: "ALL (n::nat) x::real. diffl (%x::real. x ^ n) (real n * x ^ (n - 1)) x"
   by (import lim DIFF_POW)
 
 lemma DIFF_XM1: "(All::(real => bool) => bool)
@@ -3877,18 +3876,18 @@
 ;setup_theory powser
 
 lemma POWDIFF_LEMMA: "ALL (n::nat) (x::real) y::real.
-   real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (Suc n - p)) =
-   y * real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
+   real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (Suc n - p)) =
+   y * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
   by (import powser POWDIFF_LEMMA)
 
 lemma POWDIFF: "ALL (n::nat) (x::real) y::real.
    x ^ Suc n - y ^ Suc n =
-   (x - y) * real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
+   (x - y) * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
   by (import powser POWDIFF)
 
 lemma POWREV: "ALL (n::nat) (x::real) y::real.
-   real.sum (0::nat, Suc n) (%xa::nat. x ^ xa * y ^ (n - xa)) =
-   real.sum (0::nat, Suc n) (%xa::nat. x ^ (n - xa) * y ^ xa)"
+   real.sum (0, Suc n) (%xa::nat. x ^ xa * y ^ (n - xa)) =
+   real.sum (0, Suc n) (%xa::nat. x ^ (n - xa) * y ^ xa)"
   by (import powser POWREV)
 
 lemma POWSER_INSIDEA: "(All::((nat => real) => bool) => bool)
@@ -3943,15 +3942,15 @@
   by (import powser DIFFS_NEG)
 
 lemma DIFFS_LEMMA: "ALL (n::nat) (c::nat => real) x::real.
-   real.sum (0::nat, n) (%n::nat. diffs c n * x ^ n) =
-   real.sum (0::nat, n) (%n::nat. real n * (c n * x ^ (n - (1::nat)))) +
-   real n * (c n * x ^ (n - (1::nat)))"
+   real.sum (0, n) (%n::nat. diffs c n * x ^ n) =
+   real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) +
+   real n * (c n * x ^ (n - 1))"
   by (import powser DIFFS_LEMMA)
 
 lemma DIFFS_LEMMA2: "ALL (n::nat) (c::nat => real) x::real.
-   real.sum (0::nat, n) (%n::nat. real n * (c n * x ^ (n - (1::nat)))) =
-   real.sum (0::nat, n) (%n::nat. diffs c n * x ^ n) -
-   real n * (c n * x ^ (n - (1::nat)))"
+   real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) =
+   real.sum (0, n) (%n::nat. diffs c n * x ^ n) -
+   real n * (c n * x ^ (n - 1))"
   by (import powser DIFFS_LEMMA2)
 
 lemma DIFFS_EQUIV: "(All::((nat => real) => bool) => bool)
@@ -3978,8 +3977,8 @@
   by (import powser DIFFS_EQUIV)
 
 lemma TERMDIFF_LEMMA1: "ALL (m::nat) (z::real) h::real.
-   real.sum (0::nat, m) (%p::nat. (z + h) ^ (m - p) * z ^ p - z ^ m) =
-   real.sum (0::nat, m) (%p::nat. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))"
+   real.sum (0, m) (%p::nat. (z + h) ^ (m - p) * z ^ p - z ^ m) =
+   real.sum (0, m) (%p::nat. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))"
   by (import powser TERMDIFF_LEMMA1)
 
 lemma TERMDIFF_LEMMA2: "(All::(real => bool) => bool)
@@ -4185,23 +4184,17 @@
 
 constdefs
   cos :: "real => real" 
-  "(cos ==
- (%(x::real).
-     (suminf
-       (%(n::nat).
-           ((if (EVEN n)
-             then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
-             else (0::real)) *
-            (x ^ n))))))"
-
-lemma cos: "(ALL (x::real).
-    ((cos x) =
-     (suminf
-       (%(n::nat).
-           ((if (EVEN n)
-             then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
-             else (0::real)) *
-            (x ^ n))))))"
+  "cos ==
+%x::real.
+   suminf
+    (%n::nat.
+        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
+
+lemma cos: "ALL x::real.
+   cos x =
+   suminf
+    (%n::nat.
+        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
   by (import transc cos)
 
 constdefs
@@ -4210,18 +4203,14 @@
 %x::real.
    suminf
     (%n::nat.
-        (if EVEN n then 0::real
-         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
-              real (FACT n)) *
+        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
         x ^ n)"
 
 lemma sin: "ALL x::real.
    sin x =
    suminf
     (%n::nat.
-        (if EVEN n then 0::real
-         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
-              real (FACT n)) *
+        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
         x ^ n)"
   by (import transc sin)
 
@@ -4231,56 +4220,36 @@
 lemma SIN_CONVERGES: "ALL x::real.
    sums
     (%n::nat.
-        (if EVEN n then 0::real
-         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
-              real (FACT n)) *
+        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
         x ^ n)
     (sin x)"
   by (import transc SIN_CONVERGES)
 
-lemma COS_CONVERGES: "(ALL (x::real).
-    (sums
-      (%(n::nat).
-          ((if (EVEN n)
-            then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
-            else (0::real)) *
-           (x ^ n)))
-      (cos x)))"
+lemma COS_CONVERGES: "ALL x::real.
+   sums
+    (%n::nat.
+        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)
+    (cos x)"
   by (import transc COS_CONVERGES)
 
 lemma EXP_FDIFF: "diffs (%n::nat. inverse (real (FACT n))) =
 (%n::nat. inverse (real (FACT n)))"
   by (import transc EXP_FDIFF)
 
-lemma SIN_FDIFF: "((diffs
-   (%(n::nat).
-       (if (EVEN n) then (0::real)
-        else (((- (1::real)) ^ ((n - (1::nat)) div (2::nat))) /
-              (real (FACT n)))))) =
- (%(n::nat).
-     (if (EVEN n)
-      then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
-      else (0::real))))"
+lemma SIN_FDIFF: "diffs
+ (%n::nat. if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) =
+(%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0)"
   by (import transc SIN_FDIFF)
 
-lemma COS_FDIFF: "((diffs
-   (%(n::nat).
-       (if (EVEN n)
-        then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
-        else (0::real)))) =
- (%(n::nat).
-     (- (if (EVEN n) then (0::real)
-         else (((- (1::real)) ^ ((n - (1::nat)) div (2::nat))) /
-               (real (FACT n)))))))"
+lemma COS_FDIFF: "diffs (%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) =
+(%n::nat. - (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)))"
   by (import transc COS_FDIFF)
 
 lemma SIN_NEGLEMMA: "ALL x::real.
    - sin x =
    suminf
     (%n::nat.
-        - ((if EVEN n then 0::real
-            else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
-                 real (FACT n)) *
+        - ((if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
            x ^ n))"
   by (import transc SIN_NEGLEMMA)
 
@@ -4402,22 +4371,22 @@
                      x))))))))))"
   by (import transc DIFF_COMPOSITE)
 
-lemma EXP_0: "exp (0::real) = (1::real)"
+lemma EXP_0: "exp 0 = 1"
   by (import transc EXP_0)
 
-lemma EXP_LE_X: "ALL x>=0::real. (1::real) + x <= exp x"
+lemma EXP_LE_X: "ALL x>=0. 1 + x <= exp x"
   by (import transc EXP_LE_X)
 
-lemma EXP_LT_1: "ALL x>0::real. (1::real) < exp x"
+lemma EXP_LT_1: "ALL x>0. 1 < exp x"
   by (import transc EXP_LT_1)
 
 lemma EXP_ADD_MUL: "ALL (x::real) y::real. exp (x + y) * exp (- x) = exp y"
   by (import transc EXP_ADD_MUL)
 
-lemma EXP_NEG_MUL: "ALL x::real. exp x * exp (- x) = (1::real)"
+lemma EXP_NEG_MUL: "ALL x::real. exp x * exp (- x) = 1"
   by (import transc EXP_NEG_MUL)
 
-lemma EXP_NEG_MUL2: "ALL x::real. exp (- x) * exp x = (1::real)"
+lemma EXP_NEG_MUL2: "ALL x::real. exp (- x) * exp x = 1"
   by (import transc EXP_NEG_MUL2)
 
 lemma EXP_NEG: "ALL x::real. exp (- x) = inverse (exp x)"
@@ -4426,13 +4395,13 @@
 lemma EXP_ADD: "ALL (x::real) y::real. exp (x + y) = exp x * exp y"
   by (import transc EXP_ADD)
 
-lemma EXP_POS_LE: "ALL x::real. (0::real) <= exp x"
+lemma EXP_POS_LE: "ALL x::real. 0 <= exp x"
   by (import transc EXP_POS_LE)
 
-lemma EXP_NZ: "ALL x::real. exp x ~= (0::real)"
+lemma EXP_NZ: "ALL x::real. exp x ~= 0"
   by (import transc EXP_NZ)
 
-lemma EXP_POS_LT: "ALL x::real. (0::real) < exp x"
+lemma EXP_POS_LT: "ALL x::real. 0 < exp x"
   by (import transc EXP_POS_LT)
 
 lemma EXP_N: "ALL (n::nat) x::real. exp (real n * x) = exp x ^ n"
@@ -4459,10 +4428,10 @@
 lemma EXP_INJ: "ALL (x::real) y::real. (exp x = exp y) = (x = y)"
   by (import transc EXP_INJ)
 
-lemma EXP_TOTAL_LEMMA: "ALL y>=1::real. EX x>=0::real. x <= y - (1::real) & exp x = y"
+lemma EXP_TOTAL_LEMMA: "ALL y>=1. EX x>=0. x <= y - 1 & exp x = y"
   by (import transc EXP_TOTAL_LEMMA)
 
-lemma EXP_TOTAL: "ALL y>0::real. EX x::real. exp x = y"
+lemma EXP_TOTAL: "ALL y>0. EX x::real. exp x = y"
   by (import transc EXP_TOTAL)
 
 constdefs
@@ -4475,7 +4444,7 @@
 lemma LN_EXP: "ALL x::real. ln (exp x) = x"
   by (import transc LN_EXP)
 
-lemma EXP_LN: "ALL x::real. (exp (ln x) = x) = ((0::real) < x)"
+lemma EXP_LN: "ALL x::real. (exp (ln x) = x) = (0 < x)"
   by (import transc EXP_LN)
 
 lemma LN_MUL: "(All::(real => bool) => bool)
@@ -4506,10 +4475,10 @@
              ((op =::real => real => bool) x y))))"
   by (import transc LN_INJ)
 
-lemma LN_1: "ln (1::real) = (0::real)"
+lemma LN_1: "ln 1 = 0"
   by (import transc LN_1)
 
-lemma LN_INV: "ALL x>0::real. ln (inverse x) = - ln x"
+lemma LN_INV: "ALL x>0. ln (inverse x) = - ln x"
   by (import transc LN_INV)
 
 lemma LN_DIV: "(All::(real => bool) => bool)
@@ -4566,13 +4535,13 @@
                ((ln::real => real) x)))))"
   by (import transc LN_POW)
 
-lemma LN_LE: "ALL x>=0::real. ln ((1::real) + x) <= x"
+lemma LN_LE: "ALL x>=0. ln (1 + x) <= x"
   by (import transc LN_LE)
 
-lemma LN_LT_X: "ALL x>0::real. ln x < x"
+lemma LN_LT_X: "ALL x>0. ln x < x"
   by (import transc LN_LT_X)
 
-lemma LN_POS: "ALL x>=1::real. (0::real) <= ln x"
+lemma LN_POS: "ALL x>=1. 0 <= ln x"
   by (import transc LN_POS)
 
 constdefs
@@ -4606,9 +4575,9 @@
 
 constdefs
   sqrt :: "real => real" 
-  "sqrt == root (2::nat)"
-
-lemma sqrt: "ALL x::real. sqrt x = root (2::nat) x"
+  "sqrt == root 2"
+
+lemma sqrt: "ALL x::real. sqrt x = root 2 x"
   by (import transc sqrt)
 
 lemma ROOT_LT_LEMMA: "(All::(nat => bool) => bool)
@@ -4639,10 +4608,10 @@
                  ((real::nat => real) ((Suc::nat => nat) n)))))))"
   by (import transc ROOT_LN)
 
-lemma ROOT_0: "ALL n::nat. root (Suc n) (0::real) = (0::real)"
+lemma ROOT_0: "ALL n::nat. root (Suc n) 0 = 0"
   by (import transc ROOT_0)
 
-lemma ROOT_1: "ALL n::nat. root (Suc n) (1::real) = (1::real)"
+lemma ROOT_1: "ALL n::nat. root (Suc n) 1 = 1"
   by (import transc ROOT_1)
 
 lemma ROOT_POS_LT: "(All::(nat => bool) => bool)
@@ -4773,22 +4742,22 @@
              ((root::nat => real => real) ((Suc::nat => nat) n) y))))"
   by (import transc ROOT_MONO_LE)
 
-lemma SQRT_0: "sqrt (0::real) = (0::real)"
+lemma SQRT_0: "sqrt 0 = 0"
   by (import transc SQRT_0)
 
-lemma SQRT_1: "sqrt (1::real) = (1::real)"
+lemma SQRT_1: "sqrt 1 = 1"
   by (import transc SQRT_1)
 
-lemma SQRT_POS_LT: "ALL x>0::real. (0::real) < sqrt x"
+lemma SQRT_POS_LT: "ALL x>0. 0 < sqrt x"
   by (import transc SQRT_POS_LT)
 
-lemma SQRT_POS_LE: "ALL x>=0::real. (0::real) <= sqrt x"
+lemma SQRT_POS_LE: "ALL x>=0. 0 <= sqrt x"
   by (import transc SQRT_POS_LE)
 
-lemma SQRT_POW2: "ALL x::real. (sqrt x ^ 2 = x) = ((0::real) <= x)"
+lemma SQRT_POW2: "ALL x::real. (sqrt x ^ 2 = x) = (0 <= x)"
   by (import transc SQRT_POW2)
 
-lemma SQRT_POW_2: "ALL x>=0::real. sqrt x ^ 2 = x"
+lemma SQRT_POW_2: "ALL x>=0. sqrt x ^ 2 = x"
   by (import transc SQRT_POW_2)
 
 lemma POW_2_SQRT: "(op -->::bool => bool => bool)
@@ -4837,7 +4806,7 @@
                ((sqrt::real => real) xa)))))"
   by (import transc SQRT_MUL)
 
-lemma SQRT_INV: "ALL x>=0::real. sqrt (inverse x) = inverse (sqrt x)"
+lemma SQRT_INV: "ALL x>=0. sqrt (inverse x) = inverse (sqrt x)"
   by (import transc SQRT_INV)
 
 lemma SQRT_DIV: "(All::(real => bool) => bool)
@@ -4891,7 +4860,7 @@
                 (bit.B0::bit)))))))"
   by (import transc SQRT_EVEN_POW2)
 
-lemma REAL_DIV_SQRT: "ALL x>=0::real. x / sqrt x = sqrt x"
+lemma REAL_DIV_SQRT: "ALL x>=0. x / sqrt x = sqrt x"
   by (import transc REAL_DIV_SQRT)
 
 lemma SQRT_EQ: "(All::(real => bool) => bool)
@@ -4912,34 +4881,34 @@
            ((op =::real => real => bool) x ((sqrt::real => real) y))))"
   by (import transc SQRT_EQ)
 
-lemma SIN_0: "sin (0::real) = (0::real)"
+lemma SIN_0: "sin 0 = 0"
   by (import transc SIN_0)
 
-lemma COS_0: "cos (0::real) = (1::real)"
+lemma COS_0: "cos 0 = 1"
   by (import transc COS_0)
 
-lemma SIN_CIRCLE: "ALL x::real. sin x ^ 2 + cos x ^ 2 = (1::real)"
+lemma SIN_CIRCLE: "ALL x::real. sin x ^ 2 + cos x ^ 2 = 1"
   by (import transc SIN_CIRCLE)
 
-lemma SIN_BOUND: "ALL x::real. abs (sin x) <= (1::real)"
+lemma SIN_BOUND: "ALL x::real. abs (sin x) <= 1"
   by (import transc SIN_BOUND)
 
-lemma SIN_BOUNDS: "ALL x::real. - (1::real) <= sin x & sin x <= (1::real)"
+lemma SIN_BOUNDS: "ALL x::real. - 1 <= sin x & sin x <= 1"
   by (import transc SIN_BOUNDS)
 
-lemma COS_BOUND: "ALL x::real. abs (cos x) <= (1::real)"
+lemma COS_BOUND: "ALL x::real. abs (cos x) <= 1"
   by (import transc COS_BOUND)
 
-lemma COS_BOUNDS: "ALL x::real. - (1::real) <= cos x & cos x <= (1::real)"
+lemma COS_BOUNDS: "ALL x::real. - 1 <= cos x & cos x <= 1"
   by (import transc COS_BOUNDS)
 
 lemma SIN_COS_ADD: "ALL (x::real) y::real.
    (sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 +
    (cos (x + y) - (cos x * cos y - sin x * sin y)) ^ 2 =
-   (0::real)"
+   0"
   by (import transc SIN_COS_ADD)
 
-lemma SIN_COS_NEG: "ALL x::real. (sin (- x) + sin x) ^ 2 + (cos (- x) - cos x) ^ 2 = (0::real)"
+lemma SIN_COS_NEG: "ALL x::real. (sin (- x) + sin x) ^ 2 + (cos (- x) - cos x) ^ 2 = 0"
   by (import transc SIN_COS_NEG)
 
 lemma SIN_ADD: "ALL (x::real) y::real. sin (x + y) = sin x * cos y + cos x * sin y"
@@ -4954,17 +4923,14 @@
 lemma COS_NEG: "ALL x::real. cos (- x) = cos x"
   by (import transc COS_NEG)
 
-lemma SIN_DOUBLE: "ALL x::real. sin ((2::real) * x) = (2::real) * (sin x * cos x)"
+lemma SIN_DOUBLE: "ALL x::real. sin (2 * x) = 2 * (sin x * cos x)"
   by (import transc SIN_DOUBLE)
 
-lemma COS_DOUBLE: "ALL x::real. cos ((2::real) * x) = cos x ^ 2 - sin x ^ 2"
+lemma COS_DOUBLE: "ALL x::real. cos (2 * x) = cos x ^ 2 - sin x ^ 2"
   by (import transc COS_DOUBLE)
 
 lemma SIN_PAIRED: "ALL x::real.
-   sums
-    (%n::nat.
-        (- (1::real)) ^ n / real (FACT ((2::nat) * n + (1::nat))) *
-        x ^ ((2::nat) * n + (1::nat)))
+   sums (%n::nat. (- 1) ^ n / real (FACT (2 * n + 1)) * x ^ (2 * n + 1))
     (sin x)"
   by (import transc SIN_PAIRED)
 
@@ -4982,55 +4948,47 @@
   by (import transc SIN_POS)
 
 lemma COS_PAIRED: "ALL x::real.
-   sums
-    (%n::nat.
-        (- (1::real)) ^ n / real (FACT ((2::nat) * n)) * x ^ ((2::nat) * n))
-    (cos x)"
+   sums (%n::nat. (- 1) ^ n / real (FACT (2 * n)) * x ^ (2 * n)) (cos x)"
   by (import transc COS_PAIRED)
 
-lemma COS_2: "cos (2::real) < (0::real)"
+lemma COS_2: "cos 2 < 0"
   by (import transc COS_2)
 
-lemma COS_ISZERO: "EX! x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real)"
+lemma COS_ISZERO: "EX! x::real. 0 <= x & x <= 2 & cos x = 0"
   by (import transc COS_ISZERO)
 
 constdefs
   pi :: "real" 
-  "pi ==
-(2::real) *
-(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
-
-lemma pi: "pi =
-(2::real) *
-(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
+  "pi == 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
+
+lemma pi: "pi = 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
   by (import transc pi)
 
-lemma PI2: "pi / (2::real) =
-(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
+lemma PI2: "pi / 2 = (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
   by (import transc PI2)
 
-lemma COS_PI2: "cos (pi / (2::real)) = (0::real)"
+lemma COS_PI2: "cos (pi / 2) = 0"
   by (import transc COS_PI2)
 
-lemma PI2_BOUNDS: "(0::real) < pi / (2::real) & pi / (2::real) < (2::real)"
+lemma PI2_BOUNDS: "0 < pi / 2 & pi / 2 < 2"
   by (import transc PI2_BOUNDS)
 
-lemma PI_POS: "(0::real) < pi"
+lemma PI_POS: "0 < pi"
   by (import transc PI_POS)
 
-lemma SIN_PI2: "sin (pi / (2::real)) = (1::real)"
+lemma SIN_PI2: "sin (pi / 2) = 1"
   by (import transc SIN_PI2)
 
-lemma COS_PI: "cos pi = - (1::real)"
+lemma COS_PI: "cos pi = - 1"
   by (import transc COS_PI)
 
-lemma SIN_PI: "sin pi = (0::real)"
+lemma SIN_PI: "sin pi = 0"
   by (import transc SIN_PI)
 
-lemma SIN_COS: "ALL x::real. sin x = cos (pi / (2::real) - x)"
+lemma SIN_COS: "ALL x::real. sin x = cos (pi / 2 - x)"
   by (import transc SIN_COS)
 
-lemma COS_SIN: "ALL x::real. cos x = sin (pi / (2::real) - x)"
+lemma COS_SIN: "ALL x::real. cos x = sin (pi / 2 - x)"
   by (import transc COS_SIN)
 
 lemma SIN_PERIODIC_PI: "ALL x::real. sin (x + pi) = - sin x"
@@ -5039,16 +4997,16 @@
 lemma COS_PERIODIC_PI: "ALL x::real. cos (x + pi) = - cos x"
   by (import transc COS_PERIODIC_PI)
 
-lemma SIN_PERIODIC: "ALL x::real. sin (x + (2::real) * pi) = sin x"
+lemma SIN_PERIODIC: "ALL x::real. sin (x + 2 * pi) = sin x"
   by (import transc SIN_PERIODIC)
 
-lemma COS_PERIODIC: "ALL x::real. cos (x + (2::real) * pi) = cos x"
+lemma COS_PERIODIC: "ALL x::real. cos (x + 2 * pi) = cos x"
   by (import transc COS_PERIODIC)
 
-lemma COS_NPI: "ALL n::nat. cos (real n * pi) = (- (1::real)) ^ n"
+lemma COS_NPI: "ALL n::nat. cos (real n * pi) = (- 1) ^ n"
   by (import transc COS_NPI)
 
-lemma SIN_NPI: "ALL n::nat. sin (real n * pi) = (0::real)"
+lemma SIN_NPI: "ALL n::nat. sin (real n * pi) = 0"
   by (import transc SIN_NPI)
 
 lemma SIN_POS_PI2: "(All::(real => bool) => bool)
@@ -5259,15 +5217,15 @@
   by (import transc SIN_ZERO_LEMMA)
 
 lemma COS_ZERO: "ALL x::real.
-   (cos x = (0::real)) =
-   ((EX n::nat. ~ EVEN n & x = real n * (pi / (2::real))) |
-    (EX n::nat. ~ EVEN n & x = - (real n * (pi / (2::real)))))"
+   (cos x = 0) =
+   ((EX n::nat. ~ EVEN n & x = real n * (pi / 2)) |
+    (EX n::nat. ~ EVEN n & x = - (real n * (pi / 2))))"
   by (import transc COS_ZERO)
 
 lemma SIN_ZERO: "ALL x::real.
-   (sin x = (0::real)) =
-   ((EX n::nat. EVEN n & x = real n * (pi / (2::real))) |
-    (EX n::nat. EVEN n & x = - (real n * (pi / (2::real)))))"
+   (sin x = 0) =
+   ((EX n::nat. EVEN n & x = real n * (pi / 2)) |
+    (EX n::nat. EVEN n & x = - (real n * (pi / 2))))"
   by (import transc SIN_ZERO)
 
 constdefs
@@ -5277,19 +5235,19 @@
 lemma tan: "ALL x::real. tan x = sin x / cos x"
   by (import transc tan)
 
-lemma TAN_0: "tan (0::real) = (0::real)"
+lemma TAN_0: "tan 0 = 0"
   by (import transc TAN_0)
 
-lemma TAN_PI: "tan pi = (0::real)"
+lemma TAN_PI: "tan pi = 0"
   by (import transc TAN_PI)
 
-lemma TAN_NPI: "ALL n::nat. tan (real n * pi) = (0::real)"
+lemma TAN_NPI: "ALL n::nat. tan (real n * pi) = 0"
   by (import transc TAN_NPI)
 
 lemma TAN_NEG: "ALL x::real. tan (- x) = - tan x"
   by (import transc TAN_NEG)
 
-lemma TAN_PERIODIC: "ALL x::real. tan (x + (2::real) * pi) = tan x"
+lemma TAN_PERIODIC: "ALL x::real. tan (x + 2 * pi) = tan x"
   by (import transc TAN_PERIODIC)
 
 lemma TAN_ADD: "(All::(real => bool) => bool)
@@ -5393,43 +5351,35 @@
         x))"
   by (import transc DIFF_TAN)
 
-lemma TAN_TOTAL_LEMMA: "ALL y>0::real. EX x>0::real. x < pi / (2::real) & y < tan x"
+lemma TAN_TOTAL_LEMMA: "ALL y>0. EX x>0. x < pi / 2 & y < tan x"
   by (import transc TAN_TOTAL_LEMMA)
 
-lemma TAN_TOTAL_POS: "ALL y>=0::real. EX x>=0::real. x < pi / (2::real) & tan x = y"
+lemma TAN_TOTAL_POS: "ALL y>=0. EX x>=0. x < pi / 2 & tan x = y"
   by (import transc TAN_TOTAL_POS)
 
-lemma TAN_TOTAL: "ALL y::real.
-   EX! x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y"
+lemma TAN_TOTAL: "ALL y::real. EX! x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
   by (import transc TAN_TOTAL)
 
 constdefs
   asn :: "real => real" 
-  "asn ==
-%y::real.
-   SOME x::real. - (pi / (2::real)) <= x & x <= pi / (2::real) & sin x = y"
+  "asn == %y::real. SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y"
 
 lemma asn: "ALL y::real.
-   asn y =
-   (SOME x::real. - (pi / (2::real)) <= x & x <= pi / (2::real) & sin x = y)"
+   asn y = (SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y)"
   by (import transc asn)
 
 constdefs
   acs :: "real => real" 
-  "acs == %y::real. SOME x::real. (0::real) <= x & x <= pi & cos x = y"
-
-lemma acs: "ALL y::real. acs y = (SOME x::real. (0::real) <= x & x <= pi & cos x = y)"
+  "acs == %y::real. SOME x::real. 0 <= x & x <= pi & cos x = y"
+
+lemma acs: "ALL y::real. acs y = (SOME x::real. 0 <= x & x <= pi & cos x = y)"
   by (import transc acs)
 
 constdefs
   atn :: "real => real" 
-  "atn ==
-%y::real.
-   SOME x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y"
-
-lemma atn: "ALL y::real.
-   atn y =
-   (SOME x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y)"
+  "atn == %y::real. SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
+
+lemma atn: "ALL y::real. atn y = (SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y)"
   by (import transc atn)
 
 lemma ASN: "(All::(real => bool) => bool)
@@ -5600,14 +5550,13 @@
         ((acs::real => real) ((cos::real => real) x)) x))"
   by (import transc COS_ACS)
 
-lemma ATN: "ALL y::real.
-   - (pi / (2::real)) < atn y & atn y < pi / (2::real) & tan (atn y) = y"
+lemma ATN: "ALL y::real. - (pi / 2) < atn y & atn y < pi / 2 & tan (atn y) = y"
   by (import transc ATN)
 
 lemma ATN_TAN: "ALL x::real. tan (atn x) = x"
   by (import transc ATN_TAN)
 
-lemma ATN_BOUNDS: "ALL x::real. - (pi / (2::real)) < atn x & atn x < pi / (2::real)"
+lemma ATN_BOUNDS: "ALL x::real. - (pi / 2) < atn x & atn x < pi / 2"
   by (import transc ATN_BOUNDS)
 
 lemma TAN_ATN: "(All::(real => bool) => bool)
@@ -5703,7 +5652,7 @@
                   (bit.B0::bit))))))))"
   by (import transc COS_SIN_SQ)
 
-lemma COS_ATN_NZ: "ALL x::real. cos (atn x) ~= (0::real)"
+lemma COS_ATN_NZ: "ALL x::real. cos (atn x) ~= 0"
   by (import transc COS_ATN_NZ)
 
 lemma COS_ASN_NZ: "(All::(real => bool) => bool)
@@ -5758,7 +5707,7 @@
                   (bit.B0::bit))))))))"
   by (import transc SIN_COS_SQRT)
 
-lemma DIFF_LN: "ALL x>0::real. diffl ln (inverse x) x"
+lemma DIFF_LN: "ALL x>0. diffl ln (inverse x) x"
   by (import transc DIFF_LN)
 
 lemma DIFF_ASN_LEMMA: "(All::(real => bool) => bool)
@@ -5825,7 +5774,7 @@
         x))"
   by (import transc DIFF_ACS)
 
-lemma DIFF_ATN: "ALL x::real. diffl atn (inverse ((1::real) + x ^ 2)) x"
+lemma DIFF_ATN: "ALL x::real. diffl atn (inverse (1 + x ^ 2)) x"
   by (import transc DIFF_ATN)
 
 constdefs
@@ -6002,11 +5951,11 @@
   rsum :: "(nat => real) * (nat => real) => (real => real) => real" 
   "rsum ==
 %(D::nat => real, p::nat => real) f::real => real.
-   real.sum (0::nat, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
+   real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
 
 lemma rsum: "ALL (D::nat => real) (p::nat => real) f::real => real.
    rsum (D, p) f =
-   real.sum (0::nat, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
+   real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
   by (import transc rsum)
 
 constdefs
@@ -6519,7 +6468,7 @@
                           ((op =::real => real => bool) k1 k2))))))"
   by (import transc DINT_UNIQ)
 
-lemma INTEGRAL_NULL: "ALL (f::real => real) a::real. Dint (a, a) f (0::real)"
+lemma INTEGRAL_NULL: "ALL (f::real => real) a::real. Dint (a, a) f 0"
   by (import transc INTEGRAL_NULL)
 
 lemma FTC1: "(All::((real => real) => bool) => bool)
@@ -6795,7 +6744,7 @@
    EX xa::real.
       abs xa <= abs x &
       exp x =
-      real.sum (0::nat, n) (%m::nat. x ^ m / real (FACT m)) +
+      real.sum (0, n) (%m::nat. x ^ m / real (FACT m)) +
       exp xa / real (FACT n) * x ^ n"
   by (import transc MCLAURIN_EXP_LE)
 
@@ -6823,7 +6772,7 @@
 consts
   poly :: "real list => real => real" 
 
-specification (poly_primdef: poly) poly_def: "(ALL x::real. poly [] x = (0::real)) &
+specification (poly_primdef: poly) poly_def: "(ALL x::real. poly [] x = 0) &
 (ALL (h::real) (t::real list) x::real. poly (h # t) x = h + x * poly t x)"
   by (import poly poly_def)
 
@@ -6847,9 +6796,9 @@
   poly_neg :: "real list => real list" 
 
 defs
-  poly_neg_primdef: "poly_neg == ## (- (1::real))"
-
-lemma poly_neg_def: "poly_neg = ## (- (1::real))"
+  poly_neg_primdef: "poly_neg == ## (- 1)"
+
+lemma poly_neg_def: "poly_neg = ## (- 1)"
   by (import poly poly_neg_def)
 
 consts
@@ -6858,14 +6807,13 @@
 specification (poly_mul_primdef: poly_mul) poly_mul_def: "(ALL l2::real list. poly_mul [] l2 = []) &
 (ALL (h::real) (t::real list) l2::real list.
     poly_mul (h # t) l2 =
-    (if t = [] then ## h l2
-     else poly_add (## h l2) ((0::real) # poly_mul 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::real list. poly_exp p (0::nat) = [1::real]) &
+specification (poly_exp_primdef: poly_exp) poly_exp_def: "(ALL p::real list. poly_exp p 0 = [1]) &
 (ALL (p::real list) n::nat. poly_exp p (Suc n) = poly_mul p (poly_exp p n))"
   by (import poly poly_exp_def)
 
@@ -6879,10 +6827,9 @@
 
 constdefs
   diff :: "real list => real list" 
-  "diff == %l::real list. if l = [] then [] else poly_diff_aux (1::nat) (tl l)"
-
-lemma poly_diff_def: "ALL l::real list.
-   diff l = (if l = [] then [] else poly_diff_aux (1::nat) (tl l))"
+  "diff == %l::real list. if l = [] then [] else poly_diff_aux 1 (tl l)"
+
+lemma poly_diff_def: "ALL l::real list. 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::real list) = p2 &
@@ -6900,12 +6847,11 @@
 lemma POLY_MUL_CLAUSES: "poly_mul [] (p2::real list) = [] &
 poly_mul [h1::real] p2 = ## h1 p2 &
 poly_mul (h1 # (k1::real) # (t1::real list)) p2 =
-poly_add (## h1 p2) ((0::real) # poly_mul (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::real] = [] &
-diff ((h::real) # (t::real list)) = poly_diff_aux (1::nat) t"
+diff [c::real] = [] & diff ((h::real) # (t::real list)) = poly_diff_aux 1 t"
   by (import poly POLY_DIFF_CLAUSES)
 
 lemma POLY_ADD: "ALL (t::real list) (p2::real list) x::real.
@@ -7054,7 +7000,7 @@
   by (import poly POLY_DIFF_NEG)
 
 lemma POLY_DIFF_MUL_LEMMA: "ALL (x::real list) xa::real.
-   poly (diff (xa # x)) = poly (poly_add ((0::real) # diff x) x)"
+   poly (diff (xa # x)) = poly (poly_add (0 # diff x) x)"
   by (import poly POLY_DIFF_MUL_LEMMA)
 
 lemma POLY_DIFF_MUL: "ALL (t::real list) p2::real list.
@@ -7068,22 +7014,20 @@
   by (import poly POLY_DIFF_EXP)
 
 lemma POLY_DIFF_EXP_PRIME: "ALL (n::nat) a::real.
-   poly (diff (poly_exp [- a, 1::real] (Suc n))) =
-   poly (## (real (Suc n)) (poly_exp [- a, 1::real] n))"
+   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: "ALL (t::real list) h::real.
    EX (q::real list) r::real.
-      h # t = poly_add [r] (poly_mul [- (a::real), 1::real] q)"
+      h # t = poly_add [r] (poly_mul [- (a::real), 1] q)"
   by (import poly POLY_LINEAR_REM)
 
 lemma POLY_LINEAR_DIVIDES: "ALL (a::real) t::real list.
-   (poly t a = (0::real)) =
-   (t = [] | (EX q::real list. t = poly_mul [- a, 1::real] q))"
+   (poly t a = 0) = (t = [] | (EX q::real list. t = poly_mul [- a, 1] q))"
   by (import poly POLY_LINEAR_DIVIDES)
 
-lemma POLY_LENGTH_MUL: "ALL x::real list.
-   length (poly_mul [- (a::real), 1::real] x) = Suc (length x)"
+lemma POLY_LENGTH_MUL: "ALL x::real list. length (poly_mul [- (a::real), 1] x) = Suc (length x)"
   by (import poly POLY_LENGTH_MUL)
 
 lemma POLY_ROOTS_INDEX_LEMMA: "(All::(nat => bool) => bool)
@@ -7233,13 +7177,13 @@
   by (import poly POLY_MUL_LCANCEL)
 
 lemma POLY_EXP_EQ_0: "ALL (p::real list) n::nat.
-   (poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= (0::nat))"
+   (poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= 0)"
   by (import poly POLY_EXP_EQ_0)
 
-lemma POLY_PRIME_EQ_0: "ALL a::real. poly [a, 1::real] ~= poly []"
+lemma POLY_PRIME_EQ_0: "ALL a::real. poly [a, 1] ~= poly []"
   by (import poly POLY_PRIME_EQ_0)
 
-lemma POLY_EXP_PRIME_EQ_0: "ALL (a::real) n::nat. poly (poly_exp [a, 1::real] n) ~= poly []"
+lemma POLY_EXP_PRIME_EQ_0: "ALL (a::real) n::nat. poly (poly_exp [a, 1] n) ~= poly []"
   by (import poly POLY_EXP_PRIME_EQ_0)
 
 lemma POLY_ZERO_LEMMA: "(All::(real => bool) => bool)
@@ -7258,12 +7202,12 @@
                ((poly::real list => real => real) ([]::real list))))))"
   by (import poly POLY_ZERO_LEMMA)
 
-lemma POLY_ZERO: "ALL t::real list. (poly t = poly []) = list_all (%c::real. c = (0::real)) t"
+lemma POLY_ZERO: "ALL t::real list. (poly t = poly []) = list_all (%c::real. c = 0) t"
   by (import poly POLY_ZERO)
 
 lemma POLY_DIFF_AUX_ISZERO: "ALL (t::real list) n::nat.
-   list_all (%c::real. c = (0::real)) (poly_diff_aux (Suc n) t) =
-   list_all (%c::real. c = (0::real)) t"
+   list_all (%c::real. c = 0) (poly_diff_aux (Suc n) t) =
+   list_all (%c::real. c = 0) t"
   by (import poly POLY_DIFF_AUX_ISZERO)
 
 lemma POLY_DIFF_ISZERO: "(All::(real list => bool) => bool)
@@ -7320,8 +7264,8 @@
   by (import poly poly_divides)
 
 lemma POLY_PRIMES: "ALL (a::real) (p::real list) q::real list.
-   poly_divides [a, 1::real] (poly_mul p q) =
-   (poly_divides [a, 1::real] p | poly_divides [a, 1::real] q)"
+   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: "ALL p::real list. poly_divides p p"
@@ -7496,19 +7440,19 @@
   "poly_order ==
 %(a::real) p::real list.
    SOME n::nat.
-      poly_divides (poly_exp [- a, 1::real] n) p &
-      ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p"
+      poly_divides (poly_exp [- a, 1] n) p &
+      ~ poly_divides (poly_exp [- a, 1] (Suc n)) p"
 
 lemma poly_order: "ALL (a::real) p::real list.
    poly_order a p =
    (SOME n::nat.
-       poly_divides (poly_exp [- a, 1::real] n) p &
-       ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p)"
+       poly_divides (poly_exp [- a, 1] n) p &
+       ~ poly_divides (poly_exp [- a, 1] (Suc n)) p)"
   by (import poly poly_order)
 
 lemma ORDER: "ALL (p::real list) (a::real) n::nat.
-   (poly_divides (poly_exp [- a, 1::real] n) p &
-    ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p) =
+   (poly_divides (poly_exp [- a, 1] n) p &
+    ~ poly_divides (poly_exp [- a, 1] (Suc n)) p) =
    (n = poly_order a p & poly p ~= poly [])"
   by (import poly ORDER)
 
@@ -7592,11 +7536,11 @@
   by (import poly ORDER_POLY)
 
 lemma ORDER_ROOT: "ALL (p::real list) a::real.
-   (poly p a = (0::real)) = (poly p = poly [] | poly_order a p ~= (0::nat))"
+   (poly p a = 0) = (poly p = poly [] | poly_order a p ~= 0)"
   by (import poly ORDER_ROOT)
 
 lemma ORDER_DIVIDES: "ALL (p::real list) (a::real) n::nat.
-   poly_divides (poly_exp [- a, 1::real] n) p =
+   poly_divides (poly_exp [- a, 1] n) p =
    (poly p = poly [] | n <= poly_order a p)"
   by (import poly ORDER_DIVIDES)
 
@@ -7729,17 +7673,16 @@
   "rsquarefree ==
 %p::real list.
    poly p ~= poly [] &
-   (ALL a::real. poly_order a p = (0::nat) | poly_order a p = (1::nat))"
+   (ALL a::real. poly_order a p = 0 | poly_order a p = 1)"
 
 lemma rsquarefree: "ALL p::real list.
    rsquarefree p =
    (poly p ~= poly [] &
-    (ALL a::real. poly_order a p = (0::nat) | poly_order a p = (1::nat)))"
+    (ALL a::real. poly_order a p = 0 | poly_order a p = 1))"
   by (import poly rsquarefree)
 
 lemma RSQUAREFREE_ROOTS: "ALL p::real list.
-   rsquarefree p =
-   (ALL a::real. ~ (poly p a = (0::real) & poly (diff p) a = (0::real)))"
+   rsquarefree p = (ALL a::real. ~ (poly p a = 0 & poly (diff p) a = 0))"
   by (import poly RSQUAREFREE_ROOTS)
 
 lemma RSQUAREFREE_DECOMP: "(All::(real list => bool) => bool)
@@ -7827,7 +7770,7 @@
 specification (normalize) normalize: "normalize [] = [] &
 (ALL (h::real) t::real list.
     normalize (h # t) =
-    (if normalize t = [] then if h = (0::real) then [] else [h]
+    (if normalize t = [] then if h = 0 then [] else [h]
      else h # normalize t))"
   by (import poly normalize)
 
--- a/src/HOL/Import/HOL/HOL4Vec.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/HOL4Vec.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -142,50 +142,47 @@
 lemmas word_TY_DEF = typedef_hol2hol4 [OF type_definition_word]
 
 consts
-  mk_word :: "'a::type list recspace => 'a::type word" 
-  dest_word :: "'a::type word => 'a::type list recspace" 
+  mk_word :: "'a list recspace => 'a word" 
+  dest_word :: "'a word => 'a list recspace" 
 
 specification (dest_word mk_word) word_repfns: "(ALL a::'a::type word. mk_word (dest_word a) = a) &
 (ALL r::'a::type list recspace.
     (ALL word::'a::type list recspace => bool.
         (ALL a0::'a::type list recspace.
-            (EX a::'a::type list.
-                a0 = CONSTR (0::nat) a (%n::nat. BOTTOM)) -->
+            (EX a::'a::type list. a0 = CONSTR 0 a (%n::nat. BOTTOM)) -->
             word a0) -->
         word r) =
     (dest_word (mk_word r) = r))"
   by (import word_base word_repfns)
 
 consts
-  word_base0 :: "'a::type list => 'a::type word" 
+  word_base0 :: "'a list => 'a word" 
 
 defs
-  word_base0_primdef: "word_base0 ==
-%a::'a::type list. mk_word (CONSTR (0::nat) a (%n::nat. BOTTOM))"
+  word_base0_primdef: "word_base0 == %a::'a::type list. mk_word (CONSTR 0 a (%n::nat. BOTTOM))"
 
-lemma word_base0_def: "word_base0 =
-(%a::'a::type list. mk_word (CONSTR (0::nat) a (%n::nat. BOTTOM)))"
+lemma word_base0_def: "word_base0 = (%a::'a::type list. mk_word (CONSTR 0 a (%n::nat. BOTTOM)))"
   by (import word_base word_base0_def)
 
 constdefs
-  WORD :: "'a::type list => 'a::type word" 
+  WORD :: "'a list => 'a word" 
   "WORD == word_base0"
 
 lemma WORD: "WORD = word_base0"
   by (import word_base WORD)
 
 consts
-  word_case :: "('a::type list => 'b::type) => 'a::type word => 'b::type" 
+  word_case :: "('a list => 'b) => 'a word => 'b" 
 
 specification (word_case_primdef: word_case) word_case_def: "ALL (f::'a::type list => 'b::type) a::'a::type list.
    word_case f (WORD a) = f a"
   by (import word_base word_case_def)
 
 consts
-  word_size :: "('a::type => nat) => 'a::type word => nat" 
+  word_size :: "('a => nat) => 'a word => nat" 
 
 specification (word_size_primdef: word_size) word_size_def: "ALL (f::'a::type => nat) a::'a::type list.
-   word_size f (WORD a) = (1::nat) + list_size f a"
+   word_size f (WORD a) = 1 + list_size f a"
   by (import word_base word_size_def)
 
 lemma word_11: "ALL (a::'a::type list) a'::'a::type list. (WORD a = WORD a') = (a = a')"
@@ -222,13 +219,13 @@
   by (import word_base word_cases)
 
 consts
-  WORDLEN :: "'a::type word => nat" 
+  WORDLEN :: "'a word => nat" 
 
 specification (WORDLEN) WORDLEN_DEF: "ALL l::'a::type list. WORDLEN (WORD l) = length l"
   by (import word_base WORDLEN_DEF)
 
 consts
-  PWORDLEN :: "nat => 'a::type word => bool" 
+  PWORDLEN :: "nat => 'a word => bool" 
 
 defs
   PWORDLEN_primdef: "PWORDLEN == %n::nat. GSPEC (%w::'a::type word. (w, WORDLEN w = n))"
@@ -242,20 +239,20 @@
 lemma PWORDLEN: "ALL (n::nat) w::'a::type word. IN w (PWORDLEN n) = (WORDLEN w = n)"
   by (import word_base PWORDLEN)
 
-lemma PWORDLEN0: "ALL w::'a::type word. IN w (PWORDLEN (0::nat)) --> w = WORD []"
+lemma PWORDLEN0: "ALL w::'a::type word. IN w (PWORDLEN 0) --> w = WORD []"
   by (import word_base PWORDLEN0)
 
-lemma PWORDLEN1: "ALL x::'a::type. IN (WORD [x]) (PWORDLEN (1::nat))"
+lemma PWORDLEN1: "ALL x::'a::type. IN (WORD [x]) (PWORDLEN 1)"
   by (import word_base PWORDLEN1)
 
 consts
-  WSEG :: "nat => nat => 'a::type word => 'a::type word" 
+  WSEG :: "nat => nat => 'a word => 'a word" 
 
 specification (WSEG) WSEG_DEF: "ALL (m::nat) (k::nat) l::'a::type list.
    WSEG m k (WORD l) = WORD (LASTN m (BUTLASTN k l))"
   by (import word_base WSEG_DEF)
 
-lemma WSEG0: "ALL (k::nat) w::'a::type word. WSEG (0::nat) k w = WORD []"
+lemma WSEG0: "ALL (k::nat) w::'a::type word. WSEG 0 k w = WORD []"
   by (import word_base WSEG0)
 
 lemma WSEG_PWORDLEN: "ALL n::nat.
@@ -271,17 +268,16 @@
            xb + xc <= x --> WORDLEN (WSEG xb xc xa) = xb)"
   by (import word_base WSEG_WORDLEN)
 
-lemma WSEG_WORD_LENGTH: "ALL n::nat.
-   RES_FORALL (PWORDLEN n) (%w::'a::type word. WSEG n (0::nat) w = w)"
+lemma WSEG_WORD_LENGTH: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::'a::type word. WSEG n 0 w = w)"
   by (import word_base WSEG_WORD_LENGTH)
 
 consts
-  bit :: "nat => 'a::type word => 'a::type" 
+  bit :: "nat => 'a word => 'a" 
 
 specification (bit) BIT_DEF: "ALL (k::nat) l::'a::type list. bit k (WORD l) = ELL k l"
   by (import word_base BIT_DEF)
 
-lemma BIT0: "ALL x::'a::type. bit (0::nat) (WORD [x]) = x"
+lemma BIT0: "ALL x::'a::type. bit 0 (WORD [x]) = x"
   by (import word_base BIT0)
 
 lemma WSEG_BIT: "(All::(nat => bool) => bool)
@@ -311,36 +307,35 @@
   by (import word_base BIT_WSEG)
 
 consts
-  MSB :: "'a::type word => 'a::type" 
+  MSB :: "'a word => 'a" 
 
 specification (MSB) MSB_DEF: "ALL l::'a::type list. MSB (WORD l) = hd l"
   by (import word_base MSB_DEF)
 
 lemma MSB: "ALL n::nat.
    RES_FORALL (PWORDLEN n)
-    (%w::'a::type word. (0::nat) < n --> MSB w = bit (PRE n) w)"
+    (%w::'a::type word. 0 < n --> MSB w = bit (PRE n) w)"
   by (import word_base MSB)
 
 consts
-  LSB :: "'a::type word => 'a::type" 
+  LSB :: "'a word => 'a" 
 
 specification (LSB) LSB_DEF: "ALL l::'a::type list. LSB (WORD l) = last l"
   by (import word_base LSB_DEF)
 
 lemma LSB: "ALL n::nat.
-   RES_FORALL (PWORDLEN n)
-    (%w::'a::type word. (0::nat) < n --> LSB w = bit (0::nat) w)"
+   RES_FORALL (PWORDLEN n) (%w::'a::type word. 0 < n --> LSB w = bit 0 w)"
   by (import word_base LSB)
 
 consts
-  WSPLIT :: "nat => 'a::type word => 'a::type word * 'a::type word" 
+  WSPLIT :: "nat => 'a word => 'a word * 'a word" 
 
 specification (WSPLIT) WSPLIT_DEF: "ALL (m::nat) l::'a::type list.
    WSPLIT m (WORD l) = (WORD (BUTLASTN m l), WORD (LASTN m l))"
   by (import word_base WSPLIT_DEF)
 
 consts
-  WCAT :: "'a::type word * 'a::type word => 'a::type word" 
+  WCAT :: "'a word * 'a word => 'a word" 
 
 specification (WCAT) WCAT_DEF: "ALL (l1::'a::type list) l2::'a::type list.
    WCAT (WORD l1, WORD l2) = WORD (l1 @ l2)"
@@ -451,7 +446,7 @@
 
 lemma WORDLEN_SUC_WCAT: "ALL (n::nat) w::'a::type word.
    IN w (PWORDLEN (Suc n)) -->
-   RES_EXISTS (PWORDLEN (1::nat))
+   RES_EXISTS (PWORDLEN 1)
     (%b::'a::type word.
         RES_EXISTS (PWORDLEN n) (%w'::'a::type word. w = WCAT (b, w')))"
   by (import word_base WORDLEN_SUC_WCAT)
@@ -538,25 +533,25 @@
 
 lemma WORD_SPLIT: "ALL (x::nat) xa::nat.
    RES_FORALL (PWORDLEN (x + xa))
-    (%w::'a::type word. w = WCAT (WSEG x xa w, WSEG xa (0::nat) w))"
+    (%w::'a::type word. w = WCAT (WSEG x xa w, WSEG xa 0 w))"
   by (import word_base WORD_SPLIT)
 
 lemma WORDLEN_SUC_WCAT_WSEG_WSEG: "RES_FORALL (PWORDLEN (Suc (n::nat)))
- (%w::'a::type word. w = WCAT (WSEG (1::nat) n w, WSEG n (0::nat) w))"
+ (%w::'a::type word. w = WCAT (WSEG 1 n w, WSEG n 0 w))"
   by (import word_base WORDLEN_SUC_WCAT_WSEG_WSEG)
 
 lemma WORDLEN_SUC_WCAT_WSEG_WSEG_RIGHT: "RES_FORALL (PWORDLEN (Suc (n::nat)))
- (%w::'a::type word. w = WCAT (WSEG n (1::nat) w, WSEG (1::nat) (0::nat) w))"
+ (%w::'a::type word. w = WCAT (WSEG n 1 w, WSEG 1 0 w))"
   by (import word_base WORDLEN_SUC_WCAT_WSEG_WSEG_RIGHT)
 
 lemma WORDLEN_SUC_WCAT_BIT_WSEG: "ALL n::nat.
    RES_FORALL (PWORDLEN (Suc n))
-    (%w::'a::type word. w = WCAT (WORD [bit n w], WSEG n (0::nat) w))"
+    (%w::'a::type word. w = WCAT (WORD [bit n w], WSEG n 0 w))"
   by (import word_base WORDLEN_SUC_WCAT_BIT_WSEG)
 
 lemma WORDLEN_SUC_WCAT_BIT_WSEG_RIGHT: "ALL n::nat.
    RES_FORALL (PWORDLEN (Suc n))
-    (%w::'a::type word. w = WCAT (WSEG n (1::nat) w, WORD [bit (0::nat) w]))"
+    (%w::'a::type word. w = WCAT (WSEG n 1 w, WORD [bit 0 w]))"
   by (import word_base WORDLEN_SUC_WCAT_BIT_WSEG_RIGHT)
 
 lemma WSEG_WCAT1: "ALL (n1::nat) n2::nat.
@@ -570,7 +565,7 @@
    RES_FORALL (PWORDLEN n1)
     (%w1::'a::type word.
         RES_FORALL (PWORDLEN n2)
-         (%w2::'a::type word. WSEG n2 (0::nat) (WCAT (w1, w2)) = w2))"
+         (%w2::'a::type word. WSEG n2 0 (WCAT (w1, w2)) = w2))"
   by (import word_base WSEG_WCAT2)
 
 lemma WSEG_SUC: "ALL n::nat.
@@ -578,7 +573,7 @@
     (%w::'a::type word.
         ALL (k::nat) m1::nat.
            k + Suc m1 < n -->
-           WSEG (Suc m1) k w = WCAT (WSEG (1::nat) (k + m1) w, WSEG m1 k w))"
+           WSEG (Suc m1) k w = WCAT (WSEG 1 (k + m1) w, WSEG m1 k w))"
   by (import word_base WSEG_SUC)
 
 lemma WORD_CONS_WCAT: "ALL (x::'a::type) l::'a::type list. WORD (x # l) = WCAT (WORD [x], WORD l)"
@@ -657,7 +652,7 @@
              ALL (m::nat) k::nat.
                 m + k <= n1 + n2 & k < n2 & n2 <= m + k -->
                 WSEG m k (WCAT (w1, w2)) =
-                WCAT (WSEG (m + k - n2) (0::nat) w1, WSEG (n2 - k) k w2)))"
+                WCAT (WSEG (m + k - n2) 0 w1, WSEG (n2 - k) k w2)))"
   by (import word_base WSEG_WCAT_WSEG)
 
 lemma BIT_EQ_IMP_WORD_EQ: "(All::(nat => bool) => bool)
@@ -686,23 +681,22 @@
 ;setup_theory word_num
 
 constdefs
-  LVAL :: "('a::type => nat) => nat => 'a::type list => nat" 
+  LVAL :: "('a => nat) => nat => 'a list => nat" 
   "LVAL ==
-%(f::'a::type => nat) b::nat.
-   foldl (%(e::nat) x::'a::type. b * e + f x) (0::nat)"
+%(f::'a::type => nat) b::nat. foldl (%(e::nat) x::'a::type. b * e + f x) 0"
 
 lemma LVAL_DEF: "ALL (f::'a::type => nat) (b::nat) l::'a::type list.
-   LVAL f b l = foldl (%(e::nat) x::'a::type. b * e + f x) (0::nat) l"
+   LVAL f b l = foldl (%(e::nat) x::'a::type. b * e + f x) 0 l"
   by (import word_num LVAL_DEF)
 
 consts
-  NVAL :: "('a::type => nat) => nat => 'a::type word => nat" 
+  NVAL :: "('a => nat) => nat => 'a word => nat" 
 
 specification (NVAL) NVAL_DEF: "ALL (f::'a::type => nat) (b::nat) l::'a::type list.
    NVAL f b (WORD l) = LVAL f b l"
   by (import word_num NVAL_DEF)
 
-lemma LVAL: "(ALL (x::'a::type => nat) xa::nat. LVAL x xa [] = (0::nat)) &
+lemma LVAL: "(ALL (x::'a::type => nat) xa::nat. LVAL x xa [] = 0) &
 (ALL (x::'a::type list) (xa::'a::type => nat) (xb::nat) xc::'a::type.
     LVAL xa xb (xc # x) = xa xc * xb ^ length x + LVAL xa xb x)"
   by (import word_num LVAL)
@@ -721,16 +715,15 @@
        RES_FORALL (PWORDLEN n) (%w::'a::type word. NVAL f b w < b ^ n))"
   by (import word_num NVAL_MAX)
 
-lemma NVAL0: "ALL (x::'a::type => nat) xa::nat. NVAL x xa (WORD []) = (0::nat)"
+lemma NVAL0: "ALL (x::'a::type => nat) xa::nat. NVAL x xa (WORD []) = 0"
   by (import word_num NVAL0)
 
 lemma NVAL1: "ALL (x::'a::type => nat) (xa::nat) xb::'a::type.
    NVAL x xa (WORD [xb]) = x xb"
   by (import word_num NVAL1)
 
-lemma NVAL_WORDLEN_0: "RES_FORALL (PWORDLEN (0::nat))
- (%w::'a::type word.
-     ALL (fv::'a::type => nat) r::nat. NVAL fv r w = (0::nat))"
+lemma NVAL_WORDLEN_0: "RES_FORALL (PWORDLEN 0)
+ (%w::'a::type word. ALL (fv::'a::type => nat) r::nat. NVAL fv r w = 0)"
   by (import word_num NVAL_WORDLEN_0)
 
 lemma NVAL_WCAT1: "ALL (w::'a::type word) (f::'a::type => nat) (b::nat) x::'a::type.
@@ -755,17 +748,16 @@
   by (import word_num NVAL_WCAT)
 
 consts
-  NLIST :: "nat => (nat => 'a::type) => nat => nat => 'a::type list" 
+  NLIST :: "nat => (nat => 'a) => nat => nat => 'a list" 
 
-specification (NLIST) NLIST_DEF: "(ALL (frep::nat => 'a::type) (b::nat) m::nat.
-    NLIST (0::nat) frep b m = []) &
+specification (NLIST) NLIST_DEF: "(ALL (frep::nat => 'a::type) (b::nat) m::nat. NLIST 0 frep b m = []) &
 (ALL (n::nat) (frep::nat => 'a::type) (b::nat) m::nat.
     NLIST (Suc n) frep b m =
     SNOC (frep (m mod b)) (NLIST n frep b (m div b)))"
   by (import word_num NLIST_DEF)
 
 constdefs
-  NWORD :: "nat => (nat => 'a::type) => nat => nat => 'a::type word" 
+  NWORD :: "nat => (nat => 'a) => nat => nat => 'a word" 
   "NWORD ==
 %(n::nat) (frep::nat => 'a::type) (b::nat) m::nat. WORD (NLIST n frep b m)"
 
@@ -786,7 +778,7 @@
 ;setup_theory word_bitop
 
 consts
-  PBITOP :: "('a::type word => 'b::type word) => bool" 
+  PBITOP :: "('a word => 'b word) => bool" 
 
 defs
   PBITOP_primdef: "PBITOP ==
@@ -867,7 +859,7 @@
   by (import word_bitop PBITOP_BIT)
 
 consts
-  PBITBOP :: "('a::type word => 'b::type word => 'c::type word) => bool" 
+  PBITBOP :: "('a word => 'b word => 'c word) => bool" 
 
 defs
   PBITBOP_primdef: "PBITBOP ==
@@ -944,7 +936,7 @@
   by (import word_bitop PBITBOP_EXISTS)
 
 consts
-  WMAP :: "('a::type => 'b::type) => 'a::type word => 'b::type word" 
+  WMAP :: "('a => 'b) => 'a word => 'b word" 
 
 specification (WMAP) WMAP_DEF: "ALL (f::'a::type => 'b::type) l::'a::type list.
    WMAP f (WORD l) = WORD (map f l)"
@@ -1000,7 +992,7 @@
   by (import word_bitop WMAP_o)
 
 consts
-  FORALLBITS :: "('a::type => bool) => 'a::type word => bool" 
+  FORALLBITS :: "('a => bool) => 'a word => bool" 
 
 specification (FORALLBITS) FORALLBITS_DEF: "ALL (P::'a::type => bool) l::'a::type list.
    FORALLBITS P (WORD l) = list_all P l"
@@ -1038,7 +1030,7 @@
   by (import word_bitop FORALLBITS_WCAT)
 
 consts
-  EXISTSABIT :: "('a::type => bool) => 'a::type word => bool" 
+  EXISTSABIT :: "('a => bool) => 'a word => bool" 
 
 specification (EXISTSABIT) EXISTSABIT_DEF: "ALL (P::'a::type => bool) l::'a::type list.
    EXISTSABIT P (WORD l) = list_exists P l"
@@ -1085,37 +1077,33 @@
   by (import word_bitop EXISTSABIT_WCAT)
 
 constdefs
-  SHR :: "bool => 'a::type => 'a::type word => 'a::type word * 'a::type" 
+  SHR :: "bool => 'a => 'a word => 'a word * 'a" 
   "SHR ==
 %(f::bool) (b::'a::type) w::'a::type word.
    (WCAT
-     (if f then WSEG (1::nat) (PRE (WORDLEN w)) w else WORD [b],
-      WSEG (PRE (WORDLEN w)) (1::nat) w),
-    bit (0::nat) w)"
+     (if f then WSEG 1 (PRE (WORDLEN w)) w else WORD [b],
+      WSEG (PRE (WORDLEN w)) 1 w),
+    bit 0 w)"
 
 lemma SHR_DEF: "ALL (f::bool) (b::'a::type) w::'a::type word.
    SHR f b w =
    (WCAT
-     (if f then WSEG (1::nat) (PRE (WORDLEN w)) w else WORD [b],
-      WSEG (PRE (WORDLEN w)) (1::nat) w),
-    bit (0::nat) w)"
+     (if f then WSEG 1 (PRE (WORDLEN w)) w else WORD [b],
+      WSEG (PRE (WORDLEN w)) 1 w),
+    bit 0 w)"
   by (import word_bitop SHR_DEF)
 
 constdefs
-  SHL :: "bool => 'a::type word => 'a::type => 'a::type * 'a::type word" 
+  SHL :: "bool => 'a word => 'a => 'a * 'a word" 
   "SHL ==
 %(f::bool) (w::'a::type word) b::'a::type.
    (bit (PRE (WORDLEN w)) w,
-    WCAT
-     (WSEG (PRE (WORDLEN w)) (0::nat) w,
-      if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
+    WCAT (WSEG (PRE (WORDLEN w)) 0 w, if f then WSEG 1 0 w else WORD [b]))"
 
 lemma SHL_DEF: "ALL (f::bool) (w::'a::type word) b::'a::type.
    SHL f w b =
    (bit (PRE (WORDLEN w)) w,
-    WCAT
-     (WSEG (PRE (WORDLEN w)) (0::nat) w,
-      if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
+    WCAT (WSEG (PRE (WORDLEN w)) 0 w, if f then WSEG 1 0 w else WORD [b]))"
   by (import word_bitop SHL_DEF)
 
 lemma SHR_WSEG: "ALL n::nat.
@@ -1123,14 +1111,12 @@
     (%w::'a::type word.
         ALL (m::nat) k::nat.
            m + k <= n -->
-           (0::nat) < m -->
+           0 < m -->
            (ALL (f::bool) b::'a::type.
                SHR f b (WSEG m k w) =
                (if f
-                then WCAT
-                      (WSEG (1::nat) (k + (m - (1::nat))) w,
-                       WSEG (m - (1::nat)) (k + (1::nat)) w)
-                else WCAT (WORD [b], WSEG (m - (1::nat)) (k + (1::nat)) w),
+                then WCAT (WSEG 1 (k + (m - 1)) w, WSEG (m - 1) (k + 1) w)
+                else WCAT (WORD [b], WSEG (m - 1) (k + 1) w),
                 bit k w)))"
   by (import word_bitop SHR_WSEG)
 
@@ -1139,9 +1125,9 @@
     (%w::'a::type word.
         ALL (b::'a::type) (m::nat) k::nat.
            m + k <= n -->
-           (0::nat) < m -->
+           0 < m -->
            SHR False b (WSEG m k w) =
-           (WCAT (WORD [b], WSEG (m - (1::nat)) (k + (1::nat)) w), bit k w))"
+           (WCAT (WORD [b], WSEG (m - 1) (k + 1) w), bit k w))"
   by (import word_bitop SHR_WSEG_1F)
 
 lemma SHR_WSEG_NF: "ALL n::nat.
@@ -1149,9 +1135,9 @@
     (%w::'a::type word.
         ALL (m::nat) k::nat.
            m + k < n -->
-           (0::nat) < m -->
+           0 < m -->
            SHR False (bit (m + k) w) (WSEG m k w) =
-           (WSEG m (k + (1::nat)) w, bit k w))"
+           (WSEG m (k + 1) w, bit k w))"
   by (import word_bitop SHR_WSEG_NF)
 
 lemma SHL_WSEG: "ALL n::nat.
@@ -1159,12 +1145,12 @@
     (%w::'a::type word.
         ALL (m::nat) k::nat.
            m + k <= n -->
-           (0::nat) < m -->
+           0 < m -->
            (ALL (f::bool) b::'a::type.
                SHL f (WSEG m k w) b =
-               (bit (k + (m - (1::nat))) w,
-                if f then WCAT (WSEG (m - (1::nat)) k w, WSEG (1::nat) k w)
-                else WCAT (WSEG (m - (1::nat)) k w, WORD [b]))))"
+               (bit (k + (m - 1)) w,
+                if f then WCAT (WSEG (m - 1) k w, WSEG 1 k w)
+                else WCAT (WSEG (m - 1) k w, WORD [b]))))"
   by (import word_bitop SHL_WSEG)
 
 lemma SHL_WSEG_1F: "ALL n::nat.
@@ -1172,10 +1158,9 @@
     (%w::'a::type word.
         ALL (b::'a::type) (m::nat) k::nat.
            m + k <= n -->
-           (0::nat) < m -->
+           0 < m -->
            SHL False (WSEG m k w) b =
-           (bit (k + (m - (1::nat))) w,
-            WCAT (WSEG (m - (1::nat)) k w, WORD [b])))"
+           (bit (k + (m - 1)) w, WCAT (WSEG (m - 1) k w, WORD [b])))"
   by (import word_bitop SHL_WSEG_1F)
 
 lemma SHL_WSEG_NF: "ALL n::nat.
@@ -1183,31 +1168,28 @@
     (%w::'a::type word.
         ALL (m::nat) k::nat.
            m + k <= n -->
-           (0::nat) < m -->
-           (0::nat) < k -->
-           SHL False (WSEG m k w) (bit (k - (1::nat)) w) =
-           (bit (k + (m - (1::nat))) w, WSEG m (k - (1::nat)) w))"
+           0 < m -->
+           0 < k -->
+           SHL False (WSEG m k w) (bit (k - 1) w) =
+           (bit (k + (m - 1)) w, WSEG m (k - 1) w))"
   by (import word_bitop SHL_WSEG_NF)
 
 lemma WSEG_SHL: "ALL n::nat.
    RES_FORALL (PWORDLEN (Suc n))
     (%w::'a::type word.
         ALL (m::nat) k::nat.
-           (0::nat) < k & m + k <= Suc n -->
+           0 < k & m + k <= Suc n -->
            (ALL b::'a::type.
-               WSEG m k (snd (SHL (f::bool) w b)) =
-               WSEG m (k - (1::nat)) w))"
+               WSEG m k (snd (SHL (f::bool) w b)) = WSEG m (k - 1) w))"
   by (import word_bitop WSEG_SHL)
 
 lemma WSEG_SHL_0: "ALL n::nat.
    RES_FORALL (PWORDLEN (Suc n))
     (%w::'a::type word.
         ALL (m::nat) b::'a::type.
-           (0::nat) < m & m <= Suc n -->
-           WSEG m (0::nat) (snd (SHL (f::bool) w b)) =
-           WCAT
-            (WSEG (m - (1::nat)) (0::nat) w,
-             if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
+           0 < m & m <= Suc n -->
+           WSEG m 0 (snd (SHL (f::bool) w b)) =
+           WCAT (WSEG (m - 1) 0 w, if f then WSEG 1 0 w else WORD [b]))"
   by (import word_bitop WSEG_SHL_0)
 
 ;end_setup
@@ -1216,24 +1198,24 @@
 
 constdefs
   BV :: "bool => nat" 
-  "(BV == (%(b::bool). (if b then (Suc (0::nat)) else (0::nat))))"
+  "BV == %b::bool. if b then Suc 0 else 0"
 
-lemma BV_DEF: "(ALL (b::bool). ((BV b) = (if b then (Suc (0::nat)) else (0::nat))))"
+lemma BV_DEF: "ALL b::bool. BV b = (if b then Suc 0 else 0)"
   by (import bword_num BV_DEF)
 
 consts
   BNVAL :: "bool word => nat" 
 
-specification (BNVAL) BNVAL_DEF: "ALL l::bool list. BNVAL (WORD l) = LVAL BV (2::nat) l"
+specification (BNVAL) BNVAL_DEF: "ALL l::bool list. BNVAL (WORD l) = LVAL BV 2 l"
   by (import bword_num BNVAL_DEF)
 
-lemma BV_LESS_2: "ALL x::bool. BV x < (2::nat)"
+lemma BV_LESS_2: "ALL x::bool. BV x < 2"
   by (import bword_num BV_LESS_2)
 
-lemma BNVAL_NVAL: "ALL w::bool word. BNVAL w = NVAL BV (2::nat) w"
+lemma BNVAL_NVAL: "ALL w::bool word. BNVAL w = NVAL BV 2 w"
   by (import bword_num BNVAL_NVAL)
 
-lemma BNVAL0: "BNVAL (WORD []) = (0::nat)"
+lemma BNVAL0: "BNVAL (WORD []) = 0"
   by (import bword_num BNVAL0)
 
 lemma BNVAL_11: "ALL (w1::bool word) w2::bool word.
@@ -1243,20 +1225,19 @@
 lemma BNVAL_ONTO: "ALL w::bool word. Ex (op = (BNVAL w))"
   by (import bword_num BNVAL_ONTO)
 
-lemma BNVAL_MAX: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w < (2::nat) ^ n)"
+lemma BNVAL_MAX: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w < 2 ^ n)"
   by (import bword_num BNVAL_MAX)
 
 lemma BNVAL_WCAT1: "ALL n::nat.
    RES_FORALL (PWORDLEN n)
     (%w::bool word.
-        ALL x::bool. BNVAL (WCAT (w, WORD [x])) = BNVAL w * (2::nat) + BV x)"
+        ALL x::bool. BNVAL (WCAT (w, WORD [x])) = BNVAL w * 2 + BV x)"
   by (import bword_num BNVAL_WCAT1)
 
 lemma BNVAL_WCAT2: "ALL n::nat.
    RES_FORALL (PWORDLEN n)
     (%w::bool word.
-        ALL x::bool.
-           BNVAL (WCAT (WORD [x], w)) = BV x * (2::nat) ^ n + BNVAL w)"
+        ALL x::bool. BNVAL (WCAT (WORD [x], w)) = BV x * 2 ^ n + BNVAL w)"
   by (import bword_num BNVAL_WCAT2)
 
 lemma BNVAL_WCAT: "ALL (n::nat) m::nat.
@@ -1264,24 +1245,24 @@
     (%w1::bool word.
         RES_FORALL (PWORDLEN m)
          (%w2::bool word.
-             BNVAL (WCAT (w1, w2)) = BNVAL w1 * (2::nat) ^ m + BNVAL w2))"
+             BNVAL (WCAT (w1, w2)) = BNVAL w1 * 2 ^ m + BNVAL w2))"
   by (import bword_num BNVAL_WCAT)
 
 constdefs
   VB :: "nat => bool" 
-  "VB == %n::nat. n mod (2::nat) ~= (0::nat)"
+  "VB == %n::nat. n mod 2 ~= 0"
 
-lemma VB_DEF: "ALL n::nat. VB n = (n mod (2::nat) ~= (0::nat))"
+lemma VB_DEF: "ALL n::nat. VB n = (n mod 2 ~= 0)"
   by (import bword_num VB_DEF)
 
 constdefs
   NBWORD :: "nat => nat => bool word" 
-  "NBWORD == %(n::nat) m::nat. WORD (NLIST n VB (2::nat) m)"
+  "NBWORD == %(n::nat) m::nat. WORD (NLIST n VB 2 m)"
 
-lemma NBWORD_DEF: "ALL (n::nat) m::nat. NBWORD n m = WORD (NLIST n VB (2::nat) m)"
+lemma NBWORD_DEF: "ALL (n::nat) m::nat. NBWORD n m = WORD (NLIST n VB 2 m)"
   by (import bword_num NBWORD_DEF)
 
-lemma NBWORD0: "ALL x::nat. NBWORD (0::nat) x = WORD []"
+lemma NBWORD0: "ALL x::nat. NBWORD 0 x = WORD []"
   by (import bword_num NBWORD0)
 
 lemma WORDLEN_NBWORD: "ALL (x::nat) xa::nat. WORDLEN (NBWORD x xa) = x"
@@ -1291,8 +1272,7 @@
   by (import bword_num PWORDLEN_NBWORD)
 
 lemma NBWORD_SUC: "ALL (n::nat) m::nat.
-   NBWORD (Suc n) m =
-   WCAT (NBWORD n (m div (2::nat)), WORD [VB (m mod (2::nat))])"
+   NBWORD (Suc n) m = WCAT (NBWORD n (m div 2), WORD [VB (m mod 2)])"
   by (import bword_num NBWORD_SUC)
 
 lemma VB_BV: "ALL x::bool. VB (BV x) = x"
@@ -1313,21 +1293,18 @@
 lemma NBWORD_BNVAL: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. NBWORD n (BNVAL w) = w)"
   by (import bword_num NBWORD_BNVAL)
 
-lemma BNVAL_NBWORD: "ALL (n::nat) m::nat. m < (2::nat) ^ n --> BNVAL (NBWORD n m) = m"
+lemma BNVAL_NBWORD: "ALL (n::nat) m::nat. m < 2 ^ n --> BNVAL (NBWORD n m) = m"
   by (import bword_num BNVAL_NBWORD)
 
 lemma ZERO_WORD_VAL: "RES_FORALL (PWORDLEN (n::nat))
- (%w::bool word. (w = NBWORD n (0::nat)) = (BNVAL w = (0::nat)))"
+ (%w::bool word. (w = NBWORD n 0) = (BNVAL w = 0))"
   by (import bword_num ZERO_WORD_VAL)
 
-lemma WCAT_NBWORD_0: "ALL (n1::nat) n2::nat.
-   WCAT (NBWORD n1 (0::nat), NBWORD n2 (0::nat)) = NBWORD (n1 + n2) (0::nat)"
+lemma WCAT_NBWORD_0: "ALL (n1::nat) n2::nat. WCAT (NBWORD n1 0, NBWORD n2 0) = NBWORD (n1 + n2) 0"
   by (import bword_num WCAT_NBWORD_0)
 
 lemma WSPLIT_NBWORD_0: "ALL (n::nat) m::nat.
-   m <= n -->
-   WSPLIT m (NBWORD n (0::nat)) =
-   (NBWORD (n - m) (0::nat), NBWORD m (0::nat))"
+   m <= n --> WSPLIT m (NBWORD n 0) = (NBWORD (n - m) 0, NBWORD m 0)"
   by (import bword_num WSPLIT_NBWORD_0)
 
 lemma EQ_NBWORD0_SPLIT: "(All::(nat => bool) => bool)
@@ -1354,43 +1331,41 @@
                       ((NBWORD::nat => nat => bool word) m (0::nat))))))))"
   by (import bword_num EQ_NBWORD0_SPLIT)
 
-lemma NBWORD_MOD: "ALL (n::nat) m::nat. NBWORD n (m mod (2::nat) ^ n) = NBWORD n m"
+lemma NBWORD_MOD: "ALL (n::nat) m::nat. NBWORD n (m mod 2 ^ n) = NBWORD n m"
   by (import bword_num NBWORD_MOD)
 
-lemma WSEG_NBWORD_SUC: "ALL (n::nat) m::nat. WSEG n (0::nat) (NBWORD (Suc n) m) = NBWORD n m"
+lemma WSEG_NBWORD_SUC: "ALL (n::nat) m::nat. WSEG n 0 (NBWORD (Suc n) m) = NBWORD n m"
   by (import bword_num WSEG_NBWORD_SUC)
 
 lemma NBWORD_SUC_WSEG: "ALL n::nat.
    RES_FORALL (PWORDLEN (Suc n))
-    (%w::bool word. NBWORD n (BNVAL w) = WSEG n (0::nat) w)"
+    (%w::bool word. NBWORD n (BNVAL w) = WSEG n 0 w)"
   by (import bword_num NBWORD_SUC_WSEG)
 
-lemma DOUBL_EQ_SHL: "ALL x>0::nat.
+lemma DOUBL_EQ_SHL: "ALL x>0.
    RES_FORALL (PWORDLEN x)
     (%xa::bool word.
         ALL xb::bool.
            NBWORD x (BNVAL xa + BNVAL xa + BV xb) = snd (SHL False xa xb))"
   by (import bword_num DOUBL_EQ_SHL)
 
-lemma MSB_NBWORD: "ALL (n::nat) m::nat.
-   bit n (NBWORD (Suc n) m) = VB (m div (2::nat) ^ n mod (2::nat))"
+lemma MSB_NBWORD: "ALL (n::nat) m::nat. bit n (NBWORD (Suc n) m) = VB (m div 2 ^ n mod 2)"
   by (import bword_num MSB_NBWORD)
 
 lemma NBWORD_SPLIT: "ALL (n1::nat) (n2::nat) m::nat.
-   NBWORD (n1 + n2) m = WCAT (NBWORD n1 (m div (2::nat) ^ n2), NBWORD n2 m)"
+   NBWORD (n1 + n2) m = WCAT (NBWORD n1 (m div 2 ^ n2), NBWORD n2 m)"
   by (import bword_num NBWORD_SPLIT)
 
 lemma WSEG_NBWORD: "ALL (m::nat) (k::nat) n::nat.
    m + k <= n -->
-   (ALL l::nat. WSEG m k (NBWORD n l) = NBWORD m (l div (2::nat) ^ k))"
+   (ALL l::nat. WSEG m k (NBWORD n l) = NBWORD m (l div 2 ^ k))"
   by (import bword_num WSEG_NBWORD)
 
 lemma NBWORD_SUC_FST: "ALL (n::nat) x::nat.
-   NBWORD (Suc n) x =
-   WCAT (WORD [VB (x div (2::nat) ^ n mod (2::nat))], NBWORD n x)"
+   NBWORD (Suc n) x = WCAT (WORD [VB (x div 2 ^ n mod 2)], NBWORD n x)"
   by (import bword_num NBWORD_SUC_FST)
 
-lemma BIT_NBWORD0: "ALL (k::nat) n::nat. k < n --> bit k (NBWORD n (0::nat)) = False"
+lemma BIT_NBWORD0: "ALL (k::nat) n::nat. k < n --> bit k (NBWORD n 0) = False"
   by (import bword_num BIT_NBWORD0)
 
 lemma ADD_BNVAL_LEFT: "ALL n::nat.
@@ -1399,8 +1374,8 @@
         RES_FORALL (PWORDLEN (Suc n))
          (%w2::bool word.
              BNVAL w1 + BNVAL w2 =
-             (BV (bit n w1) + BV (bit n w2)) * (2::nat) ^ n +
-             (BNVAL (WSEG n (0::nat) w1) + BNVAL (WSEG n (0::nat) w2))))"
+             (BV (bit n w1) + BV (bit n w2)) * 2 ^ n +
+             (BNVAL (WSEG n 0 w1) + BNVAL (WSEG n 0 w2))))"
   by (import bword_num ADD_BNVAL_LEFT)
 
 lemma ADD_BNVAL_RIGHT: "ALL n::nat.
@@ -1409,9 +1384,8 @@
         RES_FORALL (PWORDLEN (Suc n))
          (%w2::bool word.
              BNVAL w1 + BNVAL w2 =
-             (BNVAL (WSEG n (1::nat) w1) + BNVAL (WSEG n (1::nat) w2)) *
-             (2::nat) +
-             (BV (bit (0::nat) w1) + BV (bit (0::nat) w2))))"
+             (BNVAL (WSEG n 1 w1) + BNVAL (WSEG n 1 w2)) * 2 +
+             (BV (bit 0 w1) + BV (bit 0 w2))))"
   by (import bword_num ADD_BNVAL_RIGHT)
 
 lemma ADD_BNVAL_SPLIT: "ALL (n1::nat) n2::nat.
@@ -1420,9 +1394,8 @@
         RES_FORALL (PWORDLEN (n1 + n2))
          (%w2::bool word.
              BNVAL w1 + BNVAL w2 =
-             (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2)) *
-             (2::nat) ^ n2 +
-             (BNVAL (WSEG n2 (0::nat) w1) + BNVAL (WSEG n2 (0::nat) w2))))"
+             (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2)) * 2 ^ n2 +
+             (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2))))"
   by (import bword_num ADD_BNVAL_SPLIT)
 
 ;end_setup
@@ -1432,19 +1405,16 @@
 consts
   ACARRY :: "nat => bool word => bool word => bool => bool" 
 
-specification (ACARRY) ACARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool.
-    ACARRY (0::nat) w1 w2 cin = cin) &
+specification (ACARRY) ACARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool. ACARRY 0 w1 w2 cin = cin) &
 (ALL (n::nat) (w1::bool word) (w2::bool word) cin::bool.
     ACARRY (Suc n) w1 w2 cin =
-    VB ((BV (bit n w1) + BV (bit n w2) + BV (ACARRY n w1 w2 cin)) div
-        (2::nat)))"
+    VB ((BV (bit n w1) + BV (bit n w2) + BV (ACARRY n w1 w2 cin)) div 2))"
   by (import bword_arith ACARRY_DEF)
 
 consts
   ICARRY :: "nat => bool word => bool word => bool => bool" 
 
-specification (ICARRY) ICARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool.
-    ICARRY (0::nat) w1 w2 cin = cin) &
+specification (ICARRY) ICARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool. ICARRY 0 w1 w2 cin = cin) &
 (ALL (n::nat) (w1::bool word) (w2::bool word) cin::bool.
     ICARRY (Suc n) w1 w2 cin =
     (bit n w1 & bit n w2 | (bit n w1 | bit n w2) & ICARRY n w1 w2 cin))"
@@ -1459,9 +1429,7 @@
                 k <= n --> ACARRY k w1 w2 cin = ICARRY k w1 w2 cin))"
   by (import bword_arith ACARRY_EQ_ICARRY)
 
-lemma BNVAL_LESS_EQ: "ALL n::nat.
-   RES_FORALL (PWORDLEN n)
-    (%w::bool word. BNVAL w <= (2::nat) ^ n - (1::nat))"
+lemma BNVAL_LESS_EQ: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w <= 2 ^ n - 1)"
   by (import bword_arith BNVAL_LESS_EQ)
 
 lemma ADD_BNVAL_LESS_EQ1: "ALL (n::nat) cin::bool.
@@ -1469,8 +1437,7 @@
     (%w1::bool word.
         RES_FORALL (PWORDLEN n)
          (%w2::bool word.
-             (BNVAL w1 + (BNVAL w2 + BV cin)) div (2::nat) ^ n
-             <= Suc (0::nat)))"
+             (BNVAL w1 + (BNVAL w2 + BV cin)) div 2 ^ n <= Suc 0))"
   by (import bword_arith ADD_BNVAL_LESS_EQ1)
 
 lemma ADD_BV_BNVAL_DIV_LESS_EQ1: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
@@ -1479,9 +1446,9 @@
         RES_FORALL (PWORDLEN n)
          (%w2::bool word.
              (BV x1 + BV x2 +
-              (BNVAL w1 + (BNVAL w2 + BV cin)) div (2::nat) ^ n) div
-             (2::nat)
-             <= (1::nat)))"
+              (BNVAL w1 + (BNVAL w2 + BV cin)) div 2 ^ n) div
+             2
+             <= 1))"
   by (import bword_arith ADD_BV_BNVAL_DIV_LESS_EQ1)
 
 lemma ADD_BV_BNVAL_LESS_EQ: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
@@ -1490,7 +1457,7 @@
         RES_FORALL (PWORDLEN n)
          (%w2::bool word.
              BV x1 + BV x2 + (BNVAL w1 + (BNVAL w2 + BV cin))
-             <= Suc ((2::nat) ^ Suc n)))"
+             <= Suc (2 ^ Suc n)))"
   by (import bword_arith ADD_BV_BNVAL_LESS_EQ)
 
 lemma ADD_BV_BNVAL_LESS_EQ1: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
@@ -1499,8 +1466,8 @@
         RES_FORALL (PWORDLEN n)
          (%w2::bool word.
              (BV x1 + BV x2 + (BNVAL w1 + (BNVAL w2 + BV cin))) div
-             (2::nat) ^ Suc n
-             <= (1::nat)))"
+             2 ^ Suc n
+             <= 1))"
   by (import bword_arith ADD_BV_BNVAL_LESS_EQ1)
 
 lemma ACARRY_EQ_ADD_DIV: "(All::(nat => bool) => bool)
@@ -1552,9 +1519,7 @@
                    (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2) +
                     BV (ACARRY n2 w1 w2 cin)),
                   NBWORD n2
-                   (BNVAL (WSEG n2 (0::nat) w1) +
-                    BNVAL (WSEG n2 (0::nat) w2) +
-                    BV cin))))"
+                   (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2) + BV cin))))"
   by (import bword_arith ADD_WORD_SPLIT)
 
 lemma WSEG_NBWORD_ADD: "ALL n::nat.
@@ -1577,16 +1542,14 @@
          (%w2::bool word.
              ALL cin::bool.
                 (NBWORD (n1 + n2) (BNVAL w1 + BNVAL w2 + BV cin) =
-                 NBWORD (n1 + n2) (0::nat)) =
+                 NBWORD (n1 + n2) 0) =
                 (NBWORD n1
                   (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2) +
                    BV (ACARRY n2 w1 w2 cin)) =
-                 NBWORD n1 (0::nat) &
+                 NBWORD n1 0 &
                  NBWORD n2
-                  (BNVAL (WSEG n2 (0::nat) w1) +
-                   BNVAL (WSEG n2 (0::nat) w2) +
-                   BV cin) =
-                 NBWORD n2 (0::nat))))"
+                  (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2) + BV cin) =
+                 NBWORD n2 0)))"
   by (import bword_arith ADD_NBWORD_EQ0_SPLIT)
 
 lemma ACARRY_MSB: "ALL n::nat.
@@ -1606,7 +1569,7 @@
          (%w2::bool word.
              ALL (cin::bool) (k::nat) m::nat.
                 k < m & m <= n -->
-                ACARRY k (WSEG m (0::nat) w1) (WSEG m (0::nat) w2) cin =
+                ACARRY k (WSEG m 0 w1) (WSEG m 0 w2) cin =
                 ACARRY k w1 w2 cin))"
   by (import bword_arith ACARRY_WSEG)
 
@@ -1617,7 +1580,7 @@
          (%w2::bool word.
              ALL (cin::bool) (k::nat) m::nat.
                 k < m & m <= n -->
-                ICARRY k (WSEG m (0::nat) w1) (WSEG m (0::nat) w2) cin =
+                ICARRY k (WSEG m 0 w1) (WSEG m 0 w2) cin =
                 ICARRY k w1 w2 cin))"
   by (import bword_arith ICARRY_WSEG)
 
--- a/src/HOL/Import/HOL/HOL4Word32.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/HOL4Word32.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -8,78 +8,54 @@
   DIV2 :: "nat => nat" 
 
 defs
-  DIV2_primdef: "DIV2 == %n::nat. n div (2::nat)"
+  DIV2_primdef: "DIV2 == %n::nat. n div 2"
 
-lemma DIV2_def: "ALL n::nat. DIV2 n = n div (2::nat)"
+lemma DIV2_def: "ALL n::nat. DIV2 n = n div 2"
   by (import bits DIV2_def)
 
 consts
   TIMES_2EXP :: "nat => nat => nat" 
 
 defs
-  TIMES_2EXP_primdef: "TIMES_2EXP == %(x::nat) n::nat. n * (2::nat) ^ x"
+  TIMES_2EXP_primdef: "TIMES_2EXP == %(x::nat) n::nat. n * 2 ^ x"
 
-lemma TIMES_2EXP_def: "ALL (x::nat) n::nat. TIMES_2EXP x n = n * (2::nat) ^ x"
+lemma TIMES_2EXP_def: "ALL (x::nat) n::nat. TIMES_2EXP x n = n * 2 ^ x"
   by (import bits TIMES_2EXP_def)
 
 consts
   DIV_2EXP :: "nat => nat => nat" 
 
 defs
-  DIV_2EXP_primdef: "DIV_2EXP == %(x::nat) n::nat. n div (2::nat) ^ x"
+  DIV_2EXP_primdef: "DIV_2EXP == %(x::nat) n::nat. n div 2 ^ x"
 
-lemma DIV_2EXP_def: "ALL (x::nat) n::nat. DIV_2EXP x n = n div (2::nat) ^ x"
+lemma DIV_2EXP_def: "ALL (x::nat) n::nat. DIV_2EXP x n = n div 2 ^ x"
   by (import bits DIV_2EXP_def)
 
 consts
   MOD_2EXP :: "nat => nat => nat" 
 
 defs
-  MOD_2EXP_primdef: "MOD_2EXP == %(x::nat) n::nat. n mod (2::nat) ^ x"
+  MOD_2EXP_primdef: "MOD_2EXP == %(x::nat) n::nat. n mod 2 ^ x"
 
-lemma MOD_2EXP_def: "ALL (x::nat) n::nat. MOD_2EXP x n = n mod (2::nat) ^ x"
+lemma MOD_2EXP_def: "ALL (x::nat) n::nat. MOD_2EXP x n = n mod 2 ^ x"
   by (import bits MOD_2EXP_def)
 
 consts
   DIVMOD_2EXP :: "nat => nat => nat * nat" 
 
 defs
-  DIVMOD_2EXP_primdef: "DIVMOD_2EXP == %(x::nat) n::nat. (n div (2::nat) ^ x, n mod (2::nat) ^ x)"
+  DIVMOD_2EXP_primdef: "DIVMOD_2EXP == %(x::nat) n::nat. (n div 2 ^ x, n mod 2 ^ x)"
 
-lemma DIVMOD_2EXP_def: "ALL (x::nat) n::nat.
-   DIVMOD_2EXP x n = (n div (2::nat) ^ x, n mod (2::nat) ^ x)"
+lemma DIVMOD_2EXP_def: "ALL (x::nat) n::nat. DIVMOD_2EXP x n = (n div 2 ^ x, n mod 2 ^ x)"
   by (import bits DIVMOD_2EXP_def)
 
 consts
   SBIT :: "bool => nat => nat" 
 
 defs
-  SBIT_primdef: "(op ==::(bool => nat => nat) => (bool => nat => nat) => prop)
- (SBIT::bool => nat => nat)
- (%(b::bool) n::nat.
-     (If::bool => nat => nat => nat) b
-      ((op ^::nat => nat => nat)
-        ((number_of::bin => nat)
-          ((op BIT::bin => bit => bin)
-            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
-            (bit.B0::bit)))
-        n)
-      (0::nat))"
+  SBIT_primdef: "SBIT == %(b::bool) n::nat. if b then 2 ^ n else 0"
 
-lemma SBIT_def: "(All::(bool => bool) => bool)
- (%b::bool.
-     (All::(nat => bool) => bool)
-      (%n::nat.
-          (op =::nat => nat => bool) ((SBIT::bool => nat => nat) b n)
-           ((If::bool => nat => nat => nat) b
-             ((op ^::nat => nat => nat)
-               ((number_of::bin => nat)
-                 ((op BIT::bin => bit => bin)
-                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
-                     (bit.B1::bit))
-                   (bit.B0::bit)))
-               n)
-             (0::nat))))"
+lemma SBIT_def: "ALL (b::bool) n::nat. SBIT b n = (if b then 2 ^ n else 0)"
   by (import bits SBIT_def)
 
 consts
@@ -94,9 +70,9 @@
 
 constdefs
   bit :: "nat => nat => bool" 
-  "bit == %(b::nat) n::nat. BITS b b n = (1::nat)"
+  "bit == %(b::nat) n::nat. BITS b b n = 1"
 
-lemma BIT_def: "ALL (b::nat) n::nat. bit b n = (BITS b b n = (1::nat))"
+lemma BIT_def: "ALL (b::nat) n::nat. bit b n = (BITS b b n = 1)"
   by (import bits BIT_def)
 
 consts
@@ -113,65 +89,125 @@
   LSBn :: "nat => bool" 
 
 defs
-  LSBn_primdef: "LSBn == bit (0::nat)"
+  LSBn_primdef: "LSBn == bit 0"
 
-lemma LSBn_def: "LSBn = bit (0::nat)"
+lemma LSBn_def: "LSBn = bit 0"
   by (import bits LSBn_def)
 
 consts
   BITWISE :: "nat => (bool => bool => bool) => nat => nat => nat" 
 
-specification (BITWISE_primdef: BITWISE) BITWISE_def: "(ALL (oper::bool => bool => bool) (x::nat) y::nat.
-    BITWISE (0::nat) oper x y = (0::nat)) &
+specification (BITWISE_primdef: BITWISE) BITWISE_def: "(ALL (oper::bool => bool => bool) (x::nat) y::nat. BITWISE 0 oper x y = 0) &
 (ALL (n::nat) (oper::bool => bool => bool) (x::nat) y::nat.
     BITWISE (Suc n) oper x y =
     BITWISE n oper x y + SBIT (oper (bit n x) (bit n y)) n)"
   by (import bits BITWISE_def)
 
-lemma DIV1: "ALL x::nat. x div (1::nat) = x"
+lemma DIV1: "ALL x::nat. x div 1 = x"
   by (import bits DIV1)
 
-lemma SUC_SUB: "Suc (a::nat) - a = (1::nat)"
+lemma SUC_SUB: "Suc (a::nat) - a = 1"
   by (import bits SUC_SUB)
 
-lemma DIV_MULT_1: "ALL (r::nat) n::nat. r < n --> (n + r) div n = (1::nat)"
+lemma DIV_MULT_1: "ALL (r::nat) n::nat. r < n --> (n + r) div n = 1"
   by (import bits DIV_MULT_1)
 
-lemma ZERO_LT_TWOEXP: "ALL n::nat. (0::nat) < (2::nat) ^ n"
+lemma ZERO_LT_TWOEXP: "(All::(nat => bool) => bool)
+ (%n::nat.
+     (op <::nat => nat => bool) (0::nat)
+      ((op ^::nat => nat => nat)
+        ((number_of::bin => nat)
+          ((op BIT::bin => bit => bin)
+            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
+            (bit.B0::bit)))
+        n))"
   by (import bits ZERO_LT_TWOEXP)
 
-lemma MOD_2EXP_LT: "ALL (n::nat) k::nat. k mod (2::nat) ^ n < (2::nat) ^ n"
+lemma MOD_2EXP_LT: "ALL (n::nat) k::nat. k mod 2 ^ n < 2 ^ n"
   by (import bits MOD_2EXP_LT)
 
-lemma TWOEXP_DIVISION: "ALL (n::nat) k::nat.
-   k = k div (2::nat) ^ n * (2::nat) ^ n + k mod (2::nat) ^ n"
+lemma TWOEXP_DIVISION: "ALL (n::nat) k::nat. k = k div 2 ^ n * 2 ^ n + k mod 2 ^ n"
   by (import bits TWOEXP_DIVISION)
 
-lemma TWOEXP_MONO: "ALL (a::nat) b::nat. a < b --> (2::nat) ^ a < (2::nat) ^ b"
+lemma TWOEXP_MONO: "(All::(nat => bool) => bool)
+ (%a::nat.
+     (All::(nat => bool) => bool)
+      (%b::nat.
+          (op -->::bool => bool => bool) ((op <::nat => nat => bool) a b)
+           ((op <::nat => nat => bool)
+             ((op ^::nat => nat => nat)
+               ((number_of::bin => nat)
+                 ((op BIT::bin => bit => bin)
+                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                     (bit.B1::bit))
+                   (bit.B0::bit)))
+               a)
+             ((op ^::nat => nat => nat)
+               ((number_of::bin => nat)
+                 ((op BIT::bin => bit => bin)
+                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                     (bit.B1::bit))
+                   (bit.B0::bit)))
+               b))))"
   by (import bits TWOEXP_MONO)
 
-lemma TWOEXP_MONO2: "ALL (a::nat) b::nat. a <= b --> (2::nat) ^ a <= (2::nat) ^ b"
+lemma TWOEXP_MONO2: "(All::(nat => bool) => bool)
+ (%a::nat.
+     (All::(nat => bool) => bool)
+      (%b::nat.
+          (op -->::bool => bool => bool) ((op <=::nat => nat => bool) a b)
+           ((op <=::nat => nat => bool)
+             ((op ^::nat => nat => nat)
+               ((number_of::bin => nat)
+                 ((op BIT::bin => bit => bin)
+                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                     (bit.B1::bit))
+                   (bit.B0::bit)))
+               a)
+             ((op ^::nat => nat => nat)
+               ((number_of::bin => nat)
+                 ((op BIT::bin => bit => bin)
+                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                     (bit.B1::bit))
+                   (bit.B0::bit)))
+               b))))"
   by (import bits TWOEXP_MONO2)
 
-lemma EXP_SUB_LESS_EQ: "ALL (a::nat) b::nat. (2::nat) ^ (a - b) <= (2::nat) ^ a"
+lemma EXP_SUB_LESS_EQ: "(All::(nat => bool) => bool)
+ (%a::nat.
+     (All::(nat => bool) => bool)
+      (%b::nat.
+          (op <=::nat => nat => bool)
+           ((op ^::nat => nat => nat)
+             ((number_of::bin => nat)
+               ((op BIT::bin => bit => bin)
+                 ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                   (bit.B1::bit))
+                 (bit.B0::bit)))
+             ((op -::nat => nat => nat) a b))
+           ((op ^::nat => nat => nat)
+             ((number_of::bin => nat)
+               ((op BIT::bin => bit => bin)
+                 ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                   (bit.B1::bit))
+                 (bit.B0::bit)))
+             a)))"
   by (import bits EXP_SUB_LESS_EQ)
 
 lemma BITS_THM: "ALL (x::nat) (xa::nat) xb::nat.
-   BITS x xa xb = xb div (2::nat) ^ xa mod (2::nat) ^ (Suc x - xa)"
+   BITS x xa xb = xb div 2 ^ xa mod 2 ^ (Suc x - xa)"
   by (import bits BITS_THM)
 
-lemma BITSLT_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n < (2::nat) ^ (Suc h - l)"
+lemma BITSLT_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n < 2 ^ (Suc h - l)"
   by (import bits BITSLT_THM)
 
-lemma DIV_MULT_LEM: "ALL (m::nat) n::nat. (0::nat) < n --> m div n * n <= m"
+lemma DIV_MULT_LEM: "ALL (m::nat) n::nat. 0 < n --> m div n * n <= m"
   by (import bits DIV_MULT_LEM)
 
-lemma MOD_2EXP_LEM: "ALL (n::nat) x::nat.
-   n mod (2::nat) ^ x = n - n div (2::nat) ^ x * (2::nat) ^ x"
+lemma MOD_2EXP_LEM: "ALL (n::nat) x::nat. n mod 2 ^ x = n - n div 2 ^ x * 2 ^ x"
   by (import bits MOD_2EXP_LEM)
 
-lemma BITS2_THM: "ALL (h::nat) (l::nat) n::nat.
-   BITS h l n = n mod (2::nat) ^ Suc h div (2::nat) ^ l"
+lemma BITS2_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n = n mod 2 ^ Suc h div 2 ^ l"
   by (import bits BITS2_THM)
 
 lemma BITS_COMP_THM: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::nat.
@@ -179,71 +215,65 @@
   by (import bits BITS_COMP_THM)
 
 lemma BITS_DIV_THM: "ALL (h::nat) (l::nat) (x::nat) n::nat.
-   BITS h l x div (2::nat) ^ n = BITS h (l + n) x"
+   BITS h l x div 2 ^ n = BITS h (l + n) x"
   by (import bits BITS_DIV_THM)
 
-lemma BITS_LT_HIGH: "ALL (h::nat) (l::nat) n::nat.
-   n < (2::nat) ^ Suc h --> BITS h l n = n div (2::nat) ^ l"
+lemma BITS_LT_HIGH: "ALL (h::nat) (l::nat) n::nat. n < 2 ^ Suc h --> BITS h l n = n div 2 ^ l"
   by (import bits BITS_LT_HIGH)
 
-lemma BITS_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> BITS h l n = (0::nat)"
+lemma BITS_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> BITS h l n = 0"
   by (import bits BITS_ZERO)
 
-lemma BITS_ZERO2: "ALL (h::nat) l::nat. BITS h l (0::nat) = (0::nat)"
+lemma BITS_ZERO2: "ALL (h::nat) l::nat. BITS h l 0 = 0"
   by (import bits BITS_ZERO2)
 
-lemma BITS_ZERO3: "ALL (h::nat) x::nat. BITS h (0::nat) x = x mod (2::nat) ^ Suc h"
+lemma BITS_ZERO3: "ALL (h::nat) x::nat. BITS h 0 x = x mod 2 ^ Suc h"
   by (import bits BITS_ZERO3)
 
 lemma BITS_COMP_THM2: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::nat.
    BITS h2 l2 (BITS h1 l1 n) = BITS (min h1 (h2 + l1)) (l2 + l1) n"
   by (import bits BITS_COMP_THM2)
 
-lemma NOT_MOD2_LEM: "ALL n::nat. (n mod (2::nat) ~= (0::nat)) = (n mod (2::nat) = (1::nat))"
+lemma NOT_MOD2_LEM: "ALL n::nat. (n mod 2 ~= 0) = (n mod 2 = 1)"
   by (import bits NOT_MOD2_LEM)
 
-lemma NOT_MOD2_LEM2: "ALL (n::nat) a::'a::type.
-   (n mod (2::nat) ~= (1::nat)) = (n mod (2::nat) = (0::nat))"
+lemma NOT_MOD2_LEM2: "ALL (n::nat) a::'a::type. (n mod 2 ~= 1) = (n mod 2 = 0)"
   by (import bits NOT_MOD2_LEM2)
 
-lemma EVEN_MOD2_LEM: "ALL n::nat. EVEN n = (n mod (2::nat) = (0::nat))"
+lemma EVEN_MOD2_LEM: "ALL n::nat. EVEN n = (n mod 2 = 0)"
   by (import bits EVEN_MOD2_LEM)
 
-lemma ODD_MOD2_LEM: "ALL n::nat. ODD n = (n mod (2::nat) = (1::nat))"
+lemma ODD_MOD2_LEM: "ALL n::nat. ODD n = (n mod 2 = 1)"
   by (import bits ODD_MOD2_LEM)
 
 lemma LSB_ODD: "LSBn = ODD"
   by (import bits LSB_ODD)
 
-lemma DIV_MULT_THM: "ALL (x::nat) n::nat.
-   n div (2::nat) ^ x * (2::nat) ^ x = n - n mod (2::nat) ^ x"
+lemma DIV_MULT_THM: "ALL (x::nat) n::nat. n div 2 ^ x * 2 ^ x = n - n mod 2 ^ x"
   by (import bits DIV_MULT_THM)
 
-lemma DIV_MULT_THM2: "ALL x::nat. (2::nat) * (x div (2::nat)) = x - x mod (2::nat)"
+lemma DIV_MULT_THM2: "ALL x::nat. 2 * (x div 2) = x - x mod 2"
   by (import bits DIV_MULT_THM2)
 
-lemma LESS_EQ_EXP_MULT: "ALL (a::nat) b::nat. a <= b --> (EX x::nat. (2::nat) ^ b = x * (2::nat) ^ a)"
+lemma LESS_EQ_EXP_MULT: "ALL (a::nat) b::nat. a <= b --> (EX x::nat. 2 ^ b = x * 2 ^ a)"
   by (import bits LESS_EQ_EXP_MULT)
 
 lemma SLICE_LEM1: "ALL (a::nat) (x::nat) y::nat.
-   a div (2::nat) ^ (x + y) * (2::nat) ^ (x + y) =
-   a div (2::nat) ^ x * (2::nat) ^ x -
-   a div (2::nat) ^ x mod (2::nat) ^ y * (2::nat) ^ x"
+   a div 2 ^ (x + y) * 2 ^ (x + y) =
+   a div 2 ^ x * 2 ^ x - a div 2 ^ x mod 2 ^ y * 2 ^ x"
   by (import bits SLICE_LEM1)
 
 lemma SLICE_LEM2: "ALL (a::'a::type) (x::nat) y::nat.
-   (n::nat) mod (2::nat) ^ (x + y) =
-   n mod (2::nat) ^ x + n div (2::nat) ^ x mod (2::nat) ^ y * (2::nat) ^ x"
+   (n::nat) mod 2 ^ (x + y) = n mod 2 ^ x + n div 2 ^ x mod 2 ^ y * 2 ^ x"
   by (import bits SLICE_LEM2)
 
-lemma SLICE_LEM3: "ALL (n::nat) (h::nat) l::nat.
-   l < h --> n mod (2::nat) ^ Suc l <= n mod (2::nat) ^ h"
+lemma SLICE_LEM3: "ALL (n::nat) (h::nat) l::nat. l < h --> n mod 2 ^ Suc l <= n mod 2 ^ h"
   by (import bits SLICE_LEM3)
 
-lemma SLICE_THM: "ALL (n::nat) (h::nat) l::nat. SLICE h l n = BITS h l n * (2::nat) ^ l"
+lemma SLICE_THM: "ALL (n::nat) (h::nat) l::nat. SLICE h l n = BITS h l n * 2 ^ l"
   by (import bits SLICE_THM)
 
-lemma SLICELT_THM: "ALL (h::nat) (l::nat) n::nat. SLICE h l n < (2::nat) ^ Suc h"
+lemma SLICELT_THM: "ALL (h::nat) (l::nat) n::nat. SLICE h l n < 2 ^ Suc h"
   by (import bits SLICELT_THM)
 
 lemma BITS_SLICE_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l (SLICE h l n) = BITS h l n"
@@ -253,44 +283,41 @@
    h <= (h2::nat) --> BITS h2 l (SLICE h l n) = BITS h l n"
   by (import bits BITS_SLICE_THM2)
 
-lemma MOD_2EXP_MONO: "ALL (n::nat) (h::nat) l::nat.
-   l <= h --> n mod (2::nat) ^ l <= n mod (2::nat) ^ Suc h"
+lemma MOD_2EXP_MONO: "ALL (n::nat) (h::nat) l::nat. l <= h --> n mod 2 ^ l <= n mod 2 ^ Suc h"
   by (import bits MOD_2EXP_MONO)
 
 lemma SLICE_COMP_THM: "ALL (h::nat) (m::nat) (l::nat) n::nat.
    Suc m <= h & l <= m --> SLICE h (Suc m) n + SLICE m l n = SLICE h l n"
   by (import bits SLICE_COMP_THM)
 
-lemma SLICE_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> SLICE h l n = (0::nat)"
+lemma SLICE_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> SLICE h l n = 0"
   by (import bits SLICE_ZERO)
 
 lemma BIT_COMP_THM3: "ALL (h::nat) (m::nat) (l::nat) n::nat.
    Suc m <= h & l <= m -->
-   BITS h (Suc m) n * (2::nat) ^ (Suc m - l) + BITS m l n = BITS h l n"
+   BITS h (Suc m) n * 2 ^ (Suc m - l) + BITS m l n = BITS h l n"
   by (import bits BIT_COMP_THM3)
 
-lemma NOT_BIT: "ALL (n::nat) a::nat. (~ bit n a) = (BITS n n a = (0::nat))"
+lemma NOT_BIT: "ALL (n::nat) a::nat. (~ bit n a) = (BITS n n a = 0)"
   by (import bits NOT_BIT)
 
-lemma NOT_BITS: "ALL (n::nat) a::nat. (BITS n n a ~= (0::nat)) = (BITS n n a = (1::nat))"
+lemma NOT_BITS: "ALL (n::nat) a::nat. (BITS n n a ~= 0) = (BITS n n a = 1)"
   by (import bits NOT_BITS)
 
-lemma NOT_BITS2: "ALL (n::nat) a::nat. (BITS n n a ~= (1::nat)) = (BITS n n a = (0::nat))"
+lemma NOT_BITS2: "ALL (n::nat) a::nat. (BITS n n a ~= 1) = (BITS n n a = 0)"
   by (import bits NOT_BITS2)
 
 lemma BIT_SLICE: "ALL (n::nat) (a::nat) b::nat.
    (bit n a = bit n b) = (SLICE n n a = SLICE n n b)"
   by (import bits BIT_SLICE)
 
-lemma BIT_SLICE_LEM: "ALL (y::nat) (x::nat) n::nat.
-   SBIT (bit x n) (x + y) = SLICE x x n * (2::nat) ^ y"
+lemma BIT_SLICE_LEM: "ALL (y::nat) (x::nat) n::nat. SBIT (bit x n) (x + y) = SLICE x x n * 2 ^ y"
   by (import bits BIT_SLICE_LEM)
 
 lemma BIT_SLICE_THM: "ALL (x::nat) xa::nat. SBIT (bit x xa) x = SLICE x x xa"
   by (import bits BIT_SLICE_THM)
 
-lemma SBIT_DIV: "ALL (b::bool) (m::nat) n::nat.
-   n < m --> SBIT b (m - n) = SBIT b m div (2::nat) ^ n"
+lemma SBIT_DIV: "ALL (b::bool) (m::nat) n::nat. n < m --> SBIT b (m - n) = SBIT b m div 2 ^ n"
   by (import bits SBIT_DIV)
 
 lemma BITS_SUC: "ALL (h::nat) (l::nat) n::nat.
@@ -300,8 +327,7 @@
 
 lemma BITS_SUC_THM: "ALL (h::nat) (l::nat) n::nat.
    BITS (Suc h) l n =
-   (if Suc h < l then 0::nat
-    else SBIT (bit (Suc h) n) (Suc h - l) + BITS h l n)"
+   (if Suc h < l then 0 else SBIT (bit (Suc h) n) (Suc h - l) + BITS h l n)"
   by (import bits BITS_SUC_THM)
 
 lemma BIT_BITS_THM: "ALL (h::nat) (l::nat) (a::nat) b::nat.
@@ -310,12 +336,39 @@
   by (import bits BIT_BITS_THM)
 
 lemma BITWISE_LT_2EXP: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
-   BITWISE n oper a b < (2::nat) ^ n"
+   BITWISE n oper a b < 2 ^ n"
   by (import bits BITWISE_LT_2EXP)
 
-lemma LESS_EXP_MULT2: "ALL (a::nat) b::nat.
-   a < b -->
-   (EX x::nat. (2::nat) ^ b = (2::nat) ^ (x + (1::nat)) * (2::nat) ^ a)"
+lemma LESS_EXP_MULT2: "(All::(nat => bool) => bool)
+ (%a::nat.
+     (All::(nat => bool) => bool)
+      (%b::nat.
+          (op -->::bool => bool => bool) ((op <::nat => nat => bool) a b)
+           ((Ex::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::nat => nat => bool)
+                  ((op ^::nat => nat => nat)
+                    ((number_of::bin => nat)
+                      ((op BIT::bin => bit => bin)
+                        ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                          (bit.B1::bit))
+                        (bit.B0::bit)))
+                    b)
+                  ((op *::nat => nat => nat)
+                    ((op ^::nat => nat => nat)
+                      ((number_of::bin => nat)
+                        ((op BIT::bin => bit => bin)
+                          ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                            (bit.B1::bit))
+                          (bit.B0::bit)))
+                      ((op +::nat => nat => nat) x (1::nat)))
+                    ((op ^::nat => nat => nat)
+                      ((number_of::bin => nat)
+                        ((op BIT::bin => bit => bin)
+                          ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
+                            (bit.B1::bit))
+                          (bit.B0::bit)))
+                      a))))))"
   by (import bits LESS_EXP_MULT2)
 
 lemma BITWISE_THM: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
@@ -324,27 +377,21 @@
 
 lemma BITWISE_COR: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
    x < n -->
-   oper (bit x a) (bit x b) -->
-   BITWISE n oper a b div (2::nat) ^ x mod (2::nat) = (1::nat)"
+   oper (bit x a) (bit x b) --> BITWISE n oper a b div 2 ^ x mod 2 = 1"
   by (import bits BITWISE_COR)
 
 lemma BITWISE_NOT_COR: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
    x < n -->
-   ~ oper (bit x a) (bit x b) -->
-   BITWISE n oper a b div (2::nat) ^ x mod (2::nat) = (0::nat)"
+   ~ oper (bit x a) (bit x b) --> BITWISE n oper a b div 2 ^ x mod 2 = 0"
   by (import bits BITWISE_NOT_COR)
 
-lemma MOD_PLUS_RIGHT: "ALL n>0::nat. ALL (j::nat) k::nat. (j + k mod n) mod n = (j + k) mod n"
+lemma MOD_PLUS_RIGHT: "ALL n>0. ALL (j::nat) k::nat. (j + k mod n) mod n = (j + k) mod n"
   by (import bits MOD_PLUS_RIGHT)
 
-lemma MOD_PLUS_1: "ALL n>0::nat.
-   ALL x::nat. ((x + (1::nat)) mod n = (0::nat)) = (x mod n + (1::nat) = n)"
+lemma MOD_PLUS_1: "ALL n>0. ALL x::nat. ((x + 1) mod n = 0) = (x mod n + 1 = n)"
   by (import bits MOD_PLUS_1)
 
-lemma MOD_ADD_1: "ALL n>0::nat.
-   ALL x::nat.
-      (x + (1::nat)) mod n ~= (0::nat) -->
-      (x + (1::nat)) mod n = x mod n + (1::nat)"
+lemma MOD_ADD_1: "ALL n>0. ALL x::nat. (x + 1) mod n ~= 0 --> (x + 1) mod n = x mod n + 1"
   by (import bits MOD_ADD_1)
 
 ;end_setup
@@ -379,18 +426,18 @@
   MODw :: "nat => nat" 
 
 defs
-  MODw_primdef: "MODw == %n::nat. n mod (2::nat) ^ WL"
+  MODw_primdef: "MODw == %n::nat. n mod 2 ^ WL"
 
-lemma MODw_def: "ALL n::nat. MODw n = n mod (2::nat) ^ WL"
+lemma MODw_def: "ALL n::nat. MODw n = n mod 2 ^ WL"
   by (import word32 MODw_def)
 
 consts
   INw :: "nat => bool" 
 
 defs
-  INw_primdef: "INw == %n::nat. n < (2::nat) ^ WL"
+  INw_primdef: "INw == %n::nat. n < 2 ^ WL"
 
-lemma INw_def: "ALL n::nat. INw n = (n < (2::nat) ^ WL)"
+lemma INw_def: "ALL n::nat. INw n = (n < 2 ^ WL)"
   by (import word32 INw_def)
 
 consts
@@ -429,7 +476,7 @@
 lemma TOw_QT: "ALL a::nat. EQUIV (MODw a) a"
   by (import word32 TOw_QT)
 
-lemma MODw_THM: "MODw = BITS HB (0::nat)"
+lemma MODw_THM: "MODw = BITS HB 0"
   by (import word32 MODw_THM)
 
 lemma MOD_ADD: "ALL (a::nat) b::nat. MODw (a + b) = MODw (MODw a + MODw b)"
@@ -442,16 +489,16 @@
   AONE :: "nat" 
 
 defs
-  AONE_primdef: "AONE == 1::nat"
+  AONE_primdef: "AONE == 1"
 
-lemma AONE_def: "AONE = (1::nat)"
+lemma AONE_def: "AONE = 1"
   by (import word32 AONE_def)
 
-lemma ADD_QT: "(ALL n::nat. EQUIV ((0::nat) + n) n) &
+lemma ADD_QT: "(ALL n::nat. EQUIV (0 + n) n) &
 (ALL (m::nat) n::nat. EQUIV (Suc m + n) (Suc (m + n)))"
   by (import word32 ADD_QT)
 
-lemma ADD_0_QT: "ALL a::nat. EQUIV (a + (0::nat)) a"
+lemma ADD_0_QT: "ALL a::nat. EQUIV (a + 0) a"
   by (import word32 ADD_0_QT)
 
 lemma ADD_COMM_QT: "ALL (a::nat) b::nat. EQUIV (a + b) (b + a)"
@@ -460,30 +507,29 @@
 lemma ADD_ASSOC_QT: "ALL (a::nat) (b::nat) c::nat. EQUIV (a + (b + c)) (a + b + c)"
   by (import word32 ADD_ASSOC_QT)
 
-lemma MULT_QT: "(ALL n::nat. EQUIV ((0::nat) * n) (0::nat)) &
+lemma MULT_QT: "(ALL n::nat. EQUIV (0 * n) 0) &
 (ALL (m::nat) n::nat. EQUIV (Suc m * n) (m * n + n))"
   by (import word32 MULT_QT)
 
 lemma ADD1_QT: "ALL m::nat. EQUIV (Suc m) (m + AONE)"
   by (import word32 ADD1_QT)
 
-lemma ADD_CLAUSES_QT: "(ALL m::nat. EQUIV ((0::nat) + m) m) &
-(ALL m::nat. EQUIV (m + (0::nat)) m) &
+lemma ADD_CLAUSES_QT: "(ALL m::nat. EQUIV (0 + m) m) &
+(ALL m::nat. EQUIV (m + 0) m) &
 (ALL (m::nat) n::nat. EQUIV (Suc m + n) (Suc (m + n))) &
 (ALL (m::nat) n::nat. EQUIV (m + Suc n) (Suc (m + n)))"
   by (import word32 ADD_CLAUSES_QT)
 
-lemma SUC_EQUIV_COMP: "ALL (a::nat) b::nat.
-   EQUIV (Suc a) b --> EQUIV a (b + ((2::nat) ^ WL - (1::nat)))"
+lemma SUC_EQUIV_COMP: "ALL (a::nat) b::nat. EQUIV (Suc a) b --> EQUIV a (b + (2 ^ WL - 1))"
   by (import word32 SUC_EQUIV_COMP)
 
 lemma INV_SUC_EQ_QT: "ALL (m::nat) n::nat. EQUIV (Suc m) (Suc n) = EQUIV m n"
   by (import word32 INV_SUC_EQ_QT)
 
-lemma ADD_INV_0_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m --> EQUIV n (0::nat)"
+lemma ADD_INV_0_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m --> EQUIV n 0"
   by (import word32 ADD_INV_0_QT)
 
-lemma ADD_INV_0_EQ_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m = EQUIV n (0::nat)"
+lemma ADD_INV_0_EQ_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m = EQUIV n 0"
   by (import word32 ADD_INV_0_EQ_QT)
 
 lemma EQ_ADD_LCANCEL_QT: "ALL (m::nat) (n::nat) p::nat. EQUIV (m + n) (m + p) = EQUIV n p"
@@ -502,8 +548,8 @@
   by (import word32 MULT_COMM_QT)
 
 lemma MULT_CLAUSES_QT: "ALL (m::nat) n::nat.
-   EQUIV ((0::nat) * m) (0::nat) &
-   EQUIV (m * (0::nat)) (0::nat) &
+   EQUIV (0 * m) 0 &
+   EQUIV (m * 0) 0 &
    EQUIV (AONE * m) m &
    EQUIV (m * AONE) m &
    EQUIV (Suc m * n) (m * n + n) & EQUIV (m * Suc n) (m + m * n)"
@@ -522,21 +568,21 @@
   ONE_COMP :: "nat => nat" 
 
 defs
-  ONE_COMP_primdef: "ONE_COMP == %x::nat. (2::nat) ^ WL - (1::nat) - MODw x"
+  ONE_COMP_primdef: "ONE_COMP == %x::nat. 2 ^ WL - 1 - MODw x"
 
-lemma ONE_COMP_def: "ALL x::nat. ONE_COMP x = (2::nat) ^ WL - (1::nat) - MODw x"
+lemma ONE_COMP_def: "ALL x::nat. ONE_COMP x = 2 ^ WL - 1 - MODw x"
   by (import word32 ONE_COMP_def)
 
 consts
   TWO_COMP :: "nat => nat" 
 
 defs
-  TWO_COMP_primdef: "TWO_COMP == %x::nat. (2::nat) ^ WL - MODw x"
+  TWO_COMP_primdef: "TWO_COMP == %x::nat. 2 ^ WL - MODw x"
 
-lemma TWO_COMP_def: "ALL x::nat. TWO_COMP x = (2::nat) ^ WL - MODw x"
+lemma TWO_COMP_def: "ALL x::nat. TWO_COMP x = 2 ^ WL - MODw x"
   by (import word32 TWO_COMP_def)
 
-lemma ADD_TWO_COMP_QT: "ALL a::nat. EQUIV (MODw a + TWO_COMP a) (0::nat)"
+lemma ADD_TWO_COMP_QT: "ALL a::nat. EQUIV (MODw a + TWO_COMP a) 0"
   by (import word32 ADD_TWO_COMP_QT)
 
 lemma TWO_COMP_ONE_COMP_QT: "ALL a::nat. EQUIV (TWO_COMP a) (ONE_COMP a + AONE)"
@@ -557,8 +603,7 @@
            ((EQUIV::nat => nat => bool) x xa)))"
   by (import word32 BIT_EQUIV_THM)
 
-lemma BITS_SUC2: "ALL (n::nat) a::nat.
-   BITS (Suc n) (0::nat) a = SLICE (Suc n) (Suc n) a + BITS n (0::nat) a"
+lemma BITS_SUC2: "ALL (n::nat) a::nat. BITS (Suc n) 0 a = SLICE (Suc n) (Suc n) a + BITS n 0 a"
   by (import word32 BITS_SUC2)
 
 lemma BITWISE_ONE_COMP_THM: "ALL (a::nat) b::nat. BITWISE WL (%(x::bool) y::bool. ~ x) a b = ONE_COMP a"
@@ -598,9 +643,9 @@
   COMP0 :: "nat" 
 
 defs
-  COMP0_primdef: "COMP0 == ONE_COMP (0::nat)"
+  COMP0_primdef: "COMP0 == ONE_COMP 0"
 
-lemma COMP0_def: "COMP0 = ONE_COMP (0::nat)"
+lemma COMP0_def: "COMP0 = ONE_COMP 0"
   by (import word32 COMP0_def)
 
 lemma BITWISE_THM2: "(All::(nat => bool) => bool)
@@ -655,7 +700,7 @@
 lemma OR_COMP_QT: "ALL a::nat. EQUIV (OR a (ONE_COMP a)) COMP0"
   by (import word32 OR_COMP_QT)
 
-lemma AND_COMP_QT: "ALL a::nat. EQUIV (AND a (ONE_COMP a)) (0::nat)"
+lemma AND_COMP_QT: "ALL a::nat. EQUIV (AND a (ONE_COMP a)) 0"
   by (import word32 AND_COMP_QT)
 
 lemma ONE_COMP_QT: "ALL a::nat. EQUIV (ONE_COMP (ONE_COMP a)) a"
@@ -683,16 +728,14 @@
   by (import word32 MSB_WELLDEF)
 
 lemma BITWISE_ISTEP: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
-   (0::nat) < n -->
-   BITWISE n oper (a div (2::nat)) (b div (2::nat)) =
-   BITWISE n oper a b div (2::nat) +
-   SBIT (oper (bit n a) (bit n b)) (n - (1::nat))"
+   0 < n -->
+   BITWISE n oper (a div 2) (b div 2) =
+   BITWISE n oper a b div 2 + SBIT (oper (bit n a) (bit n b)) (n - 1)"
   by (import word32 BITWISE_ISTEP)
 
 lemma BITWISE_EVAL: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
    BITWISE (Suc n) oper a b =
-   (2::nat) * BITWISE n oper (a div (2::nat)) (b div (2::nat)) +
-   SBIT (oper (LSBn a) (LSBn b)) (0::nat)"
+   2 * BITWISE n oper (a div 2) (b div 2) + SBIT (oper (LSBn a) (LSBn b)) 0"
   by (import word32 BITWISE_EVAL)
 
 lemma BITWISE_WELLDEF: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) (b::nat) (c::nat) d::nat.
@@ -728,9 +771,9 @@
   LSR_ONE :: "nat => nat" 
 
 defs
-  LSR_ONE_primdef: "LSR_ONE == %a::nat. MODw a div (2::nat)"
+  LSR_ONE_primdef: "LSR_ONE == %a::nat. MODw a div 2"
 
-lemma LSR_ONE_def: "ALL a::nat. LSR_ONE a = MODw a div (2::nat)"
+lemma LSR_ONE_def: "ALL a::nat. LSR_ONE a = MODw a div 2"
   by (import word32 LSR_ONE_def)
 
 consts
@@ -772,7 +815,7 @@
 lemma RRX_WELLDEF: "ALL (a::nat) (b::nat) c::bool. EQUIV a b --> EQUIV (RRXn c a) (RRXn c b)"
   by (import word32 RRX_WELLDEF)
 
-lemma LSR_ONE: "LSR_ONE = BITS HB (1::nat)"
+lemma LSR_ONE: "LSR_ONE = BITS HB 1"
   by (import word32 LSR_ONE)
 
 typedef (open) word32 = "{x::nat => bool. EX xa::nat. x = EQUIV xa}" 
@@ -793,9 +836,9 @@
   w_0 :: "word32" 
 
 defs
-  w_0_primdef: "w_0 == mk_word32 (EQUIV (0::nat))"
+  w_0_primdef: "w_0 == mk_word32 (EQUIV 0)"
 
-lemma w_0_def: "w_0 = mk_word32 (EQUIV (0::nat))"
+lemma w_0_def: "w_0 = mk_word32 (EQUIV 0)"
   by (import word32 w_0_def)
 
 consts
@@ -1081,10 +1124,10 @@
    word_1comp (bitwise_or x xa) = bitwise_and (word_1comp x) (word_1comp xa)"
   by (import word32 DE_MORGAN_THMw)
 
-lemma w_0: "w_0 = n2w (0::nat)"
+lemma w_0: "w_0 = n2w 0"
   by (import word32 w_0)
 
-lemma w_1: "w_1 = n2w (1::nat)"
+lemma w_1: "w_1 = n2w 1"
   by (import word32 w_1)
 
 lemma w_T: "w_T =
@@ -1139,9 +1182,9 @@
 
 constdefs
   word_lsl :: "word32 => nat => word32" 
-  "word_lsl == %(a::word32) n::nat. word_mul a (n2w ((2::nat) ^ n))"
+  "word_lsl == %(a::word32) n::nat. word_mul a (n2w (2 ^ n))"
 
-lemma word_lsl: "ALL (a::word32) n::nat. word_lsl a n = word_mul a (n2w ((2::nat) ^ n))"
+lemma word_lsl: "ALL (a::word32) n::nat. word_lsl a n = word_mul a (n2w (2 ^ n))"
   by (import word32 word_lsl)
 
 constdefs
@@ -1320,14 +1363,13 @@
 lemma LSL_LIMIT: "ALL (w::word32) n::nat. HB < n --> word_lsl w n = w_0"
   by (import word32 LSL_LIMIT)
 
-lemma MOD_MOD_DIV: "ALL (a::nat) b::nat. INw (MODw a div (2::nat) ^ b)"
+lemma MOD_MOD_DIV: "ALL (a::nat) b::nat. INw (MODw a div 2 ^ b)"
   by (import word32 MOD_MOD_DIV)
 
-lemma MOD_MOD_DIV_2EXP: "ALL (a::nat) n::nat.
-   MODw (MODw a div (2::nat) ^ n) div (2::nat) = MODw a div (2::nat) ^ Suc n"
+lemma MOD_MOD_DIV_2EXP: "ALL (a::nat) n::nat. MODw (MODw a div 2 ^ n) div 2 = MODw a div 2 ^ Suc n"
   by (import word32 MOD_MOD_DIV_2EXP)
 
-lemma LSR_EVAL: "ALL n::nat. word_lsr (n2w (a::nat)) n = n2w (MODw a div (2::nat) ^ n)"
+lemma LSR_EVAL: "ALL n::nat. word_lsr (n2w (a::nat)) n = n2w (MODw a div 2 ^ n)"
   by (import word32 LSR_EVAL)
 
 lemma LSR_THM: "ALL (x::nat) n::nat. word_lsr (n2w n) x = n2w (BITS HB (min WL x) n)"
@@ -1336,16 +1378,13 @@
 lemma LSR_LIMIT: "ALL (x::nat) w::word32. HB < x --> word_lsr w x = w_0"
   by (import word32 LSR_LIMIT)
 
-lemma LEFT_SHIFT_LESS: "ALL (n::nat) (m::nat) a::nat.
-   a < (2::nat) ^ m -->
-   (2::nat) ^ n + a * (2::nat) ^ n <= (2::nat) ^ (m + n)"
+lemma LEFT_SHIFT_LESS: "ALL (n::nat) (m::nat) a::nat. a < 2 ^ m --> 2 ^ n + a * 2 ^ n <= 2 ^ (m + n)"
   by (import word32 LEFT_SHIFT_LESS)
 
 lemma ROR_THM: "ALL (x::nat) n::nat.
    word_ror (n2w n) x =
    (let x'::nat = x mod WL
-    in n2w (BITS HB x' n +
-            BITS (x' - (1::nat)) (0::nat) n * (2::nat) ^ (WL - x')))"
+    in n2w (BITS HB x' n + BITS (x' - 1) 0 n * 2 ^ (WL - x')))"
   by (import word32 ROR_THM)
 
 lemma ROR_CYCLE: "ALL (x::nat) w::word32. word_ror w (x * WL) = w"
@@ -1354,7 +1393,7 @@
 lemma ASR_THM: "ALL (x::nat) n::nat.
    word_asr (n2w n) x =
    (let x'::nat = min HB x; s::nat = BITS HB x' n
-    in n2w (if MSBn n then (2::nat) ^ WL - (2::nat) ^ (WL - x') + s else s))"
+    in n2w (if MSBn n then 2 ^ WL - 2 ^ (WL - x') + s else s))"
   by (import word32 ASR_THM)
 
 lemma ASR_LIMIT: "ALL (x::nat) w::word32.
@@ -1366,10 +1405,9 @@
 (ALL n::nat. word_lsr w_0 n = w_0) & (ALL n::nat. word_ror w_0 n = w_0)"
   by (import word32 ZERO_SHIFT)
 
-lemma ZERO_SHIFT2: "(ALL a::word32. word_lsl a (0::nat) = a) &
-(ALL a::word32. word_asr a (0::nat) = a) &
-(ALL a::word32. word_lsr a (0::nat) = a) &
-(ALL a::word32. word_ror a (0::nat) = a)"
+lemma ZERO_SHIFT2: "(ALL a::word32. word_lsl a 0 = a) &
+(ALL a::word32. word_asr a 0 = a) &
+(ALL a::word32. word_lsr a 0 = a) & (ALL a::word32. word_ror a 0 = a)"
   by (import word32 ZERO_SHIFT2)
 
 lemma ASR_w_T: "ALL n::nat. word_asr w_T n = w_T"
@@ -1425,19 +1463,19 @@
 
 lemma ONE_COMP_EVAL2: "ALL a::nat.
    word_1comp (n2w a) =
-   n2w ((2::nat) ^
+   n2w (2 ^
         NUMERAL
          (NUMERAL_BIT2
            (NUMERAL_BIT1
              (NUMERAL_BIT1 (NUMERAL_BIT1 (NUMERAL_BIT1 ALT_ZERO))))) -
-        (1::nat) -
+        1 -
         MODw a)"
   by (import word32 ONE_COMP_EVAL2)
 
 lemma TWO_COMP_EVAL2: "ALL a::nat.
    word_2comp (n2w a) =
    n2w (MODw
-         ((2::nat) ^
+         (2 ^
           NUMERAL
            (NUMERAL_BIT2
              (NUMERAL_BIT1
@@ -1445,12 +1483,12 @@
           MODw a))"
   by (import word32 TWO_COMP_EVAL2)
 
-lemma LSR_ONE_EVAL2: "ALL a::nat. word_lsr1 (n2w a) = n2w (MODw a div (2::nat))"
+lemma LSR_ONE_EVAL2: "ALL a::nat. word_lsr1 (n2w a) = n2w (MODw a div 2)"
   by (import word32 LSR_ONE_EVAL2)
 
 lemma ASR_ONE_EVAL2: "ALL a::nat.
    word_asr1 (n2w a) =
-   n2w (MODw a div (2::nat) +
+   n2w (MODw a div 2 +
         SBIT (MSBn a)
          (NUMERAL
            (NUMERAL_BIT1
@@ -1460,7 +1498,7 @@
 
 lemma ROR_ONE_EVAL2: "ALL a::nat.
    word_ror1 (n2w a) =
-   n2w (MODw a div (2::nat) +
+   n2w (MODw a div 2 +
         SBIT (LSBn a)
          (NUMERAL
            (NUMERAL_BIT1
@@ -1470,7 +1508,7 @@
 
 lemma RRX_EVAL2: "ALL (c::bool) a::nat.
    RRX c (n2w a) =
-   n2w (MODw a div (2::nat) +
+   n2w (MODw a div 2 +
         SBIT c
          (NUMERAL
            (NUMERAL_BIT1
@@ -1520,50 +1558,14 @@
          (%(x::bool) y::bool. x ~= y) a b)"
   by (import word32 EOR_EVAL2)
 
-lemma BITWISE_EVAL2: "(All::(nat => bool) => bool)
- (%n::nat.
-     (All::((bool => bool => bool) => bool) => bool)
-      (%oper::bool => bool => bool.
-          (All::(nat => bool) => bool)
-           (%x::nat.
-               (All::(nat => bool) => bool)
-                (%y::nat.
-                    (op =::nat => nat => bool)
-                     ((BITWISE::nat
-                                => (bool => bool => bool)
-                                   => nat => nat => nat)
-                       n oper x y)
-                     ((If::bool => nat => nat => nat)
-                       ((op =::nat => nat => bool) n (0::nat)) (0::nat)
-                       ((op +::nat => nat => nat)
-                         ((op *::nat => nat => nat)
-                           ((number_of::bin => nat)
-                             ((op BIT::bin => bit => bin)
-                               ((op BIT::bin => bit => bin)
-                                 (Numeral.Pls::bin) (bit.B1::bit))
-                               (bit.B0::bit)))
-                           ((BITWISE::nat
-=> (bool => bool => bool) => nat => nat => nat)
-                             ((op -::nat => nat => nat) n (1::nat)) oper
-                             ((op div::nat => nat => nat) x
-                               ((number_of::bin => nat)
-                                 ((op BIT::bin => bit => bin)
-                                   ((op BIT::bin => bit => bin)
-                                     (Numeral.Pls::bin) (bit.B1::bit))
-                                   (bit.B0::bit))))
-                             ((op div::nat => nat => nat) y
-                               ((number_of::bin => nat)
-                                 ((op BIT::bin => bit => bin)
-                                   ((op BIT::bin => bit => bin)
-                                     (Numeral.Pls::bin) (bit.B1::bit))
-                                   (bit.B0::bit))))))
-                         ((If::bool => nat => nat => nat)
-                           (oper ((ODD::nat => bool) x)
-                             ((ODD::nat => bool) y))
-                           (1::nat) (0::nat))))))))"
+lemma BITWISE_EVAL2: "ALL (n::nat) (oper::bool => bool => bool) (x::nat) y::nat.
+   BITWISE n oper x y =
+   (if n = 0 then 0
+    else 2 * BITWISE (n - 1) oper (x div 2) (y div 2) +
+         (if oper (ODD x) (ODD y) then 1 else 0))"
   by (import word32 BITWISE_EVAL2)
 
-lemma BITSwLT_THM: "ALL (h::nat) (l::nat) n::word32. BITSw h l n < (2::nat) ^ (Suc h - l)"
+lemma BITSwLT_THM: "ALL (h::nat) (l::nat) n::word32. BITSw h l n < 2 ^ (Suc h - l)"
   by (import word32 BITSwLT_THM)
 
 lemma BITSw_COMP_THM: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::word32.
@@ -1572,29 +1574,29 @@
   by (import word32 BITSw_COMP_THM)
 
 lemma BITSw_DIV_THM: "ALL (h::nat) (l::nat) (n::nat) x::word32.
-   BITSw h l x div (2::nat) ^ n = BITSw h (l + n) x"
+   BITSw h l x div 2 ^ n = BITSw h (l + n) x"
   by (import word32 BITSw_DIV_THM)
 
-lemma BITw_THM: "ALL (b::nat) n::word32. BITw b n = (BITSw b b n = (1::nat))"
+lemma BITw_THM: "ALL (b::nat) n::word32. BITw b n = (BITSw b b n = 1)"
   by (import word32 BITw_THM)
 
-lemma SLICEw_THM: "ALL (n::word32) (h::nat) l::nat. SLICEw h l n = BITSw h l n * (2::nat) ^ l"
+lemma SLICEw_THM: "ALL (n::word32) (h::nat) l::nat. SLICEw h l n = BITSw h l n * 2 ^ l"
   by (import word32 SLICEw_THM)
 
 lemma BITS_SLICEw_THM: "ALL (h::nat) (l::nat) n::word32. BITS h l (SLICEw h l n) = BITSw h l n"
   by (import word32 BITS_SLICEw_THM)
 
-lemma SLICEw_ZERO_THM: "ALL (n::word32) h::nat. SLICEw h (0::nat) n = BITSw h (0::nat) n"
+lemma SLICEw_ZERO_THM: "ALL (n::word32) h::nat. SLICEw h 0 n = BITSw h 0 n"
   by (import word32 SLICEw_ZERO_THM)
 
 lemma SLICEw_COMP_THM: "ALL (h::nat) (m::nat) (l::nat) a::word32.
    Suc m <= h & l <= m --> SLICEw h (Suc m) a + SLICEw m l a = SLICEw h l a"
   by (import word32 SLICEw_COMP_THM)
 
-lemma BITSw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> BITSw h l n = (0::nat)"
+lemma BITSw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> BITSw h l n = 0"
   by (import word32 BITSw_ZERO)
 
-lemma SLICEw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> SLICEw h l n = (0::nat)"
+lemma SLICEw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> SLICEw h l n = 0"
   by (import word32 SLICEw_ZERO)
 
 ;end_setup
--- a/src/HOL/Import/HOL/bool.imp	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOL/bool.imp	Mon Sep 26 16:10:19 2005 +0200
@@ -41,7 +41,7 @@
   "boolAxiom" > "HOL4Base.bool.boolAxiom"
   "UNWIND_THM2" > "HOL.simp_thms_39"
   "UNWIND_THM1" > "HOL.simp_thms_40"
-  "UNWIND_FORALL_THM2" > "HOL4Base.bool.UNWIND_FORALL_THM2"
+  "UNWIND_FORALL_THM2" > "HOL.simp_thms_41"
   "UNWIND_FORALL_THM1" > "HOL.simp_thms_42"
   "UEXISTS_SIMP" > "HOL4Base.bool.UEXISTS_SIMP"
   "UEXISTS_OR_THM" > "HOL4Base.bool.UEXISTS_OR_THM"
@@ -95,7 +95,7 @@
   "NOT_AND" > "HOL4Base.bool.NOT_AND"
   "MONO_OR" > "Inductive.basic_monos_3"
   "MONO_NOT" > "HOL.rev_contrapos"
-  "MONO_IMP" > "HOL4Base.bool.MONO_IMP"
+  "MONO_IMP" > "Set.imp_mono"
   "MONO_EXISTS" > "Inductive.basic_monos_5"
   "MONO_COND" > "HOL4Base.bool.MONO_COND"
   "MONO_AND" > "Inductive.basic_monos_4"
@@ -108,11 +108,11 @@
   "LEFT_OR_OVER_AND" > "HOL.disj_conj_distribL"
   "LEFT_OR_EXISTS_THM" > "HOL.ex_simps_3"
   "LEFT_FORALL_OR_THM" > "HOL.all_simps_3"
-  "LEFT_FORALL_IMP_THM" > "HOL4Base.bool.LEFT_FORALL_IMP_THM"
+  "LEFT_FORALL_IMP_THM" > "HOL.imp_ex"
   "LEFT_EXISTS_IMP_THM" > "HOL.imp_all"
   "LEFT_EXISTS_AND_THM" > "HOL.ex_simps_1"
   "LEFT_AND_OVER_OR" > "HOL.conj_disj_distribL"
-  "LEFT_AND_FORALL_THM" > "HOL4Base.bool.LEFT_AND_FORALL_THM"
+  "LEFT_AND_FORALL_THM" > "HOL.all_simps_1"
   "IN_def" > "HOL4Base.bool.IN_def"
   "IN_DEF" > "HOL4Base.bool.IN_DEF"
   "INFINITY_AX" > "HOL4Setup.INFINITY_AX"
@@ -146,7 +146,7 @@
   "EQ_SYM" > "HOL.meta_eq_to_obj_eq"
   "EQ_REFL" > "Presburger.fm_modd_pinf"
   "EQ_IMP_THM" > "HOL.iff_conv_conj_imp"
-  "EQ_EXT" > "HOL4Base.bool.EQ_EXT"
+  "EQ_EXT" > "HOL.meta_eq_to_obj_eq"
   "EQ_EXPAND" > "HOL4Base.bool.EQ_EXPAND"
   "EQ_CLAUSES" > "HOL4Base.bool.EQ_CLAUSES"
   "DISJ_SYM" > "HOL.disj_comms_1"
--- a/src/HOL/Import/HOLLight/HOLLight.thy	Mon Sep 26 15:56:28 2005 +0200
+++ b/src/HOL/Import/HOLLight/HOLLight.thy	Mon Sep 26 16:10:19 2005 +0200
@@ -96,7 +96,7 @@
   by (import hollight EXCLUDED_MIDDLE)
 
 constdefs
-  COND :: "bool => 'A::type => 'A::type => 'A::type" 
+  COND :: "bool => 'A => 'A => 'A" 
   "COND ==
 %(t::bool) (t1::'A::type) t2::'A::type.
    SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
@@ -174,14 +174,14 @@
   by (import hollight th_cond)
 
 constdefs
-  LET_END :: "'A::type => 'A::type" 
+  LET_END :: "'A => 'A" 
   "LET_END == %t::'A::type. t"
 
 lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
   by (import hollight DEF_LET_END)
 
 constdefs
-  GABS :: "('A::type => bool) => 'A::type" 
+  GABS :: "('A => bool) => 'A" 
   "(op ==::(('A::type => bool) => 'A::type)
         => (('A::type => bool) => 'A::type) => prop)
  (GABS::('A::type => bool) => 'A::type)
@@ -194,7 +194,7 @@
   by (import hollight DEF_GABS)
 
 constdefs
-  GEQ :: "'A::type => 'A::type => bool" 
+  GEQ :: "'A => 'A => bool" 
   "(op ==::('A::type => 'A::type => bool)
         => ('A::type => 'A::type => bool) => prop)
  (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
@@ -209,7 +209,7 @@
   by (import hollight PAIR_EXISTS_THM)
 
 constdefs
-  CURRY :: "('A::type * 'B::type => 'C::type) => 'A::type => 'B::type => 'C::type" 
+  CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" 
   "CURRY ==
 %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
    u (ua, ub)"
@@ -220,7 +220,7 @@
   by (import hollight DEF_CURRY)
 
 constdefs
-  UNCURRY :: "('A::type => 'B::type => 'C::type) => 'A::type * 'B::type => 'C::type" 
+  UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" 
   "UNCURRY ==
 %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
    u (fst ua) (snd ua)"
@@ -231,8 +231,7 @@
   by (import hollight DEF_UNCURRY)
 
 constdefs
-  PASSOC :: "(('A::type * 'B::type) * 'C::type => 'D::type)
-=> 'A::type * 'B::type * 'C::type => 'D::type" 
+  PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" 
   "PASSOC ==
 %(u::('A::type * 'B::type) * 'C::type => 'D::type)
    ua::'A::type * 'B::type * 'C::type.
@@ -245,12 +244,11 @@
   by (import hollight DEF_PASSOC)
 
 lemma num_Axiom: "ALL (e::'A::type) f::'A::type => nat => 'A::type.
-   EX! fn::nat => 'A::type.
-      fn (0::nat) = e & (ALL n::nat. fn (Suc n) = f (fn n) n)"
+   EX! fn::nat => 'A::type. fn 0 = e & (ALL n::nat. fn (Suc n) = f (fn n) n)"
   by (import hollight num_Axiom)
 
-lemma ADD_CLAUSES: "(ALL x::nat. (0::nat) + x = x) &
-(ALL x::nat. x + (0::nat) = x) &
+lemma ADD_CLAUSES: "(ALL x::nat. 0 + x = x) &
+(ALL x::nat. x + 0 = x) &
 (ALL (x::nat) xa::nat. Suc x + xa = Suc (x + xa)) &
 (ALL (x::nat) xa::nat. x + Suc xa = Suc (x + xa))"
   by (import hollight ADD_CLAUSES)
@@ -259,25 +257,25 @@
 m + n + (p::nat) = m + (n + p) & m + (n + p) = n + (m + p)"
   by (import hollight ADD_AC)
 
-lemma EQ_ADD_LCANCEL_0: "ALL (m::nat) n::nat. (m + n = m) = (n = (0::nat))"
+lemma EQ_ADD_LCANCEL_0: "ALL (m::nat) n::nat. (m + n = m) = (n = 0)"
   by (import hollight EQ_ADD_LCANCEL_0)
 
-lemma EQ_ADD_RCANCEL_0: "ALL (x::nat) xa::nat. (x + xa = xa) = (x = (0::nat))"
+lemma EQ_ADD_RCANCEL_0: "ALL (x::nat) xa::nat. (x + xa = xa) = (x = 0)"
   by (import hollight EQ_ADD_RCANCEL_0)
 
-lemma ONE: "NUMERAL_BIT1 (0::nat) = Suc (0::nat)"
+lemma ONE: "NUMERAL_BIT1 0 = Suc 0"
   by (import hollight ONE)
 
-lemma TWO: "NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) = Suc (NUMERAL_BIT1 (0::nat))"
+lemma TWO: "NUMERAL_BIT0 (NUMERAL_BIT1 0) = Suc (NUMERAL_BIT1 0)"
   by (import hollight TWO)
 
-lemma ADD1: "ALL x::nat. Suc x = x + NUMERAL_BIT1 (0::nat)"
+lemma ADD1: "ALL x::nat. Suc x = x + NUMERAL_BIT1 0"
   by (import hollight ADD1)
 
-lemma MULT_CLAUSES: "(ALL x::nat. (0::nat) * x = (0::nat)) &
-(ALL x::nat. x * (0::nat) = (0::nat)) &
-(ALL x::nat. NUMERAL_BIT1 (0::nat) * x = x) &
-(ALL x::nat. x * NUMERAL_BIT1 (0::nat) = x) &
+lemma MULT_CLAUSES: "(ALL x::nat. 0 * x = 0) &
+(ALL x::nat. x * 0 = 0) &
+(ALL x::nat. NUMERAL_BIT1 0 * x = x) &
+(ALL x::nat. x * NUMERAL_BIT1 0 = x) &
 (ALL (x::nat) xa::nat. Suc x * xa = x * xa + xa) &
 (ALL (x::nat) xa::nat. x * Suc xa = x + x * xa)"
   by (import hollight MULT_CLAUSES)
@@ -286,40 +284,39 @@
 m * n * (p::nat) = m * (n * p) & m * (n * p) = n * (m * p)"
   by (import hollight MULT_AC)
 
-lemma MULT_2: "ALL n::nat. NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * n = n + n"
+lemma MULT_2: "ALL n::nat. NUMERAL_BIT0 (NUMERAL_BIT1 0) * n = n + n"
   by (import hollight MULT_2)
 
 lemma MULT_EQ_1: "ALL (m::nat) n::nat.
-   (m * n = NUMERAL_BIT1 (0::nat)) =
-   (m = NUMERAL_BIT1 (0::nat) & n = NUMERAL_BIT1 (0::nat))"
+   (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   by (import hollight MULT_EQ_1)
 
 constdefs
   EXP :: "nat => nat => nat" 
   "EXP ==
 SOME EXP::nat => nat => nat.
-   (ALL m::nat. EXP m (0::nat) = NUMERAL_BIT1 (0::nat)) &
+   (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
    (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n)"
 
 lemma DEF_EXP: "EXP =
 (SOME EXP::nat => nat => nat.
-    (ALL m::nat. EXP m (0::nat) = NUMERAL_BIT1 (0::nat)) &
+    (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
     (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n))"
   by (import hollight DEF_EXP)
 
-lemma EXP_EQ_0: "ALL (m::nat) n::nat. (EXP m n = (0::nat)) = (m = (0::nat) & n ~= (0::nat))"
+lemma EXP_EQ_0: "ALL (m::nat) n::nat. (EXP m n = 0) = (m = 0 & n ~= 0)"
   by (import hollight EXP_EQ_0)
 
 lemma EXP_ADD: "ALL (m::nat) (n::nat) p::nat. EXP m (n + p) = EXP m n * EXP m p"
   by (import hollight EXP_ADD)
 
-lemma EXP_ONE: "ALL n::nat. EXP (NUMERAL_BIT1 (0::nat)) n = NUMERAL_BIT1 (0::nat)"
+lemma EXP_ONE: "ALL n::nat. EXP (NUMERAL_BIT1 0) n = NUMERAL_BIT1 0"
   by (import hollight EXP_ONE)
 
-lemma EXP_1: "ALL x::nat. EXP x (NUMERAL_BIT1 (0::nat)) = x"
+lemma EXP_1: "ALL x::nat. EXP x (NUMERAL_BIT1 0) = x"
   by (import hollight EXP_1)
 
-lemma EXP_2: "ALL x::nat. EXP x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = x * x"
+lemma EXP_2: "ALL x::nat. EXP x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = x * x"
   by (import hollight EXP_2)
 
 lemma MULT_EXP: "ALL (p::nat) (m::nat) n::nat. EXP (m * n) p = EXP m p * EXP n p"
@@ -334,12 +331,12 @@
 defs
   "<=_def": "<= ==
 SOME u::nat => nat => bool.
-   (ALL m::nat. u m (0::nat) = (m = (0::nat))) &
+   (ALL m::nat. u m 0 = (m = 0)) &
    (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n))"
 
 lemma DEF__lessthan__equal_: "<= =
 (SOME u::nat => nat => bool.
-    (ALL m::nat. u m (0::nat) = (m = (0::nat))) &
+    (ALL m::nat. u m 0 = (m = 0)) &
     (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n)))"
   by (import hollight DEF__lessthan__equal_)
 
@@ -349,12 +346,12 @@
 defs
   "<_def": "< ==
 SOME u::nat => nat => bool.
-   (ALL m::nat. u m (0::nat) = False) &
+   (ALL m::nat. u m 0 = False) &
    (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n))"
 
 lemma DEF__lessthan_: "< =
 (SOME u::nat => nat => bool.
-    (ALL m::nat. u m (0::nat) = False) &
+    (ALL m::nat. u m 0 = False) &
     (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n)))"
   by (import hollight DEF__lessthan_)
 
@@ -388,10 +385,10 @@
 lemma LT_SUC: "ALL (x::nat) xa::nat. < (Suc x) (Suc xa) = < x xa"
   by (import hollight LT_SUC)
 
-lemma LE_0: "All (<= (0::nat))"
+lemma LE_0: "All (<= 0)"
   by (import hollight LE_0)
 
-lemma LT_0: "ALL x::nat. < (0::nat) (Suc x)"
+lemma LT_0: "ALL x::nat. < 0 (Suc x)"
   by (import hollight LT_0)
 
 lemma LE_REFL: "ALL n::nat. <= n n"
@@ -436,7 +433,7 @@
 lemma LTE_CASES: "ALL (x::nat) xa::nat. < x xa | <= xa x"
   by (import hollight LTE_CASES)
 
-lemma LT_NZ: "ALL n::nat. < (0::nat) n = (n ~= (0::nat))"
+lemma LT_NZ: "ALL n::nat. < 0 n = (n ~= 0)"
   by (import hollight LT_NZ)
 
 lemma LE_LT: "ALL (m::nat) n::nat. <= m n = (< m n | m = n)"
@@ -469,10 +466,10 @@
 lemma LE_ADDR: "ALL (x::nat) xa::nat. <= xa (x + xa)"
   by (import hollight LE_ADDR)
 
-lemma LT_ADD: "ALL (m::nat) n::nat. < m (m + n) = < (0::nat) n"
+lemma LT_ADD: "ALL (m::nat) n::nat. < m (m + n) = < 0 n"
   by (import hollight LT_ADD)
 
-lemma LT_ADDR: "ALL (x::nat) xa::nat. < xa (x + xa) = < (0::nat) x"
+lemma LT_ADDR: "ALL (x::nat) xa::nat. < xa (x + xa) = < 0 x"
   by (import hollight LT_ADDR)
 
 lemma LE_ADD_LCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x + xa) (x + xb) = <= xa xb"
@@ -501,28 +498,26 @@
 lemma LT_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m p & < n q --> < (m + n) (p + q)"
   by (import hollight LT_ADD2)
 
-lemma LT_MULT: "ALL (m::nat) n::nat. < (0::nat) (m * n) = (< (0::nat) m & < (0::nat) n)"
+lemma LT_MULT: "ALL (m::nat) n::nat. < 0 (m * n) = (< 0 m & < 0 n)"
   by (import hollight LT_MULT)
 
 lemma LE_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat.
    <= m n & <= p q --> <= (m * p) (n * q)"
   by (import hollight LE_MULT2)
 
-lemma LT_LMULT: "ALL (m::nat) (n::nat) p::nat. m ~= (0::nat) & < n p --> < (m * n) (m * p)"
+lemma LT_LMULT: "ALL (m::nat) (n::nat) p::nat. m ~= 0 & < n p --> < (m * n) (m * p)"
   by (import hollight LT_LMULT)
 
-lemma LE_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. <= (m * n) (m * p) = (m = (0::nat) | <= n p)"
+lemma LE_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. <= (m * n) (m * p) = (m = 0 | <= n p)"
   by (import hollight LE_MULT_LCANCEL)
 
-lemma LE_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat.
-   <= (x * xb) (xa * xb) = (<= x xa | xb = (0::nat))"
+lemma LE_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x * xb) (xa * xb) = (<= x xa | xb = 0)"
   by (import hollight LE_MULT_RCANCEL)
 
-lemma LT_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. < (m * n) (m * p) = (m ~= (0::nat) & < n p)"
+lemma LT_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. < (m * n) (m * p) = (m ~= 0 & < n p)"
   by (import hollight LT_MULT_LCANCEL)
 
-lemma LT_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat.
-   < (x * xb) (xa * xb) = (< x xa & xb ~= (0::nat))"
+lemma LT_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. < (x * xb) (xa * xb) = (< x xa & xb ~= 0)"
   by (import hollight LT_MULT_RCANCEL)
 
 lemma LT_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m n & < p q --> < (m * p) (n * q)"
@@ -558,22 +553,21 @@
   EVEN :: "nat => bool" 
   "EVEN ==
 SOME EVEN::nat => bool.
-   EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
+   EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
 
 lemma DEF_EVEN: "EVEN =
 (SOME EVEN::nat => bool.
-    EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
+    EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   by (import hollight DEF_EVEN)
 
 constdefs
   ODD :: "nat => bool" 
   "ODD ==
-SOME ODD::nat => bool.
-   ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
+SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
 
 lemma DEF_ODD: "ODD =
 (SOME ODD::nat => bool.
-    ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n)))"
+    ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n)))"
   by (import hollight DEF_ODD)
 
 lemma NOT_EVEN: "ALL n::nat. (~ EVEN n) = ODD n"
@@ -594,7 +588,7 @@
 lemma EVEN_MULT: "ALL (m::nat) n::nat. EVEN (m * n) = (EVEN m | EVEN n)"
   by (import hollight EVEN_MULT)
 
-lemma EVEN_EXP: "ALL (m::nat) n::nat. EVEN (EXP m n) = (EVEN m & n ~= (0::nat))"
+lemma EVEN_EXP: "ALL (m::nat) n::nat. EVEN (EXP m n) = (EVEN m & n ~= 0)"
   by (import hollight EVEN_EXP)
 
 lemma ODD_ADD: "ALL (m::nat) n::nat. ODD (m + n) = (ODD m ~= ODD n)"
@@ -603,83 +597,76 @@
 lemma ODD_MULT: "ALL (m::nat) n::nat. ODD (m * n) = (ODD m & ODD n)"
   by (import hollight ODD_MULT)
 
-lemma ODD_EXP: "ALL (m::nat) n::nat. ODD (EXP m n) = (ODD m | n = (0::nat))"
+lemma ODD_EXP: "ALL (m::nat) n::nat. ODD (EXP m n) = (ODD m | n = 0)"
   by (import hollight ODD_EXP)
 
-lemma EVEN_DOUBLE: "ALL n::nat. EVEN (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * n)"
+lemma EVEN_DOUBLE: "ALL n::nat. EVEN (NUMERAL_BIT0 (NUMERAL_BIT1 0) * n)"
   by (import hollight EVEN_DOUBLE)
 
-lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * x))"
+lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * x))"
   by (import hollight ODD_DOUBLE)
 
 lemma EVEN_EXISTS_LEMMA: "ALL n::nat.
-   (EVEN n --> (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)) &
-   (~ EVEN n -->
-    (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)))"
+   (EVEN n --> (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)) &
+   (~ EVEN n --> (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)))"
   by (import hollight EVEN_EXISTS_LEMMA)
 
-lemma EVEN_EXISTS: "ALL n::nat.
-   EVEN n = (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)"
+lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)"
   by (import hollight EVEN_EXISTS)
 
-lemma ODD_EXISTS: "ALL n::nat.
-   ODD n = (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m))"
+lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m))"
   by (import hollight ODD_EXISTS)
 
 lemma EVEN_ODD_DECOMPOSITION: "ALL n::nat.
    (EX (k::nat) m::nat.
-       ODD m & n = EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) k * m) =
-   (n ~= (0::nat))"
+       ODD m & n = EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) k * m) =
+   (n ~= 0)"
   by (import hollight EVEN_ODD_DECOMPOSITION)
 
-lemma SUB_0: "ALL x::nat. (0::nat) - x = (0::nat) & x - (0::nat) = x"
+lemma SUB_0: "ALL x::nat. 0 - x = 0 & x - 0 = x"
   by (import hollight SUB_0)
 
 lemma SUB_PRESUC: "ALL (m::nat) n::nat. Pred (Suc m - n) = m - n"
   by (import hollight SUB_PRESUC)
 
-lemma SUB_EQ_0: "ALL (m::nat) n::nat. (m - n = (0::nat)) = <= m n"
+lemma SUB_EQ_0: "ALL (m::nat) n::nat. (m - n = 0) = <= m n"
   by (import hollight SUB_EQ_0)
 
-lemma ADD_SUBR: "ALL (x::nat) xa::nat. xa - (x + xa) = (0::nat)"
+lemma ADD_SUBR: "ALL (x::nat) xa::nat. xa - (x + xa) = 0"
   by (import hollight ADD_SUBR)
 
 lemma SUB_ADD: "ALL (x::nat) xa::nat. <= xa x --> x - xa + xa = x"
   by (import hollight SUB_ADD)
 
-lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 (0::nat) = x"
+lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
   by (import hollight SUC_SUB1)
 
 constdefs
   FACT :: "nat => nat" 
   "FACT ==
 SOME FACT::nat => nat.
-   FACT (0::nat) = NUMERAL_BIT1 (0::nat) &
-   (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
+   FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
 
 lemma DEF_FACT: "FACT =
 (SOME FACT::nat => nat.
-    FACT (0::nat) = NUMERAL_BIT1 (0::nat) &
-    (ALL n::nat. FACT (Suc n) = Suc n * FACT n))"
+    FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n))"
   by (import hollight DEF_FACT)
 
-lemma FACT_LT: "ALL n::nat. < (0::nat) (FACT n)"
+lemma FACT_LT: "ALL n::nat. < 0 (FACT n)"
   by (import hollight FACT_LT)
 
-lemma FACT_LE: "ALL x::nat. <= (NUMERAL_BIT1 (0::nat)) (FACT x)"
+lemma FACT_LE: "ALL x::nat. <= (NUMERAL_BIT1 0) (FACT x)"
   by (import hollight FACT_LE)
 
 lemma FACT_MONO: "ALL (m::nat) n::nat. <= m n --> <= (FACT m) (FACT n)"
   by (import hollight FACT_MONO)
 
-lemma DIVMOD_EXIST: "ALL (m::nat) n::nat.
-   n ~= (0::nat) --> (EX (q::nat) r::nat. m = q * n + r & < r n)"
+lemma DIVMOD_EXIST: "ALL (m::nat) n::nat. n ~= 0 --> (EX (q::nat) r::nat. m = q * n + r & < r n)"
   by (import hollight DIVMOD_EXIST)
 
 lemma DIVMOD_EXIST_0: "ALL (m::nat) n::nat.
    EX (x::nat) xa::nat.
-      COND (n = (0::nat)) (x = (0::nat) & xa = (0::nat))
-       (m = x * n + xa & < xa n)"
+      COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
   by (import hollight DIVMOD_EXIST_0)
 
 constdefs
@@ -688,14 +675,14 @@
 SOME q::nat => nat => nat.
    EX r::nat => nat => nat.
       ALL (m::nat) n::nat.
-         COND (n = (0::nat)) (q m n = (0::nat) & r m n = (0::nat))
+         COND (n = 0) (q m n = 0 & r m n = 0)
           (m = q m n * n + r m n & < (r m n) n)"
 
 lemma DEF_DIV: "DIV =
 (SOME q::nat => nat => nat.
     EX r::nat => nat => nat.
        ALL (m::nat) n::nat.
-          COND (n = (0::nat)) (q m n = (0::nat) & r m n = (0::nat))
+          COND (n = 0) (q m n = 0 & r m n = 0)
            (m = q m n * n + r m n & < (r m n) n))"
   by (import hollight DEF_DIV)
 
@@ -704,18 +691,17 @@
   "MOD ==
 SOME r::nat => nat => nat.
    ALL (m::nat) n::nat.
-      COND (n = (0::nat)) (DIV m n = (0::nat) & r m n = (0::nat))
+      COND (n = 0) (DIV m n = 0 & r m n = 0)
        (m = DIV m n * n + r m n & < (r m n) n)"
 
 lemma DEF_MOD: "MOD =
 (SOME r::nat => nat => nat.
     ALL (m::nat) n::nat.
-       COND (n = (0::nat)) (DIV m n = (0::nat) & r m n = (0::nat))
+       COND (n = 0) (DIV m n = 0 & r m n = 0)
         (m = DIV m n * n + r m n & < (r m n) n))"
   by (import hollight DEF_MOD)
 
-lemma DIVISION: "ALL (m::nat) n::nat.
-   n ~= (0::nat) --> m = DIV m n * n + MOD m n & < (MOD m n) n"
+lemma DIVISION: "ALL (m::nat) n::nat. n ~= 0 --> m = DIV m n * n + MOD m n & < (MOD m n) n"
   by (import hollight DIVISION)
 
 lemma DIVMOD_UNIQ_LEMMA: "ALL (m::nat) (n::nat) (q1::nat) (r1::nat) (q2::nat) r2::nat.
@@ -733,14 +719,13 @@
 lemma DIV_UNIQ: "ALL (m::nat) (n::nat) (q::nat) r::nat. m = q * n + r & < r n --> DIV m n = q"
   by (import hollight DIV_UNIQ)
 
-lemma MOD_MULT: "ALL (x::nat) xa::nat. x ~= (0::nat) --> MOD (x * xa) x = (0::nat)"
+lemma MOD_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> MOD (x * xa) x = 0"
   by (import hollight MOD_MULT)
 
-lemma DIV_MULT: "ALL (x::nat) xa::nat. x ~= (0::nat) --> DIV (x * xa) x = xa"
+lemma DIV_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> DIV (x * xa) x = xa"
   by (import hollight DIV_MULT)
 
-lemma DIV_DIV: "ALL (m::nat) (n::nat) p::nat.
-   n * p ~= (0::nat) --> DIV (DIV m n) p = DIV m (n * p)"
+lemma DIV_DIV: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> DIV (DIV m n) p = DIV m (n * p)"
   by (import hollight DIV_DIV)
 
 lemma MOD_LT: "ALL (m::nat) n::nat. < m n --> MOD m n = m"
@@ -750,166 +735,150 @@
   by (import hollight MOD_EQ)
 
 lemma DIV_MOD: "ALL (m::nat) (n::nat) p::nat.
-   n * p ~= (0::nat) --> MOD (DIV m n) p = DIV (MOD m (n * p)) n"
+   n * p ~= 0 --> MOD (DIV m n) p = DIV (MOD m (n * p)) n"
   by (import hollight DIV_MOD)
 
-lemma DIV_1: "ALL n::nat. DIV n (NUMERAL_BIT1 (0::nat)) = n"
+lemma DIV_1: "ALL n::nat. DIV n (NUMERAL_BIT1 0) = n"
   by (import hollight DIV_1)
 
-lemma EXP_LT_0: "ALL (x::nat) xa::nat.
-   < (0::nat) (EXP xa x) = (xa ~= (0::nat) | x = (0::nat))"
+lemma EXP_LT_0: "ALL (x::nat) xa::nat. < 0 (EXP xa x) = (xa ~= 0 | x = 0)"
   by (import hollight EXP_LT_0)
 
-lemma DIV_LE: "ALL (m::nat) n::nat. n ~= (0::nat) --> <= (DIV m n) m"
+lemma DIV_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (DIV m n) m"
   by (import hollight DIV_LE)
 
 lemma DIV_MUL_LE: "ALL (m::nat) n::nat. <= (n * DIV m n) m"
   by (import hollight DIV_MUL_LE)
 
-lemma DIV_0: "ALL n::nat. n ~= (0::nat) --> DIV (0::nat) n = (0::nat)"
+lemma DIV_0: "ALL n::nat. n ~= 0 --> DIV 0 n = 0"
   by (import hollight DIV_0)
 
-lemma MOD_0: "ALL n::nat. n ~= (0::nat) --> MOD (0::nat) n = (0::nat)"
+lemma MOD_0: "ALL n::nat. n ~= 0 --> MOD 0 n = 0"
   by (import hollight MOD_0)
 
-lemma DIV_LT: "ALL (m::nat) n::nat. < m n --> DIV m n = (0::nat)"
+lemma DIV_LT: "ALL (m::nat) n::nat. < m n --> DIV m n = 0"
   by (import hollight DIV_LT)
 
-lemma MOD_MOD: "ALL (m::nat) (n::nat) p::nat.
-   n * p ~= (0::nat) --> MOD (MOD m (n * p)) n = MOD m n"
+lemma MOD_MOD: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> MOD (MOD m (n * p)) n = MOD m n"
   by (import hollight MOD_MOD)
 
-lemma MOD_MOD_REFL: "ALL (m::nat) n::nat. n ~= (0::nat) --> MOD (MOD m n) n = MOD m n"
+lemma MOD_MOD_REFL: "ALL (m::nat) n::nat. n ~= 0 --> MOD (MOD m n) n = MOD m n"
   by (import hollight MOD_MOD_REFL)
 
 lemma DIV_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
-   x * xb ~= (0::nat) --> DIV (x * xa) (x * xb) = DIV xa xb"
+   x * xb ~= 0 --> DIV (x * xa) (x * xb) = DIV xa xb"
   by (import hollight DIV_MULT2)
 
 lemma MOD_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
-   x * xb ~= (0::nat) --> MOD (x * xa) (x * xb) = x * MOD xa xb"
+   x * xb ~= 0 --> MOD (x * xa) (x * xb) = x * MOD xa xb"
   by (import hollight MOD_MULT2)
 
-lemma MOD_1: "ALL n::nat. MOD n (NUMERAL_BIT1 (0::nat)) = (0::nat)"
+lemma MOD_1: "ALL n::nat. MOD n (NUMERAL_BIT1 0) = 0"
   by (import hollight MOD_1)
 
 lemma MOD_EXISTS: "ALL (m::nat) n::nat.
-   (EX q::nat. m = n * q) =
-   COND (n = (0::nat)) (m = (0::nat)) (MOD m n = (0::nat))"
+   (EX q::nat. m = n * q) = COND (n = 0) (m = 0) (MOD m n = 0)"
   by (import hollight MOD_EXISTS)
 
 lemma LT_EXP: "ALL (x::nat) (m::nat) n::nat.
    < (EXP x m) (EXP x n) =
-   (<= (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) x & < m n |
-    x = (0::nat) & m ~= (0::nat) & n = (0::nat))"
+   (<= (NUMERAL_BIT0 (NUMERAL_BIT1 0)) x & < m n | x = 0 & m ~= 0 & n = 0)"
   by (import hollight LT_EXP)
 
 lemma LE_EXP: "ALL (x::nat) (m::nat) n::nat.
    <= (EXP x m) (EXP x n) =
-   COND (x = (0::nat)) (m = (0::nat) --> n = (0::nat))
-    (x = NUMERAL_BIT1 (0::nat) | <= m n)"
+   COND (x = 0) (m = 0 --> n = 0) (x = NUMERAL_BIT1 0 | <= m n)"
   by (import hollight LE_EXP)
 
-lemma DIV_MONO: "ALL (m::nat) (n::nat) p::nat.
-   p ~= (0::nat) & <= m n --> <= (DIV m p) (DIV n p)"
+lemma DIV_MONO: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= m n --> <= (DIV m p) (DIV n p)"
   by (import hollight DIV_MONO)
 
 lemma DIV_MONO_LT: "ALL (m::nat) (n::nat) p::nat.
-   p ~= (0::nat) & <= (m + p) n --> < (DIV m p) (DIV n p)"
+   p ~= 0 & <= (m + p) n --> < (DIV m p) (DIV n p)"
   by (import hollight DIV_MONO_LT)
 
-lemma LE_LDIV: "ALL (a::nat) (b::nat) n::nat.
-   a ~= (0::nat) & <= b (a * n) --> <= (DIV b a) n"
+lemma LE_LDIV: "ALL (a::nat) (b::nat) n::nat. a ~= 0 & <= b (a * n) --> <= (DIV b a) n"
   by (import hollight LE_LDIV)
 
-lemma LE_RDIV_EQ: "ALL (a::nat) (b::nat) n::nat.
-   a ~= (0::nat) --> <= n (DIV b a) = <= (a * n) b"
+lemma LE_RDIV_EQ: "ALL (a::nat) (b::nat) n::nat. a ~= 0 --> <= n (DIV b a) = <= (a * n) b"
   by (import hollight LE_RDIV_EQ)
 
 lemma LE_LDIV_EQ: "ALL (a::nat) (b::nat) n::nat.
-   a ~= (0::nat) --> <= (DIV b a) n = < b (a * (n + NUMERAL_BIT1 (0::nat)))"
+   a ~= 0 --> <= (DIV b a) n = < b (a * (n + NUMERAL_BIT1 0))"
   by (import hollight LE_LDIV_EQ)
 
-lemma DIV_EQ_0: "ALL (m::nat) n::nat. n ~= (0::nat) --> (DIV m n = (0::nat)) = < m n"
+lemma DIV_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (DIV m n = 0) = < m n"
   by (import hollight DIV_EQ_0)
 
-lemma MOD_EQ_0: "ALL (m::nat) n::nat.
-   n ~= (0::nat) --> (MOD m n = (0::nat)) = (EX q::nat. m = q * n)"
+lemma MOD_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (MOD m n = 0) = (EX q::nat. m = q * n)"
   by (import hollight MOD_EQ_0)
 
-lemma EVEN_MOD: "ALL n::nat.
-   EVEN n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = (0::nat))"
+lemma EVEN_MOD: "ALL n::nat. EVEN n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = 0)"
   by (import hollight EVEN_MOD)
 
-lemma ODD_MOD: "ALL n::nat.
-   ODD n =
-   (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = NUMERAL_BIT1 (0::nat))"
+lemma ODD_MOD: "ALL n::nat. ODD n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = NUMERAL_BIT1 0)"
   by (import hollight ODD_MOD)
 
-lemma MOD_MULT_RMOD: "ALL (m::nat) (n::nat) p::nat.
-   n ~= (0::nat) --> MOD (m * MOD p n) n = MOD (m * p) n"
+lemma MOD_MULT_RMOD: "ALL (m::nat) (n::nat) p::nat. n ~= 0 --> MOD (m * MOD p n) n = MOD (m * p) n"
   by (import hollight MOD_MULT_RMOD)
 
 lemma MOD_MULT_LMOD: "ALL (x::nat) (xa::nat) xb::nat.
-   xa ~= (0::nat) --> MOD (MOD x xa * xb) xa = MOD (x * xb) xa"
+   xa ~= 0 --> MOD (MOD x xa * xb) xa = MOD (x * xb) xa"
   by (import hollight MOD_MULT_LMOD)
 
 lemma MOD_MULT_MOD2: "ALL (x::nat) (xa::nat) xb::nat.
-   xa ~= (0::nat) --> MOD (MOD x xa * MOD xb xa) xa = MOD (x * xb) xa"
+   xa ~= 0 --> MOD (MOD x xa * MOD xb xa) xa = MOD (x * xb) xa"
   by (import hollight MOD_MULT_MOD2)
 
 lemma MOD_EXP_MOD: "ALL (m::nat) (n::nat) p::nat.
-   n ~= (0::nat) --> MOD (EXP (MOD m n) p) n = MOD (EXP m p) n"
+   n ~= 0 --> MOD (EXP (MOD m n) p) n = MOD (EXP m p) n"
   by (import hollight MOD_EXP_MOD)
 
 lemma MOD_MULT_ADD: "ALL (m::nat) (n::nat) p::nat. MOD (m * n + p) n = MOD p n"
   by (import hollight MOD_MULT_ADD)
 
 lemma MOD_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
-   n ~= (0::nat) --> MOD (MOD a n + MOD b n) n = MOD (a + b) n"
+   n ~= 0 --> MOD (MOD a n + MOD b n) n = MOD (a + b) n"
   by (import hollight MOD_ADD_MOD)
 
 lemma DIV_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
-   n ~= (0::nat) -->
+   n ~= 0 -->
    (MOD (a + b) n = MOD a n + MOD b n) = (DIV (a + b) n = DIV a n + DIV b n)"
   by (import hollight DIV_ADD_MOD)
 
-lemma DIV_REFL: "ALL n::nat. n ~= (0::nat) --> DIV n n = NUMERAL_BIT1 (0::nat)"
+lemma DIV_REFL: "ALL n::nat. n ~= 0 --> DIV n n = NUMERAL_BIT1 0"
   by (import hollight DIV_REFL)
 
-lemma MOD_LE: "ALL (m::nat) n::nat. n ~= (0::nat) --> <= (MOD m n) m"
+lemma MOD_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (MOD m n) m"
   by (import hollight MOD_LE)
 
-lemma DIV_MONO2: "ALL (m::nat) (n::nat) p::nat.
-   p ~= (0::nat) & <= p m --> <= (DIV n m) (DIV n p)"
+lemma DIV_MONO2: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= p m --> <= (DIV n m) (DIV n p)"
   by (import hollight DIV_MONO2)
 
 lemma DIV_LE_EXCLUSION: "ALL (a::nat) (b::nat) (c::nat) d::nat.
-   b ~= (0::nat) & < (b * c) ((a + NUMERAL_BIT1 (0::nat)) * d) -->
-   <= (DIV c d) (DIV a b)"
+   b ~= 0 & < (b * c) ((a + NUMERAL_BIT1 0) * d) --> <= (DIV c d) (DIV a b)"
   by (import hollight DIV_LE_EXCLUSION)
 
-lemma DIV_EQ_EXCLUSION: "< ((b::nat) * (c::nat)) (((a::nat) + NUMERAL_BIT1 (0::nat)) * (d::nat)) &
-< (a * d) ((c + NUMERAL_BIT1 (0::nat)) * b) -->
+lemma DIV_EQ_EXCLUSION: "< ((b::nat) * (c::nat)) (((a::nat) + NUMERAL_BIT1 0) * (d::nat)) &
+< (a * d) ((c + NUMERAL_BIT1 0) * b) -->
 DIV a b = DIV c d"
   by (import hollight DIV_EQ_EXCLUSION)
 
 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))"
+(ALL x::nat. (b = a + x --> P 0) & (a = b + x --> P x))"
   by (import hollight SUB_ELIM_THM)
 
 lemma PRE_ELIM_THM: "(P::nat => bool) (Pred (n::nat)) =
-(ALL m::nat. (n = (0::nat) --> P (0::nat)) & (n = Suc m --> P m))"
+(ALL m::nat. (n = 0 --> P 0) & (n = Suc m --> P m))"
   by (import hollight PRE_ELIM_THM)
 
 lemma DIVMOD_ELIM_THM: "(P::nat => nat => bool) (DIV (m::nat) (n::nat)) (MOD m n) =
-(n = (0::nat) & P (0::nat) (0::nat) |
- n ~= (0::nat) & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
+(n = 0 & P 0 0 |
+ n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   by (import hollight DIVMOD_ELIM_THM)
 
 constdefs
-  eqeq :: "'q_9910::type
-=> 'q_9909::type => ('q_9910::type => 'q_9909::type => bool) => bool" 
+  eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" 
   "eqeq ==
 %(u::'q_9910::type) (ua::'q_9909::type)
    ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
@@ -942,7 +911,7 @@
   by (import hollight MINIMAL)
 
 constdefs
-  WF :: "('A::type => 'A::type => bool) => bool" 
+  WF :: "('A => 'A => bool) => bool" 
   "WF ==
 %u::'A::type => 'A::type => bool.
    ALL P::'A::type => bool.
@@ -1081,7 +1050,7 @@
   by (import hollight WF_REC_num)
 
 consts
-  measure :: "('q_11107::type => nat) => 'q_11107::type => 'q_11107::type => bool" 
+  measure :: "('q_11107 => nat) => 'q_11107 => 'q_11107 => bool" 
 
 defs
   measure_def: "hollight.measure ==
@@ -1128,73 +1097,216 @@
        ALL x::'A::type. f x = COND (P f x) (f (G f x)) (H f x))"
   by (import hollight WF_REC_TAIL_GENERAL)
 
-lemma ARITH_ZERO: "(0::nat) = (0::nat) & NUMERAL_BIT0 (0::nat) = (0::nat)"
+lemma ARITH_ZERO: "(op &::bool => bool => bool) ((op =::nat => nat => bool) (0::nat) (0::nat))
+ ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) (0::nat)) (0::nat))"
   by (import hollight ARITH_ZERO)
 
 lemma ARITH_SUC: "(ALL x::nat. Suc x = Suc x) &
-Suc (0::nat) = NUMERAL_BIT1 (0::nat) &
+Suc 0 = NUMERAL_BIT1 0 &
 (ALL x::nat. Suc (NUMERAL_BIT0 x) = NUMERAL_BIT1 x) &
 (ALL x::nat. Suc (NUMERAL_BIT1 x) = NUMERAL_BIT0 (Suc x))"
   by (import hollight ARITH_SUC)
 
 lemma ARITH_PRE: "(ALL x::nat. Pred x = Pred x) &
-Pred (0::nat) = (0::nat) &
+Pred 0 = 0 &
 (ALL x::nat.
-    Pred (NUMERAL_BIT0 x) =
-    COND (x = (0::nat)) (0::nat) (NUMERAL_BIT1 (Pred x))) &
+    Pred (NUMERAL_BIT0 x) = COND (x = 0) 0 (NUMERAL_BIT1 (Pred x))) &
 (ALL x::nat. Pred (NUMERAL_BIT1 x) = NUMERAL_BIT0 x)"
   by (import hollight ARITH_PRE)
 
-lemma ARITH_ADD: "(ALL (x::nat) xa::nat. x + xa = x + xa) &
-(0::nat) + (0::nat) = (0::nat) &
-(ALL x::nat. (0::nat) + NUMERAL_BIT0 x = NUMERAL_BIT0 x) &
-(ALL x::nat. (0::nat) + NUMERAL_BIT1 x = NUMERAL_BIT1 x) &
-(ALL x::nat. NUMERAL_BIT0 x + (0::nat) = NUMERAL_BIT0 x) &
-(ALL x::nat. NUMERAL_BIT1 x + (0::nat) = NUMERAL_BIT1 x) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT0 x + NUMERAL_BIT0 xa = NUMERAL_BIT0 (x + xa)) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT0 x + NUMERAL_BIT1 xa = NUMERAL_BIT1 (x + xa)) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT1 x + NUMERAL_BIT0 xa = NUMERAL_BIT1 (x + xa)) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT1 x + NUMERAL_BIT1 xa = NUMERAL_BIT0 (Suc (x + xa)))"
+lemma ARITH_ADD: "(op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (All::(nat => bool) => bool)
+        (%xa::nat.
+            (op =::nat => nat => bool) ((op +::nat => nat => nat) x xa)
+             ((op +::nat => nat => nat) x xa))))
+ ((op &::bool => bool => bool)
+   ((op =::nat => nat => bool) ((op +::nat => nat => nat) (0::nat) (0::nat))
+     (0::nat))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (op =::nat => nat => bool)
+            ((op +::nat => nat => nat) (0::nat)
+              ((NUMERAL_BIT0::nat => nat) x))
+            ((NUMERAL_BIT0::nat => nat) x)))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (op =::nat => nat => bool)
+              ((op +::nat => nat => nat) (0::nat)
+                ((NUMERAL_BIT1::nat => nat) x))
+              ((NUMERAL_BIT1::nat => nat) x)))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::nat => nat => bool)
+                ((op +::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
+                  (0::nat))
+                ((NUMERAL_BIT0::nat => nat) x)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::nat => nat => bool)
+                  ((op +::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
+                    (0::nat))
+                  ((NUMERAL_BIT1::nat => nat) x)))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%x::nat.
+                   (All::(nat => bool) => bool)
+                    (%xa::nat.
+                        (op =::nat => nat => bool)
+                         ((op +::nat => nat => nat)
+                           ((NUMERAL_BIT0::nat => nat) x)
+                           ((NUMERAL_BIT0::nat => nat) xa))
+                         ((NUMERAL_BIT0::nat => nat)
+                           ((op +::nat => nat => nat) x xa)))))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%x::nat.
+                     (All::(nat => bool) => bool)
+                      (%xa::nat.
+                          (op =::nat => nat => bool)
+                           ((op +::nat => nat => nat)
+                             ((NUMERAL_BIT0::nat => nat) x)
+                             ((NUMERAL_BIT1::nat => nat) xa))
+                           ((NUMERAL_BIT1::nat => nat)
+                             ((op +::nat => nat => nat) x xa)))))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::nat => nat => bool)
+                             ((op +::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT0::nat => nat) xa))
+                             ((NUMERAL_BIT1::nat => nat)
+                               ((op +::nat => nat => nat) x xa)))))
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::nat => nat => bool)
+                             ((op +::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT1::nat => nat) xa))
+                             ((NUMERAL_BIT0::nat => nat)
+                               ((Suc::nat => nat)
+                                 ((op +::nat => nat => nat) x
+                                   xa))))))))))))))"
   by (import hollight ARITH_ADD)
 
-lemma ARITH_MULT: "(ALL (x::nat) xa::nat. x * xa = x * xa) &
-(0::nat) * (0::nat) = (0::nat) &
-(ALL x::nat. (0::nat) * NUMERAL_BIT0 x = (0::nat)) &
-(ALL x::nat. (0::nat) * NUMERAL_BIT1 x = (0::nat)) &
-(ALL x::nat. NUMERAL_BIT0 x * (0::nat) = (0::nat)) &
-(ALL x::nat. NUMERAL_BIT1 x * (0::nat) = (0::nat)) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT0 x * NUMERAL_BIT0 xa =
-    NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT0 x * NUMERAL_BIT1 xa =
-    NUMERAL_BIT0 x + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT1 x * NUMERAL_BIT0 xa =
-    NUMERAL_BIT0 xa + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
-(ALL (x::nat) xa::nat.
-    NUMERAL_BIT1 x * NUMERAL_BIT1 xa =
-    NUMERAL_BIT1 x +
-    (NUMERAL_BIT0 xa + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))))"
+lemma ARITH_MULT: "(op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (All::(nat => bool) => bool)
+        (%xa::nat.
+            (op =::nat => nat => bool) ((op *::nat => nat => nat) x xa)
+             ((op *::nat => nat => nat) x xa))))
+ ((op &::bool => bool => bool)
+   ((op =::nat => nat => bool) ((op *::nat => nat => nat) (0::nat) (0::nat))
+     (0::nat))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (op =::nat => nat => bool)
+            ((op *::nat => nat => nat) (0::nat)
+              ((NUMERAL_BIT0::nat => nat) x))
+            (0::nat)))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (op =::nat => nat => bool)
+              ((op *::nat => nat => nat) (0::nat)
+                ((NUMERAL_BIT1::nat => nat) x))
+              (0::nat)))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::nat => nat => bool)
+                ((op *::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
+                  (0::nat))
+                (0::nat)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::nat => nat => bool)
+                  ((op *::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
+                    (0::nat))
+                  (0::nat)))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%x::nat.
+                   (All::(nat => bool) => bool)
+                    (%xa::nat.
+                        (op =::nat => nat => bool)
+                         ((op *::nat => nat => nat)
+                           ((NUMERAL_BIT0::nat => nat) x)
+                           ((NUMERAL_BIT0::nat => nat) xa))
+                         ((NUMERAL_BIT0::nat => nat)
+                           ((NUMERAL_BIT0::nat => nat)
+                             ((op *::nat => nat => nat) x xa))))))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%x::nat.
+                     (All::(nat => bool) => bool)
+                      (%xa::nat.
+                          (op =::nat => nat => bool)
+                           ((op *::nat => nat => nat)
+                             ((NUMERAL_BIT0::nat => nat) x)
+                             ((NUMERAL_BIT1::nat => nat) xa))
+                           ((op +::nat => nat => nat)
+                             ((NUMERAL_BIT0::nat => nat) x)
+                             ((NUMERAL_BIT0::nat => nat)
+                               ((NUMERAL_BIT0::nat => nat)
+                                 ((op *::nat => nat => nat) x xa)))))))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::nat => nat => bool)
+                             ((op *::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT0::nat => nat) xa))
+                             ((op +::nat => nat => nat)
+                               ((NUMERAL_BIT0::nat => nat) xa)
+                               ((NUMERAL_BIT0::nat => nat)
+                                 ((NUMERAL_BIT0::nat => nat)
+                                   ((op *::nat => nat => nat) x xa)))))))
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::nat => nat => bool)
+                             ((op *::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT1::nat => nat) xa))
+                             ((op +::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((op +::nat => nat => nat)
+                                 ((NUMERAL_BIT0::nat => nat) xa)
+                                 ((NUMERAL_BIT0::nat => nat)
+                                   ((NUMERAL_BIT0::nat => nat)
+                                     ((op *::nat => nat => nat) x
+ xa))))))))))))))))"
   by (import hollight ARITH_MULT)
 
 lemma ARITH_EXP: "(ALL (x::nat) xa::nat. EXP x xa = EXP x xa) &
-EXP (0::nat) (0::nat) = NUMERAL_BIT1 (0::nat) &
-(ALL m::nat. EXP (NUMERAL_BIT0 m) (0::nat) = NUMERAL_BIT1 (0::nat)) &
-(ALL m::nat. EXP (NUMERAL_BIT1 m) (0::nat) = NUMERAL_BIT1 (0::nat)) &
-(ALL n::nat.
-    EXP (0::nat) (NUMERAL_BIT0 n) = EXP (0::nat) n * EXP (0::nat) n) &
+EXP 0 0 = NUMERAL_BIT1 0 &
+(ALL m::nat. EXP (NUMERAL_BIT0 m) 0 = NUMERAL_BIT1 0) &
+(ALL m::nat. EXP (NUMERAL_BIT1 m) 0 = NUMERAL_BIT1 0) &
+(ALL n::nat. EXP 0 (NUMERAL_BIT0 n) = EXP 0 n * EXP 0 n) &
 (ALL (m::nat) n::nat.
     EXP (NUMERAL_BIT0 m) (NUMERAL_BIT0 n) =
     EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n) &
 (ALL (m::nat) n::nat.
     EXP (NUMERAL_BIT1 m) (NUMERAL_BIT0 n) =
     EXP (NUMERAL_BIT1 m) n * EXP (NUMERAL_BIT1 m) n) &
-(ALL n::nat. EXP (0::nat) (NUMERAL_BIT1 n) = (0::nat)) &
+(ALL n::nat. EXP 0 (NUMERAL_BIT1 n) = 0) &
 (ALL (m::nat) n::nat.
     EXP (NUMERAL_BIT0 m) (NUMERAL_BIT1 n) =
     NUMERAL_BIT0 m * (EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n)) &
@@ -1204,23 +1316,23 @@
   by (import hollight ARITH_EXP)
 
 lemma ARITH_EVEN: "(ALL x::nat. EVEN x = EVEN x) &
-EVEN (0::nat) = True &
+EVEN 0 = True &
 (ALL x::nat. EVEN (NUMERAL_BIT0 x) = True) &
 (ALL x::nat. EVEN (NUMERAL_BIT1 x) = False)"
   by (import hollight ARITH_EVEN)
 
 lemma ARITH_ODD: "(ALL x::nat. ODD x = ODD x) &
-ODD (0::nat) = False &
+ODD 0 = False &
 (ALL x::nat. ODD (NUMERAL_BIT0 x) = False) &
 (ALL x::nat. ODD (NUMERAL_BIT1 x) = True)"
   by (import hollight ARITH_ODD)
 
 lemma ARITH_LE: "(ALL (x::nat) xa::nat. <= x xa = <= x xa) &
-<= (0::nat) (0::nat) = True &
-(ALL x::nat. <= (NUMERAL_BIT0 x) (0::nat) = (x = (0::nat))) &
-(ALL x::nat. <= (NUMERAL_BIT1 x) (0::nat) = False) &
-(ALL x::nat. <= (0::nat) (NUMERAL_BIT0 x) = True) &
-(ALL x::nat. <= (0::nat) (NUMERAL_BIT1 x) = True) &
+<= 0 0 = True &
+(ALL x::nat. <= (NUMERAL_BIT0 x) 0 = (x = 0)) &
+(ALL x::nat. <= (NUMERAL_BIT1 x) 0 = False) &
+(ALL x::nat. <= 0 (NUMERAL_BIT0 x) = True) &
+(ALL x::nat. <= 0 (NUMERAL_BIT1 x) = True) &
 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = <= x xa) &
 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
@@ -1228,44 +1340,181 @@
   by (import hollight ARITH_LE)
 
 lemma ARITH_LT: "(ALL (x::nat) xa::nat. < x xa = < x xa) &
-< (0::nat) (0::nat) = False &
-(ALL x::nat. < (NUMERAL_BIT0 x) (0::nat) = False) &
-(ALL x::nat. < (NUMERAL_BIT1 x) (0::nat) = False) &
-(ALL x::nat. < (0::nat) (NUMERAL_BIT0 x) = < (0::nat) x) &
-(ALL x::nat. < (0::nat) (NUMERAL_BIT1 x) = True) &
+< 0 0 = False &
+(ALL x::nat. < (NUMERAL_BIT0 x) 0 = False) &
+(ALL x::nat. < (NUMERAL_BIT1 x) 0 = False) &
+(ALL x::nat. < 0 (NUMERAL_BIT0 x) = < 0 x) &
+(ALL x::nat. < 0 (NUMERAL_BIT1 x) = True) &
 (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = < x xa) &
 (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
 (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
 (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT1 xa) = < x xa)"
   by (import hollight ARITH_LT)
 
-lemma ARITH_EQ: "(ALL (x::nat) xa::nat. (x = xa) = (x = xa)) &
-((0::nat) = (0::nat)) = True &
-(ALL x::nat. (NUMERAL_BIT0 x = (0::nat)) = (x = (0::nat))) &
-(ALL x::nat. (NUMERAL_BIT1 x = (0::nat)) = False) &
-(ALL x::nat. ((0::nat) = NUMERAL_BIT0 x) = ((0::nat) = x)) &
-(ALL x::nat. ((0::nat) = NUMERAL_BIT1 x) = False) &
-(ALL (x::nat) xa::nat. (NUMERAL_BIT0 x = NUMERAL_BIT0 xa) = (x = xa)) &
-(ALL (x::nat) xa::nat. (NUMERAL_BIT0 x = NUMERAL_BIT1 xa) = False) &
-(ALL (x::nat) xa::nat. (NUMERAL_BIT1 x = NUMERAL_BIT0 xa) = False) &
-(ALL (x::nat) xa::nat. (NUMERAL_BIT1 x = NUMERAL_BIT1 xa) = (x = xa))"
+lemma ARITH_EQ: "(op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (All::(nat => bool) => bool)
+        (%xa::nat.
+            (op =::bool => bool => bool) ((op =::nat => nat => bool) x xa)
+             ((op =::nat => nat => bool) x xa))))
+ ((op &::bool => bool => bool)
+   ((op =::bool => bool => bool)
+     ((op =::nat => nat => bool) (0::nat) (0::nat)) (True::bool))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (op =::bool => bool => bool)
+            ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) x)
+              (0::nat))
+            ((op =::nat => nat => bool) x (0::nat))))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (op =::bool => bool => bool)
+              ((op =::nat => nat => bool) ((NUMERAL_BIT1::nat => nat) x)
+                (0::nat))
+              (False::bool)))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::bool => bool => bool)
+                ((op =::nat => nat => bool) (0::nat)
+                  ((NUMERAL_BIT0::nat => nat) x))
+                ((op =::nat => nat => bool) (0::nat) x)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::bool => bool => bool)
+                  ((op =::nat => nat => bool) (0::nat)
+                    ((NUMERAL_BIT1::nat => nat) x))
+                  (False::bool)))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%x::nat.
+                   (All::(nat => bool) => bool)
+                    (%xa::nat.
+                        (op =::bool => bool => bool)
+                         ((op =::nat => nat => bool)
+                           ((NUMERAL_BIT0::nat => nat) x)
+                           ((NUMERAL_BIT0::nat => nat) xa))
+                         ((op =::nat => nat => bool) x xa))))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%x::nat.
+                     (All::(nat => bool) => bool)
+                      (%xa::nat.
+                          (op =::bool => bool => bool)
+                           ((op =::nat => nat => bool)
+                             ((NUMERAL_BIT0::nat => nat) x)
+                             ((NUMERAL_BIT1::nat => nat) xa))
+                           (False::bool))))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::bool => bool => bool)
+                             ((op =::nat => nat => bool)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT0::nat => nat) xa))
+                             (False::bool))))
+                 ((All::(nat => bool) => bool)
+                   (%x::nat.
+                       (All::(nat => bool) => bool)
+                        (%xa::nat.
+                            (op =::bool => bool => bool)
+                             ((op =::nat => nat => bool)
+                               ((NUMERAL_BIT1::nat => nat) x)
+                               ((NUMERAL_BIT1::nat => nat) xa))
+                             ((op =::nat => nat => bool) x xa))))))))))))"
   by (import hollight ARITH_EQ)
 
-lemma ARITH_SUB: "(ALL (x::nat) xa::nat. x - xa = x - xa) &
-(0::nat) - (0::nat) = (0::nat) &
-(ALL x::nat. (0::nat) - NUMERAL_BIT0 x = (0::nat)) &
-(ALL x::nat. (0::nat) - NUMERAL_BIT1 x = (0::nat)) &
-(ALL x::nat. NUMERAL_BIT0 x - (0::nat) = NUMERAL_BIT0 x) &
-(ALL x::nat. NUMERAL_BIT1 x - (0::nat) = NUMERAL_BIT1 x) &
-(ALL (m::nat) n::nat.
-    NUMERAL_BIT0 m - NUMERAL_BIT0 n = NUMERAL_BIT0 (m - n)) &
-(ALL (m::nat) n::nat.
-    NUMERAL_BIT0 m - NUMERAL_BIT1 n = Pred (NUMERAL_BIT0 (m - n))) &
-(ALL (m::nat) n::nat.
-    NUMERAL_BIT1 m - NUMERAL_BIT0 n =
-    COND (<= n m) (NUMERAL_BIT1 (m - n)) (0::nat)) &
-(ALL (m::nat) n::nat.
-    NUMERAL_BIT1 m - NUMERAL_BIT1 n = NUMERAL_BIT0 (m - n))"
+lemma ARITH_SUB: "(op &::bool => bool => bool)
+ ((All::(nat => bool) => bool)
+   (%x::nat.
+       (All::(nat => bool) => bool)
+        (%xa::nat.
+            (op =::nat => nat => bool) ((op -::nat => nat => nat) x xa)
+             ((op -::nat => nat => nat) x xa))))
+ ((op &::bool => bool => bool)
+   ((op =::nat => nat => bool) ((op -::nat => nat => nat) (0::nat) (0::nat))
+     (0::nat))
+   ((op &::bool => bool => bool)
+     ((All::(nat => bool) => bool)
+       (%x::nat.
+           (op =::nat => nat => bool)
+            ((op -::nat => nat => nat) (0::nat)
+              ((NUMERAL_BIT0::nat => nat) x))
+            (0::nat)))
+     ((op &::bool => bool => bool)
+       ((All::(nat => bool) => bool)
+         (%x::nat.
+             (op =::nat => nat => bool)
+              ((op -::nat => nat => nat) (0::nat)
+                ((NUMERAL_BIT1::nat => nat) x))
+              (0::nat)))
+       ((op &::bool => bool => bool)
+         ((All::(nat => bool) => bool)
+           (%x::nat.
+               (op =::nat => nat => bool)
+                ((op -::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
+                  (0::nat))
+                ((NUMERAL_BIT0::nat => nat) x)))
+         ((op &::bool => bool => bool)
+           ((All::(nat => bool) => bool)
+             (%x::nat.
+                 (op =::nat => nat => bool)
+                  ((op -::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
+                    (0::nat))
+                  ((NUMERAL_BIT1::nat => nat) x)))
+           ((op &::bool => bool => bool)
+             ((All::(nat => bool) => bool)
+               (%m::nat.
+                   (All::(nat => bool) => bool)
+                    (%n::nat.
+                        (op =::nat => nat => bool)
+                         ((op -::nat => nat => nat)
+                           ((NUMERAL_BIT0::nat => nat) m)
+                           ((NUMERAL_BIT0::nat => nat) n))
+                         ((NUMERAL_BIT0::nat => nat)
+                           ((op -::nat => nat => nat) m n)))))
+             ((op &::bool => bool => bool)
+               ((All::(nat => bool) => bool)
+                 (%m::nat.
+                     (All::(nat => bool) => bool)
+                      (%n::nat.
+                          (op =::nat => nat => bool)
+                           ((op -::nat => nat => nat)
+                             ((NUMERAL_BIT0::nat => nat) m)
+                             ((NUMERAL_BIT1::nat => nat) n))
+                           ((Pred::nat => nat)
+                             ((NUMERAL_BIT0::nat => nat)
+                               ((op -::nat => nat => nat) m n))))))
+               ((op &::bool => bool => bool)
+                 ((All::(nat => bool) => bool)
+                   (%m::nat.
+                       (All::(nat => bool) => bool)
+                        (%n::nat.
+                            (op =::nat => nat => bool)
+                             ((op -::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) m)
+                               ((NUMERAL_BIT0::nat => nat) n))
+                             ((COND::bool => nat => nat => nat)
+                               ((<=::nat => nat => bool) n m)
+                               ((NUMERAL_BIT1::nat => nat)
+                                 ((op -::nat => nat => nat) m n))
+                               (0::nat)))))
+                 ((All::(nat => bool) => bool)
+                   (%m::nat.
+                       (All::(nat => bool) => bool)
+                        (%n::nat.
+                            (op =::nat => nat => bool)
+                             ((op -::nat => nat => nat)
+                               ((NUMERAL_BIT1::nat => nat) m)
+                               ((NUMERAL_BIT1::nat => nat) n))
+                             ((NUMERAL_BIT0::nat => nat)
+                               ((op -::nat => nat => nat) m n)))))))))))))"
   by (import hollight ARITH_SUB)
 
 lemma right_th: "(s::nat) * NUMERAL_BIT1 (x::nat) = s + NUMERAL_BIT0 (s * x)"
@@ -1282,7 +1531,7 @@
 (ALL x::'A::type. mul r0 x = r0) &
 (ALL (x::'A::type) (y::'A::type) z::'A::type.
     mul x (add y z) = add (mul x y) (mul x z)) &
-(ALL x::'A::type. (pwr::'A::type => nat => 'A::type) x (0::nat) = r1) &
+(ALL x::'A::type. (pwr::'A::type => nat => 'A::type) x 0 = r1) &
 (ALL (x::'A::type) n::nat. pwr x (Suc n) = mul x (pwr x n)) -->
 mul r1 (x::'A::type) = x &
 add (mul (a::'A::type) (m::'A::type)) (mul (b::'A::type) m) =
@@ -1318,24 +1567,24 @@
 mul (pwr x (p::nat)) (pwr x (q::nat)) = pwr x (p + q) &
 mul x (pwr x q) = pwr x (Suc q) &
 mul (pwr x q) x = pwr x (Suc q) &
-mul x x = pwr x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) &
+mul x x = pwr x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) &
 pwr (mul x (y::'A::type)) q = mul (pwr x q) (pwr y q) &
 pwr (pwr x p) q = pwr x (p * q) &
-pwr x (0::nat) = r1 &
-pwr x (NUMERAL_BIT1 (0::nat)) = x &
+pwr x 0 = r1 &
+pwr x (NUMERAL_BIT1 0) = x &
 mul x (add y (z::'A::type)) = add (mul x y) (mul x z) &
 pwr x (Suc q) = mul x (pwr x q)"
   by (import hollight SEMIRING_PTHS)
 
 lemma sth: "(ALL (x::nat) (y::nat) z::nat. x + (y + z) = x + y + z) &
 (ALL (x::nat) y::nat. x + y = y + x) &
-(ALL x::nat. (0::nat) + x = x) &
+(ALL x::nat. 0 + x = x) &
 (ALL (x::nat) (y::nat) z::nat. x * (y * z) = x * y * z) &
 (ALL (x::nat) y::nat. x * y = y * x) &
-(ALL x::nat. NUMERAL_BIT1 (0::nat) * x = x) &
-(ALL x::nat. (0::nat) * x = (0::nat)) &
+(ALL x::nat. NUMERAL_BIT1 0 * x = x) &
+(ALL x::nat. 0 * x = 0) &
 (ALL (x::nat) (xa::nat) xb::nat. x * (xa + xb) = x * xa + x * xb) &
-(ALL x::nat. EXP x (0::nat) = NUMERAL_BIT1 (0::nat)) &
+(ALL x::nat. EXP x 0 = NUMERAL_BIT1 0) &
 (ALL (x::nat) xa::nat. EXP x (Suc xa) = x * EXP x xa)"
   by (import hollight sth)
 
@@ -1343,7 +1592,7 @@
 (w * y + x * z = w * z + x * y) = (w = x | y = z)"
   by (import hollight NUM_INTEGRAL_LEMMA)
 
-lemma NUM_INTEGRAL: "(ALL x::nat. (0::nat) * x = (0::nat)) &
+lemma NUM_INTEGRAL: "(ALL x::nat. 0 * x = 0) &
 (ALL (x::nat) (xa::nat) xb::nat. (x + xa = x + xb) = (xa = xb)) &
 (ALL (w::nat) (x::nat) (y::nat) z::nat.
     (w * y + x * z = w * z + x * y) = (w = x | y = z))"
@@ -1360,13 +1609,13 @@
   NUMPAIR :: "nat => nat => nat" 
   "NUMPAIR ==
 %(u::nat) ua::nat.
-   EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) u *
-   (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua + NUMERAL_BIT1 (0::nat))"
+   EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
+   (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0)"
 
 lemma DEF_NUMPAIR: "NUMPAIR =
 (%(u::nat) ua::nat.
-    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) u *
-    (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua + NUMERAL_BIT1 (0::nat)))"
+    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
+    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0))"
   by (import hollight DEF_NUMPAIR)
 
 lemma NUMPAIR_INJ_LEMMA: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
@@ -1405,13 +1654,13 @@
   NUMSUM :: "bool => nat => nat" 
   "NUMSUM ==
 %(u::bool) ua::nat.
-   COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))
-    (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua)"
+   COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
+    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua)"
 
 lemma DEF_NUMSUM: "NUMSUM =
 (%(u::bool) ua::nat.
-    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))
-     (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))"
+    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
+     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))"
   by (import hollight DEF_NUMSUM)
 
 lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
@@ -1443,7 +1692,7 @@
   by (import hollight DEF_NUMRIGHT)
 
 constdefs
-  INJN :: "nat => nat => 'A::type => bool" 
+  INJN :: "nat => nat => 'A => bool" 
   "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
 
 lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
@@ -1462,7 +1711,7 @@
   by (import hollight INJN_INJ)
 
 constdefs
-  INJA :: "'A::type => nat => 'A::type => bool" 
+  INJA :: "'A => nat => 'A => bool" 
   "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
 
 lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
@@ -1472,7 +1721,7 @@
   by (import hollight INJA_INJ)
 
 constdefs
-  INJF :: "(nat => nat => 'A::type => bool) => nat => 'A::type => bool" 
+  INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" 
   "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
 
 lemma DEF_INJF: "INJF =
@@ -1484,8 +1733,7 @@
   by (import hollight INJF_INJ)
 
 constdefs
-  INJP :: "(nat => 'A::type => bool)
-=> (nat => 'A::type => bool) => nat => 'A::type => bool" 
+  INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" 
   "INJP ==
 %(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
    a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a)"
@@ -1501,8 +1749,7 @@
   by (import hollight INJP_INJ)
 
 constdefs
-  ZCONSTR :: "nat
-=> 'A::type => (nat => nat => 'A::type => bool) => nat => 'A::type => bool" 
+  ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" 
   "ZCONSTR ==
 %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
    INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
@@ -1513,10 +1760,10 @@
   by (import hollight DEF_ZCONSTR)
 
 constdefs
-  ZBOT :: "nat => 'A::type => bool" 
-  "ZBOT == INJP (INJN (0::nat)) (SOME z::nat => 'A::type => bool. True)"
-
-lemma DEF_ZBOT: "ZBOT = INJP (INJN (0::nat)) (SOME z::nat => 'A::type => bool. True)"
+  ZBOT :: "nat => 'A => bool" 
+  "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
+
+lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
   by (import hollight DEF_ZBOT)
 
 lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'A::type) xb::nat => nat => 'A::type => bool.
@@ -1524,7 +1771,7 @@
   by (import hollight ZCONSTR_ZBOT)
 
 constdefs
-  ZRECSPACE :: "(nat => 'A::type => bool) => bool" 
+  ZRECSPACE :: "(nat => 'A => bool) => bool" 
   "ZRECSPACE ==
 %a::nat => 'A::type => bool.
    ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
@@ -1559,29 +1806,74 @@
   "_mk_rec" :: _ ("'_mk'_rec")
 
 lemmas "TYDEF_recspace_@intern" = typedef_hol2hollight 
-  [where a="a :: 'A::type recspace" and r=r ,
+  [where a="a :: 'A recspace" and r=r ,
    OF type_definition_recspace]
 
 constdefs
-  BOTTOM :: "'A::type recspace" 
-  "BOTTOM == _mk_rec ZBOT"
-
-lemma DEF_BOTTOM: "BOTTOM = _mk_rec ZBOT"
+  BOTTOM :: "'A recspace" 
+  "(op ==::'A::type recspace => 'A::type recspace => prop)
+ (BOTTOM::'A::type recspace)
+ ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
+   (ZBOT::nat => 'A::type => bool))"
+
+lemma DEF_BOTTOM: "(op =::'A::type recspace => 'A::type recspace => bool)
+ (BOTTOM::'A::type recspace)
+ ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
+   (ZBOT::nat => 'A::type => bool))"
   by (import hollight DEF_BOTTOM)
 
 constdefs
-  CONSTR :: "nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace" 
-  "CONSTR ==
-%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
-   _mk_rec (ZCONSTR u ua (%n::nat. _dest_rec (ub n)))"
-
-lemma DEF_CONSTR: "CONSTR =
-(%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
-    _mk_rec (ZCONSTR u ua (%n::nat. _dest_rec (ub n))))"
+  CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" 
+  "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+        => (nat
+            => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+           => prop)
+ (CONSTR::nat
+          => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+ (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
+     (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
+      ((ZCONSTR::nat
+                 => 'A::type
+                    => (nat => nat => 'A::type => bool)
+                       => nat => 'A::type => bool)
+        u ua
+        (%n::nat.
+            (_dest_rec::'A::type recspace => nat => 'A::type => bool)
+             (ub n))))"
+
+lemma DEF_CONSTR: "(op =::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+       => (nat
+           => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+          => bool)
+ (CONSTR::nat
+          => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+ (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
+     (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
+      ((ZCONSTR::nat
+                 => 'A::type
+                    => (nat => nat => 'A::type => bool)
+                       => nat => 'A::type => bool)
+        u ua
+        (%n::nat.
+            (_dest_rec::'A::type recspace => nat => 'A::type => bool)
+             (ub n))))"
   by (import hollight DEF_CONSTR)
 
-lemma MK_REC_INJ: "ALL (x::nat => 'A::type => bool) y::nat => 'A::type => bool.
-   _mk_rec x = _mk_rec y --> ZRECSPACE x & ZRECSPACE y --> x = y"
+lemma MK_REC_INJ: "(All::((nat => 'A::type => bool) => bool) => bool)
+ (%x::nat => 'A::type => bool.
+     (All::((nat => 'A::type => bool) => bool) => bool)
+      (%y::nat => 'A::type => bool.
+          (op -->::bool => bool => bool)
+           ((op =::'A::type recspace => 'A::type recspace => bool)
+             ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) x)
+             ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) y))
+           ((op -->::bool => bool => bool)
+             ((op &::bool => bool => bool)
+               ((ZRECSPACE::(nat => 'A::type => bool) => bool) x)
+               ((ZRECSPACE::(nat => 'A::type => bool) => bool) y))
+             ((op =::(nat => 'A::type => bool)
+                     => (nat => 'A::type => bool) => bool)
+               x y))))"
   by (import hollight MK_REC_INJ)
 
 lemma CONSTR_BOT: "ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
@@ -1609,24 +1901,24 @@
   by (import hollight CONSTR_REC)
 
 constdefs
-  FCONS :: "'A::type => (nat => 'A::type) => nat => 'A::type" 
+  FCONS :: "'A => (nat => 'A) => nat => 'A" 
   "FCONS ==
 SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
-   (ALL (a::'A::type) f::nat => 'A::type. FCONS a f (0::nat) = a) &
+   (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
    (ALL (a::'A::type) (f::nat => 'A::type) n::nat. FCONS a f (Suc n) = f n)"
 
 lemma DEF_FCONS: "FCONS =
 (SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
-    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f (0::nat) = a) &
+    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
     (ALL (a::'A::type) (f::nat => 'A::type) n::nat.
         FCONS a f (Suc n) = f n))"
   by (import hollight DEF_FCONS)
 
-lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f (0::nat)) (f o Suc)"
+lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
   by (import hollight FCONS_UNDO)
 
 constdefs
-  FNIL :: "nat => 'A::type" 
+  FNIL :: "nat => 'A" 
   "FNIL == %u::nat. SOME x::'A::type. True"
 
 lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
@@ -1695,35 +1987,77 @@
   "_mk_sum" :: _ ("'_mk'_sum")
 
 lemmas "TYDEF_sum_@intern" = typedef_hol2hollight 
-  [where a="a :: ('A::type, 'B::type) sum" and r=r ,
+  [where a="a :: ('A, 'B) sum" and r=r ,
    OF type_definition_sum]
 
 constdefs
-  INL :: "'A::type => ('A::type, 'B::type) sum" 
-  "INL ==
-%a::'A::type.
-   _mk_sum (CONSTR (0::nat) (a, SOME v::'B::type. True) (%n::nat. BOTTOM))"
-
-lemma DEF_INL: "INL =
-(%a::'A::type.
-    _mk_sum (CONSTR (0::nat) (a, SOME v::'B::type. True) (%n::nat. BOTTOM)))"
+  INL :: "'A => ('A, 'B) sum" 
+  "(op ==::('A::type => ('A::type, 'B::type) sum)
+        => ('A::type => ('A::type, 'B::type) sum) => prop)
+ (INL::'A::type => ('A::type, 'B::type) sum)
+ (%a::'A::type.
+     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
+      ((CONSTR::nat
+                => 'A::type * 'B::type
+                   => (nat => ('A::type * 'B::type) recspace)
+                      => ('A::type * 'B::type) recspace)
+        (0::nat)
+        ((Pair::'A::type => 'B::type => 'A::type * 'B::type) a
+          ((Eps::('B::type => bool) => 'B::type)
+            (%v::'B::type. True::bool)))
+        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
+
+lemma DEF_INL: "(op =::('A::type => ('A::type, 'B::type) sum)
+       => ('A::type => ('A::type, 'B::type) sum) => bool)
+ (INL::'A::type => ('A::type, 'B::type) sum)
+ (%a::'A::type.
+     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
+      ((CONSTR::nat
+                => 'A::type * 'B::type
+                   => (nat => ('A::type * 'B::type) recspace)
+                      => ('A::type * 'B::type) recspace)
+        (0::nat)
+        ((Pair::'A::type => 'B::type => 'A::type * 'B::type) a
+          ((Eps::('B::type => bool) => 'B::type)
+            (%v::'B::type. True::bool)))
+        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
   by (import hollight DEF_INL)
 
 constdefs
-  INR :: "'B::type => ('A::type, 'B::type) sum" 
-  "INR ==
-%a::'B::type.
-   _mk_sum
-    (CONSTR (Suc (0::nat)) (SOME v::'A::type. True, a) (%n::nat. BOTTOM))"
-
-lemma DEF_INR: "INR =
-(%a::'B::type.
-    _mk_sum
-     (CONSTR (Suc (0::nat)) (SOME v::'A::type. True, a) (%n::nat. BOTTOM)))"
+  INR :: "'B => ('A, 'B) sum" 
+  "(op ==::('B::type => ('A::type, 'B::type) sum)
+        => ('B::type => ('A::type, 'B::type) sum) => prop)
+ (INR::'B::type => ('A::type, 'B::type) sum)
+ (%a::'B::type.
+     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
+      ((CONSTR::nat
+                => 'A::type * 'B::type
+                   => (nat => ('A::type * 'B::type) recspace)
+                      => ('A::type * 'B::type) recspace)
+        ((Suc::nat => nat) (0::nat))
+        ((Pair::'A::type => 'B::type => 'A::type * 'B::type)
+          ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+          a)
+        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
+
+lemma DEF_INR: "(op =::('B::type => ('A::type, 'B::type) sum)
+       => ('B::type => ('A::type, 'B::type) sum) => bool)
+ (INR::'B::type => ('A::type, 'B::type) sum)
+ (%a::'B::type.
+     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
+      ((CONSTR::nat
+                => 'A::type * 'B::type
+                   => (nat => ('A::type * 'B::type) recspace)
+                      => ('A::type * 'B::type) recspace)
+        ((Suc::nat => nat) (0::nat))
+        ((Pair::'A::type => 'B::type => 'A::type * 'B::type)
+          ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+          a)
+        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
   by (import hollight DEF_INR)
 
 consts
-  OUTL :: "('A::type, 'B::type) sum => 'A::type" 
+  OUTL :: "('A, 'B) sum => 'A" 
 
 defs
   OUTL_def: "hollight.OUTL ==
@@ -1736,7 +2070,7 @@
   by (import hollight DEF_OUTL)
 
 consts
-  OUTR :: "('A::type, 'B::type) sum => 'B::type" 
+  OUTR :: "('A, 'B) sum => 'B" 
 
 defs
   OUTR_def: "hollight.OUTR ==
@@ -1790,26 +2124,55 @@
   "_mk_option" :: _ ("'_mk'_option")
 
 lemmas "TYDEF_option_@intern" = typedef_hol2hollight 
-  [where a="a :: 'A::type hollight.option" and r=r ,
+  [where a="a :: 'A hollight.option" and r=r ,
    OF type_definition_option]
 
 constdefs
-  NONE :: "'A::type hollight.option" 
-  "NONE ==
-_mk_option (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
-
-lemma DEF_NONE: "NONE =
-_mk_option (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
+  NONE :: "'A hollight.option" 
+  "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
+ (NONE::'A::type hollight.option)
+ ((_mk_option::'A::type recspace => 'A::type hollight.option)
+   ((CONSTR::nat
+             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+     (0::nat)
+     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+     (%n::nat. BOTTOM::'A::type recspace)))"
+
+lemma DEF_NONE: "(op =::'A::type hollight.option => 'A::type hollight.option => bool)
+ (NONE::'A::type hollight.option)
+ ((_mk_option::'A::type recspace => 'A::type hollight.option)
+   ((CONSTR::nat
+             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+     (0::nat)
+     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+     (%n::nat. BOTTOM::'A::type recspace)))"
   by (import hollight DEF_NONE)
 
 consts
-  SOME :: "'A::type => 'A::type hollight.option" ("SOME")
+  SOME :: "'A => 'A hollight.option" ("SOME")
 
 defs
-  SOME_def: "SOME == %a::'A::type. _mk_option (CONSTR (Suc (0::nat)) a (%n::nat. BOTTOM))"
-
-lemma DEF_SOME: "SOME =
-(%a::'A::type. _mk_option (CONSTR (Suc (0::nat)) a (%n::nat. BOTTOM)))"
+  SOME_def: "(op ==::('A::type => 'A::type hollight.option)
+        => ('A::type => 'A::type hollight.option) => prop)
+ (SOME::'A::type => 'A::type hollight.option)
+ (%a::'A::type.
+     (_mk_option::'A::type recspace => 'A::type hollight.option)
+      ((CONSTR::nat
+                => 'A::type
+                   => (nat => 'A::type recspace) => 'A::type recspace)
+        ((Suc::nat => nat) (0::nat)) a
+        (%n::nat. BOTTOM::'A::type recspace)))"
+
+lemma DEF_SOME: "(op =::('A::type => 'A::type hollight.option)
+       => ('A::type => 'A::type hollight.option) => bool)
+ (SOME::'A::type => 'A::type hollight.option)
+ (%a::'A::type.
+     (_mk_option::'A::type recspace => 'A::type hollight.option)
+      ((CONSTR::nat
+                => 'A::type
+                   => (nat => 'A::type recspace) => 'A::type recspace)
+        ((Suc::nat => nat) (0::nat)) a
+        (%n::nat. BOTTOM::'A::type recspace)))"
   by (import hollight DEF_SOME)
 
 typedef (open) ('A) list = "(Collect::('A::type recspace => bool) => 'A::type recspace set)
@@ -1859,27 +2222,61 @@
   "_mk_list" :: _ ("'_mk'_list")
 
 lemmas "TYDEF_list_@intern" = typedef_hol2hollight 
-  [where a="a :: 'A::type hollight.list" and r=r ,
+  [where a="a :: 'A hollight.list" and r=r ,
    OF type_definition_list]
 
 constdefs
-  NIL :: "'A::type hollight.list" 
-  "NIL == _mk_list (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
-
-lemma DEF_NIL: "NIL = _mk_list (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
+  NIL :: "'A hollight.list" 
+  "(op ==::'A::type hollight.list => 'A::type hollight.list => prop)
+ (NIL::'A::type hollight.list)
+ ((_mk_list::'A::type recspace => 'A::type hollight.list)
+   ((CONSTR::nat
+             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+     (0::nat)
+     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+     (%n::nat. BOTTOM::'A::type recspace)))"
+
+lemma DEF_NIL: "(op =::'A::type hollight.list => 'A::type hollight.list => bool)
+ (NIL::'A::type hollight.list)
+ ((_mk_list::'A::type recspace => 'A::type hollight.list)
+   ((CONSTR::nat
+             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
+     (0::nat)
+     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
+     (%n::nat. BOTTOM::'A::type recspace)))"
   by (import hollight DEF_NIL)
 
 constdefs
-  CONS :: "'A::type => 'A::type hollight.list => 'A::type hollight.list" 
-  "CONS ==
-%(a0::'A::type) a1::'A::type hollight.list.
-   _mk_list
-    (CONSTR (Suc (0::nat)) a0 (FCONS (_dest_list a1) (%n::nat. BOTTOM)))"
-
-lemma DEF_CONS: "CONS =
-(%(a0::'A::type) a1::'A::type hollight.list.
-    _mk_list
-     (CONSTR (Suc (0::nat)) a0 (FCONS (_dest_list a1) (%n::nat. BOTTOM))))"
+  CONS :: "'A => 'A hollight.list => 'A hollight.list" 
+  "(op ==::('A::type => 'A::type hollight.list => 'A::type hollight.list)
+        => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
+           => prop)
+ (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
+ (%(a0::'A::type) a1::'A::type hollight.list.
+     (_mk_list::'A::type recspace => 'A::type hollight.list)
+      ((CONSTR::nat
+                => 'A::type
+                   => (nat => 'A::type recspace) => 'A::type recspace)
+        ((Suc::nat => nat) (0::nat)) a0
+        ((FCONS::'A::type recspace
+                 => (nat => 'A::type recspace) => nat => 'A::type recspace)
+          ((_dest_list::'A::type hollight.list => 'A::type recspace) a1)
+          (%n::nat. BOTTOM::'A::type recspace))))"
+
+lemma DEF_CONS: "(op =::('A::type => 'A::type hollight.list => 'A::type hollight.list)
+       => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
+          => bool)
+ (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
+ (%(a0::'A::type) a1::'A::type hollight.list.
+     (_mk_list::'A::type recspace => 'A::type hollight.list)
+      ((CONSTR::nat
+                => 'A::type
+                   => (nat => 'A::type recspace) => 'A::type recspace)
+        ((Suc::nat => nat) (0::nat)) a0
+        ((FCONS::'A::type recspace
+                 => (nat => 'A::type recspace) => nat => 'A::type recspace)
+          ((_dest_list::'A::type hollight.list => 'A::type recspace) a1)
+          (%n::nat. BOTTOM::'A::type recspace))))"
   by (import hollight DEF_CONS)
 
 lemma pair_RECURSION: "ALL PAIR'::'A::type => 'B::type => 'C::type.
@@ -1888,12 +2285,11 @@
   by (import hollight pair_RECURSION)
 
 lemma num_RECURSION_STD: "ALL (e::'Z::type) f::nat => 'Z::type => 'Z::type.
-   EX fn::nat => 'Z::type.
-      fn (0::nat) = e & (ALL n::nat. fn (Suc n) = f n (fn n))"
+   EX fn::nat => 'Z::type. fn 0 = e & (ALL n::nat. fn (Suc n) = f n (fn n))"
   by (import hollight num_RECURSION_STD)
 
 constdefs
-  ISO :: "('A::type => 'B::type) => ('B::type => 'A::type) => bool" 
+  ISO :: "('A => 'B) => ('B => 'A) => bool" 
   "ISO ==
 %(u::'A::type => 'B::type) ua::'B::type => 'A::type.
    (ALL x::'B::type. u (ua x) = x) & (ALL y::'A::type. ua (u y) = y)"
@@ -1922,14 +2318,12 @@
 typedef (open) N_2 = "{a::bool recspace.
  ALL u::bool recspace => bool.
     (ALL a::bool recspace.
-        a =
-        CONSTR (NUMERAL (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM) |
+        a = CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM) |
         a =
-        CONSTR (Suc (NUMERAL (0::nat))) (SOME x::bool. True)
-         (%n::nat. BOTTOM) -->
+        CONSTR (Suc (NUMERAL 0)) (SOME x::bool. True) (%n::nat. BOTTOM) -->
         u a) -->
     u a}"  morphisms "_dest_2" "_mk_2"
-  apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM)"])
+  apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM)"])
   by (import hollight TYDEF_2)
 
 syntax
@@ -1946,20 +2340,36 @@
   "_10288" :: "N_2" ("'_10288")
 
 defs
-  "_10288_def": "_10288 == _mk_2 (CONSTR (0::nat) (SOME x::bool. True) (%n::nat. BOTTOM))"
-
-lemma DEF__10288: "_10288 = _mk_2 (CONSTR (0::nat) (SOME x::bool. True) (%n::nat. BOTTOM))"
+  "_10288_def": "(op ==::N_2 => N_2 => prop) (_10288::N_2)
+ ((_mk_2::bool recspace => N_2)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
+
+lemma DEF__10288: "(op =::N_2 => N_2 => bool) (_10288::N_2)
+ ((_mk_2::bool recspace => N_2)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
   by (import hollight DEF__10288)
 
 consts
   "_10289" :: "N_2" ("'_10289")
 
 defs
-  "_10289_def": "_10289 ==
-_mk_2 (CONSTR (Suc (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM))"
-
-lemma DEF__10289: "_10289 =
-_mk_2 (CONSTR (Suc (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM))"
+  "_10289_def": "(op ==::N_2 => N_2 => prop) (_10289::N_2)
+ ((_mk_2::bool recspace => N_2)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) (0::nat))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
+
+lemma DEF__10289: "(op =::N_2 => N_2 => bool) (_10289::N_2)
+ ((_mk_2::bool recspace => N_2)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) (0::nat))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
   by (import hollight DEF__10289)
 
 constdefs
@@ -1979,17 +2389,15 @@
 typedef (open) N_3 = "{a::bool recspace.
  ALL u::bool recspace => bool.
     (ALL a::bool recspace.
-        a =
-        CONSTR (NUMERAL (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM) |
+        a = CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM) |
         a =
-        CONSTR (Suc (NUMERAL (0::nat))) (SOME x::bool. True)
-         (%n::nat. BOTTOM) |
+        CONSTR (Suc (NUMERAL 0)) (SOME x::bool. True) (%n::nat. BOTTOM) |
         a =
-        CONSTR (Suc (Suc (NUMERAL (0::nat)))) (SOME x::bool. True)
+        CONSTR (Suc (Suc (NUMERAL 0))) (SOME x::bool. True)
          (%n::nat. BOTTOM) -->
         u a) -->
     u a}"  morphisms "_dest_3" "_mk_3"
-  apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM)"])
+  apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM)"])
   by (import hollight TYDEF_3)
 
 syntax
@@ -2006,31 +2414,55 @@
   "_10312" :: "N_3" ("'_10312")
 
 defs
-  "_10312_def": "_10312 == _mk_3 (CONSTR (0::nat) (SOME x::bool. True) (%n::nat. BOTTOM))"
-
-lemma DEF__10312: "_10312 = _mk_3 (CONSTR (0::nat) (SOME x::bool. True) (%n::nat. BOTTOM))"
+  "_10312_def": "(op ==::N_3 => N_3 => prop) (_10312::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
+
+lemma DEF__10312: "(op =::N_3 => N_3 => bool) (_10312::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
   by (import hollight DEF__10312)
 
 consts
   "_10313" :: "N_3" ("'_10313")
 
 defs
-  "_10313_def": "_10313 ==
-_mk_3 (CONSTR (Suc (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM))"
-
-lemma DEF__10313: "_10313 =
-_mk_3 (CONSTR (Suc (0::nat)) (SOME x::bool. True) (%n::nat. BOTTOM))"
+  "_10313_def": "(op ==::N_3 => N_3 => prop) (_10313::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) (0::nat))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
+
+lemma DEF__10313: "(op =::N_3 => N_3 => bool) (_10313::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) (0::nat))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
   by (import hollight DEF__10313)
 
 consts
   "_10314" :: "N_3" ("'_10314")
 
 defs
-  "_10314_def": "_10314 ==
-_mk_3 (CONSTR (Suc (Suc (0::nat))) (SOME x::bool. True) (%n::nat. BOTTOM))"
-
-lemma DEF__10314: "_10314 =
-_mk_3 (CONSTR (Suc (Suc (0::nat))) (SOME x::bool. True) (%n::nat. BOTTOM))"
+  "_10314_def": "(op ==::N_3 => N_3 => prop) (_10314::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
+
+lemma DEF__10314: "(op =::N_3 => N_3 => bool) (_10314::N_3)
+ ((_mk_3::bool recspace => N_3)
+   ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
+     ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
+     ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
+     (%n::nat. BOTTOM::bool recspace)))"
   by (import hollight DEF__10314)
 
 constdefs
@@ -2062,7 +2494,7 @@
   by (import hollight list_INDUCT)
 
 constdefs
-  HD :: "'A::type hollight.list => 'A::type" 
+  HD :: "'A hollight.list => 'A" 
   "HD ==
 SOME HD::'A::type hollight.list => 'A::type.
    ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h"
@@ -2073,7 +2505,7 @@
   by (import hollight DEF_HD)
 
 constdefs
-  TL :: "'A::type hollight.list => 'A::type hollight.list" 
+  TL :: "'A hollight.list => 'A hollight.list" 
   "TL ==
 SOME TL::'A::type hollight.list => 'A::type hollight.list.
    ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t"
@@ -2084,7 +2516,7 @@
   by (import hollight DEF_TL)
 
 constdefs
-  APPEND :: "'A::type hollight.list => 'A::type hollight.list => 'A::type hollight.list" 
+  APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" 
   "APPEND ==
 SOME APPEND::'A::type hollight.list
              => 'A::type hollight.list => 'A::type hollight.list.
@@ -2102,7 +2534,7 @@
   by (import hollight DEF_APPEND)
 
 constdefs
-  REVERSE :: "'A::type hollight.list => 'A::type hollight.list" 
+  REVERSE :: "'A hollight.list => 'A hollight.list" 
   "REVERSE ==
 SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
    REVERSE NIL = NIL &
@@ -2117,22 +2549,22 @@
   by (import hollight DEF_REVERSE)
 
 constdefs
-  LENGTH :: "'A::type hollight.list => nat" 
+  LENGTH :: "'A hollight.list => nat" 
   "LENGTH ==
 SOME LENGTH::'A::type hollight.list => nat.
-   LENGTH NIL = (0::nat) &
+   LENGTH NIL = 0 &
    (ALL (h::'A::type) t::'A::type hollight.list.
        LENGTH (CONS h t) = Suc (LENGTH t))"
 
 lemma DEF_LENGTH: "LENGTH =
 (SOME LENGTH::'A::type hollight.list => nat.
-    LENGTH NIL = (0::nat) &
+    LENGTH NIL = 0 &
     (ALL (h::'A::type) t::'A::type hollight.list.
         LENGTH (CONS h t) = Suc (LENGTH t)))"
   by (import hollight DEF_LENGTH)
 
 constdefs
-  MAP :: "('A::type => 'B::type) => 'A::type hollight.list => 'B::type hollight.list" 
+  MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" 
   "MAP ==
 SOME MAP::('A::type => 'B::type)
           => 'A::type hollight.list => 'B::type hollight.list.
@@ -2149,7 +2581,7 @@
   by (import hollight DEF_MAP)
 
 constdefs
-  LAST :: "'A::type hollight.list => 'A::type" 
+  LAST :: "'A hollight.list => 'A" 
   "LAST ==
 SOME LAST::'A::type hollight.list => 'A::type.
    ALL (h::'A::type) t::'A::type hollight.list.
@@ -2162,22 +2594,22 @@
   by (import hollight DEF_LAST)
 
 constdefs
-  REPLICATE :: "nat => 'q_16809::type => 'q_16809::type hollight.list" 
+  REPLICATE :: "nat => 'q_16809 => 'q_16809 hollight.list" 
   "REPLICATE ==
 SOME REPLICATE::nat => 'q_16809::type => 'q_16809::type hollight.list.
-   (ALL x::'q_16809::type. REPLICATE (0::nat) x = NIL) &
+   (ALL x::'q_16809::type. REPLICATE 0 x = NIL) &
    (ALL (n::nat) x::'q_16809::type.
        REPLICATE (Suc n) x = CONS x (REPLICATE n x))"
 
 lemma DEF_REPLICATE: "REPLICATE =
 (SOME REPLICATE::nat => 'q_16809::type => 'q_16809::type hollight.list.
-    (ALL x::'q_16809::type. REPLICATE (0::nat) x = NIL) &
+    (ALL x::'q_16809::type. REPLICATE 0 x = NIL) &
     (ALL (n::nat) x::'q_16809::type.
         REPLICATE (Suc n) x = CONS x (REPLICATE n x)))"
   by (import hollight DEF_REPLICATE)
 
 constdefs
-  NULL :: "'q_16824::type hollight.list => bool" 
+  NULL :: "'q_16824 hollight.list => bool" 
   "NULL ==
 SOME NULL::'q_16824::type hollight.list => bool.
    NULL NIL = True &
@@ -2192,7 +2624,7 @@
   by (import hollight DEF_NULL)
 
 constdefs
-  ALL_list :: "('q_16844::type => bool) => 'q_16844::type hollight.list => bool" 
+  ALL_list :: "('q_16844 => bool) => 'q_16844 hollight.list => bool" 
   "ALL_list ==
 SOME u::('q_16844::type => bool) => 'q_16844::type hollight.list => bool.
    (ALL P::'q_16844::type => bool. u P NIL = True) &
@@ -2207,7 +2639,7 @@
   by (import hollight DEF_ALL)
 
 consts
-  EX :: "('q_16865::type => bool) => 'q_16865::type hollight.list => bool" ("EX")
+  EX :: "('q_16865 => bool) => 'q_16865 hollight.list => bool" ("EX")
 
 defs
   EX_def: "EX ==
@@ -2224,8 +2656,8 @@
   by (import hollight DEF_EX)
 
 constdefs
-  ITLIST :: "('q_16888::type => 'q_16887::type => 'q_16887::type)
-=> 'q_16888::type hollight.list => 'q_16887::type => 'q_16887::type" 
+  ITLIST :: "('q_16888 => 'q_16887 => 'q_16887)
+=> 'q_16888 hollight.list => 'q_16887 => 'q_16887" 
   "ITLIST ==
 SOME ITLIST::('q_16888::type => 'q_16887::type => 'q_16887::type)
              => 'q_16888::type hollight.list
@@ -2250,7 +2682,7 @@
   by (import hollight DEF_ITLIST)
 
 constdefs
-  MEM :: "'q_16913::type => 'q_16913::type hollight.list => bool" 
+  MEM :: "'q_16913 => 'q_16913 hollight.list => bool" 
   "MEM ==
 SOME MEM::'q_16913::type => 'q_16913::type hollight.list => bool.
    (ALL x::'q_16913::type. MEM x NIL = False) &
@@ -2267,8 +2699,8 @@
   by (import hollight DEF_MEM)
 
 constdefs
-  ALL2 :: "('q_16946::type => 'q_16953::type => bool)
-=> 'q_16946::type hollight.list => 'q_16953::type hollight.list => bool" 
+  ALL2 :: "('q_16946 => 'q_16953 => bool)
+=> 'q_16946 hollight.list => 'q_16953 hollight.list => bool" 
   "ALL2 ==
 SOME ALL2::('q_16946::type => 'q_16953::type => bool)
            => 'q_16946::type hollight.list
@@ -2301,9 +2733,9 @@
   by (import hollight ALL2)
 
 constdefs
-  MAP2 :: "('q_17038::type => 'q_17045::type => 'q_17035::type)
-=> 'q_17038::type hollight.list
-   => 'q_17045::type hollight.list => 'q_17035::type hollight.list" 
+  MAP2 :: "('q_17038 => 'q_17045 => 'q_17035)
+=> 'q_17038 hollight.list
+   => 'q_17045 hollight.list => 'q_17035 hollight.list" 
   "MAP2 ==
 SOME MAP2::('q_17038::type => 'q_17045::type => 'q_17035::type)
            => 'q_17038::type hollight.list
@@ -2336,23 +2768,22 @@
   by (import hollight MAP2)
 
 constdefs
-  EL :: "nat => 'q_17106::type hollight.list => 'q_17106::type" 
+  EL :: "nat => 'q_17106 hollight.list => 'q_17106" 
   "EL ==
 SOME EL::nat => 'q_17106::type hollight.list => 'q_17106::type.
-   (ALL l::'q_17106::type hollight.list. EL (0::nat) l = HD l) &
+   (ALL l::'q_17106::type hollight.list. EL 0 l = HD l) &
    (ALL (n::nat) l::'q_17106::type hollight.list.
        EL (Suc n) l = EL n (TL l))"
 
 lemma DEF_EL: "EL =
 (SOME EL::nat => 'q_17106::type hollight.list => 'q_17106::type.
-    (ALL l::'q_17106::type hollight.list. EL (0::nat) l = HD l) &
+    (ALL l::'q_17106::type hollight.list. EL 0 l = HD l) &
     (ALL (n::nat) l::'q_17106::type hollight.list.
         EL (Suc n) l = EL n (TL l)))"
   by (import hollight DEF_EL)
 
 constdefs
-  FILTER :: "('q_17131::type => bool)
-=> 'q_17131::type hollight.list => 'q_17131::type hollight.list" 
+  FILTER :: "('q_17131 => bool) => 'q_17131 hollight.list => 'q_17131 hollight.list" 
   "FILTER ==
 SOME FILTER::('q_17131::type => bool)
              => 'q_17131::type hollight.list
@@ -2374,8 +2805,7 @@
   by (import hollight DEF_FILTER)
 
 constdefs
-  ASSOC :: "'q_17160::type
-=> ('q_17160::type * 'q_17154::type) hollight.list => 'q_17154::type" 
+  ASSOC :: "'q_17160 => ('q_17160 * 'q_17154) hollight.list => 'q_17154" 
   "ASSOC ==
 SOME ASSOC::'q_17160::type
             => ('q_17160::type * 'q_17154::type) hollight.list
@@ -2394,9 +2824,8 @@
   by (import hollight DEF_ASSOC)
 
 constdefs
-  ITLIST2 :: "('q_17184::type => 'q_17192::type => 'q_17182::type => 'q_17182::type)
-=> 'q_17184::type hollight.list
-   => 'q_17192::type hollight.list => 'q_17182::type => 'q_17182::type" 
+  ITLIST2 :: "('q_17184 => 'q_17192 => 'q_17182 => 'q_17182)
+=> 'q_17184 hollight.list => 'q_17192 hollight.list => 'q_17182 => 'q_17182" 
   "ITLIST2 ==
 SOME ITLIST2::('q_17184::type
                => 'q_17192::type => 'q_17182::type => 'q_17182::type)
@@ -2443,9 +2872,8 @@
   by (import hollight ITLIST2)
 
 consts
-  ZIP :: "'q_17256::type hollight.list
-=> 'q_17264::type hollight.list
-   => ('q_17256::type * 'q_17264::type) hollight.list" 
+  ZIP :: "'q_17256 hollight.list
+=> 'q_17264 hollight.list => ('q_17256 * 'q_17264) hollight.list" 
 
 defs
   ZIP_def: "hollight.ZIP ==
@@ -2544,7 +2972,7 @@
    LENGTH (MAP f l) = LENGTH l"
   by (import hollight LENGTH_MAP)
 
-lemma LENGTH_EQ_NIL: "ALL l::'A::type hollight.list. (LENGTH l = (0::nat)) = (l = NIL)"
+lemma LENGTH_EQ_NIL: "ALL l::'A::type hollight.list. (LENGTH l = 0) = (l = NIL)"
   by (import hollight LENGTH_EQ_NIL)
 
 lemma LENGTH_EQ_CONS: "ALL (l::'q_17608::type hollight.list) n::nat.
@@ -2748,13 +3176,13 @@
 lemma DEF_dist: "dist = (%u::nat * nat. fst u - snd u + (snd u - fst u))"
   by (import hollight DEF_dist)
 
-lemma DIST_REFL: "ALL x::nat. dist (x, x) = (0::nat)"
+lemma DIST_REFL: "ALL x::nat. dist (x, x) = 0"
   by (import hollight DIST_REFL)
 
-lemma DIST_LZERO: "ALL x::nat. dist (0::nat, x) = x"
+lemma DIST_LZERO: "ALL x::nat. dist (0, x) = x"
   by (import hollight DIST_LZERO)
 
-lemma DIST_RZERO: "ALL x::nat. dist (x, 0::nat) = x"
+lemma DIST_RZERO: "ALL x::nat. dist (x, 0) = x"
   by (import hollight DIST_RZERO)
 
 lemma DIST_SYM: "ALL (x::nat) xa::nat. dist (x, xa) = dist (xa, x)"
@@ -2778,7 +3206,7 @@
 lemma DIST_RMUL: "ALL (x::nat) (xa::nat) xb::nat. dist (x, xa) * xb = dist (x * xb, xa * xb)"
   by (import hollight DIST_RMUL)
 
-lemma DIST_EQ_0: "ALL (x::nat) xa::nat. (dist (x, xa) = (0::nat)) = (x = xa)"
+lemma DIST_EQ_0: "ALL (x::nat) xa::nat. (dist (x, xa) = 0) = (x = xa)"
   by (import hollight DIST_EQ_0)
 
 lemma DIST_ELIM_THM: "(P::nat => bool) (dist (x::nat, y::nat)) =
@@ -2815,7 +3243,7 @@
 lemma BOUNDS_LINEAR: "ALL (A::nat) (B::nat) C::nat. (ALL n::nat. <= (A * n) (B * n + C)) = <= A B"
   by (import hollight BOUNDS_LINEAR)
 
-lemma BOUNDS_LINEAR_0: "ALL (A::nat) B::nat. (ALL n::nat. <= (A * n) B) = (A = (0::nat))"
+lemma BOUNDS_LINEAR_0: "ALL (A::nat) B::nat. (ALL n::nat. <= (A * n) B) = (A = 0)"
   by (import hollight BOUNDS_LINEAR_0)
 
 lemma BOUNDS_DIVIDED: "ALL P::nat => nat.
@@ -2824,8 +3252,7 @@
   by (import hollight BOUNDS_DIVIDED)
 
 lemma BOUNDS_NOTZERO: "ALL (P::nat => nat => nat) (A::nat) B::nat.
-   P (0::nat) (0::nat) = (0::nat) &
-   (ALL (m::nat) n::nat. <= (P m n) (A * (m + n) + B)) -->
+   P 0 0 = 0 & (ALL (m::nat) n::nat. <= (P m n) (A * (m + n) + B)) -->
    (EX x::nat. ALL (m::nat) n::nat. <= (P m n) (x * (m + n)))"
   by (import hollight BOUNDS_NOTZERO)
 
@@ -2847,11 +3274,11 @@
        ALL (m::nat) n::nat. <= (dist (m * u n, n * u m)) (B * (m + n)))"
   by (import hollight DEF_is_nadd)
 
-lemma is_nadd_0: "is_nadd (%n::nat. 0::nat)"
+lemma is_nadd_0: "is_nadd (%n::nat. 0)"
   by (import hollight is_nadd_0)
 
 typedef (open) nadd = "Collect is_nadd"  morphisms "dest_nadd" "mk_nadd"
-  apply (rule light_ex_imp_nonempty[where t="%n::nat. NUMERAL (0::nat)"])
+  apply (rule light_ex_imp_nonempty[where t="%n::nat. NUMERAL 0"])
   by (import hollight TYDEF_nadd)
 
 syntax
@@ -2978,8 +3405,7 @@
 
 lemma NADD_LE_TOTAL_LEMMA: "ALL (x::nadd) y::nadd.
    ~ nadd_le x y -->
-   (ALL B::nat.
-       EX n::nat. n ~= (0::nat) & < (dest_nadd y n + B) (dest_nadd x n))"
+   (ALL B::nat. EX n::nat. n ~= 0 & < (dest_nadd y n + B) (dest_nadd x n))"
   by (import hollight NADD_LE_TOTAL_LEMMA)
 
 lemma NADD_LE_TOTAL: "ALL (x::nadd) y::nadd. nadd_le x y | nadd_le y x"
@@ -3015,7 +3441,7 @@
    nadd_eq (nadd_add x (nadd_add y z)) (nadd_add (nadd_add x y) z)"
   by (import hollight NADD_ADD_ASSOC)
 
-lemma NADD_ADD_LID: "ALL x::nadd. nadd_eq (nadd_add (nadd_of_num (0::nat)) x) x"
+lemma NADD_ADD_LID: "ALL x::nadd. nadd_eq (nadd_add (nadd_of_num 0) x) x"
   by (import hollight NADD_ADD_LID)
 
 lemma NADD_ADD_LCANCEL: "ALL (x::nadd) (y::nadd) z::nadd.
@@ -3054,7 +3480,7 @@
    nadd_eq (nadd_mul x (nadd_mul y z)) (nadd_mul (nadd_mul x y) z)"
   by (import hollight NADD_MUL_ASSOC)
 
-lemma NADD_MUL_LID: "ALL x::nadd. nadd_eq (nadd_mul (nadd_of_num (NUMERAL_BIT1 (0::nat))) x) x"
+lemma NADD_MUL_LID: "ALL x::nadd. nadd_eq (nadd_mul (nadd_of_num (NUMERAL_BIT1 0)) x) x"
   by (import hollight NADD_MUL_LID)
 
 lemma NADD_LDISTRIB: "ALL (x::nadd) (y::nadd) z::nadd.
@@ -3075,7 +3501,7 @@
     (nadd_of_num (x * xa))"
   by (import hollight NADD_OF_NUM_MUL)
 
-lemma NADD_LE_0: "All (nadd_le (nadd_of_num (0::nat)))"
+lemma NADD_LE_0: "All (nadd_le (nadd_of_num 0))"
   by (import hollight NADD_LE_0)
 
 lemma NADD_EQ_IMP_LE: "ALL (x::nadd) y::nadd. nadd_eq x y --> nadd_le x y"
@@ -3103,13 +3529,13 @@
   by (import hollight NADD_RDISTRIB)
 
 lemma NADD_ARCH_MULT: "ALL (x::nadd) k::nat.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX xa::nat. nadd_le (nadd_of_num k) (nadd_mul (nadd_of_num xa) x))"
   by (import hollight NADD_ARCH_MULT)
 
 lemma NADD_ARCH_ZERO: "ALL (x::nadd) k::nadd.
    (ALL n::nat. nadd_le (nadd_mul (nadd_of_num n) x) k) -->
-   nadd_eq x (nadd_of_num (0::nat))"
+   nadd_eq x (nadd_of_num 0)"
   by (import hollight NADD_ARCH_ZERO)
 
 lemma NADD_ARCH_LEMMA: "ALL (x::nadd) (y::nadd) z::nadd.
@@ -3131,12 +3557,12 @@
   by (import hollight NADD_UBOUND)
 
 lemma NADD_NONZERO: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
-   (EX N::nat. ALL n::nat. <= N n --> dest_nadd x n ~= (0::nat))"
+   ~ nadd_eq x (nadd_of_num 0) -->
+   (EX N::nat. ALL n::nat. <= N n --> dest_nadd x n ~= 0)"
   by (import hollight NADD_NONZERO)
 
 lemma NADD_LBOUND: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX (A::nat) N::nat. ALL n::nat. <= N n --> <= n (A * dest_nadd x n))"
   by (import hollight NADD_LBOUND)
 
@@ -3148,17 +3574,17 @@
   by (import hollight DEF_nadd_rinv)
 
 lemma NADD_MUL_LINV_LEMMA0: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX (xa::nat) B::nat. ALL i::nat. <= (nadd_rinv x i) (xa * i + B))"
   by (import hollight NADD_MUL_LINV_LEMMA0)
 
 lemma NADD_MUL_LINV_LEMMA1: "ALL (x::nadd) n::nat.
-   dest_nadd x n ~= (0::nat) -->
+   dest_nadd x n ~= 0 -->
    <= (dist (dest_nadd x n * nadd_rinv x n, n * n)) (dest_nadd x n)"
   by (import hollight NADD_MUL_LINV_LEMMA1)
 
 lemma NADD_MUL_LINV_LEMMA2: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX N::nat.
        ALL n::nat.
           <= N n -->
@@ -3166,7 +3592,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA2)
 
 lemma NADD_MUL_LINV_LEMMA3: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX N::nat.
        ALL (m::nat) n::nat.
           <= N n -->
@@ -3177,7 +3603,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA3)
 
 lemma NADD_MUL_LINV_LEMMA4: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX N::nat.
        ALL (m::nat) n::nat.
           <= N m & <= N n -->
@@ -3188,7 +3614,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA4)
 
 lemma NADD_MUL_LINV_LEMMA5: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX (B::nat) N::nat.
        ALL (m::nat) n::nat.
           <= N m & <= N n -->
@@ -3198,7 +3624,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA5)
 
 lemma NADD_MUL_LINV_LEMMA6: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX (B::nat) N::nat.
        ALL (m::nat) n::nat.
           <= N m & <= N n -->
@@ -3207,7 +3633,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA6)
 
 lemma NADD_MUL_LINV_LEMMA7: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX (B::nat) N::nat.
        ALL (m::nat) n::nat.
           <= N m & <= N n -->
@@ -3215,7 +3641,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA7)
 
 lemma NADD_MUL_LINV_LEMMA7a: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (ALL N::nat.
        EX (A::nat) B::nat.
           ALL (m::nat) n::nat.
@@ -3224,7 +3650,7 @@
   by (import hollight NADD_MUL_LINV_LEMMA7a)
 
 lemma NADD_MUL_LINV_LEMMA8: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
+   ~ nadd_eq x (nadd_of_num 0) -->
    (EX B::nat.
        ALL (m::nat) n::nat.
           <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
@@ -3234,26 +3660,25 @@
   nadd_inv :: "nadd => nadd" 
   "nadd_inv ==
 %u::nadd.
-   COND (nadd_eq u (nadd_of_num (0::nat))) (nadd_of_num (0::nat))
-    (mk_nadd (nadd_rinv u))"
+   COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0) (mk_nadd (nadd_rinv u))"
 
 lemma DEF_nadd_inv: "nadd_inv =
 (%u::nadd.
-    COND (nadd_eq u (nadd_of_num (0::nat))) (nadd_of_num (0::nat))
+    COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0)
      (mk_nadd (nadd_rinv u)))"
   by (import hollight DEF_nadd_inv)
 
 lemma NADD_INV: "ALL x::nadd.
    dest_nadd (nadd_inv x) =
-   COND (nadd_eq x (nadd_of_num (0::nat))) (%n::nat. 0::nat) (nadd_rinv x)"
+   COND (nadd_eq x (nadd_of_num 0)) (%n::nat. 0) (nadd_rinv x)"
   by (import hollight NADD_INV)
 
 lemma NADD_MUL_LINV: "ALL x::nadd.
-   ~ nadd_eq x (nadd_of_num (0::nat)) -->
-   nadd_eq (nadd_mul (nadd_inv x) x) (nadd_of_num (NUMERAL_BIT1 (0::nat)))"
+   ~ nadd_eq x (nadd_of_num 0) -->
+   nadd_eq (nadd_mul (nadd_inv x) x) (nadd_of_num (NUMERAL_BIT1 0))"
   by (import hollight NADD_MUL_LINV)
 
-lemma NADD_INV_0: "nadd_eq (nadd_inv (nadd_of_num (0::nat))) (nadd_of_num (0::nat))"
+lemma NADD_INV_0: "nadd_eq (nadd_inv (nadd_of_num 0)) (nadd_of_num 0)"
   by (import hollight NADD_INV_0)
 
 lemma NADD_INV_WELLDEF: "ALL (x::nadd) y::nadd. nadd_eq x y --> nadd_eq (nadd_inv x) (nadd_inv y)"
@@ -3361,7 +3786,7 @@
    hreal_le (hreal_add x xb) (hreal_add xa xb) = hreal_le x xa"
   by (import hollight HREAL_LE_ADD_RCANCEL)
 
-lemma HREAL_ADD_RID: "ALL x::hreal. hreal_add x (hreal_of_num (0::nat)) = x"
+lemma HREAL_ADD_RID: "ALL x::hreal. hreal_add x (hreal_of_num 0) = x"
   by (import hollight HREAL_ADD_RID)
 
 lemma HREAL_ADD_RDISTRIB: "ALL (x::hreal) (xa::hreal) xb::hreal.
@@ -3369,10 +3794,10 @@
    hreal_add (hreal_mul x xb) (hreal_mul xa xb)"
   by (import hollight HREAL_ADD_RDISTRIB)
 
-lemma HREAL_MUL_LZERO: "ALL m::hreal. hreal_mul (hreal_of_num (0::nat)) m = hreal_of_num (0::nat)"
+lemma HREAL_MUL_LZERO: "ALL m::hreal. hreal_mul (hreal_of_num 0) m = hreal_of_num 0"
   by (import hollight HREAL_MUL_LZERO)
 
-lemma HREAL_MUL_RZERO: "ALL x::hreal. hreal_mul x (hreal_of_num (0::nat)) = hreal_of_num (0::nat)"
+lemma HREAL_MUL_RZERO: "ALL x::hreal. hreal_mul x (hreal_of_num 0) = hreal_of_num 0"
   by (import hollight HREAL_MUL_RZERO)
 
 lemma HREAL_ADD_AC: "hreal_add (m::hreal) (n::hreal) = hreal_add n m &
@@ -3390,9 +3815,9 @@
 
 constdefs
   treal_of_num :: "nat => hreal * hreal" 
-  "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num (0::nat))"
-
-lemma DEF_treal_of_num: "treal_of_num = (%u::nat. (hreal_of_num u, hreal_of_num (0::nat)))"
+  "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num 0)"
+
+lemma DEF_treal_of_num: "treal_of_num = (%u::nat. (hreal_of_num u, hreal_of_num 0))"
   by (import hollight DEF_treal_of_num)
 
 constdefs
@@ -3441,20 +3866,20 @@
   treal_inv :: "hreal * hreal => hreal * hreal" 
   "treal_inv ==
 %u::hreal * hreal.
-   COND (fst u = snd u) (hreal_of_num (0::nat), hreal_of_num (0::nat))
+   COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
     (COND (hreal_le (snd u) (fst u))
       (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
-       hreal_of_num (0::nat))
-      (hreal_of_num (0::nat),
+       hreal_of_num 0)
+      (hreal_of_num 0,
        hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d)))"
 
 lemma DEF_treal_inv: "treal_inv =
 (%u::hreal * hreal.
-    COND (fst u = snd u) (hreal_of_num (0::nat), hreal_of_num (0::nat))
+    COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
      (COND (hreal_le (snd u) (fst u))
        (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
-        hreal_of_num (0::nat))
-       (hreal_of_num (0::nat),
+        hreal_of_num 0)
+       (hreal_of_num 0,
         hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d))))"
   by (import hollight DEF_treal_inv)
 
@@ -3512,11 +3937,10 @@
    treal_eq (treal_add x (treal_add y z)) (treal_add (treal_add x y) z)"
   by (import hollight TREAL_ADD_ASSOC)
 
-lemma TREAL_ADD_LID: "ALL x::hreal * hreal. treal_eq (treal_add (treal_of_num (0::nat)) x) x"
+lemma TREAL_ADD_LID: "ALL x::hreal * hreal. treal_eq (treal_add (treal_of_num 0) x) x"
   by (import hollight TREAL_ADD_LID)
 
-lemma TREAL_ADD_LINV: "ALL x::hreal * hreal.
-   treal_eq (treal_add (treal_neg x) x) (treal_of_num (0::nat))"
+lemma TREAL_ADD_LINV: "ALL x::hreal * hreal. treal_eq (treal_add (treal_neg x) x) (treal_of_num 0)"
   by (import hollight TREAL_ADD_LINV)
 
 lemma TREAL_MUL_SYM: "ALL (x::hreal * hreal) y::hreal * hreal.
@@ -3528,7 +3952,7 @@
   by (import hollight TREAL_MUL_ASSOC)
 
 lemma TREAL_MUL_LID: "ALL x::hreal * hreal.
-   treal_eq (treal_mul (treal_of_num (NUMERAL_BIT1 (0::nat))) x) x"
+   treal_eq (treal_mul (treal_of_num (NUMERAL_BIT1 0)) x) x"
   by (import hollight TREAL_MUL_LID)
 
 lemma TREAL_ADD_LDISTRIB: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
@@ -3555,18 +3979,16 @@
   by (import hollight TREAL_LE_LADD_IMP)
 
 lemma TREAL_LE_MUL: "ALL (x::hreal * hreal) y::hreal * hreal.
-   treal_le (treal_of_num (0::nat)) x &
-   treal_le (treal_of_num (0::nat)) y -->
-   treal_le (treal_of_num (0::nat)) (treal_mul x y)"
+   treal_le (treal_of_num 0) x & treal_le (treal_of_num 0) y -->
+   treal_le (treal_of_num 0) (treal_mul x y)"
   by (import hollight TREAL_LE_MUL)
 
-lemma TREAL_INV_0: "treal_eq (treal_inv (treal_of_num (0::nat))) (treal_of_num (0::nat))"
+lemma TREAL_INV_0: "treal_eq (treal_inv (treal_of_num 0)) (treal_of_num 0)"
   by (import hollight TREAL_INV_0)
 
 lemma TREAL_MUL_LINV: "ALL x::hreal * hreal.
-   ~ treal_eq x (treal_of_num (0::nat)) -->
-   treal_eq (treal_mul (treal_inv x) x)
-    (treal_of_num (NUMERAL_BIT1 (0::nat)))"
+   ~ treal_eq x (treal_of_num 0) -->
+   treal_eq (treal_mul (treal_inv x) x) (treal_of_num (NUMERAL_BIT1 0))"
   by (import hollight TREAL_MUL_LINV)
 
 lemma TREAL_OF_NUM_WELLDEF: "ALL (m::nat) n::nat. m = n --> treal_eq (treal_of_num m) (treal_of_num n)"
@@ -3749,25 +4171,23 @@
 constdefs
   real_abs :: "hollight.real => hollight.real" 
   "real_abs ==
-%u::hollight.real. COND (real_le (real_of_num (0::nat)) u) u (real_neg u)"
+%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u)"
 
 lemma DEF_real_abs: "real_abs =
-(%u::hollight.real. COND (real_le (real_of_num (0::nat)) u) u (real_neg u))"
+(%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u))"
   by (import hollight DEF_real_abs)
 
 constdefs
   real_pow :: "hollight.real => nat => hollight.real" 
   "real_pow ==
 SOME real_pow::hollight.real => nat => hollight.real.
-   (ALL x::hollight.real.
-       real_pow x (0::nat) = real_of_num (NUMERAL_BIT1 (0::nat))) &
+   (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
    (ALL (x::hollight.real) n::nat.
        real_pow x (Suc n) = real_mul x (real_pow x n))"
 
 lemma DEF_real_pow: "real_pow =
 (SOME real_pow::hollight.real => nat => hollight.real.
-    (ALL x::hollight.real.
-        real_pow x (0::nat) = real_of_num (NUMERAL_BIT1 (0::nat))) &
+    (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
     (ALL (x::hollight.real) n::nat.
         real_pow x (Suc n) = real_mul x (real_pow x n)))"
   by (import hollight DEF_real_pow)
@@ -3795,20 +4215,19 @@
 
 lemma REAL_HREAL_LEMMA1: "EX x::hreal => hollight.real.
    (ALL xa::hollight.real.
-       real_le (real_of_num (0::nat)) xa = (EX y::hreal. xa = x y)) &
+       real_le (real_of_num 0) xa = (EX y::hreal. xa = x y)) &
    (ALL (y::hreal) z::hreal. hreal_le y z = real_le (x y) (x z))"
   by (import hollight REAL_HREAL_LEMMA1)
 
 lemma REAL_HREAL_LEMMA2: "EX (x::hollight.real => hreal) r::hreal => hollight.real.
    (ALL xa::hreal. x (r xa) = xa) &
-   (ALL xa::hollight.real.
-       real_le (real_of_num (0::nat)) xa --> r (x xa) = xa) &
-   (ALL x::hreal. real_le (real_of_num (0::nat)) (r x)) &
+   (ALL xa::hollight.real. real_le (real_of_num 0) xa --> r (x xa) = xa) &
+   (ALL x::hreal. real_le (real_of_num 0) (r x)) &
    (ALL (x::hreal) y::hreal. hreal_le x y = real_le (r x) (r y))"
   by (import hollight REAL_HREAL_LEMMA2)
 
 lemma REAL_COMPLETE_SOMEPOS: "ALL P::hollight.real => bool.
-   (EX x::hollight.real. P x & real_le (real_of_num (0::nat)) x) &
+   (EX x::hollight.real. P x & real_le (real_of_num 0) x) &
    (EX M::hollight.real. ALL x::hollight.real. P x --> real_le x M) -->
    (EX M::hollight.real.
        (ALL x::hollight.real. P x --> real_le x M) &
@@ -3830,7 +4249,7 @@
 real_add m (real_add n p) = real_add n (real_add m p)"
   by (import hollight REAL_ADD_AC)
 
-lemma REAL_ADD_RINV: "ALL x::hollight.real. real_add x (real_neg x) = real_of_num (0::nat)"
+lemma REAL_ADD_RINV: "ALL x::hollight.real. real_add x (real_neg x) = real_of_num 0"
   by (import hollight REAL_ADD_RINV)
 
 lemma REAL_EQ_ADD_LCANCEL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
@@ -3852,11 +4271,11 @@
    real_mul (real_neg x) y = real_neg (real_mul x y)"
   by (import hollight REAL_MUL_LNEG)
 
-lemma REAL_ADD_RID: "ALL x::hollight.real. real_add x (real_of_num (0::nat)) = x"
+lemma REAL_ADD_RID: "ALL x::hollight.real. real_add x (real_of_num 0) = x"
   by (import hollight REAL_ADD_RID)
 
 lemma REAL_LE_LNEG: "ALL (x::hollight.real) y::hollight.real.
-   real_le (real_neg x) y = real_le (real_of_num (0::nat)) (real_add x y)"
+   real_le (real_neg x) y = real_le (real_of_num 0) (real_add x y)"
   by (import hollight REAL_LE_LNEG)
 
 lemma REAL_LE_NEG2: "ALL (x::hollight.real) y::hollight.real.
@@ -3864,7 +4283,7 @@
   by (import hollight REAL_LE_NEG2)
 
 lemma REAL_LE_RNEG: "ALL (x::hollight.real) y::hollight.real.
-   real_le x (real_neg y) = real_le (real_add x y) (real_of_num (0::nat))"
+   real_le x (real_neg y) = real_le (real_add x y) (real_of_num 0)"
   by (import hollight REAL_LE_RNEG)
 
 lemma REAL_OF_NUM_POW: "ALL (x::nat) n::nat. real_pow (real_of_num x) n = real_of_num (EXP x n)"
@@ -3896,8 +4315,8 @@
   by (import hollight REAL_LT_TRANS)
 
 lemma REAL_LE_ADD: "ALL (x::hollight.real) y::hollight.real.
-   real_le (real_of_num (0::nat)) x & real_le (real_of_num (0::nat)) y -->
-   real_le (real_of_num (0::nat)) (real_add x y)"
+   real_le (real_of_num 0) x & real_le (real_of_num 0) y -->
+   real_le (real_of_num 0) (real_add x y)"
   by (import hollight REAL_LE_ADD)
 
 lemma REAL_LTE_ANTISYM: "ALL (x::hollight.real) y::hollight.real. ~ (real_lt x y & real_le y x)"
@@ -3907,46 +4326,40 @@
   by (import hollight REAL_LT_REFL)
 
 lemma REAL_LET_ADD: "ALL (x::hollight.real) y::hollight.real.
-   real_le (real_of_num (0::nat)) x & real_lt (real_of_num (0::nat)) y -->
-   real_lt (real_of_num (0::nat)) (real_add x y)"
+   real_le (real_of_num 0) x & real_lt (real_of_num 0) y -->
+   real_lt (real_of_num 0) (real_add x y)"
   by (import hollight REAL_LET_ADD)
 
 lemma REAL_ENTIRE: "ALL (x::hollight.real) y::hollight.real.
-   (real_mul x y = real_of_num (0::nat)) =
-   (x = real_of_num (0::nat) | y = real_of_num (0::nat))"
+   (real_mul x y = real_of_num 0) = (x = real_of_num 0 | y = real_of_num 0)"
   by (import hollight REAL_ENTIRE)
 
 lemma REAL_POW_2: "ALL x::hollight.real.
-   real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = real_mul x x"
+   real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = real_mul x x"
   by (import hollight REAL_POW_2)
 
 lemma REAL_POLY_CLAUSES: "(ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
     real_add x (real_add y z) = real_add (real_add x y) z) &
 (ALL (x::hollight.real) y::hollight.real. real_add x y = real_add y x) &
-(ALL x::hollight.real. real_add (real_of_num (0::nat)) x = x) &
+(ALL x::hollight.real. real_add (real_of_num 0) x = x) &
 (ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
     real_mul x (real_mul y z) = real_mul (real_mul x y) z) &
 (ALL (x::hollight.real) y::hollight.real. real_mul x y = real_mul y x) &
-(ALL x::hollight.real.
-    real_mul (real_of_num (NUMERAL_BIT1 (0::nat))) x = x) &
-(ALL x::hollight.real.
-    real_mul (real_of_num (0::nat)) x = real_of_num (0::nat)) &
+(ALL x::hollight.real. real_mul (real_of_num (NUMERAL_BIT1 0)) x = x) &
+(ALL x::hollight.real. real_mul (real_of_num 0) x = real_of_num 0) &
 (ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
     real_mul x (real_add xa xb) =
     real_add (real_mul x xa) (real_mul x xb)) &
-(ALL x::hollight.real.
-    real_pow x (0::nat) = real_of_num (NUMERAL_BIT1 (0::nat))) &
+(ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
 (ALL (x::hollight.real) xa::nat.
     real_pow x (Suc xa) = real_mul x (real_pow x xa))"
   by (import hollight REAL_POLY_CLAUSES)
 
 lemma REAL_POLY_NEG_CLAUSES: "(ALL x::hollight.real.
-    real_neg x =
-    real_mul (real_neg (real_of_num (NUMERAL_BIT1 (0::nat)))) x) &
+    real_neg x = real_mul (real_neg (real_of_num (NUMERAL_BIT1 0))) x) &
 (ALL (x::hollight.real) xa::hollight.real.
     real_sub x xa =
-    real_add x
-     (real_mul (real_neg (real_of_num (NUMERAL_BIT1 (0::nat)))) xa))"
+    real_add x (real_mul (real_neg (real_of_num (NUMERAL_BIT1 0))) xa))"
   by (import hollight REAL_POLY_NEG_CLAUSES)
 
 lemma REAL_OF_NUM_LT: "ALL (x::nat) xa::nat. real_lt (real_of_num x) (real_of_num xa) = < x xa"
@@ -3961,7 +4374,7 @@
   by (import hollight REAL_OF_NUM_GT)
 
 lemma REAL_OF_NUM_SUC: "ALL x::nat.
-   real_add (real_of_num x) (real_of_num (NUMERAL_BIT1 (0::nat))) =
+   real_add (real_of_num x) (real_of_num (NUMERAL_BIT1 0)) =
    real_of_num (Suc x)"
   by (import hollight REAL_OF_NUM_SUC)
 
@@ -3983,16 +4396,16 @@
   by (import hollight REAL_LT_LADD_IMP)
 
 lemma REAL_LT_MUL: "ALL (x::hollight.real) y::hollight.real.
-   real_lt (real_of_num (0::nat)) x & real_lt (real_of_num (0::nat)) y -->
-   real_lt (real_of_num (0::nat)) (real_mul x y)"
+   real_lt (real_of_num 0) x & real_lt (real_of_num 0) y -->
+   real_lt (real_of_num 0) (real_mul x y)"
   by (import hollight REAL_LT_MUL)
 
 lemma REAL_EQ_ADD_LCANCEL_0: "ALL (x::hollight.real) y::hollight.real.
-   (real_add x y = x) = (y = real_of_num (0::nat))"
+   (real_add x y = x) = (y = real_of_num 0)"
   by (import hollight REAL_EQ_ADD_LCANCEL_0)
 
 lemma REAL_EQ_ADD_RCANCEL_0: "ALL (x::hollight.real) y::hollight.real.
-   (real_add x y = y) = (x = real_of_num (0::nat))"
+   (real_add x y = y) = (x = real_of_num 0)"
   by (import hollight REAL_EQ_ADD_RCANCEL_0)
 
 lemma REAL_NOT_EQ: "ALL (x::hollight.real) y::hollight.real.
@@ -4009,7 +4422,7 @@
 lemma REAL_LT_TOTAL: "ALL (x::hollight.real) y::hollight.real. x = y | real_lt x y | real_lt y x"
   by (import hollight REAL_LT_TOTAL)
 
-lemma REAL_LE_01: "real_le (real_of_num (0::nat)) (real_of_num (NUMERAL_BIT1 (0::nat)))"
+lemma REAL_LE_01: "real_le (real_of_num 0) (real_of_num (NUMERAL_BIT1 0))"
   by (import hollight REAL_LE_01)
 
 lemma REAL_LE_ADD2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
@@ -4018,34 +4431,33 @@
   by (import hollight REAL_LE_ADD2)
 
 lemma REAL_LT_LNEG: "ALL (x::hollight.real) xa::hollight.real.
-   real_lt (real_neg x) xa = real_lt (real_of_num (0::nat)) (real_add x xa)"
+   real_lt (real_neg x) xa = real_lt (real_of_num 0) (real_add x xa)"
   by (import hollight REAL_LT_LNEG)
 
 lemma REAL_LT_RNEG: "ALL (x::hollight.real) xa::hollight.real.
-   real_lt x (real_neg xa) = real_lt (real_add x xa) (real_of_num (0::nat))"
+   real_lt x (real_neg xa) = real_lt (real_add x xa) (real_of_num 0)"
   by (import hollight REAL_LT_RNEG)
 
-lemma REAL_NEG_EQ_0: "ALL x::hollight.real.
-   (real_neg x = real_of_num (0::nat)) = (x = real_of_num (0::nat))"
+lemma REAL_NEG_EQ_0: "ALL x::hollight.real. (real_neg x = real_of_num 0) = (x = real_of_num 0)"
   by (import hollight REAL_NEG_EQ_0)
 
 lemma REAL_ADD_SUB: "ALL (x::hollight.real) y::hollight.real. real_sub (real_add x y) x = y"
   by (import hollight REAL_ADD_SUB)
 
 lemma REAL_LE_ADDR: "ALL (x::hollight.real) y::hollight.real.
-   real_le x (real_add x y) = real_le (real_of_num (0::nat)) y"
+   real_le x (real_add x y) = real_le (real_of_num 0) y"
   by (import hollight REAL_LE_ADDR)
 
 lemma REAL_LE_ADDL: "ALL (x::hollight.real) y::hollight.real.
-   real_le y (real_add x y) = real_le (real_of_num (0::nat)) x"
+   real_le y (real_add x y) = real_le (real_of_num 0) x"
   by (import hollight REAL_LE_ADDL)
 
 lemma REAL_LT_ADDR: "ALL (x::hollight.real) y::hollight.real.
-   real_lt x (real_add x y) = real_lt (real_of_num (0::nat)) y"
+   real_lt x (real_add x y) = real_lt (real_of_num 0) y"
   by (import hollight REAL_LT_ADDR)
 
 lemma REAL_LT_ADDL: "ALL (x::hollight.real) y::hollight.real.
-   real_lt y (real_add x y) = real_lt (real_of_num (0::nat)) x"
+   real_lt y (real_add x y) = real_lt (real_of_num 0) x"
   by (import hollight REAL_LT_ADDL)
 
 lemma REAL_ADD2_SUB2: "ALL (a::hollight.real) (b::hollight.real) (c::hollight.real)
@@ -4086,15 +4498,13 @@
    real_lt (real_neg x) (real_neg y) = real_lt y x"
   by (import hollight REAL_LT_NEG2)
 
-lemma REAL_ABS_ZERO: "ALL x::hollight.real.
-   (real_abs x = real_of_num (0::nat)) = (x = real_of_num (0::nat))"
+lemma REAL_ABS_ZERO: "ALL x::hollight.real. (real_abs x = real_of_num 0) = (x = real_of_num 0)"
   by (import hollight REAL_ABS_ZERO)
 
-lemma REAL_ABS_0: "real_abs (real_of_num (0::nat)) = real_of_num (0::nat)"
+lemma REAL_ABS_0: "real_abs (real_of_num 0) = real_of_num 0"
   by (import hollight REAL_ABS_0)
 
-lemma REAL_ABS_1: "real_abs (real_of_num (NUMERAL_BIT1 (0::nat))) =
-real_of_num (NUMERAL_BIT1 (0::nat))"
+lemma REAL_ABS_1: "real_abs (real_of_num (NUMERAL_BIT1 0)) = real_of_num (NUMERAL_BIT1 0)"
   by (import hollight REAL_ABS_1)
 
 lemma REAL_ABS_TRIANGLE: "ALL (x::hollight.real) y::hollight.real.
@@ -4111,7 +4521,7 @@
    real_lt (real_abs y) z"
   by (import hollight REAL_ABS_TRIANGLE_LT)
 
-lemma REAL_ABS_POS: "ALL x::hollight.real. real_le (real_of_num (0::nat)) (real_abs x)"
+lemma REAL_ABS_POS: "ALL x::hollight.real. real_le (real_of_num 0) (real_abs x)"
   by (import hollight REAL_ABS_POS)
 
 lemma REAL_ABS_SUB: "ALL (x::hollight.real) y::hollight.real.
@@ -4119,7 +4529,7 @@
   by (import hollight REAL_ABS_SUB)
 
 lemma REAL_ABS_NZ: "ALL x::hollight.real.
-   (x ~= real_of_num (0::nat)) = real_lt (real_of_num (0::nat)) (real_abs x)"
+   (x ~= real_of_num 0) = real_lt (real_of_num 0) (real_abs x)"
   by (import hollight REAL_ABS_NZ)
 
 lemma REAL_ABS_ABS: "ALL x::hollight.real. real_abs (real_abs x) = real_abs x"
@@ -4128,11 +4538,11 @@
 lemma REAL_ABS_LE: "ALL x::hollight.real. real_le x (real_abs x)"
   by (import hollight REAL_ABS_LE)
 
-lemma REAL_ABS_REFL: "ALL x::hollight.real. (real_abs x = x) = real_le (real_of_num (0::nat)) x"
+lemma REAL_ABS_REFL: "ALL x::hollight.real. (real_abs x = x) = real_le (real_of_num 0) x"
   by (import hollight REAL_ABS_REFL)
 
 lemma REAL_ABS_BETWEEN: "ALL (x::hollight.real) (y::hollight.real) d::hollight.real.
-   (real_lt (real_of_num (0::nat)) d &
+   (real_lt (real_of_num 0) d &
     real_lt (real_sub x d) y & real_lt y (real_add x d)) =
    real_lt (real_abs (real_sub y x)) d"
   by (import hollight REAL_ABS_BETWEEN)
@@ -4142,12 +4552,11 @@
   by (import hollight REAL_ABS_BOUND)
 
 lemma REAL_ABS_STILLNZ: "ALL (x::hollight.real) y::hollight.real.
-   real_lt (real_abs (real_sub x y)) (real_abs y) -->
-   x ~= real_of_num (0::nat)"
+   real_lt (real_abs (real_sub x y)) (real_abs y) --> x ~= real_of_num 0"
   by (import hollight REAL_ABS_STILLNZ)
 
 lemma REAL_ABS_CASES: "ALL x::hollight.real.
-   x = real_of_num (0::nat) | real_lt (real_of_num (0::nat)) (real_abs x)"
+   x = real_of_num 0 | real_lt (real_of_num 0) (real_abs x)"
   by (import hollight REAL_ABS_CASES)
 
 lemma REAL_ABS_BETWEEN1: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
@@ -4156,12 +4565,12 @@
   by (import hollight REAL_ABS_BETWEEN1)
 
 lemma REAL_ABS_SIGN: "ALL (x::hollight.real) y::hollight.real.
-   real_lt (real_abs (real_sub x y)) y --> real_lt (real_of_num (0::nat)) x"
+   real_lt (real_abs (real_sub x y)) y --> real_lt (real_of_num 0) x"
   by (import hollight REAL_ABS_SIGN)
 
 lemma REAL_ABS_SIGN2: "ALL (x::hollight.real) y::hollight.real.
    real_lt (real_abs (real_sub x y)) (real_neg y) -->
-   real_lt x (real_of_num (0::nat))"
+   real_lt x (real_of_num 0)"
   by (import hollight REAL_ABS_SIGN2)
 
 lemma REAL_ABS_CIRCLE: "ALL (x::hollight.real) (y::hollight.real) h::hollight.real.
@@ -4178,11 +4587,11 @@
    y::hollight.real.
    real_lt x0 y0 &
    real_lt
-    (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))))
+    (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
       (real_abs (real_sub x x0)))
     (real_sub y0 x0) &
    real_lt
-    (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))))
+    (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
       (real_abs (real_sub y y0)))
     (real_sub y0 x0) -->
    real_lt x y"
@@ -4271,13 +4680,11 @@
   by (import hollight REAL_ABS_MUL)
 
 lemma REAL_POW_LE: "ALL (x::hollight.real) n::nat.
-   real_le (real_of_num (0::nat)) x -->
-   real_le (real_of_num (0::nat)) (real_pow x n)"
+   real_le (real_of_num 0) x --> real_le (real_of_num 0) (real_pow x n)"
   by (import hollight REAL_POW_LE)
 
 lemma REAL_POW_LT: "ALL (x::hollight.real) n::nat.
-   real_lt (real_of_num (0::nat)) x -->
-   real_lt (real_of_num (0::nat)) (real_pow x n)"
+   real_lt (real_of_num 0) x --> real_lt (real_of_num 0) (real_pow x n)"
   by (import hollight REAL_POW_LT)
 
 lemma REAL_ABS_POW: "ALL (x::hollight.real) n::nat.
@@ -4285,89 +4692,82 @@
   by (import hollight REAL_ABS_POW)
 
 lemma REAL_LE_LMUL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_le (real_of_num (0::nat)) x & real_le xa xb -->
+   real_le (real_of_num 0) x & real_le xa xb -->
    real_le (real_mul x xa) (real_mul x xb)"
   by (import hollight REAL_LE_LMUL)
 
 lemma REAL_LE_RMUL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_le x y & real_le (real_of_num (0::nat)) z -->
+   real_le x y & real_le (real_of_num 0) z -->
    real_le (real_mul x z) (real_mul y z)"
   by (import hollight REAL_LE_RMUL)
 
 lemma REAL_LT_LMUL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) x & real_lt xa xb -->
+   real_lt (real_of_num 0) x & real_lt xa xb -->
    real_lt (real_mul x xa) (real_mul x xb)"
   by (import hollight REAL_LT_LMUL)
 
 lemma REAL_LT_RMUL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt x y & real_lt (real_of_num (0::nat)) z -->
+   real_lt x y & real_lt (real_of_num 0) z -->
    real_lt (real_mul x z) (real_mul y z)"
   by (import hollight REAL_LT_RMUL)
 
 lemma REAL_EQ_MUL_LCANCEL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   (real_mul x y = real_mul x z) = (x = real_of_num (0::nat) | y = z)"
+   (real_mul x y = real_mul x z) = (x = real_of_num 0 | y = z)"
   by (import hollight REAL_EQ_MUL_LCANCEL)
 
 lemma REAL_EQ_MUL_RCANCEL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   (real_mul x xb = real_mul xa xb) = (x = xa | xb = real_of_num (0::nat))"
+   (real_mul x xb = real_mul xa xb) = (x = xa | xb = real_of_num 0)"
   by (import hollight REAL_EQ_MUL_RCANCEL)
 
 lemma REAL_MUL_LINV_UNIQ: "ALL (x::hollight.real) y::hollight.real.
-   real_mul x y = real_of_num (NUMERAL_BIT1 (0::nat)) --> real_inv y = x"
+   real_mul x y = real_of_num (NUMERAL_BIT1 0) --> real_inv y = x"
   by (import hollight REAL_MUL_LINV_UNIQ)
 
 lemma REAL_MUL_RINV_UNIQ: "ALL (x::hollight.real) xa::hollight.real.
-   real_mul x xa = real_of_num (NUMERAL_BIT1 (0::nat)) --> real_inv x = xa"
+   real_mul x xa = real_of_num (NUMERAL_BIT1 0) --> real_inv x = xa"
   by (import hollight REAL_MUL_RINV_UNIQ)
 
 lemma REAL_INV_INV: "ALL x::hollight.real. real_inv (real_inv x) = x"
   by (import hollight REAL_INV_INV)
 
-lemma REAL_INV_EQ_0: "ALL x::hollight.real.
-   (real_inv x = real_of_num (0::nat)) = (x = real_of_num (0::nat))"
+lemma REAL_INV_EQ_0: "ALL x::hollight.real. (real_inv x = real_of_num 0) = (x = real_of_num 0)"
   by (import hollight REAL_INV_EQ_0)
 
 lemma REAL_LT_INV: "ALL x::hollight.real.
-   real_lt (real_of_num (0::nat)) x -->
-   real_lt (real_of_num (0::nat)) (real_inv x)"
+   real_lt (real_of_num 0) x --> real_lt (real_of_num 0) (real_inv x)"
   by (import hollight REAL_LT_INV)
 
 lemma REAL_LT_INV_EQ: "ALL x::hollight.real.
-   real_lt (real_of_num (0::nat)) (real_inv x) =
-   real_lt (real_of_num (0::nat)) x"
+   real_lt (real_of_num 0) (real_inv x) = real_lt (real_of_num 0) x"
   by (import hollight REAL_LT_INV_EQ)
 
 lemma REAL_INV_NEG: "ALL x::hollight.real. real_inv (real_neg x) = real_neg (real_inv x)"
   by (import hollight REAL_INV_NEG)
 
 lemma REAL_LE_INV_EQ: "ALL x::hollight.real.
-   real_le (real_of_num (0::nat)) (real_inv x) =
-   real_le (real_of_num (0::nat)) x"
+   real_le (real_of_num 0) (real_inv x) = real_le (real_of_num 0) x"
   by (import hollight REAL_LE_INV_EQ)
 
 lemma REAL_LE_INV: "ALL x::hollight.real.
-   real_le (real_of_num (0::nat)) x -->
-   real_le (real_of_num (0::nat)) (real_inv x)"
+   real_le (real_of_num 0) x --> real_le (real_of_num 0) (real_inv x)"
   by (import hollight REAL_LE_INV)
 
-lemma REAL_INV_1: "real_inv (real_of_num (NUMERAL_BIT1 (0::nat))) =
-real_of_num (NUMERAL_BIT1 (0::nat))"
+lemma REAL_INV_1: "real_inv (real_of_num (NUMERAL_BIT1 0)) = real_of_num (NUMERAL_BIT1 0)"
   by (import hollight REAL_INV_1)
 
-lemma REAL_DIV_1: "ALL x::hollight.real. real_div x (real_of_num (NUMERAL_BIT1 (0::nat))) = x"
+lemma REAL_DIV_1: "ALL x::hollight.real. real_div x (real_of_num (NUMERAL_BIT1 0)) = x"
   by (import hollight REAL_DIV_1)
 
 lemma REAL_DIV_REFL: "ALL x::hollight.real.
-   x ~= real_of_num (0::nat) -->
-   real_div x x = real_of_num (NUMERAL_BIT1 (0::nat))"
+   x ~= real_of_num 0 --> real_div x x = real_of_num (NUMERAL_BIT1 0)"
   by (import hollight REAL_DIV_REFL)
 
 lemma REAL_DIV_RMUL: "ALL (x::hollight.real) xa::hollight.real.
-   xa ~= real_of_num (0::nat) --> real_mul (real_div x xa) xa = x"
+   xa ~= real_of_num 0 --> real_mul (real_div x xa) xa = x"
   by (import hollight REAL_DIV_RMUL)
 
 lemma REAL_DIV_LMUL: "ALL (x::hollight.real) xa::hollight.real.
-   xa ~= real_of_num (0::nat) --> real_mul xa (real_div x xa) = x"
+   xa ~= real_of_num 0 --> real_mul xa (real_div x xa) = x"
   by (import hollight REAL_DIV_LMUL)
 
 lemma REAL_ABS_INV: "ALL x::hollight.real. real_abs (real_inv x) = real_inv (real_abs x)"
@@ -4402,190 +4802,179 @@
   by (import hollight REAL_POW_ADD)
 
 lemma REAL_POW_NZ: "ALL (x::hollight.real) n::nat.
-   x ~= real_of_num (0::nat) --> real_pow x n ~= real_of_num (0::nat)"
+   x ~= real_of_num 0 --> real_pow x n ~= real_of_num 0"
   by (import hollight REAL_POW_NZ)
 
 lemma REAL_POW_SUB: "ALL (x::hollight.real) (m::nat) n::nat.
-   x ~= real_of_num (0::nat) & <= m n -->
+   x ~= real_of_num 0 & <= m n -->
    real_pow x (n - m) = real_div (real_pow x n) (real_pow x m)"
   by (import hollight REAL_POW_SUB)
 
-lemma REAL_LT_IMP_NZ: "ALL x::hollight.real.
-   real_lt (real_of_num (0::nat)) x --> x ~= real_of_num (0::nat)"
+lemma REAL_LT_IMP_NZ: "ALL x::hollight.real. real_lt (real_of_num 0) x --> x ~= real_of_num 0"
   by (import hollight REAL_LT_IMP_NZ)
 
 lemma REAL_LT_LCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt (real_of_num (0::nat)) x &
-   real_lt (real_mul x y) (real_mul x z) -->
+   real_lt (real_of_num 0) x & real_lt (real_mul x y) (real_mul x z) -->
    real_lt y z"
   by (import hollight REAL_LT_LCANCEL_IMP)
 
 lemma REAL_LT_RCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb &
-   real_lt (real_mul x xb) (real_mul xa xb) -->
+   real_lt (real_of_num 0) xb & real_lt (real_mul x xb) (real_mul xa xb) -->
    real_lt x xa"
   by (import hollight REAL_LT_RCANCEL_IMP)
 
 lemma REAL_LE_LCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt (real_of_num (0::nat)) x &
-   real_le (real_mul x y) (real_mul x z) -->
+   real_lt (real_of_num 0) x & real_le (real_mul x y) (real_mul x z) -->
    real_le y z"
   by (import hollight REAL_LE_LCANCEL_IMP)
 
 lemma REAL_LE_RCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb &
-   real_le (real_mul x xb) (real_mul xa xb) -->
+   real_lt (real_of_num 0) xb & real_le (real_mul x xb) (real_mul xa xb) -->
    real_le x xa"
   by (import hollight REAL_LE_RCANCEL_IMP)
 
 lemma REAL_LE_LMUL_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt (real_of_num (0::nat)) z -->
+   real_lt (real_of_num 0) z -->
    real_le (real_mul z x) (real_mul z y) = real_le x y"
   by (import hollight REAL_LE_LMUL_EQ)
 
 lemma REAL_LE_RDIV_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt (real_of_num (0::nat)) z -->
+   real_lt (real_of_num 0) z -->
    real_le x (real_div y z) = real_le (real_mul x z) y"
   by (import hollight REAL_LE_RDIV_EQ)
 
 lemma REAL_LE_LDIV_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   real_lt (real_of_num (0::nat)) z -->
+   real_lt (real_of_num 0) z -->
    real_le (real_div x z) y = real_le x (real_mul y z)"
   by (import hollight REAL_LE_LDIV_EQ)
 
 lemma REAL_LT_RDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    real_lt x (real_div xa xb) = real_lt (real_mul x xb) xa"
   by (import hollight REAL_LT_RDIV_EQ)
 
 lemma REAL_LT_LDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    real_lt (real_div x xb) xa = real_lt x (real_mul xa xb)"
   by (import hollight REAL_LT_LDIV_EQ)
 
 lemma REAL_EQ_RDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    (x = real_div xa xb) = (real_mul x xb = xa)"
   by (import hollight REAL_EQ_RDIV_EQ)
 
 lemma REAL_EQ_LDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    (real_div x xb = xa) = (x = real_mul xa xb)"
   by (import hollight REAL_EQ_LDIV_EQ)
 
 lemma REAL_LT_DIV2_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    real_lt (real_div x xb) (real_div xa xb) = real_lt x xa"
   by (import hollight REAL_LT_DIV2_EQ)
 
 lemma REAL_LE_DIV2_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   real_lt (real_of_num (0::nat)) xb -->
+   real_lt (real_of_num 0) xb -->
    real_le (real_div x xb) (real_div xa xb) = real_le x xa"
   by (import hollight REAL_LE_DIV2_EQ)
 
 lemma REAL_MUL_2: "ALL x::hollight.real.
-   real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)))) x =
-   real_add x x"
+   real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) x = real_add x x"
   by (import hollight REAL_MUL_2)
 
 lemma REAL_POW_EQ_0: "ALL (x::hollight.real) n::nat.
-   (real_pow x n = real_of_num (0::nat)) =
-   (x = real_of_num (0::nat) & n ~= (0::nat))"
+   (real_pow x n = real_of_num 0) = (x = real_of_num 0 & n ~= 0)"
   by (import hollight REAL_POW_EQ_0)
 
 lemma REAL_LE_MUL2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
    z::hollight.real.
-   real_le (real_of_num (0::nat)) w &
-   real_le w x & real_le (real_of_num (0::nat)) y & real_le y z -->
+   real_le (real_of_num 0) w &
+   real_le w x & real_le (real_of_num 0) y & real_le y z -->
    real_le (real_mul w y) (real_mul x z)"
   by (import hollight REAL_LE_MUL2)
 
 lemma REAL_LT_MUL2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
    z::hollight.real.
-   real_le (real_of_num (0::nat)) w &
-   real_lt w x & real_le (real_of_num (0::nat)) y & real_lt y z -->
+   real_le (real_of_num 0) w &
+   real_lt w x & real_le (real_of_num 0) y & real_lt y z -->
    real_lt (real_mul w y) (real_mul x z)"
   by (import hollight REAL_LT_MUL2)
 
 lemma REAL_LT_SQUARE: "ALL x::hollight.real.
-   real_lt (real_of_num (0::nat)) (real_mul x x) =
-   (x ~= real_of_num (0::nat))"
+   real_lt (real_of_num 0) (real_mul x x) = (x ~= real_of_num 0)"
   by (import hollight REAL_LT_SQUARE)
 
 lemma REAL_INV_LE_1: "ALL x::hollight.real.
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat))) x -->
-   real_le (real_inv x) (real_of_num (NUMERAL_BIT1 (0::nat)))"
+   real_le (real_of_num (NUMERAL_BIT1 0)) x -->
+   real_le (real_inv x) (real_of_num (NUMERAL_BIT1 0))"
   by (import hollight REAL_INV_LE_1)
 
 lemma REAL_POW_LE_1: "ALL (n::nat) x::hollight.real.
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat))) x -->
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat))) (real_pow x n)"
+   real_le (real_of_num (NUMERAL_BIT1 0)) x -->
+   real_le (real_of_num (NUMERAL_BIT1 0)) (real_pow x n)"
   by (import hollight REAL_POW_LE_1)
 
 lemma REAL_POW_1_LE: "ALL (n::nat) x::hollight.real.
-   real_le (real_of_num (0::nat)) x &
-   real_le x (real_of_num (NUMERAL_BIT1 (0::nat))) -->
-   real_le (real_pow x n) (real_of_num (NUMERAL_BIT1 (0::nat)))"
+   real_le (real_of_num 0) x & real_le x (real_of_num (NUMERAL_BIT1 0)) -->
+   real_le (real_pow x n) (real_of_num (NUMERAL_BIT1 0))"
   by (import hollight REAL_POW_1_LE)
 
-lemma REAL_POW_1: "ALL x::hollight.real. real_pow x (NUMERAL_BIT1 (0::nat)) = x"
+lemma REAL_POW_1: "ALL x::hollight.real. real_pow x (NUMERAL_BIT1 0) = x"
   by (import hollight REAL_POW_1)
 
 lemma REAL_POW_ONE: "ALL n::nat.
-   real_pow (real_of_num (NUMERAL_BIT1 (0::nat))) n =
-   real_of_num (NUMERAL_BIT1 (0::nat))"
+   real_pow (real_of_num (NUMERAL_BIT1 0)) n = real_of_num (NUMERAL_BIT1 0)"
   by (import hollight REAL_POW_ONE)
 
 lemma REAL_LT_INV2: "ALL (x::hollight.real) y::hollight.real.
-   real_lt (real_of_num (0::nat)) x & real_lt x y -->
+   real_lt (real_of_num 0) x & real_lt x y -->
    real_lt (real_inv y) (real_inv x)"
   by (import hollight REAL_LT_INV2)
 
 lemma REAL_LE_INV2: "ALL (x::hollight.real) y::hollight.real.
-   real_lt (real_of_num (0::nat)) x & real_le x y -->
+   real_lt (real_of_num 0) x & real_le x y -->
    real_le (real_inv y) (real_inv x)"
   by (import hollight REAL_LE_INV2)
 
 lemma REAL_INV_1_LE: "ALL x::hollight.real.
-   real_lt (real_of_num (0::nat)) x &
-   real_le x (real_of_num (NUMERAL_BIT1 (0::nat))) -->
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat))) (real_inv x)"
+   real_lt (real_of_num 0) x & real_le x (real_of_num (NUMERAL_BIT1 0)) -->
+   real_le (real_of_num (NUMERAL_BIT1 0)) (real_inv x)"
   by (import hollight REAL_INV_1_LE)
 
 lemma REAL_SUB_INV: "ALL (x::hollight.real) xa::hollight.real.
-   x ~= real_of_num (0::nat) & xa ~= real_of_num (0::nat) -->
+   x ~= real_of_num 0 & xa ~= real_of_num 0 -->
    real_sub (real_inv x) (real_inv xa) =
    real_div (real_sub xa x) (real_mul x xa)"
   by (import hollight REAL_SUB_INV)
 
 lemma REAL_DOWN: "ALL d::hollight.real.
-   real_lt (real_of_num (0::nat)) d -->
-   (EX x::hollight.real. real_lt (real_of_num (0::nat)) x & real_lt x d)"
+   real_lt (real_of_num 0) d -->
+   (EX x::hollight.real. real_lt (real_of_num 0) x & real_lt x d)"
   by (import hollight REAL_DOWN)
 
 lemma REAL_DOWN2: "ALL (d1::hollight.real) d2::hollight.real.
-   real_lt (real_of_num (0::nat)) d1 & real_lt (real_of_num (0::nat)) d2 -->
+   real_lt (real_of_num 0) d1 & real_lt (real_of_num 0) d2 -->
    (EX e::hollight.real.
-       real_lt (real_of_num (0::nat)) e & real_lt e d1 & real_lt e d2)"
+       real_lt (real_of_num 0) e & real_lt e d1 & real_lt e d2)"
   by (import hollight REAL_DOWN2)
 
 lemma REAL_POW_LE2: "ALL (n::nat) (x::hollight.real) y::hollight.real.
-   real_le (real_of_num (0::nat)) x & real_le x y -->
+   real_le (real_of_num 0) x & real_le x y -->
    real_le (real_pow x n) (real_pow y n)"
   by (import hollight REAL_POW_LE2)
 
 lemma REAL_POW_MONO: "ALL (m::nat) (n::nat) x::hollight.real.
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat))) x & <= m n -->
+   real_le (real_of_num (NUMERAL_BIT1 0)) x & <= m n -->
    real_le (real_pow x m) (real_pow x n)"
   by (import hollight REAL_POW_MONO)
 
 lemma REAL_POW_LT2: "ALL (n::nat) (x::hollight.real) y::hollight.real.
-   n ~= (0::nat) & real_le (real_of_num (0::nat)) x & real_lt x y -->
+   n ~= 0 & real_le (real_of_num 0) x & real_lt x y -->
    real_lt (real_pow x n) (real_pow y n)"
   by (import hollight REAL_POW_LT2)
 
 lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::hollight.real.
-   real_lt (real_of_num (NUMERAL_BIT1 (0::nat))) x & < m n -->
+   real_lt (real_of_num (NUMERAL_BIT1 0)) x & < m n -->
    real_lt (real_pow x m) (real_pow x n)"
   by (import hollight REAL_POW_MONO_LT)
 
@@ -4594,54 +4983,54 @@
   by (import hollight REAL_POW_POW)
 
 lemma REAL_EQ_RCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
-   z ~= real_of_num (0::nat) & real_mul x z = real_mul y z --> x = y"
+   z ~= real_of_num 0 & real_mul x z = real_mul y z --> x = y"
   by (import hollight REAL_EQ_RCANCEL_IMP)
 
 lemma REAL_EQ_LCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
-   xb ~= real_of_num (0::nat) & real_mul xb x = real_mul xb xa --> x = xa"
+   xb ~= real_of_num 0 & real_mul xb x = real_mul xb xa --> x = xa"
   by (import hollight REAL_EQ_LCANCEL_IMP)
 
 lemma REAL_LT_DIV: "ALL (x::hollight.real) xa::hollight.real.
-   real_lt (real_of_num (0::nat)) x & real_lt (real_of_num (0::nat)) xa -->
-   real_lt (real_of_num (0::nat)) (real_div x xa)"
+   real_lt (real_of_num 0) x & real_lt (real_of_num 0) xa -->
+   real_lt (real_of_num 0) (real_div x xa)"
   by (import hollight REAL_LT_DIV)
 
 lemma REAL_LE_DIV: "ALL (x::hollight.real) xa::hollight.real.
-   real_le (real_of_num (0::nat)) x & real_le (real_of_num (0::nat)) xa -->
-   real_le (real_of_num (0::nat)) (real_div x xa)"
+   real_le (real_of_num 0) x & real_le (real_of_num 0) xa -->
+   real_le (real_of_num 0) (real_div x xa)"
   by (import hollight REAL_LE_DIV)
 
 lemma REAL_DIV_POW2: "ALL (x::hollight.real) (m::nat) n::nat.
-   x ~= real_of_num (0::nat) -->
+   x ~= real_of_num 0 -->
    real_div (real_pow x m) (real_pow x n) =
    COND (<= n m) (real_pow x (m - n)) (real_inv (real_pow x (n - m)))"
   by (import hollight REAL_DIV_POW2)
 
 lemma REAL_DIV_POW2_ALT: "ALL (x::hollight.real) (m::nat) n::nat.
-   x ~= real_of_num (0::nat) -->
+   x ~= real_of_num 0 -->
    real_div (real_pow x m) (real_pow x n) =
    COND (< n m) (real_pow x (m - n)) (real_inv (real_pow x (n - m)))"
   by (import hollight REAL_DIV_POW2_ALT)
 
 lemma REAL_LT_POW2: "ALL x::nat.
-   real_lt (real_of_num (0::nat))
-    (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)))) x)"
+   real_lt (real_of_num 0)
+    (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) x)"
   by (import hollight REAL_LT_POW2)
 
 lemma REAL_LE_POW2: "ALL n::nat.
-   real_le (real_of_num (NUMERAL_BIT1 (0::nat)))
-    (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)))) n)"
+   real_le (real_of_num (NUMERAL_BIT1 0))
+    (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) n)"
   by (import hollight REAL_LE_POW2)
 
 lemma REAL_POW2_ABS: "ALL x::hollight.real.
-   real_pow (real_abs x) (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) =
-   real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)))"
+   real_pow (real_abs x) (NUMERAL_BIT0 (NUMERAL_BIT1 0)) =
+   real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0))"
   by (import hollight REAL_POW2_ABS)
 
 lemma REAL_LE_SQUARE_ABS: "ALL (x::hollight.real) y::hollight.real.
    real_le (real_abs x) (real_abs y) =
-   real_le (real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))))
-    (real_pow y (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))))"
+   real_le (real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
+    (real_pow y (NUMERAL_BIT0 (NUMERAL_BIT1 0)))"
   by (import hollight REAL_LE_SQUARE_ABS)
 
 lemma REAL_WLOG_LE: "(ALL (x::hollight.real) y::hollight.real.
@@ -4674,39 +5063,39 @@
 lemma DEF_DECIMAL: "DECIMAL = (%(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua))"
   by (import hollight DEF_DECIMAL)
 
-lemma RAT_LEMMA1: "(y1::hollight.real) ~= real_of_num (0::nat) &
-(y2::hollight.real) ~= real_of_num (0::nat) -->
+lemma RAT_LEMMA1: "(y1::hollight.real) ~= real_of_num 0 &
+(y2::hollight.real) ~= real_of_num 0 -->
 real_add (real_div (x1::hollight.real) y1)
  (real_div (x2::hollight.real) y2) =
 real_mul (real_add (real_mul x1 y2) (real_mul x2 y1))
  (real_mul (real_inv y1) (real_inv y2))"
   by (import hollight RAT_LEMMA1)
 
-lemma RAT_LEMMA2: "real_lt (real_of_num (0::nat)) (y1::hollight.real) &
-real_lt (real_of_num (0::nat)) (y2::hollight.real) -->
+lemma RAT_LEMMA2: "real_lt (real_of_num 0) (y1::hollight.real) &
+real_lt (real_of_num 0) (y2::hollight.real) -->
 real_add (real_div (x1::hollight.real) y1)
  (real_div (x2::hollight.real) y2) =
 real_mul (real_add (real_mul x1 y2) (real_mul x2 y1))
  (real_mul (real_inv y1) (real_inv y2))"
   by (import hollight RAT_LEMMA2)
 
-lemma RAT_LEMMA3: "real_lt (real_of_num (0::nat)) (y1::hollight.real) &
-real_lt (real_of_num (0::nat)) (y2::hollight.real) -->
+lemma RAT_LEMMA3: "real_lt (real_of_num 0) (y1::hollight.real) &
+real_lt (real_of_num 0) (y2::hollight.real) -->
 real_sub (real_div (x1::hollight.real) y1)
  (real_div (x2::hollight.real) y2) =
 real_mul (real_sub (real_mul x1 y2) (real_mul x2 y1))
  (real_mul (real_inv y1) (real_inv y2))"
   by (import hollight RAT_LEMMA3)
 
-lemma RAT_LEMMA4: "real_lt (real_of_num (0::nat)) (y1::hollight.real) &
-real_lt (real_of_num (0::nat)) (y2::hollight.real) -->
+lemma RAT_LEMMA4: "real_lt (real_of_num 0) (y1::hollight.real) &
+real_lt (real_of_num 0) (y2::hollight.real) -->
 real_le (real_div (x1::hollight.real) y1)
  (real_div (x2::hollight.real) y2) =
 real_le (real_mul x1 y2) (real_mul x2 y1)"
   by (import hollight RAT_LEMMA4)
 
-lemma RAT_LEMMA5: "real_lt (real_of_num (0::nat)) (y1::hollight.real) &
-real_lt (real_of_num (0::nat)) (y2::hollight.real) -->
+lemma RAT_LEMMA5: "real_lt (real_of_num 0) (y1::hollight.real) &
+real_lt (real_of_num 0) (y2::hollight.real) -->
 (real_div (x1::hollight.real) y1 = real_div (x2::hollight.real) y2) =
 (real_mul x1 y2 = real_mul x2 y1)"
   by (import hollight RAT_LEMMA5)
@@ -4723,7 +5112,7 @@
   by (import hollight DEF_is_int)
 
 typedef (open) int = "Collect is_int"  morphisms "dest_int" "mk_int"
-  apply (rule light_ex_imp_nonempty[where t="real_of_num (NUMERAL (0::nat))"])
+  apply (rule light_ex_imp_nonempty[where t="real_of_num (NUMERAL 0)"])
   by (import hollight TYDEF_int)
 
 syntax
@@ -4902,29 +5291,29 @@
   by (import hollight INT_IMAGE)
 
 lemma INT_LT_DISCRETE: "ALL (x::hollight.int) y::hollight.int.
-   int_lt x y = int_le (int_add x (int_of_num (NUMERAL_BIT1 (0::nat)))) y"
+   int_lt x y = int_le (int_add x (int_of_num (NUMERAL_BIT1 0))) y"
   by (import hollight INT_LT_DISCRETE)
 
 lemma INT_GT_DISCRETE: "ALL (x::hollight.int) xa::hollight.int.
-   int_gt x xa = int_ge x (int_add xa (int_of_num (NUMERAL_BIT1 (0::nat))))"
+   int_gt x xa = int_ge x (int_add xa (int_of_num (NUMERAL_BIT1 0)))"
   by (import hollight INT_GT_DISCRETE)
 
 lemma INT_FORALL_POS: "(ALL n::nat. (P::hollight.int => bool) (int_of_num n)) =
-(ALL i::hollight.int. int_le (int_of_num (0::nat)) i --> P i)"
+(ALL i::hollight.int. int_le (int_of_num 0) i --> P i)"
   by (import hollight INT_FORALL_POS)
 
 lemma INT_ABS_MUL_1: "ALL (x::hollight.int) y::hollight.int.
-   (int_abs (int_mul x y) = int_of_num (NUMERAL_BIT1 (0::nat))) =
-   (int_abs x = int_of_num (NUMERAL_BIT1 (0::nat)) &
-    int_abs y = int_of_num (NUMERAL_BIT1 (0::nat)))"
+   (int_abs (int_mul x y) = int_of_num (NUMERAL_BIT1 0)) =
+   (int_abs x = int_of_num (NUMERAL_BIT1 0) &
+    int_abs y = int_of_num (NUMERAL_BIT1 0))"
   by (import hollight INT_ABS_MUL_1)
 
-lemma INT_POW: "int_pow (x::hollight.int) (0::nat) = int_of_num (NUMERAL_BIT1 (0::nat)) &
+lemma INT_POW: "int_pow (x::hollight.int) 0 = int_of_num (NUMERAL_BIT1 0) &
 (ALL xa::nat. int_pow x (Suc xa) = int_mul x (int_pow x xa))"
   by (import hollight INT_POW)
 
 lemma INT_ABS: "ALL x::hollight.int.
-   int_abs x = COND (int_le (int_of_num (0::nat)) x) x (int_neg x)"
+   int_abs x = COND (int_le (int_of_num 0) x) x (int_neg x)"
   by (import hollight INT_ABS)
 
 lemma INT_GE: "ALL (x::hollight.int) xa::hollight.int. int_ge x xa = int_le xa x"
@@ -4937,7 +5326,7 @@
   by (import hollight INT_LT)
 
 lemma INT_ARCH: "ALL (x::hollight.int) d::hollight.int.
-   d ~= int_of_num (0::nat) --> (EX c::hollight.int. int_lt x (int_mul c d))"
+   d ~= int_of_num 0 --> (EX c::hollight.int. int_lt x (int_mul c d))"
   by (import hollight INT_ARCH)
 
 constdefs
@@ -4952,7 +5341,7 @@
   by (import hollight DEF_mod_int)
 
 constdefs
-  IN :: "'A::type => ('A::type => bool) => bool" 
+  IN :: "'A => ('A => bool) => bool" 
   "IN == %(u::'A::type) ua::'A::type => bool. ua u"
 
 lemma DEF_IN: "IN = (%(u::'A::type) ua::'A::type => bool. ua u)"
@@ -4963,14 +5352,14 @@
   by (import hollight EXTENSION)
 
 constdefs
-  GSPEC :: "('A::type => bool) => 'A::type => bool" 
+  GSPEC :: "('A => bool) => 'A => bool" 
   "GSPEC == %u::'A::type => bool. u"
 
 lemma DEF_GSPEC: "GSPEC = (%u::'A::type => bool. u)"
   by (import hollight DEF_GSPEC)
 
 constdefs
-  SETSPEC :: "'q_36941::type => bool => 'q_36941::type => bool" 
+  SETSPEC :: "'q_36941 => bool => 'q_36941 => bool" 
   "SETSPEC == %(u::'q_36941::type) (ua::bool) ub::'q_36941::type. ua & u = ub"
 
 lemma DEF_SETSPEC: "SETSPEC = (%(u::'q_36941::type) (ua::bool) ub::'q_36941::type. ua & u = ub)"
@@ -4993,14 +5382,14 @@
   by (import hollight IN_ELIM_THM)
 
 constdefs
-  EMPTY :: "'A::type => bool" 
+  EMPTY :: "'A => bool" 
   "EMPTY == %x::'A::type. False"
 
 lemma DEF_EMPTY: "EMPTY = (%x::'A::type. False)"
   by (import hollight DEF_EMPTY)
 
 constdefs
-  INSERT :: "'A::type => ('A::type => bool) => 'A::type => bool" 
+  INSERT :: "'A => ('A => bool) => 'A => bool" 
   "INSERT == %(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u"
 
 lemma DEF_INSERT: "INSERT =
@@ -5008,7 +5397,7 @@
   by (import hollight DEF_INSERT)
 
 consts
-  UNIV :: "'A::type => bool" 
+  UNIV :: "'A => bool" 
 
 defs
   UNIV_def: "hollight.UNIV == %x::'A::type. True"
@@ -5017,7 +5406,7 @@
   by (import hollight DEF_UNIV)
 
 consts
-  UNION :: "('A::type => bool) => ('A::type => bool) => 'A::type => bool" 
+  UNION :: "('A => bool) => ('A => bool) => 'A => bool" 
 
 defs
   UNION_def: "hollight.UNION ==
@@ -5030,7 +5419,7 @@
   by (import hollight DEF_UNION)
 
 constdefs
-  UNIONS :: "(('A::type => bool) => bool) => 'A::type => bool" 
+  UNIONS :: "(('A => bool) => bool) => 'A => bool" 
   "UNIONS ==
 %u::('A::type => bool) => bool.
    GSPEC
@@ -5047,7 +5436,7 @@
   by (import hollight DEF_UNIONS)
 
 consts
-  INTER :: "('A::type => bool) => ('A::type => bool) => 'A::type => bool" 
+  INTER :: "('A => bool) => ('A => bool) => 'A => bool" 
 
 defs
   INTER_def: "hollight.INTER ==
@@ -5060,7 +5449,7 @@
   by (import hollight DEF_INTER)
 
 constdefs
-  INTERS :: "(('A::type => bool) => bool) => 'A::type => bool" 
+  INTERS :: "(('A => bool) => bool) => 'A => bool" 
   "INTERS ==
 %u::('A::type => bool) => bool.
    GSPEC
@@ -5077,7 +5466,7 @@
   by (import hollight DEF_INTERS)
 
 constdefs
-  DIFF :: "('A::type => bool) => ('A::type => bool) => 'A::type => bool" 
+  DIFF :: "('A => bool) => ('A => bool) => 'A => bool" 
   "DIFF ==
 %(u::'A::type => bool) ua::'A::type => bool.
    GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & ~ IN x ua) x)"
@@ -5093,7 +5482,7 @@
   by (import hollight INSERT)
 
 constdefs
-  DELETE :: "('A::type => bool) => 'A::type => 'A::type => bool" 
+  DELETE :: "('A => bool) => 'A => 'A => bool" 
   "DELETE ==
 %(u::'A::type => bool) ua::'A::type.
    GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y)"
@@ -5104,7 +5493,7 @@
   by (import hollight DEF_DELETE)
 
 constdefs
-  SUBSET :: "('A::type => bool) => ('A::type => bool) => bool" 
+  SUBSET :: "('A => bool) => ('A => bool) => bool" 
   "SUBSET ==
 %(u::'A::type => bool) ua::'A::type => bool.
    ALL x::'A::type. IN x u --> IN x ua"
@@ -5115,7 +5504,7 @@
   by (import hollight DEF_SUBSET)
 
 constdefs
-  PSUBSET :: "('A::type => bool) => ('A::type => bool) => bool" 
+  PSUBSET :: "('A => bool) => ('A => bool) => bool" 
   "PSUBSET ==
 %(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua"
 
@@ -5124,7 +5513,7 @@
   by (import hollight DEF_PSUBSET)
 
 constdefs
-  DISJOINT :: "('A::type => bool) => ('A::type => bool) => bool" 
+  DISJOINT :: "('A => bool) => ('A => bool) => bool" 
   "DISJOINT ==
 %(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY"
 
@@ -5133,14 +5522,14 @@
   by (import hollight DEF_DISJOINT)
 
 constdefs
-  SING :: "('A::type => bool) => bool" 
+  SING :: "('A => bool) => bool" 
   "SING == %u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY"
 
 lemma DEF_SING: "SING = (%u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY)"
   by (import hollight DEF_SING)
 
 constdefs
-  FINITE :: "('A::type => bool) => bool" 
+  FINITE :: "('A => bool) => bool" 
   "FINITE ==
 %a::'A::type => bool.
    ALL FINITE'::('A::type => bool) => bool.
@@ -5163,14 +5552,14 @@
   by (import hollight DEF_FINITE)
 
 constdefs
-  INFINITE :: "('A::type => bool) => bool" 
+  INFINITE :: "('A => bool) => bool" 
   "INFINITE == %u::'A::type => bool. ~ FINITE u"
 
 lemma DEF_INFINITE: "INFINITE = (%u::'A::type => bool. ~ FINITE u)"
   by (import hollight DEF_INFINITE)
 
 constdefs
-  IMAGE :: "('A::type => 'B::type) => ('A::type => bool) => 'B::type => bool" 
+  IMAGE :: "('A => 'B) => ('A => bool) => 'B => bool" 
   "IMAGE ==
 %(u::'A::type => 'B::type) ua::'A::type => bool.
    GSPEC
@@ -5185,7 +5574,7 @@
   by (import hollight DEF_IMAGE)
 
 constdefs
-  INJ :: "('A::type => 'B::type) => ('A::type => bool) => ('B::type => bool) => bool" 
+  INJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
   "INJ ==
 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
    (ALL x::'A::type. IN x ua --> IN (u x) ub) &
@@ -5199,7 +5588,7 @@
   by (import hollight DEF_INJ)
 
 constdefs
-  SURJ :: "('A::type => 'B::type) => ('A::type => bool) => ('B::type => bool) => bool" 
+  SURJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
   "SURJ ==
 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
    (ALL x::'A::type. IN x ua --> IN (u x) ub) &
@@ -5212,7 +5601,7 @@
   by (import hollight DEF_SURJ)
 
 constdefs
-  BIJ :: "('A::type => 'B::type) => ('A::type => bool) => ('B::type => bool) => bool" 
+  BIJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
   "BIJ ==
 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
    INJ u ua ub & SURJ u ua ub"
@@ -5223,21 +5612,21 @@
   by (import hollight DEF_BIJ)
 
 constdefs
-  CHOICE :: "('A::type => bool) => 'A::type" 
+  CHOICE :: "('A => bool) => 'A" 
   "CHOICE == %u::'A::type => bool. SOME x::'A::type. IN x u"
 
 lemma DEF_CHOICE: "CHOICE = (%u::'A::type => bool. SOME x::'A::type. IN x u)"
   by (import hollight DEF_CHOICE)
 
 constdefs
-  REST :: "('A::type => bool) => 'A::type => bool" 
+  REST :: "('A => bool) => 'A => bool" 
   "REST == %u::'A::type => bool. DELETE u (CHOICE u)"
 
 lemma DEF_REST: "REST = (%u::'A::type => bool. DELETE u (CHOICE u))"
   by (import hollight DEF_REST)
 
 constdefs
-  CARD_GE :: "('q_37578::type => bool) => ('q_37575::type => bool) => bool" 
+  CARD_GE :: "('q_37578 => bool) => ('q_37575 => bool) => bool" 
   "CARD_GE ==
 %(u::'q_37578::type => bool) ua::'q_37575::type => bool.
    EX f::'q_37578::type => 'q_37575::type.
@@ -5252,7 +5641,7 @@
   by (import hollight DEF_CARD_GE)
 
 constdefs
-  CARD_LE :: "('q_37587::type => bool) => ('q_37586::type => bool) => bool" 
+  CARD_LE :: "('q_37587 => bool) => ('q_37586 => bool) => bool" 
   "CARD_LE ==
 %(u::'q_37587::type => bool) ua::'q_37586::type => bool. CARD_GE ua u"
 
@@ -5261,7 +5650,7 @@
   by (import hollight DEF_CARD_LE)
 
 constdefs
-  CARD_EQ :: "('q_37597::type => bool) => ('q_37598::type => bool) => bool" 
+  CARD_EQ :: "('q_37597 => bool) => ('q_37598 => bool) => bool" 
   "CARD_EQ ==
 %(u::'q_37597::type => bool) ua::'q_37598::type => bool.
    CARD_LE u ua & CARD_LE ua u"
@@ -5272,7 +5661,7 @@
   by (import hollight DEF_CARD_EQ)
 
 constdefs
-  CARD_GT :: "('q_37612::type => bool) => ('q_37613::type => bool) => bool" 
+  CARD_GT :: "('q_37612 => bool) => ('q_37613 => bool) => bool" 
   "CARD_GT ==
 %(u::'q_37612::type => bool) ua::'q_37613::type => bool.
    CARD_GE u ua & ~ CARD_GE ua u"
@@ -5283,7 +5672,7 @@
   by (import hollight DEF_C