Release HOL4 and HOLLight Importer.
authorobua
Mon Sep 26 16:10:19 2005 +0200 (2005-09-26)
changeset 17652b1ef33ebfa17
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
     1.1 --- a/src/HOL/Import/HOL/HOL4Base.thy	Mon Sep 26 15:56:28 2005 +0200
     1.2 +++ b/src/HOL/Import/HOL/HOL4Base.thy	Mon Sep 26 16:10:19 2005 +0200
     1.3 @@ -5,21 +5,21 @@
     1.4  ;setup_theory bool
     1.5  
     1.6  constdefs
     1.7 -  ARB :: "'a::type" 
     1.8 +  ARB :: "'a" 
     1.9    "ARB == SOME x::'a::type. True"
    1.10  
    1.11  lemma ARB_DEF: "ARB = (SOME x::'a::type. True)"
    1.12    by (import bool ARB_DEF)
    1.13  
    1.14  constdefs
    1.15 -  IN :: "'a::type => ('a::type => bool) => bool" 
    1.16 +  IN :: "'a => ('a => bool) => bool" 
    1.17    "IN == %(x::'a::type) f::'a::type => bool. f x"
    1.18  
    1.19  lemma IN_DEF: "IN = (%(x::'a::type) f::'a::type => bool. f x)"
    1.20    by (import bool IN_DEF)
    1.21  
    1.22  constdefs
    1.23 -  RES_FORALL :: "('a::type => bool) => ('a::type => bool) => bool" 
    1.24 +  RES_FORALL :: "('a => bool) => ('a => bool) => bool" 
    1.25    "RES_FORALL ==
    1.26  %(p::'a::type => bool) m::'a::type => bool. ALL x::'a::type. IN x p --> m x"
    1.27  
    1.28 @@ -29,7 +29,7 @@
    1.29    by (import bool RES_FORALL_DEF)
    1.30  
    1.31  constdefs
    1.32 -  RES_EXISTS :: "('a::type => bool) => ('a::type => bool) => bool" 
    1.33 +  RES_EXISTS :: "('a => bool) => ('a => bool) => bool" 
    1.34    "RES_EXISTS ==
    1.35  %(p::'a::type => bool) m::'a::type => bool. EX x::'a::type. IN x p & m x"
    1.36  
    1.37 @@ -38,7 +38,7 @@
    1.38    by (import bool RES_EXISTS_DEF)
    1.39  
    1.40  constdefs
    1.41 -  RES_EXISTS_UNIQUE :: "('a::type => bool) => ('a::type => bool) => bool" 
    1.42 +  RES_EXISTS_UNIQUE :: "('a => bool) => ('a => bool) => bool" 
    1.43    "RES_EXISTS_UNIQUE ==
    1.44  %(p::'a::type => bool) m::'a::type => bool.
    1.45     RES_EXISTS p m &
    1.46 @@ -53,7 +53,7 @@
    1.47    by (import bool RES_EXISTS_UNIQUE_DEF)
    1.48  
    1.49  constdefs
    1.50 -  RES_SELECT :: "('a::type => bool) => ('a::type => bool) => 'a::type" 
    1.51 +  RES_SELECT :: "('a => bool) => ('a => bool) => 'a" 
    1.52    "RES_SELECT ==
    1.53  %(p::'a::type => bool) m::'a::type => bool. SOME x::'a::type. IN x p & m x"
    1.54  
    1.55 @@ -240,7 +240,7 @@
    1.56    by (import bool UEXISTS_SIMP)
    1.57  
    1.58  consts
    1.59 -  RES_ABSTRACT :: "('a::type => bool) => ('a::type => 'b::type) => 'a::type => 'b::type" 
    1.60 +  RES_ABSTRACT :: "('a => bool) => ('a => 'b) => 'a => 'b" 
    1.61  
    1.62  specification (RES_ABSTRACT) RES_ABSTRACT_DEF: "(ALL (p::'a::type => bool) (m::'a::type => 'b::type) x::'a::type.
    1.63      IN x p --> RES_ABSTRACT p m x = m x) &
    1.64 @@ -265,15 +265,14 @@
    1.65  ;setup_theory combin
    1.66  
    1.67  constdefs
    1.68 -  K :: "'a::type => 'b::type => 'a::type" 
    1.69 +  K :: "'a => 'b => 'a" 
    1.70    "K == %(x::'a::type) y::'b::type. x"
    1.71  
    1.72  lemma K_DEF: "K = (%(x::'a::type) y::'b::type. x)"
    1.73    by (import combin K_DEF)
    1.74  
    1.75  constdefs
    1.76 -  S :: "('a::type => 'b::type => 'c::type)
    1.77 -=> ('a::type => 'b::type) => 'a::type => 'c::type" 
    1.78 +  S :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c" 
    1.79    "S ==
    1.80  %(f::'a::type => 'b::type => 'c::type) (g::'a::type => 'b::type)
    1.81     x::'a::type. f x (g x)"
    1.82 @@ -284,7 +283,7 @@
    1.83    by (import combin S_DEF)
    1.84  
    1.85  constdefs
    1.86 -  I :: "'a::type => 'a::type" 
    1.87 +  I :: "'a => 'a" 
    1.88    "(op ==::('a::type => 'a::type) => ('a::type => 'a::type) => prop)
    1.89   (I::'a::type => 'a::type)
    1.90   ((S::('a::type => ('a::type => 'a::type) => 'a::type)
    1.91 @@ -301,7 +300,7 @@
    1.92    by (import combin I_DEF)
    1.93  
    1.94  constdefs
    1.95 -  C :: "('a::type => 'b::type => 'c::type) => 'b::type => 'a::type => 'c::type" 
    1.96 +  C :: "('a => 'b => 'c) => 'b => 'a => 'c" 
    1.97    "C == %(f::'a::type => 'b::type => 'c::type) (x::'b::type) y::'a::type. f y x"
    1.98  
    1.99  lemma C_DEF: "C =
   1.100 @@ -309,7 +308,7 @@
   1.101    by (import combin C_DEF)
   1.102  
   1.103  constdefs
   1.104 -  W :: "('a::type => 'a::type => 'b::type) => 'a::type => 'b::type" 
   1.105 +  W :: "('a => 'a => 'b) => 'a => 'b" 
   1.106    "W == %(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x"
   1.107  
   1.108  lemma W_DEF: "W = (%(f::'a::type => 'a::type => 'b::type) x::'a::type. f x x)"
   1.109 @@ -547,7 +546,7 @@
   1.110  ;setup_theory marker
   1.111  
   1.112  consts
   1.113 -  stmarker :: "'a::type => 'a::type" 
   1.114 +  stmarker :: "'a => 'a" 
   1.115  
   1.116  defs
   1.117    stmarker_primdef: "stmarker == %x::'a::type. x"
   1.118 @@ -584,7 +583,7 @@
   1.119  ;setup_theory relation
   1.120  
   1.121  constdefs
   1.122 -  TC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
   1.123 +  TC :: "('a => 'a => bool) => 'a => 'a => bool" 
   1.124    "TC ==
   1.125  %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
   1.126     ALL P::'a::type => 'a::type => bool.
   1.127 @@ -603,7 +602,7 @@
   1.128    by (import relation TC_DEF)
   1.129  
   1.130  constdefs
   1.131 -  RTC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
   1.132 +  RTC :: "('a => 'a => bool) => 'a => 'a => bool" 
   1.133    "RTC ==
   1.134  %(R::'a::type => 'a::type => bool) (a::'a::type) b::'a::type.
   1.135     ALL P::'a::type => 'a::type => bool.
   1.136 @@ -622,7 +621,7 @@
   1.137    by (import relation RTC_DEF)
   1.138  
   1.139  consts
   1.140 -  RC :: "('a::type => 'a::type => bool) => 'a::type => 'a::type => bool" 
   1.141 +  RC :: "('a => 'a => bool) => 'a => 'a => bool" 
   1.142  
   1.143  defs
   1.144    RC_primdef: "RC ==
   1.145 @@ -633,7 +632,7 @@
   1.146    by (import relation RC_def)
   1.147  
   1.148  consts
   1.149 -  transitive :: "('a::type => 'a::type => bool) => bool" 
   1.150 +  transitive :: "('a => 'a => bool) => bool" 
   1.151  
   1.152  defs
   1.153    transitive_primdef: "transitive ==
   1.154 @@ -646,7 +645,7 @@
   1.155    by (import relation transitive_def)
   1.156  
   1.157  constdefs
   1.158 -  pred_reflexive :: "('a::type => 'a::type => bool) => bool" 
   1.159 +  pred_reflexive :: "('a => 'a => bool) => bool" 
   1.160    "pred_reflexive == %R::'a::type => 'a::type => bool. ALL x::'a::type. R x x"
   1.161  
   1.162  lemma reflexive_def: "ALL R::'a::type => 'a::type => bool.
   1.163 @@ -790,7 +789,7 @@
   1.164    by (import relation RTC_MONOTONE)
   1.165  
   1.166  constdefs
   1.167 -  WF :: "('a::type => 'a::type => bool) => bool" 
   1.168 +  WF :: "('a => 'a => bool) => bool" 
   1.169    "WF ==
   1.170  %R::'a::type => 'a::type => bool.
   1.171     ALL B::'a::type => bool.
   1.172 @@ -816,7 +815,7 @@
   1.173    by (import relation WF_NOT_REFL)
   1.174  
   1.175  constdefs
   1.176 -  EMPTY_REL :: "'a::type => 'a::type => bool" 
   1.177 +  EMPTY_REL :: "'a => 'a => bool" 
   1.178    "EMPTY_REL == %(x::'a::type) y::'a::type. False"
   1.179  
   1.180  lemma EMPTY_REL_DEF: "ALL (x::'a::type) y::'a::type. EMPTY_REL x y = False"
   1.181 @@ -833,8 +832,7 @@
   1.182    by (import relation WF_TC)
   1.183  
   1.184  consts
   1.185 -  inv_image :: "('b::type => 'b::type => bool)
   1.186 -=> ('a::type => 'b::type) => 'a::type => 'a::type => bool" 
   1.187 +  inv_image :: "('b => 'b => bool) => ('a => 'b) => 'a => 'a => bool" 
   1.188  
   1.189  defs
   1.190    inv_image_primdef: "relation.inv_image ==
   1.191 @@ -850,8 +848,7 @@
   1.192    by (import relation WF_inv_image)
   1.193  
   1.194  constdefs
   1.195 -  RESTRICT :: "('a::type => 'b::type)
   1.196 -=> ('a::type => 'a::type => bool) => 'a::type => 'a::type => 'b::type" 
   1.197 +  RESTRICT :: "('a => 'b) => ('a => 'a => bool) => 'a => 'a => 'b" 
   1.198    "RESTRICT ==
   1.199  %(f::'a::type => 'b::type) (R::'a::type => 'a::type => bool) (x::'a::type)
   1.200     y::'a::type. if R y x then f y else ARB"
   1.201 @@ -865,9 +862,7 @@
   1.202    by (import relation RESTRICT_LEMMA)
   1.203  
   1.204  consts
   1.205 -  approx :: "('a::type => 'a::type => bool)
   1.206 -=> (('a::type => 'b::type) => 'a::type => 'b::type)
   1.207 -   => 'a::type => ('a::type => 'b::type) => bool" 
   1.208 +  approx :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => ('a => 'b) => bool" 
   1.209  
   1.210  defs
   1.211    approx_primdef: "approx ==
   1.212 @@ -883,9 +878,7 @@
   1.213    by (import relation approx_def)
   1.214  
   1.215  consts
   1.216 -  the_fun :: "('a::type => 'a::type => bool)
   1.217 -=> (('a::type => 'b::type) => 'a::type => 'b::type)
   1.218 -   => 'a::type => 'a::type => 'b::type" 
   1.219 +  the_fun :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'a => 'b" 
   1.220  
   1.221  defs
   1.222    the_fun_primdef: "the_fun ==
   1.223 @@ -899,8 +892,7 @@
   1.224    by (import relation the_fun_def)
   1.225  
   1.226  constdefs
   1.227 -  WFREC :: "('a::type => 'a::type => bool)
   1.228 -=> (('a::type => 'b::type) => 'a::type => 'b::type) => 'a::type => 'b::type" 
   1.229 +  WFREC :: "('a => 'a => bool) => (('a => 'b) => 'a => 'b) => 'a => 'b" 
   1.230    "WFREC ==
   1.231  %(R::'a::type => 'a::type => bool)
   1.232     (M::('a::type => 'b::type) => 'a::type => 'b::type) x::'a::type.
   1.233 @@ -1061,9 +1053,7 @@
   1.234    by (import pair pair_case_cong)
   1.235  
   1.236  constdefs
   1.237 -  LEX :: "('a::type => 'a::type => bool)
   1.238 -=> ('b::type => 'b::type => bool)
   1.239 -   => 'a::type * 'b::type => 'a::type * 'b::type => bool" 
   1.240 +  LEX :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
   1.241    "LEX ==
   1.242  %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
   1.243     (s::'a::type, t::'b::type) (u::'a::type, v::'b::type).
   1.244 @@ -1080,9 +1070,7 @@
   1.245    by (import pair WF_LEX)
   1.246  
   1.247  constdefs
   1.248 -  RPROD :: "('a::type => 'a::type => bool)
   1.249 -=> ('b::type => 'b::type => bool)
   1.250 -   => 'a::type * 'b::type => 'a::type * 'b::type => bool" 
   1.251 +  RPROD :: "('a => 'a => bool) => ('b => 'b => bool) => 'a * 'b => 'a * 'b => bool" 
   1.252    "RPROD ==
   1.253  %(R1::'a::type => 'a::type => bool) (R2::'b::type => 'b::type => bool)
   1.254     (s::'a::type, t::'b::type) (u::'a::type, v::'b::type). R1 s u & R2 t v"
   1.255 @@ -1104,7 +1092,7 @@
   1.256  
   1.257  ;setup_theory prim_rec
   1.258  
   1.259 -lemma LESS_0_0: "(0::nat) < Suc (0::nat)"
   1.260 +lemma LESS_0_0: "0 < Suc 0"
   1.261    by (import prim_rec LESS_0_0)
   1.262  
   1.263  lemma LESS_LEMMA1: "ALL (x::nat) xa::nat. x < Suc xa --> x = xa | x < xa"
   1.264 @@ -1126,7 +1114,7 @@
   1.265    by (import prim_rec NOT_LESS_EQ)
   1.266  
   1.267  constdefs
   1.268 -  SIMP_REC_REL :: "(nat => 'a::type) => 'a::type => ('a::type => 'a::type) => nat => bool" 
   1.269 +  SIMP_REC_REL :: "(nat => 'a) => 'a => ('a => 'a) => nat => bool" 
   1.270    "(op ==::((nat => 'a::type)
   1.271           => 'a::type => ('a::type => 'a::type) => nat => bool)
   1.272          => ((nat => 'a::type)
   1.273 @@ -1184,7 +1172,7 @@
   1.274    by (import prim_rec SIMP_REC_REL_UNIQUE_RESULT)
   1.275  
   1.276  consts
   1.277 -  SIMP_REC :: "'a::type => ('a::type => 'a::type) => nat => 'a::type" 
   1.278 +  SIMP_REC :: "'a => ('a => 'a) => nat => 'a" 
   1.279  
   1.280  specification (SIMP_REC) SIMP_REC: "ALL (x::'a::type) (f'::'a::type => 'a::type) n::nat.
   1.281     EX g::nat => 'a::type.
   1.282 @@ -1195,23 +1183,22 @@
   1.283    by (import prim_rec LESS_SUC_SUC)
   1.284  
   1.285  lemma SIMP_REC_THM: "ALL (x::'a::type) f::'a::type => 'a::type.
   1.286 -   SIMP_REC x f (0::nat) = x &
   1.287 +   SIMP_REC x f 0 = x &
   1.288     (ALL m::nat. SIMP_REC x f (Suc m) = f (SIMP_REC x f m))"
   1.289    by (import prim_rec SIMP_REC_THM)
   1.290  
   1.291  constdefs
   1.292    PRE :: "nat => nat" 
   1.293 -  "PRE == %m::nat. if m = (0::nat) then 0::nat else SOME n::nat. m = Suc n"
   1.294 -
   1.295 -lemma PRE_DEF: "ALL m::nat.
   1.296 -   PRE m = (if m = (0::nat) then 0::nat else SOME n::nat. m = Suc n)"
   1.297 +  "PRE == %m::nat. if m = 0 then 0 else SOME n::nat. m = Suc n"
   1.298 +
   1.299 +lemma PRE_DEF: "ALL m::nat. PRE m = (if m = 0 then 0 else SOME n::nat. m = Suc n)"
   1.300    by (import prim_rec PRE_DEF)
   1.301  
   1.302 -lemma PRE: "PRE (0::nat) = (0::nat) & (ALL m::nat. PRE (Suc m) = m)"
   1.303 +lemma PRE: "PRE 0 = 0 & (ALL m::nat. PRE (Suc m) = m)"
   1.304    by (import prim_rec PRE)
   1.305  
   1.306  constdefs
   1.307 -  PRIM_REC_FUN :: "'a::type => ('a::type => nat => 'a::type) => nat => nat => 'a::type" 
   1.308 +  PRIM_REC_FUN :: "'a => ('a => nat => 'a) => nat => nat => 'a" 
   1.309    "PRIM_REC_FUN ==
   1.310  %(x::'a::type) f::'a::type => nat => 'a::type.
   1.311     SIMP_REC (%n::nat. x) (%(fun::nat => 'a::type) n::nat. f (fun (PRE n)) n)"
   1.312 @@ -1222,13 +1209,13 @@
   1.313    by (import prim_rec PRIM_REC_FUN)
   1.314  
   1.315  lemma PRIM_REC_EQN: "ALL (x::'a::type) f::'a::type => nat => 'a::type.
   1.316 -   (ALL n::nat. PRIM_REC_FUN x f (0::nat) n = x) &
   1.317 +   (ALL n::nat. PRIM_REC_FUN x f 0 n = x) &
   1.318     (ALL (m::nat) n::nat.
   1.319         PRIM_REC_FUN x f (Suc m) n = f (PRIM_REC_FUN x f m (PRE n)) n)"
   1.320    by (import prim_rec PRIM_REC_EQN)
   1.321  
   1.322  constdefs
   1.323 -  PRIM_REC :: "'a::type => ('a::type => nat => 'a::type) => nat => 'a::type" 
   1.324 +  PRIM_REC :: "'a => ('a => nat => 'a) => nat => 'a" 
   1.325    "PRIM_REC ==
   1.326  %(x::'a::type) (f::'a::type => nat => 'a::type) m::nat.
   1.327     PRIM_REC_FUN x f m (PRE m)"
   1.328 @@ -1238,28 +1225,27 @@
   1.329    by (import prim_rec PRIM_REC)
   1.330  
   1.331  lemma PRIM_REC_THM: "ALL (x::'a::type) f::'a::type => nat => 'a::type.
   1.332 -   PRIM_REC x f (0::nat) = x &
   1.333 +   PRIM_REC x f 0 = x &
   1.334     (ALL m::nat. PRIM_REC x f (Suc m) = f (PRIM_REC x f m) m)"
   1.335    by (import prim_rec PRIM_REC_THM)
   1.336  
   1.337  lemma DC: "ALL (P::'a::type => bool) (R::'a::type => 'a::type => bool) a::'a::type.
   1.338     P a & (ALL x::'a::type. P x --> (EX y::'a::type. P y & R x y)) -->
   1.339     (EX x::nat => 'a::type.
   1.340 -       x (0::nat) = a & (ALL n::nat. P (x n) & R (x n) (x (Suc n))))"
   1.341 +       x 0 = a & (ALL n::nat. P (x n) & R (x n) (x (Suc n))))"
   1.342    by (import prim_rec DC)
   1.343  
   1.344  lemma num_Axiom_old: "ALL (e::'a::type) f::'a::type => nat => 'a::type.
   1.345     EX! fn1::nat => 'a::type.
   1.346 -      fn1 (0::nat) = e & (ALL n::nat. fn1 (Suc n) = f (fn1 n) n)"
   1.347 +      fn1 0 = e & (ALL n::nat. fn1 (Suc n) = f (fn1 n) n)"
   1.348    by (import prim_rec num_Axiom_old)
   1.349  
   1.350  lemma num_Axiom: "ALL (e::'a::type) f::nat => 'a::type => 'a::type.
   1.351 -   EX x::nat => 'a::type.
   1.352 -      x (0::nat) = e & (ALL n::nat. x (Suc n) = f n (x n))"
   1.353 +   EX x::nat => 'a::type. x 0 = e & (ALL n::nat. x (Suc n) = f n (x n))"
   1.354    by (import prim_rec num_Axiom)
   1.355  
   1.356  consts
   1.357 -  wellfounded :: "('a::type => 'a::type => bool) => bool" 
   1.358 +  wellfounded :: "('a => 'a => bool) => bool" 
   1.359  
   1.360  defs
   1.361    wellfounded_primdef: "wellfounded ==
   1.362 @@ -1281,7 +1267,7 @@
   1.363    by (import prim_rec WF_LESS)
   1.364  
   1.365  consts
   1.366 -  measure :: "('a::type => nat) => 'a::type => 'a::type => bool" 
   1.367 +  measure :: "('a => nat) => 'a => 'a => bool" 
   1.368  
   1.369  defs
   1.370    measure_primdef: "prim_rec.measure == relation.inv_image op <"
   1.371 @@ -1310,28 +1296,28 @@
   1.372  consts
   1.373    EVEN :: "nat => bool" 
   1.374  
   1.375 -specification (EVEN) EVEN: "EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   1.376 +specification (EVEN) EVEN: "EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   1.377    by (import arithmetic EVEN)
   1.378  
   1.379  consts
   1.380    ODD :: "nat => bool" 
   1.381  
   1.382 -specification (ODD) ODD: "ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   1.383 +specification (ODD) ODD: "ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   1.384    by (import arithmetic ODD)
   1.385  
   1.386 -lemma TWO: "(2::nat) = Suc (1::nat)"
   1.387 +lemma TWO: "2 = Suc 1"
   1.388    by (import arithmetic TWO)
   1.389  
   1.390 -lemma NORM_0: "(0::nat) = (0::nat)"
   1.391 +lemma NORM_0: "(op =::nat => nat => bool) (0::nat) (0::nat)"
   1.392    by (import arithmetic NORM_0)
   1.393  
   1.394  lemma num_case_compute: "ALL n::nat.
   1.395     nat_case (f::'a::type) (g::nat => 'a::type) n =
   1.396 -   (if n = (0::nat) then f else g (PRE n))"
   1.397 +   (if n = 0 then f else g (PRE n))"
   1.398    by (import arithmetic num_case_compute)
   1.399  
   1.400 -lemma ADD_CLAUSES: "(0::nat) + (m::nat) = m &
   1.401 -m + (0::nat) = m & Suc m + (n::nat) = Suc (m + n) & m + Suc n = Suc (m + n)"
   1.402 +lemma ADD_CLAUSES: "0 + (m::nat) = m &
   1.403 +m + 0 = m & Suc m + (n::nat) = Suc (m + n) & m + Suc n = Suc (m + n)"
   1.404    by (import arithmetic ADD_CLAUSES)
   1.405  
   1.406  lemma LESS_ADD: "ALL (m::nat) n::nat. n < m --> (EX p::nat. p + n = m)"
   1.407 @@ -1350,7 +1336,7 @@
   1.408  lemma LESS_NOT_SUC: "ALL (m::nat) n::nat. m < n & n ~= Suc m --> Suc m < n"
   1.409    by (import arithmetic LESS_NOT_SUC)
   1.410  
   1.411 -lemma LESS_0_CASES: "ALL m::nat. (0::nat) = m | (0::nat) < m"
   1.412 +lemma LESS_0_CASES: "ALL m::nat. 0 = m | 0 < m"
   1.413    by (import arithmetic LESS_0_CASES)
   1.414  
   1.415  lemma LESS_CASES_IMP: "ALL (m::nat) n::nat. ~ m < n & m ~= n --> n < m"
   1.416 @@ -1362,44 +1348,41 @@
   1.417  lemma LESS_EQ_SUC_REFL: "ALL m::nat. m <= Suc m"
   1.418    by (import arithmetic LESS_EQ_SUC_REFL)
   1.419  
   1.420 -lemma LESS_ADD_NONZERO: "ALL (m::nat) n::nat. n ~= (0::nat) --> m < m + n"
   1.421 +lemma LESS_ADD_NONZERO: "ALL (m::nat) n::nat. n ~= 0 --> m < m + n"
   1.422    by (import arithmetic LESS_ADD_NONZERO)
   1.423  
   1.424  lemma LESS_EQ_ANTISYM: "ALL (x::nat) xa::nat. ~ (x < xa & xa <= x)"
   1.425    by (import arithmetic LESS_EQ_ANTISYM)
   1.426  
   1.427 -lemma SUB_0: "ALL m::nat. (0::nat) - m = (0::nat) & m - (0::nat) = m"
   1.428 +lemma SUB_0: "ALL m::nat. 0 - m = 0 & m - 0 = m"
   1.429    by (import arithmetic SUB_0)
   1.430  
   1.431 -lemma SUC_SUB1: "ALL m::nat. Suc m - (1::nat) = m"
   1.432 +lemma SUC_SUB1: "ALL m::nat. Suc m - 1 = m"
   1.433    by (import arithmetic SUC_SUB1)
   1.434  
   1.435 -lemma PRE_SUB1: "ALL m::nat. PRE m = m - (1::nat)"
   1.436 +lemma PRE_SUB1: "ALL m::nat. PRE m = m - 1"
   1.437    by (import arithmetic PRE_SUB1)
   1.438  
   1.439  lemma MULT_CLAUSES: "ALL (x::nat) xa::nat.
   1.440 -   (0::nat) * x = (0::nat) &
   1.441 -   x * (0::nat) = (0::nat) &
   1.442 -   (1::nat) * x = x &
   1.443 -   x * (1::nat) = x & Suc x * xa = x * xa + xa & x * Suc xa = x + x * xa"
   1.444 +   0 * x = 0 &
   1.445 +   x * 0 = 0 &
   1.446 +   1 * x = x &
   1.447 +   x * 1 = x & Suc x * xa = x * xa + xa & x * Suc xa = x + x * xa"
   1.448    by (import arithmetic MULT_CLAUSES)
   1.449  
   1.450  lemma PRE_SUB: "ALL (m::nat) n::nat. PRE (m - n) = PRE m - n"
   1.451    by (import arithmetic PRE_SUB)
   1.452  
   1.453 -lemma ADD_EQ_1: "ALL (m::nat) n::nat.
   1.454 -   (m + n = (1::nat)) =
   1.455 -   (m = (1::nat) & n = (0::nat) | m = (0::nat) & n = (1::nat))"
   1.456 +lemma ADD_EQ_1: "ALL (m::nat) n::nat. (m + n = 1) = (m = 1 & n = 0 | m = 0 & n = 1)"
   1.457    by (import arithmetic ADD_EQ_1)
   1.458  
   1.459 -lemma ADD_INV_0_EQ: "ALL (m::nat) n::nat. (m + n = m) = (n = (0::nat))"
   1.460 +lemma ADD_INV_0_EQ: "ALL (m::nat) n::nat. (m + n = m) = (n = 0)"
   1.461    by (import arithmetic ADD_INV_0_EQ)
   1.462  
   1.463 -lemma PRE_SUC_EQ: "ALL (m::nat) n::nat. (0::nat) < n --> (m = PRE n) = (Suc m = n)"
   1.464 +lemma PRE_SUC_EQ: "ALL (m::nat) n::nat. 0 < n --> (m = PRE n) = (Suc m = n)"
   1.465    by (import arithmetic PRE_SUC_EQ)
   1.466  
   1.467 -lemma INV_PRE_EQ: "ALL (m::nat) n::nat.
   1.468 -   (0::nat) < m & (0::nat) < n --> (PRE m = PRE n) = (m = n)"
   1.469 +lemma INV_PRE_EQ: "ALL (m::nat) n::nat. 0 < m & 0 < n --> (PRE m = PRE n) = (m = n)"
   1.470    by (import arithmetic INV_PRE_EQ)
   1.471  
   1.472  lemma LESS_SUC_NOT: "ALL (m::nat) n::nat. m < n --> ~ n < Suc m"
   1.473 @@ -1408,7 +1391,7 @@
   1.474  lemma ADD_EQ_SUB: "ALL (m::nat) (n::nat) p::nat. n <= p --> (m + n = p) = (m = p - n)"
   1.475    by (import arithmetic ADD_EQ_SUB)
   1.476  
   1.477 -lemma LESS_ADD_1: "ALL (x::nat) xa::nat. xa < x --> (EX xb::nat. x = xa + (xb + (1::nat)))"
   1.478 +lemma LESS_ADD_1: "ALL (x::nat) xa::nat. xa < x --> (EX xb::nat. x = xa + (xb + 1))"
   1.479    by (import arithmetic LESS_ADD_1)
   1.480  
   1.481  lemma NOT_ODD_EQ_EVEN: "ALL (n::nat) m::nat. Suc (n + n) ~= m + m"
   1.482 @@ -1440,16 +1423,16 @@
   1.483                      ((Not::bool => bool) (P m)))))))"
   1.484    by (import arithmetic WOP)
   1.485  
   1.486 -lemma INV_PRE_LESS: "ALL m>0::nat. ALL n::nat. (PRE m < PRE n) = (m < n)"
   1.487 +lemma INV_PRE_LESS: "ALL m>0. ALL n::nat. (PRE m < PRE n) = (m < n)"
   1.488    by (import arithmetic INV_PRE_LESS)
   1.489  
   1.490 -lemma INV_PRE_LESS_EQ: "ALL n>0::nat. ALL m::nat. (PRE m <= PRE n) = (m <= n)"
   1.491 +lemma INV_PRE_LESS_EQ: "ALL n>0. ALL m::nat. (PRE m <= PRE n) = (m <= n)"
   1.492    by (import arithmetic INV_PRE_LESS_EQ)
   1.493  
   1.494 -lemma SUB_EQ_EQ_0: "ALL (m::nat) n::nat. (m - n = m) = (m = (0::nat) | n = (0::nat))"
   1.495 +lemma SUB_EQ_EQ_0: "ALL (m::nat) n::nat. (m - n = m) = (m = 0 | n = 0)"
   1.496    by (import arithmetic SUB_EQ_EQ_0)
   1.497  
   1.498 -lemma SUB_LESS_OR: "ALL (m::nat) n::nat. n < m --> n <= m - (1::nat)"
   1.499 +lemma SUB_LESS_OR: "ALL (m::nat) n::nat. n < m --> n <= m - 1"
   1.500    by (import arithmetic SUB_LESS_OR)
   1.501  
   1.502  lemma LESS_SUB_ADD_LESS: "ALL (n::nat) (m::nat) i::nat. i < n - m --> i + m < n"
   1.503 @@ -1468,15 +1451,13 @@
   1.504     xa <= x & xb <= x --> (x - xa = x - xb) = (xa = xb)"
   1.505    by (import arithmetic SUB_CANCEL)
   1.506  
   1.507 -lemma NOT_EXP_0: "ALL (m::nat) n::nat. Suc n ^ m ~= (0::nat)"
   1.508 +lemma NOT_EXP_0: "ALL (m::nat) n::nat. Suc n ^ m ~= 0"
   1.509    by (import arithmetic NOT_EXP_0)
   1.510  
   1.511 -lemma ZERO_LESS_EXP: "ALL (m::nat) n::nat. (0::nat) < Suc n ^ m"
   1.512 +lemma ZERO_LESS_EXP: "ALL (m::nat) n::nat. 0 < Suc n ^ m"
   1.513    by (import arithmetic ZERO_LESS_EXP)
   1.514  
   1.515 -lemma ODD_OR_EVEN: "ALL x::nat.
   1.516 -   EX xa::nat.
   1.517 -      x = Suc (Suc (0::nat)) * xa | x = Suc (Suc (0::nat)) * xa + (1::nat)"
   1.518 +lemma ODD_OR_EVEN: "ALL x::nat. EX xa::nat. x = Suc (Suc 0) * xa | x = Suc (Suc 0) * xa + 1"
   1.519    by (import arithmetic ODD_OR_EVEN)
   1.520  
   1.521  lemma LESS_EXP_SUC_MONO: "ALL (n::nat) m::nat. Suc (Suc m) ^ n < Suc (Suc m) ^ Suc n"
   1.522 @@ -1491,16 +1472,16 @@
   1.523  lemma LESS_EQ_EXISTS: "ALL (m::nat) n::nat. (m <= n) = (EX p::nat. n = m + p)"
   1.524    by (import arithmetic LESS_EQ_EXISTS)
   1.525  
   1.526 -lemma MULT_EQ_1: "ALL (x::nat) y::nat. (x * y = (1::nat)) = (x = (1::nat) & y = (1::nat))"
   1.527 +lemma MULT_EQ_1: "ALL (x::nat) y::nat. (x * y = 1) = (x = 1 & y = 1)"
   1.528    by (import arithmetic MULT_EQ_1)
   1.529  
   1.530  consts
   1.531    FACT :: "nat => nat" 
   1.532  
   1.533 -specification (FACT) FACT: "FACT (0::nat) = (1::nat) & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   1.534 +specification (FACT) FACT: "FACT 0 = 1 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   1.535    by (import arithmetic FACT)
   1.536  
   1.537 -lemma FACT_LESS: "ALL n::nat. (0::nat) < FACT n"
   1.538 +lemma FACT_LESS: "ALL n::nat. 0 < FACT n"
   1.539    by (import arithmetic FACT_LESS)
   1.540  
   1.541  lemma EVEN_ODD: "ALL n::nat. EVEN n = (~ ODD n)"
   1.542 @@ -1527,24 +1508,24 @@
   1.543  lemma ODD_MULT: "ALL (m::nat) n::nat. ODD (m * n) = (ODD m & ODD n)"
   1.544    by (import arithmetic ODD_MULT)
   1.545  
   1.546 -lemma EVEN_DOUBLE: "ALL n::nat. EVEN ((2::nat) * n)"
   1.547 +lemma EVEN_DOUBLE: "ALL n::nat. EVEN (2 * n)"
   1.548    by (import arithmetic EVEN_DOUBLE)
   1.549  
   1.550 -lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc ((2::nat) * x))"
   1.551 +lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (2 * x))"
   1.552    by (import arithmetic ODD_DOUBLE)
   1.553  
   1.554  lemma EVEN_ODD_EXISTS: "ALL x::nat.
   1.555 -   (EVEN x --> (EX m::nat. x = (2::nat) * m)) &
   1.556 -   (ODD x --> (EX m::nat. x = Suc ((2::nat) * m)))"
   1.557 +   (EVEN x --> (EX m::nat. x = 2 * m)) &
   1.558 +   (ODD x --> (EX m::nat. x = Suc (2 * m)))"
   1.559    by (import arithmetic EVEN_ODD_EXISTS)
   1.560  
   1.561 -lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = (2::nat) * m)"
   1.562 +lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = 2 * m)"
   1.563    by (import arithmetic EVEN_EXISTS)
   1.564  
   1.565 -lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc ((2::nat) * m))"
   1.566 +lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc (2 * m))"
   1.567    by (import arithmetic ODD_EXISTS)
   1.568  
   1.569 -lemma NOT_SUC_LESS_EQ_0: "ALL x::nat. ~ Suc x <= (0::nat)"
   1.570 +lemma NOT_SUC_LESS_EQ_0: "ALL x::nat. ~ Suc x <= 0"
   1.571    by (import arithmetic NOT_SUC_LESS_EQ_0)
   1.572  
   1.573  lemma NOT_LEQ: "ALL (x::nat) xa::nat. (~ x <= xa) = (Suc xa <= x)"
   1.574 @@ -1573,45 +1554,41 @@
   1.575     m - (n - p) = (if n <= p then m else m + p - n)"
   1.576    by (import arithmetic SUB_LEFT_SUB)
   1.577  
   1.578 -lemma SUB_LEFT_SUC: "ALL (m::nat) n::nat.
   1.579 -   Suc (m - n) = (if m <= n then Suc (0::nat) else Suc m - n)"
   1.580 +lemma SUB_LEFT_SUC: "ALL (m::nat) n::nat. Suc (m - n) = (if m <= n then Suc 0 else Suc m - n)"
   1.581    by (import arithmetic SUB_LEFT_SUC)
   1.582  
   1.583 -lemma SUB_LEFT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m <= n - p) = (m + p <= n | m <= (0::nat))"
   1.584 +lemma SUB_LEFT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m <= n - p) = (m + p <= n | m <= 0)"
   1.585    by (import arithmetic SUB_LEFT_LESS_EQ)
   1.586  
   1.587  lemma SUB_RIGHT_LESS_EQ: "ALL (m::nat) (n::nat) p::nat. (m - n <= p) = (m <= n + p)"
   1.588    by (import arithmetic SUB_RIGHT_LESS_EQ)
   1.589  
   1.590 -lemma SUB_RIGHT_LESS: "ALL (m::nat) (n::nat) p::nat. (m - n < p) = (m < n + p & (0::nat) < p)"
   1.591 +lemma SUB_RIGHT_LESS: "ALL (m::nat) (n::nat) p::nat. (m - n < p) = (m < n + p & 0 < p)"
   1.592    by (import arithmetic SUB_RIGHT_LESS)
   1.593  
   1.594 -lemma SUB_RIGHT_GREATER_EQ: "ALL (m::nat) (n::nat) p::nat. (p <= m - n) = (n + p <= m | p <= (0::nat))"
   1.595 +lemma SUB_RIGHT_GREATER_EQ: "ALL (m::nat) (n::nat) p::nat. (p <= m - n) = (n + p <= m | p <= 0)"
   1.596    by (import arithmetic SUB_RIGHT_GREATER_EQ)
   1.597  
   1.598 -lemma SUB_LEFT_GREATER: "ALL (m::nat) (n::nat) p::nat. (n - p < m) = (n < m + p & (0::nat) < m)"
   1.599 +lemma SUB_LEFT_GREATER: "ALL (m::nat) (n::nat) p::nat. (n - p < m) = (n < m + p & 0 < m)"
   1.600    by (import arithmetic SUB_LEFT_GREATER)
   1.601  
   1.602  lemma SUB_RIGHT_GREATER: "ALL (m::nat) (n::nat) p::nat. (p < m - n) = (n + p < m)"
   1.603    by (import arithmetic SUB_RIGHT_GREATER)
   1.604  
   1.605 -lemma SUB_LEFT_EQ: "ALL (m::nat) (n::nat) p::nat.
   1.606 -   (m = n - p) = (m + p = n | m <= (0::nat) & n <= p)"
   1.607 +lemma SUB_LEFT_EQ: "ALL (m::nat) (n::nat) p::nat. (m = n - p) = (m + p = n | m <= 0 & n <= p)"
   1.608    by (import arithmetic SUB_LEFT_EQ)
   1.609  
   1.610 -lemma SUB_RIGHT_EQ: "ALL (m::nat) (n::nat) p::nat.
   1.611 -   (m - n = p) = (m = n + p | m <= n & p <= (0::nat))"
   1.612 +lemma SUB_RIGHT_EQ: "ALL (m::nat) (n::nat) p::nat. (m - n = p) = (m = n + p | m <= n & p <= 0)"
   1.613    by (import arithmetic SUB_RIGHT_EQ)
   1.614  
   1.615 -lemma LE: "(ALL n::nat. (n <= (0::nat)) = (n = (0::nat))) &
   1.616 +lemma LE: "(ALL n::nat. (n <= 0) = (n = 0)) &
   1.617  (ALL (m::nat) n::nat. (m <= Suc n) = (m = Suc n | m <= n))"
   1.618    by (import arithmetic LE)
   1.619  
   1.620 -lemma DA: "ALL (k::nat) n::nat.
   1.621 -   (0::nat) < n --> (EX (x::nat) q::nat. k = q * n + x & x < n)"
   1.622 +lemma DA: "ALL (k::nat) n::nat. 0 < n --> (EX (x::nat) q::nat. k = q * n + x & x < n)"
   1.623    by (import arithmetic DA)
   1.624  
   1.625 -lemma DIV_LESS_EQ: "ALL n>0::nat. ALL k::nat. k div n <= k"
   1.626 +lemma DIV_LESS_EQ: "ALL n>0. ALL k::nat. k div n <= k"
   1.627    by (import arithmetic DIV_LESS_EQ)
   1.628  
   1.629  lemma DIV_UNIQUE: "ALL (n::nat) (k::nat) q::nat.
   1.630 @@ -1625,92 +1602,108 @@
   1.631  lemma DIV_MULT: "ALL (n::nat) r::nat. r < n --> (ALL q::nat. (q * n + r) div n = q)"
   1.632    by (import arithmetic DIV_MULT)
   1.633  
   1.634 -lemma MOD_EQ_0: "ALL n>0::nat. ALL k::nat. k * n mod n = (0::nat)"
   1.635 +lemma MOD_EQ_0: "ALL n>0. ALL k::nat. k * n mod n = 0"
   1.636    by (import arithmetic MOD_EQ_0)
   1.637  
   1.638 -lemma ZERO_MOD: "ALL n>0::nat. (0::nat) mod n = (0::nat)"
   1.639 +lemma ZERO_MOD: "(All::(nat => bool) => bool)
   1.640 + (%n::nat.
   1.641 +     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
   1.642 +      ((op =::nat => nat => bool) ((op mod::nat => nat => nat) (0::nat) n)
   1.643 +        (0::nat)))"
   1.644    by (import arithmetic ZERO_MOD)
   1.645  
   1.646 -lemma ZERO_DIV: "ALL n>0::nat. (0::nat) div n = (0::nat)"
   1.647 +lemma ZERO_DIV: "(All::(nat => bool) => bool)
   1.648 + (%n::nat.
   1.649 +     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
   1.650 +      ((op =::nat => nat => bool) ((op div::nat => nat => nat) (0::nat) n)
   1.651 +        (0::nat)))"
   1.652    by (import arithmetic ZERO_DIV)
   1.653  
   1.654  lemma MOD_MULT: "ALL (n::nat) r::nat. r < n --> (ALL q::nat. (q * n + r) mod n = r)"
   1.655    by (import arithmetic MOD_MULT)
   1.656  
   1.657 -lemma MOD_TIMES: "ALL n>0::nat. ALL (q::nat) r::nat. (q * n + r) mod n = r mod n"
   1.658 +lemma MOD_TIMES: "ALL n>0. ALL (q::nat) r::nat. (q * n + r) mod n = r mod n"
   1.659    by (import arithmetic MOD_TIMES)
   1.660  
   1.661 -lemma MOD_PLUS: "ALL n>0::nat. ALL (j::nat) k::nat. (j mod n + k mod n) mod n = (j + k) mod n"
   1.662 +lemma MOD_PLUS: "ALL n>0. ALL (j::nat) k::nat. (j mod n + k mod n) mod n = (j + k) mod n"
   1.663    by (import arithmetic MOD_PLUS)
   1.664  
   1.665 -lemma MOD_MOD: "ALL n>0::nat. ALL k::nat. k mod n mod n = k mod n"
   1.666 +lemma MOD_MOD: "ALL n>0. ALL k::nat. k mod n mod n = k mod n"
   1.667    by (import arithmetic MOD_MOD)
   1.668  
   1.669 -lemma ADD_DIV_ADD_DIV: "ALL x>0::nat. ALL (xa::nat) r::nat. (xa * x + r) div x = xa + r div x"
   1.670 +lemma ADD_DIV_ADD_DIV: "ALL x>0. ALL (xa::nat) r::nat. (xa * x + r) div x = xa + r div x"
   1.671    by (import arithmetic ADD_DIV_ADD_DIV)
   1.672  
   1.673  lemma MOD_MULT_MOD: "ALL (m::nat) n::nat.
   1.674 -   (0::nat) < n & (0::nat) < m -->
   1.675 -   (ALL x::nat. x mod (n * m) mod n = x mod n)"
   1.676 +   0 < n & 0 < m --> (ALL x::nat. x mod (n * m) mod n = x mod n)"
   1.677    by (import arithmetic MOD_MULT_MOD)
   1.678  
   1.679 -lemma DIVMOD_ID: "ALL n>0::nat. n div n = (1::nat) & n mod n = (0::nat)"
   1.680 +lemma DIVMOD_ID: "(All::(nat => bool) => bool)
   1.681 + (%n::nat.
   1.682 +     (op -->::bool => bool => bool) ((op <::nat => nat => bool) (0::nat) n)
   1.683 +      ((op &::bool => bool => bool)
   1.684 +        ((op =::nat => nat => bool) ((op div::nat => nat => nat) n n)
   1.685 +          (1::nat))
   1.686 +        ((op =::nat => nat => bool) ((op mod::nat => nat => nat) n n)
   1.687 +          (0::nat))))"
   1.688    by (import arithmetic DIVMOD_ID)
   1.689  
   1.690  lemma DIV_DIV_DIV_MULT: "ALL (x::nat) xa::nat.
   1.691 -   (0::nat) < x & (0::nat) < xa -->
   1.692 -   (ALL xb::nat. xb div x div xa = xb div (x * xa))"
   1.693 +   0 < x & 0 < xa --> (ALL xb::nat. xb div x div xa = xb div (x * xa))"
   1.694    by (import arithmetic DIV_DIV_DIV_MULT)
   1.695  
   1.696  lemma DIV_P: "ALL (P::nat => bool) (p::nat) q::nat.
   1.697 -   (0::nat) < q -->
   1.698 -   P (p div q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P k)"
   1.699 +   0 < q --> P (p div q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P k)"
   1.700    by (import arithmetic DIV_P)
   1.701  
   1.702  lemma MOD_P: "ALL (P::nat => bool) (p::nat) q::nat.
   1.703 -   (0::nat) < q -->
   1.704 -   P (p mod q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P r)"
   1.705 +   0 < q --> P (p mod q) = (EX (k::nat) r::nat. p = k * q + r & r < q & P r)"
   1.706    by (import arithmetic MOD_P)
   1.707  
   1.708 -lemma MOD_TIMES2: "ALL n>0::nat. ALL (j::nat) k::nat. j mod n * (k mod n) mod n = j * k mod n"
   1.709 +lemma MOD_TIMES2: "ALL n>0. ALL (j::nat) k::nat. j mod n * (k mod n) mod n = j * k mod n"
   1.710    by (import arithmetic MOD_TIMES2)
   1.711  
   1.712  lemma MOD_COMMON_FACTOR: "ALL (n::nat) (p::nat) q::nat.
   1.713 -   (0::nat) < n & (0::nat) < q --> n * (p mod q) = n * p mod (n * q)"
   1.714 +   0 < n & 0 < q --> n * (p mod q) = n * p mod (n * q)"
   1.715    by (import arithmetic MOD_COMMON_FACTOR)
   1.716  
   1.717  lemma num_case_cong: "ALL (M::nat) (M'::nat) (b::'a::type) f::nat => 'a::type.
   1.718     M = M' &
   1.719 -   (M' = (0::nat) --> b = (b'::'a::type)) &
   1.720 +   (M' = 0 --> b = (b'::'a::type)) &
   1.721     (ALL n::nat. M' = Suc n --> f n = (f'::nat => 'a::type) n) -->
   1.722     nat_case b f M = nat_case b' f' M'"
   1.723    by (import arithmetic num_case_cong)
   1.724  
   1.725  lemma SUC_ELIM_THM: "ALL P::nat => nat => bool.
   1.726 -   (ALL n::nat. P (Suc n) n) = (ALL n>0::nat. P n (n - (1::nat)))"
   1.727 +   (ALL n::nat. P (Suc n) n) = (ALL n>0. P n (n - 1))"
   1.728    by (import arithmetic SUC_ELIM_THM)
   1.729  
   1.730  lemma SUB_ELIM_THM: "(P::nat => bool) ((a::nat) - (b::nat)) =
   1.731 -(ALL x::nat. (b = a + x --> P (0::nat)) & (a = b + x --> P x))"
   1.732 +(ALL x::nat. (b = a + x --> P 0) & (a = b + x --> P x))"
   1.733    by (import arithmetic SUB_ELIM_THM)
   1.734  
   1.735  lemma PRE_ELIM_THM: "(P::nat => bool) (PRE (n::nat)) =
   1.736 -(ALL m::nat. (n = (0::nat) --> P (0::nat)) & (n = Suc m --> P m))"
   1.737 +(ALL m::nat. (n = 0 --> P 0) & (n = Suc m --> P m))"
   1.738    by (import arithmetic PRE_ELIM_THM)
   1.739  
   1.740 -lemma MULT_INCREASES: "ALL (m::nat) n::nat. (1::nat) < m & (0::nat) < n --> Suc n <= m * n"
   1.741 +lemma MULT_INCREASES: "ALL (m::nat) n::nat. 1 < m & 0 < n --> Suc n <= m * n"
   1.742    by (import arithmetic MULT_INCREASES)
   1.743  
   1.744 -lemma EXP_ALWAYS_BIG_ENOUGH: "ALL b>1::nat. ALL n::nat. EX m::nat. n <= b ^ m"
   1.745 +lemma EXP_ALWAYS_BIG_ENOUGH: "ALL b>1. ALL n::nat. EX m::nat. n <= b ^ m"
   1.746    by (import arithmetic EXP_ALWAYS_BIG_ENOUGH)
   1.747  
   1.748 -lemma EXP_EQ_0: "ALL (n::nat) m::nat. (n ^ m = (0::nat)) = (n = (0::nat) & (0::nat) < m)"
   1.749 +lemma EXP_EQ_0: "ALL (n::nat) m::nat. (n ^ m = 0) = (n = 0 & 0 < m)"
   1.750    by (import arithmetic EXP_EQ_0)
   1.751  
   1.752 -lemma EXP_1: "ALL x::nat. (1::nat) ^ x = (1::nat) & x ^ (1::nat) = x"
   1.753 +lemma EXP_1: "(All::(nat => bool) => bool)
   1.754 + (%x::nat.
   1.755 +     (op &::bool => bool => bool)
   1.756 +      ((op =::nat => nat => bool) ((op ^::nat => nat => nat) (1::nat) x)
   1.757 +        (1::nat))
   1.758 +      ((op =::nat => nat => bool) ((op ^::nat => nat => nat) x (1::nat)) x))"
   1.759    by (import arithmetic EXP_1)
   1.760  
   1.761 -lemma EXP_EQ_1: "ALL (n::nat) m::nat. (n ^ m = (1::nat)) = (n = (1::nat) | m = (0::nat))"
   1.762 +lemma EXP_EQ_1: "ALL (n::nat) m::nat. (n ^ m = 1) = (n = 1 | m = 0)"
   1.763    by (import arithmetic EXP_EQ_1)
   1.764  
   1.765  lemma MIN_MAX_EQ: "ALL (x::nat) xa::nat. (min x xa = max x xa) = (x = xa)"
   1.766 @@ -1741,10 +1734,10 @@
   1.767  lemma MAX_LE: "ALL (x::nat) xa::nat. xa <= max xa x & x <= max xa x"
   1.768    by (import arithmetic MAX_LE)
   1.769  
   1.770 -lemma MIN_0: "ALL x::nat. min x (0::nat) = (0::nat) & min (0::nat) x = (0::nat)"
   1.771 +lemma MIN_0: "ALL x::nat. min x 0 = 0 & min 0 x = 0"
   1.772    by (import arithmetic MIN_0)
   1.773  
   1.774 -lemma MAX_0: "ALL x::nat. max x (0::nat) = x & max (0::nat) x = x"
   1.775 +lemma MAX_0: "ALL x::nat. max x 0 = x & max 0 x = x"
   1.776    by (import arithmetic MAX_0)
   1.777  
   1.778  lemma EXISTS_GREATEST: "ALL P::nat => bool.
   1.779 @@ -1758,9 +1751,9 @@
   1.780  
   1.781  constdefs
   1.782    trat_1 :: "nat * nat" 
   1.783 -  "trat_1 == (0::nat, 0::nat)"
   1.784 -
   1.785 -lemma trat_1: "trat_1 = (0::nat, 0::nat)"
   1.786 +  "trat_1 == (0, 0)"
   1.787 +
   1.788 +lemma trat_1: "trat_1 = (0, 0)"
   1.789    by (import hrat trat_1)
   1.790  
   1.791  constdefs
   1.792 @@ -1794,7 +1787,7 @@
   1.793  consts
   1.794    trat_sucint :: "nat => nat * nat" 
   1.795  
   1.796 -specification (trat_sucint) trat_sucint: "trat_sucint (0::nat) = trat_1 &
   1.797 +specification (trat_sucint) trat_sucint: "trat_sucint 0 = trat_1 &
   1.798  (ALL n::nat. trat_sucint (Suc n) = trat_add (trat_sucint n) trat_1)"
   1.799    by (import hrat trat_sucint)
   1.800  
   1.801 @@ -1882,14 +1875,14 @@
   1.802     (EX d::nat * nat. trat_eq i (trat_add h d))"
   1.803    by (import hrat TRAT_ADD_TOTAL)
   1.804  
   1.805 -lemma TRAT_SUCINT_0: "ALL n::nat. trat_eq (trat_sucint n) (n, 0::nat)"
   1.806 +lemma TRAT_SUCINT_0: "ALL n::nat. trat_eq (trat_sucint n) (n, 0)"
   1.807    by (import hrat TRAT_SUCINT_0)
   1.808  
   1.809  lemma TRAT_ARCH: "ALL h::nat * nat.
   1.810     EX (n::nat) d::nat * nat. trat_eq (trat_sucint n) (trat_add h d)"
   1.811    by (import hrat TRAT_ARCH)
   1.812  
   1.813 -lemma TRAT_SUCINT: "trat_eq (trat_sucint (0::nat)) trat_1 &
   1.814 +lemma TRAT_SUCINT: "trat_eq (trat_sucint 0) trat_1 &
   1.815  (ALL n::nat.
   1.816      trat_eq (trat_sucint (Suc n)) (trat_add (trat_sucint n) trat_1))"
   1.817    by (import hrat TRAT_SUCINT)
   1.818 @@ -1989,7 +1982,7 @@
   1.819  lemma HRAT_ARCH: "ALL h::hrat. EX (x::nat) xa::hrat. hrat_sucint x = hrat_add h xa"
   1.820    by (import hrat HRAT_ARCH)
   1.821  
   1.822 -lemma HRAT_SUCINT: "hrat_sucint (0::nat) = hrat_1 &
   1.823 +lemma HRAT_SUCINT: "hrat_sucint 0 = hrat_1 &
   1.824  (ALL x::nat. hrat_sucint (Suc x) = hrat_add (hrat_sucint x) hrat_1)"
   1.825    by (import hrat HRAT_SUCINT)
   1.826  
   1.827 @@ -2382,40 +2375,243 @@
   1.828  lemma iiSUC: "ALL n::nat. iiSUC n = Suc (Suc n)"
   1.829    by (import numeral iiSUC)
   1.830  
   1.831 -lemma numeral_distrib: "(ALL x::nat. (0::nat) + x = x) &
   1.832 -(ALL x::nat. x + (0::nat) = x) &
   1.833 -(ALL (x::nat) xa::nat. NUMERAL x + NUMERAL xa = NUMERAL (iZ (x + xa))) &
   1.834 -(ALL x::nat. (0::nat) * x = (0::nat)) &
   1.835 -(ALL x::nat. x * (0::nat) = (0::nat)) &
   1.836 -(ALL (x::nat) xa::nat. NUMERAL x * NUMERAL xa = NUMERAL (x * xa)) &
   1.837 -(ALL x::nat. (0::nat) - x = (0::nat)) &
   1.838 -(ALL x::nat. x - (0::nat) = x) &
   1.839 -(ALL (x::nat) xa::nat. NUMERAL x - NUMERAL xa = NUMERAL (x - xa)) &
   1.840 -(ALL x::nat. (0::nat) ^ NUMERAL (NUMERAL_BIT1 x) = (0::nat)) &
   1.841 -(ALL x::nat. (0::nat) ^ NUMERAL (NUMERAL_BIT2 x) = (0::nat)) &
   1.842 -(ALL x::nat. x ^ (0::nat) = (1::nat)) &
   1.843 -(ALL (x::nat) xa::nat. NUMERAL x ^ NUMERAL xa = NUMERAL (x ^ xa)) &
   1.844 -Suc (0::nat) = (1::nat) &
   1.845 -(ALL x::nat. Suc (NUMERAL x) = NUMERAL (Suc x)) &
   1.846 -PRE (0::nat) = (0::nat) &
   1.847 -(ALL x::nat. PRE (NUMERAL x) = NUMERAL (PRE x)) &
   1.848 -(ALL x::nat. (NUMERAL x = (0::nat)) = (x = ALT_ZERO)) &
   1.849 -(ALL x::nat. ((0::nat) = NUMERAL x) = (x = ALT_ZERO)) &
   1.850 -(ALL (x::nat) xa::nat. (NUMERAL x = NUMERAL xa) = (x = xa)) &
   1.851 -(ALL x::nat. (x < (0::nat)) = False) &
   1.852 -(ALL x::nat. ((0::nat) < NUMERAL x) = (ALT_ZERO < x)) &
   1.853 -(ALL (x::nat) xa::nat. (NUMERAL x < NUMERAL xa) = (x < xa)) &
   1.854 -(ALL x::nat. (x < (0::nat)) = False) &
   1.855 -(ALL x::nat. ((0::nat) < NUMERAL x) = (ALT_ZERO < x)) &
   1.856 -(ALL (x::nat) xa::nat. (NUMERAL xa < NUMERAL x) = (xa < x)) &
   1.857 -(ALL x::nat. ((0::nat) <= x) = True) &
   1.858 -(ALL x::nat. (NUMERAL x <= (0::nat)) = (x <= ALT_ZERO)) &
   1.859 -(ALL (x::nat) xa::nat. (NUMERAL x <= NUMERAL xa) = (x <= xa)) &
   1.860 -(ALL x::nat. ((0::nat) <= x) = True) &
   1.861 -(ALL x::nat. (x <= (0::nat)) = (x = (0::nat))) &
   1.862 -(ALL (x::nat) xa::nat. (NUMERAL xa <= NUMERAL x) = (xa <= x)) &
   1.863 -(ALL x::nat. ODD (NUMERAL x) = ODD x) &
   1.864 -(ALL x::nat. EVEN (NUMERAL x) = EVEN x) & ~ ODD (0::nat) & EVEN (0::nat)"
   1.865 +lemma numeral_distrib: "(op &::bool => bool => bool)
   1.866 + ((All::(nat => bool) => bool)
   1.867 +   (%x::nat.
   1.868 +       (op =::nat => nat => bool) ((op +::nat => nat => nat) (0::nat) x) x))
   1.869 + ((op &::bool => bool => bool)
   1.870 +   ((All::(nat => bool) => bool)
   1.871 +     (%x::nat.
   1.872 +         (op =::nat => nat => bool) ((op +::nat => nat => nat) x (0::nat))
   1.873 +          x))
   1.874 +   ((op &::bool => bool => bool)
   1.875 +     ((All::(nat => bool) => bool)
   1.876 +       (%x::nat.
   1.877 +           (All::(nat => bool) => bool)
   1.878 +            (%xa::nat.
   1.879 +                (op =::nat => nat => bool)
   1.880 +                 ((op +::nat => nat => nat) ((NUMERAL::nat => nat) x)
   1.881 +                   ((NUMERAL::nat => nat) xa))
   1.882 +                 ((NUMERAL::nat => nat)
   1.883 +                   ((iZ::nat => nat) ((op +::nat => nat => nat) x xa))))))
   1.884 +     ((op &::bool => bool => bool)
   1.885 +       ((All::(nat => bool) => bool)
   1.886 +         (%x::nat.
   1.887 +             (op =::nat => nat => bool)
   1.888 +              ((op *::nat => nat => nat) (0::nat) x) (0::nat)))
   1.889 +       ((op &::bool => bool => bool)
   1.890 +         ((All::(nat => bool) => bool)
   1.891 +           (%x::nat.
   1.892 +               (op =::nat => nat => bool)
   1.893 +                ((op *::nat => nat => nat) x (0::nat)) (0::nat)))
   1.894 +         ((op &::bool => bool => bool)
   1.895 +           ((All::(nat => bool) => bool)
   1.896 +             (%x::nat.
   1.897 +                 (All::(nat => bool) => bool)
   1.898 +                  (%xa::nat.
   1.899 +                      (op =::nat => nat => bool)
   1.900 +                       ((op *::nat => nat => nat) ((NUMERAL::nat => nat) x)
   1.901 +                         ((NUMERAL::nat => nat) xa))
   1.902 +                       ((NUMERAL::nat => nat)
   1.903 +                         ((op *::nat => nat => nat) x xa)))))
   1.904 +           ((op &::bool => bool => bool)
   1.905 +             ((All::(nat => bool) => bool)
   1.906 +               (%x::nat.
   1.907 +                   (op =::nat => nat => bool)
   1.908 +                    ((op -::nat => nat => nat) (0::nat) x) (0::nat)))
   1.909 +             ((op &::bool => bool => bool)
   1.910 +               ((All::(nat => bool) => bool)
   1.911 +                 (%x::nat.
   1.912 +                     (op =::nat => nat => bool)
   1.913 +                      ((op -::nat => nat => nat) x (0::nat)) x))
   1.914 +               ((op &::bool => bool => bool)
   1.915 +                 ((All::(nat => bool) => bool)
   1.916 +                   (%x::nat.
   1.917 +                       (All::(nat => bool) => bool)
   1.918 +                        (%xa::nat.
   1.919 +                            (op =::nat => nat => bool)
   1.920 +                             ((op -::nat => nat => nat)
   1.921 +                               ((NUMERAL::nat => nat) x)
   1.922 +                               ((NUMERAL::nat => nat) xa))
   1.923 +                             ((NUMERAL::nat => nat)
   1.924 +                               ((op -::nat => nat => nat) x xa)))))
   1.925 +                 ((op &::bool => bool => bool)
   1.926 +                   ((All::(nat => bool) => bool)
   1.927 +                     (%x::nat.
   1.928 +                         (op =::nat => nat => bool)
   1.929 +                          ((op ^::nat => nat => nat) (0::nat)
   1.930 +                            ((NUMERAL::nat => nat)
   1.931 +                              ((NUMERAL_BIT1::nat => nat) x)))
   1.932 +                          (0::nat)))
   1.933 +                   ((op &::bool => bool => bool)
   1.934 +                     ((All::(nat => bool) => bool)
   1.935 +                       (%x::nat.
   1.936 +                           (op =::nat => nat => bool)
   1.937 +                            ((op ^::nat => nat => nat) (0::nat)
   1.938 +                              ((NUMERAL::nat => nat)
   1.939 +                                ((NUMERAL_BIT2::nat => nat) x)))
   1.940 +                            (0::nat)))
   1.941 +                     ((op &::bool => bool => bool)
   1.942 +                       ((All::(nat => bool) => bool)
   1.943 +                         (%x::nat.
   1.944 +                             (op =::nat => nat => bool)
   1.945 +                              ((op ^::nat => nat => nat) x (0::nat))
   1.946 +                              (1::nat)))
   1.947 +                       ((op &::bool => bool => bool)
   1.948 +                         ((All::(nat => bool) => bool)
   1.949 +                           (%x::nat.
   1.950 +                               (All::(nat => bool) => bool)
   1.951 +                                (%xa::nat.
   1.952 +                                    (op =::nat => nat => bool)
   1.953 +                                     ((op ^::nat => nat => nat)
   1.954 + ((NUMERAL::nat => nat) x) ((NUMERAL::nat => nat) xa))
   1.955 +                                     ((NUMERAL::nat => nat)
   1.956 + ((op ^::nat => nat => nat) x xa)))))
   1.957 +                         ((op &::bool => bool => bool)
   1.958 +                           ((op =::nat => nat => bool)
   1.959 +                             ((Suc::nat => nat) (0::nat)) (1::nat))
   1.960 +                           ((op &::bool => bool => bool)
   1.961 +                             ((All::(nat => bool) => bool)
   1.962 +                               (%x::nat.
   1.963 +                                   (op =::nat => nat => bool)
   1.964 +                                    ((Suc::nat => nat)
   1.965 +((NUMERAL::nat => nat) x))
   1.966 +                                    ((NUMERAL::nat => nat)
   1.967 +((Suc::nat => nat) x))))
   1.968 +                             ((op &::bool => bool => bool)
   1.969 +                               ((op =::nat => nat => bool)
   1.970 +                                 ((PRE::nat => nat) (0::nat)) (0::nat))
   1.971 +                               ((op &::bool => bool => bool)
   1.972 +                                 ((All::(nat => bool) => bool)
   1.973 +                                   (%x::nat.
   1.974 + (op =::nat => nat => bool) ((PRE::nat => nat) ((NUMERAL::nat => nat) x))
   1.975 +  ((NUMERAL::nat => nat) ((PRE::nat => nat) x))))
   1.976 +                                 ((op &::bool => bool => bool)
   1.977 +                                   ((All::(nat => bool) => bool)
   1.978 +                                     (%x::nat.
   1.979 +   (op =::bool => bool => bool)
   1.980 +    ((op =::nat => nat => bool) ((NUMERAL::nat => nat) x) (0::nat))
   1.981 +    ((op =::nat => nat => bool) x (ALT_ZERO::nat))))
   1.982 +                                   ((op &::bool => bool => bool)
   1.983 +                                     ((All::(nat => bool) => bool)
   1.984 + (%x::nat.
   1.985 +     (op =::bool => bool => bool)
   1.986 +      ((op =::nat => nat => bool) (0::nat) ((NUMERAL::nat => nat) x))
   1.987 +      ((op =::nat => nat => bool) x (ALT_ZERO::nat))))
   1.988 +                                     ((op &::bool => bool => bool)
   1.989 + ((All::(nat => bool) => bool)
   1.990 +   (%x::nat.
   1.991 +       (All::(nat => bool) => bool)
   1.992 +        (%xa::nat.
   1.993 +            (op =::bool => bool => bool)
   1.994 +             ((op =::nat => nat => bool) ((NUMERAL::nat => nat) x)
   1.995 +               ((NUMERAL::nat => nat) xa))
   1.996 +             ((op =::nat => nat => bool) x xa))))
   1.997 + ((op &::bool => bool => bool)
   1.998 +   ((All::(nat => bool) => bool)
   1.999 +     (%x::nat.
  1.1000 +         (op =::bool => bool => bool)
  1.1001 +          ((op <::nat => nat => bool) x (0::nat)) (False::bool)))
  1.1002 +   ((op &::bool => bool => bool)
  1.1003 +     ((All::(nat => bool) => bool)
  1.1004 +       (%x::nat.
  1.1005 +           (op =::bool => bool => bool)
  1.1006 +            ((op <::nat => nat => bool) (0::nat) ((NUMERAL::nat => nat) x))
  1.1007 +            ((op <::nat => nat => bool) (ALT_ZERO::nat) x)))
  1.1008 +     ((op &::bool => bool => bool)
  1.1009 +       ((All::(nat => bool) => bool)
  1.1010 +         (%x::nat.
  1.1011 +             (All::(nat => bool) => bool)
  1.1012 +              (%xa::nat.
  1.1013 +                  (op =::bool => bool => bool)
  1.1014 +                   ((op <::nat => nat => bool) ((NUMERAL::nat => nat) x)
  1.1015 +                     ((NUMERAL::nat => nat) xa))
  1.1016 +                   ((op <::nat => nat => bool) x xa))))
  1.1017 +       ((op &::bool => bool => bool)
  1.1018 +         ((All::(nat => bool) => bool)
  1.1019 +           (%x::nat.
  1.1020 +               (op =::bool => bool => bool)
  1.1021 +                ((op <::nat => nat => bool) x (0::nat)) (False::bool)))
  1.1022 +         ((op &::bool => bool => bool)
  1.1023 +           ((All::(nat => bool) => bool)
  1.1024 +             (%x::nat.
  1.1025 +                 (op =::bool => bool => bool)
  1.1026 +                  ((op <::nat => nat => bool) (0::nat)
  1.1027 +                    ((NUMERAL::nat => nat) x))
  1.1028 +                  ((op <::nat => nat => bool) (ALT_ZERO::nat) x)))
  1.1029 +           ((op &::bool => bool => bool)
  1.1030 +             ((All::(nat => bool) => bool)
  1.1031 +               (%x::nat.
  1.1032 +                   (All::(nat => bool) => bool)
  1.1033 +                    (%xa::nat.
  1.1034 +                        (op =::bool => bool => bool)
  1.1035 +                         ((op <::nat => nat => bool)
  1.1036 +                           ((NUMERAL::nat => nat) xa)
  1.1037 +                           ((NUMERAL::nat => nat) x))
  1.1038 +                         ((op <::nat => nat => bool) xa x))))
  1.1039 +             ((op &::bool => bool => bool)
  1.1040 +               ((All::(nat => bool) => bool)
  1.1041 +                 (%x::nat.
  1.1042 +                     (op =::bool => bool => bool)
  1.1043 +                      ((op <=::nat => nat => bool) (0::nat) x)
  1.1044 +                      (True::bool)))
  1.1045 +               ((op &::bool => bool => bool)
  1.1046 +                 ((All::(nat => bool) => bool)
  1.1047 +                   (%x::nat.
  1.1048 +                       (op =::bool => bool => bool)
  1.1049 +                        ((op <=::nat => nat => bool)
  1.1050 +                          ((NUMERAL::nat => nat) x) (0::nat))
  1.1051 +                        ((op <=::nat => nat => bool) x (ALT_ZERO::nat))))
  1.1052 +                 ((op &::bool => bool => bool)
  1.1053 +                   ((All::(nat => bool) => bool)
  1.1054 +                     (%x::nat.
  1.1055 +                         (All::(nat => bool) => bool)
  1.1056 +                          (%xa::nat.
  1.1057 +                              (op =::bool => bool => bool)
  1.1058 +                               ((op <=::nat => nat => bool)
  1.1059 +                                 ((NUMERAL::nat => nat) x)
  1.1060 +                                 ((NUMERAL::nat => nat) xa))
  1.1061 +                               ((op <=::nat => nat => bool) x xa))))
  1.1062 +                   ((op &::bool => bool => bool)
  1.1063 +                     ((All::(nat => bool) => bool)
  1.1064 +                       (%x::nat.
  1.1065 +                           (op =::bool => bool => bool)
  1.1066 +                            ((op <=::nat => nat => bool) (0::nat) x)
  1.1067 +                            (True::bool)))
  1.1068 +                     ((op &::bool => bool => bool)
  1.1069 +                       ((All::(nat => bool) => bool)
  1.1070 +                         (%x::nat.
  1.1071 +                             (op =::bool => bool => bool)
  1.1072 +                              ((op <=::nat => nat => bool) x (0::nat))
  1.1073 +                              ((op =::nat => nat => bool) x (0::nat))))
  1.1074 +                       ((op &::bool => bool => bool)
  1.1075 +                         ((All::(nat => bool) => bool)
  1.1076 +                           (%x::nat.
  1.1077 +                               (All::(nat => bool) => bool)
  1.1078 +                                (%xa::nat.
  1.1079 +                                    (op =::bool => bool => bool)
  1.1080 +                                     ((op <=::nat => nat => bool)
  1.1081 + ((NUMERAL::nat => nat) xa) ((NUMERAL::nat => nat) x))
  1.1082 +                                     ((op <=::nat => nat => bool) xa x))))
  1.1083 +                         ((op &::bool => bool => bool)
  1.1084 +                           ((All::(nat => bool) => bool)
  1.1085 +                             (%x::nat.
  1.1086 +                                 (op =::bool => bool => bool)
  1.1087 +                                  ((ODD::nat => bool)
  1.1088 +                                    ((NUMERAL::nat => nat) x))
  1.1089 +                                  ((ODD::nat => bool) x)))
  1.1090 +                           ((op &::bool => bool => bool)
  1.1091 +                             ((All::(nat => bool) => bool)
  1.1092 +                               (%x::nat.
  1.1093 +                                   (op =::bool => bool => bool)
  1.1094 +                                    ((EVEN::nat => bool)
  1.1095 +((NUMERAL::nat => nat) x))
  1.1096 +                                    ((EVEN::nat => bool) x)))
  1.1097 +                             ((op &::bool => bool => bool)
  1.1098 +                               ((Not::bool => bool)
  1.1099 +                                 ((ODD::nat => bool) (0::nat)))
  1.1100 +                               ((EVEN::nat => bool)
  1.1101 +                                 (0::nat))))))))))))))))))))))))))))))))))))"
  1.1102    by (import numeral numeral_distrib)
  1.1103  
  1.1104  lemma numeral_iisuc: "iiSUC ALT_ZERO = NUMERAL_BIT2 ALT_ZERO &
  1.1105 @@ -2496,7 +2692,7 @@
  1.1106    by (import numeral bit_initiality)
  1.1107  
  1.1108  consts
  1.1109 -  iBIT_cases :: "nat => 'a::type => (nat => 'a::type) => (nat => 'a::type) => 'a::type" 
  1.1110 +  iBIT_cases :: "nat => 'a => (nat => 'a) => (nat => 'a) => 'a" 
  1.1111  
  1.1112  specification (iBIT_cases) iBIT_cases: "(ALL (zf::'a::type) (bf1::nat => 'a::type) bf2::nat => 'a::type.
  1.1113      iBIT_cases ALT_ZERO zf bf1 bf2 = zf) &
  1.1114 @@ -2561,17 +2757,8 @@
  1.1115     NUMERAL_BIT1 (iSUB False xb xc)"
  1.1116    by (import numeral iSUB_THM)
  1.1117  
  1.1118 -lemma numeral_sub: "(All::(nat => bool) => bool)
  1.1119 - (%x::nat.
  1.1120 -     (All::(nat => bool) => bool)
  1.1121 -      (%xa::nat.
  1.1122 -          (op =::nat => nat => bool)
  1.1123 -           ((NUMERAL::nat => nat) ((op -::nat => nat => nat) x xa))
  1.1124 -           ((If::bool => nat => nat => nat)
  1.1125 -             ((op <::nat => nat => bool) xa x)
  1.1126 -             ((NUMERAL::nat => nat)
  1.1127 -               ((iSUB::bool => nat => nat => nat) (True::bool) x xa))
  1.1128 -             (0::nat))))"
  1.1129 +lemma numeral_sub: "ALL (x::nat) xa::nat.
  1.1130 +   NUMERAL (x - xa) = (if xa < x then NUMERAL (iSUB True x xa) else 0)"
  1.1131    by (import numeral numeral_sub)
  1.1132  
  1.1133  lemma iDUB_removal: "ALL x::nat.
  1.1134 @@ -2606,12 +2793,12 @@
  1.1135     ~ ODD ALT_ZERO & ~ ODD (NUMERAL_BIT2 x) & ODD (NUMERAL_BIT1 x)"
  1.1136    by (import numeral numeral_evenodd)
  1.1137  
  1.1138 -lemma numeral_fact: "ALL n::nat. FACT n = (if n = (0::nat) then 1::nat else n * FACT (PRE n))"
  1.1139 +lemma numeral_fact: "ALL n::nat. FACT n = (if n = 0 then 1 else n * FACT (PRE n))"
  1.1140    by (import numeral numeral_fact)
  1.1141  
  1.1142  lemma numeral_funpow: "ALL n::nat.
  1.1143     ((f::'a::type => 'a::type) ^ n) (x::'a::type) =
  1.1144 -   (if n = (0::nat) then x else (f ^ (n - (1::nat))) (f x))"
  1.1145 +   (if n = 0 then x else (f ^ (n - 1)) (f x))"
  1.1146    by (import numeral numeral_funpow)
  1.1147  
  1.1148  ;end_setup
  1.1149 @@ -2627,9 +2814,9 @@
  1.1150  
  1.1151  constdefs
  1.1152    NUMPAIR :: "nat => nat => nat" 
  1.1153 -  "NUMPAIR == %(x::nat) y::nat. (2::nat) ^ x * ((2::nat) * y + (1::nat))"
  1.1154 -
  1.1155 -lemma NUMPAIR: "ALL (x::nat) y::nat. NUMPAIR x y = (2::nat) ^ x * ((2::nat) * y + (1::nat))"
  1.1156 +  "NUMPAIR == %(x::nat) y::nat. 2 ^ x * (2 * y + 1)"
  1.1157 +
  1.1158 +lemma NUMPAIR: "ALL (x::nat) y::nat. NUMPAIR x y = 2 ^ x * (2 * y + 1)"
  1.1159    by (import ind_type NUMPAIR)
  1.1160  
  1.1161  lemma NUMPAIR_INJ_LEMMA: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
  1.1162 @@ -2649,10 +2836,9 @@
  1.1163  
  1.1164  constdefs
  1.1165    NUMSUM :: "bool => nat => nat" 
  1.1166 -  "NUMSUM == %(b::bool) x::nat. if b then Suc ((2::nat) * x) else (2::nat) * x"
  1.1167 -
  1.1168 -lemma NUMSUM: "ALL (b::bool) x::nat.
  1.1169 -   NUMSUM b x = (if b then Suc ((2::nat) * x) else (2::nat) * x)"
  1.1170 +  "NUMSUM == %(b::bool) x::nat. if b then Suc (2 * x) else 2 * x"
  1.1171 +
  1.1172 +lemma NUMSUM: "ALL (b::bool) x::nat. NUMSUM b x = (if b then Suc (2 * x) else 2 * x)"
  1.1173    by (import ind_type NUMSUM)
  1.1174  
  1.1175  lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
  1.1176 @@ -2667,7 +2853,7 @@
  1.1177    by (import ind_type NUMSUM_DEST)
  1.1178  
  1.1179  constdefs
  1.1180 -  INJN :: "nat => nat => 'a::type => bool" 
  1.1181 +  INJN :: "nat => nat => 'a => bool" 
  1.1182    "INJN == %(m::nat) (n::nat) a::'a::type. n = m"
  1.1183  
  1.1184  lemma INJN: "ALL m::nat. INJN m = (%(n::nat) a::'a::type. n = m)"
  1.1185 @@ -2677,7 +2863,7 @@
  1.1186    by (import ind_type INJN_INJ)
  1.1187  
  1.1188  constdefs
  1.1189 -  INJA :: "'a::type => nat => 'a::type => bool" 
  1.1190 +  INJA :: "'a => nat => 'a => bool" 
  1.1191    "INJA == %(a::'a::type) (n::nat) b::'a::type. b = a"
  1.1192  
  1.1193  lemma INJA: "ALL a::'a::type. INJA a = (%(n::nat) b::'a::type. b = a)"
  1.1194 @@ -2687,7 +2873,7 @@
  1.1195    by (import ind_type INJA_INJ)
  1.1196  
  1.1197  constdefs
  1.1198 -  INJF :: "(nat => nat => 'a::type => bool) => nat => 'a::type => bool" 
  1.1199 +  INJF :: "(nat => nat => 'a => bool) => nat => 'a => bool" 
  1.1200    "INJF == %(f::nat => nat => 'a::type => bool) n::nat. f (NUMFST n) (NUMSND n)"
  1.1201  
  1.1202  lemma INJF: "ALL f::nat => nat => 'a::type => bool.
  1.1203 @@ -2699,8 +2885,7 @@
  1.1204    by (import ind_type INJF_INJ)
  1.1205  
  1.1206  constdefs
  1.1207 -  INJP :: "(nat => 'a::type => bool)
  1.1208 -=> (nat => 'a::type => bool) => nat => 'a::type => bool" 
  1.1209 +  INJP :: "(nat => 'a => bool) => (nat => 'a => bool) => nat => 'a => bool" 
  1.1210    "INJP ==
  1.1211  %(f1::nat => 'a::type => bool) (f2::nat => 'a::type => bool) (n::nat)
  1.1212     a::'a::type. if NUMLEFT n then f1 (NUMRIGHT n) a else f2 (NUMRIGHT n) a"
  1.1213 @@ -2717,8 +2902,7 @@
  1.1214    by (import ind_type INJP_INJ)
  1.1215  
  1.1216  constdefs
  1.1217 -  ZCONSTR :: "nat
  1.1218 -=> 'a::type => (nat => nat => 'a::type => bool) => nat => 'a::type => bool" 
  1.1219 +  ZCONSTR :: "nat => 'a => (nat => nat => 'a => bool) => nat => 'a => bool" 
  1.1220    "ZCONSTR ==
  1.1221  %(c::nat) (i::'a::type) r::nat => nat => 'a::type => bool.
  1.1222     INJP (INJN (Suc c)) (INJP (INJA i) (INJF r))"
  1.1223 @@ -2728,10 +2912,10 @@
  1.1224    by (import ind_type ZCONSTR)
  1.1225  
  1.1226  constdefs
  1.1227 -  ZBOT :: "nat => 'a::type => bool" 
  1.1228 -  "ZBOT == INJP (INJN (0::nat)) (SOME z::nat => 'a::type => bool. True)"
  1.1229 -
  1.1230 -lemma ZBOT: "ZBOT = INJP (INJN (0::nat)) (SOME z::nat => 'a::type => bool. True)"
  1.1231 +  ZBOT :: "nat => 'a => bool" 
  1.1232 +  "ZBOT == INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
  1.1233 +
  1.1234 +lemma ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'a::type => bool. True)"
  1.1235    by (import ind_type ZBOT)
  1.1236  
  1.1237  lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'a::type) xb::nat => nat => 'a::type => bool.
  1.1238 @@ -2739,7 +2923,7 @@
  1.1239    by (import ind_type ZCONSTR_ZBOT)
  1.1240  
  1.1241  constdefs
  1.1242 -  ZRECSPACE :: "(nat => 'a::type => bool) => bool" 
  1.1243 +  ZRECSPACE :: "(nat => 'a => bool) => bool" 
  1.1244    "ZRECSPACE ==
  1.1245  %a0::nat => 'a::type => bool.
  1.1246     ALL ZRECSPACE'::(nat => 'a::type => bool) => bool.
  1.1247 @@ -2805,22 +2989,22 @@
  1.1248  lemmas recspace_TY_DEF = typedef_hol2hol4 [OF type_definition_recspace]
  1.1249  
  1.1250  consts
  1.1251 -  mk_rec :: "(nat => 'a::type => bool) => 'a::type recspace" 
  1.1252 -  dest_rec :: "'a::type recspace => nat => 'a::type => bool" 
  1.1253 +  mk_rec :: "(nat => 'a => bool) => 'a recspace" 
  1.1254 +  dest_rec :: "'a recspace => nat => 'a => bool" 
  1.1255  
  1.1256  specification (dest_rec mk_rec) recspace_repfns: "(ALL a::'a::type recspace. mk_rec (dest_rec a) = a) &
  1.1257  (ALL r::nat => 'a::type => bool. ZRECSPACE r = (dest_rec (mk_rec r) = r))"
  1.1258    by (import ind_type recspace_repfns)
  1.1259  
  1.1260  constdefs
  1.1261 -  BOTTOM :: "'a::type recspace" 
  1.1262 +  BOTTOM :: "'a recspace" 
  1.1263    "BOTTOM == mk_rec ZBOT"
  1.1264  
  1.1265  lemma BOTTOM: "BOTTOM = mk_rec ZBOT"
  1.1266    by (import ind_type BOTTOM)
  1.1267  
  1.1268  constdefs
  1.1269 -  CONSTR :: "nat => 'a::type => (nat => 'a::type recspace) => 'a::type recspace" 
  1.1270 +  CONSTR :: "nat => 'a => (nat => 'a recspace) => 'a recspace" 
  1.1271    "CONSTR ==
  1.1272  %(c::nat) (i::'a::type) r::nat => 'a::type recspace.
  1.1273     mk_rec (ZCONSTR c i (%n::nat. dest_rec (r n)))"
  1.1274 @@ -2862,21 +3046,21 @@
  1.1275    by (import ind_type CONSTR_REC)
  1.1276  
  1.1277  consts
  1.1278 -  FCONS :: "'a::type => (nat => 'a::type) => nat => 'a::type" 
  1.1279 -
  1.1280 -specification (FCONS) FCONS: "(ALL (a::'a::type) f::nat => 'a::type. FCONS a f (0::nat) = a) &
  1.1281 +  FCONS :: "'a => (nat => 'a) => nat => 'a" 
  1.1282 +
  1.1283 +specification (FCONS) FCONS: "(ALL (a::'a::type) f::nat => 'a::type. FCONS a f 0 = a) &
  1.1284  (ALL (a::'a::type) (f::nat => 'a::type) n::nat. FCONS a f (Suc n) = f n)"
  1.1285    by (import ind_type FCONS)
  1.1286  
  1.1287  constdefs
  1.1288 -  FNIL :: "nat => 'a::type" 
  1.1289 +  FNIL :: "nat => 'a" 
  1.1290    "FNIL == %n::nat. SOME x::'a::type. True"
  1.1291  
  1.1292  lemma FNIL: "ALL n::nat. FNIL n = (SOME x::'a::type. True)"
  1.1293    by (import ind_type FNIL)
  1.1294  
  1.1295  constdefs
  1.1296 -  ISO :: "('a::type => 'b::type) => ('b::type => 'a::type) => bool" 
  1.1297 +  ISO :: "('a => 'b) => ('b => 'a) => bool" 
  1.1298    "ISO ==
  1.1299  %(f::'a::type => 'b::type) g::'b::type => 'a::type.
  1.1300     (ALL x::'b::type. f (g x) = x) & (ALL y::'a::type. g (f y) = y)"
  1.1301 @@ -2905,16 +3089,16 @@
  1.1302  
  1.1303  ;setup_theory divides
  1.1304  
  1.1305 -lemma ONE_DIVIDES_ALL: "All (op dvd (1::nat))"
  1.1306 +lemma ONE_DIVIDES_ALL: "(All::(nat => bool) => bool) ((op dvd::nat => nat => bool) (1::nat))"
  1.1307    by (import divides ONE_DIVIDES_ALL)
  1.1308  
  1.1309  lemma DIVIDES_ADD_2: "ALL (a::nat) (b::nat) c::nat. a dvd b & a dvd b + c --> a dvd c"
  1.1310    by (import divides DIVIDES_ADD_2)
  1.1311  
  1.1312 -lemma DIVIDES_FACT: "ALL b>0::nat. b dvd FACT b"
  1.1313 +lemma DIVIDES_FACT: "ALL b>0. b dvd FACT b"
  1.1314    by (import divides DIVIDES_FACT)
  1.1315  
  1.1316 -lemma DIVIDES_MULT_LEFT: "ALL (x::nat) xa::nat. (x * xa dvd xa) = (xa = (0::nat) | x = (1::nat))"
  1.1317 +lemma DIVIDES_MULT_LEFT: "ALL (x::nat) xa::nat. (x * xa dvd xa) = (xa = 0 | x = 1)"
  1.1318    by (import divides DIVIDES_MULT_LEFT)
  1.1319  
  1.1320  ;end_setup
  1.1321 @@ -2925,18 +3109,16 @@
  1.1322    prime :: "nat => bool" 
  1.1323  
  1.1324  defs
  1.1325 -  prime_primdef: "prime.prime ==
  1.1326 -%a::nat. a ~= (1::nat) & (ALL b::nat. b dvd a --> b = a | b = (1::nat))"
  1.1327 +  prime_primdef: "prime.prime == %a::nat. a ~= 1 & (ALL b::nat. b dvd a --> b = a | b = 1)"
  1.1328  
  1.1329  lemma prime_def: "ALL a::nat.
  1.1330 -   prime.prime a =
  1.1331 -   (a ~= (1::nat) & (ALL b::nat. b dvd a --> b = a | b = (1::nat)))"
  1.1332 +   prime.prime a = (a ~= 1 & (ALL b::nat. b dvd a --> b = a | b = 1))"
  1.1333    by (import prime prime_def)
  1.1334  
  1.1335 -lemma NOT_PRIME_0: "~ prime.prime (0::nat)"
  1.1336 +lemma NOT_PRIME_0: "~ prime.prime 0"
  1.1337    by (import prime NOT_PRIME_0)
  1.1338  
  1.1339 -lemma NOT_PRIME_1: "~ prime.prime (1::nat)"
  1.1340 +lemma NOT_PRIME_1: "~ prime.prime 1"
  1.1341    by (import prime NOT_PRIME_1)
  1.1342  
  1.1343  ;end_setup
  1.1344 @@ -2944,9 +3126,9 @@
  1.1345  ;setup_theory list
  1.1346  
  1.1347  consts
  1.1348 -  EL :: "nat => 'a::type list => 'a::type" 
  1.1349 -
  1.1350 -specification (EL) EL: "(ALL l::'a::type list. EL (0::nat) l = hd l) &
  1.1351 +  EL :: "nat => 'a list => 'a" 
  1.1352 +
  1.1353 +specification (EL) EL: "(ALL l::'a::type list. EL 0 l = hd l) &
  1.1354  (ALL (l::'a::type list) n::nat. EL (Suc n) l = EL n (tl l))"
  1.1355    by (import list EL)
  1.1356  
  1.1357 @@ -3047,7 +3229,7 @@
  1.1358    by (import list LENGTH_EQ_CONS)
  1.1359  
  1.1360  lemma LENGTH_EQ_NIL: "ALL P::'a::type list => bool.
  1.1361 -   (ALL l::'a::type list. length l = (0::nat) --> P l) = P []"
  1.1362 +   (ALL l::'a::type list. length l = 0 --> P l) = P []"
  1.1363    by (import list LENGTH_EQ_NIL)
  1.1364  
  1.1365  lemma CONS_ACYCLIC: "ALL (l::'a::type list) x::'a::type. l ~= x # l & x # l ~= l"
  1.1366 @@ -3066,8 +3248,7 @@
  1.1367    by (import list APPEND_11)
  1.1368  
  1.1369  lemma EL_compute: "ALL n::nat.
  1.1370 -   EL n (l::'a::type list) =
  1.1371 -   (if n = (0::nat) then hd l else EL (PRE n) (tl l))"
  1.1372 +   EL n (l::'a::type list) = (if n = 0 then hd l else EL (PRE n) (tl l))"
  1.1373    by (import list EL_compute)
  1.1374  
  1.1375  lemma WF_LIST_PRED: "WF (%(L1::'a::type list) L2::'a::type list. EX h::'a::type. L2 = h # L1)"
  1.1376 @@ -3245,7 +3426,7 @@
  1.1377    by (import pred_set NUM_SET_WOP)
  1.1378  
  1.1379  consts
  1.1380 -  GSPEC :: "('b::type => 'a::type * bool) => 'a::type => bool" 
  1.1381 +  GSPEC :: "('b => 'a * bool) => 'a => bool" 
  1.1382  
  1.1383  specification (GSPEC) GSPECIFICATION: "ALL (f::'b::type => 'a::type * bool) v::'a::type.
  1.1384     IN v (GSPEC f) = (EX x::'b::type. (v, True) = f x)"
  1.1385 @@ -3257,7 +3438,7 @@
  1.1386    by (import pred_set SET_MINIMUM)
  1.1387  
  1.1388  constdefs
  1.1389 -  EMPTY :: "'a::type => bool" 
  1.1390 +  EMPTY :: "'a => bool" 
  1.1391    "EMPTY == %x::'a::type. False"
  1.1392  
  1.1393  lemma EMPTY_DEF: "EMPTY = (%x::'a::type. False)"
  1.1394 @@ -3270,7 +3451,7 @@
  1.1395    by (import pred_set MEMBER_NOT_EMPTY)
  1.1396  
  1.1397  consts
  1.1398 -  UNIV :: "'a::type => bool" 
  1.1399 +  UNIV :: "'a => bool" 
  1.1400  
  1.1401  defs
  1.1402    UNIV_def: "pred_set.UNIV == %x::'a::type. True"
  1.1403 @@ -3291,7 +3472,7 @@
  1.1404    by (import pred_set EQ_UNIV)
  1.1405  
  1.1406  constdefs
  1.1407 -  SUBSET :: "('a::type => bool) => ('a::type => bool) => bool" 
  1.1408 +  SUBSET :: "('a => bool) => ('a => bool) => bool" 
  1.1409    "SUBSET ==
  1.1410  %(s::'a::type => bool) t::'a::type => bool.
  1.1411     ALL x::'a::type. IN x s --> IN x t"
  1.1412 @@ -3324,7 +3505,7 @@
  1.1413    by (import pred_set UNIV_SUBSET)
  1.1414  
  1.1415  constdefs
  1.1416 -  PSUBSET :: "('a::type => bool) => ('a::type => bool) => bool" 
  1.1417 +  PSUBSET :: "('a => bool) => ('a => bool) => bool" 
  1.1418    "PSUBSET == %(s::'a::type => bool) t::'a::type => bool. SUBSET s t & s ~= t"
  1.1419  
  1.1420  lemma PSUBSET_DEF: "ALL (s::'a::type => bool) t::'a::type => bool.
  1.1421 @@ -3349,7 +3530,7 @@
  1.1422    by (import pred_set PSUBSET_UNIV)
  1.1423  
  1.1424  consts
  1.1425 -  UNION :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
  1.1426 +  UNION :: "('a => bool) => ('a => bool) => 'a => bool" 
  1.1427  
  1.1428  defs
  1.1429    UNION_def: "pred_set.UNION ==
  1.1430 @@ -3403,7 +3584,7 @@
  1.1431    by (import pred_set EMPTY_UNION)
  1.1432  
  1.1433  consts
  1.1434 -  INTER :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
  1.1435 +  INTER :: "('a => bool) => ('a => bool) => 'a => bool" 
  1.1436  
  1.1437  defs
  1.1438    INTER_def: "pred_set.INTER ==
  1.1439 @@ -3463,7 +3644,7 @@
  1.1440    by (import pred_set INTER_OVER_UNION)
  1.1441  
  1.1442  constdefs
  1.1443 -  DISJOINT :: "('a::type => bool) => ('a::type => bool) => bool" 
  1.1444 +  DISJOINT :: "('a => bool) => ('a => bool) => bool" 
  1.1445    "DISJOINT ==
  1.1446  %(s::'a::type => bool) t::'a::type => bool. pred_set.INTER s t = EMPTY"
  1.1447  
  1.1448 @@ -3495,7 +3676,7 @@
  1.1449    by (import pred_set DISJOINT_UNION_BOTH)
  1.1450  
  1.1451  constdefs
  1.1452 -  DIFF :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
  1.1453 +  DIFF :: "('a => bool) => ('a => bool) => 'a => bool" 
  1.1454    "DIFF ==
  1.1455  %(s::'a::type => bool) t::'a::type => bool.
  1.1456     GSPEC (%x::'a::type. (x, IN x s & ~ IN x t))"
  1.1457 @@ -3525,7 +3706,7 @@
  1.1458    by (import pred_set DIFF_EQ_EMPTY)
  1.1459  
  1.1460  constdefs
  1.1461 -  INSERT :: "'a::type => ('a::type => bool) => 'a::type => bool" 
  1.1462 +  INSERT :: "'a => ('a => bool) => 'a => bool" 
  1.1463    "INSERT ==
  1.1464  %(x::'a::type) s::'a::type => bool.
  1.1465     GSPEC (%y::'a::type. (y, y = x | IN y s))"
  1.1466 @@ -3601,7 +3782,7 @@
  1.1467    by (import pred_set INSERT_DIFF)
  1.1468  
  1.1469  constdefs
  1.1470 -  DELETE :: "('a::type => bool) => 'a::type => 'a::type => bool" 
  1.1471 +  DELETE :: "('a => bool) => 'a => 'a => bool" 
  1.1472    "DELETE == %(s::'a::type => bool) x::'a::type. DIFF s (INSERT x EMPTY)"
  1.1473  
  1.1474  lemma DELETE_DEF: "ALL (s::'a::type => bool) x::'a::type. DELETE s x = DIFF s (INSERT x EMPTY)"
  1.1475 @@ -3669,13 +3850,13 @@
  1.1476    by (import pred_set DISJOINT_DELETE_SYM)
  1.1477  
  1.1478  consts
  1.1479 -  CHOICE :: "('a::type => bool) => 'a::type" 
  1.1480 +  CHOICE :: "('a => bool) => 'a" 
  1.1481  
  1.1482  specification (CHOICE) CHOICE_DEF: "ALL x::'a::type => bool. x ~= EMPTY --> IN (CHOICE x) x"
  1.1483    by (import pred_set CHOICE_DEF)
  1.1484  
  1.1485  constdefs
  1.1486 -  REST :: "('a::type => bool) => 'a::type => bool" 
  1.1487 +  REST :: "('a => bool) => 'a => bool" 
  1.1488    "REST == %s::'a::type => bool. DELETE s (CHOICE s)"
  1.1489  
  1.1490  lemma REST_DEF: "ALL s::'a::type => bool. REST s = DELETE s (CHOICE s)"
  1.1491 @@ -3694,7 +3875,7 @@
  1.1492    by (import pred_set REST_PSUBSET)
  1.1493  
  1.1494  constdefs
  1.1495 -  SING :: "('a::type => bool) => bool" 
  1.1496 +  SING :: "('a => bool) => bool" 
  1.1497    "SING == %s::'a::type => bool. EX x::'a::type. s = INSERT x EMPTY"
  1.1498  
  1.1499  lemma SING_DEF: "ALL s::'a::type => bool. SING s = (EX x::'a::type. s = INSERT x EMPTY)"
  1.1500 @@ -3740,7 +3921,7 @@
  1.1501    by (import pred_set SING_IFF_EMPTY_REST)
  1.1502  
  1.1503  constdefs
  1.1504 -  IMAGE :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => bool" 
  1.1505 +  IMAGE :: "('a => 'b) => ('a => bool) => 'b => bool" 
  1.1506    "IMAGE ==
  1.1507  %(f::'a::type => 'b::type) s::'a::type => bool.
  1.1508     GSPEC (%x::'a::type. (f x, IN x s))"
  1.1509 @@ -3794,7 +3975,7 @@
  1.1510    by (import pred_set IMAGE_INTER)
  1.1511  
  1.1512  constdefs
  1.1513 -  INJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
  1.1514 +  INJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  1.1515    "INJ ==
  1.1516  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  1.1517     (ALL x::'a::type. IN x s --> IN (f x) t) &
  1.1518 @@ -3821,7 +4002,7 @@
  1.1519    by (import pred_set INJ_EMPTY)
  1.1520  
  1.1521  constdefs
  1.1522 -  SURJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
  1.1523 +  SURJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  1.1524    "SURJ ==
  1.1525  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  1.1526     (ALL x::'a::type. IN x s --> IN (f x) t) &
  1.1527 @@ -3851,7 +4032,7 @@
  1.1528    by (import pred_set IMAGE_SURJ)
  1.1529  
  1.1530  constdefs
  1.1531 -  BIJ :: "('a::type => 'b::type) => ('a::type => bool) => ('b::type => bool) => bool" 
  1.1532 +  BIJ :: "('a => 'b) => ('a => bool) => ('b => bool) => bool" 
  1.1533    "BIJ ==
  1.1534  %(f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  1.1535     INJ f s t & SURJ f s t"
  1.1536 @@ -3874,21 +4055,21 @@
  1.1537    by (import pred_set BIJ_COMPOSE)
  1.1538  
  1.1539  consts
  1.1540 -  LINV :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => 'a::type" 
  1.1541 +  LINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
  1.1542  
  1.1543  specification (LINV) LINV_DEF: "ALL (f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  1.1544     INJ f s t --> (ALL x::'a::type. IN x s --> LINV f s (f x) = x)"
  1.1545    by (import pred_set LINV_DEF)
  1.1546  
  1.1547  consts
  1.1548 -  RINV :: "('a::type => 'b::type) => ('a::type => bool) => 'b::type => 'a::type" 
  1.1549 +  RINV :: "('a => 'b) => ('a => bool) => 'b => 'a" 
  1.1550  
  1.1551  specification (RINV) RINV_DEF: "ALL (f::'a::type => 'b::type) (s::'a::type => bool) t::'b::type => bool.
  1.1552     SURJ f s t --> (ALL x::'b::type. IN x t --> f (RINV f s x) = x)"
  1.1553    by (import pred_set RINV_DEF)
  1.1554  
  1.1555  constdefs
  1.1556 -  FINITE :: "('a::type => bool) => bool" 
  1.1557 +  FINITE :: "('a => bool) => bool" 
  1.1558    "FINITE ==
  1.1559  %s::'a::type => bool.
  1.1560     ALL P::('a::type => bool) => bool.
  1.1561 @@ -3954,7 +4135,7 @@
  1.1562    by (import pred_set IMAGE_FINITE)
  1.1563  
  1.1564  consts
  1.1565 -  CARD :: "('a::type => bool) => nat" 
  1.1566 +  CARD :: "('a => bool) => nat" 
  1.1567  
  1.1568  specification (CARD) CARD_DEF: "(op &::bool => bool => bool)
  1.1569   ((op =::nat => nat => bool)
  1.1570 @@ -3977,7 +4158,7 @@
  1.1571                     ((CARD::('a::type => bool) => nat) s)))))))"
  1.1572    by (import pred_set CARD_DEF)
  1.1573  
  1.1574 -lemma CARD_EMPTY: "CARD EMPTY = (0::nat)"
  1.1575 +lemma CARD_EMPTY: "CARD EMPTY = 0"
  1.1576    by (import pred_set CARD_EMPTY)
  1.1577  
  1.1578  lemma CARD_INSERT: "ALL s::'a::type => bool.
  1.1579 @@ -3986,13 +4167,13 @@
  1.1580         CARD (INSERT x s) = (if IN x s then CARD s else Suc (CARD s)))"
  1.1581    by (import pred_set CARD_INSERT)
  1.1582  
  1.1583 -lemma CARD_EQ_0: "ALL s::'a::type => bool. FINITE s --> (CARD s = (0::nat)) = (s = EMPTY)"
  1.1584 +lemma CARD_EQ_0: "ALL s::'a::type => bool. FINITE s --> (CARD s = 0) = (s = EMPTY)"
  1.1585    by (import pred_set CARD_EQ_0)
  1.1586  
  1.1587  lemma CARD_DELETE: "ALL s::'a::type => bool.
  1.1588     FINITE s -->
  1.1589     (ALL x::'a::type.
  1.1590 -       CARD (DELETE s x) = (if IN x s then CARD s - (1::nat) else CARD s))"
  1.1591 +       CARD (DELETE s x) = (if IN x s then CARD s - 1 else CARD s))"
  1.1592    by (import pred_set CARD_DELETE)
  1.1593  
  1.1594  lemma CARD_INTER_LESS_EQ: "ALL s::'a::type => bool.
  1.1595 @@ -4016,10 +4197,10 @@
  1.1596     FINITE s --> (ALL t::'a::type => bool. PSUBSET t s --> CARD t < CARD s)"
  1.1597    by (import pred_set CARD_PSUBSET)
  1.1598  
  1.1599 -lemma CARD_SING: "ALL x::'a::type. CARD (INSERT x EMPTY) = (1::nat)"
  1.1600 +lemma CARD_SING: "ALL x::'a::type. CARD (INSERT x EMPTY) = 1"
  1.1601    by (import pred_set CARD_SING)
  1.1602  
  1.1603 -lemma SING_IFF_CARD1: "ALL x::'a::type => bool. SING x = (CARD x = (1::nat) & FINITE x)"
  1.1604 +lemma SING_IFF_CARD1: "ALL x::'a::type => bool. SING x = (CARD x = 1 & FINITE x)"
  1.1605    by (import pred_set SING_IFF_CARD1)
  1.1606  
  1.1607  lemma CARD_DIFF: "ALL t::'a::type => bool.
  1.1608 @@ -4031,7 +4212,7 @@
  1.1609  lemma LESS_CARD_DIFF: "ALL t::'a::type => bool.
  1.1610     FINITE t -->
  1.1611     (ALL s::'a::type => bool.
  1.1612 -       FINITE s --> CARD t < CARD s --> (0::nat) < CARD (DIFF s t))"
  1.1613 +       FINITE s --> CARD t < CARD s --> 0 < CARD (DIFF s t))"
  1.1614    by (import pred_set LESS_CARD_DIFF)
  1.1615  
  1.1616  lemma FINITE_COMPLETE_INDUCTION: "ALL P::('a::type => bool) => bool.
  1.1617 @@ -4042,7 +4223,7 @@
  1.1618    by (import pred_set FINITE_COMPLETE_INDUCTION)
  1.1619  
  1.1620  constdefs
  1.1621 -  INFINITE :: "('a::type => bool) => bool" 
  1.1622 +  INFINITE :: "('a => bool) => bool" 
  1.1623    "INFINITE == %s::'a::type => bool. ~ FINITE s"
  1.1624  
  1.1625  lemma INFINITE_DEF: "ALL s::'a::type => bool. INFINITE s = (~ FINITE s)"
  1.1626 @@ -4143,7 +4324,7 @@
  1.1627    by (import pred_set FINITE_WEAK_ENUMERATE)
  1.1628  
  1.1629  constdefs
  1.1630 -  BIGUNION :: "(('a::type => bool) => bool) => 'a::type => bool" 
  1.1631 +  BIGUNION :: "(('a => bool) => bool) => 'a => bool" 
  1.1632    "BIGUNION ==
  1.1633  %P::('a::type => bool) => bool.
  1.1634     GSPEC (%x::'a::type. (x, EX p::'a::type => bool. IN p P & IN x p))"
  1.1635 @@ -4190,7 +4371,7 @@
  1.1636    by (import pred_set FINITE_BIGUNION)
  1.1637  
  1.1638  constdefs
  1.1639 -  BIGINTER :: "(('a::type => bool) => bool) => 'a::type => bool" 
  1.1640 +  BIGINTER :: "(('a => bool) => bool) => 'a => bool" 
  1.1641    "BIGINTER ==
  1.1642  %B::('a::type => bool) => bool.
  1.1643     GSPEC (%x::'a::type. (x, ALL P::'a::type => bool. IN P B --> IN x P))"
  1.1644 @@ -4229,7 +4410,7 @@
  1.1645    by (import pred_set DISJOINT_BIGINTER)
  1.1646  
  1.1647  constdefs
  1.1648 -  CROSS :: "('a::type => bool) => ('b::type => bool) => 'a::type * 'b::type => bool" 
  1.1649 +  CROSS :: "('a => bool) => ('b => bool) => 'a * 'b => bool" 
  1.1650    "CROSS ==
  1.1651  %(P::'a::type => bool) Q::'b::type => bool.
  1.1652     GSPEC (%p::'a::type * 'b::type. (p, IN (fst p) P & IN (snd p) Q))"
  1.1653 @@ -4283,7 +4464,7 @@
  1.1654    by (import pred_set FINITE_CROSS_EQ)
  1.1655  
  1.1656  constdefs
  1.1657 -  COMPL :: "('a::type => bool) => 'a::type => bool" 
  1.1658 +  COMPL :: "('a => bool) => 'a => bool" 
  1.1659    "COMPL == DIFF pred_set.UNIV"
  1.1660  
  1.1661  lemma COMPL_DEF: "ALL P::'a::type => bool. COMPL P = DIFF pred_set.UNIV P"
  1.1662 @@ -4323,7 +4504,7 @@
  1.1663  lemma IN_COUNT: "ALL (m::nat) n::nat. IN m (count n) = (m < n)"
  1.1664    by (import pred_set IN_COUNT)
  1.1665  
  1.1666 -lemma COUNT_ZERO: "count (0::nat) = EMPTY"
  1.1667 +lemma COUNT_ZERO: "count 0 = EMPTY"
  1.1668    by (import pred_set COUNT_ZERO)
  1.1669  
  1.1670  lemma COUNT_SUC: "ALL n::nat. count (Suc n) = INSERT n (count n)"
  1.1671 @@ -4336,8 +4517,7 @@
  1.1672    by (import pred_set CARD_COUNT)
  1.1673  
  1.1674  constdefs
  1.1675 -  ITSET_tupled :: "('a::type => 'b::type => 'b::type)
  1.1676 -=> ('a::type => bool) * 'b::type => 'b::type" 
  1.1677 +  ITSET_tupled :: "('a => 'b => 'b) => ('a => bool) * 'b => 'b" 
  1.1678    "ITSET_tupled ==
  1.1679  %f::'a::type => 'b::type => 'b::type.
  1.1680     WFREC
  1.1681 @@ -4370,8 +4550,7 @@
  1.1682    by (import pred_set ITSET_tupled_primitive_def)
  1.1683  
  1.1684  constdefs
  1.1685 -  ITSET :: "('a::type => 'b::type => 'b::type)
  1.1686 -=> ('a::type => bool) => 'b::type => 'b::type" 
  1.1687 +  ITSET :: "('a => 'b => 'b) => ('a => bool) => 'b => 'b" 
  1.1688    "ITSET ==
  1.1689  %(f::'a::type => 'b::type => 'b::type) (x::'a::type => bool) x1::'b::type.
  1.1690     ITSET_tupled f (x, x1)"
  1.1691 @@ -4403,7 +4582,7 @@
  1.1692  ;setup_theory operator
  1.1693  
  1.1694  constdefs
  1.1695 -  ASSOC :: "('a::type => 'a::type => 'a::type) => bool" 
  1.1696 +  ASSOC :: "('a => 'a => 'a) => bool" 
  1.1697    "ASSOC ==
  1.1698  %f::'a::type => 'a::type => 'a::type.
  1.1699     ALL (x::'a::type) (y::'a::type) z::'a::type. f x (f y z) = f (f x y) z"
  1.1700 @@ -4414,7 +4593,7 @@
  1.1701    by (import operator ASSOC_DEF)
  1.1702  
  1.1703  constdefs
  1.1704 -  COMM :: "('a::type => 'a::type => 'b::type) => bool" 
  1.1705 +  COMM :: "('a => 'a => 'b) => bool" 
  1.1706    "COMM ==
  1.1707  %f::'a::type => 'a::type => 'b::type.
  1.1708     ALL (x::'a::type) y::'a::type. f x y = f y x"
  1.1709 @@ -4424,8 +4603,7 @@
  1.1710    by (import operator COMM_DEF)
  1.1711  
  1.1712  constdefs
  1.1713 -  FCOMM :: "('a::type => 'b::type => 'a::type)
  1.1714 -=> ('c::type => 'a::type => 'a::type) => bool" 
  1.1715 +  FCOMM :: "('a => 'b => 'a) => ('c => 'a => 'a) => bool" 
  1.1716    "FCOMM ==
  1.1717  %(f::'a::type => 'b::type => 'a::type) g::'c::type => 'a::type => 'a::type.
  1.1718     ALL (x::'c::type) (y::'a::type) z::'b::type. g x (f y z) = f (g x y) z"
  1.1719 @@ -4437,7 +4615,7 @@
  1.1720    by (import operator FCOMM_DEF)
  1.1721  
  1.1722  constdefs
  1.1723 -  RIGHT_ID :: "('a::type => 'b::type => 'a::type) => 'b::type => bool" 
  1.1724 +  RIGHT_ID :: "('a => 'b => 'a) => 'b => bool" 
  1.1725    "RIGHT_ID ==
  1.1726  %(f::'a::type => 'b::type => 'a::type) e::'b::type.
  1.1727     ALL x::'a::type. f x e = x"
  1.1728 @@ -4447,7 +4625,7 @@
  1.1729    by (import operator RIGHT_ID_DEF)
  1.1730  
  1.1731  constdefs
  1.1732 -  LEFT_ID :: "('a::type => 'b::type => 'b::type) => 'a::type => bool" 
  1.1733 +  LEFT_ID :: "('a => 'b => 'b) => 'a => bool" 
  1.1734    "LEFT_ID ==
  1.1735  %(f::'a::type => 'b::type => 'b::type) e::'a::type.
  1.1736     ALL x::'b::type. f e x = x"
  1.1737 @@ -4457,7 +4635,7 @@
  1.1738    by (import operator LEFT_ID_DEF)
  1.1739  
  1.1740  constdefs
  1.1741 -  MONOID :: "('a::type => 'a::type => 'a::type) => 'a::type => bool" 
  1.1742 +  MONOID :: "('a => 'a => 'a) => 'a => bool" 
  1.1743    "MONOID ==
  1.1744  %(f::'a::type => 'a::type => 'a::type) e::'a::type.
  1.1745     ASSOC f & RIGHT_ID f e & LEFT_ID f e"
  1.1746 @@ -4486,7 +4664,7 @@
  1.1747  ;setup_theory rich_list
  1.1748  
  1.1749  consts
  1.1750 -  SNOC :: "'a::type => 'a::type list => 'a::type list" 
  1.1751 +  SNOC :: "'a => 'a list => 'a list" 
  1.1752  
  1.1753  specification (SNOC) SNOC: "(ALL x::'a::type. SNOC x [] = [x]) &
  1.1754  (ALL (x::'a::type) (x'::'a::type) l::'a::type list.
  1.1755 @@ -4494,8 +4672,7 @@
  1.1756    by (import rich_list SNOC)
  1.1757  
  1.1758  consts
  1.1759 -  SCANL :: "('b::type => 'a::type => 'b::type)
  1.1760 -=> 'b::type => 'a::type list => 'b::type list" 
  1.1761 +  SCANL :: "('b => 'a => 'b) => 'b => 'a list => 'b list" 
  1.1762  
  1.1763  specification (SCANL) SCANL: "(ALL (f::'b::type => 'a::type => 'b::type) e::'b::type.
  1.1764      SCANL f e [] = [e]) &
  1.1765 @@ -4504,8 +4681,7 @@
  1.1766    by (import rich_list SCANL)
  1.1767  
  1.1768  consts
  1.1769 -  SCANR :: "('a::type => 'b::type => 'b::type)
  1.1770 -=> 'b::type => 'a::type list => 'b::type list" 
  1.1771 +  SCANR :: "('a => 'b => 'b) => 'b => 'a list => 'b list" 
  1.1772  
  1.1773  specification (SCANR) SCANR: "(ALL (f::'a::type => 'b::type => 'b::type) e::'b::type.
  1.1774      SCANR f e [] = [e]) &
  1.1775 @@ -4532,27 +4708,27 @@
  1.1776    by (import rich_list OR_EL_DEF)
  1.1777  
  1.1778  consts
  1.1779 -  FIRSTN :: "nat => 'a::type list => 'a::type list" 
  1.1780 -
  1.1781 -specification (FIRSTN) FIRSTN: "(ALL l::'a::type list. FIRSTN (0::nat) l = []) &
  1.1782 +  FIRSTN :: "nat => 'a list => 'a list" 
  1.1783 +
  1.1784 +specification (FIRSTN) FIRSTN: "(ALL l::'a::type list. FIRSTN 0 l = []) &
  1.1785  (ALL (n::nat) (x::'a::type) l::'a::type list.
  1.1786      FIRSTN (Suc n) (x # l) = x # FIRSTN n l)"
  1.1787    by (import rich_list FIRSTN)
  1.1788  
  1.1789  consts
  1.1790 -  BUTFIRSTN :: "nat => 'a::type list => 'a::type list" 
  1.1791 -
  1.1792 -specification (BUTFIRSTN) BUTFIRSTN: "(ALL l::'a::type list. BUTFIRSTN (0::nat) l = l) &
  1.1793 +  BUTFIRSTN :: "nat => 'a list => 'a list" 
  1.1794 +
  1.1795 +specification (BUTFIRSTN) BUTFIRSTN: "(ALL l::'a::type list. BUTFIRSTN 0 l = l) &
  1.1796  (ALL (n::nat) (x::'a::type) l::'a::type list.
  1.1797      BUTFIRSTN (Suc n) (x # l) = BUTFIRSTN n l)"
  1.1798    by (import rich_list BUTFIRSTN)
  1.1799  
  1.1800  consts
  1.1801 -  SEG :: "nat => nat => 'a::type list => 'a::type list" 
  1.1802 -
  1.1803 -specification (SEG) SEG: "(ALL (k::nat) l::'a::type list. SEG (0::nat) k l = []) &
  1.1804 +  SEG :: "nat => nat => 'a list => 'a list" 
  1.1805 +
  1.1806 +specification (SEG) SEG: "(ALL (k::nat) l::'a::type list. SEG 0 k l = []) &
  1.1807  (ALL (m::nat) (x::'a::type) l::'a::type list.
  1.1808 -    SEG (Suc m) (0::nat) (x # l) = x # SEG m (0::nat) l) &
  1.1809 +    SEG (Suc m) 0 (x # l) = x # SEG m 0 l) &
  1.1810  (ALL (m::nat) (k::nat) (x::'a::type) l::'a::type list.
  1.1811      SEG (Suc m) (Suc k) (x # l) = SEG (Suc m) k l)"
  1.1812    by (import rich_list SEG)
  1.1813 @@ -4564,34 +4740,34 @@
  1.1814    by (import rich_list BUTLAST)
  1.1815  
  1.1816  consts
  1.1817 -  LASTN :: "nat => 'a::type list => 'a::type list" 
  1.1818 -
  1.1819 -specification (LASTN) LASTN: "(ALL l::'a::type list. LASTN (0::nat) l = []) &
  1.1820 +  LASTN :: "nat => 'a list => 'a list" 
  1.1821 +
  1.1822 +specification (LASTN) LASTN: "(ALL l::'a::type list. LASTN 0 l = []) &
  1.1823  (ALL (n::nat) (x::'a::type) l::'a::type list.
  1.1824      LASTN (Suc n) (SNOC x l) = SNOC x (LASTN n l))"
  1.1825    by (import rich_list LASTN)
  1.1826  
  1.1827  consts
  1.1828 -  BUTLASTN :: "nat => 'a::type list => 'a::type list" 
  1.1829 -
  1.1830 -specification (BUTLASTN) BUTLASTN: "(ALL l::'a::type list. BUTLASTN (0::nat) l = l) &
  1.1831 +  BUTLASTN :: "nat => 'a list => 'a list" 
  1.1832 +
  1.1833 +specification (BUTLASTN) BUTLASTN: "(ALL l::'a::type list. BUTLASTN 0 l = l) &
  1.1834  (ALL (n::nat) (x::'a::type) l::'a::type list.
  1.1835      BUTLASTN (Suc n) (SNOC x l) = BUTLASTN n l)"
  1.1836    by (import rich_list BUTLASTN)
  1.1837  
  1.1838 -lemma EL: "(ALL x::'a::type list. EL (0::nat) x = hd x) &
  1.1839 +lemma EL: "(ALL x::'a::type list. EL 0 x = hd x) &
  1.1840  (ALL (x::nat) xa::'a::type list. EL (Suc x) xa = EL x (tl xa))"
  1.1841    by (import rich_list EL)
  1.1842  
  1.1843  consts
  1.1844 -  ELL :: "nat => 'a::type list => 'a::type" 
  1.1845 -
  1.1846 -specification (ELL) ELL: "(ALL l::'a::type list. ELL (0::nat) l = last l) &
  1.1847 +  ELL :: "nat => 'a list => 'a" 
  1.1848 +
  1.1849 +specification (ELL) ELL: "(ALL l::'a::type list. ELL 0 l = last l) &
  1.1850  (ALL (n::nat) l::'a::type list. ELL (Suc n) l = ELL n (butlast l))"
  1.1851    by (import rich_list ELL)
  1.1852  
  1.1853  consts
  1.1854 -  IS_PREFIX :: "'a::type list => 'a::type list => bool" 
  1.1855 +  IS_PREFIX :: "'a list => 'a list => bool" 
  1.1856  
  1.1857  specification (IS_PREFIX) IS_PREFIX: "(ALL l::'a::type list. IS_PREFIX l [] = True) &
  1.1858  (ALL (x::'a::type) l::'a::type list. IS_PREFIX [] (x # l) = False) &
  1.1859 @@ -4616,7 +4792,7 @@
  1.1860    by (import rich_list SNOC_Axiom)
  1.1861  
  1.1862  consts
  1.1863 -  IS_SUFFIX :: "'a::type list => 'a::type list => bool" 
  1.1864 +  IS_SUFFIX :: "'a list => 'a list => bool" 
  1.1865  
  1.1866  specification (IS_SUFFIX) IS_SUFFIX: "(ALL l::'a::type list. IS_SUFFIX l [] = True) &
  1.1867  (ALL (x::'a::type) l::'a::type list. IS_SUFFIX [] (SNOC x l) = False) &
  1.1868 @@ -4625,7 +4801,7 @@
  1.1869    by (import rich_list IS_SUFFIX)
  1.1870  
  1.1871  consts
  1.1872 -  IS_SUBLIST :: "'a::type list => 'a::type list => bool" 
  1.1873 +  IS_SUBLIST :: "'a list => 'a list => bool" 
  1.1874  
  1.1875  specification (IS_SUBLIST) IS_SUBLIST: "(ALL l::'a::type list. IS_SUBLIST l [] = True) &
  1.1876  (ALL (x::'a::type) l::'a::type list. IS_SUBLIST [] (x # l) = False) &
  1.1877 @@ -4635,7 +4811,7 @@
  1.1878    by (import rich_list IS_SUBLIST)
  1.1879  
  1.1880  consts
  1.1881 -  SPLITP :: "('a::type => bool) => 'a::type list => 'a::type list * 'a::type list" 
  1.1882 +  SPLITP :: "('a => bool) => 'a list => 'a list * 'a list" 
  1.1883  
  1.1884  specification (SPLITP) SPLITP: "(ALL P::'a::type => bool. SPLITP P [] = ([], [])) &
  1.1885  (ALL (P::'a::type => bool) (x::'a::type) l::'a::type list.
  1.1886 @@ -4644,7 +4820,7 @@
  1.1887    by (import rich_list SPLITP)
  1.1888  
  1.1889  constdefs
  1.1890 -  PREFIX :: "('a::type => bool) => 'a::type list => 'a::type list" 
  1.1891 +  PREFIX :: "('a => bool) => 'a list => 'a list" 
  1.1892    "PREFIX == %(P::'a::type => bool) l::'a::type list. fst (SPLITP (Not o P) l)"
  1.1893  
  1.1894  lemma PREFIX_DEF: "ALL (P::'a::type => bool) l::'a::type list.
  1.1895 @@ -4652,7 +4828,7 @@
  1.1896    by (import rich_list PREFIX_DEF)
  1.1897  
  1.1898  constdefs
  1.1899 -  SUFFIX :: "('a::type => bool) => 'a::type list => 'a::type list" 
  1.1900 +  SUFFIX :: "('a => bool) => 'a list => 'a list" 
  1.1901    "SUFFIX ==
  1.1902  %P::'a::type => bool.
  1.1903     foldl (%(l'::'a::type list) x::'a::type. if P x then SNOC x l' else [])
  1.1904 @@ -4665,31 +4841,31 @@
  1.1905    by (import rich_list SUFFIX_DEF)
  1.1906  
  1.1907  constdefs
  1.1908 -  UNZIP_FST :: "('a::type * 'b::type) list => 'a::type list" 
  1.1909 +  UNZIP_FST :: "('a * 'b) list => 'a list" 
  1.1910    "UNZIP_FST == %l::('a::type * 'b::type) list. fst (unzip l)"
  1.1911  
  1.1912  lemma UNZIP_FST_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_FST l = fst (unzip l)"
  1.1913    by (import rich_list UNZIP_FST_DEF)
  1.1914  
  1.1915  constdefs
  1.1916 -  UNZIP_SND :: "('a::type * 'b::type) list => 'b::type list" 
  1.1917 +  UNZIP_SND :: "('a * 'b) list => 'b list" 
  1.1918    "UNZIP_SND == %l::('a::type * 'b::type) list. snd (unzip l)"
  1.1919  
  1.1920  lemma UNZIP_SND_DEF: "ALL l::('a::type * 'b::type) list. UNZIP_SND l = snd (unzip l)"
  1.1921    by (import rich_list UNZIP_SND_DEF)
  1.1922  
  1.1923  consts
  1.1924 -  GENLIST :: "(nat => 'a::type) => nat => 'a::type list" 
  1.1925 -
  1.1926 -specification (GENLIST) GENLIST: "(ALL f::nat => 'a::type. GENLIST f (0::nat) = []) &
  1.1927 +  GENLIST :: "(nat => 'a) => nat => 'a list" 
  1.1928 +
  1.1929 +specification (GENLIST) GENLIST: "(ALL f::nat => 'a::type. GENLIST f 0 = []) &
  1.1930  (ALL (f::nat => 'a::type) n::nat.
  1.1931      GENLIST f (Suc n) = SNOC (f n) (GENLIST f n))"
  1.1932    by (import rich_list GENLIST)
  1.1933  
  1.1934  consts
  1.1935 -  REPLICATE :: "nat => 'a::type => 'a::type list" 
  1.1936 -
  1.1937 -specification (REPLICATE) REPLICATE: "(ALL x::'a::type. REPLICATE (0::nat) x = []) &
  1.1938 +  REPLICATE :: "nat => 'a => 'a list" 
  1.1939 +
  1.1940 +specification (REPLICATE) REPLICATE: "(ALL x::'a::type. REPLICATE 0 x = []) &
  1.1941  (ALL (n::nat) x::'a::type. REPLICATE (Suc n) x = x # REPLICATE n x)"
  1.1942    by (import rich_list REPLICATE)
  1.1943  
  1.1944 @@ -4706,7 +4882,7 @@
  1.1945  lemma LENGTH_EQ: "ALL (x::'a::type list) y::'a::type list. x = y --> length x = length y"
  1.1946    by (import rich_list LENGTH_EQ)
  1.1947  
  1.1948 -lemma LENGTH_NOT_NULL: "ALL l::'a::type list. ((0::nat) < length l) = (~ null l)"
  1.1949 +lemma LENGTH_NOT_NULL: "ALL l::'a::type list. (0 < length l) = (~ null l)"
  1.1950    by (import rich_list LENGTH_NOT_NULL)
  1.1951  
  1.1952  lemma SNOC_INDUCT: "ALL P::'a::type list => bool.
  1.1953 @@ -4755,11 +4931,10 @@
  1.1954     MONOID f e --> (ALL l::'a::type list. foldr f l e = foldl f e l)"
  1.1955    by (import rich_list FOLDR_FOLDL)
  1.1956  
  1.1957 -lemma LENGTH_FOLDR: "ALL l::'a::type list. length l = foldr (%x::'a::type. Suc) l (0::nat)"
  1.1958 +lemma LENGTH_FOLDR: "ALL l::'a::type list. length l = foldr (%x::'a::type. Suc) l 0"
  1.1959    by (import rich_list LENGTH_FOLDR)
  1.1960  
  1.1961 -lemma LENGTH_FOLDL: "ALL l::'a::type list.
  1.1962 -   length l = foldl (%(l'::nat) x::'a::type. Suc l') (0::nat) l"
  1.1963 +lemma LENGTH_FOLDL: "ALL l::'a::type list. length l = foldl (%(l'::nat) x::'a::type. Suc l') 0 l"
  1.1964    by (import rich_list LENGTH_FOLDL)
  1.1965  
  1.1966  lemma MAP_FOLDR: "ALL (f::'a::type => 'b::type) l::'a::type list.
  1.1967 @@ -4870,7 +5045,7 @@
  1.1968  lemma SUM_SNOC: "ALL (x::nat) l::nat list. sum (SNOC x l) = sum l + x"
  1.1969    by (import rich_list SUM_SNOC)
  1.1970  
  1.1971 -lemma SUM_FOLDL: "ALL l::nat list. sum l = foldl op + (0::nat) l"
  1.1972 +lemma SUM_FOLDL: "ALL l::nat list. sum l = foldl op + 0 l"
  1.1973    by (import rich_list SUM_FOLDL)
  1.1974  
  1.1975  lemma IS_PREFIX_APPEND: "ALL (l1::'a::type list) l2::'a::type list.
  1.1976 @@ -5077,7 +5252,7 @@
  1.1977  lemma NULL_FOLDL: "ALL l::'a::type list. null l = foldl (%(x::bool) l'::'a::type. False) True l"
  1.1978    by (import rich_list NULL_FOLDL)
  1.1979  
  1.1980 -lemma SEG_LENGTH_ID: "ALL l::'a::type list. SEG (length l) (0::nat) l = l"
  1.1981 +lemma SEG_LENGTH_ID: "ALL l::'a::type list. SEG (length l) 0 l = l"
  1.1982    by (import rich_list SEG_LENGTH_ID)
  1.1983  
  1.1984  lemma SEG_SUC_CONS: "ALL (m::nat) (n::nat) (l::'a::type list) x::'a::type.
  1.1985 @@ -5085,11 +5260,11 @@
  1.1986    by (import rich_list SEG_SUC_CONS)
  1.1987  
  1.1988  lemma SEG_0_SNOC: "ALL (m::nat) (l::'a::type list) x::'a::type.
  1.1989 -   m <= length l --> SEG m (0::nat) (SNOC x l) = SEG m (0::nat) l"
  1.1990 +   m <= length l --> SEG m 0 (SNOC x l) = SEG m 0 l"
  1.1991    by (import rich_list SEG_0_SNOC)
  1.1992  
  1.1993  lemma BUTLASTN_SEG: "ALL (n::nat) l::'a::type list.
  1.1994 -   n <= length l --> BUTLASTN n l = SEG (length l - n) (0::nat) l"
  1.1995 +   n <= length l --> BUTLASTN n l = SEG (length l - n) 0 l"
  1.1996    by (import rich_list BUTLASTN_SEG)
  1.1997  
  1.1998  lemma LASTN_CONS: "ALL (n::nat) l::'a::type list.
  1.1999 @@ -5160,7 +5335,7 @@
  1.2000    by (import rich_list BUTLASTN_LENGTH_CONS)
  1.2001  
  1.2002  lemma LAST_LASTN_LAST: "ALL (n::nat) l::'a::type list.
  1.2003 -   n <= length l --> (0::nat) < n --> last (LASTN n l) = last l"
  1.2004 +   n <= length l --> 0 < n --> last (LASTN n l) = last l"
  1.2005    by (import rich_list LAST_LASTN_LAST)
  1.2006  
  1.2007  lemma BUTLASTN_LASTN_NIL: "ALL (n::nat) l::'a::type list. n <= length l --> BUTLASTN n (LASTN n l) = []"
  1.2008 @@ -5176,10 +5351,10 @@
  1.2009     BUTLASTN m (LASTN n l) = LASTN (n - m) (BUTLASTN m l)"
  1.2010    by (import rich_list BUTLASTN_LASTN)
  1.2011  
  1.2012 -lemma LASTN_1: "ALL l::'a::type list. l ~= [] --> LASTN (1::nat) l = [last l]"
  1.2013 +lemma LASTN_1: "ALL l::'a::type list. l ~= [] --> LASTN 1 l = [last l]"
  1.2014    by (import rich_list LASTN_1)
  1.2015  
  1.2016 -lemma BUTLASTN_1: "ALL l::'a::type list. l ~= [] --> BUTLASTN (1::nat) l = butlast l"
  1.2017 +lemma BUTLASTN_1: "ALL l::'a::type list. l ~= [] --> BUTLASTN 1 l = butlast l"
  1.2018    by (import rich_list BUTLASTN_1)
  1.2019  
  1.2020  lemma BUTLASTN_APPEND1: "ALL (l2::'a::type list) n::nat.
  1.2021 @@ -5292,8 +5467,7 @@
  1.2022     n <= length l --> LASTN n l = SEG n (length l - n) l"
  1.2023    by (import rich_list LASTN_SEG)
  1.2024  
  1.2025 -lemma FIRSTN_SEG: "ALL (n::nat) l::'a::type list.
  1.2026 -   n <= length l --> FIRSTN n l = SEG n (0::nat) l"
  1.2027 +lemma FIRSTN_SEG: "ALL (n::nat) l::'a::type list. n <= length l --> FIRSTN n l = SEG n 0 l"
  1.2028    by (import rich_list FIRSTN_SEG)
  1.2029  
  1.2030  lemma BUTFIRSTN_SEG: "ALL (n::nat) l::'a::type list.
  1.2031 @@ -5331,11 +5505,10 @@
  1.2032  lemma SEG_APPEND: "ALL (m::nat) (l1::'a::type list) (n::nat) l2::'a::type list.
  1.2033     m < length l1 & length l1 <= n + m & n + m <= length l1 + length l2 -->
  1.2034     SEG n m (l1 @ l2) =
  1.2035 -   SEG (length l1 - m) m l1 @ SEG (n + m - length l1) (0::nat) l2"
  1.2036 +   SEG (length l1 - m) m l1 @ SEG (n + m - length l1) 0 l2"
  1.2037    by (import rich_list SEG_APPEND)
  1.2038  
  1.2039 -lemma SEG_LENGTH_SNOC: "ALL (x::'a::type list) xa::'a::type.
  1.2040 -   SEG (1::nat) (length x) (SNOC xa x) = [xa]"
  1.2041 +lemma SEG_LENGTH_SNOC: "ALL (x::'a::type list) xa::'a::type. SEG 1 (length x) (SNOC xa x) = [xa]"
  1.2042    by (import rich_list SEG_LENGTH_SNOC)
  1.2043  
  1.2044  lemma SEG_SNOC: "ALL (n::nat) (m::nat) l::'a::type list.
  1.2045 @@ -5343,7 +5516,7 @@
  1.2046    by (import rich_list SEG_SNOC)
  1.2047  
  1.2048  lemma ELL_SEG: "ALL (n::nat) l::'a::type list.
  1.2049 -   n < length l --> ELL n l = hd (SEG (1::nat) (PRE (length l - n)) l)"
  1.2050 +   n < length l --> ELL n l = hd (SEG 1 (PRE (length l - n)) l)"
  1.2051    by (import rich_list ELL_SEG)
  1.2052  
  1.2053  lemma SNOC_FOLDR: "ALL (x::'a::type) l::'a::type list. SNOC x l = foldr op # l [x]"
  1.2054 @@ -5405,13 +5578,13 @@
  1.2055     (ALL (e::'a::type) l::'a::type list. foldl f e (rev l) = foldl f e l)"
  1.2056    by (import rich_list COMM_ASSOC_FOLDL_REVERSE)
  1.2057  
  1.2058 -lemma ELL_LAST: "ALL l::'a::type list. ~ null l --> ELL (0::nat) l = last l"
  1.2059 +lemma ELL_LAST: "ALL l::'a::type list. ~ null l --> ELL 0 l = last l"
  1.2060    by (import rich_list ELL_LAST)
  1.2061  
  1.2062 -lemma ELL_0_SNOC: "ALL (l::'a::type list) x::'a::type. ELL (0::nat) (SNOC x l) = x"
  1.2063 +lemma ELL_0_SNOC: "ALL (l::'a::type list) x::'a::type. ELL 0 (SNOC x l) = x"
  1.2064    by (import rich_list ELL_0_SNOC)
  1.2065  
  1.2066 -lemma ELL_SNOC: "ALL n>0::nat.
  1.2067 +lemma ELL_SNOC: "ALL n>0.
  1.2068     ALL (x::'a::type) l::'a::type list. ELL n (SNOC x l) = ELL (PRE n) l"
  1.2069    by (import rich_list ELL_SNOC)
  1.2070  
  1.2071 @@ -5642,12 +5815,10 @@
  1.2072     (ALL f::'a::type => 'b::type. EL n (map f l) = f (EL n l))"
  1.2073    by (import rich_list EL_MAP)
  1.2074  
  1.2075 -lemma EL_CONS: "ALL n>0::nat.
  1.2076 -   ALL (x::'a::type) l::'a::type list. EL n (x # l) = EL (PRE n) l"
  1.2077 +lemma EL_CONS: "ALL n>0. ALL (x::'a::type) l::'a::type list. EL n (x # l) = EL (PRE n) l"
  1.2078    by (import rich_list EL_CONS)
  1.2079  
  1.2080 -lemma EL_SEG: "ALL (n::nat) l::'a::type list.
  1.2081 -   n < length l --> EL n l = hd (SEG (1::nat) n l)"
  1.2082 +lemma EL_SEG: "ALL (n::nat) l::'a::type list. n < length l --> EL n l = hd (SEG 1 n l)"
  1.2083    by (import rich_list EL_SEG)
  1.2084  
  1.2085  lemma EL_IS_EL: "ALL (n::nat) l::'a::type list. n < length l --> EL n l mem l"
  1.2086 @@ -5726,7 +5897,7 @@
  1.2087  lemma LENGTH_REPLICATE: "ALL (n::nat) x::'a::type. length (REPLICATE n x) = n"
  1.2088    by (import rich_list LENGTH_REPLICATE)
  1.2089  
  1.2090 -lemma IS_EL_REPLICATE: "ALL n>0::nat. ALL x::'a::type. x mem REPLICATE n x"
  1.2091 +lemma IS_EL_REPLICATE: "ALL n>0. ALL x::'a::type. x mem REPLICATE n x"
  1.2092    by (import rich_list IS_EL_REPLICATE)
  1.2093  
  1.2094  lemma ALL_EL_REPLICATE: "ALL (x::'a::type) n::nat. list_all (op = x) (REPLICATE n x)"
  1.2095 @@ -5749,7 +5920,7 @@
  1.2096  ;setup_theory state_transformer
  1.2097  
  1.2098  constdefs
  1.2099 -  UNIT :: "'b::type => 'a::type => 'b::type * 'a::type" 
  1.2100 +  UNIT :: "'b => 'a => 'b * 'a" 
  1.2101    "(op ==::('b::type => 'a::type => 'b::type * 'a::type)
  1.2102          => ('b::type => 'a::type => 'b::type * 'a::type) => prop)
  1.2103   (UNIT::'b::type => 'a::type => 'b::type * 'a::type)
  1.2104 @@ -5759,9 +5930,7 @@
  1.2105    by (import state_transformer UNIT_DEF)
  1.2106  
  1.2107  constdefs
  1.2108 -  BIND :: "('a::type => 'b::type * 'a::type)
  1.2109 -=> ('b::type => 'a::type => 'c::type * 'a::type)
  1.2110 -   => 'a::type => 'c::type * 'a::type" 
  1.2111 +  BIND :: "('a => 'b * 'a) => ('b => 'a => 'c * 'a) => 'a => 'c * 'a" 
  1.2112    "(op ==::(('a::type => 'b::type * 'a::type)
  1.2113           => ('b::type => 'a::type => 'c::type * 'a::type)
  1.2114              => 'a::type => 'c::type * 'a::type)
  1.2115 @@ -5802,8 +5971,7 @@
  1.2116    by (import state_transformer BIND_DEF)
  1.2117  
  1.2118  constdefs
  1.2119 -  MMAP :: "('c::type => 'b::type)
  1.2120 -=> ('a::type => 'c::type * 'a::type) => 'a::type => 'b::type * 'a::type" 
  1.2121 +  MMAP :: "('c => 'b) => ('a => 'c * 'a) => 'a => 'b * 'a" 
  1.2122    "MMAP ==
  1.2123  %(f::'c::type => 'b::type) m::'a::type => 'c::type * 'a::type.
  1.2124     BIND m (UNIT o f)"
  1.2125 @@ -5813,8 +5981,7 @@
  1.2126    by (import state_transformer MMAP_DEF)
  1.2127  
  1.2128  constdefs
  1.2129 -  JOIN :: "('a::type => ('a::type => 'b::type * 'a::type) * 'a::type)
  1.2130 -=> 'a::type => 'b::type * 'a::type" 
  1.2131 +  JOIN :: "('a => ('a => 'b * 'a) * 'a) => 'a => 'b * 'a" 
  1.2132    "JOIN ==
  1.2133  %z::'a::type => ('a::type => 'b::type * 'a::type) * 'a::type. BIND z I"
  1.2134  
     2.1 --- a/src/HOL/Import/HOL/HOL4Prob.thy	Mon Sep 26 15:56:28 2005 +0200
     2.2 +++ b/src/HOL/Import/HOL/HOL4Prob.thy	Mon Sep 26 16:10:19 2005 +0200
     2.3 @@ -9,14 +9,11 @@
     2.4     f = (%b::bool. True) | f = (%b::bool. b) | f = Not"
     2.5    by (import prob_extra BOOL_BOOL_CASES_THM)
     2.6  
     2.7 -lemma EVEN_ODD_BASIC: "EVEN (0::nat) &
     2.8 -~ EVEN (1::nat) &
     2.9 -EVEN (2::nat) & ~ ODD (0::nat) & ODD (1::nat) & ~ ODD (2::nat)"
    2.10 +lemma EVEN_ODD_BASIC: "EVEN 0 & ~ EVEN 1 & EVEN 2 & ~ ODD 0 & ODD 1 & ~ ODD 2"
    2.11    by (import prob_extra EVEN_ODD_BASIC)
    2.12  
    2.13  lemma EVEN_ODD_EXISTS_EQ: "ALL n::nat.
    2.14 -   EVEN n = (EX m::nat. n = (2::nat) * m) &
    2.15 -   ODD n = (EX m::nat. n = Suc ((2::nat) * m))"
    2.16 +   EVEN n = (EX m::nat. n = 2 * m) & ODD n = (EX m::nat. n = Suc (2 * m))"
    2.17    by (import prob_extra EVEN_ODD_EXISTS_EQ)
    2.18  
    2.19  lemma DIV_THEN_MULT: "ALL (p::nat) q::nat. Suc q * (p div Suc q) <= p"
    2.20 @@ -60,20 +57,42 @@
    2.21                            (bit.B0::bit)))))))))"
    2.22    by (import prob_extra DIV_TWO_UNIQUE)
    2.23  
    2.24 -lemma DIVISION_TWO: "ALL n::nat.
    2.25 -   n = (2::nat) * (n div (2::nat)) + n mod (2::nat) &
    2.26 -   (n mod (2::nat) = (0::nat) | n mod (2::nat) = (1::nat))"
    2.27 +lemma DIVISION_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2 & (n mod 2 = 0 | n mod 2 = 1)"
    2.28    by (import prob_extra DIVISION_TWO)
    2.29  
    2.30 -lemma DIV_TWO: "ALL n::nat. n = (2::nat) * (n div (2::nat)) + n mod (2::nat)"
    2.31 +lemma DIV_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2"
    2.32    by (import prob_extra DIV_TWO)
    2.33  
    2.34 -lemma MOD_TWO: "(ALL (n::nat).
    2.35 -    ((n mod (2::nat)) = (if (EVEN n) then (0::nat) else (1::nat))))"
    2.36 +lemma MOD_TWO: "ALL n::nat. n mod 2 = (if EVEN n then 0 else 1)"
    2.37    by (import prob_extra MOD_TWO)
    2.38  
    2.39 -lemma DIV_TWO_BASIC: "(0::nat) div (2::nat) = (0::nat) &
    2.40 -(1::nat) div (2::nat) = (0::nat) & (2::nat) div (2::nat) = (1::nat)"
    2.41 +lemma DIV_TWO_BASIC: "(op &::bool => bool => bool)
    2.42 + ((op =::nat => nat => bool)
    2.43 +   ((op div::nat => nat => nat) (0::nat)
    2.44 +     ((number_of::bin => nat)
    2.45 +       ((op BIT::bin => bit => bin)
    2.46 +         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.47 +         (bit.B0::bit))))
    2.48 +   (0::nat))
    2.49 + ((op &::bool => bool => bool)
    2.50 +   ((op =::nat => nat => bool)
    2.51 +     ((op div::nat => nat => nat) (1::nat)
    2.52 +       ((number_of::bin => nat)
    2.53 +         ((op BIT::bin => bit => bin)
    2.54 +           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.55 +           (bit.B0::bit))))
    2.56 +     (0::nat))
    2.57 +   ((op =::nat => nat => bool)
    2.58 +     ((op div::nat => nat => nat)
    2.59 +       ((number_of::bin => nat)
    2.60 +         ((op BIT::bin => bit => bin)
    2.61 +           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.62 +           (bit.B0::bit)))
    2.63 +       ((number_of::bin => nat)
    2.64 +         ((op BIT::bin => bit => bin)
    2.65 +           ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.66 +           (bit.B0::bit))))
    2.67 +     (1::nat)))"
    2.68    by (import prob_extra DIV_TWO_BASIC)
    2.69  
    2.70  lemma DIV_TWO_MONO: "(All::(nat => bool) => bool)
    2.71 @@ -119,18 +138,35 @@
    2.72               ((op <::nat => nat => bool) m n))))"
    2.73    by (import prob_extra DIV_TWO_MONO_EVEN)
    2.74  
    2.75 -lemma DIV_TWO_CANCEL: "ALL n::nat.
    2.76 -   (2::nat) * n div (2::nat) = n & Suc ((2::nat) * n) div (2::nat) = n"
    2.77 +lemma DIV_TWO_CANCEL: "ALL n::nat. 2 * n div 2 = n & Suc (2 * n) div 2 = n"
    2.78    by (import prob_extra DIV_TWO_CANCEL)
    2.79  
    2.80 -lemma EXP_DIV_TWO: "ALL n::nat. (2::nat) ^ Suc n div (2::nat) = (2::nat) ^ n"
    2.81 +lemma EXP_DIV_TWO: "(All::(nat => bool) => bool)
    2.82 + (%n::nat.
    2.83 +     (op =::nat => nat => bool)
    2.84 +      ((op div::nat => nat => nat)
    2.85 +        ((op ^::nat => nat => nat)
    2.86 +          ((number_of::bin => nat)
    2.87 +            ((op BIT::bin => bit => bin)
    2.88 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.89 +              (bit.B0::bit)))
    2.90 +          ((Suc::nat => nat) n))
    2.91 +        ((number_of::bin => nat)
    2.92 +          ((op BIT::bin => bit => bin)
    2.93 +            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.94 +            (bit.B0::bit))))
    2.95 +      ((op ^::nat => nat => nat)
    2.96 +        ((number_of::bin => nat)
    2.97 +          ((op BIT::bin => bit => bin)
    2.98 +            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    2.99 +            (bit.B0::bit)))
   2.100 +        n))"
   2.101    by (import prob_extra EXP_DIV_TWO)
   2.102  
   2.103 -lemma EVEN_EXP_TWO: "ALL n::nat. EVEN ((2::nat) ^ n) = (n ~= (0::nat))"
   2.104 +lemma EVEN_EXP_TWO: "ALL n::nat. EVEN (2 ^ n) = (n ~= 0)"
   2.105    by (import prob_extra EVEN_EXP_TWO)
   2.106  
   2.107 -lemma DIV_TWO_EXP: "ALL (n::nat) k::nat.
   2.108 -   (k div (2::nat) < (2::nat) ^ n) = (k < (2::nat) ^ Suc n)"
   2.109 +lemma DIV_TWO_EXP: "ALL (n::nat) k::nat. (k div 2 < 2 ^ n) = (k < 2 ^ Suc n)"
   2.110    by (import prob_extra DIV_TWO_EXP)
   2.111  
   2.112  consts
   2.113 @@ -195,13 +231,38 @@
   2.114               z)))"
   2.115    by (import prob_extra REAL_INF_MIN)
   2.116  
   2.117 -lemma HALF_POS: "(0::real) < (1::real) / (2::real)"
   2.118 +lemma HALF_POS: "(op <::real => real => bool) (0::real)
   2.119 + ((op /::real => real => real) (1::real)
   2.120 +   ((number_of::bin => real)
   2.121 +     ((op BIT::bin => bit => bin)
   2.122 +       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.123 +       (bit.B0::bit))))"
   2.124    by (import prob_extra HALF_POS)
   2.125  
   2.126 -lemma HALF_CANCEL: "(2::real) * ((1::real) / (2::real)) = (1::real)"
   2.127 +lemma HALF_CANCEL: "(op =::real => real => bool)
   2.128 + ((op *::real => real => real)
   2.129 +   ((number_of::bin => real)
   2.130 +     ((op BIT::bin => bit => bin)
   2.131 +       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.132 +       (bit.B0::bit)))
   2.133 +   ((op /::real => real => real) (1::real)
   2.134 +     ((number_of::bin => real)
   2.135 +       ((op BIT::bin => bit => bin)
   2.136 +         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.137 +         (bit.B0::bit)))))
   2.138 + (1::real)"
   2.139    by (import prob_extra HALF_CANCEL)
   2.140  
   2.141 -lemma POW_HALF_POS: "ALL n::nat. (0::real) < ((1::real) / (2::real)) ^ n"
   2.142 +lemma POW_HALF_POS: "(All::(nat => bool) => bool)
   2.143 + (%n::nat.
   2.144 +     (op <::real => real => bool) (0::real)
   2.145 +      ((op ^::real => nat => real)
   2.146 +        ((op /::real => real => real) (1::real)
   2.147 +          ((number_of::bin => real)
   2.148 +            ((op BIT::bin => bit => bin)
   2.149 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.150 +              (bit.B0::bit))))
   2.151 +        n))"
   2.152    by (import prob_extra POW_HALF_POS)
   2.153  
   2.154  lemma POW_HALF_MONO: "(All::(nat => bool) => bool)
   2.155 @@ -228,11 +289,32 @@
   2.156                 m))))"
   2.157    by (import prob_extra POW_HALF_MONO)
   2.158  
   2.159 -lemma POW_HALF_TWICE: "ALL n::nat.
   2.160 -   ((1::real) / (2::real)) ^ n = (2::real) * ((1::real) / (2::real)) ^ Suc n"
   2.161 +lemma POW_HALF_TWICE: "(All::(nat => bool) => bool)
   2.162 + (%n::nat.
   2.163 +     (op =::real => real => bool)
   2.164 +      ((op ^::real => nat => real)
   2.165 +        ((op /::real => real => real) (1::real)
   2.166 +          ((number_of::bin => real)
   2.167 +            ((op BIT::bin => bit => bin)
   2.168 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.169 +              (bit.B0::bit))))
   2.170 +        n)
   2.171 +      ((op *::real => real => real)
   2.172 +        ((number_of::bin => real)
   2.173 +          ((op BIT::bin => bit => bin)
   2.174 +            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.175 +            (bit.B0::bit)))
   2.176 +        ((op ^::real => nat => real)
   2.177 +          ((op /::real => real => real) (1::real)
   2.178 +            ((number_of::bin => real)
   2.179 +              ((op BIT::bin => bit => bin)
   2.180 +                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.181 +                  (bit.B1::bit))
   2.182 +                (bit.B0::bit))))
   2.183 +          ((Suc::nat => nat) n))))"
   2.184    by (import prob_extra POW_HALF_TWICE)
   2.185  
   2.186 -lemma X_HALF_HALF: "ALL x::real. (1::real) / (2::real) * x + (1::real) / (2::real) * x = x"
   2.187 +lemma X_HALF_HALF: "ALL x::real. 1 / 2 * x + 1 / 2 * x = x"
   2.188    by (import prob_extra X_HALF_HALF)
   2.189  
   2.190  lemma REAL_SUP_LE_X: "(All::((real => bool) => bool) => bool)
   2.191 @@ -271,27 +353,60 @@
   2.192    by (import prob_extra REAL_X_LE_SUP)
   2.193  
   2.194  lemma ABS_BETWEEN_LE: "ALL (x::real) (y::real) d::real.
   2.195 -   ((0::real) <= d & x - d <= y & y <= x + d) = (abs (y - x) <= d)"
   2.196 +   (0 <= d & x - d <= y & y <= x + d) = (abs (y - x) <= d)"
   2.197    by (import prob_extra ABS_BETWEEN_LE)
   2.198  
   2.199 -lemma ONE_MINUS_HALF: "(1::real) - (1::real) / (2::real) = (1::real) / (2::real)"
   2.200 +lemma ONE_MINUS_HALF: "(op =::real => real => bool)
   2.201 + ((op -::real => real => real) (1::real)
   2.202 +   ((op /::real => real => real) (1::real)
   2.203 +     ((number_of::bin => real)
   2.204 +       ((op BIT::bin => bit => bin)
   2.205 +         ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.206 +         (bit.B0::bit)))))
   2.207 + ((op /::real => real => real) (1::real)
   2.208 +   ((number_of::bin => real)
   2.209 +     ((op BIT::bin => bit => bin)
   2.210 +       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.211 +       (bit.B0::bit))))"
   2.212    by (import prob_extra ONE_MINUS_HALF)
   2.213  
   2.214 -lemma HALF_LT_1: "(1::real) / (2::real) < (1::real)"
   2.215 +lemma HALF_LT_1: "(op <::real => real => bool)
   2.216 + ((op /::real => real => real) (1::real)
   2.217 +   ((number_of::bin => real)
   2.218 +     ((op BIT::bin => bit => bin)
   2.219 +       ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.220 +       (bit.B0::bit))))
   2.221 + (1::real)"
   2.222    by (import prob_extra HALF_LT_1)
   2.223  
   2.224 -lemma POW_HALF_EXP: "ALL n::nat. ((1::real) / (2::real)) ^ n = inverse (real ((2::nat) ^ n))"
   2.225 +lemma POW_HALF_EXP: "(All::(nat => bool) => bool)
   2.226 + (%n::nat.
   2.227 +     (op =::real => real => bool)
   2.228 +      ((op ^::real => nat => real)
   2.229 +        ((op /::real => real => real) (1::real)
   2.230 +          ((number_of::bin => real)
   2.231 +            ((op BIT::bin => bit => bin)
   2.232 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.233 +              (bit.B0::bit))))
   2.234 +        n)
   2.235 +      ((inverse::real => real)
   2.236 +        ((real::nat => real)
   2.237 +          ((op ^::nat => nat => nat)
   2.238 +            ((number_of::bin => nat)
   2.239 +              ((op BIT::bin => bit => bin)
   2.240 +                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.241 +                  (bit.B1::bit))
   2.242 +                (bit.B0::bit)))
   2.243 +            n))))"
   2.244    by (import prob_extra POW_HALF_EXP)
   2.245  
   2.246 -lemma INV_SUC_POS: "ALL n::nat. (0::real) < (1::real) / real (Suc n)"
   2.247 +lemma INV_SUC_POS: "ALL n::nat. 0 < 1 / real (Suc n)"
   2.248    by (import prob_extra INV_SUC_POS)
   2.249  
   2.250 -lemma INV_SUC_MAX: "ALL x::nat. (1::real) / real (Suc x) <= (1::real)"
   2.251 +lemma INV_SUC_MAX: "ALL x::nat. 1 / real (Suc x) <= 1"
   2.252    by (import prob_extra INV_SUC_MAX)
   2.253  
   2.254 -lemma INV_SUC: "ALL n::nat.
   2.255 -   (0::real) < (1::real) / real (Suc n) &
   2.256 -   (1::real) / real (Suc n) <= (1::real)"
   2.257 +lemma INV_SUC: "ALL n::nat. 0 < 1 / real (Suc n) & 1 / real (Suc n) <= 1"
   2.258    by (import prob_extra INV_SUC)
   2.259  
   2.260  lemma ABS_UNIT_INTERVAL: "(All::(real => bool) => bool)
   2.261 @@ -894,12 +1009,10 @@
   2.262  
   2.263  defs
   2.264    alg_longest_primdef: "alg_longest ==
   2.265 -FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t)
   2.266 - (0::nat)"
   2.267 +FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
   2.268  
   2.269  lemma alg_longest_def: "alg_longest =
   2.270 -FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t)
   2.271 - (0::nat)"
   2.272 +FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
   2.273    by (import prob_canon alg_longest_def)
   2.274  
   2.275  consts
   2.276 @@ -1948,9 +2061,9 @@
   2.277    SHD :: "(nat => bool) => bool" 
   2.278  
   2.279  defs
   2.280 -  SHD_primdef: "SHD == %f::nat => bool. f (0::nat)"
   2.281 -
   2.282 -lemma SHD_def: "ALL f::nat => bool. SHD f = f (0::nat)"
   2.283 +  SHD_primdef: "SHD == %f::nat => bool. f 0"
   2.284 +
   2.285 +lemma SHD_def: "ALL f::nat => bool. SHD f = f 0"
   2.286    by (import boolean_sequence SHD_def)
   2.287  
   2.288  consts
   2.289 @@ -1965,7 +2078,7 @@
   2.290  consts
   2.291    SCONS :: "bool => (nat => bool) => nat => bool" 
   2.292  
   2.293 -specification (SCONS_primdef: SCONS) SCONS_def: "(ALL (h::bool) t::nat => bool. SCONS h t (0::nat) = h) &
   2.294 +specification (SCONS_primdef: SCONS) SCONS_def: "(ALL (h::bool) t::nat => bool. SCONS h t 0 = h) &
   2.295  (ALL (h::bool) (t::nat => bool) n::nat. SCONS h t (Suc n) = t n)"
   2.296    by (import boolean_sequence SCONS_def)
   2.297  
   2.298 @@ -1990,14 +2103,14 @@
   2.299  consts
   2.300    STAKE :: "nat => (nat => bool) => bool list" 
   2.301  
   2.302 -specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s::nat => bool. STAKE (0::nat) s = []) &
   2.303 +specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s::nat => bool. STAKE 0 s = []) &
   2.304  (ALL (n::nat) s::nat => bool. STAKE (Suc n) s = SHD s # STAKE n (STL s))"
   2.305    by (import boolean_sequence STAKE_def)
   2.306  
   2.307  consts
   2.308    SDROP :: "nat => (nat => bool) => nat => bool" 
   2.309  
   2.310 -specification (SDROP_primdef: SDROP) SDROP_def: "SDROP (0::nat) = I & (ALL n::nat. SDROP (Suc n) = SDROP n o STL)"
   2.311 +specification (SDROP_primdef: SDROP) SDROP_def: "SDROP 0 = I & (ALL n::nat. SDROP (Suc n) = SDROP n o STL)"
   2.312    by (import boolean_sequence SDROP_def)
   2.313  
   2.314  lemma SCONS_SURJ: "ALL x::nat => bool. EX (xa::bool) t::nat => bool. x = SCONS xa t"
   2.315 @@ -2271,10 +2384,9 @@
   2.316  consts
   2.317    alg_measure :: "bool list list => real" 
   2.318  
   2.319 -specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = (0::real) &
   2.320 +specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = 0 &
   2.321  (ALL (l::bool list) rest::bool list list.
   2.322 -    alg_measure (l # rest) =
   2.323 -    ((1::real) / (2::real)) ^ length l + alg_measure rest)"
   2.324 +    alg_measure (l # rest) = (1 / 2) ^ length l + alg_measure rest)"
   2.325    by (import prob alg_measure_def)
   2.326  
   2.327  consts
   2.328 @@ -2311,18 +2423,42 @@
   2.329                algebra_measure b = r & SUBSET (algebra_embed b) s)"
   2.330    by (import prob prob_def)
   2.331  
   2.332 -lemma ALG_TWINS_MEASURE: "ALL l::bool list.
   2.333 -   ((1::real) / (2::real)) ^ length (SNOC True l) +
   2.334 -   ((1::real) / (2::real)) ^ length (SNOC False l) =
   2.335 -   ((1::real) / (2::real)) ^ length l"
   2.336 +lemma ALG_TWINS_MEASURE: "(All::(bool list => bool) => bool)
   2.337 + (%l::bool list.
   2.338 +     (op =::real => real => bool)
   2.339 +      ((op +::real => real => real)
   2.340 +        ((op ^::real => nat => real)
   2.341 +          ((op /::real => real => real) (1::real)
   2.342 +            ((number_of::bin => real)
   2.343 +              ((op BIT::bin => bit => bin)
   2.344 +                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.345 +                  (bit.B1::bit))
   2.346 +                (bit.B0::bit))))
   2.347 +          ((size::bool list => nat)
   2.348 +            ((SNOC::bool => bool list => bool list) (True::bool) l)))
   2.349 +        ((op ^::real => nat => real)
   2.350 +          ((op /::real => real => real) (1::real)
   2.351 +            ((number_of::bin => real)
   2.352 +              ((op BIT::bin => bit => bin)
   2.353 +                ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.354 +                  (bit.B1::bit))
   2.355 +                (bit.B0::bit))))
   2.356 +          ((size::bool list => nat)
   2.357 +            ((SNOC::bool => bool list => bool list) (False::bool) l))))
   2.358 +      ((op ^::real => nat => real)
   2.359 +        ((op /::real => real => real) (1::real)
   2.360 +          ((number_of::bin => real)
   2.361 +            ((op BIT::bin => bit => bin)
   2.362 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   2.363 +              (bit.B0::bit))))
   2.364 +        ((size::bool list => nat) l)))"
   2.365    by (import prob ALG_TWINS_MEASURE)
   2.366  
   2.367 -lemma ALG_MEASURE_BASIC: "alg_measure [] = (0::real) &
   2.368 -alg_measure [[]] = (1::real) &
   2.369 -(ALL b::bool. alg_measure [[b]] = (1::real) / (2::real))"
   2.370 +lemma ALG_MEASURE_BASIC: "alg_measure [] = 0 &
   2.371 +alg_measure [[]] = 1 & (ALL b::bool. alg_measure [[b]] = 1 / 2)"
   2.372    by (import prob ALG_MEASURE_BASIC)
   2.373  
   2.374 -lemma ALG_MEASURE_POS: "ALL l::bool list list. (0::real) <= alg_measure l"
   2.375 +lemma ALG_MEASURE_POS: "ALL l::bool list list. 0 <= alg_measure l"
   2.376    by (import prob ALG_MEASURE_POS)
   2.377  
   2.378  lemma ALG_MEASURE_APPEND: "ALL (l1::bool list list) l2::bool list list.
   2.379 @@ -2330,7 +2466,7 @@
   2.380    by (import prob ALG_MEASURE_APPEND)
   2.381  
   2.382  lemma ALG_MEASURE_TLS: "ALL (l::bool list list) b::bool.
   2.383 -   (2::real) * alg_measure (map (op # b) l) = alg_measure l"
   2.384 +   2 * alg_measure (map (op # b) l) = alg_measure l"
   2.385    by (import prob ALG_MEASURE_TLS)
   2.386  
   2.387  lemma ALG_CANON_PREFS_MONO: "ALL (l::bool list) b::bool list list.
   2.388 @@ -2357,9 +2493,8 @@
   2.389  lemma ALGEBRA_MEASURE_DEF_ALT: "ALL l::bool list list. algebra_measure l = alg_measure (alg_canon l)"
   2.390    by (import prob ALGEBRA_MEASURE_DEF_ALT)
   2.391  
   2.392 -lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = (0::real) &
   2.393 -algebra_measure [[]] = (1::real) &
   2.394 -(ALL b::bool. algebra_measure [[b]] = (1::real) / (2::real))"
   2.395 +lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = 0 &
   2.396 +algebra_measure [[]] = 1 & (ALL b::bool. algebra_measure [[b]] = 1 / 2)"
   2.397    by (import prob ALGEBRA_MEASURE_BASIC)
   2.398  
   2.399  lemma ALGEBRA_CANON_MEASURE_MAX: "(All::(bool list list => bool) => bool)
   2.400 @@ -2370,7 +2505,7 @@
   2.401          ((alg_measure::bool list list => real) l) (1::real)))"
   2.402    by (import prob ALGEBRA_CANON_MEASURE_MAX)
   2.403  
   2.404 -lemma ALGEBRA_MEASURE_MAX: "ALL l::bool list list. algebra_measure l <= (1::real)"
   2.405 +lemma ALGEBRA_MEASURE_MAX: "ALL l::bool list list. algebra_measure l <= 1"
   2.406    by (import prob ALGEBRA_MEASURE_MAX)
   2.407  
   2.408  lemma ALGEBRA_MEASURE_MONO_EMBED: "(All::(bool list list => bool) => bool)
   2.409 @@ -2458,9 +2593,9 @@
   2.410  lemma PROB_ALGEBRA: "ALL l::bool list list. prob (algebra_embed l) = algebra_measure l"
   2.411    by (import prob PROB_ALGEBRA)
   2.412  
   2.413 -lemma PROB_BASIC: "prob EMPTY = (0::real) &
   2.414 -prob pred_set.UNIV = (1::real) &
   2.415 -(ALL b::bool. prob (%s::nat => bool. SHD s = b) = (1::real) / (2::real))"
   2.416 +lemma PROB_BASIC: "prob EMPTY = 0 &
   2.417 +prob pred_set.UNIV = 1 &
   2.418 +(ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2)"
   2.419    by (import prob PROB_BASIC)
   2.420  
   2.421  lemma PROB_ADDITIVE: "(All::(((nat => bool) => bool) => bool) => bool)
   2.422 @@ -2578,7 +2713,7 @@
   2.423               ((prob::((nat => bool) => bool) => real) t))))"
   2.424    by (import prob PROB_SUBSET_MONO)
   2.425  
   2.426 -lemma PROB_ALG: "ALL x::bool list. prob (alg_embed x) = ((1::real) / (2::real)) ^ length x"
   2.427 +lemma PROB_ALG: "ALL x::bool list. prob (alg_embed x) = (1 / 2) ^ length x"
   2.428    by (import prob PROB_ALG)
   2.429  
   2.430  lemma PROB_STL: "(All::(((nat => bool) => bool) => bool) => bool)
   2.431 @@ -2662,26 +2797,25 @@
   2.432                 ((prob::((nat => bool) => bool) => real) p)))))"
   2.433    by (import prob PROB_INTER_SHD)
   2.434  
   2.435 -lemma ALGEBRA_MEASURE_POS: "ALL l::bool list list. (0::real) <= algebra_measure l"
   2.436 +lemma ALGEBRA_MEASURE_POS: "ALL l::bool list list. 0 <= algebra_measure l"
   2.437    by (import prob ALGEBRA_MEASURE_POS)
   2.438  
   2.439 -lemma ALGEBRA_MEASURE_RANGE: "ALL l::bool list list.
   2.440 -   (0::real) <= algebra_measure l & algebra_measure l <= (1::real)"
   2.441 +lemma ALGEBRA_MEASURE_RANGE: "ALL l::bool list list. 0 <= algebra_measure l & algebra_measure l <= 1"
   2.442    by (import prob ALGEBRA_MEASURE_RANGE)
   2.443  
   2.444 -lemma PROB_POS: "ALL p::(nat => bool) => bool. (0::real) <= prob p"
   2.445 +lemma PROB_POS: "ALL p::(nat => bool) => bool. 0 <= prob p"
   2.446    by (import prob PROB_POS)
   2.447  
   2.448 -lemma PROB_MAX: "ALL p::(nat => bool) => bool. prob p <= (1::real)"
   2.449 +lemma PROB_MAX: "ALL p::(nat => bool) => bool. prob p <= 1"
   2.450    by (import prob PROB_MAX)
   2.451  
   2.452 -lemma PROB_RANGE: "ALL p::(nat => bool) => bool. (0::real) <= prob p & prob p <= (1::real)"
   2.453 +lemma PROB_RANGE: "ALL p::(nat => bool) => bool. 0 <= prob p & prob p <= 1"
   2.454    by (import prob PROB_RANGE)
   2.455  
   2.456  lemma ABS_PROB: "ALL p::(nat => bool) => bool. abs (prob p) = prob p"
   2.457    by (import prob ABS_PROB)
   2.458  
   2.459 -lemma PROB_SHD: "ALL b::bool. prob (%s::nat => bool. SHD s = b) = (1::real) / (2::real)"
   2.460 +lemma PROB_SHD: "ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2"
   2.461    by (import prob PROB_SHD)
   2.462  
   2.463  lemma PROB_COMPL_LE1: "(All::(((nat => bool) => bool) => bool) => bool)
   2.464 @@ -2719,11 +2853,10 @@
   2.465  
   2.466  defs
   2.467    pseudo_linear_tl_primdef: "pseudo_linear_tl ==
   2.468 -%(a::nat) (b::nat) (n::nat) x::nat.
   2.469 -   (a * x + b) mod ((2::nat) * n + (1::nat))"
   2.470 +%(a::nat) (b::nat) (n::nat) x::nat. (a * x + b) mod (2 * n + 1)"
   2.471  
   2.472  lemma pseudo_linear_tl_def: "ALL (a::nat) (b::nat) (n::nat) x::nat.
   2.473 -   pseudo_linear_tl a b n x = (a * x + b) mod ((2::nat) * n + (1::nat))"
   2.474 +   pseudo_linear_tl a b n x = (a * x + b) mod (2 * n + 1)"
   2.475    by (import prob_pseudo pseudo_linear_tl_def)
   2.476  
   2.477  lemma PSEUDO_LINEAR1_EXECUTE: "EX x::nat => nat => bool.
   2.478 @@ -2828,7 +2961,7 @@
   2.479    by (import prob_indep alg_cover_def)
   2.480  
   2.481  consts
   2.482 -  indep :: "((nat => bool) => 'a::type * (nat => bool)) => bool" 
   2.483 +  indep :: "((nat => bool) => 'a * (nat => bool)) => bool" 
   2.484  
   2.485  defs
   2.486    indep_primdef: "indep ==
   2.487 @@ -3520,21 +3653,19 @@
   2.488  defs
   2.489    unif_bound_primdef: "unif_bound ==
   2.490  WFREC
   2.491 - (SOME R::nat => nat => bool.
   2.492 -     WF R & (ALL v::nat. R (Suc v div (2::nat)) (Suc v)))
   2.493 + (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
   2.494   (%unif_bound::nat => nat.
   2.495 -     nat_case (0::nat) (%v1::nat. Suc (unif_bound (Suc v1 div (2::nat)))))"
   2.496 +     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
   2.497  
   2.498  lemma unif_bound_primitive_def: "unif_bound =
   2.499  WFREC
   2.500 - (SOME R::nat => nat => bool.
   2.501 -     WF R & (ALL v::nat. R (Suc v div (2::nat)) (Suc v)))
   2.502 + (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
   2.503   (%unif_bound::nat => nat.
   2.504 -     nat_case (0::nat) (%v1::nat. Suc (unif_bound (Suc v1 div (2::nat)))))"
   2.505 +     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
   2.506    by (import prob_uniform unif_bound_primitive_def)
   2.507  
   2.508 -lemma unif_bound_def: "unif_bound (0::nat) = (0::nat) &
   2.509 -unif_bound (Suc (v::nat)) = Suc (unif_bound (Suc v div (2::nat)))"
   2.510 +lemma unif_bound_def: "unif_bound 0 = 0 &
   2.511 +unif_bound (Suc (v::nat)) = Suc (unif_bound (Suc v div 2))"
   2.512    by (import prob_uniform unif_bound_def)
   2.513  
   2.514  lemma unif_bound_ind: "(All::((nat => bool) => bool) => bool)
   2.515 @@ -3559,30 +3690,24 @@
   2.516    "unif_tupled ==
   2.517  WFREC
   2.518   (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
   2.519 -     WF R &
   2.520 -     (ALL (s::nat => bool) v2::nat. R (Suc v2 div (2::nat), s) (Suc v2, s)))
   2.521 +     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
   2.522   (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
   2.523       v1::nat => bool).
   2.524 -     case v of 0 => (0::nat, v1)
   2.525 +     case v of 0 => (0, v1)
   2.526       | Suc (v3::nat) =>
   2.527 -         let (m::nat, s'::nat => bool) =
   2.528 -               unif_tupled (Suc v3 div (2::nat), v1)
   2.529 -         in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m,
   2.530 -             STL s'))"
   2.531 +         let (m::nat, s'::nat => bool) = unif_tupled (Suc v3 div 2, v1)
   2.532 +         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
   2.533  
   2.534  lemma unif_tupled_primitive_def: "unif_tupled =
   2.535  WFREC
   2.536   (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
   2.537 -     WF R &
   2.538 -     (ALL (s::nat => bool) v2::nat. R (Suc v2 div (2::nat), s) (Suc v2, s)))
   2.539 +     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
   2.540   (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
   2.541       v1::nat => bool).
   2.542 -     case v of 0 => (0::nat, v1)
   2.543 +     case v of 0 => (0, v1)
   2.544       | Suc (v3::nat) =>
   2.545 -         let (m::nat, s'::nat => bool) =
   2.546 -               unif_tupled (Suc v3 div (2::nat), v1)
   2.547 -         in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m,
   2.548 -             STL s'))"
   2.549 +         let (m::nat, s'::nat => bool) = unif_tupled (Suc v3 div 2, v1)
   2.550 +         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
   2.551    by (import prob_uniform unif_tupled_primitive_def)
   2.552  
   2.553  consts
   2.554 @@ -3594,10 +3719,10 @@
   2.555  lemma unif_curried_def: "ALL (x::nat) x1::nat => bool. unif x x1 = unif_tupled (x, x1)"
   2.556    by (import prob_uniform unif_curried_def)
   2.557  
   2.558 -lemma unif_def: "unif (0::nat) (s::nat => bool) = (0::nat, s) &
   2.559 +lemma unif_def: "unif 0 (s::nat => bool) = (0, s) &
   2.560  unif (Suc (v2::nat)) s =
   2.561 -(let (m::nat, s'::nat => bool) = unif (Suc v2 div (2::nat)) s
   2.562 - in (if SHD s' then (2::nat) * m + (1::nat) else (2::nat) * m, STL s'))"
   2.563 +(let (m::nat, s'::nat => bool) = unif (Suc v2 div 2) s
   2.564 + in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
   2.565    by (import prob_uniform unif_def)
   2.566  
   2.567  lemma unif_ind: "(All::((nat => (nat => bool) => bool) => bool) => bool)
   2.568 @@ -3871,19 +3996,19 @@
   2.569               (%xa::nat. (All::((nat => bool) => bool) => bool) (P x xa)))))"
   2.570    by (import prob_uniform uniform_ind)
   2.571  
   2.572 -lemma uniform_def: "uniform (0::nat) (Suc (n::nat)) (s::nat => bool) = (0::nat, s) &
   2.573 +lemma uniform_def: "uniform 0 (Suc (n::nat)) (s::nat => bool) = (0, s) &
   2.574  uniform (Suc (t::nat)) (Suc n) s =
   2.575  (let (xa::nat, x::nat => bool) = unif n s
   2.576   in if xa < Suc n then (xa, x) else uniform t (Suc n) x)"
   2.577    by (import prob_uniform uniform_def)
   2.578  
   2.579 -lemma SUC_DIV_TWO_ZERO: "ALL n::nat. (Suc n div (2::nat) = (0::nat)) = (n = (0::nat))"
   2.580 +lemma SUC_DIV_TWO_ZERO: "ALL n::nat. (Suc n div 2 = 0) = (n = 0)"
   2.581    by (import prob_uniform SUC_DIV_TWO_ZERO)
   2.582  
   2.583 -lemma UNIF_BOUND_LOWER: "ALL n::nat. n < (2::nat) ^ unif_bound n"
   2.584 +lemma UNIF_BOUND_LOWER: "ALL n::nat. n < 2 ^ unif_bound n"
   2.585    by (import prob_uniform UNIF_BOUND_LOWER)
   2.586  
   2.587 -lemma UNIF_BOUND_LOWER_SUC: "ALL n::nat. Suc n <= (2::nat) ^ unif_bound n"
   2.588 +lemma UNIF_BOUND_LOWER_SUC: "ALL n::nat. Suc n <= 2 ^ unif_bound n"
   2.589    by (import prob_uniform UNIF_BOUND_LOWER_SUC)
   2.590  
   2.591  lemma UNIF_BOUND_UPPER: "(All::(nat => bool) => bool)
   2.592 @@ -3905,20 +4030,18 @@
   2.593            n)))"
   2.594    by (import prob_uniform UNIF_BOUND_UPPER)
   2.595  
   2.596 -lemma UNIF_BOUND_UPPER_SUC: "ALL n::nat. (2::nat) ^ unif_bound n <= Suc ((2::nat) * n)"
   2.597 +lemma UNIF_BOUND_UPPER_SUC: "ALL n::nat. 2 ^ unif_bound n <= Suc (2 * n)"
   2.598    by (import prob_uniform UNIF_BOUND_UPPER_SUC)
   2.599  
   2.600 -lemma UNIF_DEF_MONAD: "unif (0::nat) = UNIT (0::nat) &
   2.601 +lemma UNIF_DEF_MONAD: "unif 0 = UNIT 0 &
   2.602  (ALL n::nat.
   2.603      unif (Suc n) =
   2.604 -    BIND (unif (Suc n div (2::nat)))
   2.605 +    BIND (unif (Suc n div 2))
   2.606       (%m::nat.
   2.607 -         BIND SDEST
   2.608 -          (%b::bool.
   2.609 -              UNIT (if b then (2::nat) * m + (1::nat) else (2::nat) * m))))"
   2.610 +         BIND SDEST (%b::bool. UNIT (if b then 2 * m + 1 else 2 * m))))"
   2.611    by (import prob_uniform UNIF_DEF_MONAD)
   2.612  
   2.613 -lemma UNIFORM_DEF_MONAD: "(ALL x::nat. uniform (0::nat) (Suc x) = UNIT (0::nat)) &
   2.614 +lemma UNIFORM_DEF_MONAD: "(ALL x::nat. uniform 0 (Suc x) = UNIT 0) &
   2.615  (ALL (x::nat) xa::nat.
   2.616      uniform (Suc x) (Suc xa) =
   2.617      BIND (unif xa)
   2.618 @@ -3931,45 +4054,18 @@
   2.619  lemma INDEP_UNIFORM: "ALL (t::nat) n::nat. indep (uniform t (Suc n))"
   2.620    by (import prob_uniform INDEP_UNIFORM)
   2.621  
   2.622 -lemma PROB_UNIF: "(All::(nat => bool) => bool)
   2.623 - (%n::nat.
   2.624 -     (All::(nat => bool) => bool)
   2.625 -      (%k::nat.
   2.626 -          (op =::real => real => bool)
   2.627 -           ((prob::((nat => bool) => bool) => real)
   2.628 -             (%s::nat => bool.
   2.629 -                 (op =::nat => nat => bool)
   2.630 -                  ((fst::nat * (nat => bool) => nat)
   2.631 -                    ((unif::nat => (nat => bool) => nat * (nat => bool)) n
   2.632 -                      s))
   2.633 -                  k))
   2.634 -           ((If::bool => real => real => real)
   2.635 -             ((op <::nat => nat => bool) k
   2.636 -               ((op ^::nat => nat => nat)
   2.637 -                 ((number_of::bin => nat)
   2.638 -                   ((op BIT::bin => bit => bin)
   2.639 -                     ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.640 -                       (bit.B1::bit))
   2.641 -                     (bit.B0::bit)))
   2.642 -                 ((unif_bound::nat => nat) n)))
   2.643 -             ((op ^::real => nat => real)
   2.644 -               ((op /::real => real => real) (1::real)
   2.645 -                 ((number_of::bin => real)
   2.646 -                   ((op BIT::bin => bit => bin)
   2.647 -                     ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   2.648 -                       (bit.B1::bit))
   2.649 -                     (bit.B0::bit))))
   2.650 -               ((unif_bound::nat => nat) n))
   2.651 -             (0::real))))"
   2.652 +lemma PROB_UNIF: "ALL (n::nat) k::nat.
   2.653 +   prob (%s::nat => bool. fst (unif n s) = k) =
   2.654 +   (if k < 2 ^ unif_bound n then (1 / 2) ^ unif_bound n else 0)"
   2.655    by (import prob_uniform PROB_UNIF)
   2.656  
   2.657 -lemma UNIF_RANGE: "ALL (n::nat) s::nat => bool. fst (unif n s) < (2::nat) ^ unif_bound n"
   2.658 +lemma UNIF_RANGE: "ALL (n::nat) s::nat => bool. fst (unif n s) < 2 ^ unif_bound n"
   2.659    by (import prob_uniform UNIF_RANGE)
   2.660  
   2.661  lemma PROB_UNIF_PAIR: "ALL (n::nat) (k::nat) k'::nat.
   2.662     (prob (%s::nat => bool. fst (unif n s) = k) =
   2.663      prob (%s::nat => bool. fst (unif n s) = k')) =
   2.664 -   ((k < (2::nat) ^ unif_bound n) = (k' < (2::nat) ^ unif_bound n))"
   2.665 +   ((k < 2 ^ unif_bound n) = (k' < 2 ^ unif_bound n))"
   2.666    by (import prob_uniform PROB_UNIF_PAIR)
   2.667  
   2.668  lemma PROB_UNIF_BOUND: "(All::(nat => bool) => bool)
   2.669 @@ -4004,8 +4100,7 @@
   2.670                   ((unif_bound::nat => nat) n))))))"
   2.671    by (import prob_uniform PROB_UNIF_BOUND)
   2.672  
   2.673 -lemma PROB_UNIF_GOOD: "ALL n::nat.
   2.674 -   (1::real) / (2::real) <= prob (%s::nat => bool. fst (unif n s) < Suc n)"
   2.675 +lemma PROB_UNIF_GOOD: "ALL n::nat. 1 / 2 <= prob (%s::nat => bool. fst (unif n s) < Suc n)"
   2.676    by (import prob_uniform PROB_UNIF_GOOD)
   2.677  
   2.678  lemma UNIFORM_RANGE: "ALL (t::nat) (n::nat) s::nat => bool. fst (uniform t (Suc n) s) < Suc n"
     3.1 --- a/src/HOL/Import/HOL/HOL4Real.thy	Mon Sep 26 15:56:28 2005 +0200
     3.2 +++ b/src/HOL/Import/HOL/HOL4Real.thy	Mon Sep 26 16:10:19 2005 +0200
     3.3 @@ -267,19 +267,19 @@
     3.4  
     3.5  ;setup_theory real
     3.6  
     3.7 -lemma REAL_0: "(0::real) = (0::real)"
     3.8 +lemma REAL_0: "(op =::real => real => bool) (0::real) (0::real)"
     3.9    by (import real REAL_0)
    3.10  
    3.11 -lemma REAL_1: "(1::real) = (1::real)"
    3.12 +lemma REAL_1: "(op =::real => real => bool) (1::real) (1::real)"
    3.13    by (import real REAL_1)
    3.14  
    3.15 -lemma REAL_ADD_LID_UNIQ: "ALL (x::real) y::real. (x + y = y) = (x = (0::real))"
    3.16 +lemma REAL_ADD_LID_UNIQ: "ALL (x::real) y::real. (x + y = y) = (x = 0)"
    3.17    by (import real REAL_ADD_LID_UNIQ)
    3.18  
    3.19 -lemma REAL_ADD_RID_UNIQ: "ALL (x::real) y::real. (x + y = x) = (y = (0::real))"
    3.20 +lemma REAL_ADD_RID_UNIQ: "ALL (x::real) y::real. (x + y = x) = (y = 0)"
    3.21    by (import real REAL_ADD_RID_UNIQ)
    3.22  
    3.23 -lemma REAL_LNEG_UNIQ: "ALL (x::real) y::real. (x + y = (0::real)) = (x = - y)"
    3.24 +lemma REAL_LNEG_UNIQ: "ALL (x::real) y::real. (x + y = 0) = (x = - y)"
    3.25    by (import real REAL_LNEG_UNIQ)
    3.26  
    3.27  lemma REAL_LT_ANTISYM: "ALL (x::real) y::real. ~ (x < y & y < x)"
    3.28 @@ -294,10 +294,10 @@
    3.29  lemma REAL_LTE_ANTSYM: "ALL (x::real) y::real. ~ (x <= y & y < x)"
    3.30    by (import real REAL_LTE_ANTSYM)
    3.31  
    3.32 -lemma REAL_LT_NEGTOTAL: "ALL x::real. x = (0::real) | (0::real) < x | (0::real) < - x"
    3.33 +lemma REAL_LT_NEGTOTAL: "ALL x::real. x = 0 | 0 < x | 0 < - x"
    3.34    by (import real REAL_LT_NEGTOTAL)
    3.35  
    3.36 -lemma REAL_LE_NEGTOTAL: "ALL x::real. (0::real) <= x | (0::real) <= - x"
    3.37 +lemma REAL_LE_NEGTOTAL: "ALL x::real. 0 <= x | 0 <= - x"
    3.38    by (import real REAL_LE_NEGTOTAL)
    3.39  
    3.40  lemma REAL_LT_ADDNEG: "ALL (x::real) (y::real) z::real. (y < x + - z) = (y + z < x)"
    3.41 @@ -306,16 +306,16 @@
    3.42  lemma REAL_LT_ADDNEG2: "ALL (x::real) (y::real) z::real. (x + - y < z) = (x < z + y)"
    3.43    by (import real REAL_LT_ADDNEG2)
    3.44  
    3.45 -lemma REAL_LT_ADD1: "ALL (x::real) y::real. x <= y --> x < y + (1::real)"
    3.46 +lemma REAL_LT_ADD1: "ALL (x::real) y::real. x <= y --> x < y + 1"
    3.47    by (import real REAL_LT_ADD1)
    3.48  
    3.49  lemma REAL_SUB_ADD2: "ALL (x::real) y::real. y + (x - y) = x"
    3.50    by (import real REAL_SUB_ADD2)
    3.51  
    3.52 -lemma REAL_SUB_LT: "ALL (x::real) y::real. ((0::real) < x - y) = (y < x)"
    3.53 +lemma REAL_SUB_LT: "ALL (x::real) y::real. (0 < x - y) = (y < x)"
    3.54    by (import real REAL_SUB_LT)
    3.55  
    3.56 -lemma REAL_SUB_LE: "ALL (x::real) y::real. ((0::real) <= x - y) = (y <= x)"
    3.57 +lemma REAL_SUB_LE: "ALL (x::real) y::real. (0 <= x - y) = (y <= x)"
    3.58    by (import real REAL_SUB_LE)
    3.59  
    3.60  lemma REAL_ADD_SUB: "ALL (x::real) y::real. x + y - x = y"
    3.61 @@ -324,72 +324,79 @@
    3.62  lemma REAL_NEG_EQ: "ALL (x::real) y::real. (- x = y) = (x = - y)"
    3.63    by (import real REAL_NEG_EQ)
    3.64  
    3.65 -lemma REAL_NEG_MINUS1: "ALL x::real. - x = - (1::real) * x"
    3.66 +lemma REAL_NEG_MINUS1: "ALL x::real. - x = - 1 * x"
    3.67    by (import real REAL_NEG_MINUS1)
    3.68  
    3.69 -lemma REAL_LT_LMUL_0: "ALL (x::real) y::real.
    3.70 -   (0::real) < x --> ((0::real) < x * y) = ((0::real) < y)"
    3.71 +lemma REAL_LT_LMUL_0: "ALL (x::real) y::real. 0 < x --> (0 < x * y) = (0 < y)"
    3.72    by (import real REAL_LT_LMUL_0)
    3.73  
    3.74 -lemma REAL_LT_RMUL_0: "ALL (x::real) y::real.
    3.75 -   (0::real) < y --> ((0::real) < x * y) = ((0::real) < x)"
    3.76 +lemma REAL_LT_RMUL_0: "ALL (x::real) y::real. 0 < y --> (0 < x * y) = (0 < x)"
    3.77    by (import real REAL_LT_RMUL_0)
    3.78  
    3.79 -lemma REAL_LT_LMUL: "ALL (x::real) (y::real) z::real. (0::real) < x --> (x * y < x * z) = (y < z)"
    3.80 +lemma REAL_LT_LMUL: "ALL (x::real) (y::real) z::real. 0 < x --> (x * y < x * z) = (y < z)"
    3.81    by (import real REAL_LT_LMUL)
    3.82  
    3.83 -lemma REAL_LINV_UNIQ: "ALL (x::real) y::real. x * y = (1::real) --> x = inverse y"
    3.84 +lemma REAL_LINV_UNIQ: "ALL (x::real) y::real. x * y = 1 --> x = inverse y"
    3.85    by (import real REAL_LINV_UNIQ)
    3.86  
    3.87 -lemma REAL_LE_INV: "ALL x>=0::real. (0::real) <= inverse x"
    3.88 +lemma REAL_LE_INV: "(All::(real => bool) => bool)
    3.89 + (%x::real.
    3.90 +     (op -->::bool => bool => bool)
    3.91 +      ((op <=::real => real => bool) (0::real) x)
    3.92 +      ((op <=::real => real => bool) (0::real) ((inverse::real => real) x)))"
    3.93    by (import real REAL_LE_INV)
    3.94  
    3.95 -lemma REAL_LE_ADDR: "ALL (x::real) y::real. (x <= x + y) = ((0::real) <= y)"
    3.96 +lemma REAL_LE_ADDR: "ALL (x::real) y::real. (x <= x + y) = (0 <= y)"
    3.97    by (import real REAL_LE_ADDR)
    3.98  
    3.99 -lemma REAL_LE_ADDL: "ALL (x::real) y::real. (y <= x + y) = ((0::real) <= x)"
   3.100 +lemma REAL_LE_ADDL: "ALL (x::real) y::real. (y <= x + y) = (0 <= x)"
   3.101    by (import real REAL_LE_ADDL)
   3.102  
   3.103 -lemma REAL_LT_ADDR: "ALL (x::real) y::real. (x < x + y) = ((0::real) < y)"
   3.104 +lemma REAL_LT_ADDR: "ALL (x::real) y::real. (x < x + y) = (0 < y)"
   3.105    by (import real REAL_LT_ADDR)
   3.106  
   3.107 -lemma REAL_LT_ADDL: "ALL (x::real) y::real. (y < x + y) = ((0::real) < x)"
   3.108 +lemma REAL_LT_ADDL: "ALL (x::real) y::real. (y < x + y) = (0 < x)"
   3.109    by (import real REAL_LT_ADDL)
   3.110  
   3.111 -lemma REAL_LT_NZ: "ALL n::nat. (real n ~= (0::real)) = ((0::real) < real n)"
   3.112 +lemma REAL_LT_NZ: "ALL n::nat. (real n ~= 0) = (0 < real n)"
   3.113    by (import real REAL_LT_NZ)
   3.114  
   3.115 -lemma REAL_NZ_IMP_LT: "ALL n::nat. n ~= (0::nat) --> (0::real) < real n"
   3.116 +lemma REAL_NZ_IMP_LT: "ALL n::nat. n ~= 0 --> 0 < real n"
   3.117    by (import real REAL_NZ_IMP_LT)
   3.118  
   3.119 -lemma REAL_LT_RDIV_0: "ALL (y::real) z::real.
   3.120 -   (0::real) < z --> ((0::real) < y / z) = ((0::real) < y)"
   3.121 +lemma REAL_LT_RDIV_0: "ALL (y::real) z::real. 0 < z --> (0 < y / z) = (0 < y)"
   3.122    by (import real REAL_LT_RDIV_0)
   3.123  
   3.124 -lemma REAL_LT_RDIV: "ALL (x::real) (y::real) z::real. (0::real) < z --> (x / z < y / z) = (x < y)"
   3.125 +lemma REAL_LT_RDIV: "ALL (x::real) (y::real) z::real. 0 < z --> (x / z < y / z) = (x < y)"
   3.126    by (import real REAL_LT_RDIV)
   3.127  
   3.128 -lemma REAL_LT_FRACTION_0: "ALL (n::nat) d::real.
   3.129 -   n ~= (0::nat) --> ((0::real) < d / real n) = ((0::real) < d)"
   3.130 +lemma REAL_LT_FRACTION_0: "ALL (n::nat) d::real. n ~= 0 --> (0 < d / real n) = (0 < d)"
   3.131    by (import real REAL_LT_FRACTION_0)
   3.132  
   3.133 -lemma REAL_LT_MULTIPLE: "ALL (x::nat) xa::real.
   3.134 -   (1::nat) < x --> (xa < real x * xa) = ((0::real) < xa)"
   3.135 +lemma REAL_LT_MULTIPLE: "ALL (x::nat) xa::real. 1 < x --> (xa < real x * xa) = (0 < xa)"
   3.136    by (import real REAL_LT_MULTIPLE)
   3.137  
   3.138 -lemma REAL_LT_FRACTION: "ALL (n::nat) d::real. (1::nat) < n --> (d / real n < d) = ((0::real) < d)"
   3.139 +lemma REAL_LT_FRACTION: "ALL (n::nat) d::real. 1 < n --> (d / real n < d) = (0 < d)"
   3.140    by (import real REAL_LT_FRACTION)
   3.141  
   3.142 -lemma REAL_LT_HALF2: "ALL d::real. (d / (2::real) < d) = ((0::real) < d)"
   3.143 +lemma REAL_LT_HALF2: "ALL d::real. (d / 2 < d) = (0 < d)"
   3.144    by (import real REAL_LT_HALF2)
   3.145  
   3.146 -lemma REAL_DIV_LMUL: "ALL (x::real) y::real. y ~= (0::real) --> y * (x / y) = x"
   3.147 +lemma REAL_DIV_LMUL: "ALL (x::real) y::real. y ~= 0 --> y * (x / y) = x"
   3.148    by (import real REAL_DIV_LMUL)
   3.149  
   3.150 -lemma REAL_DIV_RMUL: "ALL (x::real) y::real. y ~= (0::real) --> x / y * y = x"
   3.151 +lemma REAL_DIV_RMUL: "ALL (x::real) y::real. y ~= 0 --> x / y * y = x"
   3.152    by (import real REAL_DIV_RMUL)
   3.153  
   3.154 -lemma REAL_DOWN: "ALL x>0::real. EX xa>0::real. xa < x"
   3.155 +lemma REAL_DOWN: "(All::(real => bool) => bool)
   3.156 + (%x::real.
   3.157 +     (op -->::bool => bool => bool)
   3.158 +      ((op <::real => real => bool) (0::real) x)
   3.159 +      ((Ex::(real => bool) => bool)
   3.160 +        (%xa::real.
   3.161 +            (op &::bool => bool => bool)
   3.162 +             ((op <::real => real => bool) (0::real) xa)
   3.163 +             ((op <::real => real => bool) xa x))))"
   3.164    by (import real REAL_DOWN)
   3.165  
   3.166  lemma REAL_SUB_SUB: "ALL (x::real) y::real. x - y - x = - y"
   3.167 @@ -408,13 +415,11 @@
   3.168    by (import real REAL_SUB_TRIANGLE)
   3.169  
   3.170  lemma REAL_INV_MUL: "ALL (x::real) y::real.
   3.171 -   x ~= (0::real) & y ~= (0::real) -->
   3.172 -   inverse (x * y) = inverse x * inverse y"
   3.173 +   x ~= 0 & y ~= 0 --> inverse (x * y) = inverse x * inverse y"
   3.174    by (import real REAL_INV_MUL)
   3.175  
   3.176  lemma REAL_SUB_INV2: "ALL (x::real) y::real.
   3.177 -   x ~= (0::real) & y ~= (0::real) -->
   3.178 -   inverse x - inverse y = (y - x) / (x * y)"
   3.179 +   x ~= 0 & y ~= 0 --> inverse x - inverse y = (y - x) / (x * y)"
   3.180    by (import real REAL_SUB_INV2)
   3.181  
   3.182  lemma REAL_SUB_SUB2: "ALL (x::real) y::real. x - (x - y) = y"
   3.183 @@ -424,75 +429,74 @@
   3.184    by (import real REAL_ADD_SUB2)
   3.185  
   3.186  lemma REAL_LE_MUL2: "ALL (x1::real) (x2::real) (y1::real) y2::real.
   3.187 -   (0::real) <= x1 & (0::real) <= y1 & x1 <= x2 & y1 <= y2 -->
   3.188 -   x1 * y1 <= x2 * y2"
   3.189 +   0 <= x1 & 0 <= y1 & x1 <= x2 & y1 <= y2 --> x1 * y1 <= x2 * y2"
   3.190    by (import real REAL_LE_MUL2)
   3.191  
   3.192 -lemma REAL_LE_DIV: "ALL (x::real) xa::real.
   3.193 -   (0::real) <= x & (0::real) <= xa --> (0::real) <= x / xa"
   3.194 +lemma REAL_LE_DIV: "ALL (x::real) xa::real. 0 <= x & 0 <= xa --> 0 <= x / xa"
   3.195    by (import real REAL_LE_DIV)
   3.196  
   3.197 -lemma REAL_LT_1: "ALL (x::real) y::real. (0::real) <= x & x < y --> x / y < (1::real)"
   3.198 +lemma REAL_LT_1: "ALL (x::real) y::real. 0 <= x & x < y --> x / y < 1"
   3.199    by (import real REAL_LT_1)
   3.200  
   3.201 -lemma REAL_POS_NZ: "ALL x>0::real. x ~= (0::real)"
   3.202 +lemma REAL_POS_NZ: "(All::(real => bool) => bool)
   3.203 + (%x::real.
   3.204 +     (op -->::bool => bool => bool)
   3.205 +      ((op <::real => real => bool) (0::real) x)
   3.206 +      ((Not::bool => bool) ((op =::real => real => bool) x (0::real))))"
   3.207    by (import real REAL_POS_NZ)
   3.208  
   3.209 -lemma REAL_EQ_LMUL_IMP: "ALL (x::real) (xa::real) xb::real.
   3.210 -   x ~= (0::real) & x * xa = x * xb --> xa = xb"
   3.211 +lemma REAL_EQ_LMUL_IMP: "ALL (x::real) (xa::real) xb::real. x ~= 0 & x * xa = x * xb --> xa = xb"
   3.212    by (import real REAL_EQ_LMUL_IMP)
   3.213  
   3.214 -lemma REAL_FACT_NZ: "ALL n::nat. real (FACT n) ~= (0::real)"
   3.215 +lemma REAL_FACT_NZ: "ALL n::nat. real (FACT n) ~= 0"
   3.216    by (import real REAL_FACT_NZ)
   3.217  
   3.218  lemma REAL_DIFFSQ: "ALL (x::real) y::real. (x + y) * (x - y) = x * x - y * y"
   3.219    by (import real REAL_DIFFSQ)
   3.220  
   3.221 -lemma REAL_POASQ: "ALL x::real. ((0::real) < x * x) = (x ~= (0::real))"
   3.222 +lemma REAL_POASQ: "ALL x::real. (0 < x * x) = (x ~= 0)"
   3.223    by (import real REAL_POASQ)
   3.224  
   3.225 -lemma REAL_SUMSQ: "ALL (x::real) y::real.
   3.226 -   (x * x + y * y = (0::real)) = (x = (0::real) & y = (0::real))"
   3.227 +lemma REAL_SUMSQ: "ALL (x::real) y::real. (x * x + y * y = 0) = (x = 0 & y = 0)"
   3.228    by (import real REAL_SUMSQ)
   3.229  
   3.230  lemma REAL_DIV_MUL2: "ALL (x::real) z::real.
   3.231 -   x ~= (0::real) & z ~= (0::real) -->
   3.232 -   (ALL y::real. y / z = x * y / (x * z))"
   3.233 +   x ~= 0 & z ~= 0 --> (ALL y::real. y / z = x * y / (x * z))"
   3.234    by (import real REAL_DIV_MUL2)
   3.235  
   3.236 -lemma REAL_MIDDLE1: "ALL (a::real) b::real. a <= b --> a <= (a + b) / (2::real)"
   3.237 +lemma REAL_MIDDLE1: "ALL (a::real) b::real. a <= b --> a <= (a + b) / 2"
   3.238    by (import real REAL_MIDDLE1)
   3.239  
   3.240 -lemma REAL_MIDDLE2: "ALL (a::real) b::real. a <= b --> (a + b) / (2::real) <= b"
   3.241 +lemma REAL_MIDDLE2: "ALL (a::real) b::real. a <= b --> (a + b) / 2 <= b"
   3.242    by (import real REAL_MIDDLE2)
   3.243  
   3.244  lemma ABS_LT_MUL2: "ALL (w::real) (x::real) (y::real) z::real.
   3.245     abs w < y & abs x < z --> abs (w * x) < y * z"
   3.246    by (import real ABS_LT_MUL2)
   3.247  
   3.248 -lemma ABS_REFL: "ALL x::real. (abs x = x) = ((0::real) <= x)"
   3.249 +lemma ABS_REFL: "ALL x::real. (abs x = x) = (0 <= x)"
   3.250    by (import real ABS_REFL)
   3.251  
   3.252  lemma ABS_BETWEEN: "ALL (x::real) (y::real) d::real.
   3.253 -   ((0::real) < d & x - d < y & y < x + d) = (abs (y - x) < d)"
   3.254 +   (0 < d & x - d < y & y < x + d) = (abs (y - x) < d)"
   3.255    by (import real ABS_BETWEEN)
   3.256  
   3.257  lemma ABS_BOUND: "ALL (x::real) (y::real) d::real. abs (x - y) < d --> y < x + d"
   3.258    by (import real ABS_BOUND)
   3.259  
   3.260 -lemma ABS_STILLNZ: "ALL (x::real) y::real. abs (x - y) < abs y --> x ~= (0::real)"
   3.261 +lemma ABS_STILLNZ: "ALL (x::real) y::real. abs (x - y) < abs y --> x ~= 0"
   3.262    by (import real ABS_STILLNZ)
   3.263  
   3.264 -lemma ABS_CASES: "ALL x::real. x = (0::real) | (0::real) < abs x"
   3.265 +lemma ABS_CASES: "ALL x::real. x = 0 | 0 < abs x"
   3.266    by (import real ABS_CASES)
   3.267  
   3.268  lemma ABS_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & abs (y - x) < z - x --> y < z"
   3.269    by (import real ABS_BETWEEN1)
   3.270  
   3.271 -lemma ABS_SIGN: "ALL (x::real) y::real. abs (x - y) < y --> (0::real) < x"
   3.272 +lemma ABS_SIGN: "ALL (x::real) y::real. abs (x - y) < y --> 0 < x"
   3.273    by (import real ABS_SIGN)
   3.274  
   3.275 -lemma ABS_SIGN2: "ALL (x::real) y::real. abs (x - y) < - y --> x < (0::real)"
   3.276 +lemma ABS_SIGN2: "ALL (x::real) y::real. abs (x - y) < - y --> x < 0"
   3.277    by (import real ABS_SIGN2)
   3.278  
   3.279  lemma ABS_CIRCLE: "ALL (x::real) (y::real) h::real.
   3.280 @@ -500,44 +504,62 @@
   3.281    by (import real ABS_CIRCLE)
   3.282  
   3.283  lemma ABS_BETWEEN2: "ALL (x0::real) (x::real) (y0::real) y::real.
   3.284 -   x0 < y0 &
   3.285 -   abs (x - x0) < (y0 - x0) / (2::real) &
   3.286 -   abs (y - y0) < (y0 - x0) / (2::real) -->
   3.287 +   x0 < y0 & abs (x - x0) < (y0 - x0) / 2 & abs (y - y0) < (y0 - x0) / 2 -->
   3.288     x < y"
   3.289    by (import real ABS_BETWEEN2)
   3.290  
   3.291 -lemma POW_PLUS1: "ALL e>0::real. ALL n::nat. (1::real) + real n * e <= ((1::real) + e) ^ n"
   3.292 +lemma POW_PLUS1: "ALL e>0. ALL n::nat. 1 + real n * e <= (1 + e) ^ n"
   3.293    by (import real POW_PLUS1)
   3.294  
   3.295 -lemma POW_M1: "ALL n::nat. abs ((- (1::real)) ^ n) = (1::real)"
   3.296 +lemma POW_M1: "(All::(nat => bool) => bool)
   3.297 + (%n::nat.
   3.298 +     (op =::real => real => bool)
   3.299 +      ((abs::real => real)
   3.300 +        ((op ^::real => nat => real) ((uminus::real => real) (1::real)) n))
   3.301 +      (1::real))"
   3.302    by (import real POW_M1)
   3.303  
   3.304 -lemma REAL_LE1_POW2: "ALL x>=1::real. (1::real) <= x ^ 2"
   3.305 +lemma REAL_LE1_POW2: "(All::(real => bool) => bool)
   3.306 + (%x::real.
   3.307 +     (op -->::bool => bool => bool)
   3.308 +      ((op <=::real => real => bool) (1::real) x)
   3.309 +      ((op <=::real => real => bool) (1::real)
   3.310 +        ((op ^::real => nat => real) x
   3.311 +          ((number_of::bin => nat)
   3.312 +            ((op BIT::bin => bit => bin)
   3.313 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   3.314 +              (bit.B0::bit))))))"
   3.315    by (import real REAL_LE1_POW2)
   3.316  
   3.317 -lemma REAL_LT1_POW2: "ALL x>1::real. (1::real) < x ^ 2"
   3.318 +lemma REAL_LT1_POW2: "(All::(real => bool) => bool)
   3.319 + (%x::real.
   3.320 +     (op -->::bool => bool => bool)
   3.321 +      ((op <::real => real => bool) (1::real) x)
   3.322 +      ((op <::real => real => bool) (1::real)
   3.323 +        ((op ^::real => nat => real) x
   3.324 +          ((number_of::bin => nat)
   3.325 +            ((op BIT::bin => bit => bin)
   3.326 +              ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   3.327 +              (bit.B0::bit))))))"
   3.328    by (import real REAL_LT1_POW2)
   3.329  
   3.330 -lemma POW_POS_LT: "ALL (x::real) n::nat. (0::real) < x --> (0::real) < x ^ Suc n"
   3.331 +lemma POW_POS_LT: "ALL (x::real) n::nat. 0 < x --> 0 < x ^ Suc n"
   3.332    by (import real POW_POS_LT)
   3.333  
   3.334 -lemma POW_LT: "ALL (n::nat) (x::real) y::real.
   3.335 -   (0::real) <= x & x < y --> x ^ Suc n < y ^ Suc n"
   3.336 +lemma POW_LT: "ALL (n::nat) (x::real) y::real. 0 <= x & x < y --> x ^ Suc n < y ^ Suc n"
   3.337    by (import real POW_LT)
   3.338  
   3.339 -lemma POW_ZERO_EQ: "ALL (n::nat) x::real. (x ^ Suc n = (0::real)) = (x = (0::real))"
   3.340 +lemma POW_ZERO_EQ: "ALL (n::nat) x::real. (x ^ Suc n = 0) = (x = 0)"
   3.341    by (import real POW_ZERO_EQ)
   3.342  
   3.343 -lemma REAL_POW_LT2: "ALL (n::nat) (x::real) y::real.
   3.344 -   n ~= (0::nat) & (0::real) <= x & x < y --> x ^ n < y ^ n"
   3.345 +lemma REAL_POW_LT2: "ALL (n::nat) (x::real) y::real. n ~= 0 & 0 <= x & x < y --> x ^ n < y ^ n"
   3.346    by (import real REAL_POW_LT2)
   3.347  
   3.348 -lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::real. (1::real) < x & m < n --> x ^ m < x ^ n"
   3.349 +lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::real. 1 < x & m < n --> x ^ m < x ^ n"
   3.350    by (import real REAL_POW_MONO_LT)
   3.351  
   3.352  lemma REAL_SUP_SOMEPOS: "ALL P::real => bool.
   3.353 -   (EX x::real. P x & (0::real) < x) &
   3.354 -   (EX z::real. ALL x::real. P x --> x < z) -->
   3.355 +   (EX x::real. P x & 0 < x) & (EX z::real. ALL x::real. P x --> x < z) -->
   3.356     (EX s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s))"
   3.357    by (import real REAL_SUP_SOMEPOS)
   3.358  
   3.359 @@ -546,8 +568,7 @@
   3.360     (ALL y::real. (EX x::real. P x & y < x) = (y < s + d))"
   3.361    by (import real SUP_LEMMA1)
   3.362  
   3.363 -lemma SUP_LEMMA2: "ALL P::real => bool.
   3.364 -   Ex P --> (EX (d::real) x::real. P (x + d) & (0::real) < x)"
   3.365 +lemma SUP_LEMMA2: "ALL P::real => bool. Ex P --> (EX (d::real) x::real. P (x + d) & 0 < x)"
   3.366    by (import real SUP_LEMMA2)
   3.367  
   3.368  lemma SUP_LEMMA3: "ALL d::real.
   3.369 @@ -595,14 +616,13 @@
   3.370     (ALL y::real. P y --> y <= sup P)"
   3.371    by (import real REAL_SUP_UBOUND_LE)
   3.372  
   3.373 -lemma REAL_ARCH_LEAST: "ALL y>0::real.
   3.374 -   ALL x>=0::real. EX n::nat. real n * y <= x & x < real (Suc n) * y"
   3.375 +lemma REAL_ARCH_LEAST: "ALL y>0. ALL x>=0. EX n::nat. real n * y <= x & x < real (Suc n) * y"
   3.376    by (import real REAL_ARCH_LEAST)
   3.377  
   3.378  consts
   3.379    sumc :: "nat => nat => (nat => real) => real" 
   3.380  
   3.381 -specification (sumc) sumc: "(ALL (n::nat) f::nat => real. sumc n (0::nat) f = (0::real)) &
   3.382 +specification (sumc) sumc: "(ALL (n::nat) f::nat => real. sumc n 0 f = 0) &
   3.383  (ALL (n::nat) (m::nat) f::nat => real.
   3.384      sumc n (Suc m) f = sumc n m f + f (n + m))"
   3.385    by (import real sumc)
   3.386 @@ -622,16 +642,16 @@
   3.387    by (import real SUM_DEF)
   3.388  
   3.389  lemma sum: "ALL (x::nat => real) (xa::nat) xb::nat.
   3.390 -   real.sum (xa, 0::nat) x = (0::real) &
   3.391 +   real.sum (xa, 0) x = 0 &
   3.392     real.sum (xa, Suc xb) x = real.sum (xa, xb) x + x (xa + xb)"
   3.393    by (import real sum)
   3.394  
   3.395  lemma SUM_TWO: "ALL (f::nat => real) (n::nat) p::nat.
   3.396 -   real.sum (0::nat, n) f + real.sum (n, p) f = real.sum (0::nat, n + p) f"
   3.397 +   real.sum (0, n) f + real.sum (n, p) f = real.sum (0, n + p) f"
   3.398    by (import real SUM_TWO)
   3.399  
   3.400  lemma SUM_DIFF: "ALL (f::nat => real) (m::nat) n::nat.
   3.401 -   real.sum (m, n) f = real.sum (0::nat, m + n) f - real.sum (0::nat, m) f"
   3.402 +   real.sum (m, n) f = real.sum (0, m + n) f - real.sum (0, m) f"
   3.403    by (import real SUM_DIFF)
   3.404  
   3.405  lemma ABS_SUM: "ALL (f::nat => real) (m::nat) n::nat.
   3.406 @@ -649,13 +669,12 @@
   3.407    by (import real SUM_EQ)
   3.408  
   3.409  lemma SUM_POS: "ALL f::nat => real.
   3.410 -   (ALL n::nat. (0::real) <= f n) -->
   3.411 -   (ALL (m::nat) n::nat. (0::real) <= real.sum (m, n) f)"
   3.412 +   (ALL n::nat. 0 <= f n) --> (ALL (m::nat) n::nat. 0 <= real.sum (m, n) f)"
   3.413    by (import real SUM_POS)
   3.414  
   3.415  lemma SUM_POS_GEN: "ALL (f::nat => real) m::nat.
   3.416 -   (ALL n::nat. m <= n --> (0::real) <= f n) -->
   3.417 -   (ALL n::nat. (0::real) <= real.sum (m, n) f)"
   3.418 +   (ALL n::nat. m <= n --> 0 <= f n) -->
   3.419 +   (ALL n::nat. 0 <= real.sum (m, n) f)"
   3.420    by (import real SUM_POS_GEN)
   3.421  
   3.422  lemma SUM_ABS: "ALL (f::nat => real) (m::nat) x::nat.
   3.423 @@ -668,8 +687,8 @@
   3.424    by (import real SUM_ABS_LE)
   3.425  
   3.426  lemma SUM_ZERO: "ALL (f::nat => real) N::nat.
   3.427 -   (ALL n::nat. N <= n --> f n = (0::real)) -->
   3.428 -   (ALL (m::nat) n::nat. N <= m --> real.sum (m, n) f = (0::real))"
   3.429 +   (ALL n::nat. N <= n --> f n = 0) -->
   3.430 +   (ALL (m::nat) n::nat. N <= m --> real.sum (m, n) f = 0)"
   3.431    by (import real SUM_ZERO)
   3.432  
   3.433  lemma SUM_ADD: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat.
   3.434 @@ -696,8 +715,7 @@
   3.435    by (import real SUM_SUBST)
   3.436  
   3.437  lemma SUM_NSUB: "ALL (n::nat) (f::nat => real) c::real.
   3.438 -   real.sum (0::nat, n) f - real n * c =
   3.439 -   real.sum (0::nat, n) (%p::nat. f p - c)"
   3.440 +   real.sum (0, n) f - real n * c = real.sum (0, n) (%p::nat. f p - c)"
   3.441    by (import real SUM_NSUB)
   3.442  
   3.443  lemma SUM_BOUND: "ALL (f::nat => real) (k::real) (m::nat) n::nat.
   3.444 @@ -706,26 +724,25 @@
   3.445    by (import real SUM_BOUND)
   3.446  
   3.447  lemma SUM_GROUP: "ALL (n::nat) (k::nat) f::nat => real.
   3.448 -   real.sum (0::nat, n) (%m::nat. real.sum (m * k, k) f) =
   3.449 -   real.sum (0::nat, n * k) f"
   3.450 +   real.sum (0, n) (%m::nat. real.sum (m * k, k) f) = real.sum (0, n * k) f"
   3.451    by (import real SUM_GROUP)
   3.452  
   3.453 -lemma SUM_1: "ALL (f::nat => real) n::nat. real.sum (n, 1::nat) f = f n"
   3.454 +lemma SUM_1: "ALL (f::nat => real) n::nat. real.sum (n, 1) f = f n"
   3.455    by (import real SUM_1)
   3.456  
   3.457 -lemma SUM_2: "ALL (f::nat => real) n::nat. real.sum (n, 2::nat) f = f n + f (n + (1::nat))"
   3.458 +lemma SUM_2: "ALL (f::nat => real) n::nat. real.sum (n, 2) f = f n + f (n + 1)"
   3.459    by (import real SUM_2)
   3.460  
   3.461  lemma SUM_OFFSET: "ALL (f::nat => real) (n::nat) k::nat.
   3.462 -   real.sum (0::nat, n) (%m::nat. f (m + k)) =
   3.463 -   real.sum (0::nat, n + k) f - real.sum (0::nat, k) f"
   3.464 +   real.sum (0, n) (%m::nat. f (m + k)) =
   3.465 +   real.sum (0, n + k) f - real.sum (0, k) f"
   3.466    by (import real SUM_OFFSET)
   3.467  
   3.468  lemma SUM_REINDEX: "ALL (f::nat => real) (m::nat) (k::nat) n::nat.
   3.469     real.sum (m + k, n) f = real.sum (m, n) (%r::nat. f (r + k))"
   3.470    by (import real SUM_REINDEX)
   3.471  
   3.472 -lemma SUM_0: "ALL (m::nat) n::nat. real.sum (m, n) (%r::nat. 0::real) = (0::real)"
   3.473 +lemma SUM_0: "ALL (m::nat) n::nat. real.sum (m, n) (%r::nat. 0) = 0"
   3.474    by (import real SUM_0)
   3.475  
   3.476  lemma SUM_PERMUTE_0: "(All::(nat => bool) => bool)
   3.477 @@ -756,12 +773,10 @@
   3.478     real.sum (n, d) (%n::nat. f (Suc n) - f n) = f (n + d) - f n"
   3.479    by (import real SUM_CANCEL)
   3.480  
   3.481 -lemma REAL_EQ_RDIV_EQ: "ALL (x::real) (xa::real) xb::real.
   3.482 -   (0::real) < xb --> (x = xa / xb) = (x * xb = xa)"
   3.483 +lemma REAL_EQ_RDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x = xa / xb) = (x * xb = xa)"
   3.484    by (import real REAL_EQ_RDIV_EQ)
   3.485  
   3.486 -lemma REAL_EQ_LDIV_EQ: "ALL (x::real) (xa::real) xb::real.
   3.487 -   (0::real) < xb --> (x / xb = xa) = (x = xa * xb)"
   3.488 +lemma REAL_EQ_LDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x / xb = xa) = (x = xa * xb)"
   3.489    by (import real REAL_EQ_LDIV_EQ)
   3.490  
   3.491  ;end_setup
   3.492 @@ -769,7 +784,7 @@
   3.493  ;setup_theory topology
   3.494  
   3.495  constdefs
   3.496 -  re_Union :: "(('a::type => bool) => bool) => 'a::type => bool" 
   3.497 +  re_Union :: "(('a => bool) => bool) => 'a => bool" 
   3.498    "re_Union ==
   3.499  %(P::('a::type => bool) => bool) x::'a::type.
   3.500     EX s::'a::type => bool. P s & s x"
   3.501 @@ -779,7 +794,7 @@
   3.502    by (import topology re_Union)
   3.503  
   3.504  constdefs
   3.505 -  re_union :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
   3.506 +  re_union :: "('a => bool) => ('a => bool) => 'a => bool" 
   3.507    "re_union ==
   3.508  %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x | Q x"
   3.509  
   3.510 @@ -788,7 +803,7 @@
   3.511    by (import topology re_union)
   3.512  
   3.513  constdefs
   3.514 -  re_intersect :: "('a::type => bool) => ('a::type => bool) => 'a::type => bool" 
   3.515 +  re_intersect :: "('a => bool) => ('a => bool) => 'a => bool" 
   3.516    "re_intersect ==
   3.517  %(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x & Q x"
   3.518  
   3.519 @@ -797,21 +812,21 @@
   3.520    by (import topology re_intersect)
   3.521  
   3.522  constdefs
   3.523 -  re_null :: "'a::type => bool" 
   3.524 +  re_null :: "'a => bool" 
   3.525    "re_null == %x::'a::type. False"
   3.526  
   3.527  lemma re_null: "re_null = (%x::'a::type. False)"
   3.528    by (import topology re_null)
   3.529  
   3.530  constdefs
   3.531 -  re_universe :: "'a::type => bool" 
   3.532 +  re_universe :: "'a => bool" 
   3.533    "re_universe == %x::'a::type. True"
   3.534  
   3.535  lemma re_universe: "re_universe = (%x::'a::type. True)"
   3.536    by (import topology re_universe)
   3.537  
   3.538  constdefs
   3.539 -  re_subset :: "('a::type => bool) => ('a::type => bool) => bool" 
   3.540 +  re_subset :: "('a => bool) => ('a => bool) => bool" 
   3.541    "re_subset ==
   3.542  %(P::'a::type => bool) Q::'a::type => bool. ALL x::'a::type. P x --> Q x"
   3.543  
   3.544 @@ -820,7 +835,7 @@
   3.545    by (import topology re_subset)
   3.546  
   3.547  constdefs
   3.548 -  re_compl :: "('a::type => bool) => 'a::type => bool" 
   3.549 +  re_compl :: "('a => bool) => 'a => bool" 
   3.550    "re_compl == %(P::'a::type => bool) x::'a::type. ~ P x"
   3.551  
   3.552  lemma re_compl: "ALL P::'a::type => bool. re_compl P = (%x::'a::type. ~ P x)"
   3.553 @@ -841,7 +856,7 @@
   3.554    by (import topology SUBSET_TRANS)
   3.555  
   3.556  constdefs
   3.557 -  istopology :: "(('a::type => bool) => bool) => bool" 
   3.558 +  istopology :: "(('a => bool) => bool) => bool" 
   3.559    "istopology ==
   3.560  %L::('a::type => bool) => bool.
   3.561     L re_null &
   3.562 @@ -867,8 +882,8 @@
   3.563  lemmas topology_TY_DEF = typedef_hol2hol4 [OF type_definition_topology]
   3.564  
   3.565  consts
   3.566 -  topology :: "(('a::type => bool) => bool) => 'a::type topology" 
   3.567 -  "open" :: "'a::type topology => ('a::type => bool) => bool" 
   3.568 +  topology :: "(('a => bool) => bool) => 'a topology" 
   3.569 +  "open" :: "'a topology => ('a => bool) => bool" 
   3.570  
   3.571  specification ("open" topology) topology_tybij: "(ALL a::'a::type topology. topology (open a) = a) &
   3.572  (ALL r::('a::type => bool) => bool. istopology r = (open (topology r) = r))"
   3.573 @@ -888,7 +903,7 @@
   3.574    by (import topology TOPOLOGY_UNION)
   3.575  
   3.576  constdefs
   3.577 -  neigh :: "'a::type topology => ('a::type => bool) * 'a::type => bool" 
   3.578 +  neigh :: "'a topology => ('a => bool) * 'a => bool" 
   3.579    "neigh ==
   3.580  %(top::'a::type topology) (N::'a::type => bool, x::'a::type).
   3.581     EX P::'a::type => bool. open top P & re_subset P N & P x"
   3.582 @@ -920,7 +935,7 @@
   3.583    by (import topology OPEN_NEIGH)
   3.584  
   3.585  constdefs
   3.586 -  closed :: "'a::type topology => ('a::type => bool) => bool" 
   3.587 +  closed :: "'a topology => ('a => bool) => bool" 
   3.588    "closed == %(L::'a::type topology) S'::'a::type => bool. open L (re_compl S')"
   3.589  
   3.590  lemma closed: "ALL (L::'a::type topology) S'::'a::type => bool.
   3.591 @@ -928,7 +943,7 @@
   3.592    by (import topology closed)
   3.593  
   3.594  constdefs
   3.595 -  limpt :: "'a::type topology => 'a::type => ('a::type => bool) => bool" 
   3.596 +  limpt :: "'a topology => 'a => ('a => bool) => bool" 
   3.597    "limpt ==
   3.598  %(top::'a::type topology) (x::'a::type) S'::'a::type => bool.
   3.599     ALL N::'a::type => bool.
   3.600 @@ -945,16 +960,16 @@
   3.601    by (import topology CLOSED_LIMPT)
   3.602  
   3.603  constdefs
   3.604 -  ismet :: "('a::type * 'a::type => real) => bool" 
   3.605 +  ismet :: "('a * 'a => real) => bool" 
   3.606    "ismet ==
   3.607  %m::'a::type * 'a::type => real.
   3.608 -   (ALL (x::'a::type) y::'a::type. (m (x, y) = (0::real)) = (x = y)) &
   3.609 +   (ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) &
   3.610     (ALL (x::'a::type) (y::'a::type) z::'a::type.
   3.611         m (y, z) <= m (x, y) + m (x, z))"
   3.612  
   3.613  lemma ismet: "ALL m::'a::type * 'a::type => real.
   3.614     ismet m =
   3.615 -   ((ALL (x::'a::type) y::'a::type. (m (x, y) = (0::real)) = (x = y)) &
   3.616 +   ((ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) &
   3.617      (ALL (x::'a::type) (y::'a::type) z::'a::type.
   3.618          m (y, z) <= m (x, y) + m (x, z)))"
   3.619    by (import topology ismet)
   3.620 @@ -967,8 +982,8 @@
   3.621  lemmas metric_TY_DEF = typedef_hol2hol4 [OF type_definition_metric]
   3.622  
   3.623  consts
   3.624 -  metric :: "('a::type * 'a::type => real) => 'a::type metric" 
   3.625 -  dist :: "'a::type metric => 'a::type * 'a::type => real" 
   3.626 +  metric :: "('a * 'a => real) => 'a metric" 
   3.627 +  dist :: "'a metric => 'a * 'a => real" 
   3.628  
   3.629  specification (dist metric) metric_tybij: "(ALL a::'a::type metric. metric (dist a) = a) &
   3.630  (ALL r::'a::type * 'a::type => real. ismet r = (dist (metric r) = r))"
   3.631 @@ -978,14 +993,13 @@
   3.632    by (import topology METRIC_ISMET)
   3.633  
   3.634  lemma METRIC_ZERO: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
   3.635 -   (dist m (x, y) = (0::real)) = (x = y)"
   3.636 +   (dist m (x, y) = 0) = (x = y)"
   3.637    by (import topology METRIC_ZERO)
   3.638  
   3.639 -lemma METRIC_SAME: "ALL (m::'a::type metric) x::'a::type. dist m (x, x) = (0::real)"
   3.640 +lemma METRIC_SAME: "ALL (m::'a::type metric) x::'a::type. dist m (x, x) = 0"
   3.641    by (import topology METRIC_SAME)
   3.642  
   3.643 -lemma METRIC_POS: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
   3.644 -   (0::real) <= dist m (x, y)"
   3.645 +lemma METRIC_POS: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. 0 <= dist m (x, y)"
   3.646    by (import topology METRIC_POS)
   3.647  
   3.648  lemma METRIC_SYM: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
   3.649 @@ -997,45 +1011,41 @@
   3.650    by (import topology METRIC_TRIANGLE)
   3.651  
   3.652  lemma METRIC_NZ: "ALL (m::'a::type metric) (x::'a::type) y::'a::type.
   3.653 -   x ~= y --> (0::real) < dist m (x, y)"
   3.654 +   x ~= y --> 0 < dist m (x, y)"
   3.655    by (import topology METRIC_NZ)
   3.656  
   3.657  constdefs
   3.658 -  mtop :: "'a::type metric => 'a::type topology" 
   3.659 +  mtop :: "'a metric => 'a topology" 
   3.660    "mtop ==
   3.661  %m::'a::type metric.
   3.662     topology
   3.663      (%S'::'a::type => bool.
   3.664          ALL x::'a::type.
   3.665 -           S' x -->
   3.666 -           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.667 +           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.668  
   3.669  lemma mtop: "ALL m::'a::type metric.
   3.670     mtop m =
   3.671     topology
   3.672      (%S'::'a::type => bool.
   3.673          ALL x::'a::type.
   3.674 -           S' x -->
   3.675 -           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.676 +           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.677    by (import topology mtop)
   3.678  
   3.679  lemma mtop_istopology: "ALL m::'a::type metric.
   3.680     istopology
   3.681      (%S'::'a::type => bool.
   3.682          ALL x::'a::type.
   3.683 -           S' x -->
   3.684 -           (EX e>0::real. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.685 +           S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))"
   3.686    by (import topology mtop_istopology)
   3.687  
   3.688  lemma MTOP_OPEN: "ALL (S'::'a::type => bool) x::'a::type metric.
   3.689     open (mtop x) S' =
   3.690     (ALL xa::'a::type.
   3.691 -       S' xa -->
   3.692 -       (EX e>0::real. ALL y::'a::type. dist x (xa, y) < e --> S' y))"
   3.693 +       S' xa --> (EX e>0. ALL y::'a::type. dist x (xa, y) < e --> S' y))"
   3.694    by (import topology MTOP_OPEN)
   3.695  
   3.696  constdefs
   3.697 -  B :: "'a::type metric => 'a::type * real => 'a::type => bool" 
   3.698 +  B :: "'a metric => 'a * real => 'a => bool" 
   3.699    "B ==
   3.700  %(m::'a::type metric) (x::'a::type, e::real) y::'a::type. dist m (x, y) < e"
   3.701  
   3.702 @@ -1044,16 +1054,16 @@
   3.703    by (import topology ball)
   3.704  
   3.705  lemma BALL_OPEN: "ALL (m::'a::type metric) (x::'a::type) e::real.
   3.706 -   (0::real) < e --> open (mtop m) (B m (x, e))"
   3.707 +   0 < e --> open (mtop m) (B m (x, e))"
   3.708    by (import topology BALL_OPEN)
   3.709  
   3.710  lemma BALL_NEIGH: "ALL (m::'a::type metric) (x::'a::type) e::real.
   3.711 -   (0::real) < e --> neigh (mtop m) (B m (x, e), x)"
   3.712 +   0 < e --> neigh (mtop m) (B m (x, e), x)"
   3.713    by (import topology BALL_NEIGH)
   3.714  
   3.715  lemma MTOP_LIMPT: "ALL (m::'a::type metric) (x::'a::type) S'::'a::type => bool.
   3.716     limpt (mtop m) x S' =
   3.717 -   (ALL e>0::real. EX y::'a::type. x ~= y & S' y & dist m (x, y) < e)"
   3.718 +   (ALL e>0. EX y::'a::type. x ~= y & S' y & dist m (x, y) < e)"
   3.719    by (import topology MTOP_LIMPT)
   3.720  
   3.721  lemma ISMET_R1: "ismet (%(x::real, y::real). abs (y - x))"
   3.722 @@ -1075,16 +1085,16 @@
   3.723  lemma MR1_SUB: "ALL (x::real) d::real. dist mr1 (x, x - d) = abs d"
   3.724    by (import topology MR1_SUB)
   3.725  
   3.726 -lemma MR1_ADD_POS: "ALL (x::real) d::real. (0::real) <= d --> dist mr1 (x, x + d) = d"
   3.727 +lemma MR1_ADD_POS: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x + d) = d"
   3.728    by (import topology MR1_ADD_POS)
   3.729  
   3.730 -lemma MR1_SUB_LE: "ALL (x::real) d::real. (0::real) <= d --> dist mr1 (x, x - d) = d"
   3.731 +lemma MR1_SUB_LE: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x - d) = d"
   3.732    by (import topology MR1_SUB_LE)
   3.733  
   3.734 -lemma MR1_ADD_LT: "ALL (x::real) d::real. (0::real) < d --> dist mr1 (x, x + d) = d"
   3.735 +lemma MR1_ADD_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x + d) = d"
   3.736    by (import topology MR1_ADD_LT)
   3.737  
   3.738 -lemma MR1_SUB_LT: "ALL (x::real) d::real. (0::real) < d --> dist mr1 (x, x - d) = d"
   3.739 +lemma MR1_SUB_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x - d) = d"
   3.740    by (import topology MR1_SUB_LT)
   3.741  
   3.742  lemma MR1_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & dist mr1 (x, y) < z - x --> y < z"
   3.743 @@ -1098,7 +1108,7 @@
   3.744  ;setup_theory nets
   3.745  
   3.746  constdefs
   3.747 -  dorder :: "('a::type => 'a::type => bool) => bool" 
   3.748 +  dorder :: "('a => 'a => bool) => bool" 
   3.749    "dorder ==
   3.750  %g::'a::type => 'a::type => bool.
   3.751     ALL (x::'a::type) y::'a::type.
   3.752 @@ -1113,8 +1123,7 @@
   3.753    by (import nets dorder)
   3.754  
   3.755  constdefs
   3.756 -  tends :: "('b::type => 'a::type)
   3.757 -=> 'a::type => 'a::type topology * ('b::type => 'b::type => bool) => bool" 
   3.758 +  tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool" 
   3.759    "tends ==
   3.760  %(s::'b::type => 'a::type) (l::'a::type) (top::'a::type topology,
   3.761     g::'b::type => 'b::type => bool).
   3.762 @@ -1131,8 +1140,7 @@
   3.763    by (import nets tends)
   3.764  
   3.765  constdefs
   3.766 -  bounded :: "'a::type metric * ('b::type => 'b::type => bool)
   3.767 -=> ('b::type => 'a::type) => bool" 
   3.768 +  bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool" 
   3.769    "bounded ==
   3.770  %(m::'a::type metric, g::'b::type => 'b::type => bool)
   3.771     f::'b::type => 'a::type.
   3.772 @@ -1147,14 +1155,13 @@
   3.773    by (import nets bounded)
   3.774  
   3.775  constdefs
   3.776 -  tendsto :: "'a::type metric * 'a::type => 'a::type => 'a::type => bool" 
   3.777 +  tendsto :: "'a metric * 'a => 'a => 'a => bool" 
   3.778    "tendsto ==
   3.779  %(m::'a::type metric, x::'a::type) (y::'a::type) z::'a::type.
   3.780 -   (0::real) < dist m (x, y) & dist m (x, y) <= dist m (x, z)"
   3.781 +   0 < dist m (x, y) & dist m (x, y) <= dist m (x, z)"
   3.782  
   3.783  lemma tendsto: "ALL (m::'a::type metric) (x::'a::type) (y::'a::type) z::'a::type.
   3.784 -   tendsto (m, x) y z =
   3.785 -   ((0::real) < dist m (x, y) & dist m (x, y) <= dist m (x, z))"
   3.786 +   tendsto (m, x) y z = (0 < dist m (x, y) & dist m (x, y) <= dist m (x, z))"
   3.787    by (import nets tendsto)
   3.788  
   3.789  lemma DORDER_LEMMA: "ALL g::'a::type => 'a::type => bool.
   3.790 @@ -1174,7 +1181,7 @@
   3.791  lemma MTOP_TENDS: "ALL (d::'a::type metric) (g::'b::type => 'b::type => bool)
   3.792     (x::'b::type => 'a::type) x0::'a::type.
   3.793     tends x x0 (mtop d, g) =
   3.794 -   (ALL e>0::real.
   3.795 +   (ALL e>0.
   3.796         EX n::'b::type.
   3.797            g n n & (ALL m::'b::type. g m n --> dist d (x m, x0) < e))"
   3.798    by (import nets MTOP_TENDS)
   3.799 @@ -1188,18 +1195,17 @@
   3.800  
   3.801  lemma SEQ_TENDS: "ALL (d::'a::type metric) (x::nat => 'a::type) x0::'a::type.
   3.802     tends x x0 (mtop d, nat_ge) =
   3.803 -   (ALL xa>0::real.
   3.804 -       EX xb::nat. ALL xc::nat. xb <= xc --> dist d (x xc, x0) < xa)"
   3.805 +   (ALL xa>0. EX xb::nat. ALL xc::nat. xb <= xc --> dist d (x xc, x0) < xa)"
   3.806    by (import nets SEQ_TENDS)
   3.807  
   3.808  lemma LIM_TENDS: "ALL (m1::'a::type metric) (m2::'b::type metric) (f::'a::type => 'b::type)
   3.809     (x0::'a::type) y0::'b::type.
   3.810     limpt (mtop m1) x0 re_universe -->
   3.811     tends f y0 (mtop m2, tendsto (m1, x0)) =
   3.812 -   (ALL e>0::real.
   3.813 -       EX d>0::real.
   3.814 +   (ALL e>0.
   3.815 +       EX d>0.
   3.816            ALL x::'a::type.
   3.817 -             (0::real) < dist m1 (x, x0) & dist m1 (x, x0) <= d -->
   3.818 +             0 < dist m1 (x, x0) & dist m1 (x, x0) <= d -->
   3.819               dist m2 (f x, y0) < e)"
   3.820    by (import nets LIM_TENDS)
   3.821  
   3.822 @@ -1207,10 +1213,10 @@
   3.823     (x0::'a::type) y0::'b::type.
   3.824     limpt (mtop m1) x0 re_universe -->
   3.825     tends f y0 (mtop m2, tendsto (m1, x0)) =
   3.826 -   (ALL e>0::real.
   3.827 -       EX d>0::real.
   3.828 +   (ALL e>0.
   3.829 +       EX d>0.
   3.830            ALL x::'a::type.
   3.831 -             (0::real) < dist m1 (x, x0) & dist m1 (x, x0) < d -->
   3.832 +             0 < dist m1 (x, x0) & dist m1 (x, x0) < d -->
   3.833               dist m2 (f x, y0) < e)"
   3.834    by (import nets LIM_TENDS2)
   3.835  
   3.836 @@ -1221,8 +1227,7 @@
   3.837    by (import nets MR1_BOUNDED)
   3.838  
   3.839  lemma NET_NULL: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
   3.840 -   tends x x0 (mtop mr1, g) =
   3.841 -   tends (%n::'a::type. x n - x0) (0::real) (mtop mr1, g)"
   3.842 +   tends x x0 (mtop mr1, g) = tends (%n::'a::type. x n - x0) 0 (mtop mr1, g)"
   3.843    by (import nets NET_NULL)
   3.844  
   3.845  lemma NET_CONV_BOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
   3.846 @@ -1230,32 +1235,31 @@
   3.847    by (import nets NET_CONV_BOUNDED)
   3.848  
   3.849  lemma NET_CONV_NZ: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
   3.850 -   tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
   3.851 -   (EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n ~= (0::real)))"
   3.852 +   tends x x0 (mtop mr1, g) & x0 ~= 0 -->
   3.853 +   (EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n ~= 0))"
   3.854    by (import nets NET_CONV_NZ)
   3.855  
   3.856  lemma NET_CONV_IBOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real.
   3.857 -   tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
   3.858 +   tends x x0 (mtop mr1, g) & x0 ~= 0 -->
   3.859     bounded (mr1, g) (%n::'a::type. inverse (x n))"
   3.860    by (import nets NET_CONV_IBOUNDED)
   3.861  
   3.862  lemma NET_NULL_ADD: "ALL g::'a::type => 'a::type => bool.
   3.863     dorder g -->
   3.864     (ALL (x::'a::type => real) y::'a::type => real.
   3.865 -       tends x (0::real) (mtop mr1, g) & tends y (0::real) (mtop mr1, g) -->
   3.866 -       tends (%n::'a::type. x n + y n) (0::real) (mtop mr1, g))"
   3.867 +       tends x 0 (mtop mr1, g) & tends y 0 (mtop mr1, g) -->
   3.868 +       tends (%n::'a::type. x n + y n) 0 (mtop mr1, g))"
   3.869    by (import nets NET_NULL_ADD)
   3.870  
   3.871  lemma NET_NULL_MUL: "ALL g::'a::type => 'a::type => bool.
   3.872     dorder g -->
   3.873     (ALL (x::'a::type => real) y::'a::type => real.
   3.874 -       bounded (mr1, g) x & tends y (0::real) (mtop mr1, g) -->
   3.875 -       tends (%n::'a::type. x n * y n) (0::real) (mtop mr1, g))"
   3.876 +       bounded (mr1, g) x & tends y 0 (mtop mr1, g) -->
   3.877 +       tends (%n::'a::type. x n * y n) 0 (mtop mr1, g))"
   3.878    by (import nets NET_NULL_MUL)
   3.879  
   3.880  lemma NET_NULL_CMUL: "ALL (g::'a::type => 'a::type => bool) (k::real) x::'a::type => real.
   3.881 -   tends x (0::real) (mtop mr1, g) -->
   3.882 -   tends (%n::'a::type. k * x n) (0::real) (mtop mr1, g)"
   3.883 +   tends x 0 (mtop mr1, g) --> tends (%n::'a::type. k * x n) 0 (mtop mr1, g)"
   3.884    by (import nets NET_NULL_CMUL)
   3.885  
   3.886  lemma NET_ADD: "ALL g::'a::type => 'a::type => bool.
   3.887 @@ -1289,15 +1293,14 @@
   3.888  lemma NET_INV: "ALL g::'a::type => 'a::type => bool.
   3.889     dorder g -->
   3.890     (ALL (x::'a::type => real) x0::real.
   3.891 -       tends x x0 (mtop mr1, g) & x0 ~= (0::real) -->
   3.892 +       tends x x0 (mtop mr1, g) & x0 ~= 0 -->
   3.893         tends (%n::'a::type. inverse (x n)) (inverse x0) (mtop mr1, g))"
   3.894    by (import nets NET_INV)
   3.895  
   3.896  lemma NET_DIV: "ALL g::'a::type => 'a::type => bool.
   3.897     dorder g -->
   3.898     (ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real.
   3.899 -       tends x x0 (mtop mr1, g) &
   3.900 -       tends y y0 (mtop mr1, g) & y0 ~= (0::real) -->
   3.901 +       tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) & y0 ~= 0 -->
   3.902         tends (%xa::'a::type. x xa / y xa) (x0 / y0) (mtop mr1, g))"
   3.903    by (import nets NET_DIV)
   3.904  
   3.905 @@ -1764,7 +1767,7 @@
   3.906  lemma SEQ_SUC: "ALL (f::nat => real) l::real. --> f l = --> (%n::nat. f (Suc n)) l"
   3.907    by (import seq SEQ_SUC)
   3.908  
   3.909 -lemma SEQ_ABS: "ALL f::nat => real. --> (%n::nat. abs (f n)) (0::real) = --> f (0::real)"
   3.910 +lemma SEQ_ABS: "ALL f::nat => real. --> (%n::nat. abs (f n)) 0 = --> f 0"
   3.911    by (import seq SEQ_ABS)
   3.912  
   3.913  lemma SEQ_ABS_IMP: "(All::((nat => real) => bool) => bool)
   3.914 @@ -1929,10 +1932,9 @@
   3.915  
   3.916  constdefs
   3.917    sums :: "(nat => real) => real => bool" 
   3.918 -  "sums == %f::nat => real. --> (%n::nat. real.sum (0::nat, n) f)"
   3.919 -
   3.920 -lemma sums: "ALL (f::nat => real) s::real.
   3.921 -   sums f s = --> (%n::nat. real.sum (0::nat, n) f) s"
   3.922 +  "sums == %f::nat => real. --> (%n::nat. real.sum (0, n) f)"
   3.923 +
   3.924 +lemma sums: "ALL (f::nat => real) s::real. sums f s = --> (%n::nat. real.sum (0, n) f) s"
   3.925    by (import seq sums)
   3.926  
   3.927  constdefs
   3.928 @@ -2538,7 +2540,7 @@
   3.929    by (import lim LIM_DIV)
   3.930  
   3.931  lemma LIM_NULL: "ALL (f::real => real) (l::real) x::real.
   3.932 -   tends_real_real f l x = tends_real_real (%x::real. f x - l) (0::real) x"
   3.933 +   tends_real_real f l x = tends_real_real (%x::real. f x - l) 0 x"
   3.934    by (import lim LIM_NULL)
   3.935  
   3.936  lemma LIM_X: "ALL x0::real. tends_real_real (%x::real. x) x0 x0"
   3.937 @@ -2614,21 +2616,19 @@
   3.938    diffl :: "(real => real) => real => real => bool" 
   3.939    "diffl ==
   3.940  %(f::real => real) (l::real) x::real.
   3.941 -   tends_real_real (%h::real. (f (x + h) - f x) / h) l (0::real)"
   3.942 +   tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
   3.943  
   3.944  lemma diffl: "ALL (f::real => real) (l::real) x::real.
   3.945 -   diffl f l x =
   3.946 -   tends_real_real (%h::real. (f (x + h) - f x) / h) l (0::real)"
   3.947 +   diffl f l x = tends_real_real (%h::real. (f (x + h) - f x) / h) l 0"
   3.948    by (import lim diffl)
   3.949  
   3.950  constdefs
   3.951    contl :: "(real => real) => real => bool" 
   3.952    "contl ==
   3.953 -%(f::real => real) x::real.
   3.954 -   tends_real_real (%h::real. f (x + h)) (f x) (0::real)"
   3.955 +%(f::real => real) x::real. tends_real_real (%h::real. f (x + h)) (f x) 0"
   3.956  
   3.957  lemma contl: "ALL (f::real => real) x::real.
   3.958 -   contl f x = tends_real_real (%h::real. f (x + h)) (f x) (0::real)"
   3.959 +   contl f x = tends_real_real (%h::real. f (x + h)) (f x) 0"
   3.960    by (import lim contl)
   3.961  
   3.962  constdefs
   3.963 @@ -2839,7 +2839,7 @@
   3.964                                ((op =::real => real => bool) (f x) y))))))))"
   3.965    by (import lim IVT2)
   3.966  
   3.967 -lemma DIFF_CONST: "ALL k::real. All (diffl (%x::real. k) (0::real))"
   3.968 +lemma DIFF_CONST: "ALL k::real. All (diffl (%x::real. k) 0)"
   3.969    by (import lim DIFF_CONST)
   3.970  
   3.971  lemma DIFF_ADD: "(All::((real => real) => bool) => bool)
   3.972 @@ -2960,11 +2960,10 @@
   3.973                              ((op *::real => real => real) l m) x))))))"
   3.974    by (import lim DIFF_CHAIN)
   3.975  
   3.976 -lemma DIFF_X: "All (diffl (%x::real. x) (1::real))"
   3.977 +lemma DIFF_X: "All (diffl (%x::real. x) 1)"
   3.978    by (import lim DIFF_X)
   3.979  
   3.980 -lemma DIFF_POW: "ALL (n::nat) x::real.
   3.981 -   diffl (%x::real. x ^ n) (real n * x ^ (n - (1::nat))) x"
   3.982 +lemma DIFF_POW: "ALL (n::nat) x::real. diffl (%x::real. x ^ n) (real n * x ^ (n - 1)) x"
   3.983    by (import lim DIFF_POW)
   3.984  
   3.985  lemma DIFF_XM1: "(All::(real => bool) => bool)
   3.986 @@ -3877,18 +3876,18 @@
   3.987  ;setup_theory powser
   3.988  
   3.989  lemma POWDIFF_LEMMA: "ALL (n::nat) (x::real) y::real.
   3.990 -   real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (Suc n - p)) =
   3.991 -   y * real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
   3.992 +   real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (Suc n - p)) =
   3.993 +   y * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
   3.994    by (import powser POWDIFF_LEMMA)
   3.995  
   3.996  lemma POWDIFF: "ALL (n::nat) (x::real) y::real.
   3.997     x ^ Suc n - y ^ Suc n =
   3.998 -   (x - y) * real.sum (0::nat, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
   3.999 +   (x - y) * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))"
  3.1000    by (import powser POWDIFF)
  3.1001  
  3.1002  lemma POWREV: "ALL (n::nat) (x::real) y::real.
  3.1003 -   real.sum (0::nat, Suc n) (%xa::nat. x ^ xa * y ^ (n - xa)) =
  3.1004 -   real.sum (0::nat, Suc n) (%xa::nat. x ^ (n - xa) * y ^ xa)"
  3.1005 +   real.sum (0, Suc n) (%xa::nat. x ^ xa * y ^ (n - xa)) =
  3.1006 +   real.sum (0, Suc n) (%xa::nat. x ^ (n - xa) * y ^ xa)"
  3.1007    by (import powser POWREV)
  3.1008  
  3.1009  lemma POWSER_INSIDEA: "(All::((nat => real) => bool) => bool)
  3.1010 @@ -3943,15 +3942,15 @@
  3.1011    by (import powser DIFFS_NEG)
  3.1012  
  3.1013  lemma DIFFS_LEMMA: "ALL (n::nat) (c::nat => real) x::real.
  3.1014 -   real.sum (0::nat, n) (%n::nat. diffs c n * x ^ n) =
  3.1015 -   real.sum (0::nat, n) (%n::nat. real n * (c n * x ^ (n - (1::nat)))) +
  3.1016 -   real n * (c n * x ^ (n - (1::nat)))"
  3.1017 +   real.sum (0, n) (%n::nat. diffs c n * x ^ n) =
  3.1018 +   real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) +
  3.1019 +   real n * (c n * x ^ (n - 1))"
  3.1020    by (import powser DIFFS_LEMMA)
  3.1021  
  3.1022  lemma DIFFS_LEMMA2: "ALL (n::nat) (c::nat => real) x::real.
  3.1023 -   real.sum (0::nat, n) (%n::nat. real n * (c n * x ^ (n - (1::nat)))) =
  3.1024 -   real.sum (0::nat, n) (%n::nat. diffs c n * x ^ n) -
  3.1025 -   real n * (c n * x ^ (n - (1::nat)))"
  3.1026 +   real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) =
  3.1027 +   real.sum (0, n) (%n::nat. diffs c n * x ^ n) -
  3.1028 +   real n * (c n * x ^ (n - 1))"
  3.1029    by (import powser DIFFS_LEMMA2)
  3.1030  
  3.1031  lemma DIFFS_EQUIV: "(All::((nat => real) => bool) => bool)
  3.1032 @@ -3978,8 +3977,8 @@
  3.1033    by (import powser DIFFS_EQUIV)
  3.1034  
  3.1035  lemma TERMDIFF_LEMMA1: "ALL (m::nat) (z::real) h::real.
  3.1036 -   real.sum (0::nat, m) (%p::nat. (z + h) ^ (m - p) * z ^ p - z ^ m) =
  3.1037 -   real.sum (0::nat, m) (%p::nat. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))"
  3.1038 +   real.sum (0, m) (%p::nat. (z + h) ^ (m - p) * z ^ p - z ^ m) =
  3.1039 +   real.sum (0, m) (%p::nat. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))"
  3.1040    by (import powser TERMDIFF_LEMMA1)
  3.1041  
  3.1042  lemma TERMDIFF_LEMMA2: "(All::(real => bool) => bool)
  3.1043 @@ -4185,23 +4184,17 @@
  3.1044  
  3.1045  constdefs
  3.1046    cos :: "real => real" 
  3.1047 -  "(cos ==
  3.1048 - (%(x::real).
  3.1049 -     (suminf
  3.1050 -       (%(n::nat).
  3.1051 -           ((if (EVEN n)
  3.1052 -             then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
  3.1053 -             else (0::real)) *
  3.1054 -            (x ^ n))))))"
  3.1055 -
  3.1056 -lemma cos: "(ALL (x::real).
  3.1057 -    ((cos x) =
  3.1058 -     (suminf
  3.1059 -       (%(n::nat).
  3.1060 -           ((if (EVEN n)
  3.1061 -             then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
  3.1062 -             else (0::real)) *
  3.1063 -            (x ^ n))))))"
  3.1064 +  "cos ==
  3.1065 +%x::real.
  3.1066 +   suminf
  3.1067 +    (%n::nat.
  3.1068 +        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
  3.1069 +
  3.1070 +lemma cos: "ALL x::real.
  3.1071 +   cos x =
  3.1072 +   suminf
  3.1073 +    (%n::nat.
  3.1074 +        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)"
  3.1075    by (import transc cos)
  3.1076  
  3.1077  constdefs
  3.1078 @@ -4210,18 +4203,14 @@
  3.1079  %x::real.
  3.1080     suminf
  3.1081      (%n::nat.
  3.1082 -        (if EVEN n then 0::real
  3.1083 -         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
  3.1084 -              real (FACT n)) *
  3.1085 +        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
  3.1086          x ^ n)"
  3.1087  
  3.1088  lemma sin: "ALL x::real.
  3.1089     sin x =
  3.1090     suminf
  3.1091      (%n::nat.
  3.1092 -        (if EVEN n then 0::real
  3.1093 -         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
  3.1094 -              real (FACT n)) *
  3.1095 +        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
  3.1096          x ^ n)"
  3.1097    by (import transc sin)
  3.1098  
  3.1099 @@ -4231,56 +4220,36 @@
  3.1100  lemma SIN_CONVERGES: "ALL x::real.
  3.1101     sums
  3.1102      (%n::nat.
  3.1103 -        (if EVEN n then 0::real
  3.1104 -         else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
  3.1105 -              real (FACT n)) *
  3.1106 +        (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
  3.1107          x ^ n)
  3.1108      (sin x)"
  3.1109    by (import transc SIN_CONVERGES)
  3.1110  
  3.1111 -lemma COS_CONVERGES: "(ALL (x::real).
  3.1112 -    (sums
  3.1113 -      (%(n::nat).
  3.1114 -          ((if (EVEN n)
  3.1115 -            then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
  3.1116 -            else (0::real)) *
  3.1117 -           (x ^ n)))
  3.1118 -      (cos x)))"
  3.1119 +lemma COS_CONVERGES: "ALL x::real.
  3.1120 +   sums
  3.1121 +    (%n::nat.
  3.1122 +        (if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)
  3.1123 +    (cos x)"
  3.1124    by (import transc COS_CONVERGES)
  3.1125  
  3.1126  lemma EXP_FDIFF: "diffs (%n::nat. inverse (real (FACT n))) =
  3.1127  (%n::nat. inverse (real (FACT n)))"
  3.1128    by (import transc EXP_FDIFF)
  3.1129  
  3.1130 -lemma SIN_FDIFF: "((diffs
  3.1131 -   (%(n::nat).
  3.1132 -       (if (EVEN n) then (0::real)
  3.1133 -        else (((- (1::real)) ^ ((n - (1::nat)) div (2::nat))) /
  3.1134 -              (real (FACT n)))))) =
  3.1135 - (%(n::nat).
  3.1136 -     (if (EVEN n)
  3.1137 -      then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
  3.1138 -      else (0::real))))"
  3.1139 +lemma SIN_FDIFF: "diffs
  3.1140 + (%n::nat. if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) =
  3.1141 +(%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0)"
  3.1142    by (import transc SIN_FDIFF)
  3.1143  
  3.1144 -lemma COS_FDIFF: "((diffs
  3.1145 -   (%(n::nat).
  3.1146 -       (if (EVEN n)
  3.1147 -        then (((- (1::real)) ^ (n div (2::nat))) / (real (FACT n)))
  3.1148 -        else (0::real)))) =
  3.1149 - (%(n::nat).
  3.1150 -     (- (if (EVEN n) then (0::real)
  3.1151 -         else (((- (1::real)) ^ ((n - (1::nat)) div (2::nat))) /
  3.1152 -               (real (FACT n)))))))"
  3.1153 +lemma COS_FDIFF: "diffs (%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) =
  3.1154 +(%n::nat. - (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)))"
  3.1155    by (import transc COS_FDIFF)
  3.1156  
  3.1157  lemma SIN_NEGLEMMA: "ALL x::real.
  3.1158     - sin x =
  3.1159     suminf
  3.1160      (%n::nat.
  3.1161 -        - ((if EVEN n then 0::real
  3.1162 -            else (- (1::real)) ^ ((n - (1::nat)) div (2::nat)) /
  3.1163 -                 real (FACT n)) *
  3.1164 +        - ((if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) *
  3.1165             x ^ n))"
  3.1166    by (import transc SIN_NEGLEMMA)
  3.1167  
  3.1168 @@ -4402,22 +4371,22 @@
  3.1169                       x))))))))))"
  3.1170    by (import transc DIFF_COMPOSITE)
  3.1171  
  3.1172 -lemma EXP_0: "exp (0::real) = (1::real)"
  3.1173 +lemma EXP_0: "exp 0 = 1"
  3.1174    by (import transc EXP_0)
  3.1175  
  3.1176 -lemma EXP_LE_X: "ALL x>=0::real. (1::real) + x <= exp x"
  3.1177 +lemma EXP_LE_X: "ALL x>=0. 1 + x <= exp x"
  3.1178    by (import transc EXP_LE_X)
  3.1179  
  3.1180 -lemma EXP_LT_1: "ALL x>0::real. (1::real) < exp x"
  3.1181 +lemma EXP_LT_1: "ALL x>0. 1 < exp x"
  3.1182    by (import transc EXP_LT_1)
  3.1183  
  3.1184  lemma EXP_ADD_MUL: "ALL (x::real) y::real. exp (x + y) * exp (- x) = exp y"
  3.1185    by (import transc EXP_ADD_MUL)
  3.1186  
  3.1187 -lemma EXP_NEG_MUL: "ALL x::real. exp x * exp (- x) = (1::real)"
  3.1188 +lemma EXP_NEG_MUL: "ALL x::real. exp x * exp (- x) = 1"
  3.1189    by (import transc EXP_NEG_MUL)
  3.1190  
  3.1191 -lemma EXP_NEG_MUL2: "ALL x::real. exp (- x) * exp x = (1::real)"
  3.1192 +lemma EXP_NEG_MUL2: "ALL x::real. exp (- x) * exp x = 1"
  3.1193    by (import transc EXP_NEG_MUL2)
  3.1194  
  3.1195  lemma EXP_NEG: "ALL x::real. exp (- x) = inverse (exp x)"
  3.1196 @@ -4426,13 +4395,13 @@
  3.1197  lemma EXP_ADD: "ALL (x::real) y::real. exp (x + y) = exp x * exp y"
  3.1198    by (import transc EXP_ADD)
  3.1199  
  3.1200 -lemma EXP_POS_LE: "ALL x::real. (0::real) <= exp x"
  3.1201 +lemma EXP_POS_LE: "ALL x::real. 0 <= exp x"
  3.1202    by (import transc EXP_POS_LE)
  3.1203  
  3.1204 -lemma EXP_NZ: "ALL x::real. exp x ~= (0::real)"
  3.1205 +lemma EXP_NZ: "ALL x::real. exp x ~= 0"
  3.1206    by (import transc EXP_NZ)
  3.1207  
  3.1208 -lemma EXP_POS_LT: "ALL x::real. (0::real) < exp x"
  3.1209 +lemma EXP_POS_LT: "ALL x::real. 0 < exp x"
  3.1210    by (import transc EXP_POS_LT)
  3.1211  
  3.1212  lemma EXP_N: "ALL (n::nat) x::real. exp (real n * x) = exp x ^ n"
  3.1213 @@ -4459,10 +4428,10 @@
  3.1214  lemma EXP_INJ: "ALL (x::real) y::real. (exp x = exp y) = (x = y)"
  3.1215    by (import transc EXP_INJ)
  3.1216  
  3.1217 -lemma EXP_TOTAL_LEMMA: "ALL y>=1::real. EX x>=0::real. x <= y - (1::real) & exp x = y"
  3.1218 +lemma EXP_TOTAL_LEMMA: "ALL y>=1. EX x>=0. x <= y - 1 & exp x = y"
  3.1219    by (import transc EXP_TOTAL_LEMMA)
  3.1220  
  3.1221 -lemma EXP_TOTAL: "ALL y>0::real. EX x::real. exp x = y"
  3.1222 +lemma EXP_TOTAL: "ALL y>0. EX x::real. exp x = y"
  3.1223    by (import transc EXP_TOTAL)
  3.1224  
  3.1225  constdefs
  3.1226 @@ -4475,7 +4444,7 @@
  3.1227  lemma LN_EXP: "ALL x::real. ln (exp x) = x"
  3.1228    by (import transc LN_EXP)
  3.1229  
  3.1230 -lemma EXP_LN: "ALL x::real. (exp (ln x) = x) = ((0::real) < x)"
  3.1231 +lemma EXP_LN: "ALL x::real. (exp (ln x) = x) = (0 < x)"
  3.1232    by (import transc EXP_LN)
  3.1233  
  3.1234  lemma LN_MUL: "(All::(real => bool) => bool)
  3.1235 @@ -4506,10 +4475,10 @@
  3.1236               ((op =::real => real => bool) x y))))"
  3.1237    by (import transc LN_INJ)
  3.1238  
  3.1239 -lemma LN_1: "ln (1::real) = (0::real)"
  3.1240 +lemma LN_1: "ln 1 = 0"
  3.1241    by (import transc LN_1)
  3.1242  
  3.1243 -lemma LN_INV: "ALL x>0::real. ln (inverse x) = - ln x"
  3.1244 +lemma LN_INV: "ALL x>0. ln (inverse x) = - ln x"
  3.1245    by (import transc LN_INV)
  3.1246  
  3.1247  lemma LN_DIV: "(All::(real => bool) => bool)
  3.1248 @@ -4566,13 +4535,13 @@
  3.1249                 ((ln::real => real) x)))))"
  3.1250    by (import transc LN_POW)
  3.1251  
  3.1252 -lemma LN_LE: "ALL x>=0::real. ln ((1::real) + x) <= x"
  3.1253 +lemma LN_LE: "ALL x>=0. ln (1 + x) <= x"
  3.1254    by (import transc LN_LE)
  3.1255  
  3.1256 -lemma LN_LT_X: "ALL x>0::real. ln x < x"
  3.1257 +lemma LN_LT_X: "ALL x>0. ln x < x"
  3.1258    by (import transc LN_LT_X)
  3.1259  
  3.1260 -lemma LN_POS: "ALL x>=1::real. (0::real) <= ln x"
  3.1261 +lemma LN_POS: "ALL x>=1. 0 <= ln x"
  3.1262    by (import transc LN_POS)
  3.1263  
  3.1264  constdefs
  3.1265 @@ -4606,9 +4575,9 @@
  3.1266  
  3.1267  constdefs
  3.1268    sqrt :: "real => real" 
  3.1269 -  "sqrt == root (2::nat)"
  3.1270 -
  3.1271 -lemma sqrt: "ALL x::real. sqrt x = root (2::nat) x"
  3.1272 +  "sqrt == root 2"
  3.1273 +
  3.1274 +lemma sqrt: "ALL x::real. sqrt x = root 2 x"
  3.1275    by (import transc sqrt)
  3.1276  
  3.1277  lemma ROOT_LT_LEMMA: "(All::(nat => bool) => bool)
  3.1278 @@ -4639,10 +4608,10 @@
  3.1279                   ((real::nat => real) ((Suc::nat => nat) n)))))))"
  3.1280    by (import transc ROOT_LN)
  3.1281  
  3.1282 -lemma ROOT_0: "ALL n::nat. root (Suc n) (0::real) = (0::real)"
  3.1283 +lemma ROOT_0: "ALL n::nat. root (Suc n) 0 = 0"
  3.1284    by (import transc ROOT_0)
  3.1285  
  3.1286 -lemma ROOT_1: "ALL n::nat. root (Suc n) (1::real) = (1::real)"
  3.1287 +lemma ROOT_1: "ALL n::nat. root (Suc n) 1 = 1"
  3.1288    by (import transc ROOT_1)
  3.1289  
  3.1290  lemma ROOT_POS_LT: "(All::(nat => bool) => bool)
  3.1291 @@ -4773,22 +4742,22 @@
  3.1292               ((root::nat => real => real) ((Suc::nat => nat) n) y))))"
  3.1293    by (import transc ROOT_MONO_LE)
  3.1294  
  3.1295 -lemma SQRT_0: "sqrt (0::real) = (0::real)"
  3.1296 +lemma SQRT_0: "sqrt 0 = 0"
  3.1297    by (import transc SQRT_0)
  3.1298  
  3.1299 -lemma SQRT_1: "sqrt (1::real) = (1::real)"
  3.1300 +lemma SQRT_1: "sqrt 1 = 1"
  3.1301    by (import transc SQRT_1)
  3.1302  
  3.1303 -lemma SQRT_POS_LT: "ALL x>0::real. (0::real) < sqrt x"
  3.1304 +lemma SQRT_POS_LT: "ALL x>0. 0 < sqrt x"
  3.1305    by (import transc SQRT_POS_LT)
  3.1306  
  3.1307 -lemma SQRT_POS_LE: "ALL x>=0::real. (0::real) <= sqrt x"
  3.1308 +lemma SQRT_POS_LE: "ALL x>=0. 0 <= sqrt x"
  3.1309    by (import transc SQRT_POS_LE)
  3.1310  
  3.1311 -lemma SQRT_POW2: "ALL x::real. (sqrt x ^ 2 = x) = ((0::real) <= x)"
  3.1312 +lemma SQRT_POW2: "ALL x::real. (sqrt x ^ 2 = x) = (0 <= x)"
  3.1313    by (import transc SQRT_POW2)
  3.1314  
  3.1315 -lemma SQRT_POW_2: "ALL x>=0::real. sqrt x ^ 2 = x"
  3.1316 +lemma SQRT_POW_2: "ALL x>=0. sqrt x ^ 2 = x"
  3.1317    by (import transc SQRT_POW_2)
  3.1318  
  3.1319  lemma POW_2_SQRT: "(op -->::bool => bool => bool)
  3.1320 @@ -4837,7 +4806,7 @@
  3.1321                 ((sqrt::real => real) xa)))))"
  3.1322    by (import transc SQRT_MUL)
  3.1323  
  3.1324 -lemma SQRT_INV: "ALL x>=0::real. sqrt (inverse x) = inverse (sqrt x)"
  3.1325 +lemma SQRT_INV: "ALL x>=0. sqrt (inverse x) = inverse (sqrt x)"
  3.1326    by (import transc SQRT_INV)
  3.1327  
  3.1328  lemma SQRT_DIV: "(All::(real => bool) => bool)
  3.1329 @@ -4891,7 +4860,7 @@
  3.1330                  (bit.B0::bit)))))))"
  3.1331    by (import transc SQRT_EVEN_POW2)
  3.1332  
  3.1333 -lemma REAL_DIV_SQRT: "ALL x>=0::real. x / sqrt x = sqrt x"
  3.1334 +lemma REAL_DIV_SQRT: "ALL x>=0. x / sqrt x = sqrt x"
  3.1335    by (import transc REAL_DIV_SQRT)
  3.1336  
  3.1337  lemma SQRT_EQ: "(All::(real => bool) => bool)
  3.1338 @@ -4912,34 +4881,34 @@
  3.1339             ((op =::real => real => bool) x ((sqrt::real => real) y))))"
  3.1340    by (import transc SQRT_EQ)
  3.1341  
  3.1342 -lemma SIN_0: "sin (0::real) = (0::real)"
  3.1343 +lemma SIN_0: "sin 0 = 0"
  3.1344    by (import transc SIN_0)
  3.1345  
  3.1346 -lemma COS_0: "cos (0::real) = (1::real)"
  3.1347 +lemma COS_0: "cos 0 = 1"
  3.1348    by (import transc COS_0)
  3.1349  
  3.1350 -lemma SIN_CIRCLE: "ALL x::real. sin x ^ 2 + cos x ^ 2 = (1::real)"
  3.1351 +lemma SIN_CIRCLE: "ALL x::real. sin x ^ 2 + cos x ^ 2 = 1"
  3.1352    by (import transc SIN_CIRCLE)
  3.1353  
  3.1354 -lemma SIN_BOUND: "ALL x::real. abs (sin x) <= (1::real)"
  3.1355 +lemma SIN_BOUND: "ALL x::real. abs (sin x) <= 1"
  3.1356    by (import transc SIN_BOUND)
  3.1357  
  3.1358 -lemma SIN_BOUNDS: "ALL x::real. - (1::real) <= sin x & sin x <= (1::real)"
  3.1359 +lemma SIN_BOUNDS: "ALL x::real. - 1 <= sin x & sin x <= 1"
  3.1360    by (import transc SIN_BOUNDS)
  3.1361  
  3.1362 -lemma COS_BOUND: "ALL x::real. abs (cos x) <= (1::real)"
  3.1363 +lemma COS_BOUND: "ALL x::real. abs (cos x) <= 1"
  3.1364    by (import transc COS_BOUND)
  3.1365  
  3.1366 -lemma COS_BOUNDS: "ALL x::real. - (1::real) <= cos x & cos x <= (1::real)"
  3.1367 +lemma COS_BOUNDS: "ALL x::real. - 1 <= cos x & cos x <= 1"
  3.1368    by (import transc COS_BOUNDS)
  3.1369  
  3.1370  lemma SIN_COS_ADD: "ALL (x::real) y::real.
  3.1371     (sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 +
  3.1372     (cos (x + y) - (cos x * cos y - sin x * sin y)) ^ 2 =
  3.1373 -   (0::real)"
  3.1374 +   0"
  3.1375    by (import transc SIN_COS_ADD)
  3.1376  
  3.1377 -lemma SIN_COS_NEG: "ALL x::real. (sin (- x) + sin x) ^ 2 + (cos (- x) - cos x) ^ 2 = (0::real)"
  3.1378 +lemma SIN_COS_NEG: "ALL x::real. (sin (- x) + sin x) ^ 2 + (cos (- x) - cos x) ^ 2 = 0"
  3.1379    by (import transc SIN_COS_NEG)
  3.1380  
  3.1381  lemma SIN_ADD: "ALL (x::real) y::real. sin (x + y) = sin x * cos y + cos x * sin y"
  3.1382 @@ -4954,17 +4923,14 @@
  3.1383  lemma COS_NEG: "ALL x::real. cos (- x) = cos x"
  3.1384    by (import transc COS_NEG)
  3.1385  
  3.1386 -lemma SIN_DOUBLE: "ALL x::real. sin ((2::real) * x) = (2::real) * (sin x * cos x)"
  3.1387 +lemma SIN_DOUBLE: "ALL x::real. sin (2 * x) = 2 * (sin x * cos x)"
  3.1388    by (import transc SIN_DOUBLE)
  3.1389  
  3.1390 -lemma COS_DOUBLE: "ALL x::real. cos ((2::real) * x) = cos x ^ 2 - sin x ^ 2"
  3.1391 +lemma COS_DOUBLE: "ALL x::real. cos (2 * x) = cos x ^ 2 - sin x ^ 2"
  3.1392    by (import transc COS_DOUBLE)
  3.1393  
  3.1394  lemma SIN_PAIRED: "ALL x::real.
  3.1395 -   sums
  3.1396 -    (%n::nat.
  3.1397 -        (- (1::real)) ^ n / real (FACT ((2::nat) * n + (1::nat))) *
  3.1398 -        x ^ ((2::nat) * n + (1::nat)))
  3.1399 +   sums (%n::nat. (- 1) ^ n / real (FACT (2 * n + 1)) * x ^ (2 * n + 1))
  3.1400      (sin x)"
  3.1401    by (import transc SIN_PAIRED)
  3.1402  
  3.1403 @@ -4982,55 +4948,47 @@
  3.1404    by (import transc SIN_POS)
  3.1405  
  3.1406  lemma COS_PAIRED: "ALL x::real.
  3.1407 -   sums
  3.1408 -    (%n::nat.
  3.1409 -        (- (1::real)) ^ n / real (FACT ((2::nat) * n)) * x ^ ((2::nat) * n))
  3.1410 -    (cos x)"
  3.1411 +   sums (%n::nat. (- 1) ^ n / real (FACT (2 * n)) * x ^ (2 * n)) (cos x)"
  3.1412    by (import transc COS_PAIRED)
  3.1413  
  3.1414 -lemma COS_2: "cos (2::real) < (0::real)"
  3.1415 +lemma COS_2: "cos 2 < 0"
  3.1416    by (import transc COS_2)
  3.1417  
  3.1418 -lemma COS_ISZERO: "EX! x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real)"
  3.1419 +lemma COS_ISZERO: "EX! x::real. 0 <= x & x <= 2 & cos x = 0"
  3.1420    by (import transc COS_ISZERO)
  3.1421  
  3.1422  constdefs
  3.1423    pi :: "real" 
  3.1424 -  "pi ==
  3.1425 -(2::real) *
  3.1426 -(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
  3.1427 -
  3.1428 -lemma pi: "pi =
  3.1429 -(2::real) *
  3.1430 -(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
  3.1431 +  "pi == 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
  3.1432 +
  3.1433 +lemma pi: "pi = 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
  3.1434    by (import transc pi)
  3.1435  
  3.1436 -lemma PI2: "pi / (2::real) =
  3.1437 -(SOME x::real. (0::real) <= x & x <= (2::real) & cos x = (0::real))"
  3.1438 +lemma PI2: "pi / 2 = (SOME x::real. 0 <= x & x <= 2 & cos x = 0)"
  3.1439    by (import transc PI2)
  3.1440  
  3.1441 -lemma COS_PI2: "cos (pi / (2::real)) = (0::real)"
  3.1442 +lemma COS_PI2: "cos (pi / 2) = 0"
  3.1443    by (import transc COS_PI2)
  3.1444  
  3.1445 -lemma PI2_BOUNDS: "(0::real) < pi / (2::real) & pi / (2::real) < (2::real)"
  3.1446 +lemma PI2_BOUNDS: "0 < pi / 2 & pi / 2 < 2"
  3.1447    by (import transc PI2_BOUNDS)
  3.1448  
  3.1449 -lemma PI_POS: "(0::real) < pi"
  3.1450 +lemma PI_POS: "0 < pi"
  3.1451    by (import transc PI_POS)
  3.1452  
  3.1453 -lemma SIN_PI2: "sin (pi / (2::real)) = (1::real)"
  3.1454 +lemma SIN_PI2: "sin (pi / 2) = 1"
  3.1455    by (import transc SIN_PI2)
  3.1456  
  3.1457 -lemma COS_PI: "cos pi = - (1::real)"
  3.1458 +lemma COS_PI: "cos pi = - 1"
  3.1459    by (import transc COS_PI)
  3.1460  
  3.1461 -lemma SIN_PI: "sin pi = (0::real)"
  3.1462 +lemma SIN_PI: "sin pi = 0"
  3.1463    by (import transc SIN_PI)
  3.1464  
  3.1465 -lemma SIN_COS: "ALL x::real. sin x = cos (pi / (2::real) - x)"
  3.1466 +lemma SIN_COS: "ALL x::real. sin x = cos (pi / 2 - x)"
  3.1467    by (import transc SIN_COS)
  3.1468  
  3.1469 -lemma COS_SIN: "ALL x::real. cos x = sin (pi / (2::real) - x)"
  3.1470 +lemma COS_SIN: "ALL x::real. cos x = sin (pi / 2 - x)"
  3.1471    by (import transc COS_SIN)
  3.1472  
  3.1473  lemma SIN_PERIODIC_PI: "ALL x::real. sin (x + pi) = - sin x"
  3.1474 @@ -5039,16 +4997,16 @@
  3.1475  lemma COS_PERIODIC_PI: "ALL x::real. cos (x + pi) = - cos x"
  3.1476    by (import transc COS_PERIODIC_PI)
  3.1477  
  3.1478 -lemma SIN_PERIODIC: "ALL x::real. sin (x + (2::real) * pi) = sin x"
  3.1479 +lemma SIN_PERIODIC: "ALL x::real. sin (x + 2 * pi) = sin x"
  3.1480    by (import transc SIN_PERIODIC)
  3.1481  
  3.1482 -lemma COS_PERIODIC: "ALL x::real. cos (x + (2::real) * pi) = cos x"
  3.1483 +lemma COS_PERIODIC: "ALL x::real. cos (x + 2 * pi) = cos x"
  3.1484    by (import transc COS_PERIODIC)
  3.1485  
  3.1486 -lemma COS_NPI: "ALL n::nat. cos (real n * pi) = (- (1::real)) ^ n"
  3.1487 +lemma COS_NPI: "ALL n::nat. cos (real n * pi) = (- 1) ^ n"
  3.1488    by (import transc COS_NPI)
  3.1489  
  3.1490 -lemma SIN_NPI: "ALL n::nat. sin (real n * pi) = (0::real)"
  3.1491 +lemma SIN_NPI: "ALL n::nat. sin (real n * pi) = 0"
  3.1492    by (import transc SIN_NPI)
  3.1493  
  3.1494  lemma SIN_POS_PI2: "(All::(real => bool) => bool)
  3.1495 @@ -5259,15 +5217,15 @@
  3.1496    by (import transc SIN_ZERO_LEMMA)
  3.1497  
  3.1498  lemma COS_ZERO: "ALL x::real.
  3.1499 -   (cos x = (0::real)) =
  3.1500 -   ((EX n::nat. ~ EVEN n & x = real n * (pi / (2::real))) |
  3.1501 -    (EX n::nat. ~ EVEN n & x = - (real n * (pi / (2::real)))))"
  3.1502 +   (cos x = 0) =
  3.1503 +   ((EX n::nat. ~ EVEN n & x = real n * (pi / 2)) |
  3.1504 +    (EX n::nat. ~ EVEN n & x = - (real n * (pi / 2))))"
  3.1505    by (import transc COS_ZERO)
  3.1506  
  3.1507  lemma SIN_ZERO: "ALL x::real.
  3.1508 -   (sin x = (0::real)) =
  3.1509 -   ((EX n::nat. EVEN n & x = real n * (pi / (2::real))) |
  3.1510 -    (EX n::nat. EVEN n & x = - (real n * (pi / (2::real)))))"
  3.1511 +   (sin x = 0) =
  3.1512 +   ((EX n::nat. EVEN n & x = real n * (pi / 2)) |
  3.1513 +    (EX n::nat. EVEN n & x = - (real n * (pi / 2))))"
  3.1514    by (import transc SIN_ZERO)
  3.1515  
  3.1516  constdefs
  3.1517 @@ -5277,19 +5235,19 @@
  3.1518  lemma tan: "ALL x::real. tan x = sin x / cos x"
  3.1519    by (import transc tan)
  3.1520  
  3.1521 -lemma TAN_0: "tan (0::real) = (0::real)"
  3.1522 +lemma TAN_0: "tan 0 = 0"
  3.1523    by (import transc TAN_0)
  3.1524  
  3.1525 -lemma TAN_PI: "tan pi = (0::real)"
  3.1526 +lemma TAN_PI: "tan pi = 0"
  3.1527    by (import transc TAN_PI)
  3.1528  
  3.1529 -lemma TAN_NPI: "ALL n::nat. tan (real n * pi) = (0::real)"
  3.1530 +lemma TAN_NPI: "ALL n::nat. tan (real n * pi) = 0"
  3.1531    by (import transc TAN_NPI)
  3.1532  
  3.1533  lemma TAN_NEG: "ALL x::real. tan (- x) = - tan x"
  3.1534    by (import transc TAN_NEG)
  3.1535  
  3.1536 -lemma TAN_PERIODIC: "ALL x::real. tan (x + (2::real) * pi) = tan x"
  3.1537 +lemma TAN_PERIODIC: "ALL x::real. tan (x + 2 * pi) = tan x"
  3.1538    by (import transc TAN_PERIODIC)
  3.1539  
  3.1540  lemma TAN_ADD: "(All::(real => bool) => bool)
  3.1541 @@ -5393,43 +5351,35 @@
  3.1542          x))"
  3.1543    by (import transc DIFF_TAN)
  3.1544  
  3.1545 -lemma TAN_TOTAL_LEMMA: "ALL y>0::real. EX x>0::real. x < pi / (2::real) & y < tan x"
  3.1546 +lemma TAN_TOTAL_LEMMA: "ALL y>0. EX x>0. x < pi / 2 & y < tan x"
  3.1547    by (import transc TAN_TOTAL_LEMMA)
  3.1548  
  3.1549 -lemma TAN_TOTAL_POS: "ALL y>=0::real. EX x>=0::real. x < pi / (2::real) & tan x = y"
  3.1550 +lemma TAN_TOTAL_POS: "ALL y>=0. EX x>=0. x < pi / 2 & tan x = y"
  3.1551    by (import transc TAN_TOTAL_POS)
  3.1552  
  3.1553 -lemma TAN_TOTAL: "ALL y::real.
  3.1554 -   EX! x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y"
  3.1555 +lemma TAN_TOTAL: "ALL y::real. EX! x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
  3.1556    by (import transc TAN_TOTAL)
  3.1557  
  3.1558  constdefs
  3.1559    asn :: "real => real" 
  3.1560 -  "asn ==
  3.1561 -%y::real.
  3.1562 -   SOME x::real. - (pi / (2::real)) <= x & x <= pi / (2::real) & sin x = y"
  3.1563 +  "asn == %y::real. SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y"
  3.1564  
  3.1565  lemma asn: "ALL y::real.
  3.1566 -   asn y =
  3.1567 -   (SOME x::real. - (pi / (2::real)) <= x & x <= pi / (2::real) & sin x = y)"
  3.1568 +   asn y = (SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y)"
  3.1569    by (import transc asn)
  3.1570  
  3.1571  constdefs
  3.1572    acs :: "real => real" 
  3.1573 -  "acs == %y::real. SOME x::real. (0::real) <= x & x <= pi & cos x = y"
  3.1574 -
  3.1575 -lemma acs: "ALL y::real. acs y = (SOME x::real. (0::real) <= x & x <= pi & cos x = y)"
  3.1576 +  "acs == %y::real. SOME x::real. 0 <= x & x <= pi & cos x = y"
  3.1577 +
  3.1578 +lemma acs: "ALL y::real. acs y = (SOME x::real. 0 <= x & x <= pi & cos x = y)"
  3.1579    by (import transc acs)
  3.1580  
  3.1581  constdefs
  3.1582    atn :: "real => real" 
  3.1583 -  "atn ==
  3.1584 -%y::real.
  3.1585 -   SOME x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y"
  3.1586 -
  3.1587 -lemma atn: "ALL y::real.
  3.1588 -   atn y =
  3.1589 -   (SOME x::real. - (pi / (2::real)) < x & x < pi / (2::real) & tan x = y)"
  3.1590 +  "atn == %y::real. SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y"
  3.1591 +
  3.1592 +lemma atn: "ALL y::real. atn y = (SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y)"
  3.1593    by (import transc atn)
  3.1594  
  3.1595  lemma ASN: "(All::(real => bool) => bool)
  3.1596 @@ -5600,14 +5550,13 @@
  3.1597          ((acs::real => real) ((cos::real => real) x)) x))"
  3.1598    by (import transc COS_ACS)
  3.1599  
  3.1600 -lemma ATN: "ALL y::real.
  3.1601 -   - (pi / (2::real)) < atn y & atn y < pi / (2::real) & tan (atn y) = y"
  3.1602 +lemma ATN: "ALL y::real. - (pi / 2) < atn y & atn y < pi / 2 & tan (atn y) = y"
  3.1603    by (import transc ATN)
  3.1604  
  3.1605  lemma ATN_TAN: "ALL x::real. tan (atn x) = x"
  3.1606    by (import transc ATN_TAN)
  3.1607  
  3.1608 -lemma ATN_BOUNDS: "ALL x::real. - (pi / (2::real)) < atn x & atn x < pi / (2::real)"
  3.1609 +lemma ATN_BOUNDS: "ALL x::real. - (pi / 2) < atn x & atn x < pi / 2"
  3.1610    by (import transc ATN_BOUNDS)
  3.1611  
  3.1612  lemma TAN_ATN: "(All::(real => bool) => bool)
  3.1613 @@ -5703,7 +5652,7 @@
  3.1614                    (bit.B0::bit))))))))"
  3.1615    by (import transc COS_SIN_SQ)
  3.1616  
  3.1617 -lemma COS_ATN_NZ: "ALL x::real. cos (atn x) ~= (0::real)"
  3.1618 +lemma COS_ATN_NZ: "ALL x::real. cos (atn x) ~= 0"
  3.1619    by (import transc COS_ATN_NZ)
  3.1620  
  3.1621  lemma COS_ASN_NZ: "(All::(real => bool) => bool)
  3.1622 @@ -5758,7 +5707,7 @@
  3.1623                    (bit.B0::bit))))))))"
  3.1624    by (import transc SIN_COS_SQRT)
  3.1625  
  3.1626 -lemma DIFF_LN: "ALL x>0::real. diffl ln (inverse x) x"
  3.1627 +lemma DIFF_LN: "ALL x>0. diffl ln (inverse x) x"
  3.1628    by (import transc DIFF_LN)
  3.1629  
  3.1630  lemma DIFF_ASN_LEMMA: "(All::(real => bool) => bool)
  3.1631 @@ -5825,7 +5774,7 @@
  3.1632          x))"
  3.1633    by (import transc DIFF_ACS)
  3.1634  
  3.1635 -lemma DIFF_ATN: "ALL x::real. diffl atn (inverse ((1::real) + x ^ 2)) x"
  3.1636 +lemma DIFF_ATN: "ALL x::real. diffl atn (inverse (1 + x ^ 2)) x"
  3.1637    by (import transc DIFF_ATN)
  3.1638  
  3.1639  constdefs
  3.1640 @@ -6002,11 +5951,11 @@
  3.1641    rsum :: "(nat => real) * (nat => real) => (real => real) => real" 
  3.1642    "rsum ==
  3.1643  %(D::nat => real, p::nat => real) f::real => real.
  3.1644 -   real.sum (0::nat, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  3.1645 +   real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  3.1646  
  3.1647  lemma rsum: "ALL (D::nat => real) (p::nat => real) f::real => real.
  3.1648     rsum (D, p) f =
  3.1649 -   real.sum (0::nat, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  3.1650 +   real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))"
  3.1651    by (import transc rsum)
  3.1652  
  3.1653  constdefs
  3.1654 @@ -6519,7 +6468,7 @@
  3.1655                            ((op =::real => real => bool) k1 k2))))))"
  3.1656    by (import transc DINT_UNIQ)
  3.1657  
  3.1658 -lemma INTEGRAL_NULL: "ALL (f::real => real) a::real. Dint (a, a) f (0::real)"
  3.1659 +lemma INTEGRAL_NULL: "ALL (f::real => real) a::real. Dint (a, a) f 0"
  3.1660    by (import transc INTEGRAL_NULL)
  3.1661  
  3.1662  lemma FTC1: "(All::((real => real) => bool) => bool)
  3.1663 @@ -6795,7 +6744,7 @@
  3.1664     EX xa::real.
  3.1665        abs xa <= abs x &
  3.1666        exp x =
  3.1667 -      real.sum (0::nat, n) (%m::nat. x ^ m / real (FACT m)) +
  3.1668 +      real.sum (0, n) (%m::nat. x ^ m / real (FACT m)) +
  3.1669        exp xa / real (FACT n) * x ^ n"
  3.1670    by (import transc MCLAURIN_EXP_LE)
  3.1671  
  3.1672 @@ -6823,7 +6772,7 @@
  3.1673  consts
  3.1674    poly :: "real list => real => real" 
  3.1675  
  3.1676 -specification (poly_primdef: poly) poly_def: "(ALL x::real. poly [] x = (0::real)) &
  3.1677 +specification (poly_primdef: poly) poly_def: "(ALL x::real. poly [] x = 0) &
  3.1678  (ALL (h::real) (t::real list) x::real. poly (h # t) x = h + x * poly t x)"
  3.1679    by (import poly poly_def)
  3.1680  
  3.1681 @@ -6847,9 +6796,9 @@
  3.1682    poly_neg :: "real list => real list" 
  3.1683  
  3.1684  defs
  3.1685 -  poly_neg_primdef: "poly_neg == ## (- (1::real))"
  3.1686 -
  3.1687 -lemma poly_neg_def: "poly_neg = ## (- (1::real))"
  3.1688 +  poly_neg_primdef: "poly_neg == ## (- 1)"
  3.1689 +
  3.1690 +lemma poly_neg_def: "poly_neg = ## (- 1)"
  3.1691    by (import poly poly_neg_def)
  3.1692  
  3.1693  consts
  3.1694 @@ -6858,14 +6807,13 @@
  3.1695  specification (poly_mul_primdef: poly_mul) poly_mul_def: "(ALL l2::real list. poly_mul [] l2 = []) &
  3.1696  (ALL (h::real) (t::real list) l2::real list.
  3.1697      poly_mul (h # t) l2 =
  3.1698 -    (if t = [] then ## h l2
  3.1699 -     else poly_add (## h l2) ((0::real) # poly_mul t l2)))"
  3.1700 +    (if t = [] then ## h l2 else poly_add (## h l2) (0 # poly_mul t l2)))"
  3.1701    by (import poly poly_mul_def)
  3.1702  
  3.1703  consts
  3.1704    poly_exp :: "real list => nat => real list" 
  3.1705  
  3.1706 -specification (poly_exp_primdef: poly_exp) poly_exp_def: "(ALL p::real list. poly_exp p (0::nat) = [1::real]) &
  3.1707 +specification (poly_exp_primdef: poly_exp) poly_exp_def: "(ALL p::real list. poly_exp p 0 = [1]) &
  3.1708  (ALL (p::real list) n::nat. poly_exp p (Suc n) = poly_mul p (poly_exp p n))"
  3.1709    by (import poly poly_exp_def)
  3.1710  
  3.1711 @@ -6879,10 +6827,9 @@
  3.1712  
  3.1713  constdefs
  3.1714    diff :: "real list => real list" 
  3.1715 -  "diff == %l::real list. if l = [] then [] else poly_diff_aux (1::nat) (tl l)"
  3.1716 -
  3.1717 -lemma poly_diff_def: "ALL l::real list.
  3.1718 -   diff l = (if l = [] then [] else poly_diff_aux (1::nat) (tl l))"
  3.1719 +  "diff == %l::real list. if l = [] then [] else poly_diff_aux 1 (tl l)"
  3.1720 +
  3.1721 +lemma poly_diff_def: "ALL l::real list. diff l = (if l = [] then [] else poly_diff_aux 1 (tl l))"
  3.1722    by (import poly poly_diff_def)
  3.1723  
  3.1724  lemma POLY_ADD_CLAUSES: "poly_add [] (p2::real list) = p2 &
  3.1725 @@ -6900,12 +6847,11 @@
  3.1726  lemma POLY_MUL_CLAUSES: "poly_mul [] (p2::real list) = [] &
  3.1727  poly_mul [h1::real] p2 = ## h1 p2 &
  3.1728  poly_mul (h1 # (k1::real) # (t1::real list)) p2 =
  3.1729 -poly_add (## h1 p2) ((0::real) # poly_mul (k1 # t1) p2)"
  3.1730 +poly_add (## h1 p2) (0 # poly_mul (k1 # t1) p2)"
  3.1731    by (import poly POLY_MUL_CLAUSES)
  3.1732  
  3.1733  lemma POLY_DIFF_CLAUSES: "diff [] = [] &
  3.1734 -diff [c::real] = [] &
  3.1735 -diff ((h::real) # (t::real list)) = poly_diff_aux (1::nat) t"
  3.1736 +diff [c::real] = [] & diff ((h::real) # (t::real list)) = poly_diff_aux 1 t"
  3.1737    by (import poly POLY_DIFF_CLAUSES)
  3.1738  
  3.1739  lemma POLY_ADD: "ALL (t::real list) (p2::real list) x::real.
  3.1740 @@ -7054,7 +7000,7 @@
  3.1741    by (import poly POLY_DIFF_NEG)
  3.1742  
  3.1743  lemma POLY_DIFF_MUL_LEMMA: "ALL (x::real list) xa::real.
  3.1744 -   poly (diff (xa # x)) = poly (poly_add ((0::real) # diff x) x)"
  3.1745 +   poly (diff (xa # x)) = poly (poly_add (0 # diff x) x)"
  3.1746    by (import poly POLY_DIFF_MUL_LEMMA)
  3.1747  
  3.1748  lemma POLY_DIFF_MUL: "ALL (t::real list) p2::real list.
  3.1749 @@ -7068,22 +7014,20 @@
  3.1750    by (import poly POLY_DIFF_EXP)
  3.1751  
  3.1752  lemma POLY_DIFF_EXP_PRIME: "ALL (n::nat) a::real.
  3.1753 -   poly (diff (poly_exp [- a, 1::real] (Suc n))) =
  3.1754 -   poly (## (real (Suc n)) (poly_exp [- a, 1::real] n))"
  3.1755 +   poly (diff (poly_exp [- a, 1] (Suc n))) =
  3.1756 +   poly (## (real (Suc n)) (poly_exp [- a, 1] n))"
  3.1757    by (import poly POLY_DIFF_EXP_PRIME)
  3.1758  
  3.1759  lemma POLY_LINEAR_REM: "ALL (t::real list) h::real.
  3.1760     EX (q::real list) r::real.
  3.1761 -      h # t = poly_add [r] (poly_mul [- (a::real), 1::real] q)"
  3.1762 +      h # t = poly_add [r] (poly_mul [- (a::real), 1] q)"
  3.1763    by (import poly POLY_LINEAR_REM)
  3.1764  
  3.1765  lemma POLY_LINEAR_DIVIDES: "ALL (a::real) t::real list.
  3.1766 -   (poly t a = (0::real)) =
  3.1767 -   (t = [] | (EX q::real list. t = poly_mul [- a, 1::real] q))"
  3.1768 +   (poly t a = 0) = (t = [] | (EX q::real list. t = poly_mul [- a, 1] q))"
  3.1769    by (import poly POLY_LINEAR_DIVIDES)
  3.1770  
  3.1771 -lemma POLY_LENGTH_MUL: "ALL x::real list.
  3.1772 -   length (poly_mul [- (a::real), 1::real] x) = Suc (length x)"
  3.1773 +lemma POLY_LENGTH_MUL: "ALL x::real list. length (poly_mul [- (a::real), 1] x) = Suc (length x)"
  3.1774    by (import poly POLY_LENGTH_MUL)
  3.1775  
  3.1776  lemma POLY_ROOTS_INDEX_LEMMA: "(All::(nat => bool) => bool)
  3.1777 @@ -7233,13 +7177,13 @@
  3.1778    by (import poly POLY_MUL_LCANCEL)
  3.1779  
  3.1780  lemma POLY_EXP_EQ_0: "ALL (p::real list) n::nat.
  3.1781 -   (poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= (0::nat))"
  3.1782 +   (poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= 0)"
  3.1783    by (import poly POLY_EXP_EQ_0)
  3.1784  
  3.1785 -lemma POLY_PRIME_EQ_0: "ALL a::real. poly [a, 1::real] ~= poly []"
  3.1786 +lemma POLY_PRIME_EQ_0: "ALL a::real. poly [a, 1] ~= poly []"
  3.1787    by (import poly POLY_PRIME_EQ_0)
  3.1788  
  3.1789 -lemma POLY_EXP_PRIME_EQ_0: "ALL (a::real) n::nat. poly (poly_exp [a, 1::real] n) ~= poly []"
  3.1790 +lemma POLY_EXP_PRIME_EQ_0: "ALL (a::real) n::nat. poly (poly_exp [a, 1] n) ~= poly []"
  3.1791    by (import poly POLY_EXP_PRIME_EQ_0)
  3.1792  
  3.1793  lemma POLY_ZERO_LEMMA: "(All::(real => bool) => bool)
  3.1794 @@ -7258,12 +7202,12 @@
  3.1795                 ((poly::real list => real => real) ([]::real list))))))"
  3.1796    by (import poly POLY_ZERO_LEMMA)
  3.1797  
  3.1798 -lemma POLY_ZERO: "ALL t::real list. (poly t = poly []) = list_all (%c::real. c = (0::real)) t"
  3.1799 +lemma POLY_ZERO: "ALL t::real list. (poly t = poly []) = list_all (%c::real. c = 0) t"
  3.1800    by (import poly POLY_ZERO)
  3.1801  
  3.1802  lemma POLY_DIFF_AUX_ISZERO: "ALL (t::real list) n::nat.
  3.1803 -   list_all (%c::real. c = (0::real)) (poly_diff_aux (Suc n) t) =
  3.1804 -   list_all (%c::real. c = (0::real)) t"
  3.1805 +   list_all (%c::real. c = 0) (poly_diff_aux (Suc n) t) =
  3.1806 +   list_all (%c::real. c = 0) t"
  3.1807    by (import poly POLY_DIFF_AUX_ISZERO)
  3.1808  
  3.1809  lemma POLY_DIFF_ISZERO: "(All::(real list => bool) => bool)
  3.1810 @@ -7320,8 +7264,8 @@
  3.1811    by (import poly poly_divides)
  3.1812  
  3.1813  lemma POLY_PRIMES: "ALL (a::real) (p::real list) q::real list.
  3.1814 -   poly_divides [a, 1::real] (poly_mul p q) =
  3.1815 -   (poly_divides [a, 1::real] p | poly_divides [a, 1::real] q)"
  3.1816 +   poly_divides [a, 1] (poly_mul p q) =
  3.1817 +   (poly_divides [a, 1] p | poly_divides [a, 1] q)"
  3.1818    by (import poly POLY_PRIMES)
  3.1819  
  3.1820  lemma POLY_DIVIDES_REFL: "ALL p::real list. poly_divides p p"
  3.1821 @@ -7496,19 +7440,19 @@
  3.1822    "poly_order ==
  3.1823  %(a::real) p::real list.
  3.1824     SOME n::nat.
  3.1825 -      poly_divides (poly_exp [- a, 1::real] n) p &
  3.1826 -      ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p"
  3.1827 +      poly_divides (poly_exp [- a, 1] n) p &
  3.1828 +      ~ poly_divides (poly_exp [- a, 1] (Suc n)) p"
  3.1829  
  3.1830  lemma poly_order: "ALL (a::real) p::real list.
  3.1831     poly_order a p =
  3.1832     (SOME n::nat.
  3.1833 -       poly_divides (poly_exp [- a, 1::real] n) p &
  3.1834 -       ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p)"
  3.1835 +       poly_divides (poly_exp [- a, 1] n) p &
  3.1836 +       ~ poly_divides (poly_exp [- a, 1] (Suc n)) p)"
  3.1837    by (import poly poly_order)
  3.1838  
  3.1839  lemma ORDER: "ALL (p::real list) (a::real) n::nat.
  3.1840 -   (poly_divides (poly_exp [- a, 1::real] n) p &
  3.1841 -    ~ poly_divides (poly_exp [- a, 1::real] (Suc n)) p) =
  3.1842 +   (poly_divides (poly_exp [- a, 1] n) p &
  3.1843 +    ~ poly_divides (poly_exp [- a, 1] (Suc n)) p) =
  3.1844     (n = poly_order a p & poly p ~= poly [])"
  3.1845    by (import poly ORDER)
  3.1846  
  3.1847 @@ -7592,11 +7536,11 @@
  3.1848    by (import poly ORDER_POLY)
  3.1849  
  3.1850  lemma ORDER_ROOT: "ALL (p::real list) a::real.
  3.1851 -   (poly p a = (0::real)) = (poly p = poly [] | poly_order a p ~= (0::nat))"
  3.1852 +   (poly p a = 0) = (poly p = poly [] | poly_order a p ~= 0)"
  3.1853    by (import poly ORDER_ROOT)
  3.1854  
  3.1855  lemma ORDER_DIVIDES: "ALL (p::real list) (a::real) n::nat.
  3.1856 -   poly_divides (poly_exp [- a, 1::real] n) p =
  3.1857 +   poly_divides (poly_exp [- a, 1] n) p =
  3.1858     (poly p = poly [] | n <= poly_order a p)"
  3.1859    by (import poly ORDER_DIVIDES)
  3.1860  
  3.1861 @@ -7729,17 +7673,16 @@
  3.1862    "rsquarefree ==
  3.1863  %p::real list.
  3.1864     poly p ~= poly [] &
  3.1865 -   (ALL a::real. poly_order a p = (0::nat) | poly_order a p = (1::nat))"
  3.1866 +   (ALL a::real. poly_order a p = 0 | poly_order a p = 1)"
  3.1867  
  3.1868  lemma rsquarefree: "ALL p::real list.
  3.1869     rsquarefree p =
  3.1870     (poly p ~= poly [] &
  3.1871 -    (ALL a::real. poly_order a p = (0::nat) | poly_order a p = (1::nat)))"
  3.1872 +    (ALL a::real. poly_order a p = 0 | poly_order a p = 1))"
  3.1873    by (import poly rsquarefree)
  3.1874  
  3.1875  lemma RSQUAREFREE_ROOTS: "ALL p::real list.
  3.1876 -   rsquarefree p =
  3.1877 -   (ALL a::real. ~ (poly p a = (0::real) & poly (diff p) a = (0::real)))"
  3.1878 +   rsquarefree p = (ALL a::real. ~ (poly p a = 0 & poly (diff p) a = 0))"
  3.1879    by (import poly RSQUAREFREE_ROOTS)
  3.1880  
  3.1881  lemma RSQUAREFREE_DECOMP: "(All::(real list => bool) => bool)
  3.1882 @@ -7827,7 +7770,7 @@
  3.1883  specification (normalize) normalize: "normalize [] = [] &
  3.1884  (ALL (h::real) t::real list.
  3.1885      normalize (h # t) =
  3.1886 -    (if normalize t = [] then if h = (0::real) then [] else [h]
  3.1887 +    (if normalize t = [] then if h = 0 then [] else [h]
  3.1888       else h # normalize t))"
  3.1889    by (import poly normalize)
  3.1890  
     4.1 --- a/src/HOL/Import/HOL/HOL4Vec.thy	Mon Sep 26 15:56:28 2005 +0200
     4.2 +++ b/src/HOL/Import/HOL/HOL4Vec.thy	Mon Sep 26 16:10:19 2005 +0200
     4.3 @@ -142,50 +142,47 @@
     4.4  lemmas word_TY_DEF = typedef_hol2hol4 [OF type_definition_word]
     4.5  
     4.6  consts
     4.7 -  mk_word :: "'a::type list recspace => 'a::type word" 
     4.8 -  dest_word :: "'a::type word => 'a::type list recspace" 
     4.9 +  mk_word :: "'a list recspace => 'a word" 
    4.10 +  dest_word :: "'a word => 'a list recspace" 
    4.11  
    4.12  specification (dest_word mk_word) word_repfns: "(ALL a::'a::type word. mk_word (dest_word a) = a) &
    4.13  (ALL r::'a::type list recspace.
    4.14      (ALL word::'a::type list recspace => bool.
    4.15          (ALL a0::'a::type list recspace.
    4.16 -            (EX a::'a::type list.
    4.17 -                a0 = CONSTR (0::nat) a (%n::nat. BOTTOM)) -->
    4.18 +            (EX a::'a::type list. a0 = CONSTR 0 a (%n::nat. BOTTOM)) -->
    4.19              word a0) -->
    4.20          word r) =
    4.21      (dest_word (mk_word r) = r))"
    4.22    by (import word_base word_repfns)
    4.23  
    4.24  consts
    4.25 -  word_base0 :: "'a::type list => 'a::type word" 
    4.26 +  word_base0 :: "'a list => 'a word" 
    4.27  
    4.28  defs
    4.29 -  word_base0_primdef: "word_base0 ==
    4.30 -%a::'a::type list. mk_word (CONSTR (0::nat) a (%n::nat. BOTTOM))"
    4.31 +  word_base0_primdef: "word_base0 == %a::'a::type list. mk_word (CONSTR 0 a (%n::nat. BOTTOM))"
    4.32  
    4.33 -lemma word_base0_def: "word_base0 =
    4.34 -(%a::'a::type list. mk_word (CONSTR (0::nat) a (%n::nat. BOTTOM)))"
    4.35 +lemma word_base0_def: "word_base0 = (%a::'a::type list. mk_word (CONSTR 0 a (%n::nat. BOTTOM)))"
    4.36    by (import word_base word_base0_def)
    4.37  
    4.38  constdefs
    4.39 -  WORD :: "'a::type list => 'a::type word" 
    4.40 +  WORD :: "'a list => 'a word" 
    4.41    "WORD == word_base0"
    4.42  
    4.43  lemma WORD: "WORD = word_base0"
    4.44    by (import word_base WORD)
    4.45  
    4.46  consts
    4.47 -  word_case :: "('a::type list => 'b::type) => 'a::type word => 'b::type" 
    4.48 +  word_case :: "('a list => 'b) => 'a word => 'b" 
    4.49  
    4.50  specification (word_case_primdef: word_case) word_case_def: "ALL (f::'a::type list => 'b::type) a::'a::type list.
    4.51     word_case f (WORD a) = f a"
    4.52    by (import word_base word_case_def)
    4.53  
    4.54  consts
    4.55 -  word_size :: "('a::type => nat) => 'a::type word => nat" 
    4.56 +  word_size :: "('a => nat) => 'a word => nat" 
    4.57  
    4.58  specification (word_size_primdef: word_size) word_size_def: "ALL (f::'a::type => nat) a::'a::type list.
    4.59 -   word_size f (WORD a) = (1::nat) + list_size f a"
    4.60 +   word_size f (WORD a) = 1 + list_size f a"
    4.61    by (import word_base word_size_def)
    4.62  
    4.63  lemma word_11: "ALL (a::'a::type list) a'::'a::type list. (WORD a = WORD a') = (a = a')"
    4.64 @@ -222,13 +219,13 @@
    4.65    by (import word_base word_cases)
    4.66  
    4.67  consts
    4.68 -  WORDLEN :: "'a::type word => nat" 
    4.69 +  WORDLEN :: "'a word => nat" 
    4.70  
    4.71  specification (WORDLEN) WORDLEN_DEF: "ALL l::'a::type list. WORDLEN (WORD l) = length l"
    4.72    by (import word_base WORDLEN_DEF)
    4.73  
    4.74  consts
    4.75 -  PWORDLEN :: "nat => 'a::type word => bool" 
    4.76 +  PWORDLEN :: "nat => 'a word => bool" 
    4.77  
    4.78  defs
    4.79    PWORDLEN_primdef: "PWORDLEN == %n::nat. GSPEC (%w::'a::type word. (w, WORDLEN w = n))"
    4.80 @@ -242,20 +239,20 @@
    4.81  lemma PWORDLEN: "ALL (n::nat) w::'a::type word. IN w (PWORDLEN n) = (WORDLEN w = n)"
    4.82    by (import word_base PWORDLEN)
    4.83  
    4.84 -lemma PWORDLEN0: "ALL w::'a::type word. IN w (PWORDLEN (0::nat)) --> w = WORD []"
    4.85 +lemma PWORDLEN0: "ALL w::'a::type word. IN w (PWORDLEN 0) --> w = WORD []"
    4.86    by (import word_base PWORDLEN0)
    4.87  
    4.88 -lemma PWORDLEN1: "ALL x::'a::type. IN (WORD [x]) (PWORDLEN (1::nat))"
    4.89 +lemma PWORDLEN1: "ALL x::'a::type. IN (WORD [x]) (PWORDLEN 1)"
    4.90    by (import word_base PWORDLEN1)
    4.91  
    4.92  consts
    4.93 -  WSEG :: "nat => nat => 'a::type word => 'a::type word" 
    4.94 +  WSEG :: "nat => nat => 'a word => 'a word" 
    4.95  
    4.96  specification (WSEG) WSEG_DEF: "ALL (m::nat) (k::nat) l::'a::type list.
    4.97     WSEG m k (WORD l) = WORD (LASTN m (BUTLASTN k l))"
    4.98    by (import word_base WSEG_DEF)
    4.99  
   4.100 -lemma WSEG0: "ALL (k::nat) w::'a::type word. WSEG (0::nat) k w = WORD []"
   4.101 +lemma WSEG0: "ALL (k::nat) w::'a::type word. WSEG 0 k w = WORD []"
   4.102    by (import word_base WSEG0)
   4.103  
   4.104  lemma WSEG_PWORDLEN: "ALL n::nat.
   4.105 @@ -271,17 +268,16 @@
   4.106             xb + xc <= x --> WORDLEN (WSEG xb xc xa) = xb)"
   4.107    by (import word_base WSEG_WORDLEN)
   4.108  
   4.109 -lemma WSEG_WORD_LENGTH: "ALL n::nat.
   4.110 -   RES_FORALL (PWORDLEN n) (%w::'a::type word. WSEG n (0::nat) w = w)"
   4.111 +lemma WSEG_WORD_LENGTH: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::'a::type word. WSEG n 0 w = w)"
   4.112    by (import word_base WSEG_WORD_LENGTH)
   4.113  
   4.114  consts
   4.115 -  bit :: "nat => 'a::type word => 'a::type" 
   4.116 +  bit :: "nat => 'a word => 'a" 
   4.117  
   4.118  specification (bit) BIT_DEF: "ALL (k::nat) l::'a::type list. bit k (WORD l) = ELL k l"
   4.119    by (import word_base BIT_DEF)
   4.120  
   4.121 -lemma BIT0: "ALL x::'a::type. bit (0::nat) (WORD [x]) = x"
   4.122 +lemma BIT0: "ALL x::'a::type. bit 0 (WORD [x]) = x"
   4.123    by (import word_base BIT0)
   4.124  
   4.125  lemma WSEG_BIT: "(All::(nat => bool) => bool)
   4.126 @@ -311,36 +307,35 @@
   4.127    by (import word_base BIT_WSEG)
   4.128  
   4.129  consts
   4.130 -  MSB :: "'a::type word => 'a::type" 
   4.131 +  MSB :: "'a word => 'a" 
   4.132  
   4.133  specification (MSB) MSB_DEF: "ALL l::'a::type list. MSB (WORD l) = hd l"
   4.134    by (import word_base MSB_DEF)
   4.135  
   4.136  lemma MSB: "ALL n::nat.
   4.137     RES_FORALL (PWORDLEN n)
   4.138 -    (%w::'a::type word. (0::nat) < n --> MSB w = bit (PRE n) w)"
   4.139 +    (%w::'a::type word. 0 < n --> MSB w = bit (PRE n) w)"
   4.140    by (import word_base MSB)
   4.141  
   4.142  consts
   4.143 -  LSB :: "'a::type word => 'a::type" 
   4.144 +  LSB :: "'a word => 'a" 
   4.145  
   4.146  specification (LSB) LSB_DEF: "ALL l::'a::type list. LSB (WORD l) = last l"
   4.147    by (import word_base LSB_DEF)
   4.148  
   4.149  lemma LSB: "ALL n::nat.
   4.150 -   RES_FORALL (PWORDLEN n)
   4.151 -    (%w::'a::type word. (0::nat) < n --> LSB w = bit (0::nat) w)"
   4.152 +   RES_FORALL (PWORDLEN n) (%w::'a::type word. 0 < n --> LSB w = bit 0 w)"
   4.153    by (import word_base LSB)
   4.154  
   4.155  consts
   4.156 -  WSPLIT :: "nat => 'a::type word => 'a::type word * 'a::type word" 
   4.157 +  WSPLIT :: "nat => 'a word => 'a word * 'a word" 
   4.158  
   4.159  specification (WSPLIT) WSPLIT_DEF: "ALL (m::nat) l::'a::type list.
   4.160     WSPLIT m (WORD l) = (WORD (BUTLASTN m l), WORD (LASTN m l))"
   4.161    by (import word_base WSPLIT_DEF)
   4.162  
   4.163  consts
   4.164 -  WCAT :: "'a::type word * 'a::type word => 'a::type word" 
   4.165 +  WCAT :: "'a word * 'a word => 'a word" 
   4.166  
   4.167  specification (WCAT) WCAT_DEF: "ALL (l1::'a::type list) l2::'a::type list.
   4.168     WCAT (WORD l1, WORD l2) = WORD (l1 @ l2)"
   4.169 @@ -451,7 +446,7 @@
   4.170  
   4.171  lemma WORDLEN_SUC_WCAT: "ALL (n::nat) w::'a::type word.
   4.172     IN w (PWORDLEN (Suc n)) -->
   4.173 -   RES_EXISTS (PWORDLEN (1::nat))
   4.174 +   RES_EXISTS (PWORDLEN 1)
   4.175      (%b::'a::type word.
   4.176          RES_EXISTS (PWORDLEN n) (%w'::'a::type word. w = WCAT (b, w')))"
   4.177    by (import word_base WORDLEN_SUC_WCAT)
   4.178 @@ -538,25 +533,25 @@
   4.179  
   4.180  lemma WORD_SPLIT: "ALL (x::nat) xa::nat.
   4.181     RES_FORALL (PWORDLEN (x + xa))
   4.182 -    (%w::'a::type word. w = WCAT (WSEG x xa w, WSEG xa (0::nat) w))"
   4.183 +    (%w::'a::type word. w = WCAT (WSEG x xa w, WSEG xa 0 w))"
   4.184    by (import word_base WORD_SPLIT)
   4.185  
   4.186  lemma WORDLEN_SUC_WCAT_WSEG_WSEG: "RES_FORALL (PWORDLEN (Suc (n::nat)))
   4.187 - (%w::'a::type word. w = WCAT (WSEG (1::nat) n w, WSEG n (0::nat) w))"
   4.188 + (%w::'a::type word. w = WCAT (WSEG 1 n w, WSEG n 0 w))"
   4.189    by (import word_base WORDLEN_SUC_WCAT_WSEG_WSEG)
   4.190  
   4.191  lemma WORDLEN_SUC_WCAT_WSEG_WSEG_RIGHT: "RES_FORALL (PWORDLEN (Suc (n::nat)))
   4.192 - (%w::'a::type word. w = WCAT (WSEG n (1::nat) w, WSEG (1::nat) (0::nat) w))"
   4.193 + (%w::'a::type word. w = WCAT (WSEG n 1 w, WSEG 1 0 w))"
   4.194    by (import word_base WORDLEN_SUC_WCAT_WSEG_WSEG_RIGHT)
   4.195  
   4.196  lemma WORDLEN_SUC_WCAT_BIT_WSEG: "ALL n::nat.
   4.197     RES_FORALL (PWORDLEN (Suc n))
   4.198 -    (%w::'a::type word. w = WCAT (WORD [bit n w], WSEG n (0::nat) w))"
   4.199 +    (%w::'a::type word. w = WCAT (WORD [bit n w], WSEG n 0 w))"
   4.200    by (import word_base WORDLEN_SUC_WCAT_BIT_WSEG)
   4.201  
   4.202  lemma WORDLEN_SUC_WCAT_BIT_WSEG_RIGHT: "ALL n::nat.
   4.203     RES_FORALL (PWORDLEN (Suc n))
   4.204 -    (%w::'a::type word. w = WCAT (WSEG n (1::nat) w, WORD [bit (0::nat) w]))"
   4.205 +    (%w::'a::type word. w = WCAT (WSEG n 1 w, WORD [bit 0 w]))"
   4.206    by (import word_base WORDLEN_SUC_WCAT_BIT_WSEG_RIGHT)
   4.207  
   4.208  lemma WSEG_WCAT1: "ALL (n1::nat) n2::nat.
   4.209 @@ -570,7 +565,7 @@
   4.210     RES_FORALL (PWORDLEN n1)
   4.211      (%w1::'a::type word.
   4.212          RES_FORALL (PWORDLEN n2)
   4.213 -         (%w2::'a::type word. WSEG n2 (0::nat) (WCAT (w1, w2)) = w2))"
   4.214 +         (%w2::'a::type word. WSEG n2 0 (WCAT (w1, w2)) = w2))"
   4.215    by (import word_base WSEG_WCAT2)
   4.216  
   4.217  lemma WSEG_SUC: "ALL n::nat.
   4.218 @@ -578,7 +573,7 @@
   4.219      (%w::'a::type word.
   4.220          ALL (k::nat) m1::nat.
   4.221             k + Suc m1 < n -->
   4.222 -           WSEG (Suc m1) k w = WCAT (WSEG (1::nat) (k + m1) w, WSEG m1 k w))"
   4.223 +           WSEG (Suc m1) k w = WCAT (WSEG 1 (k + m1) w, WSEG m1 k w))"
   4.224    by (import word_base WSEG_SUC)
   4.225  
   4.226  lemma WORD_CONS_WCAT: "ALL (x::'a::type) l::'a::type list. WORD (x # l) = WCAT (WORD [x], WORD l)"
   4.227 @@ -657,7 +652,7 @@
   4.228               ALL (m::nat) k::nat.
   4.229                  m + k <= n1 + n2 & k < n2 & n2 <= m + k -->
   4.230                  WSEG m k (WCAT (w1, w2)) =
   4.231 -                WCAT (WSEG (m + k - n2) (0::nat) w1, WSEG (n2 - k) k w2)))"
   4.232 +                WCAT (WSEG (m + k - n2) 0 w1, WSEG (n2 - k) k w2)))"
   4.233    by (import word_base WSEG_WCAT_WSEG)
   4.234  
   4.235  lemma BIT_EQ_IMP_WORD_EQ: "(All::(nat => bool) => bool)
   4.236 @@ -686,23 +681,22 @@
   4.237  ;setup_theory word_num
   4.238  
   4.239  constdefs
   4.240 -  LVAL :: "('a::type => nat) => nat => 'a::type list => nat" 
   4.241 +  LVAL :: "('a => nat) => nat => 'a list => nat" 
   4.242    "LVAL ==
   4.243 -%(f::'a::type => nat) b::nat.
   4.244 -   foldl (%(e::nat) x::'a::type. b * e + f x) (0::nat)"
   4.245 +%(f::'a::type => nat) b::nat. foldl (%(e::nat) x::'a::type. b * e + f x) 0"
   4.246  
   4.247  lemma LVAL_DEF: "ALL (f::'a::type => nat) (b::nat) l::'a::type list.
   4.248 -   LVAL f b l = foldl (%(e::nat) x::'a::type. b * e + f x) (0::nat) l"
   4.249 +   LVAL f b l = foldl (%(e::nat) x::'a::type. b * e + f x) 0 l"
   4.250    by (import word_num LVAL_DEF)
   4.251  
   4.252  consts
   4.253 -  NVAL :: "('a::type => nat) => nat => 'a::type word => nat" 
   4.254 +  NVAL :: "('a => nat) => nat => 'a word => nat" 
   4.255  
   4.256  specification (NVAL) NVAL_DEF: "ALL (f::'a::type => nat) (b::nat) l::'a::type list.
   4.257     NVAL f b (WORD l) = LVAL f b l"
   4.258    by (import word_num NVAL_DEF)
   4.259  
   4.260 -lemma LVAL: "(ALL (x::'a::type => nat) xa::nat. LVAL x xa [] = (0::nat)) &
   4.261 +lemma LVAL: "(ALL (x::'a::type => nat) xa::nat. LVAL x xa [] = 0) &
   4.262  (ALL (x::'a::type list) (xa::'a::type => nat) (xb::nat) xc::'a::type.
   4.263      LVAL xa xb (xc # x) = xa xc * xb ^ length x + LVAL xa xb x)"
   4.264    by (import word_num LVAL)
   4.265 @@ -721,16 +715,15 @@
   4.266         RES_FORALL (PWORDLEN n) (%w::'a::type word. NVAL f b w < b ^ n))"
   4.267    by (import word_num NVAL_MAX)
   4.268  
   4.269 -lemma NVAL0: "ALL (x::'a::type => nat) xa::nat. NVAL x xa (WORD []) = (0::nat)"
   4.270 +lemma NVAL0: "ALL (x::'a::type => nat) xa::nat. NVAL x xa (WORD []) = 0"
   4.271    by (import word_num NVAL0)
   4.272  
   4.273  lemma NVAL1: "ALL (x::'a::type => nat) (xa::nat) xb::'a::type.
   4.274     NVAL x xa (WORD [xb]) = x xb"
   4.275    by (import word_num NVAL1)
   4.276  
   4.277 -lemma NVAL_WORDLEN_0: "RES_FORALL (PWORDLEN (0::nat))
   4.278 - (%w::'a::type word.
   4.279 -     ALL (fv::'a::type => nat) r::nat. NVAL fv r w = (0::nat))"
   4.280 +lemma NVAL_WORDLEN_0: "RES_FORALL (PWORDLEN 0)
   4.281 + (%w::'a::type word. ALL (fv::'a::type => nat) r::nat. NVAL fv r w = 0)"
   4.282    by (import word_num NVAL_WORDLEN_0)
   4.283  
   4.284  lemma NVAL_WCAT1: "ALL (w::'a::type word) (f::'a::type => nat) (b::nat) x::'a::type.
   4.285 @@ -755,17 +748,16 @@
   4.286    by (import word_num NVAL_WCAT)
   4.287  
   4.288  consts
   4.289 -  NLIST :: "nat => (nat => 'a::type) => nat => nat => 'a::type list" 
   4.290 +  NLIST :: "nat => (nat => 'a) => nat => nat => 'a list" 
   4.291  
   4.292 -specification (NLIST) NLIST_DEF: "(ALL (frep::nat => 'a::type) (b::nat) m::nat.
   4.293 -    NLIST (0::nat) frep b m = []) &
   4.294 +specification (NLIST) NLIST_DEF: "(ALL (frep::nat => 'a::type) (b::nat) m::nat. NLIST 0 frep b m = []) &
   4.295  (ALL (n::nat) (frep::nat => 'a::type) (b::nat) m::nat.
   4.296      NLIST (Suc n) frep b m =
   4.297      SNOC (frep (m mod b)) (NLIST n frep b (m div b)))"
   4.298    by (import word_num NLIST_DEF)
   4.299  
   4.300  constdefs
   4.301 -  NWORD :: "nat => (nat => 'a::type) => nat => nat => 'a::type word" 
   4.302 +  NWORD :: "nat => (nat => 'a) => nat => nat => 'a word" 
   4.303    "NWORD ==
   4.304  %(n::nat) (frep::nat => 'a::type) (b::nat) m::nat. WORD (NLIST n frep b m)"
   4.305  
   4.306 @@ -786,7 +778,7 @@
   4.307  ;setup_theory word_bitop
   4.308  
   4.309  consts
   4.310 -  PBITOP :: "('a::type word => 'b::type word) => bool" 
   4.311 +  PBITOP :: "('a word => 'b word) => bool" 
   4.312  
   4.313  defs
   4.314    PBITOP_primdef: "PBITOP ==
   4.315 @@ -867,7 +859,7 @@
   4.316    by (import word_bitop PBITOP_BIT)
   4.317  
   4.318  consts
   4.319 -  PBITBOP :: "('a::type word => 'b::type word => 'c::type word) => bool" 
   4.320 +  PBITBOP :: "('a word => 'b word => 'c word) => bool" 
   4.321  
   4.322  defs
   4.323    PBITBOP_primdef: "PBITBOP ==
   4.324 @@ -944,7 +936,7 @@
   4.325    by (import word_bitop PBITBOP_EXISTS)
   4.326  
   4.327  consts
   4.328 -  WMAP :: "('a::type => 'b::type) => 'a::type word => 'b::type word" 
   4.329 +  WMAP :: "('a => 'b) => 'a word => 'b word" 
   4.330  
   4.331  specification (WMAP) WMAP_DEF: "ALL (f::'a::type => 'b::type) l::'a::type list.
   4.332     WMAP f (WORD l) = WORD (map f l)"
   4.333 @@ -1000,7 +992,7 @@
   4.334    by (import word_bitop WMAP_o)
   4.335  
   4.336  consts
   4.337 -  FORALLBITS :: "('a::type => bool) => 'a::type word => bool" 
   4.338 +  FORALLBITS :: "('a => bool) => 'a word => bool" 
   4.339  
   4.340  specification (FORALLBITS) FORALLBITS_DEF: "ALL (P::'a::type => bool) l::'a::type list.
   4.341     FORALLBITS P (WORD l) = list_all P l"
   4.342 @@ -1038,7 +1030,7 @@
   4.343    by (import word_bitop FORALLBITS_WCAT)
   4.344  
   4.345  consts
   4.346 -  EXISTSABIT :: "('a::type => bool) => 'a::type word => bool" 
   4.347 +  EXISTSABIT :: "('a => bool) => 'a word => bool" 
   4.348  
   4.349  specification (EXISTSABIT) EXISTSABIT_DEF: "ALL (P::'a::type => bool) l::'a::type list.
   4.350     EXISTSABIT P (WORD l) = list_exists P l"
   4.351 @@ -1085,37 +1077,33 @@
   4.352    by (import word_bitop EXISTSABIT_WCAT)
   4.353  
   4.354  constdefs
   4.355 -  SHR :: "bool => 'a::type => 'a::type word => 'a::type word * 'a::type" 
   4.356 +  SHR :: "bool => 'a => 'a word => 'a word * 'a" 
   4.357    "SHR ==
   4.358  %(f::bool) (b::'a::type) w::'a::type word.
   4.359     (WCAT
   4.360 -     (if f then WSEG (1::nat) (PRE (WORDLEN w)) w else WORD [b],
   4.361 -      WSEG (PRE (WORDLEN w)) (1::nat) w),
   4.362 -    bit (0::nat) w)"
   4.363 +     (if f then WSEG 1 (PRE (WORDLEN w)) w else WORD [b],
   4.364 +      WSEG (PRE (WORDLEN w)) 1 w),
   4.365 +    bit 0 w)"
   4.366  
   4.367  lemma SHR_DEF: "ALL (f::bool) (b::'a::type) w::'a::type word.
   4.368     SHR f b w =
   4.369     (WCAT
   4.370 -     (if f then WSEG (1::nat) (PRE (WORDLEN w)) w else WORD [b],
   4.371 -      WSEG (PRE (WORDLEN w)) (1::nat) w),
   4.372 -    bit (0::nat) w)"
   4.373 +     (if f then WSEG 1 (PRE (WORDLEN w)) w else WORD [b],
   4.374 +      WSEG (PRE (WORDLEN w)) 1 w),
   4.375 +    bit 0 w)"
   4.376    by (import word_bitop SHR_DEF)
   4.377  
   4.378  constdefs
   4.379 -  SHL :: "bool => 'a::type word => 'a::type => 'a::type * 'a::type word" 
   4.380 +  SHL :: "bool => 'a word => 'a => 'a * 'a word" 
   4.381    "SHL ==
   4.382  %(f::bool) (w::'a::type word) b::'a::type.
   4.383     (bit (PRE (WORDLEN w)) w,
   4.384 -    WCAT
   4.385 -     (WSEG (PRE (WORDLEN w)) (0::nat) w,
   4.386 -      if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
   4.387 +    WCAT (WSEG (PRE (WORDLEN w)) 0 w, if f then WSEG 1 0 w else WORD [b]))"
   4.388  
   4.389  lemma SHL_DEF: "ALL (f::bool) (w::'a::type word) b::'a::type.
   4.390     SHL f w b =
   4.391     (bit (PRE (WORDLEN w)) w,
   4.392 -    WCAT
   4.393 -     (WSEG (PRE (WORDLEN w)) (0::nat) w,
   4.394 -      if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
   4.395 +    WCAT (WSEG (PRE (WORDLEN w)) 0 w, if f then WSEG 1 0 w else WORD [b]))"
   4.396    by (import word_bitop SHL_DEF)
   4.397  
   4.398  lemma SHR_WSEG: "ALL n::nat.
   4.399 @@ -1123,14 +1111,12 @@
   4.400      (%w::'a::type word.
   4.401          ALL (m::nat) k::nat.
   4.402             m + k <= n -->
   4.403 -           (0::nat) < m -->
   4.404 +           0 < m -->
   4.405             (ALL (f::bool) b::'a::type.
   4.406                 SHR f b (WSEG m k w) =
   4.407                 (if f
   4.408 -                then WCAT
   4.409 -                      (WSEG (1::nat) (k + (m - (1::nat))) w,
   4.410 -                       WSEG (m - (1::nat)) (k + (1::nat)) w)
   4.411 -                else WCAT (WORD [b], WSEG (m - (1::nat)) (k + (1::nat)) w),
   4.412 +                then WCAT (WSEG 1 (k + (m - 1)) w, WSEG (m - 1) (k + 1) w)
   4.413 +                else WCAT (WORD [b], WSEG (m - 1) (k + 1) w),
   4.414                  bit k w)))"
   4.415    by (import word_bitop SHR_WSEG)
   4.416  
   4.417 @@ -1139,9 +1125,9 @@
   4.418      (%w::'a::type word.
   4.419          ALL (b::'a::type) (m::nat) k::nat.
   4.420             m + k <= n -->
   4.421 -           (0::nat) < m -->
   4.422 +           0 < m -->
   4.423             SHR False b (WSEG m k w) =
   4.424 -           (WCAT (WORD [b], WSEG (m - (1::nat)) (k + (1::nat)) w), bit k w))"
   4.425 +           (WCAT (WORD [b], WSEG (m - 1) (k + 1) w), bit k w))"
   4.426    by (import word_bitop SHR_WSEG_1F)
   4.427  
   4.428  lemma SHR_WSEG_NF: "ALL n::nat.
   4.429 @@ -1149,9 +1135,9 @@
   4.430      (%w::'a::type word.
   4.431          ALL (m::nat) k::nat.
   4.432             m + k < n -->
   4.433 -           (0::nat) < m -->
   4.434 +           0 < m -->
   4.435             SHR False (bit (m + k) w) (WSEG m k w) =
   4.436 -           (WSEG m (k + (1::nat)) w, bit k w))"
   4.437 +           (WSEG m (k + 1) w, bit k w))"
   4.438    by (import word_bitop SHR_WSEG_NF)
   4.439  
   4.440  lemma SHL_WSEG: "ALL n::nat.
   4.441 @@ -1159,12 +1145,12 @@
   4.442      (%w::'a::type word.
   4.443          ALL (m::nat) k::nat.
   4.444             m + k <= n -->
   4.445 -           (0::nat) < m -->
   4.446 +           0 < m -->
   4.447             (ALL (f::bool) b::'a::type.
   4.448                 SHL f (WSEG m k w) b =
   4.449 -               (bit (k + (m - (1::nat))) w,
   4.450 -                if f then WCAT (WSEG (m - (1::nat)) k w, WSEG (1::nat) k w)
   4.451 -                else WCAT (WSEG (m - (1::nat)) k w, WORD [b]))))"
   4.452 +               (bit (k + (m - 1)) w,
   4.453 +                if f then WCAT (WSEG (m - 1) k w, WSEG 1 k w)
   4.454 +                else WCAT (WSEG (m - 1) k w, WORD [b]))))"
   4.455    by (import word_bitop SHL_WSEG)
   4.456  
   4.457  lemma SHL_WSEG_1F: "ALL n::nat.
   4.458 @@ -1172,10 +1158,9 @@
   4.459      (%w::'a::type word.
   4.460          ALL (b::'a::type) (m::nat) k::nat.
   4.461             m + k <= n -->
   4.462 -           (0::nat) < m -->
   4.463 +           0 < m -->
   4.464             SHL False (WSEG m k w) b =
   4.465 -           (bit (k + (m - (1::nat))) w,
   4.466 -            WCAT (WSEG (m - (1::nat)) k w, WORD [b])))"
   4.467 +           (bit (k + (m - 1)) w, WCAT (WSEG (m - 1) k w, WORD [b])))"
   4.468    by (import word_bitop SHL_WSEG_1F)
   4.469  
   4.470  lemma SHL_WSEG_NF: "ALL n::nat.
   4.471 @@ -1183,31 +1168,28 @@
   4.472      (%w::'a::type word.
   4.473          ALL (m::nat) k::nat.
   4.474             m + k <= n -->
   4.475 -           (0::nat) < m -->
   4.476 -           (0::nat) < k -->
   4.477 -           SHL False (WSEG m k w) (bit (k - (1::nat)) w) =
   4.478 -           (bit (k + (m - (1::nat))) w, WSEG m (k - (1::nat)) w))"
   4.479 +           0 < m -->
   4.480 +           0 < k -->
   4.481 +           SHL False (WSEG m k w) (bit (k - 1) w) =
   4.482 +           (bit (k + (m - 1)) w, WSEG m (k - 1) w))"
   4.483    by (import word_bitop SHL_WSEG_NF)
   4.484  
   4.485  lemma WSEG_SHL: "ALL n::nat.
   4.486     RES_FORALL (PWORDLEN (Suc n))
   4.487      (%w::'a::type word.
   4.488          ALL (m::nat) k::nat.
   4.489 -           (0::nat) < k & m + k <= Suc n -->
   4.490 +           0 < k & m + k <= Suc n -->
   4.491             (ALL b::'a::type.
   4.492 -               WSEG m k (snd (SHL (f::bool) w b)) =
   4.493 -               WSEG m (k - (1::nat)) w))"
   4.494 +               WSEG m k (snd (SHL (f::bool) w b)) = WSEG m (k - 1) w))"
   4.495    by (import word_bitop WSEG_SHL)
   4.496  
   4.497  lemma WSEG_SHL_0: "ALL n::nat.
   4.498     RES_FORALL (PWORDLEN (Suc n))
   4.499      (%w::'a::type word.
   4.500          ALL (m::nat) b::'a::type.
   4.501 -           (0::nat) < m & m <= Suc n -->
   4.502 -           WSEG m (0::nat) (snd (SHL (f::bool) w b)) =
   4.503 -           WCAT
   4.504 -            (WSEG (m - (1::nat)) (0::nat) w,
   4.505 -             if f then WSEG (1::nat) (0::nat) w else WORD [b]))"
   4.506 +           0 < m & m <= Suc n -->
   4.507 +           WSEG m 0 (snd (SHL (f::bool) w b)) =
   4.508 +           WCAT (WSEG (m - 1) 0 w, if f then WSEG 1 0 w else WORD [b]))"
   4.509    by (import word_bitop WSEG_SHL_0)
   4.510  
   4.511  ;end_setup
   4.512 @@ -1216,24 +1198,24 @@
   4.513  
   4.514  constdefs
   4.515    BV :: "bool => nat" 
   4.516 -  "(BV == (%(b::bool). (if b then (Suc (0::nat)) else (0::nat))))"
   4.517 +  "BV == %b::bool. if b then Suc 0 else 0"
   4.518  
   4.519 -lemma BV_DEF: "(ALL (b::bool). ((BV b) = (if b then (Suc (0::nat)) else (0::nat))))"
   4.520 +lemma BV_DEF: "ALL b::bool. BV b = (if b then Suc 0 else 0)"
   4.521    by (import bword_num BV_DEF)
   4.522  
   4.523  consts
   4.524    BNVAL :: "bool word => nat" 
   4.525  
   4.526 -specification (BNVAL) BNVAL_DEF: "ALL l::bool list. BNVAL (WORD l) = LVAL BV (2::nat) l"
   4.527 +specification (BNVAL) BNVAL_DEF: "ALL l::bool list. BNVAL (WORD l) = LVAL BV 2 l"
   4.528    by (import bword_num BNVAL_DEF)
   4.529  
   4.530 -lemma BV_LESS_2: "ALL x::bool. BV x < (2::nat)"
   4.531 +lemma BV_LESS_2: "ALL x::bool. BV x < 2"
   4.532    by (import bword_num BV_LESS_2)
   4.533  
   4.534 -lemma BNVAL_NVAL: "ALL w::bool word. BNVAL w = NVAL BV (2::nat) w"
   4.535 +lemma BNVAL_NVAL: "ALL w::bool word. BNVAL w = NVAL BV 2 w"
   4.536    by (import bword_num BNVAL_NVAL)
   4.537  
   4.538 -lemma BNVAL0: "BNVAL (WORD []) = (0::nat)"
   4.539 +lemma BNVAL0: "BNVAL (WORD []) = 0"
   4.540    by (import bword_num BNVAL0)
   4.541  
   4.542  lemma BNVAL_11: "ALL (w1::bool word) w2::bool word.
   4.543 @@ -1243,20 +1225,19 @@
   4.544  lemma BNVAL_ONTO: "ALL w::bool word. Ex (op = (BNVAL w))"
   4.545    by (import bword_num BNVAL_ONTO)
   4.546  
   4.547 -lemma BNVAL_MAX: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w < (2::nat) ^ n)"
   4.548 +lemma BNVAL_MAX: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w < 2 ^ n)"
   4.549    by (import bword_num BNVAL_MAX)
   4.550  
   4.551  lemma BNVAL_WCAT1: "ALL n::nat.
   4.552     RES_FORALL (PWORDLEN n)
   4.553      (%w::bool word.
   4.554 -        ALL x::bool. BNVAL (WCAT (w, WORD [x])) = BNVAL w * (2::nat) + BV x)"
   4.555 +        ALL x::bool. BNVAL (WCAT (w, WORD [x])) = BNVAL w * 2 + BV x)"
   4.556    by (import bword_num BNVAL_WCAT1)
   4.557  
   4.558  lemma BNVAL_WCAT2: "ALL n::nat.
   4.559     RES_FORALL (PWORDLEN n)
   4.560      (%w::bool word.
   4.561 -        ALL x::bool.
   4.562 -           BNVAL (WCAT (WORD [x], w)) = BV x * (2::nat) ^ n + BNVAL w)"
   4.563 +        ALL x::bool. BNVAL (WCAT (WORD [x], w)) = BV x * 2 ^ n + BNVAL w)"
   4.564    by (import bword_num BNVAL_WCAT2)
   4.565  
   4.566  lemma BNVAL_WCAT: "ALL (n::nat) m::nat.
   4.567 @@ -1264,24 +1245,24 @@
   4.568      (%w1::bool word.
   4.569          RES_FORALL (PWORDLEN m)
   4.570           (%w2::bool word.
   4.571 -             BNVAL (WCAT (w1, w2)) = BNVAL w1 * (2::nat) ^ m + BNVAL w2))"
   4.572 +             BNVAL (WCAT (w1, w2)) = BNVAL w1 * 2 ^ m + BNVAL w2))"
   4.573    by (import bword_num BNVAL_WCAT)
   4.574  
   4.575  constdefs
   4.576    VB :: "nat => bool" 
   4.577 -  "VB == %n::nat. n mod (2::nat) ~= (0::nat)"
   4.578 +  "VB == %n::nat. n mod 2 ~= 0"
   4.579  
   4.580 -lemma VB_DEF: "ALL n::nat. VB n = (n mod (2::nat) ~= (0::nat))"
   4.581 +lemma VB_DEF: "ALL n::nat. VB n = (n mod 2 ~= 0)"
   4.582    by (import bword_num VB_DEF)
   4.583  
   4.584  constdefs
   4.585    NBWORD :: "nat => nat => bool word" 
   4.586 -  "NBWORD == %(n::nat) m::nat. WORD (NLIST n VB (2::nat) m)"
   4.587 +  "NBWORD == %(n::nat) m::nat. WORD (NLIST n VB 2 m)"
   4.588  
   4.589 -lemma NBWORD_DEF: "ALL (n::nat) m::nat. NBWORD n m = WORD (NLIST n VB (2::nat) m)"
   4.590 +lemma NBWORD_DEF: "ALL (n::nat) m::nat. NBWORD n m = WORD (NLIST n VB 2 m)"
   4.591    by (import bword_num NBWORD_DEF)
   4.592  
   4.593 -lemma NBWORD0: "ALL x::nat. NBWORD (0::nat) x = WORD []"
   4.594 +lemma NBWORD0: "ALL x::nat. NBWORD 0 x = WORD []"
   4.595    by (import bword_num NBWORD0)
   4.596  
   4.597  lemma WORDLEN_NBWORD: "ALL (x::nat) xa::nat. WORDLEN (NBWORD x xa) = x"
   4.598 @@ -1291,8 +1272,7 @@
   4.599    by (import bword_num PWORDLEN_NBWORD)
   4.600  
   4.601  lemma NBWORD_SUC: "ALL (n::nat) m::nat.
   4.602 -   NBWORD (Suc n) m =
   4.603 -   WCAT (NBWORD n (m div (2::nat)), WORD [VB (m mod (2::nat))])"
   4.604 +   NBWORD (Suc n) m = WCAT (NBWORD n (m div 2), WORD [VB (m mod 2)])"
   4.605    by (import bword_num NBWORD_SUC)
   4.606  
   4.607  lemma VB_BV: "ALL x::bool. VB (BV x) = x"
   4.608 @@ -1313,21 +1293,18 @@
   4.609  lemma NBWORD_BNVAL: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. NBWORD n (BNVAL w) = w)"
   4.610    by (import bword_num NBWORD_BNVAL)
   4.611  
   4.612 -lemma BNVAL_NBWORD: "ALL (n::nat) m::nat. m < (2::nat) ^ n --> BNVAL (NBWORD n m) = m"
   4.613 +lemma BNVAL_NBWORD: "ALL (n::nat) m::nat. m < 2 ^ n --> BNVAL (NBWORD n m) = m"
   4.614    by (import bword_num BNVAL_NBWORD)
   4.615  
   4.616  lemma ZERO_WORD_VAL: "RES_FORALL (PWORDLEN (n::nat))
   4.617 - (%w::bool word. (w = NBWORD n (0::nat)) = (BNVAL w = (0::nat)))"
   4.618 + (%w::bool word. (w = NBWORD n 0) = (BNVAL w = 0))"
   4.619    by (import bword_num ZERO_WORD_VAL)
   4.620  
   4.621 -lemma WCAT_NBWORD_0: "ALL (n1::nat) n2::nat.
   4.622 -   WCAT (NBWORD n1 (0::nat), NBWORD n2 (0::nat)) = NBWORD (n1 + n2) (0::nat)"
   4.623 +lemma WCAT_NBWORD_0: "ALL (n1::nat) n2::nat. WCAT (NBWORD n1 0, NBWORD n2 0) = NBWORD (n1 + n2) 0"
   4.624    by (import bword_num WCAT_NBWORD_0)
   4.625  
   4.626  lemma WSPLIT_NBWORD_0: "ALL (n::nat) m::nat.
   4.627 -   m <= n -->
   4.628 -   WSPLIT m (NBWORD n (0::nat)) =
   4.629 -   (NBWORD (n - m) (0::nat), NBWORD m (0::nat))"
   4.630 +   m <= n --> WSPLIT m (NBWORD n 0) = (NBWORD (n - m) 0, NBWORD m 0)"
   4.631    by (import bword_num WSPLIT_NBWORD_0)
   4.632  
   4.633  lemma EQ_NBWORD0_SPLIT: "(All::(nat => bool) => bool)
   4.634 @@ -1354,43 +1331,41 @@
   4.635                        ((NBWORD::nat => nat => bool word) m (0::nat))))))))"
   4.636    by (import bword_num EQ_NBWORD0_SPLIT)
   4.637  
   4.638 -lemma NBWORD_MOD: "ALL (n::nat) m::nat. NBWORD n (m mod (2::nat) ^ n) = NBWORD n m"
   4.639 +lemma NBWORD_MOD: "ALL (n::nat) m::nat. NBWORD n (m mod 2 ^ n) = NBWORD n m"
   4.640    by (import bword_num NBWORD_MOD)
   4.641  
   4.642 -lemma WSEG_NBWORD_SUC: "ALL (n::nat) m::nat. WSEG n (0::nat) (NBWORD (Suc n) m) = NBWORD n m"
   4.643 +lemma WSEG_NBWORD_SUC: "ALL (n::nat) m::nat. WSEG n 0 (NBWORD (Suc n) m) = NBWORD n m"
   4.644    by (import bword_num WSEG_NBWORD_SUC)
   4.645  
   4.646  lemma NBWORD_SUC_WSEG: "ALL n::nat.
   4.647     RES_FORALL (PWORDLEN (Suc n))
   4.648 -    (%w::bool word. NBWORD n (BNVAL w) = WSEG n (0::nat) w)"
   4.649 +    (%w::bool word. NBWORD n (BNVAL w) = WSEG n 0 w)"
   4.650    by (import bword_num NBWORD_SUC_WSEG)
   4.651  
   4.652 -lemma DOUBL_EQ_SHL: "ALL x>0::nat.
   4.653 +lemma DOUBL_EQ_SHL: "ALL x>0.
   4.654     RES_FORALL (PWORDLEN x)
   4.655      (%xa::bool word.
   4.656          ALL xb::bool.
   4.657             NBWORD x (BNVAL xa + BNVAL xa + BV xb) = snd (SHL False xa xb))"
   4.658    by (import bword_num DOUBL_EQ_SHL)
   4.659  
   4.660 -lemma MSB_NBWORD: "ALL (n::nat) m::nat.
   4.661 -   bit n (NBWORD (Suc n) m) = VB (m div (2::nat) ^ n mod (2::nat))"
   4.662 +lemma MSB_NBWORD: "ALL (n::nat) m::nat. bit n (NBWORD (Suc n) m) = VB (m div 2 ^ n mod 2)"
   4.663    by (import bword_num MSB_NBWORD)
   4.664  
   4.665  lemma NBWORD_SPLIT: "ALL (n1::nat) (n2::nat) m::nat.
   4.666 -   NBWORD (n1 + n2) m = WCAT (NBWORD n1 (m div (2::nat) ^ n2), NBWORD n2 m)"
   4.667 +   NBWORD (n1 + n2) m = WCAT (NBWORD n1 (m div 2 ^ n2), NBWORD n2 m)"
   4.668    by (import bword_num NBWORD_SPLIT)
   4.669  
   4.670  lemma WSEG_NBWORD: "ALL (m::nat) (k::nat) n::nat.
   4.671     m + k <= n -->
   4.672 -   (ALL l::nat. WSEG m k (NBWORD n l) = NBWORD m (l div (2::nat) ^ k))"
   4.673 +   (ALL l::nat. WSEG m k (NBWORD n l) = NBWORD m (l div 2 ^ k))"
   4.674    by (import bword_num WSEG_NBWORD)
   4.675  
   4.676  lemma NBWORD_SUC_FST: "ALL (n::nat) x::nat.
   4.677 -   NBWORD (Suc n) x =
   4.678 -   WCAT (WORD [VB (x div (2::nat) ^ n mod (2::nat))], NBWORD n x)"
   4.679 +   NBWORD (Suc n) x = WCAT (WORD [VB (x div 2 ^ n mod 2)], NBWORD n x)"
   4.680    by (import bword_num NBWORD_SUC_FST)
   4.681  
   4.682 -lemma BIT_NBWORD0: "ALL (k::nat) n::nat. k < n --> bit k (NBWORD n (0::nat)) = False"
   4.683 +lemma BIT_NBWORD0: "ALL (k::nat) n::nat. k < n --> bit k (NBWORD n 0) = False"
   4.684    by (import bword_num BIT_NBWORD0)
   4.685  
   4.686  lemma ADD_BNVAL_LEFT: "ALL n::nat.
   4.687 @@ -1399,8 +1374,8 @@
   4.688          RES_FORALL (PWORDLEN (Suc n))
   4.689           (%w2::bool word.
   4.690               BNVAL w1 + BNVAL w2 =
   4.691 -             (BV (bit n w1) + BV (bit n w2)) * (2::nat) ^ n +
   4.692 -             (BNVAL (WSEG n (0::nat) w1) + BNVAL (WSEG n (0::nat) w2))))"
   4.693 +             (BV (bit n w1) + BV (bit n w2)) * 2 ^ n +
   4.694 +             (BNVAL (WSEG n 0 w1) + BNVAL (WSEG n 0 w2))))"
   4.695    by (import bword_num ADD_BNVAL_LEFT)
   4.696  
   4.697  lemma ADD_BNVAL_RIGHT: "ALL n::nat.
   4.698 @@ -1409,9 +1384,8 @@
   4.699          RES_FORALL (PWORDLEN (Suc n))
   4.700           (%w2::bool word.
   4.701               BNVAL w1 + BNVAL w2 =
   4.702 -             (BNVAL (WSEG n (1::nat) w1) + BNVAL (WSEG n (1::nat) w2)) *
   4.703 -             (2::nat) +
   4.704 -             (BV (bit (0::nat) w1) + BV (bit (0::nat) w2))))"
   4.705 +             (BNVAL (WSEG n 1 w1) + BNVAL (WSEG n 1 w2)) * 2 +
   4.706 +             (BV (bit 0 w1) + BV (bit 0 w2))))"
   4.707    by (import bword_num ADD_BNVAL_RIGHT)
   4.708  
   4.709  lemma ADD_BNVAL_SPLIT: "ALL (n1::nat) n2::nat.
   4.710 @@ -1420,9 +1394,8 @@
   4.711          RES_FORALL (PWORDLEN (n1 + n2))
   4.712           (%w2::bool word.
   4.713               BNVAL w1 + BNVAL w2 =
   4.714 -             (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2)) *
   4.715 -             (2::nat) ^ n2 +
   4.716 -             (BNVAL (WSEG n2 (0::nat) w1) + BNVAL (WSEG n2 (0::nat) w2))))"
   4.717 +             (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2)) * 2 ^ n2 +
   4.718 +             (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2))))"
   4.719    by (import bword_num ADD_BNVAL_SPLIT)
   4.720  
   4.721  ;end_setup
   4.722 @@ -1432,19 +1405,16 @@
   4.723  consts
   4.724    ACARRY :: "nat => bool word => bool word => bool => bool" 
   4.725  
   4.726 -specification (ACARRY) ACARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool.
   4.727 -    ACARRY (0::nat) w1 w2 cin = cin) &
   4.728 +specification (ACARRY) ACARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool. ACARRY 0 w1 w2 cin = cin) &
   4.729  (ALL (n::nat) (w1::bool word) (w2::bool word) cin::bool.
   4.730      ACARRY (Suc n) w1 w2 cin =
   4.731 -    VB ((BV (bit n w1) + BV (bit n w2) + BV (ACARRY n w1 w2 cin)) div
   4.732 -        (2::nat)))"
   4.733 +    VB ((BV (bit n w1) + BV (bit n w2) + BV (ACARRY n w1 w2 cin)) div 2))"
   4.734    by (import bword_arith ACARRY_DEF)
   4.735  
   4.736  consts
   4.737    ICARRY :: "nat => bool word => bool word => bool => bool" 
   4.738  
   4.739 -specification (ICARRY) ICARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool.
   4.740 -    ICARRY (0::nat) w1 w2 cin = cin) &
   4.741 +specification (ICARRY) ICARRY_DEF: "(ALL (w1::bool word) (w2::bool word) cin::bool. ICARRY 0 w1 w2 cin = cin) &
   4.742  (ALL (n::nat) (w1::bool word) (w2::bool word) cin::bool.
   4.743      ICARRY (Suc n) w1 w2 cin =
   4.744      (bit n w1 & bit n w2 | (bit n w1 | bit n w2) & ICARRY n w1 w2 cin))"
   4.745 @@ -1459,9 +1429,7 @@
   4.746                  k <= n --> ACARRY k w1 w2 cin = ICARRY k w1 w2 cin))"
   4.747    by (import bword_arith ACARRY_EQ_ICARRY)
   4.748  
   4.749 -lemma BNVAL_LESS_EQ: "ALL n::nat.
   4.750 -   RES_FORALL (PWORDLEN n)
   4.751 -    (%w::bool word. BNVAL w <= (2::nat) ^ n - (1::nat))"
   4.752 +lemma BNVAL_LESS_EQ: "ALL n::nat. RES_FORALL (PWORDLEN n) (%w::bool word. BNVAL w <= 2 ^ n - 1)"
   4.753    by (import bword_arith BNVAL_LESS_EQ)
   4.754  
   4.755  lemma ADD_BNVAL_LESS_EQ1: "ALL (n::nat) cin::bool.
   4.756 @@ -1469,8 +1437,7 @@
   4.757      (%w1::bool word.
   4.758          RES_FORALL (PWORDLEN n)
   4.759           (%w2::bool word.
   4.760 -             (BNVAL w1 + (BNVAL w2 + BV cin)) div (2::nat) ^ n
   4.761 -             <= Suc (0::nat)))"
   4.762 +             (BNVAL w1 + (BNVAL w2 + BV cin)) div 2 ^ n <= Suc 0))"
   4.763    by (import bword_arith ADD_BNVAL_LESS_EQ1)
   4.764  
   4.765  lemma ADD_BV_BNVAL_DIV_LESS_EQ1: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
   4.766 @@ -1479,9 +1446,9 @@
   4.767          RES_FORALL (PWORDLEN n)
   4.768           (%w2::bool word.
   4.769               (BV x1 + BV x2 +
   4.770 -              (BNVAL w1 + (BNVAL w2 + BV cin)) div (2::nat) ^ n) div
   4.771 -             (2::nat)
   4.772 -             <= (1::nat)))"
   4.773 +              (BNVAL w1 + (BNVAL w2 + BV cin)) div 2 ^ n) div
   4.774 +             2
   4.775 +             <= 1))"
   4.776    by (import bword_arith ADD_BV_BNVAL_DIV_LESS_EQ1)
   4.777  
   4.778  lemma ADD_BV_BNVAL_LESS_EQ: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
   4.779 @@ -1490,7 +1457,7 @@
   4.780          RES_FORALL (PWORDLEN n)
   4.781           (%w2::bool word.
   4.782               BV x1 + BV x2 + (BNVAL w1 + (BNVAL w2 + BV cin))
   4.783 -             <= Suc ((2::nat) ^ Suc n)))"
   4.784 +             <= Suc (2 ^ Suc n)))"
   4.785    by (import bword_arith ADD_BV_BNVAL_LESS_EQ)
   4.786  
   4.787  lemma ADD_BV_BNVAL_LESS_EQ1: "ALL (n::nat) (x1::bool) (x2::bool) cin::bool.
   4.788 @@ -1499,8 +1466,8 @@
   4.789          RES_FORALL (PWORDLEN n)
   4.790           (%w2::bool word.
   4.791               (BV x1 + BV x2 + (BNVAL w1 + (BNVAL w2 + BV cin))) div
   4.792 -             (2::nat) ^ Suc n
   4.793 -             <= (1::nat)))"
   4.794 +             2 ^ Suc n
   4.795 +             <= 1))"
   4.796    by (import bword_arith ADD_BV_BNVAL_LESS_EQ1)
   4.797  
   4.798  lemma ACARRY_EQ_ADD_DIV: "(All::(nat => bool) => bool)
   4.799 @@ -1552,9 +1519,7 @@
   4.800                     (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2) +
   4.801                      BV (ACARRY n2 w1 w2 cin)),
   4.802                    NBWORD n2
   4.803 -                   (BNVAL (WSEG n2 (0::nat) w1) +
   4.804 -                    BNVAL (WSEG n2 (0::nat) w2) +
   4.805 -                    BV cin))))"
   4.806 +                   (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2) + BV cin))))"
   4.807    by (import bword_arith ADD_WORD_SPLIT)
   4.808  
   4.809  lemma WSEG_NBWORD_ADD: "ALL n::nat.
   4.810 @@ -1577,16 +1542,14 @@
   4.811           (%w2::bool word.
   4.812               ALL cin::bool.
   4.813                  (NBWORD (n1 + n2) (BNVAL w1 + BNVAL w2 + BV cin) =
   4.814 -                 NBWORD (n1 + n2) (0::nat)) =
   4.815 +                 NBWORD (n1 + n2) 0) =
   4.816                  (NBWORD n1
   4.817                    (BNVAL (WSEG n1 n2 w1) + BNVAL (WSEG n1 n2 w2) +
   4.818                     BV (ACARRY n2 w1 w2 cin)) =
   4.819 -                 NBWORD n1 (0::nat) &
   4.820 +                 NBWORD n1 0 &
   4.821                   NBWORD n2
   4.822 -                  (BNVAL (WSEG n2 (0::nat) w1) +
   4.823 -                   BNVAL (WSEG n2 (0::nat) w2) +
   4.824 -                   BV cin) =
   4.825 -                 NBWORD n2 (0::nat))))"
   4.826 +                  (BNVAL (WSEG n2 0 w1) + BNVAL (WSEG n2 0 w2) + BV cin) =
   4.827 +                 NBWORD n2 0)))"
   4.828    by (import bword_arith ADD_NBWORD_EQ0_SPLIT)
   4.829  
   4.830  lemma ACARRY_MSB: "ALL n::nat.
   4.831 @@ -1606,7 +1569,7 @@
   4.832           (%w2::bool word.
   4.833               ALL (cin::bool) (k::nat) m::nat.
   4.834                  k < m & m <= n -->
   4.835 -                ACARRY k (WSEG m (0::nat) w1) (WSEG m (0::nat) w2) cin =
   4.836 +                ACARRY k (WSEG m 0 w1) (WSEG m 0 w2) cin =
   4.837                  ACARRY k w1 w2 cin))"
   4.838    by (import bword_arith ACARRY_WSEG)
   4.839  
   4.840 @@ -1617,7 +1580,7 @@
   4.841           (%w2::bool word.
   4.842               ALL (cin::bool) (k::nat) m::nat.
   4.843                  k < m & m <= n -->
   4.844 -                ICARRY k (WSEG m (0::nat) w1) (WSEG m (0::nat) w2) cin =
   4.845 +                ICARRY k (WSEG m 0 w1) (WSEG m 0 w2) cin =
   4.846                  ICARRY k w1 w2 cin))"
   4.847    by (import bword_arith ICARRY_WSEG)
   4.848  
     5.1 --- a/src/HOL/Import/HOL/HOL4Word32.thy	Mon Sep 26 15:56:28 2005 +0200
     5.2 +++ b/src/HOL/Import/HOL/HOL4Word32.thy	Mon Sep 26 16:10:19 2005 +0200
     5.3 @@ -8,78 +8,54 @@
     5.4    DIV2 :: "nat => nat" 
     5.5  
     5.6  defs
     5.7 -  DIV2_primdef: "DIV2 == %n::nat. n div (2::nat)"
     5.8 +  DIV2_primdef: "DIV2 == %n::nat. n div 2"
     5.9  
    5.10 -lemma DIV2_def: "ALL n::nat. DIV2 n = n div (2::nat)"
    5.11 +lemma DIV2_def: "ALL n::nat. DIV2 n = n div 2"
    5.12    by (import bits DIV2_def)
    5.13  
    5.14  consts
    5.15    TIMES_2EXP :: "nat => nat => nat" 
    5.16  
    5.17  defs
    5.18 -  TIMES_2EXP_primdef: "TIMES_2EXP == %(x::nat) n::nat. n * (2::nat) ^ x"
    5.19 +  TIMES_2EXP_primdef: "TIMES_2EXP == %(x::nat) n::nat. n * 2 ^ x"
    5.20  
    5.21 -lemma TIMES_2EXP_def: "ALL (x::nat) n::nat. TIMES_2EXP x n = n * (2::nat) ^ x"
    5.22 +lemma TIMES_2EXP_def: "ALL (x::nat) n::nat. TIMES_2EXP x n = n * 2 ^ x"
    5.23    by (import bits TIMES_2EXP_def)
    5.24  
    5.25  consts
    5.26    DIV_2EXP :: "nat => nat => nat" 
    5.27  
    5.28  defs
    5.29 -  DIV_2EXP_primdef: "DIV_2EXP == %(x::nat) n::nat. n div (2::nat) ^ x"
    5.30 +  DIV_2EXP_primdef: "DIV_2EXP == %(x::nat) n::nat. n div 2 ^ x"
    5.31  
    5.32 -lemma DIV_2EXP_def: "ALL (x::nat) n::nat. DIV_2EXP x n = n div (2::nat) ^ x"
    5.33 +lemma DIV_2EXP_def: "ALL (x::nat) n::nat. DIV_2EXP x n = n div 2 ^ x"
    5.34    by (import bits DIV_2EXP_def)
    5.35  
    5.36  consts
    5.37    MOD_2EXP :: "nat => nat => nat" 
    5.38  
    5.39  defs
    5.40 -  MOD_2EXP_primdef: "MOD_2EXP == %(x::nat) n::nat. n mod (2::nat) ^ x"
    5.41 +  MOD_2EXP_primdef: "MOD_2EXP == %(x::nat) n::nat. n mod 2 ^ x"
    5.42  
    5.43 -lemma MOD_2EXP_def: "ALL (x::nat) n::nat. MOD_2EXP x n = n mod (2::nat) ^ x"
    5.44 +lemma MOD_2EXP_def: "ALL (x::nat) n::nat. MOD_2EXP x n = n mod 2 ^ x"
    5.45    by (import bits MOD_2EXP_def)
    5.46  
    5.47  consts
    5.48    DIVMOD_2EXP :: "nat => nat => nat * nat" 
    5.49  
    5.50  defs
    5.51 -  DIVMOD_2EXP_primdef: "DIVMOD_2EXP == %(x::nat) n::nat. (n div (2::nat) ^ x, n mod (2::nat) ^ x)"
    5.52 +  DIVMOD_2EXP_primdef: "DIVMOD_2EXP == %(x::nat) n::nat. (n div 2 ^ x, n mod 2 ^ x)"
    5.53  
    5.54 -lemma DIVMOD_2EXP_def: "ALL (x::nat) n::nat.
    5.55 -   DIVMOD_2EXP x n = (n div (2::nat) ^ x, n mod (2::nat) ^ x)"
    5.56 +lemma DIVMOD_2EXP_def: "ALL (x::nat) n::nat. DIVMOD_2EXP x n = (n div 2 ^ x, n mod 2 ^ x)"
    5.57    by (import bits DIVMOD_2EXP_def)
    5.58  
    5.59  consts
    5.60    SBIT :: "bool => nat => nat" 
    5.61  
    5.62  defs
    5.63 -  SBIT_primdef: "(op ==::(bool => nat => nat) => (bool => nat => nat) => prop)
    5.64 - (SBIT::bool => nat => nat)
    5.65 - (%(b::bool) n::nat.
    5.66 -     (If::bool => nat => nat => nat) b
    5.67 -      ((op ^::nat => nat => nat)
    5.68 -        ((number_of::bin => nat)
    5.69 -          ((op BIT::bin => bit => bin)
    5.70 -            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
    5.71 -            (bit.B0::bit)))
    5.72 -        n)
    5.73 -      (0::nat))"
    5.74 +  SBIT_primdef: "SBIT == %(b::bool) n::nat. if b then 2 ^ n else 0"
    5.75  
    5.76 -lemma SBIT_def: "(All::(bool => bool) => bool)
    5.77 - (%b::bool.
    5.78 -     (All::(nat => bool) => bool)
    5.79 -      (%n::nat.
    5.80 -          (op =::nat => nat => bool) ((SBIT::bool => nat => nat) b n)
    5.81 -           ((If::bool => nat => nat => nat) b
    5.82 -             ((op ^::nat => nat => nat)
    5.83 -               ((number_of::bin => nat)
    5.84 -                 ((op BIT::bin => bit => bin)
    5.85 -                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
    5.86 -                     (bit.B1::bit))
    5.87 -                   (bit.B0::bit)))
    5.88 -               n)
    5.89 -             (0::nat))))"
    5.90 +lemma SBIT_def: "ALL (b::bool) n::nat. SBIT b n = (if b then 2 ^ n else 0)"
    5.91    by (import bits SBIT_def)
    5.92  
    5.93  consts
    5.94 @@ -94,9 +70,9 @@
    5.95  
    5.96  constdefs
    5.97    bit :: "nat => nat => bool" 
    5.98 -  "bit == %(b::nat) n::nat. BITS b b n = (1::nat)"
    5.99 +  "bit == %(b::nat) n::nat. BITS b b n = 1"
   5.100  
   5.101 -lemma BIT_def: "ALL (b::nat) n::nat. bit b n = (BITS b b n = (1::nat))"
   5.102 +lemma BIT_def: "ALL (b::nat) n::nat. bit b n = (BITS b b n = 1)"
   5.103    by (import bits BIT_def)
   5.104  
   5.105  consts
   5.106 @@ -113,65 +89,125 @@
   5.107    LSBn :: "nat => bool" 
   5.108  
   5.109  defs
   5.110 -  LSBn_primdef: "LSBn == bit (0::nat)"
   5.111 +  LSBn_primdef: "LSBn == bit 0"
   5.112  
   5.113 -lemma LSBn_def: "LSBn = bit (0::nat)"
   5.114 +lemma LSBn_def: "LSBn = bit 0"
   5.115    by (import bits LSBn_def)
   5.116  
   5.117  consts
   5.118    BITWISE :: "nat => (bool => bool => bool) => nat => nat => nat" 
   5.119  
   5.120 -specification (BITWISE_primdef: BITWISE) BITWISE_def: "(ALL (oper::bool => bool => bool) (x::nat) y::nat.
   5.121 -    BITWISE (0::nat) oper x y = (0::nat)) &
   5.122 +specification (BITWISE_primdef: BITWISE) BITWISE_def: "(ALL (oper::bool => bool => bool) (x::nat) y::nat. BITWISE 0 oper x y = 0) &
   5.123  (ALL (n::nat) (oper::bool => bool => bool) (x::nat) y::nat.
   5.124      BITWISE (Suc n) oper x y =
   5.125      BITWISE n oper x y + SBIT (oper (bit n x) (bit n y)) n)"
   5.126    by (import bits BITWISE_def)
   5.127  
   5.128 -lemma DIV1: "ALL x::nat. x div (1::nat) = x"
   5.129 +lemma DIV1: "ALL x::nat. x div 1 = x"
   5.130    by (import bits DIV1)
   5.131  
   5.132 -lemma SUC_SUB: "Suc (a::nat) - a = (1::nat)"
   5.133 +lemma SUC_SUB: "Suc (a::nat) - a = 1"
   5.134    by (import bits SUC_SUB)
   5.135  
   5.136 -lemma DIV_MULT_1: "ALL (r::nat) n::nat. r < n --> (n + r) div n = (1::nat)"
   5.137 +lemma DIV_MULT_1: "ALL (r::nat) n::nat. r < n --> (n + r) div n = 1"
   5.138    by (import bits DIV_MULT_1)
   5.139  
   5.140 -lemma ZERO_LT_TWOEXP: "ALL n::nat. (0::nat) < (2::nat) ^ n"
   5.141 +lemma ZERO_LT_TWOEXP: "(All::(nat => bool) => bool)
   5.142 + (%n::nat.
   5.143 +     (op <::nat => nat => bool) (0::nat)
   5.144 +      ((op ^::nat => nat => nat)
   5.145 +        ((number_of::bin => nat)
   5.146 +          ((op BIT::bin => bit => bin)
   5.147 +            ((op BIT::bin => bit => bin) (Numeral.Pls::bin) (bit.B1::bit))
   5.148 +            (bit.B0::bit)))
   5.149 +        n))"
   5.150    by (import bits ZERO_LT_TWOEXP)
   5.151  
   5.152 -lemma MOD_2EXP_LT: "ALL (n::nat) k::nat. k mod (2::nat) ^ n < (2::nat) ^ n"
   5.153 +lemma MOD_2EXP_LT: "ALL (n::nat) k::nat. k mod 2 ^ n < 2 ^ n"
   5.154    by (import bits MOD_2EXP_LT)
   5.155  
   5.156 -lemma TWOEXP_DIVISION: "ALL (n::nat) k::nat.
   5.157 -   k = k div (2::nat) ^ n * (2::nat) ^ n + k mod (2::nat) ^ n"
   5.158 +lemma TWOEXP_DIVISION: "ALL (n::nat) k::nat. k = k div 2 ^ n * 2 ^ n + k mod 2 ^ n"
   5.159    by (import bits TWOEXP_DIVISION)
   5.160  
   5.161 -lemma TWOEXP_MONO: "ALL (a::nat) b::nat. a < b --> (2::nat) ^ a < (2::nat) ^ b"
   5.162 +lemma TWOEXP_MONO: "(All::(nat => bool) => bool)
   5.163 + (%a::nat.
   5.164 +     (All::(nat => bool) => bool)
   5.165 +      (%b::nat.
   5.166 +          (op -->::bool => bool => bool) ((op <::nat => nat => bool) a b)
   5.167 +           ((op <::nat => nat => bool)
   5.168 +             ((op ^::nat => nat => nat)
   5.169 +               ((number_of::bin => nat)
   5.170 +                 ((op BIT::bin => bit => bin)
   5.171 +                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.172 +                     (bit.B1::bit))
   5.173 +                   (bit.B0::bit)))
   5.174 +               a)
   5.175 +             ((op ^::nat => nat => nat)
   5.176 +               ((number_of::bin => nat)
   5.177 +                 ((op BIT::bin => bit => bin)
   5.178 +                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.179 +                     (bit.B1::bit))
   5.180 +                   (bit.B0::bit)))
   5.181 +               b))))"
   5.182    by (import bits TWOEXP_MONO)
   5.183  
   5.184 -lemma TWOEXP_MONO2: "ALL (a::nat) b::nat. a <= b --> (2::nat) ^ a <= (2::nat) ^ b"
   5.185 +lemma TWOEXP_MONO2: "(All::(nat => bool) => bool)
   5.186 + (%a::nat.
   5.187 +     (All::(nat => bool) => bool)
   5.188 +      (%b::nat.
   5.189 +          (op -->::bool => bool => bool) ((op <=::nat => nat => bool) a b)
   5.190 +           ((op <=::nat => nat => bool)
   5.191 +             ((op ^::nat => nat => nat)
   5.192 +               ((number_of::bin => nat)
   5.193 +                 ((op BIT::bin => bit => bin)
   5.194 +                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.195 +                     (bit.B1::bit))
   5.196 +                   (bit.B0::bit)))
   5.197 +               a)
   5.198 +             ((op ^::nat => nat => nat)
   5.199 +               ((number_of::bin => nat)
   5.200 +                 ((op BIT::bin => bit => bin)
   5.201 +                   ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.202 +                     (bit.B1::bit))
   5.203 +                   (bit.B0::bit)))
   5.204 +               b))))"
   5.205    by (import bits TWOEXP_MONO2)
   5.206  
   5.207 -lemma EXP_SUB_LESS_EQ: "ALL (a::nat) b::nat. (2::nat) ^ (a - b) <= (2::nat) ^ a"
   5.208 +lemma EXP_SUB_LESS_EQ: "(All::(nat => bool) => bool)
   5.209 + (%a::nat.
   5.210 +     (All::(nat => bool) => bool)
   5.211 +      (%b::nat.
   5.212 +          (op <=::nat => nat => bool)
   5.213 +           ((op ^::nat => nat => nat)
   5.214 +             ((number_of::bin => nat)
   5.215 +               ((op BIT::bin => bit => bin)
   5.216 +                 ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.217 +                   (bit.B1::bit))
   5.218 +                 (bit.B0::bit)))
   5.219 +             ((op -::nat => nat => nat) a b))
   5.220 +           ((op ^::nat => nat => nat)
   5.221 +             ((number_of::bin => nat)
   5.222 +               ((op BIT::bin => bit => bin)
   5.223 +                 ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.224 +                   (bit.B1::bit))
   5.225 +                 (bit.B0::bit)))
   5.226 +             a)))"
   5.227    by (import bits EXP_SUB_LESS_EQ)
   5.228  
   5.229  lemma BITS_THM: "ALL (x::nat) (xa::nat) xb::nat.
   5.230 -   BITS x xa xb = xb div (2::nat) ^ xa mod (2::nat) ^ (Suc x - xa)"
   5.231 +   BITS x xa xb = xb div 2 ^ xa mod 2 ^ (Suc x - xa)"
   5.232    by (import bits BITS_THM)
   5.233  
   5.234 -lemma BITSLT_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n < (2::nat) ^ (Suc h - l)"
   5.235 +lemma BITSLT_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n < 2 ^ (Suc h - l)"
   5.236    by (import bits BITSLT_THM)
   5.237  
   5.238 -lemma DIV_MULT_LEM: "ALL (m::nat) n::nat. (0::nat) < n --> m div n * n <= m"
   5.239 +lemma DIV_MULT_LEM: "ALL (m::nat) n::nat. 0 < n --> m div n * n <= m"
   5.240    by (import bits DIV_MULT_LEM)
   5.241  
   5.242 -lemma MOD_2EXP_LEM: "ALL (n::nat) x::nat.
   5.243 -   n mod (2::nat) ^ x = n - n div (2::nat) ^ x * (2::nat) ^ x"
   5.244 +lemma MOD_2EXP_LEM: "ALL (n::nat) x::nat. n mod 2 ^ x = n - n div 2 ^ x * 2 ^ x"
   5.245    by (import bits MOD_2EXP_LEM)
   5.246  
   5.247 -lemma BITS2_THM: "ALL (h::nat) (l::nat) n::nat.
   5.248 -   BITS h l n = n mod (2::nat) ^ Suc h div (2::nat) ^ l"
   5.249 +lemma BITS2_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l n = n mod 2 ^ Suc h div 2 ^ l"
   5.250    by (import bits BITS2_THM)
   5.251  
   5.252  lemma BITS_COMP_THM: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::nat.
   5.253 @@ -179,71 +215,65 @@
   5.254    by (import bits BITS_COMP_THM)
   5.255  
   5.256  lemma BITS_DIV_THM: "ALL (h::nat) (l::nat) (x::nat) n::nat.
   5.257 -   BITS h l x div (2::nat) ^ n = BITS h (l + n) x"
   5.258 +   BITS h l x div 2 ^ n = BITS h (l + n) x"
   5.259    by (import bits BITS_DIV_THM)
   5.260  
   5.261 -lemma BITS_LT_HIGH: "ALL (h::nat) (l::nat) n::nat.
   5.262 -   n < (2::nat) ^ Suc h --> BITS h l n = n div (2::nat) ^ l"
   5.263 +lemma BITS_LT_HIGH: "ALL (h::nat) (l::nat) n::nat. n < 2 ^ Suc h --> BITS h l n = n div 2 ^ l"
   5.264    by (import bits BITS_LT_HIGH)
   5.265  
   5.266 -lemma BITS_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> BITS h l n = (0::nat)"
   5.267 +lemma BITS_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> BITS h l n = 0"
   5.268    by (import bits BITS_ZERO)
   5.269  
   5.270 -lemma BITS_ZERO2: "ALL (h::nat) l::nat. BITS h l (0::nat) = (0::nat)"
   5.271 +lemma BITS_ZERO2: "ALL (h::nat) l::nat. BITS h l 0 = 0"
   5.272    by (import bits BITS_ZERO2)
   5.273  
   5.274 -lemma BITS_ZERO3: "ALL (h::nat) x::nat. BITS h (0::nat) x = x mod (2::nat) ^ Suc h"
   5.275 +lemma BITS_ZERO3: "ALL (h::nat) x::nat. BITS h 0 x = x mod 2 ^ Suc h"
   5.276    by (import bits BITS_ZERO3)
   5.277  
   5.278  lemma BITS_COMP_THM2: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::nat.
   5.279     BITS h2 l2 (BITS h1 l1 n) = BITS (min h1 (h2 + l1)) (l2 + l1) n"
   5.280    by (import bits BITS_COMP_THM2)
   5.281  
   5.282 -lemma NOT_MOD2_LEM: "ALL n::nat. (n mod (2::nat) ~= (0::nat)) = (n mod (2::nat) = (1::nat))"
   5.283 +lemma NOT_MOD2_LEM: "ALL n::nat. (n mod 2 ~= 0) = (n mod 2 = 1)"
   5.284    by (import bits NOT_MOD2_LEM)
   5.285  
   5.286 -lemma NOT_MOD2_LEM2: "ALL (n::nat) a::'a::type.
   5.287 -   (n mod (2::nat) ~= (1::nat)) = (n mod (2::nat) = (0::nat))"
   5.288 +lemma NOT_MOD2_LEM2: "ALL (n::nat) a::'a::type. (n mod 2 ~= 1) = (n mod 2 = 0)"
   5.289    by (import bits NOT_MOD2_LEM2)
   5.290  
   5.291 -lemma EVEN_MOD2_LEM: "ALL n::nat. EVEN n = (n mod (2::nat) = (0::nat))"
   5.292 +lemma EVEN_MOD2_LEM: "ALL n::nat. EVEN n = (n mod 2 = 0)"
   5.293    by (import bits EVEN_MOD2_LEM)
   5.294  
   5.295 -lemma ODD_MOD2_LEM: "ALL n::nat. ODD n = (n mod (2::nat) = (1::nat))"
   5.296 +lemma ODD_MOD2_LEM: "ALL n::nat. ODD n = (n mod 2 = 1)"
   5.297    by (import bits ODD_MOD2_LEM)
   5.298  
   5.299  lemma LSB_ODD: "LSBn = ODD"
   5.300    by (import bits LSB_ODD)
   5.301  
   5.302 -lemma DIV_MULT_THM: "ALL (x::nat) n::nat.
   5.303 -   n div (2::nat) ^ x * (2::nat) ^ x = n - n mod (2::nat) ^ x"
   5.304 +lemma DIV_MULT_THM: "ALL (x::nat) n::nat. n div 2 ^ x * 2 ^ x = n - n mod 2 ^ x"
   5.305    by (import bits DIV_MULT_THM)
   5.306  
   5.307 -lemma DIV_MULT_THM2: "ALL x::nat. (2::nat) * (x div (2::nat)) = x - x mod (2::nat)"
   5.308 +lemma DIV_MULT_THM2: "ALL x::nat. 2 * (x div 2) = x - x mod 2"
   5.309    by (import bits DIV_MULT_THM2)
   5.310  
   5.311 -lemma LESS_EQ_EXP_MULT: "ALL (a::nat) b::nat. a <= b --> (EX x::nat. (2::nat) ^ b = x * (2::nat) ^ a)"
   5.312 +lemma LESS_EQ_EXP_MULT: "ALL (a::nat) b::nat. a <= b --> (EX x::nat. 2 ^ b = x * 2 ^ a)"
   5.313    by (import bits LESS_EQ_EXP_MULT)
   5.314  
   5.315  lemma SLICE_LEM1: "ALL (a::nat) (x::nat) y::nat.
   5.316 -   a div (2::nat) ^ (x + y) * (2::nat) ^ (x + y) =
   5.317 -   a div (2::nat) ^ x * (2::nat) ^ x -
   5.318 -   a div (2::nat) ^ x mod (2::nat) ^ y * (2::nat) ^ x"
   5.319 +   a div 2 ^ (x + y) * 2 ^ (x + y) =
   5.320 +   a div 2 ^ x * 2 ^ x - a div 2 ^ x mod 2 ^ y * 2 ^ x"
   5.321    by (import bits SLICE_LEM1)
   5.322  
   5.323  lemma SLICE_LEM2: "ALL (a::'a::type) (x::nat) y::nat.
   5.324 -   (n::nat) mod (2::nat) ^ (x + y) =
   5.325 -   n mod (2::nat) ^ x + n div (2::nat) ^ x mod (2::nat) ^ y * (2::nat) ^ x"
   5.326 +   (n::nat) mod 2 ^ (x + y) = n mod 2 ^ x + n div 2 ^ x mod 2 ^ y * 2 ^ x"
   5.327    by (import bits SLICE_LEM2)
   5.328  
   5.329 -lemma SLICE_LEM3: "ALL (n::nat) (h::nat) l::nat.
   5.330 -   l < h --> n mod (2::nat) ^ Suc l <= n mod (2::nat) ^ h"
   5.331 +lemma SLICE_LEM3: "ALL (n::nat) (h::nat) l::nat. l < h --> n mod 2 ^ Suc l <= n mod 2 ^ h"
   5.332    by (import bits SLICE_LEM3)
   5.333  
   5.334 -lemma SLICE_THM: "ALL (n::nat) (h::nat) l::nat. SLICE h l n = BITS h l n * (2::nat) ^ l"
   5.335 +lemma SLICE_THM: "ALL (n::nat) (h::nat) l::nat. SLICE h l n = BITS h l n * 2 ^ l"
   5.336    by (import bits SLICE_THM)
   5.337  
   5.338 -lemma SLICELT_THM: "ALL (h::nat) (l::nat) n::nat. SLICE h l n < (2::nat) ^ Suc h"
   5.339 +lemma SLICELT_THM: "ALL (h::nat) (l::nat) n::nat. SLICE h l n < 2 ^ Suc h"
   5.340    by (import bits SLICELT_THM)
   5.341  
   5.342  lemma BITS_SLICE_THM: "ALL (h::nat) (l::nat) n::nat. BITS h l (SLICE h l n) = BITS h l n"
   5.343 @@ -253,44 +283,41 @@
   5.344     h <= (h2::nat) --> BITS h2 l (SLICE h l n) = BITS h l n"
   5.345    by (import bits BITS_SLICE_THM2)
   5.346  
   5.347 -lemma MOD_2EXP_MONO: "ALL (n::nat) (h::nat) l::nat.
   5.348 -   l <= h --> n mod (2::nat) ^ l <= n mod (2::nat) ^ Suc h"
   5.349 +lemma MOD_2EXP_MONO: "ALL (n::nat) (h::nat) l::nat. l <= h --> n mod 2 ^ l <= n mod 2 ^ Suc h"
   5.350    by (import bits MOD_2EXP_MONO)
   5.351  
   5.352  lemma SLICE_COMP_THM: "ALL (h::nat) (m::nat) (l::nat) n::nat.
   5.353     Suc m <= h & l <= m --> SLICE h (Suc m) n + SLICE m l n = SLICE h l n"
   5.354    by (import bits SLICE_COMP_THM)
   5.355  
   5.356 -lemma SLICE_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> SLICE h l n = (0::nat)"
   5.357 +lemma SLICE_ZERO: "ALL (h::nat) (l::nat) n::nat. h < l --> SLICE h l n = 0"
   5.358    by (import bits SLICE_ZERO)
   5.359  
   5.360  lemma BIT_COMP_THM3: "ALL (h::nat) (m::nat) (l::nat) n::nat.
   5.361     Suc m <= h & l <= m -->
   5.362 -   BITS h (Suc m) n * (2::nat) ^ (Suc m - l) + BITS m l n = BITS h l n"
   5.363 +   BITS h (Suc m) n * 2 ^ (Suc m - l) + BITS m l n = BITS h l n"
   5.364    by (import bits BIT_COMP_THM3)
   5.365  
   5.366 -lemma NOT_BIT: "ALL (n::nat) a::nat. (~ bit n a) = (BITS n n a = (0::nat))"
   5.367 +lemma NOT_BIT: "ALL (n::nat) a::nat. (~ bit n a) = (BITS n n a = 0)"
   5.368    by (import bits NOT_BIT)
   5.369  
   5.370 -lemma NOT_BITS: "ALL (n::nat) a::nat. (BITS n n a ~= (0::nat)) = (BITS n n a = (1::nat))"
   5.371 +lemma NOT_BITS: "ALL (n::nat) a::nat. (BITS n n a ~= 0) = (BITS n n a = 1)"
   5.372    by (import bits NOT_BITS)
   5.373  
   5.374 -lemma NOT_BITS2: "ALL (n::nat) a::nat. (BITS n n a ~= (1::nat)) = (BITS n n a = (0::nat))"
   5.375 +lemma NOT_BITS2: "ALL (n::nat) a::nat. (BITS n n a ~= 1) = (BITS n n a = 0)"
   5.376    by (import bits NOT_BITS2)
   5.377  
   5.378  lemma BIT_SLICE: "ALL (n::nat) (a::nat) b::nat.
   5.379     (bit n a = bit n b) = (SLICE n n a = SLICE n n b)"
   5.380    by (import bits BIT_SLICE)
   5.381  
   5.382 -lemma BIT_SLICE_LEM: "ALL (y::nat) (x::nat) n::nat.
   5.383 -   SBIT (bit x n) (x + y) = SLICE x x n * (2::nat) ^ y"
   5.384 +lemma BIT_SLICE_LEM: "ALL (y::nat) (x::nat) n::nat. SBIT (bit x n) (x + y) = SLICE x x n * 2 ^ y"
   5.385    by (import bits BIT_SLICE_LEM)
   5.386  
   5.387  lemma BIT_SLICE_THM: "ALL (x::nat) xa::nat. SBIT (bit x xa) x = SLICE x x xa"
   5.388    by (import bits BIT_SLICE_THM)
   5.389  
   5.390 -lemma SBIT_DIV: "ALL (b::bool) (m::nat) n::nat.
   5.391 -   n < m --> SBIT b (m - n) = SBIT b m div (2::nat) ^ n"
   5.392 +lemma SBIT_DIV: "ALL (b::bool) (m::nat) n::nat. n < m --> SBIT b (m - n) = SBIT b m div 2 ^ n"
   5.393    by (import bits SBIT_DIV)
   5.394  
   5.395  lemma BITS_SUC: "ALL (h::nat) (l::nat) n::nat.
   5.396 @@ -300,8 +327,7 @@
   5.397  
   5.398  lemma BITS_SUC_THM: "ALL (h::nat) (l::nat) n::nat.
   5.399     BITS (Suc h) l n =
   5.400 -   (if Suc h < l then 0::nat
   5.401 -    else SBIT (bit (Suc h) n) (Suc h - l) + BITS h l n)"
   5.402 +   (if Suc h < l then 0 else SBIT (bit (Suc h) n) (Suc h - l) + BITS h l n)"
   5.403    by (import bits BITS_SUC_THM)
   5.404  
   5.405  lemma BIT_BITS_THM: "ALL (h::nat) (l::nat) (a::nat) b::nat.
   5.406 @@ -310,12 +336,39 @@
   5.407    by (import bits BIT_BITS_THM)
   5.408  
   5.409  lemma BITWISE_LT_2EXP: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.410 -   BITWISE n oper a b < (2::nat) ^ n"
   5.411 +   BITWISE n oper a b < 2 ^ n"
   5.412    by (import bits BITWISE_LT_2EXP)
   5.413  
   5.414 -lemma LESS_EXP_MULT2: "ALL (a::nat) b::nat.
   5.415 -   a < b -->
   5.416 -   (EX x::nat. (2::nat) ^ b = (2::nat) ^ (x + (1::nat)) * (2::nat) ^ a)"
   5.417 +lemma LESS_EXP_MULT2: "(All::(nat => bool) => bool)
   5.418 + (%a::nat.
   5.419 +     (All::(nat => bool) => bool)
   5.420 +      (%b::nat.
   5.421 +          (op -->::bool => bool => bool) ((op <::nat => nat => bool) a b)
   5.422 +           ((Ex::(nat => bool) => bool)
   5.423 +             (%x::nat.
   5.424 +                 (op =::nat => nat => bool)
   5.425 +                  ((op ^::nat => nat => nat)
   5.426 +                    ((number_of::bin => nat)
   5.427 +                      ((op BIT::bin => bit => bin)
   5.428 +                        ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.429 +                          (bit.B1::bit))
   5.430 +                        (bit.B0::bit)))
   5.431 +                    b)
   5.432 +                  ((op *::nat => nat => nat)
   5.433 +                    ((op ^::nat => nat => nat)
   5.434 +                      ((number_of::bin => nat)
   5.435 +                        ((op BIT::bin => bit => bin)
   5.436 +                          ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.437 +                            (bit.B1::bit))
   5.438 +                          (bit.B0::bit)))
   5.439 +                      ((op +::nat => nat => nat) x (1::nat)))
   5.440 +                    ((op ^::nat => nat => nat)
   5.441 +                      ((number_of::bin => nat)
   5.442 +                        ((op BIT::bin => bit => bin)
   5.443 +                          ((op BIT::bin => bit => bin) (Numeral.Pls::bin)
   5.444 +                            (bit.B1::bit))
   5.445 +                          (bit.B0::bit)))
   5.446 +                      a))))))"
   5.447    by (import bits LESS_EXP_MULT2)
   5.448  
   5.449  lemma BITWISE_THM: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.450 @@ -324,27 +377,21 @@
   5.451  
   5.452  lemma BITWISE_COR: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.453     x < n -->
   5.454 -   oper (bit x a) (bit x b) -->
   5.455 -   BITWISE n oper a b div (2::nat) ^ x mod (2::nat) = (1::nat)"
   5.456 +   oper (bit x a) (bit x b) --> BITWISE n oper a b div 2 ^ x mod 2 = 1"
   5.457    by (import bits BITWISE_COR)
   5.458  
   5.459  lemma BITWISE_NOT_COR: "ALL (x::nat) (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.460     x < n -->
   5.461 -   ~ oper (bit x a) (bit x b) -->
   5.462 -   BITWISE n oper a b div (2::nat) ^ x mod (2::nat) = (0::nat)"
   5.463 +   ~ oper (bit x a) (bit x b) --> BITWISE n oper a b div 2 ^ x mod 2 = 0"
   5.464    by (import bits BITWISE_NOT_COR)
   5.465  
   5.466 -lemma MOD_PLUS_RIGHT: "ALL n>0::nat. ALL (j::nat) k::nat. (j + k mod n) mod n = (j + k) mod n"
   5.467 +lemma MOD_PLUS_RIGHT: "ALL n>0. ALL (j::nat) k::nat. (j + k mod n) mod n = (j + k) mod n"
   5.468    by (import bits MOD_PLUS_RIGHT)
   5.469  
   5.470 -lemma MOD_PLUS_1: "ALL n>0::nat.
   5.471 -   ALL x::nat. ((x + (1::nat)) mod n = (0::nat)) = (x mod n + (1::nat) = n)"
   5.472 +lemma MOD_PLUS_1: "ALL n>0. ALL x::nat. ((x + 1) mod n = 0) = (x mod n + 1 = n)"
   5.473    by (import bits MOD_PLUS_1)
   5.474  
   5.475 -lemma MOD_ADD_1: "ALL n>0::nat.
   5.476 -   ALL x::nat.
   5.477 -      (x + (1::nat)) mod n ~= (0::nat) -->
   5.478 -      (x + (1::nat)) mod n = x mod n + (1::nat)"
   5.479 +lemma MOD_ADD_1: "ALL n>0. ALL x::nat. (x + 1) mod n ~= 0 --> (x + 1) mod n = x mod n + 1"
   5.480    by (import bits MOD_ADD_1)
   5.481  
   5.482  ;end_setup
   5.483 @@ -379,18 +426,18 @@
   5.484    MODw :: "nat => nat" 
   5.485  
   5.486  defs
   5.487 -  MODw_primdef: "MODw == %n::nat. n mod (2::nat) ^ WL"
   5.488 +  MODw_primdef: "MODw == %n::nat. n mod 2 ^ WL"
   5.489  
   5.490 -lemma MODw_def: "ALL n::nat. MODw n = n mod (2::nat) ^ WL"
   5.491 +lemma MODw_def: "ALL n::nat. MODw n = n mod 2 ^ WL"
   5.492    by (import word32 MODw_def)
   5.493  
   5.494  consts
   5.495    INw :: "nat => bool" 
   5.496  
   5.497  defs
   5.498 -  INw_primdef: "INw == %n::nat. n < (2::nat) ^ WL"
   5.499 +  INw_primdef: "INw == %n::nat. n < 2 ^ WL"
   5.500  
   5.501 -lemma INw_def: "ALL n::nat. INw n = (n < (2::nat) ^ WL)"
   5.502 +lemma INw_def: "ALL n::nat. INw n = (n < 2 ^ WL)"
   5.503    by (import word32 INw_def)
   5.504  
   5.505  consts
   5.506 @@ -429,7 +476,7 @@
   5.507  lemma TOw_QT: "ALL a::nat. EQUIV (MODw a) a"
   5.508    by (import word32 TOw_QT)
   5.509  
   5.510 -lemma MODw_THM: "MODw = BITS HB (0::nat)"
   5.511 +lemma MODw_THM: "MODw = BITS HB 0"
   5.512    by (import word32 MODw_THM)
   5.513  
   5.514  lemma MOD_ADD: "ALL (a::nat) b::nat. MODw (a + b) = MODw (MODw a + MODw b)"
   5.515 @@ -442,16 +489,16 @@
   5.516    AONE :: "nat" 
   5.517  
   5.518  defs
   5.519 -  AONE_primdef: "AONE == 1::nat"
   5.520 +  AONE_primdef: "AONE == 1"
   5.521  
   5.522 -lemma AONE_def: "AONE = (1::nat)"
   5.523 +lemma AONE_def: "AONE = 1"
   5.524    by (import word32 AONE_def)
   5.525  
   5.526 -lemma ADD_QT: "(ALL n::nat. EQUIV ((0::nat) + n) n) &
   5.527 +lemma ADD_QT: "(ALL n::nat. EQUIV (0 + n) n) &
   5.528  (ALL (m::nat) n::nat. EQUIV (Suc m + n) (Suc (m + n)))"
   5.529    by (import word32 ADD_QT)
   5.530  
   5.531 -lemma ADD_0_QT: "ALL a::nat. EQUIV (a + (0::nat)) a"
   5.532 +lemma ADD_0_QT: "ALL a::nat. EQUIV (a + 0) a"
   5.533    by (import word32 ADD_0_QT)
   5.534  
   5.535  lemma ADD_COMM_QT: "ALL (a::nat) b::nat. EQUIV (a + b) (b + a)"
   5.536 @@ -460,30 +507,29 @@
   5.537  lemma ADD_ASSOC_QT: "ALL (a::nat) (b::nat) c::nat. EQUIV (a + (b + c)) (a + b + c)"
   5.538    by (import word32 ADD_ASSOC_QT)
   5.539  
   5.540 -lemma MULT_QT: "(ALL n::nat. EQUIV ((0::nat) * n) (0::nat)) &
   5.541 +lemma MULT_QT: "(ALL n::nat. EQUIV (0 * n) 0) &
   5.542  (ALL (m::nat) n::nat. EQUIV (Suc m * n) (m * n + n))"
   5.543    by (import word32 MULT_QT)
   5.544  
   5.545  lemma ADD1_QT: "ALL m::nat. EQUIV (Suc m) (m + AONE)"
   5.546    by (import word32 ADD1_QT)
   5.547  
   5.548 -lemma ADD_CLAUSES_QT: "(ALL m::nat. EQUIV ((0::nat) + m) m) &
   5.549 -(ALL m::nat. EQUIV (m + (0::nat)) m) &
   5.550 +lemma ADD_CLAUSES_QT: "(ALL m::nat. EQUIV (0 + m) m) &
   5.551 +(ALL m::nat. EQUIV (m + 0) m) &
   5.552  (ALL (m::nat) n::nat. EQUIV (Suc m + n) (Suc (m + n))) &
   5.553  (ALL (m::nat) n::nat. EQUIV (m + Suc n) (Suc (m + n)))"
   5.554    by (import word32 ADD_CLAUSES_QT)
   5.555  
   5.556 -lemma SUC_EQUIV_COMP: "ALL (a::nat) b::nat.
   5.557 -   EQUIV (Suc a) b --> EQUIV a (b + ((2::nat) ^ WL - (1::nat)))"
   5.558 +lemma SUC_EQUIV_COMP: "ALL (a::nat) b::nat. EQUIV (Suc a) b --> EQUIV a (b + (2 ^ WL - 1))"
   5.559    by (import word32 SUC_EQUIV_COMP)
   5.560  
   5.561  lemma INV_SUC_EQ_QT: "ALL (m::nat) n::nat. EQUIV (Suc m) (Suc n) = EQUIV m n"
   5.562    by (import word32 INV_SUC_EQ_QT)
   5.563  
   5.564 -lemma ADD_INV_0_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m --> EQUIV n (0::nat)"
   5.565 +lemma ADD_INV_0_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m --> EQUIV n 0"
   5.566    by (import word32 ADD_INV_0_QT)
   5.567  
   5.568 -lemma ADD_INV_0_EQ_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m = EQUIV n (0::nat)"
   5.569 +lemma ADD_INV_0_EQ_QT: "ALL (m::nat) n::nat. EQUIV (m + n) m = EQUIV n 0"
   5.570    by (import word32 ADD_INV_0_EQ_QT)
   5.571  
   5.572  lemma EQ_ADD_LCANCEL_QT: "ALL (m::nat) (n::nat) p::nat. EQUIV (m + n) (m + p) = EQUIV n p"
   5.573 @@ -502,8 +548,8 @@
   5.574    by (import word32 MULT_COMM_QT)
   5.575  
   5.576  lemma MULT_CLAUSES_QT: "ALL (m::nat) n::nat.
   5.577 -   EQUIV ((0::nat) * m) (0::nat) &
   5.578 -   EQUIV (m * (0::nat)) (0::nat) &
   5.579 +   EQUIV (0 * m) 0 &
   5.580 +   EQUIV (m * 0) 0 &
   5.581     EQUIV (AONE * m) m &
   5.582     EQUIV (m * AONE) m &
   5.583     EQUIV (Suc m * n) (m * n + n) & EQUIV (m * Suc n) (m + m * n)"
   5.584 @@ -522,21 +568,21 @@
   5.585    ONE_COMP :: "nat => nat" 
   5.586  
   5.587  defs
   5.588 -  ONE_COMP_primdef: "ONE_COMP == %x::nat. (2::nat) ^ WL - (1::nat) - MODw x"
   5.589 +  ONE_COMP_primdef: "ONE_COMP == %x::nat. 2 ^ WL - 1 - MODw x"
   5.590  
   5.591 -lemma ONE_COMP_def: "ALL x::nat. ONE_COMP x = (2::nat) ^ WL - (1::nat) - MODw x"
   5.592 +lemma ONE_COMP_def: "ALL x::nat. ONE_COMP x = 2 ^ WL - 1 - MODw x"
   5.593    by (import word32 ONE_COMP_def)
   5.594  
   5.595  consts
   5.596    TWO_COMP :: "nat => nat" 
   5.597  
   5.598  defs
   5.599 -  TWO_COMP_primdef: "TWO_COMP == %x::nat. (2::nat) ^ WL - MODw x"
   5.600 +  TWO_COMP_primdef: "TWO_COMP == %x::nat. 2 ^ WL - MODw x"
   5.601  
   5.602 -lemma TWO_COMP_def: "ALL x::nat. TWO_COMP x = (2::nat) ^ WL - MODw x"
   5.603 +lemma TWO_COMP_def: "ALL x::nat. TWO_COMP x = 2 ^ WL - MODw x"
   5.604    by (import word32 TWO_COMP_def)
   5.605  
   5.606 -lemma ADD_TWO_COMP_QT: "ALL a::nat. EQUIV (MODw a + TWO_COMP a) (0::nat)"
   5.607 +lemma ADD_TWO_COMP_QT: "ALL a::nat. EQUIV (MODw a + TWO_COMP a) 0"
   5.608    by (import word32 ADD_TWO_COMP_QT)
   5.609  
   5.610  lemma TWO_COMP_ONE_COMP_QT: "ALL a::nat. EQUIV (TWO_COMP a) (ONE_COMP a + AONE)"
   5.611 @@ -557,8 +603,7 @@
   5.612             ((EQUIV::nat => nat => bool) x xa)))"
   5.613    by (import word32 BIT_EQUIV_THM)
   5.614  
   5.615 -lemma BITS_SUC2: "ALL (n::nat) a::nat.
   5.616 -   BITS (Suc n) (0::nat) a = SLICE (Suc n) (Suc n) a + BITS n (0::nat) a"
   5.617 +lemma BITS_SUC2: "ALL (n::nat) a::nat. BITS (Suc n) 0 a = SLICE (Suc n) (Suc n) a + BITS n 0 a"
   5.618    by (import word32 BITS_SUC2)
   5.619  
   5.620  lemma BITWISE_ONE_COMP_THM: "ALL (a::nat) b::nat. BITWISE WL (%(x::bool) y::bool. ~ x) a b = ONE_COMP a"
   5.621 @@ -598,9 +643,9 @@
   5.622    COMP0 :: "nat" 
   5.623  
   5.624  defs
   5.625 -  COMP0_primdef: "COMP0 == ONE_COMP (0::nat)"
   5.626 +  COMP0_primdef: "COMP0 == ONE_COMP 0"
   5.627  
   5.628 -lemma COMP0_def: "COMP0 = ONE_COMP (0::nat)"
   5.629 +lemma COMP0_def: "COMP0 = ONE_COMP 0"
   5.630    by (import word32 COMP0_def)
   5.631  
   5.632  lemma BITWISE_THM2: "(All::(nat => bool) => bool)
   5.633 @@ -655,7 +700,7 @@
   5.634  lemma OR_COMP_QT: "ALL a::nat. EQUIV (OR a (ONE_COMP a)) COMP0"
   5.635    by (import word32 OR_COMP_QT)
   5.636  
   5.637 -lemma AND_COMP_QT: "ALL a::nat. EQUIV (AND a (ONE_COMP a)) (0::nat)"
   5.638 +lemma AND_COMP_QT: "ALL a::nat. EQUIV (AND a (ONE_COMP a)) 0"
   5.639    by (import word32 AND_COMP_QT)
   5.640  
   5.641  lemma ONE_COMP_QT: "ALL a::nat. EQUIV (ONE_COMP (ONE_COMP a)) a"
   5.642 @@ -683,16 +728,14 @@
   5.643    by (import word32 MSB_WELLDEF)
   5.644  
   5.645  lemma BITWISE_ISTEP: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.646 -   (0::nat) < n -->
   5.647 -   BITWISE n oper (a div (2::nat)) (b div (2::nat)) =
   5.648 -   BITWISE n oper a b div (2::nat) +
   5.649 -   SBIT (oper (bit n a) (bit n b)) (n - (1::nat))"
   5.650 +   0 < n -->
   5.651 +   BITWISE n oper (a div 2) (b div 2) =
   5.652 +   BITWISE n oper a b div 2 + SBIT (oper (bit n a) (bit n b)) (n - 1)"
   5.653    by (import word32 BITWISE_ISTEP)
   5.654  
   5.655  lemma BITWISE_EVAL: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) b::nat.
   5.656     BITWISE (Suc n) oper a b =
   5.657 -   (2::nat) * BITWISE n oper (a div (2::nat)) (b div (2::nat)) +
   5.658 -   SBIT (oper (LSBn a) (LSBn b)) (0::nat)"
   5.659 +   2 * BITWISE n oper (a div 2) (b div 2) + SBIT (oper (LSBn a) (LSBn b)) 0"
   5.660    by (import word32 BITWISE_EVAL)
   5.661  
   5.662  lemma BITWISE_WELLDEF: "ALL (n::nat) (oper::bool => bool => bool) (a::nat) (b::nat) (c::nat) d::nat.
   5.663 @@ -728,9 +771,9 @@
   5.664    LSR_ONE :: "nat => nat" 
   5.665  
   5.666  defs
   5.667 -  LSR_ONE_primdef: "LSR_ONE == %a::nat. MODw a div (2::nat)"
   5.668 +  LSR_ONE_primdef: "LSR_ONE == %a::nat. MODw a div 2"
   5.669  
   5.670 -lemma LSR_ONE_def: "ALL a::nat. LSR_ONE a = MODw a div (2::nat)"
   5.671 +lemma LSR_ONE_def: "ALL a::nat. LSR_ONE a = MODw a div 2"
   5.672    by (import word32 LSR_ONE_def)
   5.673  
   5.674  consts
   5.675 @@ -772,7 +815,7 @@
   5.676  lemma RRX_WELLDEF: "ALL (a::nat) (b::nat) c::bool. EQUIV a b --> EQUIV (RRXn c a) (RRXn c b)"
   5.677    by (import word32 RRX_WELLDEF)
   5.678  
   5.679 -lemma LSR_ONE: "LSR_ONE = BITS HB (1::nat)"
   5.680 +lemma LSR_ONE: "LSR_ONE = BITS HB 1"
   5.681    by (import word32 LSR_ONE)
   5.682  
   5.683  typedef (open) word32 = "{x::nat => bool. EX xa::nat. x = EQUIV xa}" 
   5.684 @@ -793,9 +836,9 @@
   5.685    w_0 :: "word32" 
   5.686  
   5.687  defs
   5.688 -  w_0_primdef: "w_0 == mk_word32 (EQUIV (0::nat))"
   5.689 +  w_0_primdef: "w_0 == mk_word32 (EQUIV 0)"
   5.690  
   5.691 -lemma w_0_def: "w_0 = mk_word32 (EQUIV (0::nat))"
   5.692 +lemma w_0_def: "w_0 = mk_word32 (EQUIV 0)"
   5.693    by (import word32 w_0_def)
   5.694  
   5.695  consts
   5.696 @@ -1081,10 +1124,10 @@
   5.697     word_1comp (bitwise_or x xa) = bitwise_and (word_1comp x) (word_1comp xa)"
   5.698    by (import word32 DE_MORGAN_THMw)
   5.699  
   5.700 -lemma w_0: "w_0 = n2w (0::nat)"
   5.701 +lemma w_0: "w_0 = n2w 0"
   5.702    by (import word32 w_0)
   5.703  
   5.704 -lemma w_1: "w_1 = n2w (1::nat)"
   5.705 +lemma w_1: "w_1 = n2w 1"
   5.706    by (import word32 w_1)
   5.707  
   5.708  lemma w_T: "w_T =
   5.709 @@ -1139,9 +1182,9 @@
   5.710  
   5.711  constdefs
   5.712    word_lsl :: "word32 => nat => word32" 
   5.713 -  "word_lsl == %(a::word32) n::nat. word_mul a (n2w ((2::nat) ^ n))"
   5.714 +  "word_lsl == %(a::word32) n::nat. word_mul a (n2w (2 ^ n))"
   5.715  
   5.716 -lemma word_lsl: "ALL (a::word32) n::nat. word_lsl a n = word_mul a (n2w ((2::nat) ^ n))"
   5.717 +lemma word_lsl: "ALL (a::word32) n::nat. word_lsl a n = word_mul a (n2w (2 ^ n))"
   5.718    by (import word32 word_lsl)
   5.719  
   5.720  constdefs
   5.721 @@ -1320,14 +1363,13 @@
   5.722  lemma LSL_LIMIT: "ALL (w::word32) n::nat. HB < n --> word_lsl w n = w_0"
   5.723    by (import word32 LSL_LIMIT)
   5.724  
   5.725 -lemma MOD_MOD_DIV: "ALL (a::nat) b::nat. INw (MODw a div (2::nat) ^ b)"
   5.726 +lemma MOD_MOD_DIV: "ALL (a::nat) b::nat. INw (MODw a div 2 ^ b)"
   5.727    by (import word32 MOD_MOD_DIV)
   5.728  
   5.729 -lemma MOD_MOD_DIV_2EXP: "ALL (a::nat) n::nat.
   5.730 -   MODw (MODw a div (2::nat) ^ n) div (2::nat) = MODw a div (2::nat) ^ Suc n"
   5.731 +lemma MOD_MOD_DIV_2EXP: "ALL (a::nat) n::nat. MODw (MODw a div 2 ^ n) div 2 = MODw a div 2 ^ Suc n"
   5.732    by (import word32 MOD_MOD_DIV_2EXP)
   5.733  
   5.734 -lemma LSR_EVAL: "ALL n::nat. word_lsr (n2w (a::nat)) n = n2w (MODw a div (2::nat) ^ n)"
   5.735 +lemma LSR_EVAL: "ALL n::nat. word_lsr (n2w (a::nat)) n = n2w (MODw a div 2 ^ n)"
   5.736    by (import word32 LSR_EVAL)
   5.737  
   5.738  lemma LSR_THM: "ALL (x::nat) n::nat. word_lsr (n2w n) x = n2w (BITS HB (min WL x) n)"
   5.739 @@ -1336,16 +1378,13 @@
   5.740  lemma LSR_LIMIT: "ALL (x::nat) w::word32. HB < x --> word_lsr w x = w_0"
   5.741    by (import word32 LSR_LIMIT)
   5.742  
   5.743 -lemma LEFT_SHIFT_LESS: "ALL (n::nat) (m::nat) a::nat.
   5.744 -   a < (2::nat) ^ m -->
   5.745 -   (2::nat) ^ n + a * (2::nat) ^ n <= (2::nat) ^ (m + n)"
   5.746 +lemma LEFT_SHIFT_LESS: "ALL (n::nat) (m::nat) a::nat. a < 2 ^ m --> 2 ^ n + a * 2 ^ n <= 2 ^ (m + n)"
   5.747    by (import word32 LEFT_SHIFT_LESS)
   5.748  
   5.749  lemma ROR_THM: "ALL (x::nat) n::nat.
   5.750     word_ror (n2w n) x =
   5.751     (let x'::nat = x mod WL
   5.752 -    in n2w (BITS HB x' n +
   5.753 -            BITS (x' - (1::nat)) (0::nat) n * (2::nat) ^ (WL - x')))"
   5.754 +    in n2w (BITS HB x' n + BITS (x' - 1) 0 n * 2 ^ (WL - x')))"
   5.755    by (import word32 ROR_THM)
   5.756  
   5.757  lemma ROR_CYCLE: "ALL (x::nat) w::word32. word_ror w (x * WL) = w"
   5.758 @@ -1354,7 +1393,7 @@
   5.759  lemma ASR_THM: "ALL (x::nat) n::nat.
   5.760     word_asr (n2w n) x =
   5.761     (let x'::nat = min HB x; s::nat = BITS HB x' n
   5.762 -    in n2w (if MSBn n then (2::nat) ^ WL - (2::nat) ^ (WL - x') + s else s))"
   5.763 +    in n2w (if MSBn n then 2 ^ WL - 2 ^ (WL - x') + s else s))"
   5.764    by (import word32 ASR_THM)
   5.765  
   5.766  lemma ASR_LIMIT: "ALL (x::nat) w::word32.
   5.767 @@ -1366,10 +1405,9 @@
   5.768  (ALL n::nat. word_lsr w_0 n = w_0) & (ALL n::nat. word_ror w_0 n = w_0)"
   5.769    by (import word32 ZERO_SHIFT)
   5.770  
   5.771 -lemma ZERO_SHIFT2: "(ALL a::word32. word_lsl a (0::nat) = a) &
   5.772 -(ALL a::word32. word_asr a (0::nat) = a) &
   5.773 -(ALL a::word32. word_lsr a (0::nat) = a) &
   5.774 -(ALL a::word32. word_ror a (0::nat) = a)"
   5.775 +lemma ZERO_SHIFT2: "(ALL a::word32. word_lsl a 0 = a) &
   5.776 +(ALL a::word32. word_asr a 0 = a) &
   5.777 +(ALL a::word32. word_lsr a 0 = a) & (ALL a::word32. word_ror a 0 = a)"
   5.778    by (import word32 ZERO_SHIFT2)
   5.779  
   5.780  lemma ASR_w_T: "ALL n::nat. word_asr w_T n = w_T"
   5.781 @@ -1425,19 +1463,19 @@
   5.782  
   5.783  lemma ONE_COMP_EVAL2: "ALL a::nat.
   5.784     word_1comp (n2w a) =
   5.785 -   n2w ((2::nat) ^
   5.786 +   n2w (2 ^
   5.787          NUMERAL
   5.788           (NUMERAL_BIT2
   5.789             (NUMERAL_BIT1
   5.790               (NUMERAL_BIT1 (NUMERAL_BIT1 (NUMERAL_BIT1 ALT_ZERO))))) -
   5.791 -        (1::nat) -
   5.792 +        1 -
   5.793          MODw a)"
   5.794    by (import word32 ONE_COMP_EVAL2)
   5.795  
   5.796  lemma TWO_COMP_EVAL2: "ALL a::nat.
   5.797     word_2comp (n2w a) =
   5.798     n2w (MODw
   5.799 -         ((2::nat) ^
   5.800 +         (2 ^
   5.801            NUMERAL
   5.802             (NUMERAL_BIT2
   5.803               (NUMERAL_BIT1
   5.804 @@ -1445,12 +1483,12 @@
   5.805            MODw a))"
   5.806    by (import word32 TWO_COMP_EVAL2)
   5.807  
   5.808 -lemma LSR_ONE_EVAL2: "ALL a::nat. word_lsr1 (n2w a) = n2w (MODw a div (2::nat))"
   5.809 +lemma LSR_ONE_EVAL2: "ALL a::nat. word_lsr1 (n2w a) = n2w (MODw a div 2)"
   5.810    by (import word32 LSR_ONE_EVAL2)
   5.811  
   5.812  lemma ASR_ONE_EVAL2: "ALL a::nat.
   5.813     word_asr1 (n2w a) =
   5.814 -   n2w (MODw a div (2::nat) +
   5.815 +   n2w (MODw a div 2 +
   5.816          SBIT (MSBn a)
   5.817           (NUMERAL
   5.818             (NUMERAL_BIT1
   5.819 @@ -1460,7 +1498,7 @@
   5.820  
   5.821  lemma ROR_ONE_EVAL2: "ALL a::nat.
   5.822     word_ror1 (n2w a) =
   5.823 -   n2w (MODw a div (2::nat) +
   5.824 +   n2w (MODw a div 2 +
   5.825          SBIT (LSBn a)
   5.826           (NUMERAL
   5.827             (NUMERAL_BIT1
   5.828 @@ -1470,7 +1508,7 @@
   5.829  
   5.830  lemma RRX_EVAL2: "ALL (c::bool) a::nat.
   5.831     RRX c (n2w a) =
   5.832 -   n2w (MODw a div (2::nat) +
   5.833 +   n2w (MODw a div 2 +
   5.834          SBIT c
   5.835           (NUMERAL
   5.836             (NUMERAL_BIT1
   5.837 @@ -1520,50 +1558,14 @@
   5.838           (%(x::bool) y::bool. x ~= y) a b)"
   5.839    by (import word32 EOR_EVAL2)
   5.840  
   5.841 -lemma BITWISE_EVAL2: "(All::(nat => bool) => bool)
   5.842 - (%n::nat.
   5.843 -     (All::((bool => bool => bool) => bool) => bool)
   5.844 -      (%oper::bool => bool => bool.
   5.845 -          (All::(nat => bool) => bool)
   5.846 -           (%x::nat.
   5.847 -               (All::(nat => bool) => bool)
   5.848 -                (%y::nat.
   5.849 -                    (op =::nat => nat => bool)
   5.850 -                     ((BITWISE::nat
   5.851 -                                => (bool => bool => bool)
   5.852 -                                   => nat => nat => nat)
   5.853 -                       n oper x y)
   5.854 -                     ((If::bool => nat => nat => nat)
   5.855 -                       ((op =::nat => nat => bool) n (0::nat)) (0::nat)
   5.856 -                       ((op +::nat => nat => nat)
   5.857 -                         ((op *::nat => nat => nat)
   5.858 -                           ((number_of::bin => nat)
   5.859 -                             ((op BIT::bin => bit => bin)
   5.860 -                               ((op BIT::bin => bit => bin)
   5.861 -                                 (Numeral.Pls::bin) (bit.B1::bit))
   5.862 -                               (bit.B0::bit)))
   5.863 -                           ((BITWISE::nat
   5.864 -=> (bool => bool => bool) => nat => nat => nat)
   5.865 -                             ((op -::nat => nat => nat) n (1::nat)) oper
   5.866 -                             ((op div::nat => nat => nat) x
   5.867 -                               ((number_of::bin => nat)
   5.868 -                                 ((op BIT::bin => bit => bin)
   5.869 -                                   ((op BIT::bin => bit => bin)
   5.870 -                                     (Numeral.Pls::bin) (bit.B1::bit))
   5.871 -                                   (bit.B0::bit))))
   5.872 -                             ((op div::nat => nat => nat) y
   5.873 -                               ((number_of::bin => nat)
   5.874 -                                 ((op BIT::bin => bit => bin)
   5.875 -                                   ((op BIT::bin => bit => bin)
   5.876 -                                     (Numeral.Pls::bin) (bit.B1::bit))
   5.877 -                                   (bit.B0::bit))))))
   5.878 -                         ((If::bool => nat => nat => nat)
   5.879 -                           (oper ((ODD::nat => bool) x)
   5.880 -                             ((ODD::nat => bool) y))
   5.881 -                           (1::nat) (0::nat))))))))"
   5.882 +lemma BITWISE_EVAL2: "ALL (n::nat) (oper::bool => bool => bool) (x::nat) y::nat.
   5.883 +   BITWISE n oper x y =
   5.884 +   (if n = 0 then 0
   5.885 +    else 2 * BITWISE (n - 1) oper (x div 2) (y div 2) +
   5.886 +         (if oper (ODD x) (ODD y) then 1 else 0))"
   5.887    by (import word32 BITWISE_EVAL2)
   5.888  
   5.889 -lemma BITSwLT_THM: "ALL (h::nat) (l::nat) n::word32. BITSw h l n < (2::nat) ^ (Suc h - l)"
   5.890 +lemma BITSwLT_THM: "ALL (h::nat) (l::nat) n::word32. BITSw h l n < 2 ^ (Suc h - l)"
   5.891    by (import word32 BITSwLT_THM)
   5.892  
   5.893  lemma BITSw_COMP_THM: "ALL (h1::nat) (l1::nat) (h2::nat) (l2::nat) n::word32.
   5.894 @@ -1572,29 +1574,29 @@
   5.895    by (import word32 BITSw_COMP_THM)
   5.896  
   5.897  lemma BITSw_DIV_THM: "ALL (h::nat) (l::nat) (n::nat) x::word32.
   5.898 -   BITSw h l x div (2::nat) ^ n = BITSw h (l + n) x"
   5.899 +   BITSw h l x div 2 ^ n = BITSw h (l + n) x"
   5.900    by (import word32 BITSw_DIV_THM)
   5.901  
   5.902 -lemma BITw_THM: "ALL (b::nat) n::word32. BITw b n = (BITSw b b n = (1::nat))"
   5.903 +lemma BITw_THM: "ALL (b::nat) n::word32. BITw b n = (BITSw b b n = 1)"
   5.904    by (import word32 BITw_THM)
   5.905  
   5.906 -lemma SLICEw_THM: "ALL (n::word32) (h::nat) l::nat. SLICEw h l n = BITSw h l n * (2::nat) ^ l"
   5.907 +lemma SLICEw_THM: "ALL (n::word32) (h::nat) l::nat. SLICEw h l n = BITSw h l n * 2 ^ l"
   5.908    by (import word32 SLICEw_THM)
   5.909  
   5.910  lemma BITS_SLICEw_THM: "ALL (h::nat) (l::nat) n::word32. BITS h l (SLICEw h l n) = BITSw h l n"
   5.911    by (import word32 BITS_SLICEw_THM)
   5.912  
   5.913 -lemma SLICEw_ZERO_THM: "ALL (n::word32) h::nat. SLICEw h (0::nat) n = BITSw h (0::nat) n"
   5.914 +lemma SLICEw_ZERO_THM: "ALL (n::word32) h::nat. SLICEw h 0 n = BITSw h 0 n"
   5.915    by (import word32 SLICEw_ZERO_THM)
   5.916  
   5.917  lemma SLICEw_COMP_THM: "ALL (h::nat) (m::nat) (l::nat) a::word32.
   5.918     Suc m <= h & l <= m --> SLICEw h (Suc m) a + SLICEw m l a = SLICEw h l a"
   5.919    by (import word32 SLICEw_COMP_THM)
   5.920  
   5.921 -lemma BITSw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> BITSw h l n = (0::nat)"
   5.922 +lemma BITSw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> BITSw h l n = 0"
   5.923    by (import word32 BITSw_ZERO)
   5.924  
   5.925 -lemma SLICEw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> SLICEw h l n = (0::nat)"
   5.926 +lemma SLICEw_ZERO: "ALL (h::nat) (l::nat) n::word32. h < l --> SLICEw h l n = 0"
   5.927    by (import word32 SLICEw_ZERO)
   5.928  
   5.929  ;end_setup
     6.1 --- a/src/HOL/Import/HOL/bool.imp	Mon Sep 26 15:56:28 2005 +0200
     6.2 +++ b/src/HOL/Import/HOL/bool.imp	Mon Sep 26 16:10:19 2005 +0200
     6.3 @@ -41,7 +41,7 @@
     6.4    "boolAxiom" > "HOL4Base.bool.boolAxiom"
     6.5    "UNWIND_THM2" > "HOL.simp_thms_39"
     6.6    "UNWIND_THM1" > "HOL.simp_thms_40"
     6.7 -  "UNWIND_FORALL_THM2" > "HOL4Base.bool.UNWIND_FORALL_THM2"
     6.8 +  "UNWIND_FORALL_THM2" > "HOL.simp_thms_41"
     6.9    "UNWIND_FORALL_THM1" > "HOL.simp_thms_42"
    6.10    "UEXISTS_SIMP" > "HOL4Base.bool.UEXISTS_SIMP"
    6.11    "UEXISTS_OR_THM" > "HOL4Base.bool.UEXISTS_OR_THM"
    6.12 @@ -95,7 +95,7 @@
    6.13    "NOT_AND" > "HOL4Base.bool.NOT_AND"
    6.14    "MONO_OR" > "Inductive.basic_monos_3"
    6.15    "MONO_NOT" > "HOL.rev_contrapos"
    6.16 -  "MONO_IMP" > "HOL4Base.bool.MONO_IMP"
    6.17 +  "MONO_IMP" > "Set.imp_mono"
    6.18    "MONO_EXISTS" > "Inductive.basic_monos_5"
    6.19    "MONO_COND" > "HOL4Base.bool.MONO_COND"
    6.20    "MONO_AND" > "Inductive.basic_monos_4"
    6.21 @@ -108,11 +108,11 @@
    6.22    "LEFT_OR_OVER_AND" > "HOL.disj_conj_distribL"
    6.23    "LEFT_OR_EXISTS_THM" > "HOL.ex_simps_3"
    6.24    "LEFT_FORALL_OR_THM" > "HOL.all_simps_3"
    6.25 -  "LEFT_FORALL_IMP_THM" > "HOL4Base.bool.LEFT_FORALL_IMP_THM"
    6.26 +  "LEFT_FORALL_IMP_THM" > "HOL.imp_ex"
    6.27    "LEFT_EXISTS_IMP_THM" > "HOL.imp_all"
    6.28    "LEFT_EXISTS_AND_THM" > "HOL.ex_simps_1"
    6.29    "LEFT_AND_OVER_OR" > "HOL.conj_disj_distribL"
    6.30 -  "LEFT_AND_FORALL_THM" > "HOL4Base.bool.LEFT_AND_FORALL_THM"
    6.31 +  "LEFT_AND_FORALL_THM" > "HOL.all_simps_1"
    6.32    "IN_def" > "HOL4Base.bool.IN_def"
    6.33    "IN_DEF" > "HOL4Base.bool.IN_DEF"
    6.34    "INFINITY_AX" > "HOL4Setup.INFINITY_AX"
    6.35 @@ -146,7 +146,7 @@
    6.36    "EQ_SYM" > "HOL.meta_eq_to_obj_eq"
    6.37    "EQ_REFL" > "Presburger.fm_modd_pinf"
    6.38    "EQ_IMP_THM" > "HOL.iff_conv_conj_imp"
    6.39 -  "EQ_EXT" > "HOL4Base.bool.EQ_EXT"
    6.40 +  "EQ_EXT" > "HOL.meta_eq_to_obj_eq"
    6.41    "EQ_EXPAND" > "HOL4Base.bool.EQ_EXPAND"
    6.42    "EQ_CLAUSES" > "HOL4Base.bool.EQ_CLAUSES"
    6.43    "DISJ_SYM" > "HOL.disj_comms_1"
     7.1 --- a/src/HOL/Import/HOLLight/HOLLight.thy	Mon Sep 26 15:56:28 2005 +0200
     7.2 +++ b/src/HOL/Import/HOLLight/HOLLight.thy	Mon Sep 26 16:10:19 2005 +0200
     7.3 @@ -96,7 +96,7 @@
     7.4    by (import hollight EXCLUDED_MIDDLE)
     7.5  
     7.6  constdefs
     7.7 -  COND :: "bool => 'A::type => 'A::type => 'A::type" 
     7.8 +  COND :: "bool => 'A => 'A => 'A" 
     7.9    "COND ==
    7.10  %(t::bool) (t1::'A::type) t2::'A::type.
    7.11     SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
    7.12 @@ -174,14 +174,14 @@
    7.13    by (import hollight th_cond)
    7.14  
    7.15  constdefs
    7.16 -  LET_END :: "'A::type => 'A::type" 
    7.17 +  LET_END :: "'A => 'A" 
    7.18    "LET_END == %t::'A::type. t"
    7.19  
    7.20  lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
    7.21    by (import hollight DEF_LET_END)
    7.22  
    7.23  constdefs
    7.24 -  GABS :: "('A::type => bool) => 'A::type" 
    7.25 +  GABS :: "('A => bool) => 'A" 
    7.26    "(op ==::(('A::type => bool) => 'A::type)
    7.27          => (('A::type => bool) => 'A::type) => prop)
    7.28   (GABS::('A::type => bool) => 'A::type)
    7.29 @@ -194,7 +194,7 @@
    7.30    by (import hollight DEF_GABS)
    7.31  
    7.32  constdefs
    7.33 -  GEQ :: "'A::type => 'A::type => bool" 
    7.34 +  GEQ :: "'A => 'A => bool" 
    7.35    "(op ==::('A::type => 'A::type => bool)
    7.36          => ('A::type => 'A::type => bool) => prop)
    7.37   (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
    7.38 @@ -209,7 +209,7 @@
    7.39    by (import hollight PAIR_EXISTS_THM)
    7.40  
    7.41  constdefs
    7.42 -  CURRY :: "('A::type * 'B::type => 'C::type) => 'A::type => 'B::type => 'C::type" 
    7.43 +  CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" 
    7.44    "CURRY ==
    7.45  %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
    7.46     u (ua, ub)"
    7.47 @@ -220,7 +220,7 @@
    7.48    by (import hollight DEF_CURRY)
    7.49  
    7.50  constdefs
    7.51 -  UNCURRY :: "('A::type => 'B::type => 'C::type) => 'A::type * 'B::type => 'C::type" 
    7.52 +  UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" 
    7.53    "UNCURRY ==
    7.54  %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
    7.55     u (fst ua) (snd ua)"
    7.56 @@ -231,8 +231,7 @@
    7.57    by (import hollight DEF_UNCURRY)
    7.58  
    7.59  constdefs
    7.60 -  PASSOC :: "(('A::type * 'B::type) * 'C::type => 'D::type)
    7.61 -=> 'A::type * 'B::type * 'C::type => 'D::type" 
    7.62 +  PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" 
    7.63    "PASSOC ==
    7.64  %(u::('A::type * 'B::type) * 'C::type => 'D::type)
    7.65     ua::'A::type * 'B::type * 'C::type.
    7.66 @@ -245,12 +244,11 @@
    7.67    by (import hollight DEF_PASSOC)
    7.68  
    7.69  lemma num_Axiom: "ALL (e::'A::type) f::'A::type => nat => 'A::type.
    7.70 -   EX! fn::nat => 'A::type.
    7.71 -      fn (0::nat) = e & (ALL n::nat. fn (Suc n) = f (fn n) n)"
    7.72 +   EX! fn::nat => 'A::type. fn 0 = e & (ALL n::nat. fn (Suc n) = f (fn n) n)"
    7.73    by (import hollight num_Axiom)
    7.74  
    7.75 -lemma ADD_CLAUSES: "(ALL x::nat. (0::nat) + x = x) &
    7.76 -(ALL x::nat. x + (0::nat) = x) &
    7.77 +lemma ADD_CLAUSES: "(ALL x::nat. 0 + x = x) &
    7.78 +(ALL x::nat. x + 0 = x) &
    7.79  (ALL (x::nat) xa::nat. Suc x + xa = Suc (x + xa)) &
    7.80  (ALL (x::nat) xa::nat. x + Suc xa = Suc (x + xa))"
    7.81    by (import hollight ADD_CLAUSES)
    7.82 @@ -259,25 +257,25 @@
    7.83  m + n + (p::nat) = m + (n + p) & m + (n + p) = n + (m + p)"
    7.84    by (import hollight ADD_AC)
    7.85  
    7.86 -lemma EQ_ADD_LCANCEL_0: "ALL (m::nat) n::nat. (m + n = m) = (n = (0::nat))"
    7.87 +lemma EQ_ADD_LCANCEL_0: "ALL (m::nat) n::nat. (m + n = m) = (n = 0)"
    7.88    by (import hollight EQ_ADD_LCANCEL_0)
    7.89  
    7.90 -lemma EQ_ADD_RCANCEL_0: "ALL (x::nat) xa::nat. (x + xa = xa) = (x = (0::nat))"
    7.91 +lemma EQ_ADD_RCANCEL_0: "ALL (x::nat) xa::nat. (x + xa = xa) = (x = 0)"
    7.92    by (import hollight EQ_ADD_RCANCEL_0)
    7.93  
    7.94 -lemma ONE: "NUMERAL_BIT1 (0::nat) = Suc (0::nat)"
    7.95 +lemma ONE: "NUMERAL_BIT1 0 = Suc 0"
    7.96    by (import hollight ONE)
    7.97  
    7.98 -lemma TWO: "NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) = Suc (NUMERAL_BIT1 (0::nat))"
    7.99 +lemma TWO: "NUMERAL_BIT0 (NUMERAL_BIT1 0) = Suc (NUMERAL_BIT1 0)"
   7.100    by (import hollight TWO)
   7.101  
   7.102 -lemma ADD1: "ALL x::nat. Suc x = x + NUMERAL_BIT1 (0::nat)"
   7.103 +lemma ADD1: "ALL x::nat. Suc x = x + NUMERAL_BIT1 0"
   7.104    by (import hollight ADD1)
   7.105  
   7.106 -lemma MULT_CLAUSES: "(ALL x::nat. (0::nat) * x = (0::nat)) &
   7.107 -(ALL x::nat. x * (0::nat) = (0::nat)) &
   7.108 -(ALL x::nat. NUMERAL_BIT1 (0::nat) * x = x) &
   7.109 -(ALL x::nat. x * NUMERAL_BIT1 (0::nat) = x) &
   7.110 +lemma MULT_CLAUSES: "(ALL x::nat. 0 * x = 0) &
   7.111 +(ALL x::nat. x * 0 = 0) &
   7.112 +(ALL x::nat. NUMERAL_BIT1 0 * x = x) &
   7.113 +(ALL x::nat. x * NUMERAL_BIT1 0 = x) &
   7.114  (ALL (x::nat) xa::nat. Suc x * xa = x * xa + xa) &
   7.115  (ALL (x::nat) xa::nat. x * Suc xa = x + x * xa)"
   7.116    by (import hollight MULT_CLAUSES)
   7.117 @@ -286,40 +284,39 @@
   7.118  m * n * (p::nat) = m * (n * p) & m * (n * p) = n * (m * p)"
   7.119    by (import hollight MULT_AC)
   7.120  
   7.121 -lemma MULT_2: "ALL n::nat. NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * n = n + n"
   7.122 +lemma MULT_2: "ALL n::nat. NUMERAL_BIT0 (NUMERAL_BIT1 0) * n = n + n"
   7.123    by (import hollight MULT_2)
   7.124  
   7.125  lemma MULT_EQ_1: "ALL (m::nat) n::nat.
   7.126 -   (m * n = NUMERAL_BIT1 (0::nat)) =
   7.127 -   (m = NUMERAL_BIT1 (0::nat) & n = NUMERAL_BIT1 (0::nat))"
   7.128 +   (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   7.129    by (import hollight MULT_EQ_1)
   7.130  
   7.131  constdefs
   7.132    EXP :: "nat => nat => nat" 
   7.133    "EXP ==
   7.134  SOME EXP::nat => nat => nat.
   7.135 -   (ALL m::nat. EXP m (0::nat) = NUMERAL_BIT1 (0::nat)) &
   7.136 +   (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   7.137     (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n)"
   7.138  
   7.139  lemma DEF_EXP: "EXP =
   7.140  (SOME EXP::nat => nat => nat.
   7.141 -    (ALL m::nat. EXP m (0::nat) = NUMERAL_BIT1 (0::nat)) &
   7.142 +    (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   7.143      (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n))"
   7.144    by (import hollight DEF_EXP)
   7.145  
   7.146 -lemma EXP_EQ_0: "ALL (m::nat) n::nat. (EXP m n = (0::nat)) = (m = (0::nat) & n ~= (0::nat))"
   7.147 +lemma EXP_EQ_0: "ALL (m::nat) n::nat. (EXP m n = 0) = (m = 0 & n ~= 0)"
   7.148    by (import hollight EXP_EQ_0)
   7.149  
   7.150  lemma EXP_ADD: "ALL (m::nat) (n::nat) p::nat. EXP m (n + p) = EXP m n * EXP m p"
   7.151    by (import hollight EXP_ADD)
   7.152  
   7.153 -lemma EXP_ONE: "ALL n::nat. EXP (NUMERAL_BIT1 (0::nat)) n = NUMERAL_BIT1 (0::nat)"
   7.154 +lemma EXP_ONE: "ALL n::nat. EXP (NUMERAL_BIT1 0) n = NUMERAL_BIT1 0"
   7.155    by (import hollight EXP_ONE)
   7.156  
   7.157 -lemma EXP_1: "ALL x::nat. EXP x (NUMERAL_BIT1 (0::nat)) = x"
   7.158 +lemma EXP_1: "ALL x::nat. EXP x (NUMERAL_BIT1 0) = x"
   7.159    by (import hollight EXP_1)
   7.160  
   7.161 -lemma EXP_2: "ALL x::nat. EXP x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = x * x"
   7.162 +lemma EXP_2: "ALL x::nat. EXP x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = x * x"
   7.163    by (import hollight EXP_2)
   7.164  
   7.165  lemma MULT_EXP: "ALL (p::nat) (m::nat) n::nat. EXP (m * n) p = EXP m p * EXP n p"
   7.166 @@ -334,12 +331,12 @@
   7.167  defs
   7.168    "<=_def": "<= ==
   7.169  SOME u::nat => nat => bool.
   7.170 -   (ALL m::nat. u m (0::nat) = (m = (0::nat))) &
   7.171 +   (ALL m::nat. u m 0 = (m = 0)) &
   7.172     (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n))"
   7.173  
   7.174  lemma DEF__lessthan__equal_: "<= =
   7.175  (SOME u::nat => nat => bool.
   7.176 -    (ALL m::nat. u m (0::nat) = (m = (0::nat))) &
   7.177 +    (ALL m::nat. u m 0 = (m = 0)) &
   7.178      (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n)))"
   7.179    by (import hollight DEF__lessthan__equal_)
   7.180  
   7.181 @@ -349,12 +346,12 @@
   7.182  defs
   7.183    "<_def": "< ==
   7.184  SOME u::nat => nat => bool.
   7.185 -   (ALL m::nat. u m (0::nat) = False) &
   7.186 +   (ALL m::nat. u m 0 = False) &
   7.187     (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n))"
   7.188  
   7.189  lemma DEF__lessthan_: "< =
   7.190  (SOME u::nat => nat => bool.
   7.191 -    (ALL m::nat. u m (0::nat) = False) &
   7.192 +    (ALL m::nat. u m 0 = False) &
   7.193      (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n)))"
   7.194    by (import hollight DEF__lessthan_)
   7.195  
   7.196 @@ -388,10 +385,10 @@
   7.197  lemma LT_SUC: "ALL (x::nat) xa::nat. < (Suc x) (Suc xa) = < x xa"
   7.198    by (import hollight LT_SUC)
   7.199  
   7.200 -lemma LE_0: "All (<= (0::nat))"
   7.201 +lemma LE_0: "All (<= 0)"
   7.202    by (import hollight LE_0)
   7.203  
   7.204 -lemma LT_0: "ALL x::nat. < (0::nat) (Suc x)"
   7.205 +lemma LT_0: "ALL x::nat. < 0 (Suc x)"
   7.206    by (import hollight LT_0)
   7.207  
   7.208  lemma LE_REFL: "ALL n::nat. <= n n"
   7.209 @@ -436,7 +433,7 @@
   7.210  lemma LTE_CASES: "ALL (x::nat) xa::nat. < x xa | <= xa x"
   7.211    by (import hollight LTE_CASES)
   7.212  
   7.213 -lemma LT_NZ: "ALL n::nat. < (0::nat) n = (n ~= (0::nat))"
   7.214 +lemma LT_NZ: "ALL n::nat. < 0 n = (n ~= 0)"
   7.215    by (import hollight LT_NZ)
   7.216  
   7.217  lemma LE_LT: "ALL (m::nat) n::nat. <= m n = (< m n | m = n)"
   7.218 @@ -469,10 +466,10 @@
   7.219  lemma LE_ADDR: "ALL (x::nat) xa::nat. <= xa (x + xa)"
   7.220    by (import hollight LE_ADDR)
   7.221  
   7.222 -lemma LT_ADD: "ALL (m::nat) n::nat. < m (m + n) = < (0::nat) n"
   7.223 +lemma LT_ADD: "ALL (m::nat) n::nat. < m (m + n) = < 0 n"
   7.224    by (import hollight LT_ADD)
   7.225  
   7.226 -lemma LT_ADDR: "ALL (x::nat) xa::nat. < xa (x + xa) = < (0::nat) x"
   7.227 +lemma LT_ADDR: "ALL (x::nat) xa::nat. < xa (x + xa) = < 0 x"
   7.228    by (import hollight LT_ADDR)
   7.229  
   7.230  lemma LE_ADD_LCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x + xa) (x + xb) = <= xa xb"
   7.231 @@ -501,28 +498,26 @@
   7.232  lemma LT_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m p & < n q --> < (m + n) (p + q)"
   7.233    by (import hollight LT_ADD2)
   7.234  
   7.235 -lemma LT_MULT: "ALL (m::nat) n::nat. < (0::nat) (m * n) = (< (0::nat) m & < (0::nat) n)"
   7.236 +lemma LT_MULT: "ALL (m::nat) n::nat. < 0 (m * n) = (< 0 m & < 0 n)"
   7.237    by (import hollight LT_MULT)
   7.238  
   7.239  lemma LE_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat.
   7.240     <= m n & <= p q --> <= (m * p) (n * q)"
   7.241    by (import hollight LE_MULT2)
   7.242  
   7.243 -lemma LT_LMULT: "ALL (m::nat) (n::nat) p::nat. m ~= (0::nat) & < n p --> < (m * n) (m * p)"
   7.244 +lemma LT_LMULT: "ALL (m::nat) (n::nat) p::nat. m ~= 0 & < n p --> < (m * n) (m * p)"
   7.245    by (import hollight LT_LMULT)
   7.246  
   7.247 -lemma LE_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. <= (m * n) (m * p) = (m = (0::nat) | <= n p)"
   7.248 +lemma LE_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. <= (m * n) (m * p) = (m = 0 | <= n p)"
   7.249    by (import hollight LE_MULT_LCANCEL)
   7.250  
   7.251 -lemma LE_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat.
   7.252 -   <= (x * xb) (xa * xb) = (<= x xa | xb = (0::nat))"
   7.253 +lemma LE_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x * xb) (xa * xb) = (<= x xa | xb = 0)"
   7.254    by (import hollight LE_MULT_RCANCEL)
   7.255  
   7.256 -lemma LT_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. < (m * n) (m * p) = (m ~= (0::nat) & < n p)"
   7.257 +lemma LT_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. < (m * n) (m * p) = (m ~= 0 & < n p)"
   7.258    by (import hollight LT_MULT_LCANCEL)
   7.259  
   7.260 -lemma LT_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat.
   7.261 -   < (x * xb) (xa * xb) = (< x xa & xb ~= (0::nat))"
   7.262 +lemma LT_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. < (x * xb) (xa * xb) = (< x xa & xb ~= 0)"
   7.263    by (import hollight LT_MULT_RCANCEL)
   7.264  
   7.265  lemma LT_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m n & < p q --> < (m * p) (n * q)"
   7.266 @@ -558,22 +553,21 @@
   7.267    EVEN :: "nat => bool" 
   7.268    "EVEN ==
   7.269  SOME EVEN::nat => bool.
   7.270 -   EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   7.271 +   EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   7.272  
   7.273  lemma DEF_EVEN: "EVEN =
   7.274  (SOME EVEN::nat => bool.
   7.275 -    EVEN (0::nat) = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   7.276 +    EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   7.277    by (import hollight DEF_EVEN)
   7.278  
   7.279  constdefs
   7.280    ODD :: "nat => bool" 
   7.281    "ODD ==
   7.282 -SOME ODD::nat => bool.
   7.283 -   ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   7.284 +SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   7.285  
   7.286  lemma DEF_ODD: "ODD =
   7.287  (SOME ODD::nat => bool.
   7.288 -    ODD (0::nat) = False & (ALL n::nat. ODD (Suc n) = (~ ODD n)))"
   7.289 +    ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n)))"
   7.290    by (import hollight DEF_ODD)
   7.291  
   7.292  lemma NOT_EVEN: "ALL n::nat. (~ EVEN n) = ODD n"
   7.293 @@ -594,7 +588,7 @@
   7.294  lemma EVEN_MULT: "ALL (m::nat) n::nat. EVEN (m * n) = (EVEN m | EVEN n)"
   7.295    by (import hollight EVEN_MULT)
   7.296  
   7.297 -lemma EVEN_EXP: "ALL (m::nat) n::nat. EVEN (EXP m n) = (EVEN m & n ~= (0::nat))"
   7.298 +lemma EVEN_EXP: "ALL (m::nat) n::nat. EVEN (EXP m n) = (EVEN m & n ~= 0)"
   7.299    by (import hollight EVEN_EXP)
   7.300  
   7.301  lemma ODD_ADD: "ALL (m::nat) n::nat. ODD (m + n) = (ODD m ~= ODD n)"
   7.302 @@ -603,83 +597,76 @@
   7.303  lemma ODD_MULT: "ALL (m::nat) n::nat. ODD (m * n) = (ODD m & ODD n)"
   7.304    by (import hollight ODD_MULT)
   7.305  
   7.306 -lemma ODD_EXP: "ALL (m::nat) n::nat. ODD (EXP m n) = (ODD m | n = (0::nat))"
   7.307 +lemma ODD_EXP: "ALL (m::nat) n::nat. ODD (EXP m n) = (ODD m | n = 0)"
   7.308    by (import hollight ODD_EXP)
   7.309  
   7.310 -lemma EVEN_DOUBLE: "ALL n::nat. EVEN (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * n)"
   7.311 +lemma EVEN_DOUBLE: "ALL n::nat. EVEN (NUMERAL_BIT0 (NUMERAL_BIT1 0) * n)"
   7.312    by (import hollight EVEN_DOUBLE)
   7.313  
   7.314 -lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * x))"
   7.315 +lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * x))"
   7.316    by (import hollight ODD_DOUBLE)
   7.317  
   7.318  lemma EVEN_EXISTS_LEMMA: "ALL n::nat.
   7.319 -   (EVEN n --> (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)) &
   7.320 -   (~ EVEN n -->
   7.321 -    (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)))"
   7.322 +   (EVEN n --> (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)) &
   7.323 +   (~ EVEN n --> (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)))"
   7.324    by (import hollight EVEN_EXISTS_LEMMA)
   7.325  
   7.326 -lemma EVEN_EXISTS: "ALL n::nat.
   7.327 -   EVEN n = (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m)"
   7.328 +lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)"
   7.329    by (import hollight EVEN_EXISTS)
   7.330  
   7.331 -lemma ODD_EXISTS: "ALL n::nat.
   7.332 -   ODD n = (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * m))"
   7.333 +lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m))"
   7.334    by (import hollight ODD_EXISTS)
   7.335  
   7.336  lemma EVEN_ODD_DECOMPOSITION: "ALL n::nat.
   7.337     (EX (k::nat) m::nat.
   7.338 -       ODD m & n = EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) k * m) =
   7.339 -   (n ~= (0::nat))"
   7.340 +       ODD m & n = EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) k * m) =
   7.341 +   (n ~= 0)"
   7.342    by (import hollight EVEN_ODD_DECOMPOSITION)
   7.343  
   7.344 -lemma SUB_0: "ALL x::nat. (0::nat) - x = (0::nat) & x - (0::nat) = x"
   7.345 +lemma SUB_0: "ALL x::nat. 0 - x = 0 & x - 0 = x"
   7.346    by (import hollight SUB_0)
   7.347  
   7.348  lemma SUB_PRESUC: "ALL (m::nat) n::nat. Pred (Suc m - n) = m - n"
   7.349    by (import hollight SUB_PRESUC)
   7.350  
   7.351 -lemma SUB_EQ_0: "ALL (m::nat) n::nat. (m - n = (0::nat)) = <= m n"
   7.352 +lemma SUB_EQ_0: "ALL (m::nat) n::nat. (m - n = 0) = <= m n"
   7.353    by (import hollight SUB_EQ_0)
   7.354  
   7.355 -lemma ADD_SUBR: "ALL (x::nat) xa::nat. xa - (x + xa) = (0::nat)"
   7.356 +lemma ADD_SUBR: "ALL (x::nat) xa::nat. xa - (x + xa) = 0"
   7.357    by (import hollight ADD_SUBR)
   7.358  
   7.359  lemma SUB_ADD: "ALL (x::nat) xa::nat. <= xa x --> x - xa + xa = x"
   7.360    by (import hollight SUB_ADD)
   7.361  
   7.362 -lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 (0::nat) = x"
   7.363 +lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
   7.364    by (import hollight SUC_SUB1)
   7.365  
   7.366  constdefs
   7.367    FACT :: "nat => nat" 
   7.368    "FACT ==
   7.369  SOME FACT::nat => nat.
   7.370 -   FACT (0::nat) = NUMERAL_BIT1 (0::nat) &
   7.371 -   (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   7.372 +   FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   7.373  
   7.374  lemma DEF_FACT: "FACT =
   7.375  (SOME FACT::nat => nat.
   7.376 -    FACT (0::nat) = NUMERAL_BIT1 (0::nat) &
   7.377 -    (ALL n::nat. FACT (Suc n) = Suc n * FACT n))"
   7.378 +    FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n))"
   7.379    by (import hollight DEF_FACT)
   7.380  
   7.381 -lemma FACT_LT: "ALL n::nat. < (0::nat) (FACT n)"
   7.382 +lemma FACT_LT: "ALL n::nat. < 0 (FACT n)"
   7.383    by (import hollight FACT_LT)
   7.384  
   7.385 -lemma FACT_LE: "ALL x::nat. <= (NUMERAL_BIT1 (0::nat)) (FACT x)"
   7.386 +lemma FACT_LE: "ALL x::nat. <= (NUMERAL_BIT1 0) (FACT x)"
   7.387    by (import hollight FACT_LE)
   7.388  
   7.389  lemma FACT_MONO: "ALL (m::nat) n::nat. <= m n --> <= (FACT m) (FACT n)"
   7.390    by (import hollight FACT_MONO)
   7.391  
   7.392 -lemma DIVMOD_EXIST: "ALL (m::nat) n::nat.
   7.393 -   n ~= (0::nat) --> (EX (q::nat) r::nat. m = q * n + r & < r n)"
   7.394 +lemma DIVMOD_EXIST: "ALL (m::nat) n::nat. n ~= 0 --> (EX (q::nat) r::nat. m = q * n + r & < r n)"
   7.395    by (import hollight DIVMOD_EXIST)
   7.396  
   7.397  lemma DIVMOD_EXIST_0: "ALL (m::nat) n::nat.
   7.398     EX (x::nat) xa::nat.
   7.399 -      COND (n = (0::nat)) (x = (0::nat) & xa = (0::nat))
   7.400 -       (m = x * n + xa & < xa n)"
   7.401 +      COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
   7.402    by (import hollight DIVMOD_EXIST_0)
   7.403  
   7.404  constdefs
   7.405 @@ -688,14 +675,14 @@
   7.406  SOME q::nat => nat => nat.
   7.407     EX r::nat => nat => nat.
   7.408        ALL (m::nat) n::nat.
   7.409 -         COND (n = (0::nat)) (q m n = (0::nat) & r m n = (0::nat))
   7.410 +         COND (n = 0) (q m n = 0 & r m n = 0)
   7.411            (m = q m n * n + r m n & < (r m n) n)"
   7.412  
   7.413  lemma DEF_DIV: "DIV =
   7.414  (SOME q::nat => nat => nat.
   7.415      EX r::nat => nat => nat.
   7.416         ALL (m::nat) n::nat.
   7.417 -          COND (n = (0::nat)) (q m n = (0::nat) & r m n = (0::nat))
   7.418 +          COND (n = 0) (q m n = 0 & r m n = 0)
   7.419             (m = q m n * n + r m n & < (r m n) n))"
   7.420    by (import hollight DEF_DIV)
   7.421  
   7.422 @@ -704,18 +691,17 @@
   7.423    "MOD ==
   7.424  SOME r::nat => nat => nat.
   7.425     ALL (m::nat) n::nat.
   7.426 -      COND (n = (0::nat)) (DIV m n = (0::nat) & r m n = (0::nat))
   7.427 +      COND (n = 0) (DIV m n = 0 & r m n = 0)
   7.428         (m = DIV m n * n + r m n & < (r m n) n)"
   7.429  
   7.430  lemma DEF_MOD: "MOD =
   7.431  (SOME r::nat => nat => nat.
   7.432      ALL (m::nat) n::nat.
   7.433 -       COND (n = (0::nat)) (DIV m n = (0::nat) & r m n = (0::nat))
   7.434 +       COND (n = 0) (DIV m n = 0 & r m n = 0)
   7.435          (m = DIV m n * n + r m n & < (r m n) n))"
   7.436    by (import hollight DEF_MOD)
   7.437  
   7.438 -lemma DIVISION: "ALL (m::nat) n::nat.
   7.439 -   n ~= (0::nat) --> m = DIV m n * n + MOD m n & < (MOD m n) n"
   7.440 +lemma DIVISION: "ALL (m::nat) n::nat. n ~= 0 --> m = DIV m n * n + MOD m n & < (MOD m n) n"
   7.441    by (import hollight DIVISION)
   7.442  
   7.443  lemma DIVMOD_UNIQ_LEMMA: "ALL (m::nat) (n::nat) (q1::nat) (r1::nat) (q2::nat) r2::nat.
   7.444 @@ -733,14 +719,13 @@
   7.445  lemma DIV_UNIQ: "ALL (m::nat) (n::nat) (q::nat) r::nat. m = q * n + r & < r n --> DIV m n = q"
   7.446    by (import hollight DIV_UNIQ)
   7.447  
   7.448 -lemma MOD_MULT: "ALL (x::nat) xa::nat. x ~= (0::nat) --> MOD (x * xa) x = (0::nat)"
   7.449 +lemma MOD_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> MOD (x * xa) x = 0"
   7.450    by (import hollight MOD_MULT)
   7.451  
   7.452 -lemma DIV_MULT: "ALL (x::nat) xa::nat. x ~= (0::nat) --> DIV (x * xa) x = xa"
   7.453 +lemma DIV_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> DIV (x * xa) x = xa"
   7.454    by (import hollight DIV_MULT)
   7.455  
   7.456 -lemma DIV_DIV: "ALL (m::nat) (n::nat) p::nat.
   7.457 -   n * p ~= (0::nat) --> DIV (DIV m n) p = DIV m (n * p)"
   7.458 +lemma DIV_DIV: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> DIV (DIV m n) p = DIV m (n * p)"
   7.459    by (import hollight DIV_DIV)
   7.460  
   7.461  lemma MOD_LT: "ALL (m::nat) n::nat. < m n --> MOD m n = m"
   7.462 @@ -750,166 +735,150 @@
   7.463    by (import hollight MOD_EQ)
   7.464  
   7.465  lemma DIV_MOD: "ALL (m::nat) (n::nat) p::nat.
   7.466 -   n * p ~= (0::nat) --> MOD (DIV m n) p = DIV (MOD m (n * p)) n"
   7.467 +   n * p ~= 0 --> MOD (DIV m n) p = DIV (MOD m (n * p)) n"
   7.468    by (import hollight DIV_MOD)
   7.469  
   7.470 -lemma DIV_1: "ALL n::nat. DIV n (NUMERAL_BIT1 (0::nat)) = n"
   7.471 +lemma DIV_1: "ALL n::nat. DIV n (NUMERAL_BIT1 0) = n"
   7.472    by (import hollight DIV_1)
   7.473  
   7.474 -lemma EXP_LT_0: "ALL (x::nat) xa::nat.
   7.475 -   < (0::nat) (EXP xa x) = (xa ~= (0::nat) | x = (0::nat))"
   7.476 +lemma EXP_LT_0: "ALL (x::nat) xa::nat. < 0 (EXP xa x) = (xa ~= 0 | x = 0)"
   7.477    by (import hollight EXP_LT_0)
   7.478  
   7.479 -lemma DIV_LE: "ALL (m::nat) n::nat. n ~= (0::nat) --> <= (DIV m n) m"
   7.480 +lemma DIV_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (DIV m n) m"
   7.481    by (import hollight DIV_LE)
   7.482  
   7.483  lemma DIV_MUL_LE: "ALL (m::nat) n::nat. <= (n * DIV m n) m"
   7.484    by (import hollight DIV_MUL_LE)
   7.485  
   7.486 -lemma DIV_0: "ALL n::nat. n ~= (0::nat) --> DIV (0::nat) n = (0::nat)"
   7.487 +lemma DIV_0: "ALL n::nat. n ~= 0 --> DIV 0 n = 0"
   7.488    by (import hollight DIV_0)
   7.489  
   7.490 -lemma MOD_0: "ALL n::nat. n ~= (0::nat) --> MOD (0::nat) n = (0::nat)"
   7.491 +lemma MOD_0: "ALL n::nat. n ~= 0 --> MOD 0 n = 0"
   7.492    by (import hollight MOD_0)
   7.493  
   7.494 -lemma DIV_LT: "ALL (m::nat) n::nat. < m n --> DIV m n = (0::nat)"
   7.495 +lemma DIV_LT: "ALL (m::nat) n::nat. < m n --> DIV m n = 0"
   7.496    by (import hollight DIV_LT)
   7.497  
   7.498 -lemma MOD_MOD: "ALL (m::nat) (n::nat) p::nat.
   7.499 -   n * p ~= (0::nat) --> MOD (MOD m (n * p)) n = MOD m n"
   7.500 +lemma MOD_MOD: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> MOD (MOD m (n * p)) n = MOD m n"
   7.501    by (import hollight MOD_MOD)
   7.502  
   7.503 -lemma MOD_MOD_REFL: "ALL (m::nat) n::nat. n ~= (0::nat) --> MOD (MOD m n) n = MOD m n"
   7.504 +lemma MOD_MOD_REFL: "ALL (m::nat) n::nat. n ~= 0 --> MOD (MOD m n) n = MOD m n"
   7.505    by (import hollight MOD_MOD_REFL)
   7.506  
   7.507  lemma DIV_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
   7.508 -   x * xb ~= (0::nat) --> DIV (x * xa) (x * xb) = DIV xa xb"
   7.509 +   x * xb ~= 0 --> DIV (x * xa) (x * xb) = DIV xa xb"
   7.510    by (import hollight DIV_MULT2)
   7.511  
   7.512  lemma MOD_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
   7.513 -   x * xb ~= (0::nat) --> MOD (x * xa) (x * xb) = x * MOD xa xb"
   7.514 +   x * xb ~= 0 --> MOD (x * xa) (x * xb) = x * MOD xa xb"
   7.515    by (import hollight MOD_MULT2)
   7.516  
   7.517 -lemma MOD_1: "ALL n::nat. MOD n (NUMERAL_BIT1 (0::nat)) = (0::nat)"
   7.518 +lemma MOD_1: "ALL n::nat. MOD n (NUMERAL_BIT1 0) = 0"
   7.519    by (import hollight MOD_1)
   7.520  
   7.521  lemma MOD_EXISTS: "ALL (m::nat) n::nat.
   7.522 -   (EX q::nat. m = n * q) =
   7.523 -   COND (n = (0::nat)) (m = (0::nat)) (MOD m n = (0::nat))"
   7.524 +   (EX q::nat. m = n * q) = COND (n = 0) (m = 0) (MOD m n = 0)"
   7.525    by (import hollight MOD_EXISTS)
   7.526  
   7.527  lemma LT_EXP: "ALL (x::nat) (m::nat) n::nat.
   7.528     < (EXP x m) (EXP x n) =
   7.529 -   (<= (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) x & < m n |
   7.530 -    x = (0::nat) & m ~= (0::nat) & n = (0::nat))"
   7.531 +   (<= (NUMERAL_BIT0 (NUMERAL_BIT1 0)) x & < m n | x = 0 & m ~= 0 & n = 0)"
   7.532    by (import hollight LT_EXP)
   7.533  
   7.534  lemma LE_EXP: "ALL (x::nat) (m::nat) n::nat.
   7.535     <= (EXP x m) (EXP x n) =
   7.536 -   COND (x = (0::nat)) (m = (0::nat) --> n = (0::nat))
   7.537 -    (x = NUMERAL_BIT1 (0::nat) | <= m n)"
   7.538 +   COND (x = 0) (m = 0 --> n = 0) (x = NUMERAL_BIT1 0 | <= m n)"
   7.539    by (import hollight LE_EXP)
   7.540  
   7.541 -lemma DIV_MONO: "ALL (m::nat) (n::nat) p::nat.
   7.542 -   p ~= (0::nat) & <= m n --> <= (DIV m p) (DIV n p)"
   7.543 +lemma DIV_MONO: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= m n --> <= (DIV m p) (DIV n p)"
   7.544    by (import hollight DIV_MONO)
   7.545  
   7.546  lemma DIV_MONO_LT: "ALL (m::nat) (n::nat) p::nat.
   7.547 -   p ~= (0::nat) & <= (m + p) n --> < (DIV m p) (DIV n p)"
   7.548 +   p ~= 0 & <= (m + p) n --> < (DIV m p) (DIV n p)"
   7.549    by (import hollight DIV_MONO_LT)
   7.550  
   7.551 -lemma LE_LDIV: "ALL (a::nat) (b::nat) n::nat.
   7.552 -   a ~= (0::nat) & <= b (a * n) --> <= (DIV b a) n"
   7.553 +lemma LE_LDIV: "ALL (a::nat) (b::nat) n::nat. a ~= 0 & <= b (a * n) --> <= (DIV b a) n"
   7.554    by (import hollight LE_LDIV)
   7.555  
   7.556 -lemma LE_RDIV_EQ: "ALL (a::nat) (b::nat) n::nat.
   7.557 -   a ~= (0::nat) --> <= n (DIV b a) = <= (a * n) b"
   7.558 +lemma LE_RDIV_EQ: "ALL (a::nat) (b::nat) n::nat. a ~= 0 --> <= n (DIV b a) = <= (a * n) b"
   7.559    by (import hollight LE_RDIV_EQ)
   7.560  
   7.561  lemma LE_LDIV_EQ: "ALL (a::nat) (b::nat) n::nat.
   7.562 -   a ~= (0::nat) --> <= (DIV b a) n = < b (a * (n + NUMERAL_BIT1 (0::nat)))"
   7.563 +   a ~= 0 --> <= (DIV b a) n = < b (a * (n + NUMERAL_BIT1 0))"
   7.564    by (import hollight LE_LDIV_EQ)
   7.565  
   7.566 -lemma DIV_EQ_0: "ALL (m::nat) n::nat. n ~= (0::nat) --> (DIV m n = (0::nat)) = < m n"
   7.567 +lemma DIV_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (DIV m n = 0) = < m n"
   7.568    by (import hollight DIV_EQ_0)
   7.569  
   7.570 -lemma MOD_EQ_0: "ALL (m::nat) n::nat.
   7.571 -   n ~= (0::nat) --> (MOD m n = (0::nat)) = (EX q::nat. m = q * n)"
   7.572 +lemma MOD_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (MOD m n = 0) = (EX q::nat. m = q * n)"
   7.573    by (import hollight MOD_EQ_0)
   7.574  
   7.575 -lemma EVEN_MOD: "ALL n::nat.
   7.576 -   EVEN n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = (0::nat))"
   7.577 +lemma EVEN_MOD: "ALL n::nat. EVEN n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = 0)"
   7.578    by (import hollight EVEN_MOD)
   7.579  
   7.580 -lemma ODD_MOD: "ALL n::nat.
   7.581 -   ODD n =
   7.582 -   (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) = NUMERAL_BIT1 (0::nat))"
   7.583 +lemma ODD_MOD: "ALL n::nat. ODD n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = NUMERAL_BIT1 0)"
   7.584    by (import hollight ODD_MOD)
   7.585  
   7.586 -lemma MOD_MULT_RMOD: "ALL (m::nat) (n::nat) p::nat.
   7.587 -   n ~= (0::nat) --> MOD (m * MOD p n) n = MOD (m * p) n"
   7.588 +lemma MOD_MULT_RMOD: "ALL (m::nat) (n::nat) p::nat. n ~= 0 --> MOD (m * MOD p n) n = MOD (m * p) n"
   7.589    by (import hollight MOD_MULT_RMOD)
   7.590  
   7.591  lemma MOD_MULT_LMOD: "ALL (x::nat) (xa::nat) xb::nat.
   7.592 -   xa ~= (0::nat) --> MOD (MOD x xa * xb) xa = MOD (x * xb) xa"
   7.593 +   xa ~= 0 --> MOD (MOD x xa * xb) xa = MOD (x * xb) xa"
   7.594    by (import hollight MOD_MULT_LMOD)
   7.595  
   7.596  lemma MOD_MULT_MOD2: "ALL (x::nat) (xa::nat) xb::nat.
   7.597 -   xa ~= (0::nat) --> MOD (MOD x xa * MOD xb xa) xa = MOD (x * xb) xa"
   7.598 +   xa ~= 0 --> MOD (MOD x xa * MOD xb xa) xa = MOD (x * xb) xa"
   7.599    by (import hollight MOD_MULT_MOD2)
   7.600  
   7.601  lemma MOD_EXP_MOD: "ALL (m::nat) (n::nat) p::nat.
   7.602 -   n ~= (0::nat) --> MOD (EXP (MOD m n) p) n = MOD (EXP m p) n"
   7.603 +   n ~= 0 --> MOD (EXP (MOD m n) p) n = MOD (EXP m p) n"
   7.604    by (import hollight MOD_EXP_MOD)
   7.605  
   7.606  lemma MOD_MULT_ADD: "ALL (m::nat) (n::nat) p::nat. MOD (m * n + p) n = MOD p n"
   7.607    by (import hollight MOD_MULT_ADD)
   7.608  
   7.609  lemma MOD_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
   7.610 -   n ~= (0::nat) --> MOD (MOD a n + MOD b n) n = MOD (a + b) n"
   7.611 +   n ~= 0 --> MOD (MOD a n + MOD b n) n = MOD (a + b) n"
   7.612    by (import hollight MOD_ADD_MOD)
   7.613  
   7.614  lemma DIV_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
   7.615 -   n ~= (0::nat) -->
   7.616 +   n ~= 0 -->
   7.617     (MOD (a + b) n = MOD a n + MOD b n) = (DIV (a + b) n = DIV a n + DIV b n)"
   7.618    by (import hollight DIV_ADD_MOD)
   7.619  
   7.620 -lemma DIV_REFL: "ALL n::nat. n ~= (0::nat) --> DIV n n = NUMERAL_BIT1 (0::nat)"
   7.621 +lemma DIV_REFL: "ALL n::nat. n ~= 0 --> DIV n n = NUMERAL_BIT1 0"
   7.622    by (import hollight DIV_REFL)
   7.623  
   7.624 -lemma MOD_LE: "ALL (m::nat) n::nat. n ~= (0::nat) --> <= (MOD m n) m"
   7.625 +lemma MOD_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (MOD m n) m"
   7.626    by (import hollight MOD_LE)
   7.627  
   7.628 -lemma DIV_MONO2: "ALL (m::nat) (n::nat) p::nat.
   7.629 -   p ~= (0::nat) & <= p m --> <= (DIV n m) (DIV n p)"
   7.630 +lemma DIV_MONO2: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= p m --> <= (DIV n m) (DIV n p)"
   7.631    by (import hollight DIV_MONO2)
   7.632  
   7.633  lemma DIV_LE_EXCLUSION: "ALL (a::nat) (b::nat) (c::nat) d::nat.
   7.634 -   b ~= (0::nat) & < (b * c) ((a + NUMERAL_BIT1 (0::nat)) * d) -->
   7.635 -   <= (DIV c d) (DIV a b)"
   7.636 +   b ~= 0 & < (b * c) ((a + NUMERAL_BIT1 0) * d) --> <= (DIV c d) (DIV a b)"
   7.637    by (import hollight DIV_LE_EXCLUSION)
   7.638  
   7.639 -lemma DIV_EQ_EXCLUSION: "< ((b::nat) * (c::nat)) (((a::nat) + NUMERAL_BIT1 (0::nat)) * (d::nat)) &
   7.640 -< (a * d) ((c + NUMERAL_BIT1 (0::nat)) * b) -->
   7.641 +lemma DIV_EQ_EXCLUSION: "< ((b::nat) * (c::nat)) (((a::nat) + NUMERAL_BIT1 0) * (d::nat)) &
   7.642 +< (a * d) ((c + NUMERAL_BIT1 0) * b) -->
   7.643  DIV a b = DIV c d"
   7.644    by (import hollight DIV_EQ_EXCLUSION)
   7.645  
   7.646  lemma SUB_ELIM_THM: "(P::nat => bool) ((a::nat) - (b::nat)) =
   7.647 -(ALL x::nat. (b = a + x --> P (0::nat)) & (a = b + x --> P x))"
   7.648 +(ALL x::nat. (b = a + x --> P 0) & (a = b + x --> P x))"
   7.649    by (import hollight SUB_ELIM_THM)
   7.650  
   7.651  lemma PRE_ELIM_THM: "(P::nat => bool) (Pred (n::nat)) =
   7.652 -(ALL m::nat. (n = (0::nat) --> P (0::nat)) & (n = Suc m --> P m))"
   7.653 +(ALL m::nat. (n = 0 --> P 0) & (n = Suc m --> P m))"
   7.654    by (import hollight PRE_ELIM_THM)
   7.655  
   7.656  lemma DIVMOD_ELIM_THM: "(P::nat => nat => bool) (DIV (m::nat) (n::nat)) (MOD m n) =
   7.657 -(n = (0::nat) & P (0::nat) (0::nat) |
   7.658 - n ~= (0::nat) & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   7.659 +(n = 0 & P 0 0 |
   7.660 + n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   7.661    by (import hollight DIVMOD_ELIM_THM)
   7.662  
   7.663  constdefs
   7.664 -  eqeq :: "'q_9910::type
   7.665 -=> 'q_9909::type => ('q_9910::type => 'q_9909::type => bool) => bool" 
   7.666 +  eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" 
   7.667    "eqeq ==
   7.668  %(u::'q_9910::type) (ua::'q_9909::type)
   7.669     ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
   7.670 @@ -942,7 +911,7 @@
   7.671    by (import hollight MINIMAL)
   7.672  
   7.673  constdefs
   7.674 -  WF :: "('A::type => 'A::type => bool) => bool" 
   7.675 +  WF :: "('A => 'A => bool) => bool" 
   7.676    "WF ==
   7.677  %u::'A::type => 'A::type => bool.
   7.678     ALL P::'A::type => bool.
   7.679 @@ -1081,7 +1050,7 @@
   7.680    by (import hollight WF_REC_num)
   7.681  
   7.682  consts
   7.683 -  measure :: "('q_11107::type => nat) => 'q_11107::type => 'q_11107::type => bool" 
   7.684 +  measure :: "('q_11107 => nat) => 'q_11107 => 'q_11107 => bool" 
   7.685  
   7.686  defs
   7.687    measure_def: "hollight.measure ==
   7.688 @@ -1128,73 +1097,216 @@
   7.689         ALL x::'A::type. f x = COND (P f x) (f (G f x)) (H f x))"
   7.690    by (import hollight WF_REC_TAIL_GENERAL)
   7.691  
   7.692 -lemma ARITH_ZERO: "(0::nat) = (0::nat) & NUMERAL_BIT0 (0::nat) = (0::nat)"
   7.693 +lemma ARITH_ZERO: "(op &::bool => bool => bool) ((op =::nat => nat => bool) (0::nat) (0::nat))
   7.694 + ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) (0::nat)) (0::nat))"
   7.695    by (import hollight ARITH_ZERO)
   7.696  
   7.697  lemma ARITH_SUC: "(ALL x::nat. Suc x = Suc x) &
   7.698 -Suc (0::nat) = NUMERAL_BIT1 (0::nat) &
   7.699 +Suc 0 = NUMERAL_BIT1 0 &
   7.700  (ALL x::nat. Suc (NUMERAL_BIT0 x) = NUMERAL_BIT1 x) &
   7.701  (ALL x::nat. Suc (NUMERAL_BIT1 x) = NUMERAL_BIT0 (Suc x))"
   7.702    by (import hollight ARITH_SUC)
   7.703  
   7.704  lemma ARITH_PRE: "(ALL x::nat. Pred x = Pred x) &
   7.705 -Pred (0::nat) = (0::nat) &
   7.706 +Pred 0 = 0 &
   7.707  (ALL x::nat.
   7.708 -    Pred (NUMERAL_BIT0 x) =
   7.709 -    COND (x = (0::nat)) (0::nat) (NUMERAL_BIT1 (Pred x))) &
   7.710 +    Pred (NUMERAL_BIT0 x) = COND (x = 0) 0 (NUMERAL_BIT1 (Pred x))) &
   7.711  (ALL x::nat. Pred (NUMERAL_BIT1 x) = NUMERAL_BIT0 x)"
   7.712    by (import hollight ARITH_PRE)
   7.713  
   7.714 -lemma ARITH_ADD: "(ALL (x::nat) xa::nat. x + xa = x + xa) &
   7.715 -(0::nat) + (0::nat) = (0::nat) &
   7.716 -(ALL x::nat. (0::nat) + NUMERAL_BIT0 x = NUMERAL_BIT0 x) &
   7.717 -(ALL x::nat. (0::nat) + NUMERAL_BIT1 x = NUMERAL_BIT1 x) &
   7.718 -(ALL x::nat. NUMERAL_BIT0 x + (0::nat) = NUMERAL_BIT0 x) &
   7.719 -(ALL x::nat. NUMERAL_BIT1 x + (0::nat) = NUMERAL_BIT1 x) &
   7.720 -(ALL (x::nat) xa::nat.
   7.721 -    NUMERAL_BIT0 x + NUMERAL_BIT0 xa = NUMERAL_BIT0 (x + xa)) &
   7.722 -(ALL (x::nat) xa::nat.
   7.723 -    NUMERAL_BIT0 x + NUMERAL_BIT1 xa = NUMERAL_BIT1 (x + xa)) &
   7.724 -(ALL (x::nat) xa::nat.
   7.725 -    NUMERAL_BIT1 x + NUMERAL_BIT0 xa = NUMERAL_BIT1 (x + xa)) &
   7.726 -(ALL (x::nat) xa::nat.
   7.727 -    NUMERAL_BIT1 x + NUMERAL_BIT1 xa = NUMERAL_BIT0 (Suc (x + xa)))"
   7.728 +lemma ARITH_ADD: "(op &::bool => bool => bool)
   7.729 + ((All::(nat => bool) => bool)
   7.730 +   (%x::nat.
   7.731 +       (All::(nat => bool) => bool)
   7.732 +        (%xa::nat.
   7.733 +            (op =::nat => nat => bool) ((op +::nat => nat => nat) x xa)
   7.734 +             ((op +::nat => nat => nat) x xa))))
   7.735 + ((op &::bool => bool => bool)
   7.736 +   ((op =::nat => nat => bool) ((op +::nat => nat => nat) (0::nat) (0::nat))
   7.737 +     (0::nat))
   7.738 +   ((op &::bool => bool => bool)
   7.739 +     ((All::(nat => bool) => bool)
   7.740 +       (%x::nat.
   7.741 +           (op =::nat => nat => bool)
   7.742 +            ((op +::nat => nat => nat) (0::nat)
   7.743 +              ((NUMERAL_BIT0::nat => nat) x))
   7.744 +            ((NUMERAL_BIT0::nat => nat) x)))
   7.745 +     ((op &::bool => bool => bool)
   7.746 +       ((All::(nat => bool) => bool)
   7.747 +         (%x::nat.
   7.748 +             (op =::nat => nat => bool)
   7.749 +              ((op +::nat => nat => nat) (0::nat)
   7.750 +                ((NUMERAL_BIT1::nat => nat) x))
   7.751 +              ((NUMERAL_BIT1::nat => nat) x)))
   7.752 +       ((op &::bool => bool => bool)
   7.753 +         ((All::(nat => bool) => bool)
   7.754 +           (%x::nat.
   7.755 +               (op =::nat => nat => bool)
   7.756 +                ((op +::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
   7.757 +                  (0::nat))
   7.758 +                ((NUMERAL_BIT0::nat => nat) x)))
   7.759 +         ((op &::bool => bool => bool)
   7.760 +           ((All::(nat => bool) => bool)
   7.761 +             (%x::nat.
   7.762 +                 (op =::nat => nat => bool)
   7.763 +                  ((op +::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
   7.764 +                    (0::nat))
   7.765 +                  ((NUMERAL_BIT1::nat => nat) x)))
   7.766 +           ((op &::bool => bool => bool)
   7.767 +             ((All::(nat => bool) => bool)
   7.768 +               (%x::nat.
   7.769 +                   (All::(nat => bool) => bool)
   7.770 +                    (%xa::nat.
   7.771 +                        (op =::nat => nat => bool)
   7.772 +                         ((op +::nat => nat => nat)
   7.773 +                           ((NUMERAL_BIT0::nat => nat) x)
   7.774 +                           ((NUMERAL_BIT0::nat => nat) xa))
   7.775 +                         ((NUMERAL_BIT0::nat => nat)
   7.776 +                           ((op +::nat => nat => nat) x xa)))))
   7.777 +             ((op &::bool => bool => bool)
   7.778 +               ((All::(nat => bool) => bool)
   7.779 +                 (%x::nat.
   7.780 +                     (All::(nat => bool) => bool)
   7.781 +                      (%xa::nat.
   7.782 +                          (op =::nat => nat => bool)
   7.783 +                           ((op +::nat => nat => nat)
   7.784 +                             ((NUMERAL_BIT0::nat => nat) x)
   7.785 +                             ((NUMERAL_BIT1::nat => nat) xa))
   7.786 +                           ((NUMERAL_BIT1::nat => nat)
   7.787 +                             ((op +::nat => nat => nat) x xa)))))
   7.788 +               ((op &::bool => bool => bool)
   7.789 +                 ((All::(nat => bool) => bool)
   7.790 +                   (%x::nat.
   7.791 +                       (All::(nat => bool) => bool)
   7.792 +                        (%xa::nat.
   7.793 +                            (op =::nat => nat => bool)
   7.794 +                             ((op +::nat => nat => nat)
   7.795 +                               ((NUMERAL_BIT1::nat => nat) x)
   7.796 +                               ((NUMERAL_BIT0::nat => nat) xa))
   7.797 +                             ((NUMERAL_BIT1::nat => nat)
   7.798 +                               ((op +::nat => nat => nat) x xa)))))
   7.799 +                 ((All::(nat => bool) => bool)
   7.800 +                   (%x::nat.
   7.801 +                       (All::(nat => bool) => bool)
   7.802 +                        (%xa::nat.
   7.803 +                            (op =::nat => nat => bool)
   7.804 +                             ((op +::nat => nat => nat)
   7.805 +                               ((NUMERAL_BIT1::nat => nat) x)
   7.806 +                               ((NUMERAL_BIT1::nat => nat) xa))
   7.807 +                             ((NUMERAL_BIT0::nat => nat)
   7.808 +                               ((Suc::nat => nat)
   7.809 +                                 ((op +::nat => nat => nat) x
   7.810 +                                   xa))))))))))))))"
   7.811    by (import hollight ARITH_ADD)
   7.812  
   7.813 -lemma ARITH_MULT: "(ALL (x::nat) xa::nat. x * xa = x * xa) &
   7.814 -(0::nat) * (0::nat) = (0::nat) &
   7.815 -(ALL x::nat. (0::nat) * NUMERAL_BIT0 x = (0::nat)) &
   7.816 -(ALL x::nat. (0::nat) * NUMERAL_BIT1 x = (0::nat)) &
   7.817 -(ALL x::nat. NUMERAL_BIT0 x * (0::nat) = (0::nat)) &
   7.818 -(ALL x::nat. NUMERAL_BIT1 x * (0::nat) = (0::nat)) &
   7.819 -(ALL (x::nat) xa::nat.
   7.820 -    NUMERAL_BIT0 x * NUMERAL_BIT0 xa =
   7.821 -    NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
   7.822 -(ALL (x::nat) xa::nat.
   7.823 -    NUMERAL_BIT0 x * NUMERAL_BIT1 xa =
   7.824 -    NUMERAL_BIT0 x + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
   7.825 -(ALL (x::nat) xa::nat.
   7.826 -    NUMERAL_BIT1 x * NUMERAL_BIT0 xa =
   7.827 -    NUMERAL_BIT0 xa + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))) &
   7.828 -(ALL (x::nat) xa::nat.
   7.829 -    NUMERAL_BIT1 x * NUMERAL_BIT1 xa =
   7.830 -    NUMERAL_BIT1 x +
   7.831 -    (NUMERAL_BIT0 xa + NUMERAL_BIT0 (NUMERAL_BIT0 (x * xa))))"
   7.832 +lemma ARITH_MULT: "(op &::bool => bool => bool)
   7.833 + ((All::(nat => bool) => bool)
   7.834 +   (%x::nat.
   7.835 +       (All::(nat => bool) => bool)
   7.836 +        (%xa::nat.
   7.837 +            (op =::nat => nat => bool) ((op *::nat => nat => nat) x xa)
   7.838 +             ((op *::nat => nat => nat) x xa))))
   7.839 + ((op &::bool => bool => bool)
   7.840 +   ((op =::nat => nat => bool) ((op *::nat => nat => nat) (0::nat) (0::nat))
   7.841 +     (0::nat))
   7.842 +   ((op &::bool => bool => bool)
   7.843 +     ((All::(nat => bool) => bool)
   7.844 +       (%x::nat.
   7.845 +           (op =::nat => nat => bool)
   7.846 +            ((op *::nat => nat => nat) (0::nat)
   7.847 +              ((NUMERAL_BIT0::nat => nat) x))
   7.848 +            (0::nat)))
   7.849 +     ((op &::bool => bool => bool)
   7.850 +       ((All::(nat => bool) => bool)
   7.851 +         (%x::nat.
   7.852 +             (op =::nat => nat => bool)
   7.853 +              ((op *::nat => nat => nat) (0::nat)
   7.854 +                ((NUMERAL_BIT1::nat => nat) x))
   7.855 +              (0::nat)))
   7.856 +       ((op &::bool => bool => bool)
   7.857 +         ((All::(nat => bool) => bool)
   7.858 +           (%x::nat.
   7.859 +               (op =::nat => nat => bool)
   7.860 +                ((op *::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
   7.861 +                  (0::nat))
   7.862 +                (0::nat)))
   7.863 +         ((op &::bool => bool => bool)
   7.864 +           ((All::(nat => bool) => bool)
   7.865 +             (%x::nat.
   7.866 +                 (op =::nat => nat => bool)
   7.867 +                  ((op *::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
   7.868 +                    (0::nat))
   7.869 +                  (0::nat)))
   7.870 +           ((op &::bool => bool => bool)
   7.871 +             ((All::(nat => bool) => bool)
   7.872 +               (%x::nat.
   7.873 +                   (All::(nat => bool) => bool)
   7.874 +                    (%xa::nat.
   7.875 +                        (op =::nat => nat => bool)
   7.876 +                         ((op *::nat => nat => nat)
   7.877 +                           ((NUMERAL_BIT0::nat => nat) x)
   7.878 +                           ((NUMERAL_BIT0::nat => nat) xa))
   7.879 +                         ((NUMERAL_BIT0::nat => nat)
   7.880 +                           ((NUMERAL_BIT0::nat => nat)
   7.881 +                             ((op *::nat => nat => nat) x xa))))))
   7.882 +             ((op &::bool => bool => bool)
   7.883 +               ((All::(nat => bool) => bool)
   7.884 +                 (%x::nat.
   7.885 +                     (All::(nat => bool) => bool)
   7.886 +                      (%xa::nat.
   7.887 +                          (op =::nat => nat => bool)
   7.888 +                           ((op *::nat => nat => nat)
   7.889 +                             ((NUMERAL_BIT0::nat => nat) x)
   7.890 +                             ((NUMERAL_BIT1::nat => nat) xa))
   7.891 +                           ((op +::nat => nat => nat)
   7.892 +                             ((NUMERAL_BIT0::nat => nat) x)
   7.893 +                             ((NUMERAL_BIT0::nat => nat)
   7.894 +                               ((NUMERAL_BIT0::nat => nat)
   7.895 +                                 ((op *::nat => nat => nat) x xa)))))))
   7.896 +               ((op &::bool => bool => bool)
   7.897 +                 ((All::(nat => bool) => bool)
   7.898 +                   (%x::nat.
   7.899 +                       (All::(nat => bool) => bool)
   7.900 +                        (%xa::nat.
   7.901 +                            (op =::nat => nat => bool)
   7.902 +                             ((op *::nat => nat => nat)
   7.903 +                               ((NUMERAL_BIT1::nat => nat) x)
   7.904 +                               ((NUMERAL_BIT0::nat => nat) xa))
   7.905 +                             ((op +::nat => nat => nat)
   7.906 +                               ((NUMERAL_BIT0::nat => nat) xa)
   7.907 +                               ((NUMERAL_BIT0::nat => nat)
   7.908 +                                 ((NUMERAL_BIT0::nat => nat)
   7.909 +                                   ((op *::nat => nat => nat) x xa)))))))
   7.910 +                 ((All::(nat => bool) => bool)
   7.911 +                   (%x::nat.
   7.912 +                       (All::(nat => bool) => bool)
   7.913 +                        (%xa::nat.
   7.914 +                            (op =::nat => nat => bool)
   7.915 +                             ((op *::nat => nat => nat)
   7.916 +                               ((NUMERAL_BIT1::nat => nat) x)
   7.917 +                               ((NUMERAL_BIT1::nat => nat) xa))
   7.918 +                             ((op +::nat => nat => nat)
   7.919 +                               ((NUMERAL_BIT1::nat => nat) x)
   7.920 +                               ((op +::nat => nat => nat)
   7.921 +                                 ((NUMERAL_BIT0::nat => nat) xa)
   7.922 +                                 ((NUMERAL_BIT0::nat => nat)
   7.923 +                                   ((NUMERAL_BIT0::nat => nat)
   7.924 +                                     ((op *::nat => nat => nat) x
   7.925 + xa))))))))))))))))"
   7.926    by (import hollight ARITH_MULT)
   7.927  
   7.928  lemma ARITH_EXP: "(ALL (x::nat) xa::nat. EXP x xa = EXP x xa) &
   7.929 -EXP (0::nat) (0::nat) = NUMERAL_BIT1 (0::nat) &
   7.930 -(ALL m::nat. EXP (NUMERAL_BIT0 m) (0::nat) = NUMERAL_BIT1 (0::nat)) &
   7.931 -(ALL m::nat. EXP (NUMERAL_BIT1 m) (0::nat) = NUMERAL_BIT1 (0::nat)) &
   7.932 -(ALL n::nat.
   7.933 -    EXP (0::nat) (NUMERAL_BIT0 n) = EXP (0::nat) n * EXP (0::nat) n) &
   7.934 +EXP 0 0 = NUMERAL_BIT1 0 &
   7.935 +(ALL m::nat. EXP (NUMERAL_BIT0 m) 0 = NUMERAL_BIT1 0) &
   7.936 +(ALL m::nat. EXP (NUMERAL_BIT1 m) 0 = NUMERAL_BIT1 0) &
   7.937 +(ALL n::nat. EXP 0 (NUMERAL_BIT0 n) = EXP 0 n * EXP 0 n) &
   7.938  (ALL (m::nat) n::nat.
   7.939      EXP (NUMERAL_BIT0 m) (NUMERAL_BIT0 n) =
   7.940      EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n) &
   7.941  (ALL (m::nat) n::nat.
   7.942      EXP (NUMERAL_BIT1 m) (NUMERAL_BIT0 n) =
   7.943      EXP (NUMERAL_BIT1 m) n * EXP (NUMERAL_BIT1 m) n) &
   7.944 -(ALL n::nat. EXP (0::nat) (NUMERAL_BIT1 n) = (0::nat)) &
   7.945 +(ALL n::nat. EXP 0 (NUMERAL_BIT1 n) = 0) &
   7.946  (ALL (m::nat) n::nat.
   7.947      EXP (NUMERAL_BIT0 m) (NUMERAL_BIT1 n) =
   7.948      NUMERAL_BIT0 m * (EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n)) &
   7.949 @@ -1204,23 +1316,23 @@
   7.950    by (import hollight ARITH_EXP)
   7.951  
   7.952  lemma ARITH_EVEN: "(ALL x::nat. EVEN x = EVEN x) &
   7.953 -EVEN (0::nat) = True &
   7.954 +EVEN 0 = True &
   7.955  (ALL x::nat. EVEN (NUMERAL_BIT0 x) = True) &
   7.956  (ALL x::nat. EVEN (NUMERAL_BIT1 x) = False)"
   7.957    by (import hollight ARITH_EVEN)
   7.958  
   7.959  lemma ARITH_ODD: "(ALL x::nat. ODD x = ODD x) &
   7.960 -ODD (0::nat) = False &
   7.961 +ODD 0 = False &
   7.962  (ALL x::nat. ODD (NUMERAL_BIT0 x) = False) &
   7.963  (ALL x::nat. ODD (NUMERAL_BIT1 x) = True)"
   7.964    by (import hollight ARITH_ODD)
   7.965  
   7.966  lemma ARITH_LE: "(ALL (x::nat) xa::nat. <= x xa = <= x xa) &
   7.967 -<= (0::nat) (0::nat) = True &
   7.968 -(ALL x::nat. <= (NUMERAL_BIT0 x) (0::nat) = (x = (0::nat))) &
   7.969 -(ALL x::nat. <= (NUMERAL_BIT1 x) (0::nat) = False) &
   7.970 -(ALL x::nat. <= (0::nat) (NUMERAL_BIT0 x) = True) &
   7.971 -(ALL x::nat. <= (0::nat) (NUMERAL_BIT1 x) = True) &
   7.972 +<= 0 0 = True &
   7.973 +(ALL x::nat. <= (NUMERAL_BIT0 x) 0 = (x = 0)) &
   7.974 +(ALL x::nat. <= (NUMERAL_BIT1 x) 0 = False) &
   7.975 +(ALL x::nat. <= 0 (NUMERAL_BIT0 x) = True) &
   7.976 +(ALL x::nat. <= 0 (NUMERAL_BIT1 x) = True) &
   7.977  (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = <= x xa) &
   7.978  (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
   7.979  (ALL (x::nat) xa::nat. <= (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
   7.980 @@ -1228,44 +1340,181 @@
   7.981    by (import hollight ARITH_LE)
   7.982  
   7.983  lemma ARITH_LT: "(ALL (x::nat) xa::nat. < x xa = < x xa) &
   7.984 -< (0::nat) (0::nat) = False &
   7.985 -(ALL x::nat. < (NUMERAL_BIT0 x) (0::nat) = False) &
   7.986 -(ALL x::nat. < (NUMERAL_BIT1 x) (0::nat) = False) &
   7.987 -(ALL x::nat. < (0::nat) (NUMERAL_BIT0 x) = < (0::nat) x) &
   7.988 -(ALL x::nat. < (0::nat) (NUMERAL_BIT1 x) = True) &
   7.989 +< 0 0 = False &
   7.990 +(ALL x::nat. < (NUMERAL_BIT0 x) 0 = False) &
   7.991 +(ALL x::nat. < (NUMERAL_BIT1 x) 0 = False) &
   7.992 +(ALL x::nat. < 0 (NUMERAL_BIT0 x) = < 0 x) &
   7.993 +(ALL x::nat. < 0 (NUMERAL_BIT1 x) = True) &
   7.994  (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = < x xa) &
   7.995  (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
   7.996  (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
   7.997  (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT1 xa) = < x xa)"
   7.998    by (import hollight ARITH_LT)
   7.999  
  7.1000 -lemma ARITH_EQ: "(ALL (x::nat) xa::nat. (x = xa) = (x = xa)) &
  7.1001 -((0::nat) = (0::nat)) = True &
  7.1002 -(ALL x::nat. (NUMERAL_BIT0 x = (0::nat)) = (x = (0::nat))) &
  7.1003 -(ALL x::nat. (NUMERAL_BIT1 x = (0::nat)) = False) &
  7.1004 -(ALL x::nat. ((0::nat) = NUMERAL_BIT0 x) = ((0::nat) = x)) &
  7.1005 -(ALL x::nat. ((0::nat) = NUMERAL_BIT1 x) = False) &
  7.1006 -(ALL (x::nat) xa::nat. (NUMERAL_BIT0 x = NUMERAL_BIT0 xa) = (x = xa)) &
  7.1007 -(ALL (x::nat) xa::nat. (NUMERAL_BIT0 x = NUMERAL_BIT1 xa) = False) &
  7.1008 -(ALL (x::nat) xa::nat. (NUMERAL_BIT1 x = NUMERAL_BIT0 xa) = False) &
  7.1009 -(ALL (x::nat) xa::nat. (NUMERAL_BIT1 x = NUMERAL_BIT1 xa) = (x = xa))"
  7.1010 +lemma ARITH_EQ: "(op &::bool => bool => bool)
  7.1011 + ((All::(nat => bool) => bool)
  7.1012 +   (%x::nat.
  7.1013 +       (All::(nat => bool) => bool)
  7.1014 +        (%xa::nat.
  7.1015 +            (op =::bool => bool => bool) ((op =::nat => nat => bool) x xa)
  7.1016 +             ((op =::nat => nat => bool) x xa))))
  7.1017 + ((op &::bool => bool => bool)
  7.1018 +   ((op =::bool => bool => bool)
  7.1019 +     ((op =::nat => nat => bool) (0::nat) (0::nat)) (True::bool))
  7.1020 +   ((op &::bool => bool => bool)
  7.1021 +     ((All::(nat => bool) => bool)
  7.1022 +       (%x::nat.
  7.1023 +           (op =::bool => bool => bool)
  7.1024 +            ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) x)
  7.1025 +              (0::nat))
  7.1026 +            ((op =::nat => nat => bool) x (0::nat))))
  7.1027 +     ((op &::bool => bool => bool)
  7.1028 +       ((All::(nat => bool) => bool)
  7.1029 +         (%x::nat.
  7.1030 +             (op =::bool => bool => bool)
  7.1031 +              ((op =::nat => nat => bool) ((NUMERAL_BIT1::nat => nat) x)
  7.1032 +                (0::nat))
  7.1033 +              (False::bool)))
  7.1034 +       ((op &::bool => bool => bool)
  7.1035 +         ((All::(nat => bool) => bool)
  7.1036 +           (%x::nat.
  7.1037 +               (op =::bool => bool => bool)
  7.1038 +                ((op =::nat => nat => bool) (0::nat)
  7.1039 +                  ((NUMERAL_BIT0::nat => nat) x))
  7.1040 +                ((op =::nat => nat => bool) (0::nat) x)))
  7.1041 +         ((op &::bool => bool => bool)
  7.1042 +           ((All::(nat => bool) => bool)
  7.1043 +             (%x::nat.
  7.1044 +                 (op =::bool => bool => bool)
  7.1045 +                  ((op =::nat => nat => bool) (0::nat)
  7.1046 +                    ((NUMERAL_BIT1::nat => nat) x))
  7.1047 +                  (False::bool)))
  7.1048 +           ((op &::bool => bool => bool)
  7.1049 +             ((All::(nat => bool) => bool)
  7.1050 +               (%x::nat.
  7.1051 +                   (All::(nat => bool) => bool)
  7.1052 +                    (%xa::nat.
  7.1053 +                        (op =::bool => bool => bool)
  7.1054 +                         ((op =::nat => nat => bool)
  7.1055 +                           ((NUMERAL_BIT0::nat => nat) x)
  7.1056 +                           ((NUMERAL_BIT0::nat => nat) xa))
  7.1057 +                         ((op =::nat => nat => bool) x xa))))
  7.1058 +             ((op &::bool => bool => bool)
  7.1059 +               ((All::(nat => bool) => bool)
  7.1060 +                 (%x::nat.
  7.1061 +                     (All::(nat => bool) => bool)
  7.1062 +                      (%xa::nat.
  7.1063 +                          (op =::bool => bool => bool)
  7.1064 +                           ((op =::nat => nat => bool)
  7.1065 +                             ((NUMERAL_BIT0::nat => nat) x)
  7.1066 +                             ((NUMERAL_BIT1::nat => nat) xa))
  7.1067 +                           (False::bool))))
  7.1068 +               ((op &::bool => bool => bool)
  7.1069 +                 ((All::(nat => bool) => bool)
  7.1070 +                   (%x::nat.
  7.1071 +                       (All::(nat => bool) => bool)
  7.1072 +                        (%xa::nat.
  7.1073 +                            (op =::bool => bool => bool)
  7.1074 +                             ((op =::nat => nat => bool)
  7.1075 +                               ((NUMERAL_BIT1::nat => nat) x)
  7.1076 +                               ((NUMERAL_BIT0::nat => nat) xa))
  7.1077 +                             (False::bool))))
  7.1078 +                 ((All::(nat => bool) => bool)
  7.1079 +                   (%x::nat.
  7.1080 +                       (All::(nat => bool) => bool)
  7.1081 +                        (%xa::nat.
  7.1082 +                            (op =::bool => bool => bool)
  7.1083 +                             ((op =::nat => nat => bool)
  7.1084 +                               ((NUMERAL_BIT1::nat => nat) x)
  7.1085 +                               ((NUMERAL_BIT1::nat => nat) xa))
  7.1086 +                             ((op =::nat => nat => bool) x xa))))))))))))"
  7.1087    by (import hollight ARITH_EQ)
  7.1088  
  7.1089 -lemma ARITH_SUB: "(ALL (x::nat) xa::nat. x - xa = x - xa) &
  7.1090 -(0::nat) - (0::nat) = (0::nat) &
  7.1091 -(ALL x::nat. (0::nat) - NUMERAL_BIT0 x = (0::nat)) &
  7.1092 -(ALL x::nat. (0::nat) - NUMERAL_BIT1 x = (0::nat)) &
  7.1093 -(ALL x::nat. NUMERAL_BIT0 x - (0::nat) = NUMERAL_BIT0 x) &
  7.1094 -(ALL x::nat. NUMERAL_BIT1 x - (0::nat) = NUMERAL_BIT1 x) &
  7.1095 -(ALL (m::nat) n::nat.
  7.1096 -    NUMERAL_BIT0 m - NUMERAL_BIT0 n = NUMERAL_BIT0 (m - n)) &
  7.1097 -(ALL (m::nat) n::nat.
  7.1098 -    NUMERAL_BIT0 m - NUMERAL_BIT1 n = Pred (NUMERAL_BIT0 (m - n))) &
  7.1099 -(ALL (m::nat) n::nat.
  7.1100 -    NUMERAL_BIT1 m - NUMERAL_BIT0 n =
  7.1101 -    COND (<= n m) (NUMERAL_BIT1 (m - n)) (0::nat)) &
  7.1102 -(ALL (m::nat) n::nat.
  7.1103 -    NUMERAL_BIT1 m - NUMERAL_BIT1 n = NUMERAL_BIT0 (m - n))"
  7.1104 +lemma ARITH_SUB: "(op &::bool => bool => bool)
  7.1105 + ((All::(nat => bool) => bool)
  7.1106 +   (%x::nat.
  7.1107 +       (All::(nat => bool) => bool)
  7.1108 +        (%xa::nat.
  7.1109 +            (op =::nat => nat => bool) ((op -::nat => nat => nat) x xa)
  7.1110 +             ((op -::nat => nat => nat) x xa))))
  7.1111 + ((op &::bool => bool => bool)
  7.1112 +   ((op =::nat => nat => bool) ((op -::nat => nat => nat) (0::nat) (0::nat))
  7.1113 +     (0::nat))
  7.1114 +   ((op &::bool => bool => bool)
  7.1115 +     ((All::(nat => bool) => bool)
  7.1116 +       (%x::nat.
  7.1117 +           (op =::nat => nat => bool)
  7.1118 +            ((op -::nat => nat => nat) (0::nat)
  7.1119 +              ((NUMERAL_BIT0::nat => nat) x))
  7.1120 +            (0::nat)))
  7.1121 +     ((op &::bool => bool => bool)
  7.1122 +       ((All::(nat => bool) => bool)
  7.1123 +         (%x::nat.
  7.1124 +             (op =::nat => nat => bool)
  7.1125 +              ((op -::nat => nat => nat) (0::nat)
  7.1126 +                ((NUMERAL_BIT1::nat => nat) x))
  7.1127 +              (0::nat)))
  7.1128 +       ((op &::bool => bool => bool)
  7.1129 +         ((All::(nat => bool) => bool)
  7.1130 +           (%x::nat.
  7.1131 +               (op =::nat => nat => bool)
  7.1132 +                ((op -::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  7.1133 +                  (0::nat))
  7.1134 +                ((NUMERAL_BIT0::nat => nat) x)))
  7.1135 +         ((op &::bool => bool => bool)
  7.1136 +           ((All::(nat => bool) => bool)
  7.1137 +             (%x::nat.
  7.1138 +                 (op =::nat => nat => bool)
  7.1139 +                  ((op -::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  7.1140 +                    (0::nat))
  7.1141 +                  ((NUMERAL_BIT1::nat => nat) x)))
  7.1142 +           ((op &::bool => bool => bool)
  7.1143 +             ((All::(nat => bool) => bool)
  7.1144 +               (%m::nat.
  7.1145 +                   (All::(nat => bool) => bool)
  7.1146 +                    (%n::nat.
  7.1147 +                        (op =::nat => nat => bool)
  7.1148 +                         ((op -::nat => nat => nat)
  7.1149 +                           ((NUMERAL_BIT0::nat => nat) m)
  7.1150 +                           ((NUMERAL_BIT0::nat => nat) n))
  7.1151 +                         ((NUMERAL_BIT0::nat => nat)
  7.1152 +                           ((op -::nat => nat => nat) m n)))))
  7.1153 +             ((op &::bool => bool => bool)
  7.1154 +               ((All::(nat => bool) => bool)
  7.1155 +                 (%m::nat.
  7.1156 +                     (All::(nat => bool) => bool)
  7.1157 +                      (%n::nat.
  7.1158 +                          (op =::nat => nat => bool)
  7.1159 +                           ((op -::nat => nat => nat)
  7.1160 +                             ((NUMERAL_BIT0::nat => nat) m)
  7.1161 +                             ((NUMERAL_BIT1::nat => nat) n))
  7.1162 +                           ((Pred::nat => nat)
  7.1163 +                             ((NUMERAL_BIT0::nat => nat)
  7.1164 +                               ((op -::nat => nat => nat) m n))))))
  7.1165 +               ((op &::bool => bool => bool)
  7.1166 +                 ((All::(nat => bool) => bool)
  7.1167 +                   (%m::nat.
  7.1168 +                       (All::(nat => bool) => bool)
  7.1169 +                        (%n::nat.
  7.1170 +                            (op =::nat => nat => bool)
  7.1171 +                             ((op -::nat => nat => nat)
  7.1172 +                               ((NUMERAL_BIT1::nat => nat) m)
  7.1173 +                               ((NUMERAL_BIT0::nat => nat) n))
  7.1174 +                             ((COND::bool => nat => nat => nat)
  7.1175 +                               ((<=::nat => nat => bool) n m)
  7.1176 +                               ((NUMERAL_BIT1::nat => nat)
  7.1177 +                                 ((op -::nat => nat => nat) m n))
  7.1178 +                               (0::nat)))))
  7.1179 +                 ((All::(nat => bool) => bool)
  7.1180 +                   (%m::nat.
  7.1181 +                       (All::(nat => bool) => bool)
  7.1182 +                        (%n::nat.
  7.1183 +                            (op =::nat => nat => bool)
  7.1184 +                             ((op -::nat => nat => nat)
  7.1185 +                               ((NUMERAL_BIT1::nat => nat) m)
  7.1186 +                               ((NUMERAL_BIT1::nat => nat) n))
  7.1187 +                             ((NUMERAL_BIT0::nat => nat)
  7.1188 +                               ((op -::nat => nat => nat) m n)))))))))))))"
  7.1189    by (import hollight ARITH_SUB)
  7.1190  
  7.1191  lemma right_th: "(s::nat) * NUMERAL_BIT1 (x::nat) = s + NUMERAL_BIT0 (s * x)"
  7.1192 @@ -1282,7 +1531,7 @@
  7.1193  (ALL x::'A::type. mul r0 x = r0) &
  7.1194  (ALL (x::'A::type) (y::'A::type) z::'A::type.
  7.1195      mul x (add y z) = add (mul x y) (mul x z)) &
  7.1196 -(ALL x::'A::type. (pwr::'A::type => nat => 'A::type) x (0::nat) = r1) &
  7.1197 +(ALL x::'A::type. (pwr::'A::type => nat => 'A::type) x 0 = r1) &
  7.1198  (ALL (x::'A::type) n::nat. pwr x (Suc n) = mul x (pwr x n)) -->
  7.1199  mul r1 (x::'A::type) = x &
  7.1200  add (mul (a::'A::type) (m::'A::type)) (mul (b::'A::type) m) =
  7.1201 @@ -1318,24 +1567,24 @@
  7.1202  mul (pwr x (p::nat)) (pwr x (q::nat)) = pwr x (p + q) &
  7.1203  mul x (pwr x q) = pwr x (Suc q) &
  7.1204  mul (pwr x q) x = pwr x (Suc q) &
  7.1205 -mul x x = pwr x (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) &
  7.1206 +mul x x = pwr x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) &
  7.1207  pwr (mul x (y::'A::type)) q = mul (pwr x q) (pwr y q) &
  7.1208  pwr (pwr x p) q = pwr x (p * q) &
  7.1209 -pwr x (0::nat) = r1 &
  7.1210 -pwr x (NUMERAL_BIT1 (0::nat)) = x &
  7.1211 +pwr x 0 = r1 &
  7.1212 +pwr x (NUMERAL_BIT1 0) = x &
  7.1213  mul x (add y (z::'A::type)) = add (mul x y) (mul x z) &
  7.1214  pwr x (Suc q) = mul x (pwr x q)"
  7.1215    by (import hollight SEMIRING_PTHS)
  7.1216  
  7.1217  lemma sth: "(ALL (x::nat) (y::nat) z::nat. x + (y + z) = x + y + z) &
  7.1218  (ALL (x::nat) y::nat. x + y = y + x) &
  7.1219 -(ALL x::nat. (0::nat) + x = x) &
  7.1220 +(ALL x::nat. 0 + x = x) &
  7.1221  (ALL (x::nat) (y::nat) z::nat. x * (y * z) = x * y * z) &
  7.1222  (ALL (x::nat) y::nat. x * y = y * x) &
  7.1223 -(ALL x::nat. NUMERAL_BIT1 (0::nat) * x = x) &
  7.1224 -(ALL x::nat. (0::nat) * x = (0::nat)) &
  7.1225 +(ALL x::nat. NUMERAL_BIT1 0 * x = x) &
  7.1226 +(ALL x::nat. 0 * x = 0) &
  7.1227  (ALL (x::nat) (xa::nat) xb::nat. x * (xa + xb) = x * xa + x * xb) &
  7.1228 -(ALL x::nat. EXP x (0::nat) = NUMERAL_BIT1 (0::nat)) &
  7.1229 +(ALL x::nat. EXP x 0 = NUMERAL_BIT1 0) &
  7.1230  (ALL (x::nat) xa::nat. EXP x (Suc xa) = x * EXP x xa)"
  7.1231    by (import hollight sth)
  7.1232  
  7.1233 @@ -1343,7 +1592,7 @@
  7.1234  (w * y + x * z = w * z + x * y) = (w = x | y = z)"
  7.1235    by (import hollight NUM_INTEGRAL_LEMMA)
  7.1236  
  7.1237 -lemma NUM_INTEGRAL: "(ALL x::nat. (0::nat) * x = (0::nat)) &
  7.1238 +lemma NUM_INTEGRAL: "(ALL x::nat. 0 * x = 0) &
  7.1239  (ALL (x::nat) (xa::nat) xb::nat. (x + xa = x + xb) = (xa = xb)) &
  7.1240  (ALL (w::nat) (x::nat) (y::nat) z::nat.
  7.1241      (w * y + x * z = w * z + x * y) = (w = x | y = z))"
  7.1242 @@ -1360,13 +1609,13 @@
  7.1243    NUMPAIR :: "nat => nat => nat" 
  7.1244    "NUMPAIR ==
  7.1245  %(u::nat) ua::nat.
  7.1246 -   EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) u *
  7.1247 -   (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua + NUMERAL_BIT1 (0::nat))"
  7.1248 +   EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  7.1249 +   (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0)"
  7.1250  
  7.1251  lemma DEF_NUMPAIR: "NUMPAIR =
  7.1252  (%(u::nat) ua::nat.
  7.1253 -    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat))) u *
  7.1254 -    (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua + NUMERAL_BIT1 (0::nat)))"
  7.1255 +    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  7.1256 +    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0))"
  7.1257    by (import hollight DEF_NUMPAIR)
  7.1258  
  7.1259  lemma NUMPAIR_INJ_LEMMA: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
  7.1260 @@ -1405,13 +1654,13 @@
  7.1261    NUMSUM :: "bool => nat => nat" 
  7.1262    "NUMSUM ==
  7.1263  %(u::bool) ua::nat.
  7.1264 -   COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))
  7.1265 -    (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua)"
  7.1266 +   COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  7.1267 +    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua)"
  7.1268  
  7.1269  lemma DEF_NUMSUM: "NUMSUM =
  7.1270  (%(u::bool) ua::nat.
  7.1271 -    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))
  7.1272 -     (NUMERAL_BIT0 (NUMERAL_BIT1 (0::nat)) * ua))"
  7.1273 +    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  7.1274 +     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))"
  7.1275    by (import hollight DEF_NUMSUM)
  7.1276  
  7.1277  lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
  7.1278 @@ -1443,7 +1692,7 @@
  7.1279    by (import hollight DEF_NUMRIGHT)
  7.1280  
  7.1281  constdefs
  7.1282 -  INJN :: "nat => nat => 'A::type => bool" 
  7.1283 +  INJN :: "nat => nat => 'A => bool" 
  7.1284    "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
  7.1285  
  7.1286  lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
  7.1287 @@ -1462,7 +1711,7 @@
  7.1288    by (import hollight INJN_INJ)
  7.1289  
  7.1290  constdefs
  7.1291 -  INJA :: "'A::type => nat => 'A::type => bool" 
  7.1292 +  INJA :: "'A => nat => 'A => bool" 
  7.1293    "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
  7.1294  
  7.1295  lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
  7.1296 @@ -1472,7 +1721,7 @@
  7.1297    by (import hollight INJA_INJ)
  7.1298  
  7.1299  constdefs
  7.1300 -  INJF :: "(nat => nat => 'A::type => bool) => nat => 'A::type => bool" 
  7.1301 +  INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" 
  7.1302    "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
  7.1303  
  7.1304  lemma DEF_INJF: "INJF =
  7.1305 @@ -1484,8 +1733,7 @@
  7.1306    by (import hollight INJF_INJ)
  7.1307  
  7.1308  constdefs
  7.1309 -  INJP :: "(nat => 'A::type => bool)
  7.1310 -=> (nat => 'A::type => bool) => nat => 'A::type => bool" 
  7.1311 +  INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" 
  7.1312    "INJP ==
  7.1313  %(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
  7.1314     a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a)"
  7.1315 @@ -1501,8 +1749,7 @@
  7.1316    by (import hollight INJP_INJ)
  7.1317  
  7.1318  constdefs
  7.1319 -  ZCONSTR :: "nat
  7.1320 -=> 'A::type => (nat => nat => 'A::type => bool) => nat => 'A::type => bool" 
  7.1321 +  ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" 
  7.1322    "ZCONSTR ==
  7.1323  %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  7.1324     INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
  7.1325 @@ -1513,10 +1760,10 @@
  7.1326    by (import hollight DEF_ZCONSTR)
  7.1327  
  7.1328  constdefs
  7.1329 -  ZBOT :: "nat => 'A::type => bool" 
  7.1330 -  "ZBOT == INJP (INJN (0::nat)) (SOME z::nat => 'A::type => bool. True)"
  7.1331 -
  7.1332 -lemma DEF_ZBOT: "ZBOT = INJP (INJN (0::nat)) (SOME z::nat => 'A::type => bool. True)"
  7.1333 +  ZBOT :: "nat => 'A => bool" 
  7.1334 +  "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  7.1335 +
  7.1336 +lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  7.1337    by (import hollight DEF_ZBOT)
  7.1338  
  7.1339  lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'A::type) xb::nat => nat => 'A::type => bool.
  7.1340 @@ -1524,7 +1771,7 @@
  7.1341    by (import hollight ZCONSTR_ZBOT)
  7.1342  
  7.1343  constdefs
  7.1344 -  ZRECSPACE :: "(nat => 'A::type => bool) => bool" 
  7.1345 +  ZRECSPACE :: "(nat => 'A => bool) => bool" 
  7.1346    "ZRECSPACE ==
  7.1347  %a::nat => 'A::type => bool.
  7.1348     ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  7.1349 @@ -1559,29 +1806,74 @@
  7.1350    "_mk_rec" :: _ ("'_mk'_rec")
  7.1351  
  7.1352  lemmas "TYDEF_recspace_@intern" = typedef_hol2hollight 
  7.1353 -  [where a="a :: 'A::type recspace" and r=r ,
  7.1354 +  [where a="a :: 'A recspace" and r=r ,
  7.1355     OF type_definition_recspace]
  7.1356  
  7.1357  constdefs
  7.1358 -  BOTTOM :: "'A::type recspace" 
  7.1359 -  "BOTTOM == _mk_rec ZBOT"
  7.1360 -
  7.1361 -lemma DEF_BOTTOM: "BOTTOM = _mk_rec ZBOT"
  7.1362 +  BOTTOM :: "'A recspace" 
  7.1363 +  "(op ==::'A::type recspace => 'A::type recspace => prop)
  7.1364 + (BOTTOM::'A::type recspace)
  7.1365 + ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  7.1366 +   (ZBOT::nat => 'A::type => bool))"
  7.1367 +
  7.1368 +lemma DEF_BOTTOM: "(op =::'A::type recspace => 'A::type recspace => bool)
  7.1369 + (BOTTOM::'A::type recspace)
  7.1370 + ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  7.1371 +   (ZBOT::nat => 'A::type => bool))"
  7.1372    by (import hollight DEF_BOTTOM)
  7.1373  
  7.1374  constdefs
  7.1375 -  CONSTR :: "nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace" 
  7.1376 -  "CONSTR ==
  7.1377 -%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  7.1378 -   _mk_rec (ZCONSTR u ua (%n::nat. _dest_rec (ub n)))"
  7.1379 -
  7.1380 -lemma DEF_CONSTR: "CONSTR =
  7.1381 -(%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  7.1382 -    _mk_rec (ZCONSTR u ua (%n::nat. _dest_rec (ub n))))"
  7.1383 +  CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" 
  7.1384 +  "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1385 +        => (nat
  7.1386 +            => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1387 +           => prop)
  7.1388 + (CONSTR::nat
  7.1389 +          => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1390 + (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  7.1391 +     (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  7.1392 +      ((ZCONSTR::nat
  7.1393 +                 => 'A::type
  7.1394 +                    => (nat => nat => 'A::type => bool)
  7.1395 +                       => nat => 'A::type => bool)
  7.1396 +        u ua
  7.1397 +        (%n::nat.
  7.1398 +            (_dest_rec::'A::type recspace => nat => 'A::type => bool)
  7.1399 +             (ub n))))"
  7.1400 +
  7.1401 +lemma DEF_CONSTR: "(op =::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1402 +       => (nat
  7.1403 +           => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1404 +          => bool)
  7.1405 + (CONSTR::nat
  7.1406 +          => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1407 + (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  7.1408 +     (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  7.1409 +      ((ZCONSTR::nat
  7.1410 +                 => 'A::type
  7.1411 +                    => (nat => nat => 'A::type => bool)
  7.1412 +                       => nat => 'A::type => bool)
  7.1413 +        u ua
  7.1414 +        (%n::nat.
  7.1415 +            (_dest_rec::'A::type recspace => nat => 'A::type => bool)
  7.1416 +             (ub n))))"
  7.1417    by (import hollight DEF_CONSTR)
  7.1418  
  7.1419 -lemma MK_REC_INJ: "ALL (x::nat => 'A::type => bool) y::nat => 'A::type => bool.
  7.1420 -   _mk_rec x = _mk_rec y --> ZRECSPACE x & ZRECSPACE y --> x = y"
  7.1421 +lemma MK_REC_INJ: "(All::((nat => 'A::type => bool) => bool) => bool)
  7.1422 + (%x::nat => 'A::type => bool.
  7.1423 +     (All::((nat => 'A::type => bool) => bool) => bool)
  7.1424 +      (%y::nat => 'A::type => bool.
  7.1425 +          (op -->::bool => bool => bool)
  7.1426 +           ((op =::'A::type recspace => 'A::type recspace => bool)
  7.1427 +             ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) x)
  7.1428 +             ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) y))
  7.1429 +           ((op -->::bool => bool => bool)
  7.1430 +             ((op &::bool => bool => bool)
  7.1431 +               ((ZRECSPACE::(nat => 'A::type => bool) => bool) x)
  7.1432 +               ((ZRECSPACE::(nat => 'A::type => bool) => bool) y))
  7.1433 +             ((op =::(nat => 'A::type => bool)
  7.1434 +                     => (nat => 'A::type => bool) => bool)
  7.1435 +               x y))))"
  7.1436    by (import hollight MK_REC_INJ)
  7.1437  
  7.1438  lemma CONSTR_BOT: "ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
  7.1439 @@ -1609,24 +1901,24 @@
  7.1440    by (import hollight CONSTR_REC)
  7.1441  
  7.1442  constdefs
  7.1443 -  FCONS :: "'A::type => (nat => 'A::type) => nat => 'A::type" 
  7.1444 +  FCONS :: "'A => (nat => 'A) => nat => 'A" 
  7.1445    "FCONS ==
  7.1446  SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  7.1447 -   (ALL (a::'A::type) f::nat => 'A::type. FCONS a f (0::nat) = a) &
  7.1448 +   (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  7.1449     (ALL (a::'A::type) (f::nat => 'A::type) n::nat. FCONS a f (Suc n) = f n)"
  7.1450  
  7.1451  lemma DEF_FCONS: "FCONS =
  7.1452  (SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  7.1453 -    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f (0::nat) = a) &
  7.1454 +    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  7.1455      (ALL (a::'A::type) (f::nat => 'A::type) n::nat.
  7.1456          FCONS a f (Suc n) = f n))"
  7.1457    by (import hollight DEF_FCONS)
  7.1458  
  7.1459 -lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f (0::nat)) (f o Suc)"
  7.1460 +lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
  7.1461    by (import hollight FCONS_UNDO)
  7.1462  
  7.1463  constdefs
  7.1464 -  FNIL :: "nat => 'A::type" 
  7.1465 +  FNIL :: "nat => 'A" 
  7.1466    "FNIL == %u::nat. SOME x::'A::type. True"
  7.1467  
  7.1468  lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
  7.1469 @@ -1695,35 +1987,77 @@
  7.1470    "_mk_sum" :: _ ("'_mk'_sum")
  7.1471  
  7.1472  lemmas "TYDEF_sum_@intern" = typedef_hol2hollight 
  7.1473 -  [where a="a :: ('A::type, 'B::type) sum" and r=r ,
  7.1474 +  [where a="a :: ('A, 'B) sum" and r=r ,
  7.1475     OF type_definition_sum]
  7.1476  
  7.1477  constdefs
  7.1478 -  INL :: "'A::type => ('A::type, 'B::type) sum" 
  7.1479 -  "INL ==
  7.1480 -%a::'A::type.
  7.1481 -   _mk_sum (CONSTR (0::nat) (a, SOME v::'B::type. True) (%n::nat. BOTTOM))"
  7.1482 -
  7.1483 -lemma DEF_INL: "INL =
  7.1484 -(%a::'A::type.
  7.1485 -    _mk_sum (CONSTR (0::nat) (a, SOME v::'B::type. True) (%n::nat. BOTTOM)))"
  7.1486 +  INL :: "'A => ('A, 'B) sum" 
  7.1487 +  "(op ==::('A::type => ('A::type, 'B::type) sum)
  7.1488 +        => ('A::type => ('A::type, 'B::type) sum) => prop)
  7.1489 + (INL::'A::type => ('A::type, 'B::type) sum)
  7.1490 + (%a::'A::type.
  7.1491 +     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
  7.1492 +      ((CONSTR::nat
  7.1493 +                => 'A::type * 'B::type
  7.1494 +                   => (nat => ('A::type * 'B::type) recspace)
  7.1495 +                      => ('A::type * 'B::type) recspace)
  7.1496 +        (0::nat)
  7.1497 +        ((Pair::'A::type => 'B::type => 'A::type * 'B::type) a
  7.1498 +          ((Eps::('B::type => bool) => 'B::type)
  7.1499 +            (%v::'B::type. True::bool)))
  7.1500 +        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
  7.1501 +
  7.1502 +lemma DEF_INL: "(op =::('A::type => ('A::type, 'B::type) sum)
  7.1503 +       => ('A::type => ('A::type, 'B::type) sum) => bool)
  7.1504 + (INL::'A::type => ('A::type, 'B::type) sum)
  7.1505 + (%a::'A::type.
  7.1506 +     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
  7.1507 +      ((CONSTR::nat
  7.1508 +                => 'A::type * 'B::type
  7.1509 +                   => (nat => ('A::type * 'B::type) recspace)
  7.1510 +                      => ('A::type * 'B::type) recspace)
  7.1511 +        (0::nat)
  7.1512 +        ((Pair::'A::type => 'B::type => 'A::type * 'B::type) a
  7.1513 +          ((Eps::('B::type => bool) => 'B::type)
  7.1514 +            (%v::'B::type. True::bool)))
  7.1515 +        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
  7.1516    by (import hollight DEF_INL)
  7.1517  
  7.1518  constdefs
  7.1519 -  INR :: "'B::type => ('A::type, 'B::type) sum" 
  7.1520 -  "INR ==
  7.1521 -%a::'B::type.
  7.1522 -   _mk_sum
  7.1523 -    (CONSTR (Suc (0::nat)) (SOME v::'A::type. True, a) (%n::nat. BOTTOM))"
  7.1524 -
  7.1525 -lemma DEF_INR: "INR =
  7.1526 -(%a::'B::type.
  7.1527 -    _mk_sum
  7.1528 -     (CONSTR (Suc (0::nat)) (SOME v::'A::type. True, a) (%n::nat. BOTTOM)))"
  7.1529 +  INR :: "'B => ('A, 'B) sum" 
  7.1530 +  "(op ==::('B::type => ('A::type, 'B::type) sum)
  7.1531 +        => ('B::type => ('A::type, 'B::type) sum) => prop)
  7.1532 + (INR::'B::type => ('A::type, 'B::type) sum)
  7.1533 + (%a::'B::type.
  7.1534 +     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
  7.1535 +      ((CONSTR::nat
  7.1536 +                => 'A::type * 'B::type
  7.1537 +                   => (nat => ('A::type * 'B::type) recspace)
  7.1538 +                      => ('A::type * 'B::type) recspace)
  7.1539 +        ((Suc::nat => nat) (0::nat))
  7.1540 +        ((Pair::'A::type => 'B::type => 'A::type * 'B::type)
  7.1541 +          ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  7.1542 +          a)
  7.1543 +        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
  7.1544 +
  7.1545 +lemma DEF_INR: "(op =::('B::type => ('A::type, 'B::type) sum)
  7.1546 +       => ('B::type => ('A::type, 'B::type) sum) => bool)
  7.1547 + (INR::'B::type => ('A::type, 'B::type) sum)
  7.1548 + (%a::'B::type.
  7.1549 +     (_mk_sum::('A::type * 'B::type) recspace => ('A::type, 'B::type) sum)
  7.1550 +      ((CONSTR::nat
  7.1551 +                => 'A::type * 'B::type
  7.1552 +                   => (nat => ('A::type * 'B::type) recspace)
  7.1553 +                      => ('A::type * 'B::type) recspace)
  7.1554 +        ((Suc::nat => nat) (0::nat))
  7.1555 +        ((Pair::'A::type => 'B::type => 'A::type * 'B::type)
  7.1556 +          ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  7.1557 +          a)
  7.1558 +        (%n::nat. BOTTOM::('A::type * 'B::type) recspace)))"
  7.1559    by (import hollight DEF_INR)
  7.1560  
  7.1561  consts
  7.1562 -  OUTL :: "('A::type, 'B::type) sum => 'A::type" 
  7.1563 +  OUTL :: "('A, 'B) sum => 'A" 
  7.1564  
  7.1565  defs
  7.1566    OUTL_def: "hollight.OUTL ==
  7.1567 @@ -1736,7 +2070,7 @@
  7.1568    by (import hollight DEF_OUTL)
  7.1569  
  7.1570  consts
  7.1571 -  OUTR :: "('A::type, 'B::type) sum => 'B::type" 
  7.1572 +  OUTR :: "('A, 'B) sum => 'B" 
  7.1573  
  7.1574  defs
  7.1575    OUTR_def: "hollight.OUTR ==
  7.1576 @@ -1790,26 +2124,55 @@
  7.1577    "_mk_option" :: _ ("'_mk'_option")
  7.1578  
  7.1579  lemmas "TYDEF_option_@intern" = typedef_hol2hollight 
  7.1580 -  [where a="a :: 'A::type hollight.option" and r=r ,
  7.1581 +  [where a="a :: 'A hollight.option" and r=r ,
  7.1582     OF type_definition_option]
  7.1583  
  7.1584  constdefs
  7.1585 -  NONE :: "'A::type hollight.option" 
  7.1586 -  "NONE ==
  7.1587 -_mk_option (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
  7.1588 -
  7.1589 -lemma DEF_NONE: "NONE =
  7.1590 -_mk_option (CONSTR (0::nat) (SOME v::'A::type. True) (%n::nat. BOTTOM))"
  7.1591 +  NONE :: "'A hollight.option" 
  7.1592 +  "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
  7.1593 + (NONE::'A::type hollight.option)
  7.1594 + ((_mk_option::'A::type recspace => 'A::type hollight.option)
  7.1595 +   ((CONSTR::nat
  7.1596 +             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1597 +     (0::nat)
  7.1598 +     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  7.1599 +     (%n::nat. BOTTOM::'A::type recspace)))"
  7.1600 +
  7.1601 +lemma DEF_NONE: "(op =::'A::type hollight.option => 'A::type hollight.option => bool)
  7.1602 + (NONE::'A::type hollight.option)
  7.1603 + ((_mk_option::'A::type recspace => 'A::type hollight.option)
  7.1604 +   ((CONSTR::nat
  7.1605 +             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  7.1606 +     (0::nat)
  7.1607 +     ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  7.1608 +     (%n::nat. BOTTOM::'A::type recspace)))"
  7.1609    by (import hollight DEF_NONE)
  7.1610  
  7.1611  consts
  7.1612 -  SOME :: "'A::type => 'A::type hollight.option" ("SOME")
  7.1613 +  SOME :: "'A => 'A hollight.option" ("SOME")
  7.1614  
  7.1615  defs
  7.1616 -  SOME_def: "SOME == %a::'A::type. _mk_option (CONSTR (Suc (0::nat)) a (%n::nat. BOTTOM))"
  7.1617 -
  7.1618 -lemma DEF_SOME: "SOME =
  7.1619 -(%a::'A::type. _mk_option (CONSTR (Suc (0::nat)) a (%n::nat. BOTTOM)))"
  7.1620 +  SOME_def: "(op ==::('A::type => 'A::type hollight.option)
  7.1621 +        => ('A::type => 'A::type hollight.option) => prop)
  7.1622 + (SOME::'A::type => 'A::type hollight.option)
  7.1623 + (%a::'A::type.
  7.1624 +     (_mk_option::'A::type recspace => 'A::type hollight.option)
  7.1625 +      ((CONSTR::nat
  7.1626 +                => 'A::type
  7.1627 +                   => (nat => 'A::type recspace) => 'A::type recspace)
  7.1628 +        ((Suc::nat => nat) (0::nat)) a
  7.1629 +        (%n::nat. BOTTOM::'A::type recspace)))"
  7.1630 +
  7.1631 +lemma DEF_SOME: "(op =::('A::type => 'A::type hollight.option)
  7.1632 +       => ('A::type => 'A::type hollight.option) => bool)
  7.1633 + (SOME::'A::type => 'A::type hollight.option)