src/HOL/Import/HOLLight/HOLLight.thy
author obua
Fri Feb 17 03:30:50 2006 +0100 (2006-02-17)
changeset 19093 6d584f9d2021
parent 17915 e38947f9ba5e
child 19233 77ca20b0ed77
permissions -rw-r--r--
use monomorphic sequences / scanners
     1 (* AUTOMATICALLY GENERATED, DO NOT EDIT! *)
     2 
     3 theory HOLLight = "../HOLLightCompat" + "../HOL4Syntax":
     4 
     5 ;setup_theory hollight
     6 
     7 consts
     8   "_FALSITY_" :: "bool" ("'_FALSITY'_")
     9 
    10 defs
    11   "_FALSITY__def": "_FALSITY_ == False"
    12 
    13 lemma DEF__FALSITY_: "_FALSITY_ = False"
    14   by (import hollight DEF__FALSITY_)
    15 
    16 lemma CONJ_ACI: "((p::bool) & (q::bool)) = (q & p) &
    17 ((p & q) & (r::bool)) = (p & q & r) &
    18 (p & q & r) = (q & p & r) & (p & p) = p & (p & p & q) = (p & q)"
    19   by (import hollight CONJ_ACI)
    20 
    21 lemma DISJ_ACI: "((p::bool) | (q::bool)) = (q | p) &
    22 ((p | q) | (r::bool)) = (p | q | r) &
    23 (p | q | r) = (q | p | r) & (p | p) = p & (p | p | q) = (p | q)"
    24   by (import hollight DISJ_ACI)
    25 
    26 lemma EQ_CLAUSES: "ALL t::bool.
    27    (True = t) = t &
    28    (t = True) = t & (False = t) = (~ t) & (t = False) = (~ t)"
    29   by (import hollight EQ_CLAUSES)
    30 
    31 lemma NOT_CLAUSES_WEAK: "(~ True) = False & (~ False) = True"
    32   by (import hollight NOT_CLAUSES_WEAK)
    33 
    34 lemma AND_CLAUSES: "ALL t::bool.
    35    (True & t) = t &
    36    (t & True) = t & (False & t) = False & (t & False) = False & (t & t) = t"
    37   by (import hollight AND_CLAUSES)
    38 
    39 lemma OR_CLAUSES: "ALL t::bool.
    40    (True | t) = True &
    41    (t | True) = True & (False | t) = t & (t | False) = t & (t | t) = t"
    42   by (import hollight OR_CLAUSES)
    43 
    44 lemma IMP_CLAUSES: "ALL t::bool.
    45    (True --> t) = t &
    46    (t --> True) = True &
    47    (False --> t) = True & (t --> t) = True & (t --> False) = (~ t)"
    48   by (import hollight IMP_CLAUSES)
    49 
    50 lemma IMP_EQ_CLAUSE: "((x::'q_864::type) = x --> (p::bool)) = p"
    51   by (import hollight IMP_EQ_CLAUSE)
    52 
    53 lemma SWAP_FORALL_THM: "ALL P::'A::type => 'B::type => bool.
    54    (ALL x::'A::type. All (P x)) = (ALL (y::'B::type) x::'A::type. P x y)"
    55   by (import hollight SWAP_FORALL_THM)
    56 
    57 lemma SWAP_EXISTS_THM: "ALL P::'A::type => 'B::type => bool.
    58    (EX x::'A::type. Ex (P x)) = (EX (x::'B::type) xa::'A::type. P xa x)"
    59   by (import hollight SWAP_EXISTS_THM)
    60 
    61 lemma TRIV_EXISTS_AND_THM: "ALL (P::bool) Q::bool.
    62    (EX x::'A::type. P & Q) = ((EX x::'A::type. P) & (EX x::'A::type. Q))"
    63   by (import hollight TRIV_EXISTS_AND_THM)
    64 
    65 lemma TRIV_AND_EXISTS_THM: "ALL (P::bool) Q::bool.
    66    ((EX x::'A::type. P) & (EX x::'A::type. Q)) = (EX x::'A::type. P & Q)"
    67   by (import hollight TRIV_AND_EXISTS_THM)
    68 
    69 lemma TRIV_FORALL_OR_THM: "ALL (P::bool) Q::bool.
    70    (ALL x::'A::type. P | Q) = ((ALL x::'A::type. P) | (ALL x::'A::type. Q))"
    71   by (import hollight TRIV_FORALL_OR_THM)
    72 
    73 lemma TRIV_OR_FORALL_THM: "ALL (P::bool) Q::bool.
    74    ((ALL x::'A::type. P) | (ALL x::'A::type. Q)) = (ALL x::'A::type. P | Q)"
    75   by (import hollight TRIV_OR_FORALL_THM)
    76 
    77 lemma TRIV_FORALL_IMP_THM: "ALL (P::bool) Q::bool.
    78    (ALL x::'A::type. P --> Q) =
    79    ((EX x::'A::type. P) --> (ALL x::'A::type. Q))"
    80   by (import hollight TRIV_FORALL_IMP_THM)
    81 
    82 lemma TRIV_EXISTS_IMP_THM: "ALL (P::bool) Q::bool.
    83    (EX x::'A::type. P --> Q) =
    84    ((ALL x::'A::type. P) --> (EX x::'A::type. Q))"
    85   by (import hollight TRIV_EXISTS_IMP_THM)
    86 
    87 lemma EXISTS_UNIQUE_ALT: "ALL P::'A::type => bool.
    88    Ex1 P = (EX x::'A::type. ALL y::'A::type. P y = (x = y))"
    89   by (import hollight EXISTS_UNIQUE_ALT)
    90 
    91 lemma SELECT_UNIQUE: "ALL (P::'A::type => bool) x::'A::type.
    92    (ALL y::'A::type. P y = (y = x)) --> Eps P = x"
    93   by (import hollight SELECT_UNIQUE)
    94 
    95 lemma EXCLUDED_MIDDLE: "ALL t::bool. t | ~ t"
    96   by (import hollight EXCLUDED_MIDDLE)
    97 
    98 constdefs
    99   COND :: "bool => 'A => 'A => 'A" 
   100   "COND ==
   101 %(t::bool) (t1::'A::type) t2::'A::type.
   102    SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
   103 
   104 lemma DEF_COND: "COND =
   105 (%(t::bool) (t1::'A::type) t2::'A::type.
   106     SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2))"
   107   by (import hollight DEF_COND)
   108 
   109 lemma COND_CLAUSES: "ALL (x::'A::type) xa::'A::type. COND True x xa = x & COND False x xa = xa"
   110   by (import hollight COND_CLAUSES)
   111 
   112 lemma COND_EXPAND: "ALL (b::bool) (t1::bool) t2::bool. COND b t1 t2 = ((~ b | t1) & (b | t2))"
   113   by (import hollight COND_EXPAND)
   114 
   115 lemma COND_ID: "ALL (b::bool) t::'A::type. COND b t t = t"
   116   by (import hollight COND_ID)
   117 
   118 lemma COND_RAND: "ALL (b::bool) (f::'A::type => 'B::type) (x::'A::type) y::'A::type.
   119    f (COND b x y) = COND b (f x) (f y)"
   120   by (import hollight COND_RAND)
   121 
   122 lemma COND_RATOR: "ALL (b::bool) (f::'A::type => 'B::type) (g::'A::type => 'B::type)
   123    x::'A::type. COND b f g x = COND b (f x) (g x)"
   124   by (import hollight COND_RATOR)
   125 
   126 lemma COND_ABS: "ALL (b::bool) (f::'A::type => 'B::type) g::'A::type => 'B::type.
   127    (%x::'A::type. COND b (f x) (g x)) = COND b f g"
   128   by (import hollight COND_ABS)
   129 
   130 lemma MONO_COND: "((A::bool) --> (B::bool)) & ((C::bool) --> (D::bool)) -->
   131 COND (b::bool) A C --> COND b B D"
   132   by (import hollight MONO_COND)
   133 
   134 lemma COND_ELIM_THM: "(P::'A::type => bool) (COND (c::bool) (x::'A::type) (y::'A::type)) =
   135 ((c --> P x) & (~ c --> P y))"
   136   by (import hollight COND_ELIM_THM)
   137 
   138 lemma SKOLEM_THM: "ALL P::'A::type => 'B::type => bool.
   139    (ALL x::'A::type. Ex (P x)) =
   140    (EX x::'A::type => 'B::type. ALL xa::'A::type. P xa (x xa))"
   141   by (import hollight SKOLEM_THM)
   142 
   143 lemma UNIQUE_SKOLEM_ALT: "ALL P::'A::type => 'B::type => bool.
   144    (ALL x::'A::type. Ex1 (P x)) =
   145    (EX f::'A::type => 'B::type.
   146        ALL (x::'A::type) y::'B::type. P x y = (f x = y))"
   147   by (import hollight UNIQUE_SKOLEM_ALT)
   148 
   149 lemma COND_EQ_CLAUSE: "COND ((x::'q_3000::type) = x) (y::'q_2993::type) (z::'q_2993::type) = y"
   150   by (import hollight COND_EQ_CLAUSE)
   151 
   152 lemma o_ASSOC: "ALL (f::'C::type => 'D::type) (g::'B::type => 'C::type)
   153    h::'A::type => 'B::type. f o (g o h) = f o g o h"
   154   by (import hollight o_ASSOC)
   155 
   156 lemma I_O_ID: "ALL f::'A::type => 'B::type. id o f = f & f o id = f"
   157   by (import hollight I_O_ID)
   158 
   159 lemma EXISTS_ONE_REP: "EX x::bool. x"
   160   by (import hollight EXISTS_ONE_REP)
   161 
   162 lemma one_axiom: "ALL f::'A::type => unit. All (op = f)"
   163   by (import hollight one_axiom)
   164 
   165 lemma one_RECURSION: "ALL e::'A::type. EX x::unit => 'A::type. x () = e"
   166   by (import hollight one_RECURSION)
   167 
   168 lemma one_Axiom: "ALL e::'A::type. EX! fn::unit => 'A::type. fn () = e"
   169   by (import hollight one_Axiom)
   170 
   171 lemma th_cond: "(P::'A::type => bool => bool) (COND (b::bool) (x::'A::type) (y::'A::type))
   172  b =
   173 (b & P x True | ~ b & P y False)"
   174   by (import hollight th_cond)
   175 
   176 constdefs
   177   LET_END :: "'A => 'A" 
   178   "LET_END == %t::'A::type. t"
   179 
   180 lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
   181   by (import hollight DEF_LET_END)
   182 
   183 constdefs
   184   GABS :: "('A => bool) => 'A" 
   185   "(op ==::(('A::type => bool) => 'A::type)
   186         => (('A::type => bool) => 'A::type) => prop)
   187  (GABS::('A::type => bool) => 'A::type)
   188  (Eps::('A::type => bool) => 'A::type)"
   189 
   190 lemma DEF_GABS: "(op =::(('A::type => bool) => 'A::type)
   191        => (('A::type => bool) => 'A::type) => bool)
   192  (GABS::('A::type => bool) => 'A::type)
   193  (Eps::('A::type => bool) => 'A::type)"
   194   by (import hollight DEF_GABS)
   195 
   196 constdefs
   197   GEQ :: "'A => 'A => bool" 
   198   "(op ==::('A::type => 'A::type => bool)
   199         => ('A::type => 'A::type => bool) => prop)
   200  (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
   201 
   202 lemma DEF_GEQ: "(op =::('A::type => 'A::type => bool)
   203        => ('A::type => 'A::type => bool) => bool)
   204  (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
   205   by (import hollight DEF_GEQ)
   206 
   207 lemma PAIR_EXISTS_THM: "EX (x::'A::type => 'B::type => bool) (a::'A::type) b::'B::type.
   208    x = Pair_Rep a b"
   209   by (import hollight PAIR_EXISTS_THM)
   210 
   211 constdefs
   212   CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" 
   213   "CURRY ==
   214 %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   215    u (ua, ub)"
   216 
   217 lemma DEF_CURRY: "CURRY =
   218 (%(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   219     u (ua, ub))"
   220   by (import hollight DEF_CURRY)
   221 
   222 constdefs
   223   UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" 
   224   "UNCURRY ==
   225 %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   226    u (fst ua) (snd ua)"
   227 
   228 lemma DEF_UNCURRY: "UNCURRY =
   229 (%(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   230     u (fst ua) (snd ua))"
   231   by (import hollight DEF_UNCURRY)
   232 
   233 constdefs
   234   PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" 
   235   "PASSOC ==
   236 %(u::('A::type * 'B::type) * 'C::type => 'D::type)
   237    ua::'A::type * 'B::type * 'C::type.
   238    u ((fst ua, fst (snd ua)), snd (snd ua))"
   239 
   240 lemma DEF_PASSOC: "PASSOC =
   241 (%(u::('A::type * 'B::type) * 'C::type => 'D::type)
   242     ua::'A::type * 'B::type * 'C::type.
   243     u ((fst ua, fst (snd ua)), snd (snd ua)))"
   244   by (import hollight DEF_PASSOC)
   245 
   246 lemma num_Axiom: "ALL (e::'A::type) f::'A::type => nat => 'A::type.
   247    EX! fn::nat => 'A::type. fn 0 = e & (ALL n::nat. fn (Suc n) = f (fn n) n)"
   248   by (import hollight num_Axiom)
   249 
   250 lemma ADD_CLAUSES: "(ALL x::nat. 0 + x = x) &
   251 (ALL x::nat. x + 0 = x) &
   252 (ALL (x::nat) xa::nat. Suc x + xa = Suc (x + xa)) &
   253 (ALL (x::nat) xa::nat. x + Suc xa = Suc (x + xa))"
   254   by (import hollight ADD_CLAUSES)
   255 
   256 lemma ADD_AC: "(m::nat) + (n::nat) = n + m &
   257 m + n + (p::nat) = m + (n + p) & m + (n + p) = n + (m + p)"
   258   by (import hollight ADD_AC)
   259 
   260 lemma EQ_ADD_LCANCEL_0: "ALL (m::nat) n::nat. (m + n = m) = (n = 0)"
   261   by (import hollight EQ_ADD_LCANCEL_0)
   262 
   263 lemma EQ_ADD_RCANCEL_0: "ALL (x::nat) xa::nat. (x + xa = xa) = (x = 0)"
   264   by (import hollight EQ_ADD_RCANCEL_0)
   265 
   266 lemma ONE: "NUMERAL_BIT1 0 = Suc 0"
   267   by (import hollight ONE)
   268 
   269 lemma TWO: "NUMERAL_BIT0 (NUMERAL_BIT1 0) = Suc (NUMERAL_BIT1 0)"
   270   by (import hollight TWO)
   271 
   272 lemma ADD1: "ALL x::nat. Suc x = x + NUMERAL_BIT1 0"
   273   by (import hollight ADD1)
   274 
   275 lemma MULT_CLAUSES: "(ALL x::nat. 0 * x = 0) &
   276 (ALL x::nat. x * 0 = 0) &
   277 (ALL x::nat. NUMERAL_BIT1 0 * x = x) &
   278 (ALL x::nat. x * NUMERAL_BIT1 0 = x) &
   279 (ALL (x::nat) xa::nat. Suc x * xa = x * xa + xa) &
   280 (ALL (x::nat) xa::nat. x * Suc xa = x + x * xa)"
   281   by (import hollight MULT_CLAUSES)
   282 
   283 lemma MULT_AC: "(m::nat) * (n::nat) = n * m &
   284 m * n * (p::nat) = m * (n * p) & m * (n * p) = n * (m * p)"
   285   by (import hollight MULT_AC)
   286 
   287 lemma MULT_2: "ALL n::nat. NUMERAL_BIT0 (NUMERAL_BIT1 0) * n = n + n"
   288   by (import hollight MULT_2)
   289 
   290 lemma MULT_EQ_1: "ALL (m::nat) n::nat.
   291    (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   292   by (import hollight MULT_EQ_1)
   293 
   294 constdefs
   295   EXP :: "nat => nat => nat" 
   296   "EXP ==
   297 SOME EXP::nat => nat => nat.
   298    (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   299    (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n)"
   300 
   301 lemma DEF_EXP: "EXP =
   302 (SOME EXP::nat => nat => nat.
   303     (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   304     (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n))"
   305   by (import hollight DEF_EXP)
   306 
   307 lemma EXP_EQ_0: "ALL (m::nat) n::nat. (EXP m n = 0) = (m = 0 & n ~= 0)"
   308   by (import hollight EXP_EQ_0)
   309 
   310 lemma EXP_ADD: "ALL (m::nat) (n::nat) p::nat. EXP m (n + p) = EXP m n * EXP m p"
   311   by (import hollight EXP_ADD)
   312 
   313 lemma EXP_ONE: "ALL n::nat. EXP (NUMERAL_BIT1 0) n = NUMERAL_BIT1 0"
   314   by (import hollight EXP_ONE)
   315 
   316 lemma EXP_1: "ALL x::nat. EXP x (NUMERAL_BIT1 0) = x"
   317   by (import hollight EXP_1)
   318 
   319 lemma EXP_2: "ALL x::nat. EXP x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = x * x"
   320   by (import hollight EXP_2)
   321 
   322 lemma MULT_EXP: "ALL (p::nat) (m::nat) n::nat. EXP (m * n) p = EXP m p * EXP n p"
   323   by (import hollight MULT_EXP)
   324 
   325 lemma EXP_MULT: "ALL (m::nat) (n::nat) p::nat. EXP m (n * p) = EXP (EXP m n) p"
   326   by (import hollight EXP_MULT)
   327 
   328 consts
   329   "<=" :: "nat => nat => bool" ("<=")
   330 
   331 defs
   332   "<=_def": "<= ==
   333 SOME u::nat => nat => bool.
   334    (ALL m::nat. u m 0 = (m = 0)) &
   335    (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n))"
   336 
   337 lemma DEF__lessthan__equal_: "<= =
   338 (SOME u::nat => nat => bool.
   339     (ALL m::nat. u m 0 = (m = 0)) &
   340     (ALL (m::nat) n::nat. u m (Suc n) = (m = Suc n | u m n)))"
   341   by (import hollight DEF__lessthan__equal_)
   342 
   343 consts
   344   "<" :: "nat => nat => bool" ("<")
   345 
   346 defs
   347   "<_def": "< ==
   348 SOME u::nat => nat => bool.
   349    (ALL m::nat. u m 0 = False) &
   350    (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n))"
   351 
   352 lemma DEF__lessthan_: "< =
   353 (SOME u::nat => nat => bool.
   354     (ALL m::nat. u m 0 = False) &
   355     (ALL (m::nat) n::nat. u m (Suc n) = (m = n | u m n)))"
   356   by (import hollight DEF__lessthan_)
   357 
   358 consts
   359   ">=" :: "nat => nat => bool" (">=")
   360 
   361 defs
   362   ">=_def": ">= == %(u::nat) ua::nat. <= ua u"
   363 
   364 lemma DEF__greaterthan__equal_: ">= = (%(u::nat) ua::nat. <= ua u)"
   365   by (import hollight DEF__greaterthan__equal_)
   366 
   367 consts
   368   ">" :: "nat => nat => bool" (">")
   369 
   370 defs
   371   ">_def": "> == %(u::nat) ua::nat. < ua u"
   372 
   373 lemma DEF__greaterthan_: "> = (%(u::nat) ua::nat. < ua u)"
   374   by (import hollight DEF__greaterthan_)
   375 
   376 lemma LE_SUC_LT: "ALL (m::nat) n::nat. <= (Suc m) n = < m n"
   377   by (import hollight LE_SUC_LT)
   378 
   379 lemma LT_SUC_LE: "ALL (m::nat) n::nat. < m (Suc n) = <= m n"
   380   by (import hollight LT_SUC_LE)
   381 
   382 lemma LE_SUC: "ALL (x::nat) xa::nat. <= (Suc x) (Suc xa) = <= x xa"
   383   by (import hollight LE_SUC)
   384 
   385 lemma LT_SUC: "ALL (x::nat) xa::nat. < (Suc x) (Suc xa) = < x xa"
   386   by (import hollight LT_SUC)
   387 
   388 lemma LE_0: "All (<= 0)"
   389   by (import hollight LE_0)
   390 
   391 lemma LT_0: "ALL x::nat. < 0 (Suc x)"
   392   by (import hollight LT_0)
   393 
   394 lemma LE_REFL: "ALL n::nat. <= n n"
   395   by (import hollight LE_REFL)
   396 
   397 lemma LT_REFL: "ALL n::nat. ~ < n n"
   398   by (import hollight LT_REFL)
   399 
   400 lemma LE_ANTISYM: "ALL (m::nat) n::nat. (<= m n & <= n m) = (m = n)"
   401   by (import hollight LE_ANTISYM)
   402 
   403 lemma LT_ANTISYM: "ALL (m::nat) n::nat. ~ (< m n & < n m)"
   404   by (import hollight LT_ANTISYM)
   405 
   406 lemma LET_ANTISYM: "ALL (m::nat) n::nat. ~ (<= m n & < n m)"
   407   by (import hollight LET_ANTISYM)
   408 
   409 lemma LTE_ANTISYM: "ALL (x::nat) xa::nat. ~ (< x xa & <= xa x)"
   410   by (import hollight LTE_ANTISYM)
   411 
   412 lemma LE_TRANS: "ALL (m::nat) (n::nat) p::nat. <= m n & <= n p --> <= m p"
   413   by (import hollight LE_TRANS)
   414 
   415 lemma LT_TRANS: "ALL (m::nat) (n::nat) p::nat. < m n & < n p --> < m p"
   416   by (import hollight LT_TRANS)
   417 
   418 lemma LET_TRANS: "ALL (m::nat) (n::nat) p::nat. <= m n & < n p --> < m p"
   419   by (import hollight LET_TRANS)
   420 
   421 lemma LTE_TRANS: "ALL (m::nat) (n::nat) p::nat. < m n & <= n p --> < m p"
   422   by (import hollight LTE_TRANS)
   423 
   424 lemma LE_CASES: "ALL (m::nat) n::nat. <= m n | <= n m"
   425   by (import hollight LE_CASES)
   426 
   427 lemma LT_CASES: "ALL (m::nat) n::nat. < m n | < n m | m = n"
   428   by (import hollight LT_CASES)
   429 
   430 lemma LET_CASES: "ALL (m::nat) n::nat. <= m n | < n m"
   431   by (import hollight LET_CASES)
   432 
   433 lemma LTE_CASES: "ALL (x::nat) xa::nat. < x xa | <= xa x"
   434   by (import hollight LTE_CASES)
   435 
   436 lemma LT_NZ: "ALL n::nat. < 0 n = (n ~= 0)"
   437   by (import hollight LT_NZ)
   438 
   439 lemma LE_LT: "ALL (m::nat) n::nat. <= m n = (< m n | m = n)"
   440   by (import hollight LE_LT)
   441 
   442 lemma LT_LE: "ALL (x::nat) xa::nat. < x xa = (<= x xa & x ~= xa)"
   443   by (import hollight LT_LE)
   444 
   445 lemma NOT_LE: "ALL (m::nat) n::nat. (~ <= m n) = < n m"
   446   by (import hollight NOT_LE)
   447 
   448 lemma NOT_LT: "ALL (m::nat) n::nat. (~ < m n) = <= n m"
   449   by (import hollight NOT_LT)
   450 
   451 lemma LT_IMP_LE: "ALL (x::nat) xa::nat. < x xa --> <= x xa"
   452   by (import hollight LT_IMP_LE)
   453 
   454 lemma EQ_IMP_LE: "ALL (m::nat) n::nat. m = n --> <= m n"
   455   by (import hollight EQ_IMP_LE)
   456 
   457 lemma LE_EXISTS: "ALL (m::nat) n::nat. <= m n = (EX d::nat. n = m + d)"
   458   by (import hollight LE_EXISTS)
   459 
   460 lemma LT_EXISTS: "ALL (m::nat) n::nat. < m n = (EX d::nat. n = m + Suc d)"
   461   by (import hollight LT_EXISTS)
   462 
   463 lemma LE_ADD: "ALL (m::nat) n::nat. <= m (m + n)"
   464   by (import hollight LE_ADD)
   465 
   466 lemma LE_ADDR: "ALL (x::nat) xa::nat. <= xa (x + xa)"
   467   by (import hollight LE_ADDR)
   468 
   469 lemma LT_ADD: "ALL (m::nat) n::nat. < m (m + n) = < 0 n"
   470   by (import hollight LT_ADD)
   471 
   472 lemma LT_ADDR: "ALL (x::nat) xa::nat. < xa (x + xa) = < 0 x"
   473   by (import hollight LT_ADDR)
   474 
   475 lemma LE_ADD_LCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x + xa) (x + xb) = <= xa xb"
   476   by (import hollight LE_ADD_LCANCEL)
   477 
   478 lemma LE_ADD_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x + xb) (xa + xb) = <= x xa"
   479   by (import hollight LE_ADD_RCANCEL)
   480 
   481 lemma LT_ADD_LCANCEL: "ALL (x::nat) (xa::nat) xb::nat. < (x + xa) (x + xb) = < xa xb"
   482   by (import hollight LT_ADD_LCANCEL)
   483 
   484 lemma LT_ADD_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. < (x + xb) (xa + xb) = < x xa"
   485   by (import hollight LT_ADD_RCANCEL)
   486 
   487 lemma LE_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat.
   488    <= m p & <= n q --> <= (m + n) (p + q)"
   489   by (import hollight LE_ADD2)
   490 
   491 lemma LET_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat. <= m p & < n q --> < (m + n) (p + q)"
   492   by (import hollight LET_ADD2)
   493 
   494 lemma LTE_ADD2: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
   495    < x xb & <= xa xc --> < (x + xa) (xb + xc)"
   496   by (import hollight LTE_ADD2)
   497 
   498 lemma LT_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m p & < n q --> < (m + n) (p + q)"
   499   by (import hollight LT_ADD2)
   500 
   501 lemma LT_MULT: "ALL (m::nat) n::nat. < 0 (m * n) = (< 0 m & < 0 n)"
   502   by (import hollight LT_MULT)
   503 
   504 lemma LE_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat.
   505    <= m n & <= p q --> <= (m * p) (n * q)"
   506   by (import hollight LE_MULT2)
   507 
   508 lemma LT_LMULT: "ALL (m::nat) (n::nat) p::nat. m ~= 0 & < n p --> < (m * n) (m * p)"
   509   by (import hollight LT_LMULT)
   510 
   511 lemma LE_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. <= (m * n) (m * p) = (m = 0 | <= n p)"
   512   by (import hollight LE_MULT_LCANCEL)
   513 
   514 lemma LE_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. <= (x * xb) (xa * xb) = (<= x xa | xb = 0)"
   515   by (import hollight LE_MULT_RCANCEL)
   516 
   517 lemma LT_MULT_LCANCEL: "ALL (m::nat) (n::nat) p::nat. < (m * n) (m * p) = (m ~= 0 & < n p)"
   518   by (import hollight LT_MULT_LCANCEL)
   519 
   520 lemma LT_MULT_RCANCEL: "ALL (x::nat) (xa::nat) xb::nat. < (x * xb) (xa * xb) = (< x xa & xb ~= 0)"
   521   by (import hollight LT_MULT_RCANCEL)
   522 
   523 lemma LT_MULT2: "ALL (m::nat) (n::nat) (p::nat) q::nat. < m n & < p q --> < (m * p) (n * q)"
   524   by (import hollight LT_MULT2)
   525 
   526 lemma LE_SQUARE_REFL: "ALL n::nat. <= n (n * n)"
   527   by (import hollight LE_SQUARE_REFL)
   528 
   529 lemma WLOG_LE: "(ALL (m::nat) n::nat. (P::nat => nat => bool) m n = P n m) &
   530 (ALL (m::nat) n::nat. <= m n --> P m n) -->
   531 (ALL m::nat. All (P m))"
   532   by (import hollight WLOG_LE)
   533 
   534 lemma WLOG_LT: "(ALL m::nat. (P::nat => nat => bool) m m) &
   535 (ALL (m::nat) n::nat. P m n = P n m) &
   536 (ALL (m::nat) n::nat. < m n --> P m n) -->
   537 (ALL m::nat. All (P m))"
   538   by (import hollight WLOG_LT)
   539 
   540 lemma num_WF: "ALL P::nat => bool.
   541    (ALL n::nat. (ALL m::nat. < m n --> P m) --> P n) --> All P"
   542   by (import hollight num_WF)
   543 
   544 lemma num_WOP: "ALL P::nat => bool. Ex P = (EX n::nat. P n & (ALL m::nat. < m n --> ~ P m))"
   545   by (import hollight num_WOP)
   546 
   547 lemma num_MAX: "ALL P::nat => bool.
   548    (Ex P & (EX M::nat. ALL x::nat. P x --> <= x M)) =
   549    (EX m::nat. P m & (ALL x::nat. P x --> <= x m))"
   550   by (import hollight num_MAX)
   551 
   552 constdefs
   553   EVEN :: "nat => bool" 
   554   "EVEN ==
   555 SOME EVEN::nat => bool.
   556    EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   557 
   558 lemma DEF_EVEN: "EVEN =
   559 (SOME EVEN::nat => bool.
   560     EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   561   by (import hollight DEF_EVEN)
   562 
   563 constdefs
   564   ODD :: "nat => bool" 
   565   "ODD ==
   566 SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   567 
   568 lemma DEF_ODD: "ODD =
   569 (SOME ODD::nat => bool.
   570     ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n)))"
   571   by (import hollight DEF_ODD)
   572 
   573 lemma NOT_EVEN: "ALL n::nat. (~ EVEN n) = ODD n"
   574   by (import hollight NOT_EVEN)
   575 
   576 lemma NOT_ODD: "ALL n::nat. (~ ODD n) = EVEN n"
   577   by (import hollight NOT_ODD)
   578 
   579 lemma EVEN_OR_ODD: "ALL n::nat. EVEN n | ODD n"
   580   by (import hollight EVEN_OR_ODD)
   581 
   582 lemma EVEN_AND_ODD: "ALL x::nat. ~ (EVEN x & ODD x)"
   583   by (import hollight EVEN_AND_ODD)
   584 
   585 lemma EVEN_ADD: "ALL (m::nat) n::nat. EVEN (m + n) = (EVEN m = EVEN n)"
   586   by (import hollight EVEN_ADD)
   587 
   588 lemma EVEN_MULT: "ALL (m::nat) n::nat. EVEN (m * n) = (EVEN m | EVEN n)"
   589   by (import hollight EVEN_MULT)
   590 
   591 lemma EVEN_EXP: "ALL (m::nat) n::nat. EVEN (EXP m n) = (EVEN m & n ~= 0)"
   592   by (import hollight EVEN_EXP)
   593 
   594 lemma ODD_ADD: "ALL (m::nat) n::nat. ODD (m + n) = (ODD m ~= ODD n)"
   595   by (import hollight ODD_ADD)
   596 
   597 lemma ODD_MULT: "ALL (m::nat) n::nat. ODD (m * n) = (ODD m & ODD n)"
   598   by (import hollight ODD_MULT)
   599 
   600 lemma ODD_EXP: "ALL (m::nat) n::nat. ODD (EXP m n) = (ODD m | n = 0)"
   601   by (import hollight ODD_EXP)
   602 
   603 lemma EVEN_DOUBLE: "ALL n::nat. EVEN (NUMERAL_BIT0 (NUMERAL_BIT1 0) * n)"
   604   by (import hollight EVEN_DOUBLE)
   605 
   606 lemma ODD_DOUBLE: "ALL x::nat. ODD (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * x))"
   607   by (import hollight ODD_DOUBLE)
   608 
   609 lemma EVEN_EXISTS_LEMMA: "ALL n::nat.
   610    (EVEN n --> (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)) &
   611    (~ EVEN n --> (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)))"
   612   by (import hollight EVEN_EXISTS_LEMMA)
   613 
   614 lemma EVEN_EXISTS: "ALL n::nat. EVEN n = (EX m::nat. n = NUMERAL_BIT0 (NUMERAL_BIT1 0) * m)"
   615   by (import hollight EVEN_EXISTS)
   616 
   617 lemma ODD_EXISTS: "ALL n::nat. ODD n = (EX m::nat. n = Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * m))"
   618   by (import hollight ODD_EXISTS)
   619 
   620 lemma EVEN_ODD_DECOMPOSITION: "ALL n::nat.
   621    (EX (k::nat) m::nat.
   622        ODD m & n = EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) k * m) =
   623    (n ~= 0)"
   624   by (import hollight EVEN_ODD_DECOMPOSITION)
   625 
   626 lemma SUB_0: "ALL x::nat. 0 - x = 0 & x - 0 = x"
   627   by (import hollight SUB_0)
   628 
   629 lemma SUB_PRESUC: "ALL (m::nat) n::nat. Pred (Suc m - n) = m - n"
   630   by (import hollight SUB_PRESUC)
   631 
   632 lemma SUB_EQ_0: "ALL (m::nat) n::nat. (m - n = 0) = <= m n"
   633   by (import hollight SUB_EQ_0)
   634 
   635 lemma ADD_SUBR: "ALL (x::nat) xa::nat. xa - (x + xa) = 0"
   636   by (import hollight ADD_SUBR)
   637 
   638 lemma SUB_ADD: "ALL (x::nat) xa::nat. <= xa x --> x - xa + xa = x"
   639   by (import hollight SUB_ADD)
   640 
   641 lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
   642   by (import hollight SUC_SUB1)
   643 
   644 constdefs
   645   FACT :: "nat => nat" 
   646   "FACT ==
   647 SOME FACT::nat => nat.
   648    FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   649 
   650 lemma DEF_FACT: "FACT =
   651 (SOME FACT::nat => nat.
   652     FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n))"
   653   by (import hollight DEF_FACT)
   654 
   655 lemma FACT_LT: "ALL n::nat. < 0 (FACT n)"
   656   by (import hollight FACT_LT)
   657 
   658 lemma FACT_LE: "ALL x::nat. <= (NUMERAL_BIT1 0) (FACT x)"
   659   by (import hollight FACT_LE)
   660 
   661 lemma FACT_MONO: "ALL (m::nat) n::nat. <= m n --> <= (FACT m) (FACT n)"
   662   by (import hollight FACT_MONO)
   663 
   664 lemma DIVMOD_EXIST: "ALL (m::nat) n::nat. n ~= 0 --> (EX (q::nat) r::nat. m = q * n + r & < r n)"
   665   by (import hollight DIVMOD_EXIST)
   666 
   667 lemma DIVMOD_EXIST_0: "ALL (m::nat) n::nat.
   668    EX (x::nat) xa::nat.
   669       COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
   670   by (import hollight DIVMOD_EXIST_0)
   671 
   672 constdefs
   673   DIV :: "nat => nat => nat" 
   674   "DIV ==
   675 SOME q::nat => nat => nat.
   676    EX r::nat => nat => nat.
   677       ALL (m::nat) n::nat.
   678          COND (n = 0) (q m n = 0 & r m n = 0)
   679           (m = q m n * n + r m n & < (r m n) n)"
   680 
   681 lemma DEF_DIV: "DIV =
   682 (SOME q::nat => nat => nat.
   683     EX r::nat => nat => nat.
   684        ALL (m::nat) n::nat.
   685           COND (n = 0) (q m n = 0 & r m n = 0)
   686            (m = q m n * n + r m n & < (r m n) n))"
   687   by (import hollight DEF_DIV)
   688 
   689 constdefs
   690   MOD :: "nat => nat => nat" 
   691   "MOD ==
   692 SOME r::nat => nat => nat.
   693    ALL (m::nat) n::nat.
   694       COND (n = 0) (DIV m n = 0 & r m n = 0)
   695        (m = DIV m n * n + r m n & < (r m n) n)"
   696 
   697 lemma DEF_MOD: "MOD =
   698 (SOME r::nat => nat => nat.
   699     ALL (m::nat) n::nat.
   700        COND (n = 0) (DIV m n = 0 & r m n = 0)
   701         (m = DIV m n * n + r m n & < (r m n) n))"
   702   by (import hollight DEF_MOD)
   703 
   704 lemma DIVISION: "ALL (m::nat) n::nat. n ~= 0 --> m = DIV m n * n + MOD m n & < (MOD m n) n"
   705   by (import hollight DIVISION)
   706 
   707 lemma DIVMOD_UNIQ_LEMMA: "ALL (m::nat) (n::nat) (q1::nat) (r1::nat) (q2::nat) r2::nat.
   708    (m = q1 * n + r1 & < r1 n) & m = q2 * n + r2 & < r2 n -->
   709    q1 = q2 & r1 = r2"
   710   by (import hollight DIVMOD_UNIQ_LEMMA)
   711 
   712 lemma DIVMOD_UNIQ: "ALL (m::nat) (n::nat) (q::nat) r::nat.
   713    m = q * n + r & < r n --> DIV m n = q & MOD m n = r"
   714   by (import hollight DIVMOD_UNIQ)
   715 
   716 lemma MOD_UNIQ: "ALL (m::nat) (n::nat) (q::nat) r::nat. m = q * n + r & < r n --> MOD m n = r"
   717   by (import hollight MOD_UNIQ)
   718 
   719 lemma DIV_UNIQ: "ALL (m::nat) (n::nat) (q::nat) r::nat. m = q * n + r & < r n --> DIV m n = q"
   720   by (import hollight DIV_UNIQ)
   721 
   722 lemma MOD_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> MOD (x * xa) x = 0"
   723   by (import hollight MOD_MULT)
   724 
   725 lemma DIV_MULT: "ALL (x::nat) xa::nat. x ~= 0 --> DIV (x * xa) x = xa"
   726   by (import hollight DIV_MULT)
   727 
   728 lemma DIV_DIV: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> DIV (DIV m n) p = DIV m (n * p)"
   729   by (import hollight DIV_DIV)
   730 
   731 lemma MOD_LT: "ALL (m::nat) n::nat. < m n --> MOD m n = m"
   732   by (import hollight MOD_LT)
   733 
   734 lemma MOD_EQ: "ALL (m::nat) (n::nat) (p::nat) q::nat. m = n + q * p --> MOD m p = MOD n p"
   735   by (import hollight MOD_EQ)
   736 
   737 lemma DIV_MOD: "ALL (m::nat) (n::nat) p::nat.
   738    n * p ~= 0 --> MOD (DIV m n) p = DIV (MOD m (n * p)) n"
   739   by (import hollight DIV_MOD)
   740 
   741 lemma DIV_1: "ALL n::nat. DIV n (NUMERAL_BIT1 0) = n"
   742   by (import hollight DIV_1)
   743 
   744 lemma EXP_LT_0: "ALL (x::nat) xa::nat. < 0 (EXP xa x) = (xa ~= 0 | x = 0)"
   745   by (import hollight EXP_LT_0)
   746 
   747 lemma DIV_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (DIV m n) m"
   748   by (import hollight DIV_LE)
   749 
   750 lemma DIV_MUL_LE: "ALL (m::nat) n::nat. <= (n * DIV m n) m"
   751   by (import hollight DIV_MUL_LE)
   752 
   753 lemma DIV_0: "ALL n::nat. n ~= 0 --> DIV 0 n = 0"
   754   by (import hollight DIV_0)
   755 
   756 lemma MOD_0: "ALL n::nat. n ~= 0 --> MOD 0 n = 0"
   757   by (import hollight MOD_0)
   758 
   759 lemma DIV_LT: "ALL (m::nat) n::nat. < m n --> DIV m n = 0"
   760   by (import hollight DIV_LT)
   761 
   762 lemma MOD_MOD: "ALL (m::nat) (n::nat) p::nat. n * p ~= 0 --> MOD (MOD m (n * p)) n = MOD m n"
   763   by (import hollight MOD_MOD)
   764 
   765 lemma MOD_MOD_REFL: "ALL (m::nat) n::nat. n ~= 0 --> MOD (MOD m n) n = MOD m n"
   766   by (import hollight MOD_MOD_REFL)
   767 
   768 lemma DIV_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
   769    x * xb ~= 0 --> DIV (x * xa) (x * xb) = DIV xa xb"
   770   by (import hollight DIV_MULT2)
   771 
   772 lemma MOD_MULT2: "ALL (x::nat) (xa::nat) xb::nat.
   773    x * xb ~= 0 --> MOD (x * xa) (x * xb) = x * MOD xa xb"
   774   by (import hollight MOD_MULT2)
   775 
   776 lemma MOD_1: "ALL n::nat. MOD n (NUMERAL_BIT1 0) = 0"
   777   by (import hollight MOD_1)
   778 
   779 lemma MOD_EXISTS: "ALL (m::nat) n::nat.
   780    (EX q::nat. m = n * q) = COND (n = 0) (m = 0) (MOD m n = 0)"
   781   by (import hollight MOD_EXISTS)
   782 
   783 lemma LT_EXP: "ALL (x::nat) (m::nat) n::nat.
   784    < (EXP x m) (EXP x n) =
   785    (<= (NUMERAL_BIT0 (NUMERAL_BIT1 0)) x & < m n | x = 0 & m ~= 0 & n = 0)"
   786   by (import hollight LT_EXP)
   787 
   788 lemma LE_EXP: "ALL (x::nat) (m::nat) n::nat.
   789    <= (EXP x m) (EXP x n) =
   790    COND (x = 0) (m = 0 --> n = 0) (x = NUMERAL_BIT1 0 | <= m n)"
   791   by (import hollight LE_EXP)
   792 
   793 lemma DIV_MONO: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= m n --> <= (DIV m p) (DIV n p)"
   794   by (import hollight DIV_MONO)
   795 
   796 lemma DIV_MONO_LT: "ALL (m::nat) (n::nat) p::nat.
   797    p ~= 0 & <= (m + p) n --> < (DIV m p) (DIV n p)"
   798   by (import hollight DIV_MONO_LT)
   799 
   800 lemma LE_LDIV: "ALL (a::nat) (b::nat) n::nat. a ~= 0 & <= b (a * n) --> <= (DIV b a) n"
   801   by (import hollight LE_LDIV)
   802 
   803 lemma LE_RDIV_EQ: "ALL (a::nat) (b::nat) n::nat. a ~= 0 --> <= n (DIV b a) = <= (a * n) b"
   804   by (import hollight LE_RDIV_EQ)
   805 
   806 lemma LE_LDIV_EQ: "ALL (a::nat) (b::nat) n::nat.
   807    a ~= 0 --> <= (DIV b a) n = < b (a * (n + NUMERAL_BIT1 0))"
   808   by (import hollight LE_LDIV_EQ)
   809 
   810 lemma DIV_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (DIV m n = 0) = < m n"
   811   by (import hollight DIV_EQ_0)
   812 
   813 lemma MOD_EQ_0: "ALL (m::nat) n::nat. n ~= 0 --> (MOD m n = 0) = (EX q::nat. m = q * n)"
   814   by (import hollight MOD_EQ_0)
   815 
   816 lemma EVEN_MOD: "ALL n::nat. EVEN n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = 0)"
   817   by (import hollight EVEN_MOD)
   818 
   819 lemma ODD_MOD: "ALL n::nat. ODD n = (MOD n (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = NUMERAL_BIT1 0)"
   820   by (import hollight ODD_MOD)
   821 
   822 lemma MOD_MULT_RMOD: "ALL (m::nat) (n::nat) p::nat. n ~= 0 --> MOD (m * MOD p n) n = MOD (m * p) n"
   823   by (import hollight MOD_MULT_RMOD)
   824 
   825 lemma MOD_MULT_LMOD: "ALL (x::nat) (xa::nat) xb::nat.
   826    xa ~= 0 --> MOD (MOD x xa * xb) xa = MOD (x * xb) xa"
   827   by (import hollight MOD_MULT_LMOD)
   828 
   829 lemma MOD_MULT_MOD2: "ALL (x::nat) (xa::nat) xb::nat.
   830    xa ~= 0 --> MOD (MOD x xa * MOD xb xa) xa = MOD (x * xb) xa"
   831   by (import hollight MOD_MULT_MOD2)
   832 
   833 lemma MOD_EXP_MOD: "ALL (m::nat) (n::nat) p::nat.
   834    n ~= 0 --> MOD (EXP (MOD m n) p) n = MOD (EXP m p) n"
   835   by (import hollight MOD_EXP_MOD)
   836 
   837 lemma MOD_MULT_ADD: "ALL (m::nat) (n::nat) p::nat. MOD (m * n + p) n = MOD p n"
   838   by (import hollight MOD_MULT_ADD)
   839 
   840 lemma MOD_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
   841    n ~= 0 --> MOD (MOD a n + MOD b n) n = MOD (a + b) n"
   842   by (import hollight MOD_ADD_MOD)
   843 
   844 lemma DIV_ADD_MOD: "ALL (a::nat) (b::nat) n::nat.
   845    n ~= 0 -->
   846    (MOD (a + b) n = MOD a n + MOD b n) = (DIV (a + b) n = DIV a n + DIV b n)"
   847   by (import hollight DIV_ADD_MOD)
   848 
   849 lemma DIV_REFL: "ALL n::nat. n ~= 0 --> DIV n n = NUMERAL_BIT1 0"
   850   by (import hollight DIV_REFL)
   851 
   852 lemma MOD_LE: "ALL (m::nat) n::nat. n ~= 0 --> <= (MOD m n) m"
   853   by (import hollight MOD_LE)
   854 
   855 lemma DIV_MONO2: "ALL (m::nat) (n::nat) p::nat. p ~= 0 & <= p m --> <= (DIV n m) (DIV n p)"
   856   by (import hollight DIV_MONO2)
   857 
   858 lemma DIV_LE_EXCLUSION: "ALL (a::nat) (b::nat) (c::nat) d::nat.
   859    b ~= 0 & < (b * c) ((a + NUMERAL_BIT1 0) * d) --> <= (DIV c d) (DIV a b)"
   860   by (import hollight DIV_LE_EXCLUSION)
   861 
   862 lemma DIV_EQ_EXCLUSION: "< ((b::nat) * (c::nat)) (((a::nat) + NUMERAL_BIT1 0) * (d::nat)) &
   863 < (a * d) ((c + NUMERAL_BIT1 0) * b) -->
   864 DIV a b = DIV c d"
   865   by (import hollight DIV_EQ_EXCLUSION)
   866 
   867 lemma SUB_ELIM_THM: "(P::nat => bool) ((a::nat) - (b::nat)) =
   868 (ALL x::nat. (b = a + x --> P 0) & (a = b + x --> P x))"
   869   by (import hollight SUB_ELIM_THM)
   870 
   871 lemma PRE_ELIM_THM: "(P::nat => bool) (Pred (n::nat)) =
   872 (ALL m::nat. (n = 0 --> P 0) & (n = Suc m --> P m))"
   873   by (import hollight PRE_ELIM_THM)
   874 
   875 lemma DIVMOD_ELIM_THM: "(P::nat => nat => bool) (DIV (m::nat) (n::nat)) (MOD m n) =
   876 (n = 0 & P 0 0 |
   877  n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   878   by (import hollight DIVMOD_ELIM_THM)
   879 
   880 constdefs
   881   eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" 
   882   "eqeq ==
   883 %(u::'q_9910::type) (ua::'q_9909::type)
   884    ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
   885 
   886 lemma DEF__equal__equal_: "eqeq =
   887 (%(u::'q_9910::type) (ua::'q_9909::type)
   888     ub::'q_9910::type => 'q_9909::type => bool. ub u ua)"
   889   by (import hollight DEF__equal__equal_)
   890 
   891 constdefs
   892   mod_nat :: "nat => nat => nat => bool" 
   893   "mod_nat ==
   894 %(u::nat) (ua::nat) ub::nat. EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2"
   895 
   896 lemma DEF_mod_nat: "mod_nat =
   897 (%(u::nat) (ua::nat) ub::nat.
   898     EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2)"
   899   by (import hollight DEF_mod_nat)
   900 
   901 constdefs
   902   minimal :: "(nat => bool) => nat" 
   903   "minimal == %u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m)"
   904 
   905 lemma DEF_minimal: "minimal =
   906 (%u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m))"
   907   by (import hollight DEF_minimal)
   908 
   909 lemma MINIMAL: "ALL P::nat => bool.
   910    Ex P = (P (minimal P) & (ALL x::nat. < x (minimal P) --> ~ P x))"
   911   by (import hollight MINIMAL)
   912 
   913 constdefs
   914   WF :: "('A => 'A => bool) => bool" 
   915   "WF ==
   916 %u::'A::type => 'A::type => bool.
   917    ALL P::'A::type => bool.
   918       Ex P --> (EX x::'A::type. P x & (ALL y::'A::type. u y x --> ~ P y))"
   919 
   920 lemma DEF_WF: "WF =
   921 (%u::'A::type => 'A::type => bool.
   922     ALL P::'A::type => bool.
   923        Ex P --> (EX x::'A::type. P x & (ALL y::'A::type. u y x --> ~ P y)))"
   924   by (import hollight DEF_WF)
   925 
   926 lemma WF_EQ: "WF (u_353::'A::type => 'A::type => bool) =
   927 (ALL P::'A::type => bool.
   928     Ex P = (EX x::'A::type. P x & (ALL y::'A::type. u_353 y x --> ~ P y)))"
   929   by (import hollight WF_EQ)
   930 
   931 lemma WF_IND: "WF (u_353::'A::type => 'A::type => bool) =
   932 (ALL P::'A::type => bool.
   933     (ALL x::'A::type. (ALL y::'A::type. u_353 y x --> P y) --> P x) -->
   934     All P)"
   935   by (import hollight WF_IND)
   936 
   937 lemma WF_DCHAIN: "WF (u_353::'A::type => 'A::type => bool) =
   938 (~ (EX s::nat => 'A::type. ALL n::nat. u_353 (s (Suc n)) (s n)))"
   939   by (import hollight WF_DCHAIN)
   940 
   941 lemma WF_UREC: "WF (u_353::'A::type => 'A::type => bool) -->
   942 (ALL H::('A::type => 'B::type) => 'A::type => 'B::type.
   943     (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
   944         (ALL z::'A::type. u_353 z x --> f z = g z) --> H f x = H g x) -->
   945     (ALL (f::'A::type => 'B::type) g::'A::type => 'B::type.
   946         (ALL x::'A::type. f x = H f x) & (ALL x::'A::type. g x = H g x) -->
   947         f = g))"
   948   by (import hollight WF_UREC)
   949 
   950 lemma WF_UREC_WF: "(ALL H::('A::type => bool) => 'A::type => bool.
   951     (ALL (f::'A::type => bool) (g::'A::type => bool) x::'A::type.
   952         (ALL z::'A::type.
   953             (u_353::'A::type => 'A::type => bool) z x --> f z = g z) -->
   954         H f x = H g x) -->
   955     (ALL (f::'A::type => bool) g::'A::type => bool.
   956         (ALL x::'A::type. f x = H f x) & (ALL x::'A::type. g x = H g x) -->
   957         f = g)) -->
   958 WF u_353"
   959   by (import hollight WF_UREC_WF)
   960 
   961 lemma WF_REC_INVARIANT: "WF (u_353::'A::type => 'A::type => bool) -->
   962 (ALL (H::('A::type => 'B::type) => 'A::type => 'B::type)
   963     S::'A::type => 'B::type => bool.
   964     (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
   965         (ALL z::'A::type. u_353 z x --> f z = g z & S z (f z)) -->
   966         H f x = H g x & S x (H f x)) -->
   967     (EX f::'A::type => 'B::type. ALL x::'A::type. f x = H f x))"
   968   by (import hollight WF_REC_INVARIANT)
   969 
   970 lemma WF_REC: "WF (u_353::'A::type => 'A::type => bool) -->
   971 (ALL H::('A::type => 'B::type) => 'A::type => 'B::type.
   972     (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
   973         (ALL z::'A::type. u_353 z x --> f z = g z) --> H f x = H g x) -->
   974     (EX f::'A::type => 'B::type. ALL x::'A::type. f x = H f x))"
   975   by (import hollight WF_REC)
   976 
   977 lemma WF_REC_WF: "(ALL H::('A::type => nat) => 'A::type => nat.
   978     (ALL (f::'A::type => nat) (g::'A::type => nat) x::'A::type.
   979         (ALL z::'A::type.
   980             (u_353::'A::type => 'A::type => bool) z x --> f z = g z) -->
   981         H f x = H g x) -->
   982     (EX f::'A::type => nat. ALL x::'A::type. f x = H f x)) -->
   983 WF u_353"
   984   by (import hollight WF_REC_WF)
   985 
   986 lemma WF_EREC: "WF (u_353::'A::type => 'A::type => bool) -->
   987 (ALL H::('A::type => 'B::type) => 'A::type => 'B::type.
   988     (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
   989         (ALL z::'A::type. u_353 z x --> f z = g z) --> H f x = H g x) -->
   990     (EX! f::'A::type => 'B::type. ALL x::'A::type. f x = H f x))"
   991   by (import hollight WF_EREC)
   992 
   993 lemma WF_SUBSET: "(ALL (x::'A::type) y::'A::type.
   994     (u_353::'A::type => 'A::type => bool) x y -->
   995     (u_472::'A::type => 'A::type => bool) x y) &
   996 WF u_472 -->
   997 WF u_353"
   998   by (import hollight WF_SUBSET)
   999 
  1000 lemma WF_MEASURE_GEN: "ALL m::'A::type => 'B::type.
  1001    WF (u_353::'B::type => 'B::type => bool) -->
  1002    WF (%(x::'A::type) x'::'A::type. u_353 (m x) (m x'))"
  1003   by (import hollight WF_MEASURE_GEN)
  1004 
  1005 lemma WF_LEX_DEPENDENT: "ALL (R::'A::type => 'A::type => bool)
  1006    S::'A::type => 'B::type => 'B::type => bool.
  1007    WF R & (ALL x::'A::type. WF (S x)) -->
  1008    WF (GABS
  1009         (%f::'A::type * 'B::type => 'A::type * 'B::type => bool.
  1010             ALL (r1::'A::type) s1::'B::type.
  1011                GEQ (f (r1, s1))
  1012                 (GABS
  1013                   (%f::'A::type * 'B::type => bool.
  1014                       ALL (r2::'A::type) s2::'B::type.
  1015                          GEQ (f (r2, s2))
  1016                           (R r1 r2 | r1 = r2 & S r1 s1 s2)))))"
  1017   by (import hollight WF_LEX_DEPENDENT)
  1018 
  1019 lemma WF_LEX: "ALL (x::'A::type => 'A::type => bool) xa::'B::type => 'B::type => bool.
  1020    WF x & WF xa -->
  1021    WF (GABS
  1022         (%f::'A::type * 'B::type => 'A::type * 'B::type => bool.
  1023             ALL (r1::'A::type) s1::'B::type.
  1024                GEQ (f (r1, s1))
  1025                 (GABS
  1026                   (%f::'A::type * 'B::type => bool.
  1027                       ALL (r2::'A::type) s2::'B::type.
  1028                          GEQ (f (r2, s2)) (x r1 r2 | r1 = r2 & xa s1 s2)))))"
  1029   by (import hollight WF_LEX)
  1030 
  1031 lemma WF_POINTWISE: "WF (u_353::'A::type => 'A::type => bool) &
  1032 WF (u_472::'B::type => 'B::type => bool) -->
  1033 WF (GABS
  1034      (%f::'A::type * 'B::type => 'A::type * 'B::type => bool.
  1035          ALL (x1::'A::type) y1::'B::type.
  1036             GEQ (f (x1, y1))
  1037              (GABS
  1038                (%f::'A::type * 'B::type => bool.
  1039                    ALL (x2::'A::type) y2::'B::type.
  1040                       GEQ (f (x2, y2)) (u_353 x1 x2 & u_472 y1 y2)))))"
  1041   by (import hollight WF_POINTWISE)
  1042 
  1043 lemma WF_num: "WF <"
  1044   by (import hollight WF_num)
  1045 
  1046 lemma WF_REC_num: "ALL H::(nat => 'A::type) => nat => 'A::type.
  1047    (ALL (f::nat => 'A::type) (g::nat => 'A::type) x::nat.
  1048        (ALL z::nat. < z x --> f z = g z) --> H f x = H g x) -->
  1049    (EX f::nat => 'A::type. ALL x::nat. f x = H f x)"
  1050   by (import hollight WF_REC_num)
  1051 
  1052 consts
  1053   measure :: "('q_11107 => nat) => 'q_11107 => 'q_11107 => bool" 
  1054 
  1055 defs
  1056   measure_def: "hollight.measure ==
  1057 %(u::'q_11107::type => nat) (x::'q_11107::type) y::'q_11107::type.
  1058    < (u x) (u y)"
  1059 
  1060 lemma DEF_measure: "hollight.measure =
  1061 (%(u::'q_11107::type => nat) (x::'q_11107::type) y::'q_11107::type.
  1062     < (u x) (u y))"
  1063   by (import hollight DEF_measure)
  1064 
  1065 lemma WF_MEASURE: "ALL m::'A::type => nat. WF (hollight.measure m)"
  1066   by (import hollight WF_MEASURE)
  1067 
  1068 lemma MEASURE_LE: "(ALL x::'q_11137::type.
  1069     hollight.measure (m::'q_11137::type => nat) x (a::'q_11137::type) -->
  1070     hollight.measure m x (b::'q_11137::type)) =
  1071 <= (m a) (m b)"
  1072   by (import hollight MEASURE_LE)
  1073 
  1074 lemma WF_REFL: "ALL x::'A::type. WF (u_353::'A::type => 'A::type => bool) --> ~ u_353 x x"
  1075   by (import hollight WF_REFL)
  1076 
  1077 lemma WF_FALSE: "WF (%(x::'A::type) y::'A::type. False)"
  1078   by (import hollight WF_FALSE)
  1079 
  1080 lemma WF_REC_TAIL: "ALL (P::'A::type => bool) (g::'A::type => 'A::type) h::'A::type => 'B::type.
  1081    EX f::'A::type => 'B::type.
  1082       ALL x::'A::type. f x = COND (P x) (f (g x)) (h x)"
  1083   by (import hollight WF_REC_TAIL)
  1084 
  1085 lemma WF_REC_TAIL_GENERAL: "ALL (P::('A::type => 'B::type) => 'A::type => bool)
  1086    (G::('A::type => 'B::type) => 'A::type => 'A::type)
  1087    H::('A::type => 'B::type) => 'A::type => 'B::type.
  1088    WF (u_353::'A::type => 'A::type => bool) &
  1089    (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
  1090        (ALL z::'A::type. u_353 z x --> f z = g z) -->
  1091        P f x = P g x & G f x = G g x & H f x = H g x) &
  1092    (ALL (f::'A::type => 'B::type) (g::'A::type => 'B::type) x::'A::type.
  1093        (ALL z::'A::type. u_353 z x --> f z = g z) --> H f x = H g x) &
  1094    (ALL (f::'A::type => 'B::type) (x::'A::type) y::'A::type.
  1095        P f x & u_353 y (G f x) --> u_353 y x) -->
  1096    (EX f::'A::type => 'B::type.
  1097        ALL x::'A::type. f x = COND (P f x) (f (G f x)) (H f x))"
  1098   by (import hollight WF_REC_TAIL_GENERAL)
  1099 
  1100 lemma ARITH_ZERO: "(op &::bool => bool => bool) ((op =::nat => nat => bool) (0::nat) (0::nat))
  1101  ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) (0::nat)) (0::nat))"
  1102   by (import hollight ARITH_ZERO)
  1103 
  1104 lemma ARITH_SUC: "(ALL x::nat. Suc x = Suc x) &
  1105 Suc 0 = NUMERAL_BIT1 0 &
  1106 (ALL x::nat. Suc (NUMERAL_BIT0 x) = NUMERAL_BIT1 x) &
  1107 (ALL x::nat. Suc (NUMERAL_BIT1 x) = NUMERAL_BIT0 (Suc x))"
  1108   by (import hollight ARITH_SUC)
  1109 
  1110 lemma ARITH_PRE: "(ALL x::nat. Pred x = Pred x) &
  1111 Pred 0 = 0 &
  1112 (ALL x::nat.
  1113     Pred (NUMERAL_BIT0 x) = COND (x = 0) 0 (NUMERAL_BIT1 (Pred x))) &
  1114 (ALL x::nat. Pred (NUMERAL_BIT1 x) = NUMERAL_BIT0 x)"
  1115   by (import hollight ARITH_PRE)
  1116 
  1117 lemma ARITH_ADD: "(op &::bool => bool => bool)
  1118  ((All::(nat => bool) => bool)
  1119    (%x::nat.
  1120        (All::(nat => bool) => bool)
  1121         (%xa::nat.
  1122             (op =::nat => nat => bool) ((op +::nat => nat => nat) x xa)
  1123              ((op +::nat => nat => nat) x xa))))
  1124  ((op &::bool => bool => bool)
  1125    ((op =::nat => nat => bool) ((op +::nat => nat => nat) (0::nat) (0::nat))
  1126      (0::nat))
  1127    ((op &::bool => bool => bool)
  1128      ((All::(nat => bool) => bool)
  1129        (%x::nat.
  1130            (op =::nat => nat => bool)
  1131             ((op +::nat => nat => nat) (0::nat)
  1132               ((NUMERAL_BIT0::nat => nat) x))
  1133             ((NUMERAL_BIT0::nat => nat) x)))
  1134      ((op &::bool => bool => bool)
  1135        ((All::(nat => bool) => bool)
  1136          (%x::nat.
  1137              (op =::nat => nat => bool)
  1138               ((op +::nat => nat => nat) (0::nat)
  1139                 ((NUMERAL_BIT1::nat => nat) x))
  1140               ((NUMERAL_BIT1::nat => nat) x)))
  1141        ((op &::bool => bool => bool)
  1142          ((All::(nat => bool) => bool)
  1143            (%x::nat.
  1144                (op =::nat => nat => bool)
  1145                 ((op +::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  1146                   (0::nat))
  1147                 ((NUMERAL_BIT0::nat => nat) x)))
  1148          ((op &::bool => bool => bool)
  1149            ((All::(nat => bool) => bool)
  1150              (%x::nat.
  1151                  (op =::nat => nat => bool)
  1152                   ((op +::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  1153                     (0::nat))
  1154                   ((NUMERAL_BIT1::nat => nat) x)))
  1155            ((op &::bool => bool => bool)
  1156              ((All::(nat => bool) => bool)
  1157                (%x::nat.
  1158                    (All::(nat => bool) => bool)
  1159                     (%xa::nat.
  1160                         (op =::nat => nat => bool)
  1161                          ((op +::nat => nat => nat)
  1162                            ((NUMERAL_BIT0::nat => nat) x)
  1163                            ((NUMERAL_BIT0::nat => nat) xa))
  1164                          ((NUMERAL_BIT0::nat => nat)
  1165                            ((op +::nat => nat => nat) x xa)))))
  1166              ((op &::bool => bool => bool)
  1167                ((All::(nat => bool) => bool)
  1168                  (%x::nat.
  1169                      (All::(nat => bool) => bool)
  1170                       (%xa::nat.
  1171                           (op =::nat => nat => bool)
  1172                            ((op +::nat => nat => nat)
  1173                              ((NUMERAL_BIT0::nat => nat) x)
  1174                              ((NUMERAL_BIT1::nat => nat) xa))
  1175                            ((NUMERAL_BIT1::nat => nat)
  1176                              ((op +::nat => nat => nat) x xa)))))
  1177                ((op &::bool => bool => bool)
  1178                  ((All::(nat => bool) => bool)
  1179                    (%x::nat.
  1180                        (All::(nat => bool) => bool)
  1181                         (%xa::nat.
  1182                             (op =::nat => nat => bool)
  1183                              ((op +::nat => nat => nat)
  1184                                ((NUMERAL_BIT1::nat => nat) x)
  1185                                ((NUMERAL_BIT0::nat => nat) xa))
  1186                              ((NUMERAL_BIT1::nat => nat)
  1187                                ((op +::nat => nat => nat) x xa)))))
  1188                  ((All::(nat => bool) => bool)
  1189                    (%x::nat.
  1190                        (All::(nat => bool) => bool)
  1191                         (%xa::nat.
  1192                             (op =::nat => nat => bool)
  1193                              ((op +::nat => nat => nat)
  1194                                ((NUMERAL_BIT1::nat => nat) x)
  1195                                ((NUMERAL_BIT1::nat => nat) xa))
  1196                              ((NUMERAL_BIT0::nat => nat)
  1197                                ((Suc::nat => nat)
  1198                                  ((op +::nat => nat => nat) x
  1199                                    xa))))))))))))))"
  1200   by (import hollight ARITH_ADD)
  1201 
  1202 lemma ARITH_MULT: "(op &::bool => bool => bool)
  1203  ((All::(nat => bool) => bool)
  1204    (%x::nat.
  1205        (All::(nat => bool) => bool)
  1206         (%xa::nat.
  1207             (op =::nat => nat => bool) ((op *::nat => nat => nat) x xa)
  1208              ((op *::nat => nat => nat) x xa))))
  1209  ((op &::bool => bool => bool)
  1210    ((op =::nat => nat => bool) ((op *::nat => nat => nat) (0::nat) (0::nat))
  1211      (0::nat))
  1212    ((op &::bool => bool => bool)
  1213      ((All::(nat => bool) => bool)
  1214        (%x::nat.
  1215            (op =::nat => nat => bool)
  1216             ((op *::nat => nat => nat) (0::nat)
  1217               ((NUMERAL_BIT0::nat => nat) x))
  1218             (0::nat)))
  1219      ((op &::bool => bool => bool)
  1220        ((All::(nat => bool) => bool)
  1221          (%x::nat.
  1222              (op =::nat => nat => bool)
  1223               ((op *::nat => nat => nat) (0::nat)
  1224                 ((NUMERAL_BIT1::nat => nat) x))
  1225               (0::nat)))
  1226        ((op &::bool => bool => bool)
  1227          ((All::(nat => bool) => bool)
  1228            (%x::nat.
  1229                (op =::nat => nat => bool)
  1230                 ((op *::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  1231                   (0::nat))
  1232                 (0::nat)))
  1233          ((op &::bool => bool => bool)
  1234            ((All::(nat => bool) => bool)
  1235              (%x::nat.
  1236                  (op =::nat => nat => bool)
  1237                   ((op *::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  1238                     (0::nat))
  1239                   (0::nat)))
  1240            ((op &::bool => bool => bool)
  1241              ((All::(nat => bool) => bool)
  1242                (%x::nat.
  1243                    (All::(nat => bool) => bool)
  1244                     (%xa::nat.
  1245                         (op =::nat => nat => bool)
  1246                          ((op *::nat => nat => nat)
  1247                            ((NUMERAL_BIT0::nat => nat) x)
  1248                            ((NUMERAL_BIT0::nat => nat) xa))
  1249                          ((NUMERAL_BIT0::nat => nat)
  1250                            ((NUMERAL_BIT0::nat => nat)
  1251                              ((op *::nat => nat => nat) x xa))))))
  1252              ((op &::bool => bool => bool)
  1253                ((All::(nat => bool) => bool)
  1254                  (%x::nat.
  1255                      (All::(nat => bool) => bool)
  1256                       (%xa::nat.
  1257                           (op =::nat => nat => bool)
  1258                            ((op *::nat => nat => nat)
  1259                              ((NUMERAL_BIT0::nat => nat) x)
  1260                              ((NUMERAL_BIT1::nat => nat) xa))
  1261                            ((op +::nat => nat => nat)
  1262                              ((NUMERAL_BIT0::nat => nat) x)
  1263                              ((NUMERAL_BIT0::nat => nat)
  1264                                ((NUMERAL_BIT0::nat => nat)
  1265                                  ((op *::nat => nat => nat) x xa)))))))
  1266                ((op &::bool => bool => bool)
  1267                  ((All::(nat => bool) => bool)
  1268                    (%x::nat.
  1269                        (All::(nat => bool) => bool)
  1270                         (%xa::nat.
  1271                             (op =::nat => nat => bool)
  1272                              ((op *::nat => nat => nat)
  1273                                ((NUMERAL_BIT1::nat => nat) x)
  1274                                ((NUMERAL_BIT0::nat => nat) xa))
  1275                              ((op +::nat => nat => nat)
  1276                                ((NUMERAL_BIT0::nat => nat) xa)
  1277                                ((NUMERAL_BIT0::nat => nat)
  1278                                  ((NUMERAL_BIT0::nat => nat)
  1279                                    ((op *::nat => nat => nat) x xa)))))))
  1280                  ((All::(nat => bool) => bool)
  1281                    (%x::nat.
  1282                        (All::(nat => bool) => bool)
  1283                         (%xa::nat.
  1284                             (op =::nat => nat => bool)
  1285                              ((op *::nat => nat => nat)
  1286                                ((NUMERAL_BIT1::nat => nat) x)
  1287                                ((NUMERAL_BIT1::nat => nat) xa))
  1288                              ((op +::nat => nat => nat)
  1289                                ((NUMERAL_BIT1::nat => nat) x)
  1290                                ((op +::nat => nat => nat)
  1291                                  ((NUMERAL_BIT0::nat => nat) xa)
  1292                                  ((NUMERAL_BIT0::nat => nat)
  1293                                    ((NUMERAL_BIT0::nat => nat)
  1294                                      ((op *::nat => nat => nat) x
  1295  xa))))))))))))))))"
  1296   by (import hollight ARITH_MULT)
  1297 
  1298 lemma ARITH_EXP: "(ALL (x::nat) xa::nat. EXP x xa = EXP x xa) &
  1299 EXP 0 0 = NUMERAL_BIT1 0 &
  1300 (ALL m::nat. EXP (NUMERAL_BIT0 m) 0 = NUMERAL_BIT1 0) &
  1301 (ALL m::nat. EXP (NUMERAL_BIT1 m) 0 = NUMERAL_BIT1 0) &
  1302 (ALL n::nat. EXP 0 (NUMERAL_BIT0 n) = EXP 0 n * EXP 0 n) &
  1303 (ALL (m::nat) n::nat.
  1304     EXP (NUMERAL_BIT0 m) (NUMERAL_BIT0 n) =
  1305     EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n) &
  1306 (ALL (m::nat) n::nat.
  1307     EXP (NUMERAL_BIT1 m) (NUMERAL_BIT0 n) =
  1308     EXP (NUMERAL_BIT1 m) n * EXP (NUMERAL_BIT1 m) n) &
  1309 (ALL n::nat. EXP 0 (NUMERAL_BIT1 n) = 0) &
  1310 (ALL (m::nat) n::nat.
  1311     EXP (NUMERAL_BIT0 m) (NUMERAL_BIT1 n) =
  1312     NUMERAL_BIT0 m * (EXP (NUMERAL_BIT0 m) n * EXP (NUMERAL_BIT0 m) n)) &
  1313 (ALL (m::nat) n::nat.
  1314     EXP (NUMERAL_BIT1 m) (NUMERAL_BIT1 n) =
  1315     NUMERAL_BIT1 m * (EXP (NUMERAL_BIT1 m) n * EXP (NUMERAL_BIT1 m) n))"
  1316   by (import hollight ARITH_EXP)
  1317 
  1318 lemma ARITH_EVEN: "(ALL x::nat. EVEN x = EVEN x) &
  1319 EVEN 0 = True &
  1320 (ALL x::nat. EVEN (NUMERAL_BIT0 x) = True) &
  1321 (ALL x::nat. EVEN (NUMERAL_BIT1 x) = False)"
  1322   by (import hollight ARITH_EVEN)
  1323 
  1324 lemma ARITH_ODD: "(ALL x::nat. ODD x = ODD x) &
  1325 ODD 0 = False &
  1326 (ALL x::nat. ODD (NUMERAL_BIT0 x) = False) &
  1327 (ALL x::nat. ODD (NUMERAL_BIT1 x) = True)"
  1328   by (import hollight ARITH_ODD)
  1329 
  1330 lemma ARITH_LE: "(ALL (x::nat) xa::nat. <= x xa = <= x xa) &
  1331 <= 0 0 = True &
  1332 (ALL x::nat. <= (NUMERAL_BIT0 x) 0 = (x = 0)) &
  1333 (ALL x::nat. <= (NUMERAL_BIT1 x) 0 = False) &
  1334 (ALL x::nat. <= 0 (NUMERAL_BIT0 x) = True) &
  1335 (ALL x::nat. <= 0 (NUMERAL_BIT1 x) = True) &
  1336 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = <= x xa) &
  1337 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
  1338 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
  1339 (ALL (x::nat) xa::nat. <= (NUMERAL_BIT1 x) (NUMERAL_BIT1 xa) = <= x xa)"
  1340   by (import hollight ARITH_LE)
  1341 
  1342 lemma ARITH_LT: "(ALL (x::nat) xa::nat. < x xa = < x xa) &
  1343 < 0 0 = False &
  1344 (ALL x::nat. < (NUMERAL_BIT0 x) 0 = False) &
  1345 (ALL x::nat. < (NUMERAL_BIT1 x) 0 = False) &
  1346 (ALL x::nat. < 0 (NUMERAL_BIT0 x) = < 0 x) &
  1347 (ALL x::nat. < 0 (NUMERAL_BIT1 x) = True) &
  1348 (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT0 xa) = < x xa) &
  1349 (ALL (x::nat) xa::nat. < (NUMERAL_BIT0 x) (NUMERAL_BIT1 xa) = <= x xa) &
  1350 (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT0 xa) = < x xa) &
  1351 (ALL (x::nat) xa::nat. < (NUMERAL_BIT1 x) (NUMERAL_BIT1 xa) = < x xa)"
  1352   by (import hollight ARITH_LT)
  1353 
  1354 lemma ARITH_EQ: "(op &::bool => bool => bool)
  1355  ((All::(nat => bool) => bool)
  1356    (%x::nat.
  1357        (All::(nat => bool) => bool)
  1358         (%xa::nat.
  1359             (op =::bool => bool => bool) ((op =::nat => nat => bool) x xa)
  1360              ((op =::nat => nat => bool) x xa))))
  1361  ((op &::bool => bool => bool)
  1362    ((op =::bool => bool => bool)
  1363      ((op =::nat => nat => bool) (0::nat) (0::nat)) (True::bool))
  1364    ((op &::bool => bool => bool)
  1365      ((All::(nat => bool) => bool)
  1366        (%x::nat.
  1367            (op =::bool => bool => bool)
  1368             ((op =::nat => nat => bool) ((NUMERAL_BIT0::nat => nat) x)
  1369               (0::nat))
  1370             ((op =::nat => nat => bool) x (0::nat))))
  1371      ((op &::bool => bool => bool)
  1372        ((All::(nat => bool) => bool)
  1373          (%x::nat.
  1374              (op =::bool => bool => bool)
  1375               ((op =::nat => nat => bool) ((NUMERAL_BIT1::nat => nat) x)
  1376                 (0::nat))
  1377               (False::bool)))
  1378        ((op &::bool => bool => bool)
  1379          ((All::(nat => bool) => bool)
  1380            (%x::nat.
  1381                (op =::bool => bool => bool)
  1382                 ((op =::nat => nat => bool) (0::nat)
  1383                   ((NUMERAL_BIT0::nat => nat) x))
  1384                 ((op =::nat => nat => bool) (0::nat) x)))
  1385          ((op &::bool => bool => bool)
  1386            ((All::(nat => bool) => bool)
  1387              (%x::nat.
  1388                  (op =::bool => bool => bool)
  1389                   ((op =::nat => nat => bool) (0::nat)
  1390                     ((NUMERAL_BIT1::nat => nat) x))
  1391                   (False::bool)))
  1392            ((op &::bool => bool => bool)
  1393              ((All::(nat => bool) => bool)
  1394                (%x::nat.
  1395                    (All::(nat => bool) => bool)
  1396                     (%xa::nat.
  1397                         (op =::bool => bool => bool)
  1398                          ((op =::nat => nat => bool)
  1399                            ((NUMERAL_BIT0::nat => nat) x)
  1400                            ((NUMERAL_BIT0::nat => nat) xa))
  1401                          ((op =::nat => nat => bool) x xa))))
  1402              ((op &::bool => bool => bool)
  1403                ((All::(nat => bool) => bool)
  1404                  (%x::nat.
  1405                      (All::(nat => bool) => bool)
  1406                       (%xa::nat.
  1407                           (op =::bool => bool => bool)
  1408                            ((op =::nat => nat => bool)
  1409                              ((NUMERAL_BIT0::nat => nat) x)
  1410                              ((NUMERAL_BIT1::nat => nat) xa))
  1411                            (False::bool))))
  1412                ((op &::bool => bool => bool)
  1413                  ((All::(nat => bool) => bool)
  1414                    (%x::nat.
  1415                        (All::(nat => bool) => bool)
  1416                         (%xa::nat.
  1417                             (op =::bool => bool => bool)
  1418                              ((op =::nat => nat => bool)
  1419                                ((NUMERAL_BIT1::nat => nat) x)
  1420                                ((NUMERAL_BIT0::nat => nat) xa))
  1421                              (False::bool))))
  1422                  ((All::(nat => bool) => bool)
  1423                    (%x::nat.
  1424                        (All::(nat => bool) => bool)
  1425                         (%xa::nat.
  1426                             (op =::bool => bool => bool)
  1427                              ((op =::nat => nat => bool)
  1428                                ((NUMERAL_BIT1::nat => nat) x)
  1429                                ((NUMERAL_BIT1::nat => nat) xa))
  1430                              ((op =::nat => nat => bool) x xa))))))))))))"
  1431   by (import hollight ARITH_EQ)
  1432 
  1433 lemma ARITH_SUB: "(op &::bool => bool => bool)
  1434  ((All::(nat => bool) => bool)
  1435    (%x::nat.
  1436        (All::(nat => bool) => bool)
  1437         (%xa::nat.
  1438             (op =::nat => nat => bool) ((op -::nat => nat => nat) x xa)
  1439              ((op -::nat => nat => nat) x xa))))
  1440  ((op &::bool => bool => bool)
  1441    ((op =::nat => nat => bool) ((op -::nat => nat => nat) (0::nat) (0::nat))
  1442      (0::nat))
  1443    ((op &::bool => bool => bool)
  1444      ((All::(nat => bool) => bool)
  1445        (%x::nat.
  1446            (op =::nat => nat => bool)
  1447             ((op -::nat => nat => nat) (0::nat)
  1448               ((NUMERAL_BIT0::nat => nat) x))
  1449             (0::nat)))
  1450      ((op &::bool => bool => bool)
  1451        ((All::(nat => bool) => bool)
  1452          (%x::nat.
  1453              (op =::nat => nat => bool)
  1454               ((op -::nat => nat => nat) (0::nat)
  1455                 ((NUMERAL_BIT1::nat => nat) x))
  1456               (0::nat)))
  1457        ((op &::bool => bool => bool)
  1458          ((All::(nat => bool) => bool)
  1459            (%x::nat.
  1460                (op =::nat => nat => bool)
  1461                 ((op -::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  1462                   (0::nat))
  1463                 ((NUMERAL_BIT0::nat => nat) x)))
  1464          ((op &::bool => bool => bool)
  1465            ((All::(nat => bool) => bool)
  1466              (%x::nat.
  1467                  (op =::nat => nat => bool)
  1468                   ((op -::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  1469                     (0::nat))
  1470                   ((NUMERAL_BIT1::nat => nat) x)))
  1471            ((op &::bool => bool => bool)
  1472              ((All::(nat => bool) => bool)
  1473                (%m::nat.
  1474                    (All::(nat => bool) => bool)
  1475                     (%n::nat.
  1476                         (op =::nat => nat => bool)
  1477                          ((op -::nat => nat => nat)
  1478                            ((NUMERAL_BIT0::nat => nat) m)
  1479                            ((NUMERAL_BIT0::nat => nat) n))
  1480                          ((NUMERAL_BIT0::nat => nat)
  1481                            ((op -::nat => nat => nat) m n)))))
  1482              ((op &::bool => bool => bool)
  1483                ((All::(nat => bool) => bool)
  1484                  (%m::nat.
  1485                      (All::(nat => bool) => bool)
  1486                       (%n::nat.
  1487                           (op =::nat => nat => bool)
  1488                            ((op -::nat => nat => nat)
  1489                              ((NUMERAL_BIT0::nat => nat) m)
  1490                              ((NUMERAL_BIT1::nat => nat) n))
  1491                            ((Pred::nat => nat)
  1492                              ((NUMERAL_BIT0::nat => nat)
  1493                                ((op -::nat => nat => nat) m n))))))
  1494                ((op &::bool => bool => bool)
  1495                  ((All::(nat => bool) => bool)
  1496                    (%m::nat.
  1497                        (All::(nat => bool) => bool)
  1498                         (%n::nat.
  1499                             (op =::nat => nat => bool)
  1500                              ((op -::nat => nat => nat)
  1501                                ((NUMERAL_BIT1::nat => nat) m)
  1502                                ((NUMERAL_BIT0::nat => nat) n))
  1503                              ((COND::bool => nat => nat => nat)
  1504                                ((<=::nat => nat => bool) n m)
  1505                                ((NUMERAL_BIT1::nat => nat)
  1506                                  ((op -::nat => nat => nat) m n))
  1507                                (0::nat)))))
  1508                  ((All::(nat => bool) => bool)
  1509                    (%m::nat.
  1510                        (All::(nat => bool) => bool)
  1511                         (%n::nat.
  1512                             (op =::nat => nat => bool)
  1513                              ((op -::nat => nat => nat)
  1514                                ((NUMERAL_BIT1::nat => nat) m)
  1515                                ((NUMERAL_BIT1::nat => nat) n))
  1516                              ((NUMERAL_BIT0::nat => nat)
  1517                                ((op -::nat => nat => nat) m n)))))))))))))"
  1518   by (import hollight ARITH_SUB)
  1519 
  1520 lemma right_th: "(s::nat) * NUMERAL_BIT1 (x::nat) = s + NUMERAL_BIT0 (s * x)"
  1521   by (import hollight right_th)
  1522 
  1523 lemma SEMIRING_PTHS: "(ALL (x::'A::type) (y::'A::type) z::'A::type.
  1524     (add::'A::type => 'A::type => 'A::type) x (add y z) = add (add x y) z) &
  1525 (ALL (x::'A::type) y::'A::type. add x y = add y x) &
  1526 (ALL x::'A::type. add (r0::'A::type) x = x) &
  1527 (ALL (x::'A::type) (y::'A::type) z::'A::type.
  1528     (mul::'A::type => 'A::type => 'A::type) x (mul y z) = mul (mul x y) z) &
  1529 (ALL (x::'A::type) y::'A::type. mul x y = mul y x) &
  1530 (ALL x::'A::type. mul (r1::'A::type) x = x) &
  1531 (ALL x::'A::type. mul r0 x = r0) &
  1532 (ALL (x::'A::type) (y::'A::type) z::'A::type.
  1533     mul x (add y z) = add (mul x y) (mul x z)) &
  1534 (ALL x::'A::type. (pwr::'A::type => nat => 'A::type) x 0 = r1) &
  1535 (ALL (x::'A::type) n::nat. pwr x (Suc n) = mul x (pwr x n)) -->
  1536 mul r1 (x::'A::type) = x &
  1537 add (mul (a::'A::type) (m::'A::type)) (mul (b::'A::type) m) =
  1538 mul (add a b) m &
  1539 add (mul a m) m = mul (add a r1) m &
  1540 add m (mul a m) = mul (add a r1) m &
  1541 add m m = mul (add r1 r1) m &
  1542 mul r0 m = r0 &
  1543 add r0 a = a &
  1544 add a r0 = a &
  1545 mul a b = mul b a &
  1546 mul (add a b) (c::'A::type) = add (mul a c) (mul b c) &
  1547 mul r0 a = r0 &
  1548 mul a r0 = r0 &
  1549 mul r1 a = a &
  1550 mul a r1 = a &
  1551 mul (mul (lx::'A::type) (ly::'A::type))
  1552  (mul (rx::'A::type) (ry::'A::type)) =
  1553 mul (mul lx rx) (mul ly ry) &
  1554 mul (mul lx ly) (mul rx ry) = mul lx (mul ly (mul rx ry)) &
  1555 mul (mul lx ly) (mul rx ry) = mul rx (mul (mul lx ly) ry) &
  1556 mul (mul lx ly) rx = mul (mul lx rx) ly &
  1557 mul (mul lx ly) rx = mul lx (mul ly rx) &
  1558 mul lx rx = mul rx lx &
  1559 mul lx (mul rx ry) = mul (mul lx rx) ry &
  1560 mul lx (mul rx ry) = mul rx (mul lx ry) &
  1561 add (add a b) (add c (d::'A::type)) = add (add a c) (add b d) &
  1562 add (add a b) c = add a (add b c) &
  1563 add a (add c d) = add c (add a d) &
  1564 add (add a b) c = add (add a c) b &
  1565 add a c = add c a &
  1566 add a (add c d) = add (add a c) d &
  1567 mul (pwr x (p::nat)) (pwr x (q::nat)) = pwr x (p + q) &
  1568 mul x (pwr x q) = pwr x (Suc q) &
  1569 mul (pwr x q) x = pwr x (Suc q) &
  1570 mul x x = pwr x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) &
  1571 pwr (mul x (y::'A::type)) q = mul (pwr x q) (pwr y q) &
  1572 pwr (pwr x p) q = pwr x (p * q) &
  1573 pwr x 0 = r1 &
  1574 pwr x (NUMERAL_BIT1 0) = x &
  1575 mul x (add y (z::'A::type)) = add (mul x y) (mul x z) &
  1576 pwr x (Suc q) = mul x (pwr x q)"
  1577   by (import hollight SEMIRING_PTHS)
  1578 
  1579 lemma sth: "(ALL (x::nat) (y::nat) z::nat. x + (y + z) = x + y + z) &
  1580 (ALL (x::nat) y::nat. x + y = y + x) &
  1581 (ALL x::nat. 0 + x = x) &
  1582 (ALL (x::nat) (y::nat) z::nat. x * (y * z) = x * y * z) &
  1583 (ALL (x::nat) y::nat. x * y = y * x) &
  1584 (ALL x::nat. NUMERAL_BIT1 0 * x = x) &
  1585 (ALL x::nat. 0 * x = 0) &
  1586 (ALL (x::nat) (xa::nat) xb::nat. x * (xa + xb) = x * xa + x * xb) &
  1587 (ALL x::nat. EXP x 0 = NUMERAL_BIT1 0) &
  1588 (ALL (x::nat) xa::nat. EXP x (Suc xa) = x * EXP x xa)"
  1589   by (import hollight sth)
  1590 
  1591 lemma NUM_INTEGRAL_LEMMA: "(w::nat) = (x::nat) + (d::nat) & (y::nat) = (z::nat) + (e::nat) -->
  1592 (w * y + x * z = w * z + x * y) = (w = x | y = z)"
  1593   by (import hollight NUM_INTEGRAL_LEMMA)
  1594 
  1595 lemma NUM_INTEGRAL: "(ALL x::nat. 0 * x = 0) &
  1596 (ALL (x::nat) (xa::nat) xb::nat. (x + xa = x + xb) = (xa = xb)) &
  1597 (ALL (w::nat) (x::nat) (y::nat) z::nat.
  1598     (w * y + x * z = w * z + x * y) = (w = x | y = z))"
  1599   by (import hollight NUM_INTEGRAL)
  1600 
  1601 lemma INJ_INVERSE2: "ALL P::'A::type => 'B::type => 'C::type.
  1602    (ALL (x1::'A::type) (y1::'B::type) (x2::'A::type) y2::'B::type.
  1603        (P x1 y1 = P x2 y2) = (x1 = x2 & y1 = y2)) -->
  1604    (EX (x::'C::type => 'A::type) Y::'C::type => 'B::type.
  1605        ALL (xa::'A::type) y::'B::type. x (P xa y) = xa & Y (P xa y) = y)"
  1606   by (import hollight INJ_INVERSE2)
  1607 
  1608 constdefs
  1609   NUMPAIR :: "nat => nat => nat" 
  1610   "NUMPAIR ==
  1611 %(u::nat) ua::nat.
  1612    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  1613    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0)"
  1614 
  1615 lemma DEF_NUMPAIR: "NUMPAIR =
  1616 (%(u::nat) ua::nat.
  1617     EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  1618     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0))"
  1619   by (import hollight DEF_NUMPAIR)
  1620 
  1621 lemma NUMPAIR_INJ_LEMMA: "ALL (x::nat) (xa::nat) (xb::nat) xc::nat.
  1622    NUMPAIR x xa = NUMPAIR xb xc --> x = xb"
  1623   by (import hollight NUMPAIR_INJ_LEMMA)
  1624 
  1625 lemma NUMPAIR_INJ: "ALL (x1::nat) (y1::nat) (x2::nat) y2::nat.
  1626    (NUMPAIR x1 y1 = NUMPAIR x2 y2) = (x1 = x2 & y1 = y2)"
  1627   by (import hollight NUMPAIR_INJ)
  1628 
  1629 constdefs
  1630   NUMFST :: "nat => nat" 
  1631   "NUMFST ==
  1632 SOME X::nat => nat.
  1633    EX Y::nat => nat.
  1634       ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1635 
  1636 lemma DEF_NUMFST: "NUMFST =
  1637 (SOME X::nat => nat.
  1638     EX Y::nat => nat.
  1639        ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1640   by (import hollight DEF_NUMFST)
  1641 
  1642 constdefs
  1643   NUMSND :: "nat => nat" 
  1644   "NUMSND ==
  1645 SOME Y::nat => nat.
  1646    ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1647 
  1648 lemma DEF_NUMSND: "NUMSND =
  1649 (SOME Y::nat => nat.
  1650     ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1651   by (import hollight DEF_NUMSND)
  1652 
  1653 constdefs
  1654   NUMSUM :: "bool => nat => nat" 
  1655   "NUMSUM ==
  1656 %(u::bool) ua::nat.
  1657    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  1658     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua)"
  1659 
  1660 lemma DEF_NUMSUM: "NUMSUM =
  1661 (%(u::bool) ua::nat.
  1662     COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  1663      (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))"
  1664   by (import hollight DEF_NUMSUM)
  1665 
  1666 lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
  1667    (NUMSUM b1 x1 = NUMSUM b2 x2) = (b1 = b2 & x1 = x2)"
  1668   by (import hollight NUMSUM_INJ)
  1669 
  1670 constdefs
  1671   NUMLEFT :: "nat => bool" 
  1672   "NUMLEFT ==
  1673 SOME X::nat => bool.
  1674    EX Y::nat => nat.
  1675       ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1676 
  1677 lemma DEF_NUMLEFT: "NUMLEFT =
  1678 (SOME X::nat => bool.
  1679     EX Y::nat => nat.
  1680        ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1681   by (import hollight DEF_NUMLEFT)
  1682 
  1683 constdefs
  1684   NUMRIGHT :: "nat => nat" 
  1685   "NUMRIGHT ==
  1686 SOME Y::nat => nat.
  1687    ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1688 
  1689 lemma DEF_NUMRIGHT: "NUMRIGHT =
  1690 (SOME Y::nat => nat.
  1691     ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1692   by (import hollight DEF_NUMRIGHT)
  1693 
  1694 constdefs
  1695   INJN :: "nat => nat => 'A => bool" 
  1696   "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
  1697 
  1698 lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
  1699   by (import hollight DEF_INJN)
  1700 
  1701 lemma INJN_INJ: "(All::(nat => bool) => bool)
  1702  (%n1::nat.
  1703      (All::(nat => bool) => bool)
  1704       (%n2::nat.
  1705           (op =::bool => bool => bool)
  1706            ((op =::(nat => 'A::type => bool)
  1707                    => (nat => 'A::type => bool) => bool)
  1708              ((INJN::nat => nat => 'A::type => bool) n1)
  1709              ((INJN::nat => nat => 'A::type => bool) n2))
  1710            ((op =::nat => nat => bool) n1 n2)))"
  1711   by (import hollight INJN_INJ)
  1712 
  1713 constdefs
  1714   INJA :: "'A => nat => 'A => bool" 
  1715   "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
  1716 
  1717 lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
  1718   by (import hollight DEF_INJA)
  1719 
  1720 lemma INJA_INJ: "ALL (a1::'A::type) a2::'A::type. (INJA a1 = INJA a2) = (a1 = a2)"
  1721   by (import hollight INJA_INJ)
  1722 
  1723 constdefs
  1724   INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" 
  1725   "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
  1726 
  1727 lemma DEF_INJF: "INJF =
  1728 (%(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n))"
  1729   by (import hollight DEF_INJF)
  1730 
  1731 lemma INJF_INJ: "ALL (f1::nat => nat => 'A::type => bool) f2::nat => nat => 'A::type => bool.
  1732    (INJF f1 = INJF f2) = (f1 = f2)"
  1733   by (import hollight INJF_INJ)
  1734 
  1735 constdefs
  1736   INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" 
  1737   "INJP ==
  1738 %(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
  1739    a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a)"
  1740 
  1741 lemma DEF_INJP: "INJP =
  1742 (%(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
  1743     a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a))"
  1744   by (import hollight DEF_INJP)
  1745 
  1746 lemma INJP_INJ: "ALL (f1::nat => 'A::type => bool) (f1'::nat => 'A::type => bool)
  1747    (f2::nat => 'A::type => bool) f2'::nat => 'A::type => bool.
  1748    (INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
  1749   by (import hollight INJP_INJ)
  1750 
  1751 constdefs
  1752   ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" 
  1753   "ZCONSTR ==
  1754 %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1755    INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
  1756 
  1757 lemma DEF_ZCONSTR: "ZCONSTR =
  1758 (%(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1759     INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub)))"
  1760   by (import hollight DEF_ZCONSTR)
  1761 
  1762 constdefs
  1763   ZBOT :: "nat => 'A => bool" 
  1764   "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1765 
  1766 lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1767   by (import hollight DEF_ZBOT)
  1768 
  1769 lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'A::type) xb::nat => nat => 'A::type => bool.
  1770    ZCONSTR x xa xb ~= ZBOT"
  1771   by (import hollight ZCONSTR_ZBOT)
  1772 
  1773 constdefs
  1774   ZRECSPACE :: "(nat => 'A => bool) => bool" 
  1775   "ZRECSPACE ==
  1776 %a::nat => 'A::type => bool.
  1777    ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  1778       (ALL a::nat => 'A::type => bool.
  1779           a = ZBOT |
  1780           (EX (c::nat) (i::'A::type) r::nat => nat => 'A::type => bool.
  1781               a = ZCONSTR c i r & (ALL n::nat. ZRECSPACE' (r n))) -->
  1782           ZRECSPACE' a) -->
  1783       ZRECSPACE' a"
  1784 
  1785 lemma DEF_ZRECSPACE: "ZRECSPACE =
  1786 (%a::nat => 'A::type => bool.
  1787     ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  1788        (ALL a::nat => 'A::type => bool.
  1789            a = ZBOT |
  1790            (EX (c::nat) (i::'A::type) r::nat => nat => 'A::type => bool.
  1791                a = ZCONSTR c i r & (ALL n::nat. ZRECSPACE' (r n))) -->
  1792            ZRECSPACE' a) -->
  1793        ZRECSPACE' a)"
  1794   by (import hollight DEF_ZRECSPACE)
  1795 
  1796 typedef (open) ('A) recspace = "(Collect::((nat => 'A::type => bool) => bool)
  1797           => (nat => 'A::type => bool) set)
  1798  (ZRECSPACE::(nat => 'A::type => bool) => bool)"  morphisms "_dest_rec" "_mk_rec"
  1799   apply (rule light_ex_imp_nonempty[where t="ZBOT::nat => 'A::type => bool"])
  1800   by (import hollight TYDEF_recspace)
  1801 
  1802 syntax
  1803   "_dest_rec" :: _ ("'_dest'_rec")
  1804 
  1805 syntax
  1806   "_mk_rec" :: _ ("'_mk'_rec")
  1807 
  1808 lemmas "TYDEF_recspace_@intern" = typedef_hol2hollight 
  1809   [where a="a :: 'A recspace" and r=r ,
  1810    OF type_definition_recspace]
  1811 
  1812 constdefs
  1813   BOTTOM :: "'A recspace" 
  1814   "(op ==::'A::type recspace => 'A::type recspace => prop)
  1815  (BOTTOM::'A::type recspace)
  1816  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1817    (ZBOT::nat => 'A::type => bool))"
  1818 
  1819 lemma DEF_BOTTOM: "(op =::'A::type recspace => 'A::type recspace => bool)
  1820  (BOTTOM::'A::type recspace)
  1821  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1822    (ZBOT::nat => 'A::type => bool))"
  1823   by (import hollight DEF_BOTTOM)
  1824 
  1825 constdefs
  1826   CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" 
  1827   "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1828         => (nat
  1829             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1830            => prop)
  1831  (CONSTR::nat
  1832           => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1833  (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  1834      (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1835       ((ZCONSTR::nat
  1836                  => 'A::type
  1837                     => (nat => nat => 'A::type => bool)
  1838                        => nat => 'A::type => bool)
  1839         u ua
  1840         (%n::nat.
  1841             (_dest_rec::'A::type recspace => nat => 'A::type => bool)
  1842              (ub n))))"
  1843 
  1844 lemma DEF_CONSTR: "(op =::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1845        => (nat
  1846            => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1847           => bool)
  1848  (CONSTR::nat
  1849           => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1850  (%(u::nat) (ua::'A::type) ub::nat => 'A::type recspace.
  1851      (_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1852       ((ZCONSTR::nat
  1853                  => 'A::type
  1854                     => (nat => nat => 'A::type => bool)
  1855                        => nat => 'A::type => bool)
  1856         u ua
  1857         (%n::nat.
  1858             (_dest_rec::'A::type recspace => nat => 'A::type => bool)
  1859              (ub n))))"
  1860   by (import hollight DEF_CONSTR)
  1861 
  1862 lemma MK_REC_INJ: "(All::((nat => 'A::type => bool) => bool) => bool)
  1863  (%x::nat => 'A::type => bool.
  1864      (All::((nat => 'A::type => bool) => bool) => bool)
  1865       (%y::nat => 'A::type => bool.
  1866           (op -->::bool => bool => bool)
  1867            ((op =::'A::type recspace => 'A::type recspace => bool)
  1868              ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) x)
  1869              ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace) y))
  1870            ((op -->::bool => bool => bool)
  1871              ((op &::bool => bool => bool)
  1872                ((ZRECSPACE::(nat => 'A::type => bool) => bool) x)
  1873                ((ZRECSPACE::(nat => 'A::type => bool) => bool) y))
  1874              ((op =::(nat => 'A::type => bool)
  1875                      => (nat => 'A::type => bool) => bool)
  1876                x y))))"
  1877   by (import hollight MK_REC_INJ)
  1878 
  1879 lemma CONSTR_BOT: "ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
  1880    CONSTR c i r ~= BOTTOM"
  1881   by (import hollight CONSTR_BOT)
  1882 
  1883 lemma CONSTR_INJ: "ALL (c1::nat) (i1::'A::type) (r1::nat => 'A::type recspace) (c2::nat)
  1884    (i2::'A::type) r2::nat => 'A::type recspace.
  1885    (CONSTR c1 i1 r1 = CONSTR c2 i2 r2) = (c1 = c2 & i1 = i2 & r1 = r2)"
  1886   by (import hollight CONSTR_INJ)
  1887 
  1888 lemma CONSTR_IND: "ALL P::'A::type recspace => bool.
  1889    P BOTTOM &
  1890    (ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
  1891        (ALL n::nat. P (r n)) --> P (CONSTR c i r)) -->
  1892    All P"
  1893   by (import hollight CONSTR_IND)
  1894 
  1895 lemma CONSTR_REC: "ALL Fn::nat
  1896         => 'A::type
  1897            => (nat => 'A::type recspace) => (nat => 'B::type) => 'B::type.
  1898    EX f::'A::type recspace => 'B::type.
  1899       ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
  1900          f (CONSTR c i r) = Fn c i r (%n::nat. f (r n))"
  1901   by (import hollight CONSTR_REC)
  1902 
  1903 constdefs
  1904   FCONS :: "'A => (nat => 'A) => nat => 'A" 
  1905   "FCONS ==
  1906 SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  1907    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  1908    (ALL (a::'A::type) (f::nat => 'A::type) n::nat. FCONS a f (Suc n) = f n)"
  1909 
  1910 lemma DEF_FCONS: "FCONS =
  1911 (SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  1912     (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  1913     (ALL (a::'A::type) (f::nat => 'A::type) n::nat.
  1914         FCONS a f (Suc n) = f n))"
  1915   by (import hollight DEF_FCONS)
  1916 
  1917 lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
  1918   by (import hollight FCONS_UNDO)
  1919 
  1920 constdefs
  1921   FNIL :: "nat => 'A" 
  1922   "FNIL == %u::nat. SOME x::'A::type. True"
  1923 
  1924 lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
  1925   by (import hollight DEF_FNIL)
  1926 
  1927 consts
  1928   OUTL :: "'A + 'B => 'A" 
  1929 
  1930 defs
  1931   OUTL_def: "hollight.OUTL ==
  1932 SOME OUTL::'A::type + 'B::type => 'A::type.
  1933    ALL x::'A::type. OUTL (Inl x) = x"
  1934 
  1935 lemma DEF_OUTL: "hollight.OUTL =
  1936 (SOME OUTL::'A::type + 'B::type => 'A::type.
  1937     ALL x::'A::type. OUTL (Inl x) = x)"
  1938   by (import hollight DEF_OUTL)
  1939 
  1940 consts
  1941   OUTR :: "'A + 'B => 'B" 
  1942 
  1943 defs
  1944   OUTR_def: "hollight.OUTR ==
  1945 SOME OUTR::'A::type + 'B::type => 'B::type.
  1946    ALL y::'B::type. OUTR (Inr y) = y"
  1947 
  1948 lemma DEF_OUTR: "hollight.OUTR =
  1949 (SOME OUTR::'A::type + 'B::type => 'B::type.
  1950     ALL y::'B::type. OUTR (Inr y) = y)"
  1951   by (import hollight DEF_OUTR)
  1952 
  1953 typedef (open) ('A) option = "(Collect::('A::type recspace => bool) => 'A::type recspace set)
  1954  (%a::'A::type recspace.
  1955      (All::(('A::type recspace => bool) => bool) => bool)
  1956       (%option'::'A::type recspace => bool.
  1957           (op -->::bool => bool => bool)
  1958            ((All::('A::type recspace => bool) => bool)
  1959              (%a::'A::type recspace.
  1960                  (op -->::bool => bool => bool)
  1961                   ((op |::bool => bool => bool)
  1962                     ((op =::'A::type recspace => 'A::type recspace => bool)
  1963                       a ((CONSTR::nat
  1964                                   => 'A::type
  1965                                      => (nat => 'A::type recspace)
  1966   => 'A::type recspace)
  1967                           ((NUMERAL::nat => nat) (0::nat))
  1968                           ((Eps::('A::type => bool) => 'A::type)
  1969                             (%v::'A::type. True::bool))
  1970                           (%n::nat. BOTTOM::'A::type recspace)))
  1971                     ((Ex::('A::type => bool) => bool)
  1972                       (%aa::'A::type.
  1973                           (op =::'A::type recspace
  1974                                  => 'A::type recspace => bool)
  1975                            a ((CONSTR::nat
  1976  => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1977                                ((Suc::nat => nat)
  1978                                  ((NUMERAL::nat => nat) (0::nat)))
  1979                                aa (%n::nat. BOTTOM::'A::type recspace)))))
  1980                   (option' a)))
  1981            (option' a)))"  morphisms "_dest_option" "_mk_option"
  1982   apply (rule light_ex_imp_nonempty[where t="(CONSTR::nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1983  ((NUMERAL::nat => nat) (0::nat))
  1984  ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  1985  (%n::nat. BOTTOM::'A::type recspace)"])
  1986   by (import hollight TYDEF_option)
  1987 
  1988 syntax
  1989   "_dest_option" :: _ ("'_dest'_option")
  1990 
  1991 syntax
  1992   "_mk_option" :: _ ("'_mk'_option")
  1993 
  1994 lemmas "TYDEF_option_@intern" = typedef_hol2hollight 
  1995   [where a="a :: 'A hollight.option" and r=r ,
  1996    OF type_definition_option]
  1997 
  1998 constdefs
  1999   NONE :: "'A hollight.option" 
  2000   "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
  2001  (NONE::'A::type hollight.option)
  2002  ((_mk_option::'A::type recspace => 'A::type hollight.option)
  2003    ((CONSTR::nat
  2004              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2005      (0::nat)
  2006      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2007      (%n::nat. BOTTOM::'A::type recspace)))"
  2008 
  2009 lemma DEF_NONE: "(op =::'A::type hollight.option => 'A::type hollight.option => bool)
  2010  (NONE::'A::type hollight.option)
  2011  ((_mk_option::'A::type recspace => 'A::type hollight.option)
  2012    ((CONSTR::nat
  2013              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2014      (0::nat)
  2015      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2016      (%n::nat. BOTTOM::'A::type recspace)))"
  2017   by (import hollight DEF_NONE)
  2018 
  2019 consts
  2020   SOME :: "'A => 'A hollight.option" ("SOME")
  2021 
  2022 defs
  2023   SOME_def: "(op ==::('A::type => 'A::type hollight.option)
  2024         => ('A::type => 'A::type hollight.option) => prop)
  2025  (SOME::'A::type => 'A::type hollight.option)
  2026  (%a::'A::type.
  2027      (_mk_option::'A::type recspace => 'A::type hollight.option)
  2028       ((CONSTR::nat
  2029                 => 'A::type
  2030                    => (nat => 'A::type recspace) => 'A::type recspace)
  2031         ((Suc::nat => nat) (0::nat)) a
  2032         (%n::nat. BOTTOM::'A::type recspace)))"
  2033 
  2034 lemma DEF_SOME: "(op =::('A::type => 'A::type hollight.option)
  2035        => ('A::type => 'A::type hollight.option) => bool)
  2036  (SOME::'A::type => 'A::type hollight.option)
  2037  (%a::'A::type.
  2038      (_mk_option::'A::type recspace => 'A::type hollight.option)
  2039       ((CONSTR::nat
  2040                 => 'A::type
  2041                    => (nat => 'A::type recspace) => 'A::type recspace)
  2042         ((Suc::nat => nat) (0::nat)) a
  2043         (%n::nat. BOTTOM::'A::type recspace)))"
  2044   by (import hollight DEF_SOME)
  2045 
  2046 typedef (open) ('A) list = "(Collect::('A::type recspace => bool) => 'A::type recspace set)
  2047  (%a::'A::type recspace.
  2048      (All::(('A::type recspace => bool) => bool) => bool)
  2049       (%list'::'A::type recspace => bool.
  2050           (op -->::bool => bool => bool)
  2051            ((All::('A::type recspace => bool) => bool)
  2052              (%a::'A::type recspace.
  2053                  (op -->::bool => bool => bool)
  2054                   ((op |::bool => bool => bool)
  2055                     ((op =::'A::type recspace => 'A::type recspace => bool)
  2056                       a ((CONSTR::nat
  2057                                   => 'A::type
  2058                                      => (nat => 'A::type recspace)
  2059   => 'A::type recspace)
  2060                           ((NUMERAL::nat => nat) (0::nat))
  2061                           ((Eps::('A::type => bool) => 'A::type)
  2062                             (%v::'A::type. True::bool))
  2063                           (%n::nat. BOTTOM::'A::type recspace)))
  2064                     ((Ex::('A::type => bool) => bool)
  2065                       (%a0::'A::type.
  2066                           (Ex::('A::type recspace => bool) => bool)
  2067                            (%a1::'A::type recspace.
  2068                                (op &::bool => bool => bool)
  2069                                 ((op =::'A::type recspace
  2070   => 'A::type recspace => bool)
  2071                                   a ((CONSTR::nat
  2072         => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2073 ((Suc::nat => nat) ((NUMERAL::nat => nat) (0::nat))) a0
  2074 ((FCONS::'A::type recspace
  2075          => (nat => 'A::type recspace) => nat => 'A::type recspace)
  2076   a1 (%n::nat. BOTTOM::'A::type recspace))))
  2077                                 (list' a1)))))
  2078                   (list' a)))
  2079            (list' a)))"  morphisms "_dest_list" "_mk_list"
  2080   apply (rule light_ex_imp_nonempty[where t="(CONSTR::nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2081  ((NUMERAL::nat => nat) (0::nat))
  2082  ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2083  (%n::nat. BOTTOM::'A::type recspace)"])
  2084   by (import hollight TYDEF_list)
  2085 
  2086 syntax
  2087   "_dest_list" :: _ ("'_dest'_list")
  2088 
  2089 syntax
  2090   "_mk_list" :: _ ("'_mk'_list")
  2091 
  2092 lemmas "TYDEF_list_@intern" = typedef_hol2hollight 
  2093   [where a="a :: 'A hollight.list" and r=r ,
  2094    OF type_definition_list]
  2095 
  2096 constdefs
  2097   NIL :: "'A hollight.list" 
  2098   "(op ==::'A::type hollight.list => 'A::type hollight.list => prop)
  2099  (NIL::'A::type hollight.list)
  2100  ((_mk_list::'A::type recspace => 'A::type hollight.list)
  2101    ((CONSTR::nat
  2102              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2103      (0::nat)
  2104      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2105      (%n::nat. BOTTOM::'A::type recspace)))"
  2106 
  2107 lemma DEF_NIL: "(op =::'A::type hollight.list => 'A::type hollight.list => bool)
  2108  (NIL::'A::type hollight.list)
  2109  ((_mk_list::'A::type recspace => 'A::type hollight.list)
  2110    ((CONSTR::nat
  2111              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2112      (0::nat)
  2113      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2114      (%n::nat. BOTTOM::'A::type recspace)))"
  2115   by (import hollight DEF_NIL)
  2116 
  2117 constdefs
  2118   CONS :: "'A => 'A hollight.list => 'A hollight.list" 
  2119   "(op ==::('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2120         => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2121            => prop)
  2122  (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
  2123  (%(a0::'A::type) a1::'A::type hollight.list.
  2124      (_mk_list::'A::type recspace => 'A::type hollight.list)
  2125       ((CONSTR::nat
  2126                 => 'A::type
  2127                    => (nat => 'A::type recspace) => 'A::type recspace)
  2128         ((Suc::nat => nat) (0::nat)) a0
  2129         ((FCONS::'A::type recspace
  2130                  => (nat => 'A::type recspace) => nat => 'A::type recspace)
  2131           ((_dest_list::'A::type hollight.list => 'A::type recspace) a1)
  2132           (%n::nat. BOTTOM::'A::type recspace))))"
  2133 
  2134 lemma DEF_CONS: "(op =::('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2135        => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2136           => bool)
  2137  (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
  2138  (%(a0::'A::type) a1::'A::type hollight.list.
  2139      (_mk_list::'A::type recspace => 'A::type hollight.list)
  2140       ((CONSTR::nat
  2141                 => 'A::type
  2142                    => (nat => 'A::type recspace) => 'A::type recspace)
  2143         ((Suc::nat => nat) (0::nat)) a0
  2144         ((FCONS::'A::type recspace
  2145                  => (nat => 'A::type recspace) => nat => 'A::type recspace)
  2146           ((_dest_list::'A::type hollight.list => 'A::type recspace) a1)
  2147           (%n::nat. BOTTOM::'A::type recspace))))"
  2148   by (import hollight DEF_CONS)
  2149 
  2150 lemma pair_RECURSION: "ALL PAIR'::'A::type => 'B::type => 'C::type.
  2151    EX x::'A::type * 'B::type => 'C::type.
  2152       ALL (a0::'A::type) a1::'B::type. x (a0, a1) = PAIR' a0 a1"
  2153   by (import hollight pair_RECURSION)
  2154 
  2155 lemma num_RECURSION_STD: "ALL (e::'Z::type) f::nat => 'Z::type => 'Z::type.
  2156    EX fn::nat => 'Z::type. fn 0 = e & (ALL n::nat. fn (Suc n) = f n (fn n))"
  2157   by (import hollight num_RECURSION_STD)
  2158 
  2159 lemma bool_RECURSION: "ALL (a::'A::type) b::'A::type.
  2160    EX x::bool => 'A::type. x False = a & x True = b"
  2161   by (import hollight bool_RECURSION)
  2162 
  2163 constdefs
  2164   ISO :: "('A => 'B) => ('B => 'A) => bool" 
  2165   "ISO ==
  2166 %(u::'A::type => 'B::type) ua::'B::type => 'A::type.
  2167    (ALL x::'B::type. u (ua x) = x) & (ALL y::'A::type. ua (u y) = y)"
  2168 
  2169 lemma DEF_ISO: "ISO =
  2170 (%(u::'A::type => 'B::type) ua::'B::type => 'A::type.
  2171     (ALL x::'B::type. u (ua x) = x) & (ALL y::'A::type. ua (u y) = y))"
  2172   by (import hollight DEF_ISO)
  2173 
  2174 lemma ISO_REFL: "ISO (%x::'A::type. x) (%x::'A::type. x)"
  2175   by (import hollight ISO_REFL)
  2176 
  2177 lemma ISO_FUN: "ISO (f::'A::type => 'A'::type) (f'::'A'::type => 'A::type) &
  2178 ISO (g::'B::type => 'B'::type) (g'::'B'::type => 'B::type) -->
  2179 ISO (%(h::'A::type => 'B::type) a'::'A'::type. g (h (f' a')))
  2180  (%(h::'A'::type => 'B'::type) a::'A::type. g' (h (f a)))"
  2181   by (import hollight ISO_FUN)
  2182 
  2183 lemma ISO_USAGE: "ISO (f::'q_16636::type => 'q_16633::type)
  2184  (g::'q_16633::type => 'q_16636::type) -->
  2185 (ALL P::'q_16636::type => bool. All P = (ALL x::'q_16633::type. P (g x))) &
  2186 (ALL P::'q_16636::type => bool. Ex P = (EX x::'q_16633::type. P (g x))) &
  2187 (ALL (a::'q_16636::type) b::'q_16633::type. (a = g b) = (f a = b))"
  2188   by (import hollight ISO_USAGE)
  2189 
  2190 typedef (open) N_2 = "{a::bool recspace.
  2191  ALL u::bool recspace => bool.
  2192     (ALL a::bool recspace.
  2193         a = CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM) |
  2194         a =
  2195         CONSTR (Suc (NUMERAL 0)) (SOME x::bool. True) (%n::nat. BOTTOM) -->
  2196         u a) -->
  2197     u a}"  morphisms "_dest_2" "_mk_2"
  2198   apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM)"])
  2199   by (import hollight TYDEF_2)
  2200 
  2201 syntax
  2202   "_dest_2" :: _ ("'_dest'_2")
  2203 
  2204 syntax
  2205   "_mk_2" :: _ ("'_mk'_2")
  2206 
  2207 lemmas "TYDEF_2_@intern" = typedef_hol2hollight 
  2208   [where a="a :: N_2" and r=r ,
  2209    OF type_definition_N_2]
  2210 
  2211 consts
  2212   "_10302" :: "N_2" ("'_10302")
  2213 
  2214 defs
  2215   "_10302_def": "(op ==::N_2 => N_2 => prop) (_10302::N_2)
  2216  ((_mk_2::bool recspace => N_2)
  2217    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2218      (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2219      (%n::nat. BOTTOM::bool recspace)))"
  2220 
  2221 lemma DEF__10302: "(op =::N_2 => N_2 => bool) (_10302::N_2)
  2222  ((_mk_2::bool recspace => N_2)
  2223    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2224      (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2225      (%n::nat. BOTTOM::bool recspace)))"
  2226   by (import hollight DEF__10302)
  2227 
  2228 consts
  2229   "_10303" :: "N_2" ("'_10303")
  2230 
  2231 defs
  2232   "_10303_def": "(op ==::N_2 => N_2 => prop) (_10303::N_2)
  2233  ((_mk_2::bool recspace => N_2)
  2234    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2235      ((Suc::nat => nat) (0::nat))
  2236      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2237      (%n::nat. BOTTOM::bool recspace)))"
  2238 
  2239 lemma DEF__10303: "(op =::N_2 => N_2 => bool) (_10303::N_2)
  2240  ((_mk_2::bool recspace => N_2)
  2241    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2242      ((Suc::nat => nat) (0::nat))
  2243      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2244      (%n::nat. BOTTOM::bool recspace)))"
  2245   by (import hollight DEF__10303)
  2246 
  2247 constdefs
  2248   two_1 :: "N_2" 
  2249   "two_1 == _10302"
  2250 
  2251 lemma DEF_two_1: "two_1 = _10302"
  2252   by (import hollight DEF_two_1)
  2253 
  2254 constdefs
  2255   two_2 :: "N_2" 
  2256   "two_2 == _10303"
  2257 
  2258 lemma DEF_two_2: "two_2 = _10303"
  2259   by (import hollight DEF_two_2)
  2260 
  2261 typedef (open) N_3 = "{a::bool recspace.
  2262  ALL u::bool recspace => bool.
  2263     (ALL a::bool recspace.
  2264         a = CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM) |
  2265         a =
  2266         CONSTR (Suc (NUMERAL 0)) (SOME x::bool. True) (%n::nat. BOTTOM) |
  2267         a =
  2268         CONSTR (Suc (Suc (NUMERAL 0))) (SOME x::bool. True)
  2269          (%n::nat. BOTTOM) -->
  2270         u a) -->
  2271     u a}"  morphisms "_dest_3" "_mk_3"
  2272   apply (rule light_ex_imp_nonempty[where t="CONSTR (NUMERAL 0) (SOME x::bool. True) (%n::nat. BOTTOM)"])
  2273   by (import hollight TYDEF_3)
  2274 
  2275 syntax
  2276   "_dest_3" :: _ ("'_dest'_3")
  2277 
  2278 syntax
  2279   "_mk_3" :: _ ("'_mk'_3")
  2280 
  2281 lemmas "TYDEF_3_@intern" = typedef_hol2hollight 
  2282   [where a="a :: N_3" and r=r ,
  2283    OF type_definition_N_3]
  2284 
  2285 consts
  2286   "_10326" :: "N_3" ("'_10326")
  2287 
  2288 defs
  2289   "_10326_def": "(op ==::N_3 => N_3 => prop) (_10326::N_3)
  2290  ((_mk_3::bool recspace => N_3)
  2291    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2292      (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2293      (%n::nat. BOTTOM::bool recspace)))"
  2294 
  2295 lemma DEF__10326: "(op =::N_3 => N_3 => bool) (_10326::N_3)
  2296  ((_mk_3::bool recspace => N_3)
  2297    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2298      (0::nat) ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2299      (%n::nat. BOTTOM::bool recspace)))"
  2300   by (import hollight DEF__10326)
  2301 
  2302 consts
  2303   "_10327" :: "N_3" ("'_10327")
  2304 
  2305 defs
  2306   "_10327_def": "(op ==::N_3 => N_3 => prop) (_10327::N_3)
  2307  ((_mk_3::bool recspace => N_3)
  2308    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2309      ((Suc::nat => nat) (0::nat))
  2310      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2311      (%n::nat. BOTTOM::bool recspace)))"
  2312 
  2313 lemma DEF__10327: "(op =::N_3 => N_3 => bool) (_10327::N_3)
  2314  ((_mk_3::bool recspace => N_3)
  2315    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2316      ((Suc::nat => nat) (0::nat))
  2317      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2318      (%n::nat. BOTTOM::bool recspace)))"
  2319   by (import hollight DEF__10327)
  2320 
  2321 consts
  2322   "_10328" :: "N_3" ("'_10328")
  2323 
  2324 defs
  2325   "_10328_def": "(op ==::N_3 => N_3 => prop) (_10328::N_3)
  2326  ((_mk_3::bool recspace => N_3)
  2327    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2328      ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
  2329      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2330      (%n::nat. BOTTOM::bool recspace)))"
  2331 
  2332 lemma DEF__10328: "(op =::N_3 => N_3 => bool) (_10328::N_3)
  2333  ((_mk_3::bool recspace => N_3)
  2334    ((CONSTR::nat => bool => (nat => bool recspace) => bool recspace)
  2335      ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
  2336      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2337      (%n::nat. BOTTOM::bool recspace)))"
  2338   by (import hollight DEF__10328)
  2339 
  2340 constdefs
  2341   three_1 :: "N_3" 
  2342   "three_1 == _10326"
  2343 
  2344 lemma DEF_three_1: "three_1 = _10326"
  2345   by (import hollight DEF_three_1)
  2346 
  2347 constdefs
  2348   three_2 :: "N_3" 
  2349   "three_2 == _10327"
  2350 
  2351 lemma DEF_three_2: "three_2 = _10327"
  2352   by (import hollight DEF_three_2)
  2353 
  2354 constdefs
  2355   three_3 :: "N_3" 
  2356   "three_3 == _10328"
  2357 
  2358 lemma DEF_three_3: "three_3 = _10328"
  2359   by (import hollight DEF_three_3)
  2360 
  2361 lemma list_INDUCT: "ALL P::'A::type hollight.list => bool.
  2362    P NIL &
  2363    (ALL (a0::'A::type) a1::'A::type hollight.list.
  2364        P a1 --> P (CONS a0 a1)) -->
  2365    All P"
  2366   by (import hollight list_INDUCT)
  2367 
  2368 constdefs
  2369   HD :: "'A hollight.list => 'A" 
  2370   "HD ==
  2371 SOME HD::'A::type hollight.list => 'A::type.
  2372    ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h"
  2373 
  2374 lemma DEF_HD: "HD =
  2375 (SOME HD::'A::type hollight.list => 'A::type.
  2376     ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h)"
  2377   by (import hollight DEF_HD)
  2378 
  2379 constdefs
  2380   TL :: "'A hollight.list => 'A hollight.list" 
  2381   "TL ==
  2382 SOME TL::'A::type hollight.list => 'A::type hollight.list.
  2383    ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t"
  2384 
  2385 lemma DEF_TL: "TL =
  2386 (SOME TL::'A::type hollight.list => 'A::type hollight.list.
  2387     ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t)"
  2388   by (import hollight DEF_TL)
  2389 
  2390 constdefs
  2391   APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" 
  2392   "APPEND ==
  2393 SOME APPEND::'A::type hollight.list
  2394              => 'A::type hollight.list => 'A::type hollight.list.
  2395    (ALL l::'A::type hollight.list. APPEND NIL l = l) &
  2396    (ALL (h::'A::type) (t::'A::type hollight.list) l::'A::type hollight.list.
  2397        APPEND (CONS h t) l = CONS h (APPEND t l))"
  2398 
  2399 lemma DEF_APPEND: "APPEND =
  2400 (SOME APPEND::'A::type hollight.list
  2401               => 'A::type hollight.list => 'A::type hollight.list.
  2402     (ALL l::'A::type hollight.list. APPEND NIL l = l) &
  2403     (ALL (h::'A::type) (t::'A::type hollight.list)
  2404         l::'A::type hollight.list.
  2405         APPEND (CONS h t) l = CONS h (APPEND t l)))"
  2406   by (import hollight DEF_APPEND)
  2407 
  2408 constdefs
  2409   REVERSE :: "'A hollight.list => 'A hollight.list" 
  2410   "REVERSE ==
  2411 SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
  2412    REVERSE NIL = NIL &
  2413    (ALL (l::'A::type hollight.list) x::'A::type.
  2414        REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL))"
  2415 
  2416 lemma DEF_REVERSE: "REVERSE =
  2417 (SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
  2418     REVERSE NIL = NIL &
  2419     (ALL (l::'A::type hollight.list) x::'A::type.
  2420         REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL)))"
  2421   by (import hollight DEF_REVERSE)
  2422 
  2423 constdefs
  2424   LENGTH :: "'A hollight.list => nat" 
  2425   "LENGTH ==
  2426 SOME LENGTH::'A::type hollight.list => nat.
  2427    LENGTH NIL = 0 &
  2428    (ALL (h::'A::type) t::'A::type hollight.list.
  2429        LENGTH (CONS h t) = Suc (LENGTH t))"
  2430 
  2431 lemma DEF_LENGTH: "LENGTH =
  2432 (SOME LENGTH::'A::type hollight.list => nat.
  2433     LENGTH NIL = 0 &
  2434     (ALL (h::'A::type) t::'A::type hollight.list.
  2435         LENGTH (CONS h t) = Suc (LENGTH t)))"
  2436   by (import hollight DEF_LENGTH)
  2437 
  2438 constdefs
  2439   MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" 
  2440   "MAP ==
  2441 SOME MAP::('A::type => 'B::type)
  2442           => 'A::type hollight.list => 'B::type hollight.list.
  2443    (ALL f::'A::type => 'B::type. MAP f NIL = NIL) &
  2444    (ALL (f::'A::type => 'B::type) (h::'A::type) t::'A::type hollight.list.
  2445        MAP f (CONS h t) = CONS (f h) (MAP f t))"
  2446 
  2447 lemma DEF_MAP: "MAP =
  2448 (SOME MAP::('A::type => 'B::type)
  2449            => 'A::type hollight.list => 'B::type hollight.list.
  2450     (ALL f::'A::type => 'B::type. MAP f NIL = NIL) &
  2451     (ALL (f::'A::type => 'B::type) (h::'A::type) t::'A::type hollight.list.
  2452         MAP f (CONS h t) = CONS (f h) (MAP f t)))"
  2453   by (import hollight DEF_MAP)
  2454 
  2455 constdefs
  2456   LAST :: "'A hollight.list => 'A" 
  2457   "LAST ==
  2458 SOME LAST::'A::type hollight.list => 'A::type.
  2459    ALL (h::'A::type) t::'A::type hollight.list.
  2460       LAST (CONS h t) = COND (t = NIL) h (LAST t)"
  2461 
  2462 lemma DEF_LAST: "LAST =
  2463 (SOME LAST::'A::type hollight.list => 'A::type.
  2464     ALL (h::'A::type) t::'A::type hollight.list.
  2465        LAST (CONS h t) = COND (t = NIL) h (LAST t))"
  2466   by (import hollight DEF_LAST)
  2467 
  2468 constdefs
  2469   REPLICATE :: "nat => 'q_16860 => 'q_16860 hollight.list" 
  2470   "REPLICATE ==
  2471 SOME REPLICATE::nat => 'q_16860::type => 'q_16860::type hollight.list.
  2472    (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2473    (ALL (n::nat) x::'q_16860::type.
  2474        REPLICATE (Suc n) x = CONS x (REPLICATE n x))"
  2475 
  2476 lemma DEF_REPLICATE: "REPLICATE =
  2477 (SOME REPLICATE::nat => 'q_16860::type => 'q_16860::type hollight.list.
  2478     (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2479     (ALL (n::nat) x::'q_16860::type.
  2480         REPLICATE (Suc n) x = CONS x (REPLICATE n x)))"
  2481   by (import hollight DEF_REPLICATE)
  2482 
  2483 constdefs
  2484   NULL :: "'q_16875 hollight.list => bool" 
  2485   "NULL ==
  2486 SOME NULL::'q_16875::type hollight.list => bool.
  2487    NULL NIL = True &
  2488    (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2489        NULL (CONS h t) = False)"
  2490 
  2491 lemma DEF_NULL: "NULL =
  2492 (SOME NULL::'q_16875::type hollight.list => bool.
  2493     NULL NIL = True &
  2494     (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2495         NULL (CONS h t) = False))"
  2496   by (import hollight DEF_NULL)
  2497 
  2498 constdefs
  2499   ALL_list :: "('q_16895 => bool) => 'q_16895 hollight.list => bool" 
  2500   "ALL_list ==
  2501 SOME u::('q_16895::type => bool) => 'q_16895::type hollight.list => bool.
  2502    (ALL P::'q_16895::type => bool. u P NIL = True) &
  2503    (ALL (h::'q_16895::type) (P::'q_16895::type => bool)
  2504        t::'q_16895::type hollight.list. u P (CONS h t) = (P h & u P t))"
  2505 
  2506 lemma DEF_ALL: "ALL_list =
  2507 (SOME u::('q_16895::type => bool) => 'q_16895::type hollight.list => bool.
  2508     (ALL P::'q_16895::type => bool. u P NIL = True) &
  2509     (ALL (h::'q_16895::type) (P::'q_16895::type => bool)
  2510         t::'q_16895::type hollight.list. u P (CONS h t) = (P h & u P t)))"
  2511   by (import hollight DEF_ALL)
  2512 
  2513 consts
  2514   EX :: "('q_16916 => bool) => 'q_16916 hollight.list => bool" ("EX")
  2515 
  2516 defs
  2517   EX_def: "EX ==
  2518 SOME u::('q_16916::type => bool) => 'q_16916::type hollight.list => bool.
  2519    (ALL P::'q_16916::type => bool. u P NIL = False) &
  2520    (ALL (h::'q_16916::type) (P::'q_16916::type => bool)
  2521        t::'q_16916::type hollight.list. u P (CONS h t) = (P h | u P t))"
  2522 
  2523 lemma DEF_EX: "EX =
  2524 (SOME u::('q_16916::type => bool) => 'q_16916::type hollight.list => bool.
  2525     (ALL P::'q_16916::type => bool. u P NIL = False) &
  2526     (ALL (h::'q_16916::type) (P::'q_16916::type => bool)
  2527         t::'q_16916::type hollight.list. u P (CONS h t) = (P h | u P t)))"
  2528   by (import hollight DEF_EX)
  2529 
  2530 constdefs
  2531   ITLIST :: "('q_16939 => 'q_16938 => 'q_16938)
  2532 => 'q_16939 hollight.list => 'q_16938 => 'q_16938" 
  2533   "ITLIST ==
  2534 SOME ITLIST::('q_16939::type => 'q_16938::type => 'q_16938::type)
  2535              => 'q_16939::type hollight.list
  2536                 => 'q_16938::type => 'q_16938::type.
  2537    (ALL (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2538        b::'q_16938::type. ITLIST f NIL b = b) &
  2539    (ALL (h::'q_16939::type)
  2540        (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2541        (t::'q_16939::type hollight.list) b::'q_16938::type.
  2542        ITLIST f (CONS h t) b = f h (ITLIST f t b))"
  2543 
  2544 lemma DEF_ITLIST: "ITLIST =
  2545 (SOME ITLIST::('q_16939::type => 'q_16938::type => 'q_16938::type)
  2546               => 'q_16939::type hollight.list
  2547                  => 'q_16938::type => 'q_16938::type.
  2548     (ALL (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2549         b::'q_16938::type. ITLIST f NIL b = b) &
  2550     (ALL (h::'q_16939::type)
  2551         (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2552         (t::'q_16939::type hollight.list) b::'q_16938::type.
  2553         ITLIST f (CONS h t) b = f h (ITLIST f t b)))"
  2554   by (import hollight DEF_ITLIST)
  2555 
  2556 constdefs
  2557   MEM :: "'q_16964 => 'q_16964 hollight.list => bool" 
  2558   "MEM ==
  2559 SOME MEM::'q_16964::type => 'q_16964::type hollight.list => bool.
  2560    (ALL x::'q_16964::type. MEM x NIL = False) &
  2561    (ALL (h::'q_16964::type) (x::'q_16964::type)
  2562        t::'q_16964::type hollight.list.
  2563        MEM x (CONS h t) = (x = h | MEM x t))"
  2564 
  2565 lemma DEF_MEM: "MEM =
  2566 (SOME MEM::'q_16964::type => 'q_16964::type hollight.list => bool.
  2567     (ALL x::'q_16964::type. MEM x NIL = False) &
  2568     (ALL (h::'q_16964::type) (x::'q_16964::type)
  2569         t::'q_16964::type hollight.list.
  2570         MEM x (CONS h t) = (x = h | MEM x t)))"
  2571   by (import hollight DEF_MEM)
  2572 
  2573 constdefs
  2574   ALL2 :: "('q_16997 => 'q_17004 => bool)
  2575 => 'q_16997 hollight.list => 'q_17004 hollight.list => bool" 
  2576   "ALL2 ==
  2577 SOME ALL2::('q_16997::type => 'q_17004::type => bool)
  2578            => 'q_16997::type hollight.list
  2579               => 'q_17004::type hollight.list => bool.
  2580    (ALL (P::'q_16997::type => 'q_17004::type => bool)
  2581        l2::'q_17004::type hollight.list. ALL2 P NIL l2 = (l2 = NIL)) &
  2582    (ALL (h1::'q_16997::type) (P::'q_16997::type => 'q_17004::type => bool)
  2583        (t1::'q_16997::type hollight.list) l2::'q_17004::type hollight.list.
  2584        ALL2 P (CONS h1 t1) l2 =
  2585        COND (l2 = NIL) False (P h1 (HD l2) & ALL2 P t1 (TL l2)))"
  2586 
  2587 lemma DEF_ALL2: "ALL2 =
  2588 (SOME ALL2::('q_16997::type => 'q_17004::type => bool)
  2589             => 'q_16997::type hollight.list
  2590                => 'q_17004::type hollight.list => bool.
  2591     (ALL (P::'q_16997::type => 'q_17004::type => bool)
  2592         l2::'q_17004::type hollight.list. ALL2 P NIL l2 = (l2 = NIL)) &
  2593     (ALL (h1::'q_16997::type) (P::'q_16997::type => 'q_17004::type => bool)
  2594         (t1::'q_16997::type hollight.list) l2::'q_17004::type hollight.list.
  2595         ALL2 P (CONS h1 t1) l2 =
  2596         COND (l2 = NIL) False (P h1 (HD l2) & ALL2 P t1 (TL l2))))"
  2597   by (import hollight DEF_ALL2)
  2598 
  2599 lemma ALL2: "ALL2 (P::'q_17059::type => 'q_17058::type => bool) NIL NIL = True &
  2600 ALL2 P (CONS (h1::'q_17059::type) (t1::'q_17059::type hollight.list)) NIL =
  2601 False &
  2602 ALL2 P NIL (CONS (h2::'q_17058::type) (t2::'q_17058::type hollight.list)) =
  2603 False &
  2604 ALL2 P (CONS h1 t1) (CONS h2 t2) = (P h1 h2 & ALL2 P t1 t2)"
  2605   by (import hollight ALL2)
  2606 
  2607 constdefs
  2608   MAP2 :: "('q_17089 => 'q_17096 => 'q_17086)
  2609 => 'q_17089 hollight.list
  2610    => 'q_17096 hollight.list => 'q_17086 hollight.list" 
  2611   "MAP2 ==
  2612 SOME MAP2::('q_17089::type => 'q_17096::type => 'q_17086::type)
  2613            => 'q_17089::type hollight.list
  2614               => 'q_17096::type hollight.list
  2615                  => 'q_17086::type hollight.list.
  2616    (ALL (f::'q_17089::type => 'q_17096::type => 'q_17086::type)
  2617        l::'q_17096::type hollight.list. MAP2 f NIL l = NIL) &
  2618    (ALL (h1::'q_17089::type)
  2619        (f::'q_17089::type => 'q_17096::type => 'q_17086::type)
  2620        (t1::'q_17089::type hollight.list) l::'q_17096::type hollight.list.
  2621        MAP2 f (CONS h1 t1) l = CONS (f h1 (HD l)) (MAP2 f t1 (TL l)))"
  2622 
  2623 lemma DEF_MAP2: "MAP2 =
  2624 (SOME MAP2::('q_17089::type => 'q_17096::type => 'q_17086::type)
  2625             => 'q_17089::type hollight.list
  2626                => 'q_17096::type hollight.list
  2627                   => 'q_17086::type hollight.list.
  2628     (ALL (f::'q_17089::type => 'q_17096::type => 'q_17086::type)
  2629         l::'q_17096::type hollight.list. MAP2 f NIL l = NIL) &
  2630     (ALL (h1::'q_17089::type)
  2631         (f::'q_17089::type => 'q_17096::type => 'q_17086::type)
  2632         (t1::'q_17089::type hollight.list) l::'q_17096::type hollight.list.
  2633         MAP2 f (CONS h1 t1) l = CONS (f h1 (HD l)) (MAP2 f t1 (TL l))))"
  2634   by (import hollight DEF_MAP2)
  2635 
  2636 lemma MAP2: "MAP2 (f::'q_17131::type => 'q_17130::type => 'q_17137::type) NIL NIL = NIL &
  2637 MAP2 f (CONS (h1::'q_17131::type) (t1::'q_17131::type hollight.list))
  2638  (CONS (h2::'q_17130::type) (t2::'q_17130::type hollight.list)) =
  2639 CONS (f h1 h2) (MAP2 f t1 t2)"
  2640   by (import hollight MAP2)
  2641 
  2642 constdefs
  2643   EL :: "nat => 'q_17157 hollight.list => 'q_17157" 
  2644   "EL ==
  2645 SOME EL::nat => 'q_17157::type hollight.list => 'q_17157::type.
  2646    (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2647    (ALL (n::nat) l::'q_17157::type hollight.list.
  2648        EL (Suc n) l = EL n (TL l))"
  2649 
  2650 lemma DEF_EL: "EL =
  2651 (SOME EL::nat => 'q_17157::type hollight.list => 'q_17157::type.
  2652     (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2653     (ALL (n::nat) l::'q_17157::type hollight.list.
  2654         EL (Suc n) l = EL n (TL l)))"
  2655   by (import hollight DEF_EL)
  2656 
  2657 constdefs
  2658   FILTER :: "('q_17182 => bool) => 'q_17182 hollight.list => 'q_17182 hollight.list" 
  2659   "FILTER ==
  2660 SOME FILTER::('q_17182::type => bool)
  2661              => 'q_17182::type hollight.list
  2662                 => 'q_17182::type hollight.list.
  2663    (ALL P::'q_17182::type => bool. FILTER P NIL = NIL) &
  2664    (ALL (h::'q_17182::type) (P::'q_17182::type => bool)
  2665        t::'q_17182::type hollight.list.
  2666        FILTER P (CONS h t) = COND (P h) (CONS h (FILTER P t)) (FILTER P t))"
  2667 
  2668 lemma DEF_FILTER: "FILTER =
  2669 (SOME FILTER::('q_17182::type => bool)
  2670               => 'q_17182::type hollight.list
  2671                  => 'q_17182::type hollight.list.
  2672     (ALL P::'q_17182::type => bool. FILTER P NIL = NIL) &
  2673     (ALL (h::'q_17182::type) (P::'q_17182::type => bool)
  2674         t::'q_17182::type hollight.list.
  2675         FILTER P (CONS h t) =
  2676         COND (P h) (CONS h (FILTER P t)) (FILTER P t)))"
  2677   by (import hollight DEF_FILTER)
  2678 
  2679 constdefs
  2680   ASSOC :: "'q_17211 => ('q_17211 * 'q_17205) hollight.list => 'q_17205" 
  2681   "ASSOC ==
  2682 SOME ASSOC::'q_17211::type
  2683             => ('q_17211::type * 'q_17205::type) hollight.list
  2684                => 'q_17205::type.
  2685    ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2686       t::('q_17211::type * 'q_17205::type) hollight.list.
  2687       ASSOC a (CONS h t) = COND (fst h = a) (snd h) (ASSOC a t)"
  2688 
  2689 lemma DEF_ASSOC: "ASSOC =
  2690 (SOME ASSOC::'q_17211::type
  2691              => ('q_17211::type * 'q_17205::type) hollight.list
  2692                 => 'q_17205::type.
  2693     ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2694        t::('q_17211::type * 'q_17205::type) hollight.list.
  2695        ASSOC a (CONS h t) = COND (fst h = a) (snd h) (ASSOC a t))"
  2696   by (import hollight DEF_ASSOC)
  2697 
  2698 constdefs
  2699   ITLIST2 :: "('q_17235 => 'q_17243 => 'q_17233 => 'q_17233)
  2700 => 'q_17235 hollight.list => 'q_17243 hollight.list => 'q_17233 => 'q_17233" 
  2701   "ITLIST2 ==
  2702 SOME ITLIST2::('q_17235::type
  2703                => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2704               => 'q_17235::type hollight.list
  2705                  => 'q_17243::type hollight.list
  2706                     => 'q_17233::type => 'q_17233::type.
  2707    (ALL (f::'q_17235::type
  2708             => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2709        (l2::'q_17243::type hollight.list) b::'q_17233::type.
  2710        ITLIST2 f NIL l2 b = b) &
  2711    (ALL (h1::'q_17235::type)
  2712        (f::'q_17235::type
  2713            => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2714        (t1::'q_17235::type hollight.list) (l2::'q_17243::type hollight.list)
  2715        b::'q_17233::type.
  2716        ITLIST2 f (CONS h1 t1) l2 b = f h1 (HD l2) (ITLIST2 f t1 (TL l2) b))"
  2717 
  2718 lemma DEF_ITLIST2: "ITLIST2 =
  2719 (SOME ITLIST2::('q_17235::type
  2720                 => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2721                => 'q_17235::type hollight.list
  2722                   => 'q_17243::type hollight.list
  2723                      => 'q_17233::type => 'q_17233::type.
  2724     (ALL (f::'q_17235::type
  2725              => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2726         (l2::'q_17243::type hollight.list) b::'q_17233::type.
  2727         ITLIST2 f NIL l2 b = b) &
  2728     (ALL (h1::'q_17235::type)
  2729         (f::'q_17235::type
  2730             => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2731         (t1::'q_17235::type hollight.list)
  2732         (l2::'q_17243::type hollight.list) b::'q_17233::type.
  2733         ITLIST2 f (CONS h1 t1) l2 b =
  2734         f h1 (HD l2) (ITLIST2 f t1 (TL l2) b)))"
  2735   by (import hollight DEF_ITLIST2)
  2736 
  2737 lemma ITLIST2: "ITLIST2
  2738  (f::'q_17277::type => 'q_17276::type => 'q_17275::type => 'q_17275::type)
  2739  NIL NIL (b::'q_17275::type) =
  2740 b &
  2741 ITLIST2 f (CONS (h1::'q_17277::type) (t1::'q_17277::type hollight.list))
  2742  (CONS (h2::'q_17276::type) (t2::'q_17276::type hollight.list)) b =
  2743 f h1 h2 (ITLIST2 f t1 t2 b)"
  2744   by (import hollight ITLIST2)
  2745 
  2746 consts
  2747   ZIP :: "'q_17307 hollight.list
  2748 => 'q_17315 hollight.list => ('q_17307 * 'q_17315) hollight.list" 
  2749 
  2750 defs
  2751   ZIP_def: "hollight.ZIP ==
  2752 SOME ZIP::'q_17307::type hollight.list
  2753           => 'q_17315::type hollight.list
  2754              => ('q_17307::type * 'q_17315::type) hollight.list.
  2755    (ALL l2::'q_17315::type hollight.list. ZIP NIL l2 = NIL) &
  2756    (ALL (h1::'q_17307::type) (t1::'q_17307::type hollight.list)
  2757        l2::'q_17315::type hollight.list.
  2758        ZIP (CONS h1 t1) l2 = CONS (h1, HD l2) (ZIP t1 (TL l2)))"
  2759 
  2760 lemma DEF_ZIP: "hollight.ZIP =
  2761 (SOME ZIP::'q_17307::type hollight.list
  2762            => 'q_17315::type hollight.list
  2763               => ('q_17307::type * 'q_17315::type) hollight.list.
  2764     (ALL l2::'q_17315::type hollight.list. ZIP NIL l2 = NIL) &
  2765     (ALL (h1::'q_17307::type) (t1::'q_17307::type hollight.list)
  2766         l2::'q_17315::type hollight.list.
  2767         ZIP (CONS h1 t1) l2 = CONS (h1, HD l2) (ZIP t1 (TL l2))))"
  2768   by (import hollight DEF_ZIP)
  2769 
  2770 lemma ZIP: "(op &::bool => bool => bool)
  2771  ((op =::('q_17326::type * 'q_17327::type) hollight.list
  2772          => ('q_17326::type * 'q_17327::type) hollight.list => bool)
  2773    ((hollight.ZIP::'q_17326::type hollight.list
  2774                    => 'q_17327::type hollight.list
  2775                       => ('q_17326::type * 'q_17327::type) hollight.list)
  2776      (NIL::'q_17326::type hollight.list)
  2777      (NIL::'q_17327::type hollight.list))
  2778    (NIL::('q_17326::type * 'q_17327::type) hollight.list))
  2779  ((op =::('q_17351::type * 'q_17352::type) hollight.list
  2780          => ('q_17351::type * 'q_17352::type) hollight.list => bool)
  2781    ((hollight.ZIP::'q_17351::type hollight.list
  2782                    => 'q_17352::type hollight.list
  2783                       => ('q_17351::type * 'q_17352::type) hollight.list)
  2784      ((CONS::'q_17351::type
  2785              => 'q_17351::type hollight.list
  2786                 => 'q_17351::type hollight.list)
  2787        (h1::'q_17351::type) (t1::'q_17351::type hollight.list))
  2788      ((CONS::'q_17352::type
  2789              => 'q_17352::type hollight.list
  2790                 => 'q_17352::type hollight.list)
  2791        (h2::'q_17352::type) (t2::'q_17352::type hollight.list)))
  2792    ((CONS::'q_17351::type * 'q_17352::type
  2793            => ('q_17351::type * 'q_17352::type) hollight.list
  2794               => ('q_17351::type * 'q_17352::type) hollight.list)
  2795      ((Pair::'q_17351::type
  2796              => 'q_17352::type => 'q_17351::type * 'q_17352::type)
  2797        h1 h2)
  2798      ((hollight.ZIP::'q_17351::type hollight.list
  2799                      => 'q_17352::type hollight.list
  2800                         => ('q_17351::type * 'q_17352::type) hollight.list)
  2801        t1 t2)))"
  2802   by (import hollight ZIP)
  2803 
  2804 lemma NOT_CONS_NIL: "ALL (x::'A::type) xa::'A::type hollight.list. CONS x xa ~= NIL"
  2805   by (import hollight NOT_CONS_NIL)
  2806 
  2807 lemma LAST_CLAUSES: "LAST (CONS (h::'A::type) NIL) = h &
  2808 LAST (CONS h (CONS (k::'A::type) (t::'A::type hollight.list))) =
  2809 LAST (CONS k t)"
  2810   by (import hollight LAST_CLAUSES)
  2811 
  2812 lemma APPEND_NIL: "ALL l::'A::type hollight.list. APPEND l NIL = l"
  2813   by (import hollight APPEND_NIL)
  2814 
  2815 lemma APPEND_ASSOC: "ALL (l::'A::type hollight.list) (m::'A::type hollight.list)
  2816    n::'A::type hollight.list. APPEND l (APPEND m n) = APPEND (APPEND l m) n"
  2817   by (import hollight APPEND_ASSOC)
  2818 
  2819 lemma REVERSE_APPEND: "ALL (l::'A::type hollight.list) m::'A::type hollight.list.
  2820    REVERSE (APPEND l m) = APPEND (REVERSE m) (REVERSE l)"
  2821   by (import hollight REVERSE_APPEND)
  2822 
  2823 lemma REVERSE_REVERSE: "ALL l::'A::type hollight.list. REVERSE (REVERSE l) = l"
  2824   by (import hollight REVERSE_REVERSE)
  2825 
  2826 lemma CONS_11: "ALL (x::'A::type) (xa::'A::type) (xb::'A::type hollight.list)
  2827    xc::'A::type hollight.list. (CONS x xb = CONS xa xc) = (x = xa & xb = xc)"
  2828   by (import hollight CONS_11)
  2829 
  2830 lemma list_CASES: "ALL l::'A::type hollight.list.
  2831    l = NIL | (EX (h::'A::type) t::'A::type hollight.list. l = CONS h t)"
  2832   by (import hollight list_CASES)
  2833 
  2834 lemma LENGTH_APPEND: "ALL (l::'A::type hollight.list) m::'A::type hollight.list.
  2835    LENGTH (APPEND l m) = LENGTH l + LENGTH m"
  2836   by (import hollight LENGTH_APPEND)
  2837 
  2838 lemma MAP_APPEND: "ALL (f::'A::type => 'B::type) (l1::'A::type hollight.list)
  2839    l2::'A::type hollight.list.
  2840    MAP f (APPEND l1 l2) = APPEND (MAP f l1) (MAP f l2)"
  2841   by (import hollight MAP_APPEND)
  2842 
  2843 lemma LENGTH_MAP: "ALL (l::'A::type hollight.list) f::'A::type => 'B::type.
  2844    LENGTH (MAP f l) = LENGTH l"
  2845   by (import hollight LENGTH_MAP)
  2846 
  2847 lemma LENGTH_EQ_NIL: "ALL l::'A::type hollight.list. (LENGTH l = 0) = (l = NIL)"
  2848   by (import hollight LENGTH_EQ_NIL)
  2849 
  2850 lemma LENGTH_EQ_CONS: "ALL (l::'q_17659::type hollight.list) n::nat.
  2851    (LENGTH l = Suc n) =
  2852    (EX (h::'q_17659::type) t::'q_17659::type hollight.list.
  2853        l = CONS h t & LENGTH t = n)"
  2854   by (import hollight LENGTH_EQ_CONS)
  2855 
  2856 lemma MAP_o: "ALL (f::'A::type => 'B::type) (g::'B::type => 'C::type)
  2857    l::'A::type hollight.list. MAP (g o f) l = MAP g (MAP f l)"
  2858   by (import hollight MAP_o)
  2859 
  2860 lemma MAP_EQ: "ALL (f::'q_17723::type => 'q_17734::type)
  2861    (g::'q_17723::type => 'q_17734::type) l::'q_17723::type hollight.list.
  2862    ALL_list (%x::'q_17723::type. f x = g x) l --> MAP f l = MAP g l"
  2863   by (import hollight MAP_EQ)
  2864 
  2865 lemma ALL_IMP: "ALL (P::'q_17764::type => bool) (Q::'q_17764::type => bool)
  2866    l::'q_17764::type hollight.list.
  2867    (ALL x::'q_17764::type. MEM x l & P x --> Q x) & ALL_list P l -->
  2868    ALL_list Q l"
  2869   by (import hollight ALL_IMP)
  2870 
  2871 lemma NOT_EX: "ALL (P::'q_17792::type => bool) l::'q_17792::type hollight.list.
  2872    (~ EX P l) = ALL_list (%x::'q_17792::type. ~ P x) l"
  2873   by (import hollight NOT_EX)
  2874 
  2875 lemma NOT_ALL: "ALL (P::'q_17814::type => bool) l::'q_17814::type hollight.list.
  2876    (~ ALL_list P l) = EX (%x::'q_17814::type. ~ P x) l"
  2877   by (import hollight NOT_ALL)
  2878 
  2879 lemma ALL_MAP: "ALL (P::'q_17836::type => bool) (f::'q_17835::type => 'q_17836::type)
  2880    l::'q_17835::type hollight.list.
  2881    ALL_list P (MAP f l) = ALL_list (P o f) l"
  2882   by (import hollight ALL_MAP)
  2883 
  2884 lemma ALL_T: "All (ALL_list (%x::'q_17854::type. True))"
  2885   by (import hollight ALL_T)
  2886 
  2887 lemma MAP_EQ_ALL2: "ALL (l::'q_17879::type hollight.list) m::'q_17879::type hollight.list.
  2888    ALL2
  2889     (%(x::'q_17879::type) y::'q_17879::type.
  2890         (f::'q_17879::type => 'q_17890::type) x = f y)
  2891     l m -->
  2892    MAP f l = MAP f m"
  2893   by (import hollight MAP_EQ_ALL2)
  2894 
  2895 lemma ALL2_MAP: "ALL (P::'q_17921::type => 'q_17922::type => bool)
  2896    (f::'q_17922::type => 'q_17921::type) l::'q_17922::type hollight.list.
  2897    ALL2 P (MAP f l) l = ALL_list (%a::'q_17922::type. P (f a) a) l"
  2898   by (import hollight ALL2_MAP)
  2899 
  2900 lemma MAP_EQ_DEGEN: "ALL (l::'q_17939::type hollight.list) f::'q_17939::type => 'q_17939::type.
  2901    ALL_list (%x::'q_17939::type. f x = x) l --> MAP f l = l"
  2902   by (import hollight MAP_EQ_DEGEN)
  2903 
  2904 lemma ALL2_AND_RIGHT: "ALL (l::'q_17982::type hollight.list) (m::'q_17981::type hollight.list)
  2905    (P::'q_17982::type => bool) Q::'q_17982::type => 'q_17981::type => bool.
  2906    ALL2 (%(x::'q_17982::type) y::'q_17981::type. P x & Q x y) l m =
  2907    (ALL_list P l & ALL2 Q l m)"
  2908   by (import hollight ALL2_AND_RIGHT)
  2909 
  2910 lemma ITLIST_EXTRA: "ALL l::'q_18019::type hollight.list.
  2911    ITLIST (f::'q_18019::type => 'q_18018::type => 'q_18018::type)
  2912     (APPEND l (CONS (a::'q_18019::type) NIL)) (b::'q_18018::type) =
  2913    ITLIST f l (f a b)"
  2914   by (import hollight ITLIST_EXTRA)
  2915 
  2916 lemma ALL_MP: "ALL (P::'q_18045::type => bool) (Q::'q_18045::type => bool)
  2917    l::'q_18045::type hollight.list.
  2918    ALL_list (%x::'q_18045::type. P x --> Q x) l & ALL_list P l -->
  2919    ALL_list Q l"
  2920   by (import hollight ALL_MP)
  2921 
  2922 lemma AND_ALL: "ALL x::'q_18075::type hollight.list.
  2923    (ALL_list (P::'q_18075::type => bool) x &
  2924     ALL_list (Q::'q_18075::type => bool) x) =
  2925    ALL_list (%x::'q_18075::type. P x & Q x) x"
  2926   by (import hollight AND_ALL)
  2927 
  2928 lemma EX_IMP: "ALL (P::'q_18105::type => bool) (Q::'q_18105::type => bool)
  2929    l::'q_18105::type hollight.list.
  2930    (ALL x::'q_18105::type. MEM x l & P x --> Q x) & EX P l --> EX Q l"
  2931   by (import hollight EX_IMP)
  2932 
  2933 lemma ALL_MEM: "ALL (P::'q_18132::type => bool) l::'q_18132::type hollight.list.
  2934    (ALL x::'q_18132::type. MEM x l --> P x) = ALL_list P l"
  2935   by (import hollight ALL_MEM)
  2936 
  2937 lemma LENGTH_REPLICATE: "ALL (n::nat) x::'q_18150::type. LENGTH (REPLICATE n x) = n"
  2938   by (import hollight LENGTH_REPLICATE)
  2939 
  2940 lemma EX_MAP: "ALL (P::'q_18174::type => bool) (f::'q_18173::type => 'q_18174::type)
  2941    l::'q_18173::type hollight.list. EX P (MAP f l) = EX (P o f) l"
  2942   by (import hollight EX_MAP)
  2943 
  2944 lemma EXISTS_EX: "ALL (P::'q_18212::type => 'q_18211::type => bool)
  2945    l::'q_18211::type hollight.list.
  2946    (EX x::'q_18212::type. EX (P x) l) =
  2947    EX (%s::'q_18211::type. EX x::'q_18212::type. P x s) l"
  2948   by (import hollight EXISTS_EX)
  2949 
  2950 lemma FORALL_ALL: "ALL (P::'q_18242::type => 'q_18241::type => bool)
  2951    l::'q_18241::type hollight.list.
  2952    (ALL x::'q_18242::type. ALL_list (P x) l) =
  2953    ALL_list (%s::'q_18241::type. ALL x::'q_18242::type. P x s) l"
  2954   by (import hollight FORALL_ALL)
  2955 
  2956 lemma MEM_APPEND: "ALL (x::'q_18270::type) (l1::'q_18270::type hollight.list)
  2957    l2::'q_18270::type hollight.list.
  2958    MEM x (APPEND l1 l2) = (MEM x l1 | MEM x l2)"
  2959   by (import hollight MEM_APPEND)
  2960 
  2961 lemma MEM_MAP: "ALL (f::'q_18306::type => 'q_18303::type) (y::'q_18303::type)
  2962    l::'q_18306::type hollight.list.
  2963    MEM y (MAP f l) = (EX x::'q_18306::type. MEM x l & y = f x)"
  2964   by (import hollight MEM_MAP)
  2965 
  2966 lemma FILTER_APPEND: "ALL (P::'q_18337::type => bool) (l1::'q_18337::type hollight.list)
  2967    l2::'q_18337::type hollight.list.
  2968    FILTER P (APPEND l1 l2) = APPEND (FILTER P l1) (FILTER P l2)"
  2969   by (import hollight FILTER_APPEND)
  2970 
  2971 lemma FILTER_MAP: "ALL (P::'q_18364::type => bool) (f::'q_18371::type => 'q_18364::type)
  2972    l::'q_18371::type hollight.list.
  2973    FILTER P (MAP f l) = MAP f (FILTER (P o f) l)"
  2974   by (import hollight FILTER_MAP)
  2975 
  2976 lemma MEM_FILTER: "ALL (P::'q_18398::type => bool) (l::'q_18398::type hollight.list)
  2977    x::'q_18398::type. MEM x (FILTER P l) = (P x & MEM x l)"
  2978   by (import hollight MEM_FILTER)
  2979 
  2980 lemma EX_MEM: "ALL (P::'q_18419::type => bool) l::'q_18419::type hollight.list.
  2981    (EX x::'q_18419::type. P x & MEM x l) = EX P l"
  2982   by (import hollight EX_MEM)
  2983 
  2984 lemma MAP_FST_ZIP: "ALL (l1::'q_18439::type hollight.list) l2::'q_18441::type hollight.list.
  2985    LENGTH l1 = LENGTH l2 --> MAP fst (hollight.ZIP l1 l2) = l1"
  2986   by (import hollight MAP_FST_ZIP)
  2987 
  2988 lemma MAP_SND_ZIP: "ALL (l1::'q_18470::type hollight.list) l2::'q_18472::type hollight.list.
  2989    LENGTH l1 = LENGTH l2 --> MAP snd (hollight.ZIP l1 l2) = l2"
  2990   by (import hollight MAP_SND_ZIP)
  2991 
  2992 lemma MEM_ASSOC: "ALL (l::('q_18516::type * 'q_18500::type) hollight.list) x::'q_18516::type.
  2993    MEM (x, ASSOC x l) l = MEM x (MAP fst l)"
  2994   by (import hollight MEM_ASSOC)
  2995 
  2996 lemma ALL_APPEND: "ALL (P::'q_18537::type => bool) (l1::'q_18537::type hollight.list)
  2997    l2::'q_18537::type hollight.list.
  2998    ALL_list P (APPEND l1 l2) = (ALL_list P l1 & ALL_list P l2)"
  2999   by (import hollight ALL_APPEND)
  3000 
  3001 lemma MEM_EL: "ALL (l::'q_18560::type hollight.list) n::nat.
  3002    < n (LENGTH l) --> MEM (EL n l) l"
  3003   by (import hollight MEM_EL)
  3004 
  3005 lemma ALL2_MAP2: "ALL (l::'q_18603::type hollight.list) m::'q_18604::type hollight.list.
  3006    ALL2 (P::'q_18602::type => 'q_18601::type => bool)
  3007     (MAP (f::'q_18603::type => 'q_18602::type) l)
  3008     (MAP (g::'q_18604::type => 'q_18601::type) m) =
  3009    ALL2 (%(x::'q_18603::type) y::'q_18604::type. P (f x) (g y)) l m"
  3010   by (import hollight ALL2_MAP2)
  3011 
  3012 lemma AND_ALL2: "ALL (P::'q_18650::type => 'q_18649::type => bool)
  3013    (Q::'q_18650::type => 'q_18649::type => bool)
  3014    (x::'q_18650::type hollight.list) xa::'q_18649::type hollight.list.
  3015    (ALL2 P x xa & ALL2 Q x xa) =
  3016    ALL2 (%(x::'q_18650::type) y::'q_18649::type. P x y & Q x y) x xa"
  3017   by (import hollight AND_ALL2)
  3018 
  3019 lemma ALL2_ALL: "ALL (P::'q_18672::type => 'q_18672::type => bool)
  3020    l::'q_18672::type hollight.list.
  3021    ALL2 P l l = ALL_list (%x::'q_18672::type. P x x) l"
  3022   by (import hollight ALL2_ALL)
  3023 
  3024 lemma APPEND_EQ_NIL: "ALL (x::'q_18701::type hollight.list) xa::'q_18701::type hollight.list.
  3025    (APPEND x xa = NIL) = (x = NIL & xa = NIL)"
  3026   by (import hollight APPEND_EQ_NIL)
  3027 
  3028 lemma LENGTH_MAP2: "ALL (f::'q_18721::type => 'q_18723::type => 'q_18734::type)
  3029    (l::'q_18721::type hollight.list) m::'q_18723::type hollight.list.
  3030    LENGTH l = LENGTH m --> LENGTH (MAP2 f l m) = LENGTH m"
  3031   by (import hollight LENGTH_MAP2)
  3032 
  3033 lemma MONO_ALL: "(ALL x::'A::type. (P::'A::type => bool) x --> (Q::'A::type => bool) x) -->
  3034 ALL_list P (l::'A::type hollight.list) --> ALL_list Q l"
  3035   by (import hollight MONO_ALL)
  3036 
  3037 lemma MONO_ALL2: "(ALL (x::'A::type) y::'B::type.
  3038     (P::'A::type => 'B::type => bool) x y -->
  3039     (Q::'A::type => 'B::type => bool) x y) -->
  3040 ALL2 P (l::'A::type hollight.list) (l'::'B::type hollight.list) -->
  3041 ALL2 Q l l'"
  3042   by (import hollight MONO_ALL2)
  3043 
  3044 constdefs
  3045   dist :: "nat * nat => nat" 
  3046   "dist == %u::nat * nat. fst u - snd u + (snd u - fst u)"
  3047 
  3048 lemma DEF_dist: "dist = (%u::nat * nat. fst u - snd u + (snd u - fst u))"
  3049   by (import hollight DEF_dist)
  3050 
  3051 lemma DIST_REFL: "ALL x::nat. dist (x, x) = 0"
  3052   by (import hollight DIST_REFL)
  3053 
  3054 lemma DIST_LZERO: "ALL x::nat. dist (0, x) = x"
  3055   by (import hollight DIST_LZERO)
  3056 
  3057 lemma DIST_RZERO: "ALL x::nat. dist (x, 0) = x"
  3058   by (import hollight DIST_RZERO)
  3059 
  3060 lemma DIST_SYM: "ALL (x::nat) xa::nat. dist (x, xa) = dist (xa, x)"
  3061   by (import hollight DIST_SYM)
  3062 
  3063 lemma DIST_LADD: "ALL (x::nat) (xa::nat) xb::nat. dist (x + xb, x + xa) = dist (xb, xa)"
  3064   by (import hollight DIST_LADD)
  3065 
  3066 lemma DIST_RADD: "ALL (x::nat) (xa::nat) xb::nat. dist (x + xa, xb + xa) = dist (x, xb)"
  3067   by (import hollight DIST_RADD)
  3068 
  3069 lemma DIST_LADD_0: "ALL (x::nat) xa::nat. dist (x + xa, x) = xa"
  3070   by (import hollight DIST_LADD_0)
  3071 
  3072 lemma DIST_RADD_0: "ALL (x::nat) xa::nat. dist (x, x + xa) = xa"
  3073   by (import hollight DIST_RADD_0)
  3074 
  3075 lemma DIST_LMUL: "ALL (x::nat) (xa::nat) xb::nat. x * dist (xa, xb) = dist (x * xa, x * xb)"
  3076   by (import hollight DIST_LMUL)
  3077 
  3078 lemma DIST_RMUL: "ALL (x::nat) (xa::nat) xb::nat. dist (x, xa) * xb = dist (x * xb, xa * xb)"
  3079   by (import hollight DIST_RMUL)
  3080 
  3081 lemma DIST_EQ_0: "ALL (x::nat) xa::nat. (dist (x, xa) = 0) = (x = xa)"
  3082   by (import hollight DIST_EQ_0)
  3083 
  3084 lemma DIST_ELIM_THM: "(P::nat => bool) (dist (x::nat, y::nat)) =
  3085 (ALL d::nat. (x = y + d --> P d) & (y = x + d --> P d))"
  3086   by (import hollight DIST_ELIM_THM)
  3087 
  3088 lemma DIST_LE_CASES: "ALL (m::nat) (n::nat) p::nat.
  3089    <= (dist (m, n)) p = (<= m (n + p) & <= n (m + p))"
  3090   by (import hollight DIST_LE_CASES)
  3091 
  3092 lemma DIST_ADDBOUND: "ALL (m::nat) n::nat. <= (dist (m, n)) (m + n)"
  3093   by (import hollight DIST_ADDBOUND)
  3094 
  3095 lemma DIST_TRIANGLE: "ALL (m::nat) (n::nat) p::nat. <= (dist (m, p)) (dist (m, n) + dist (n, p))"
  3096   by (import hollight DIST_TRIANGLE)
  3097 
  3098 lemma DIST_ADD2: "ALL (m::nat) (n::nat) (p::nat) q::nat.
  3099    <= (dist (m + n, p + q)) (dist (m, p) + dist (n, q))"
  3100   by (import hollight DIST_ADD2)
  3101 
  3102 lemma DIST_ADD2_REV: "ALL (m::nat) (n::nat) (p::nat) q::nat.
  3103    <= (dist (m, p)) (dist (m + n, p + q) + dist (n, q))"
  3104   by (import hollight DIST_ADD2_REV)
  3105 
  3106 lemma DIST_TRIANGLE_LE: "ALL (m::nat) (n::nat) (p::nat) q::nat.
  3107    <= (dist (m, n) + dist (n, p)) q --> <= (dist (m, p)) q"
  3108   by (import hollight DIST_TRIANGLE_LE)
  3109 
  3110 lemma DIST_TRIANGLES_LE: "ALL (m::nat) (n::nat) (p::nat) (q::nat) (r::nat) s::nat.
  3111    <= (dist (m, n)) r & <= (dist (p, q)) s -->
  3112    <= (dist (m, p)) (dist (n, q) + (r + s))"
  3113   by (import hollight DIST_TRIANGLES_LE)
  3114 
  3115 lemma BOUNDS_LINEAR: "ALL (A::nat) (B::nat) C::nat. (ALL n::nat. <= (A * n) (B * n + C)) = <= A B"
  3116   by (import hollight BOUNDS_LINEAR)
  3117 
  3118 lemma BOUNDS_LINEAR_0: "ALL (A::nat) B::nat. (ALL n::nat. <= (A * n) B) = (A = 0)"
  3119   by (import hollight BOUNDS_LINEAR_0)
  3120 
  3121 lemma BOUNDS_DIVIDED: "ALL P::nat => nat.
  3122    (EX B::nat. ALL n::nat. <= (P n) B) =
  3123    (EX (x::nat) B::nat. ALL n::nat. <= (n * P n) (x * n + B))"
  3124   by (import hollight BOUNDS_DIVIDED)
  3125 
  3126 lemma BOUNDS_NOTZERO: "ALL (P::nat => nat => nat) (A::nat) B::nat.
  3127    P 0 0 = 0 & (ALL (m::nat) n::nat. <= (P m n) (A * (m + n) + B)) -->
  3128    (EX x::nat. ALL (m::nat) n::nat. <= (P m n) (x * (m + n)))"
  3129   by (import hollight BOUNDS_NOTZERO)
  3130 
  3131 lemma BOUNDS_IGNORE: "ALL (P::nat => nat) Q::nat => nat.
  3132    (EX B::nat. ALL i::nat. <= (P i) (Q i + B)) =
  3133    (EX (x::nat) N::nat. ALL i::nat. <= N i --> <= (P i) (Q i + x))"
  3134   by (import hollight BOUNDS_IGNORE)
  3135 
  3136 constdefs
  3137   is_nadd :: "(nat => nat) => bool" 
  3138   "is_nadd ==
  3139 %u::nat => nat.
  3140    EX B::nat.
  3141       ALL (m::nat) n::nat. <= (dist (m * u n, n * u m)) (B * (m + n))"
  3142 
  3143 lemma DEF_is_nadd: "is_nadd =
  3144 (%u::nat => nat.
  3145     EX B::nat.
  3146        ALL (m::nat) n::nat. <= (dist (m * u n, n * u m)) (B * (m + n)))"
  3147   by (import hollight DEF_is_nadd)
  3148 
  3149 lemma is_nadd_0: "is_nadd (%n::nat. 0)"
  3150   by (import hollight is_nadd_0)
  3151 
  3152 typedef (open) nadd = "Collect is_nadd"  morphisms "dest_nadd" "mk_nadd"
  3153   apply (rule light_ex_imp_nonempty[where t="%n::nat. NUMERAL 0"])
  3154   by (import hollight TYDEF_nadd)
  3155 
  3156 syntax
  3157   dest_nadd :: _ 
  3158 
  3159 syntax
  3160   mk_nadd :: _ 
  3161 
  3162 lemmas "TYDEF_nadd_@intern" = typedef_hol2hollight 
  3163   [where a="a :: nadd" and r=r ,
  3164    OF type_definition_nadd]
  3165 
  3166 lemma NADD_CAUCHY: "ALL x::nadd.
  3167    EX xa::nat.
  3168       ALL (xb::nat) xc::nat.
  3169          <= (dist (xb * dest_nadd x xc, xc * dest_nadd x xb))
  3170           (xa * (xb + xc))"
  3171   by (import hollight NADD_CAUCHY)
  3172 
  3173 lemma NADD_BOUND: "ALL x::nadd.
  3174    EX (xa::nat) B::nat. ALL n::nat. <= (dest_nadd x n) (xa * n + B)"
  3175   by (import hollight NADD_BOUND)
  3176 
  3177 lemma NADD_MULTIPLICATIVE: "ALL x::nadd.
  3178    EX xa::nat.
  3179       ALL (m::nat) n::nat.
  3180          <= (dist (dest_nadd x (m * n), m * dest_nadd x n)) (xa * m + xa)"
  3181   by (import hollight NADD_MULTIPLICATIVE)
  3182 
  3183 lemma NADD_ADDITIVE: "ALL x::nadd.
  3184    EX xa::nat.
  3185       ALL (m::nat) n::nat.
  3186          <= (dist (dest_nadd x (m + n), dest_nadd x m + dest_nadd x n)) xa"
  3187   by (import hollight NADD_ADDITIVE)
  3188 
  3189 lemma NADD_SUC: "ALL x::nadd.
  3190    EX xa::nat. ALL n::nat. <= (dist (dest_nadd x (Suc n), dest_nadd x n)) xa"
  3191   by (import hollight NADD_SUC)
  3192 
  3193 lemma NADD_DIST_LEMMA: "ALL x::nadd.
  3194    EX xa::nat.
  3195       ALL (m::nat) n::nat.
  3196          <= (dist (dest_nadd x (m + n), dest_nadd x m)) (xa * n)"
  3197   by (import hollight NADD_DIST_LEMMA)
  3198 
  3199 lemma NADD_DIST: "ALL x::nadd.
  3200    EX xa::nat.
  3201       ALL (m::nat) n::nat.
  3202          <= (dist (dest_nadd x m, dest_nadd x n)) (xa * dist (m, n))"
  3203   by (import hollight NADD_DIST)
  3204 
  3205 lemma NADD_ALTMUL: "ALL (x::nadd) y::nadd.
  3206    EX (A::nat) B::nat.
  3207       ALL n::nat.
  3208          <= (dist
  3209               (n * dest_nadd x (dest_nadd y n),
  3210                dest_nadd x n * dest_nadd y n))
  3211           (A * n + B)"
  3212   by (import hollight NADD_ALTMUL)
  3213 
  3214 constdefs
  3215   nadd_eq :: "nadd => nadd => bool" 
  3216   "nadd_eq ==
  3217 %(u::nadd) ua::nadd.
  3218    EX B::nat. ALL n::nat. <= (dist (dest_nadd u n, dest_nadd ua n)) B"
  3219 
  3220 lemma DEF_nadd_eq: "nadd_eq =
  3221 (%(u::nadd) ua::nadd.
  3222     EX B::nat. ALL n::nat. <= (dist (dest_nadd u n, dest_nadd ua n)) B)"
  3223   by (import hollight DEF_nadd_eq)
  3224 
  3225 lemma NADD_EQ_REFL: "ALL x::nadd. nadd_eq x x"
  3226   by (import hollight NADD_EQ_REFL)
  3227 
  3228 lemma NADD_EQ_SYM: "ALL (x::nadd) y::nadd. nadd_eq x y = nadd_eq y x"
  3229   by (import hollight NADD_EQ_SYM)
  3230 
  3231 lemma NADD_EQ_TRANS: "ALL (x::nadd) (y::nadd) z::nadd. nadd_eq x y & nadd_eq y z --> nadd_eq x z"
  3232   by (import hollight NADD_EQ_TRANS)
  3233 
  3234 constdefs
  3235   nadd_of_num :: "nat => nadd" 
  3236   "nadd_of_num == %u::nat. mk_nadd (op * u)"
  3237 
  3238 lemma DEF_nadd_of_num: "nadd_of_num = (%u::nat. mk_nadd (op * u))"
  3239   by (import hollight DEF_nadd_of_num)
  3240 
  3241 lemma NADD_OF_NUM: "ALL x::nat. dest_nadd (nadd_of_num x) = op * x"
  3242   by (import hollight NADD_OF_NUM)
  3243 
  3244 lemma NADD_OF_NUM_WELLDEF: "ALL (m::nat) n::nat. m = n --> nadd_eq (nadd_of_num m) (nadd_of_num n)"
  3245   by (import hollight NADD_OF_NUM_WELLDEF)
  3246 
  3247 lemma NADD_OF_NUM_EQ: "ALL (m::nat) n::nat. nadd_eq (nadd_of_num m) (nadd_of_num n) = (m = n)"
  3248   by (import hollight NADD_OF_NUM_EQ)
  3249 
  3250 constdefs
  3251   nadd_le :: "nadd => nadd => bool" 
  3252   "nadd_le ==
  3253 %(u::nadd) ua::nadd.
  3254    EX B::nat. ALL n::nat. <= (dest_nadd u n) (dest_nadd ua n + B)"
  3255 
  3256 lemma DEF_nadd_le: "nadd_le =
  3257 (%(u::nadd) ua::nadd.
  3258     EX B::nat. ALL n::nat. <= (dest_nadd u n) (dest_nadd ua n + B))"
  3259   by (import hollight DEF_nadd_le)
  3260 
  3261 lemma NADD_LE_WELLDEF_LEMMA: "ALL (x::nadd) (x'::nadd) (y::nadd) y'::nadd.
  3262    nadd_eq x x' & nadd_eq y y' & nadd_le x y --> nadd_le x' y'"
  3263   by (import hollight NADD_LE_WELLDEF_LEMMA)
  3264 
  3265 lemma NADD_LE_WELLDEF: "ALL (x::nadd) (x'::nadd) (y::nadd) y'::nadd.
  3266    nadd_eq x x' & nadd_eq y y' --> nadd_le x y = nadd_le x' y'"
  3267   by (import hollight NADD_LE_WELLDEF)
  3268 
  3269 lemma NADD_LE_REFL: "ALL x::nadd. nadd_le x x"
  3270   by (import hollight NADD_LE_REFL)
  3271 
  3272 lemma NADD_LE_TRANS: "ALL (x::nadd) (y::nadd) z::nadd. nadd_le x y & nadd_le y z --> nadd_le x z"
  3273   by (import hollight NADD_LE_TRANS)
  3274 
  3275 lemma NADD_LE_ANTISYM: "ALL (x::nadd) y::nadd. (nadd_le x y & nadd_le y x) = nadd_eq x y"
  3276   by (import hollight NADD_LE_ANTISYM)
  3277 
  3278 lemma NADD_LE_TOTAL_LEMMA: "ALL (x::nadd) y::nadd.
  3279    ~ nadd_le x y -->
  3280    (ALL B::nat. EX n::nat. n ~= 0 & < (dest_nadd y n + B) (dest_nadd x n))"
  3281   by (import hollight NADD_LE_TOTAL_LEMMA)
  3282 
  3283 lemma NADD_LE_TOTAL: "ALL (x::nadd) y::nadd. nadd_le x y | nadd_le y x"
  3284   by (import hollight NADD_LE_TOTAL)
  3285 
  3286 lemma NADD_ARCH: "ALL x::nadd. EX xa::nat. nadd_le x (nadd_of_num xa)"
  3287   by (import hollight NADD_ARCH)
  3288 
  3289 lemma NADD_OF_NUM_LE: "ALL (m::nat) n::nat. nadd_le (nadd_of_num m) (nadd_of_num n) = <= m n"
  3290   by (import hollight NADD_OF_NUM_LE)
  3291 
  3292 constdefs
  3293   nadd_add :: "nadd => nadd => nadd" 
  3294   "nadd_add ==
  3295 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n)"
  3296 
  3297 lemma DEF_nadd_add: "nadd_add =
  3298 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n))"
  3299   by (import hollight DEF_nadd_add)
  3300 
  3301 lemma NADD_ADD: "ALL (x::nadd) y::nadd.
  3302    dest_nadd (nadd_add x y) = (%n::nat. dest_nadd x n + dest_nadd y n)"
  3303   by (import hollight NADD_ADD)
  3304 
  3305 lemma NADD_ADD_WELLDEF: "ALL (x::nadd) (x'::nadd) (y::nadd) y'::nadd.
  3306    nadd_eq x x' & nadd_eq y y' --> nadd_eq (nadd_add x y) (nadd_add x' y')"
  3307   by (import hollight NADD_ADD_WELLDEF)
  3308 
  3309 lemma NADD_ADD_SYM: "ALL (x::nadd) y::nadd. nadd_eq (nadd_add x y) (nadd_add y x)"
  3310   by (import hollight NADD_ADD_SYM)
  3311 
  3312 lemma NADD_ADD_ASSOC: "ALL (x::nadd) (y::nadd) z::nadd.
  3313    nadd_eq (nadd_add x (nadd_add y z)) (nadd_add (nadd_add x y) z)"
  3314   by (import hollight NADD_ADD_ASSOC)
  3315 
  3316 lemma NADD_ADD_LID: "ALL x::nadd. nadd_eq (nadd_add (nadd_of_num 0) x) x"
  3317   by (import hollight NADD_ADD_LID)
  3318 
  3319 lemma NADD_ADD_LCANCEL: "ALL (x::nadd) (y::nadd) z::nadd.
  3320    nadd_eq (nadd_add x y) (nadd_add x z) --> nadd_eq y z"
  3321   by (import hollight NADD_ADD_LCANCEL)
  3322 
  3323 lemma NADD_LE_ADD: "ALL (x::nadd) y::nadd. nadd_le x (nadd_add x y)"
  3324   by (import hollight NADD_LE_ADD)
  3325 
  3326 lemma NADD_LE_EXISTS: "ALL (x::nadd) y::nadd.
  3327    nadd_le x y --> (EX d::nadd. nadd_eq y (nadd_add x d))"
  3328   by (import hollight NADD_LE_EXISTS)
  3329 
  3330 lemma NADD_OF_NUM_ADD: "ALL (x::nat) xa::nat.
  3331    nadd_eq (nadd_add (nadd_of_num x) (nadd_of_num xa))
  3332     (nadd_of_num (x + xa))"
  3333   by (import hollight NADD_OF_NUM_ADD)
  3334 
  3335 constdefs
  3336   nadd_mul :: "nadd => nadd => nadd" 
  3337   "nadd_mul ==
  3338 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n))"
  3339 
  3340 lemma DEF_nadd_mul: "nadd_mul =
  3341 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n)))"
  3342   by (import hollight DEF_nadd_mul)
  3343 
  3344 lemma NADD_MUL: "ALL (x::nadd) y::nadd.
  3345    dest_nadd (nadd_mul x y) = (%n::nat. dest_nadd x (dest_nadd y n))"
  3346   by (import hollight NADD_MUL)
  3347 
  3348 lemma NADD_MUL_SYM: "ALL (x::nadd) y::nadd. nadd_eq (nadd_mul x y) (nadd_mul y x)"
  3349   by (import hollight NADD_MUL_SYM)
  3350 
  3351 lemma NADD_MUL_ASSOC: "ALL (x::nadd) (y::nadd) z::nadd.
  3352    nadd_eq (nadd_mul x (nadd_mul y z)) (nadd_mul (nadd_mul x y) z)"
  3353   by (import hollight NADD_MUL_ASSOC)
  3354 
  3355 lemma NADD_MUL_LID: "ALL x::nadd. nadd_eq (nadd_mul (nadd_of_num (NUMERAL_BIT1 0)) x) x"
  3356   by (import hollight NADD_MUL_LID)
  3357 
  3358 lemma NADD_LDISTRIB: "ALL (x::nadd) (y::nadd) z::nadd.
  3359    nadd_eq (nadd_mul x (nadd_add y z))
  3360     (nadd_add (nadd_mul x y) (nadd_mul x z))"
  3361   by (import hollight NADD_LDISTRIB)
  3362 
  3363 lemma NADD_MUL_WELLDEF_LEMMA: "ALL (x::nadd) (y::nadd) y'::nadd.
  3364    nadd_eq y y' --> nadd_eq (nadd_mul x y) (nadd_mul x y')"
  3365   by (import hollight NADD_MUL_WELLDEF_LEMMA)
  3366 
  3367 lemma NADD_MUL_WELLDEF: "ALL (x::nadd) (x'::nadd) (y::nadd) y'::nadd.
  3368    nadd_eq x x' & nadd_eq y y' --> nadd_eq (nadd_mul x y) (nadd_mul x' y')"
  3369   by (import hollight NADD_MUL_WELLDEF)
  3370 
  3371 lemma NADD_OF_NUM_MUL: "ALL (x::nat) xa::nat.
  3372    nadd_eq (nadd_mul (nadd_of_num x) (nadd_of_num xa))
  3373     (nadd_of_num (x * xa))"
  3374   by (import hollight NADD_OF_NUM_MUL)
  3375 
  3376 lemma NADD_LE_0: "All (nadd_le (nadd_of_num 0))"
  3377   by (import hollight NADD_LE_0)
  3378 
  3379 lemma NADD_EQ_IMP_LE: "ALL (x::nadd) y::nadd. nadd_eq x y --> nadd_le x y"
  3380   by (import hollight NADD_EQ_IMP_LE)
  3381 
  3382 lemma NADD_LE_LMUL: "ALL (x::nadd) (y::nadd) z::nadd.
  3383    nadd_le y z --> nadd_le (nadd_mul x y) (nadd_mul x z)"
  3384   by (import hollight NADD_LE_LMUL)
  3385 
  3386 lemma NADD_LE_RMUL: "ALL (x::nadd) (y::nadd) z::nadd.
  3387    nadd_le x y --> nadd_le (nadd_mul x z) (nadd_mul y z)"
  3388   by (import hollight NADD_LE_RMUL)
  3389 
  3390 lemma NADD_LE_RADD: "ALL (x::nadd) (y::nadd) z::nadd.
  3391    nadd_le (nadd_add x z) (nadd_add y z) = nadd_le x y"
  3392   by (import hollight NADD_LE_RADD)
  3393 
  3394 lemma NADD_LE_LADD: "ALL (x::nadd) (y::nadd) z::nadd.
  3395    nadd_le (nadd_add x y) (nadd_add x z) = nadd_le y z"
  3396   by (import hollight NADD_LE_LADD)
  3397 
  3398 lemma NADD_RDISTRIB: "ALL (x::nadd) (y::nadd) z::nadd.
  3399    nadd_eq (nadd_mul (nadd_add x y) z)
  3400     (nadd_add (nadd_mul x z) (nadd_mul y z))"
  3401   by (import hollight NADD_RDISTRIB)
  3402 
  3403 lemma NADD_ARCH_MULT: "ALL (x::nadd) k::nat.
  3404    ~ nadd_eq x (nadd_of_num 0) -->
  3405    (EX xa::nat. nadd_le (nadd_of_num k) (nadd_mul (nadd_of_num xa) x))"
  3406   by (import hollight NADD_ARCH_MULT)
  3407 
  3408 lemma NADD_ARCH_ZERO: "ALL (x::nadd) k::nadd.
  3409    (ALL n::nat. nadd_le (nadd_mul (nadd_of_num n) x) k) -->
  3410    nadd_eq x (nadd_of_num 0)"
  3411   by (import hollight NADD_ARCH_ZERO)
  3412 
  3413 lemma NADD_ARCH_LEMMA: "ALL (x::nadd) (y::nadd) z::nadd.
  3414    (ALL n::nat.
  3415        nadd_le (nadd_mul (nadd_of_num n) x)
  3416         (nadd_add (nadd_mul (nadd_of_num n) y) z)) -->
  3417    nadd_le x y"
  3418   by (import hollight NADD_ARCH_LEMMA)
  3419 
  3420 lemma NADD_COMPLETE: "ALL P::nadd => bool.
  3421    Ex P & (EX M::nadd. ALL x::nadd. P x --> nadd_le x M) -->
  3422    (EX M::nadd.
  3423        (ALL x::nadd. P x --> nadd_le x M) &
  3424        (ALL M'::nadd. (ALL x::nadd. P x --> nadd_le x M') --> nadd_le M M'))"
  3425   by (import hollight NADD_COMPLETE)
  3426 
  3427 lemma NADD_UBOUND: "ALL x::nadd.
  3428    EX (xa::nat) N::nat. ALL n::nat. <= N n --> <= (dest_nadd x n) (xa * n)"
  3429   by (import hollight NADD_UBOUND)
  3430 
  3431 lemma NADD_NONZERO: "ALL x::nadd.
  3432    ~ nadd_eq x (nadd_of_num 0) -->
  3433    (EX N::nat. ALL n::nat. <= N n --> dest_nadd x n ~= 0)"
  3434   by (import hollight NADD_NONZERO)
  3435 
  3436 lemma NADD_LBOUND: "ALL x::nadd.
  3437    ~ nadd_eq x (nadd_of_num 0) -->
  3438    (EX (A::nat) N::nat. ALL n::nat. <= N n --> <= n (A * dest_nadd x n))"
  3439   by (import hollight NADD_LBOUND)
  3440 
  3441 constdefs
  3442   nadd_rinv :: "nadd => nat => nat" 
  3443   "nadd_rinv == %(u::nadd) n::nat. DIV (n * n) (dest_nadd u n)"
  3444 
  3445 lemma DEF_nadd_rinv: "nadd_rinv = (%(u::nadd) n::nat. DIV (n * n) (dest_nadd u n))"
  3446   by (import hollight DEF_nadd_rinv)
  3447 
  3448 lemma NADD_MUL_LINV_LEMMA0: "ALL x::nadd.
  3449    ~ nadd_eq x (nadd_of_num 0) -->
  3450    (EX (xa::nat) B::nat. ALL i::nat. <= (nadd_rinv x i) (xa * i + B))"
  3451   by (import hollight NADD_MUL_LINV_LEMMA0)
  3452 
  3453 lemma NADD_MUL_LINV_LEMMA1: "ALL (x::nadd) n::nat.
  3454    dest_nadd x n ~= 0 -->
  3455    <= (dist (dest_nadd x n * nadd_rinv x n, n * n)) (dest_nadd x n)"
  3456   by (import hollight NADD_MUL_LINV_LEMMA1)
  3457 
  3458 lemma NADD_MUL_LINV_LEMMA2: "ALL x::nadd.
  3459    ~ nadd_eq x (nadd_of_num 0) -->
  3460    (EX N::nat.
  3461        ALL n::nat.
  3462           <= N n -->
  3463           <= (dist (dest_nadd x n * nadd_rinv x n, n * n)) (dest_nadd x n))"
  3464   by (import hollight NADD_MUL_LINV_LEMMA2)
  3465 
  3466 lemma NADD_MUL_LINV_LEMMA3: "ALL x::nadd.
  3467    ~ nadd_eq x (nadd_of_num 0) -->
  3468    (EX N::nat.
  3469        ALL (m::nat) n::nat.
  3470           <= N n -->
  3471           <= (dist
  3472                (m * (dest_nadd x m * (dest_nadd x n * nadd_rinv x n)),
  3473                 m * (dest_nadd x m * (n * n))))
  3474            (m * (dest_nadd x m * dest_nadd x n)))"
  3475   by (import hollight NADD_MUL_LINV_LEMMA3)
  3476 
  3477 lemma NADD_MUL_LINV_LEMMA4: "ALL x::nadd.
  3478    ~ nadd_eq x (nadd_of_num 0) -->
  3479    (EX N::nat.
  3480        ALL (m::nat) n::nat.
  3481           <= N m & <= N n -->
  3482           <= (dest_nadd x m * dest_nadd x n *
  3483               dist (m * nadd_rinv x n, n * nadd_rinv x m))
  3484            (m * n * dist (m * dest_nadd x n, n * dest_nadd x m) +
  3485             dest_nadd x m * dest_nadd x n * (m + n)))"
  3486   by (import hollight NADD_MUL_LINV_LEMMA4)
  3487 
  3488 lemma NADD_MUL_LINV_LEMMA5: "ALL x::nadd.
  3489    ~ nadd_eq x (nadd_of_num 0) -->
  3490    (EX (B::nat) N::nat.
  3491        ALL (m::nat) n::nat.
  3492           <= N m & <= N n -->
  3493           <= (dest_nadd x m * dest_nadd x n *
  3494               dist (m * nadd_rinv x n, n * nadd_rinv x m))
  3495            (B * (m * n * (m + n))))"
  3496   by (import hollight NADD_MUL_LINV_LEMMA5)
  3497 
  3498 lemma NADD_MUL_LINV_LEMMA6: "ALL x::nadd.
  3499    ~ nadd_eq x (nadd_of_num 0) -->
  3500    (EX (B::nat) N::nat.
  3501        ALL (m::nat) n::nat.
  3502           <= N m & <= N n -->
  3503           <= (m * n * dist (m * nadd_rinv x n, n * nadd_rinv x m))
  3504            (B * (m * n * (m + n))))"
  3505   by (import hollight NADD_MUL_LINV_LEMMA6)
  3506 
  3507 lemma NADD_MUL_LINV_LEMMA7: "ALL x::nadd.
  3508    ~ nadd_eq x (nadd_of_num 0) -->
  3509    (EX (B::nat) N::nat.
  3510        ALL (m::nat) n::nat.
  3511           <= N m & <= N n -->
  3512           <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
  3513   by (import hollight NADD_MUL_LINV_LEMMA7)
  3514 
  3515 lemma NADD_MUL_LINV_LEMMA7a: "ALL x::nadd.
  3516    ~ nadd_eq x (nadd_of_num 0) -->
  3517    (ALL N::nat.
  3518        EX (A::nat) B::nat.
  3519           ALL (m::nat) n::nat.
  3520              <= m N -->
  3521              <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (A * n + B))"
  3522   by (import hollight NADD_MUL_LINV_LEMMA7a)
  3523 
  3524 lemma NADD_MUL_LINV_LEMMA8: "ALL x::nadd.
  3525    ~ nadd_eq x (nadd_of_num 0) -->
  3526    (EX B::nat.
  3527        ALL (m::nat) n::nat.
  3528           <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
  3529   by (import hollight NADD_MUL_LINV_LEMMA8)
  3530 
  3531 constdefs
  3532   nadd_inv :: "nadd => nadd" 
  3533   "nadd_inv ==
  3534 %u::nadd.
  3535    COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0) (mk_nadd (nadd_rinv u))"
  3536 
  3537 lemma DEF_nadd_inv: "nadd_inv =
  3538 (%u::nadd.
  3539     COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0)
  3540      (mk_nadd (nadd_rinv u)))"
  3541   by (import hollight DEF_nadd_inv)
  3542 
  3543 lemma NADD_INV: "ALL x::nadd.
  3544    dest_nadd (nadd_inv x) =
  3545    COND (nadd_eq x (nadd_of_num 0)) (%n::nat. 0) (nadd_rinv x)"
  3546   by (import hollight NADD_INV)
  3547 
  3548 lemma NADD_MUL_LINV: "ALL x::nadd.
  3549    ~ nadd_eq x (nadd_of_num 0) -->
  3550    nadd_eq (nadd_mul (nadd_inv x) x) (nadd_of_num (NUMERAL_BIT1 0))"
  3551   by (import hollight NADD_MUL_LINV)
  3552 
  3553 lemma NADD_INV_0: "nadd_eq (nadd_inv (nadd_of_num 0)) (nadd_of_num 0)"
  3554   by (import hollight NADD_INV_0)
  3555 
  3556 lemma NADD_INV_WELLDEF: "ALL (x::nadd) y::nadd. nadd_eq x y --> nadd_eq (nadd_inv x) (nadd_inv y)"
  3557   by (import hollight NADD_INV_WELLDEF)
  3558 
  3559 typedef (open) hreal = "{s::nadd => bool. EX x::nadd. s = nadd_eq x}"  morphisms "dest_hreal" "mk_hreal"
  3560   apply (rule light_ex_imp_nonempty[where t="nadd_eq (x::nadd)"])
  3561   by (import hollight TYDEF_hreal)
  3562 
  3563 syntax
  3564   dest_hreal :: _ 
  3565 
  3566 syntax
  3567   mk_hreal :: _ 
  3568 
  3569 lemmas "TYDEF_hreal_@intern" = typedef_hol2hollight 
  3570   [where a="a :: hreal" and r=r ,
  3571    OF type_definition_hreal]
  3572 
  3573 constdefs
  3574   hreal_of_num :: "nat => hreal" 
  3575   "hreal_of_num == %m::nat. mk_hreal (nadd_eq (nadd_of_num m))"
  3576 
  3577 lemma DEF_hreal_of_num: "hreal_of_num = (%m::nat. mk_hreal (nadd_eq (nadd_of_num m)))"
  3578   by (import hollight DEF_hreal_of_num)
  3579 
  3580 constdefs
  3581   hreal_add :: "hreal => hreal => hreal" 
  3582   "hreal_add ==
  3583 %(x::hreal) y::hreal.
  3584    mk_hreal
  3585     (%u::nadd.
  3586         EX (xa::nadd) ya::nadd.
  3587            nadd_eq (nadd_add xa ya) u & dest_hreal x xa & dest_hreal y ya)"
  3588 
  3589 lemma DEF_hreal_add: "hreal_add =
  3590 (%(x::hreal) y::hreal.
  3591     mk_hreal
  3592      (%u::nadd.
  3593          EX (xa::nadd) ya::nadd.
  3594             nadd_eq (nadd_add xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3595   by (import hollight DEF_hreal_add)
  3596 
  3597 constdefs
  3598   hreal_mul :: "hreal => hreal => hreal" 
  3599   "hreal_mul ==
  3600 %(x::hreal) y::hreal.
  3601    mk_hreal
  3602     (%u::nadd.
  3603         EX (xa::nadd) ya::nadd.
  3604            nadd_eq (nadd_mul xa ya) u & dest_hreal x xa & dest_hreal y ya)"
  3605 
  3606 lemma DEF_hreal_mul: "hreal_mul =
  3607 (%(x::hreal) y::hreal.
  3608     mk_hreal
  3609      (%u::nadd.
  3610          EX (xa::nadd) ya::nadd.
  3611             nadd_eq (nadd_mul xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3612   by (import hollight DEF_hreal_mul)
  3613 
  3614 constdefs
  3615   hreal_le :: "hreal => hreal => bool" 
  3616   "hreal_le ==
  3617 %(x::hreal) y::hreal.
  3618    SOME u::bool.
  3619       EX (xa::nadd) ya::nadd.
  3620          nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya"
  3621 
  3622 lemma DEF_hreal_le: "hreal_le =
  3623 (%(x::hreal) y::hreal.
  3624     SOME u::bool.
  3625        EX (xa::nadd) ya::nadd.
  3626           nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya)"
  3627   by (import hollight DEF_hreal_le)
  3628 
  3629 constdefs
  3630   hreal_inv :: "hreal => hreal" 
  3631   "hreal_inv ==
  3632 %x::hreal.
  3633    mk_hreal
  3634     (%u::nadd. EX xa::nadd. nadd_eq (nadd_inv xa) u & dest_hreal x xa)"
  3635 
  3636 lemma DEF_hreal_inv: "hreal_inv =
  3637 (%x::hreal.
  3638     mk_hreal
  3639      (%u::nadd. EX xa::nadd. nadd_eq (nadd_inv xa) u & dest_hreal x xa))"
  3640   by (import hollight DEF_hreal_inv)
  3641 
  3642 lemma HREAL_LE_EXISTS_DEF: "ALL (m::hreal) n::hreal. hreal_le m n = (EX d::hreal. n = hreal_add m d)"
  3643   by (import hollight HREAL_LE_EXISTS_DEF)
  3644 
  3645 lemma HREAL_EQ_ADD_LCANCEL: "ALL (m::hreal) (n::hreal) p::hreal.
  3646    (hreal_add m n = hreal_add m p) = (n = p)"
  3647   by (import hollight HREAL_EQ_ADD_LCANCEL)
  3648 
  3649 lemma HREAL_EQ_ADD_RCANCEL: "ALL (x::hreal) (xa::hreal) xb::hreal.
  3650    (hreal_add x xb = hreal_add xa xb) = (x = xa)"
  3651   by (import hollight HREAL_EQ_ADD_RCANCEL)
  3652 
  3653 lemma HREAL_LE_ADD_LCANCEL: "ALL (x::hreal) (xa::hreal) xb::hreal.
  3654    hreal_le (hreal_add x xa) (hreal_add x xb) = hreal_le xa xb"
  3655   by (import hollight HREAL_LE_ADD_LCANCEL)
  3656 
  3657 lemma HREAL_LE_ADD_RCANCEL: "ALL (x::hreal) (xa::hreal) xb::hreal.
  3658    hreal_le (hreal_add x xb) (hreal_add xa xb) = hreal_le x xa"
  3659   by (import hollight HREAL_LE_ADD_RCANCEL)
  3660 
  3661 lemma HREAL_ADD_RID: "ALL x::hreal. hreal_add x (hreal_of_num 0) = x"
  3662   by (import hollight HREAL_ADD_RID)
  3663 
  3664 lemma HREAL_ADD_RDISTRIB: "ALL (x::hreal) (xa::hreal) xb::hreal.
  3665    hreal_mul (hreal_add x xa) xb =
  3666    hreal_add (hreal_mul x xb) (hreal_mul xa xb)"
  3667   by (import hollight HREAL_ADD_RDISTRIB)
  3668 
  3669 lemma HREAL_MUL_LZERO: "ALL m::hreal. hreal_mul (hreal_of_num 0) m = hreal_of_num 0"
  3670   by (import hollight HREAL_MUL_LZERO)
  3671 
  3672 lemma HREAL_MUL_RZERO: "ALL x::hreal. hreal_mul x (hreal_of_num 0) = hreal_of_num 0"
  3673   by (import hollight HREAL_MUL_RZERO)
  3674 
  3675 lemma HREAL_ADD_AC: "hreal_add (m::hreal) (n::hreal) = hreal_add n m &
  3676 hreal_add (hreal_add m n) (p::hreal) = hreal_add m (hreal_add n p) &
  3677 hreal_add m (hreal_add n p) = hreal_add n (hreal_add m p)"
  3678   by (import hollight HREAL_ADD_AC)
  3679 
  3680 lemma HREAL_LE_ADD2: "ALL (a::hreal) (b::hreal) (c::hreal) d::hreal.
  3681    hreal_le a b & hreal_le c d --> hreal_le (hreal_add a c) (hreal_add b d)"
  3682   by (import hollight HREAL_LE_ADD2)
  3683 
  3684 lemma HREAL_LE_MUL_RCANCEL_IMP: "ALL (a::hreal) (b::hreal) c::hreal.
  3685    hreal_le a b --> hreal_le (hreal_mul a c) (hreal_mul b c)"
  3686   by (import hollight HREAL_LE_MUL_RCANCEL_IMP)
  3687 
  3688 constdefs
  3689   treal_of_num :: "nat => hreal * hreal" 
  3690   "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num 0)"
  3691 
  3692 lemma DEF_treal_of_num: "treal_of_num = (%u::nat. (hreal_of_num u, hreal_of_num 0))"
  3693   by (import hollight DEF_treal_of_num)
  3694 
  3695 constdefs
  3696   treal_neg :: "hreal * hreal => hreal * hreal" 
  3697   "treal_neg == %u::hreal * hreal. (snd u, fst u)"
  3698 
  3699 lemma DEF_treal_neg: "treal_neg = (%u::hreal * hreal. (snd u, fst u))"
  3700   by (import hollight DEF_treal_neg)
  3701 
  3702 constdefs
  3703   treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" 
  3704   "treal_add ==
  3705 %(u::hreal * hreal) ua::hreal * hreal.
  3706    (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua))"
  3707 
  3708 lemma DEF_treal_add: "treal_add =
  3709 (%(u::hreal * hreal) ua::hreal * hreal.
  3710     (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua)))"
  3711   by (import hollight DEF_treal_add)
  3712 
  3713 constdefs
  3714   treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" 
  3715   "treal_mul ==
  3716 %(u::hreal * hreal) ua::hreal * hreal.
  3717    (hreal_add (hreal_mul (fst u) (fst ua)) (hreal_mul (snd u) (snd ua)),
  3718     hreal_add (hreal_mul (fst u) (snd ua)) (hreal_mul (snd u) (fst ua)))"
  3719 
  3720 lemma DEF_treal_mul: "treal_mul =
  3721 (%(u::hreal * hreal) ua::hreal * hreal.
  3722     (hreal_add (hreal_mul (fst u) (fst ua)) (hreal_mul (snd u) (snd ua)),
  3723      hreal_add (hreal_mul (fst u) (snd ua)) (hreal_mul (snd u) (fst ua))))"
  3724   by (import hollight DEF_treal_mul)
  3725 
  3726 constdefs
  3727   treal_le :: "hreal * hreal => hreal * hreal => bool" 
  3728   "treal_le ==
  3729 %(u::hreal * hreal) ua::hreal * hreal.
  3730    hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u))"
  3731 
  3732 lemma DEF_treal_le: "treal_le =
  3733 (%(u::hreal * hreal) ua::hreal * hreal.
  3734     hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u)))"
  3735   by (import hollight DEF_treal_le)
  3736 
  3737 constdefs
  3738   treal_inv :: "hreal * hreal => hreal * hreal" 
  3739   "treal_inv ==
  3740 %u::hreal * hreal.
  3741    COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
  3742     (COND (hreal_le (snd u) (fst u))
  3743       (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
  3744        hreal_of_num 0)
  3745       (hreal_of_num 0,
  3746        hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d)))"
  3747 
  3748 lemma DEF_treal_inv: "treal_inv =
  3749 (%u::hreal * hreal.
  3750     COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
  3751      (COND (hreal_le (snd u) (fst u))
  3752        (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
  3753         hreal_of_num 0)
  3754        (hreal_of_num 0,
  3755         hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d))))"
  3756   by (import hollight DEF_treal_inv)
  3757 
  3758 constdefs
  3759   treal_eq :: "hreal * hreal => hreal * hreal => bool" 
  3760   "treal_eq ==
  3761 %(u::hreal * hreal) ua::hreal * hreal.
  3762    hreal_add (fst u) (snd ua) = hreal_add (fst ua) (snd u)"
  3763 
  3764 lemma DEF_treal_eq: "treal_eq =
  3765 (%(u::hreal * hreal) ua::hreal * hreal.
  3766     hreal_add (fst u) (snd ua) = hreal_add (fst ua) (snd u))"
  3767   by (import hollight DEF_treal_eq)
  3768 
  3769 lemma TREAL_EQ_REFL: "ALL x::hreal * hreal. treal_eq x x"
  3770   by (import hollight TREAL_EQ_REFL)
  3771 
  3772 lemma TREAL_EQ_SYM: "ALL (x::hreal * hreal) y::hreal * hreal. treal_eq x y = treal_eq y x"
  3773   by (import hollight TREAL_EQ_SYM)
  3774 
  3775 lemma TREAL_EQ_TRANS: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3776    treal_eq x y & treal_eq y z --> treal_eq x z"
  3777   by (import hollight TREAL_EQ_TRANS)
  3778 
  3779 lemma TREAL_EQ_AP: "ALL (x::hreal * hreal) y::hreal * hreal. x = y --> treal_eq x y"
  3780   by (import hollight TREAL_EQ_AP)
  3781 
  3782 lemma TREAL_OF_NUM_EQ: "ALL (x::nat) xa::nat. treal_eq (treal_of_num x) (treal_of_num xa) = (x = xa)"
  3783   by (import hollight TREAL_OF_NUM_EQ)
  3784 
  3785 lemma TREAL_OF_NUM_LE: "ALL (x::nat) xa::nat. treal_le (treal_of_num x) (treal_of_num xa) = <= x xa"
  3786   by (import hollight TREAL_OF_NUM_LE)
  3787 
  3788 lemma TREAL_OF_NUM_ADD: "ALL (x::nat) xa::nat.
  3789    treal_eq (treal_add (treal_of_num x) (treal_of_num xa))
  3790     (treal_of_num (x + xa))"
  3791   by (import hollight TREAL_OF_NUM_ADD)
  3792 
  3793 lemma TREAL_OF_NUM_MUL: "ALL (x::nat) xa::nat.
  3794    treal_eq (treal_mul (treal_of_num x) (treal_of_num xa))
  3795     (treal_of_num (x * xa))"
  3796   by (import hollight TREAL_OF_NUM_MUL)
  3797 
  3798 lemma TREAL_ADD_SYM_EQ: "ALL (x::hreal * hreal) y::hreal * hreal. treal_add x y = treal_add y x"
  3799   by (import hollight TREAL_ADD_SYM_EQ)
  3800 
  3801 lemma TREAL_MUL_SYM_EQ: "ALL (x::hreal * hreal) y::hreal * hreal. treal_mul x y = treal_mul y x"
  3802   by (import hollight TREAL_MUL_SYM_EQ)
  3803 
  3804 lemma TREAL_ADD_SYM: "ALL (x::hreal * hreal) y::hreal * hreal.
  3805    treal_eq (treal_add x y) (treal_add y x)"
  3806   by (import hollight TREAL_ADD_SYM)
  3807 
  3808 lemma TREAL_ADD_ASSOC: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3809    treal_eq (treal_add x (treal_add y z)) (treal_add (treal_add x y) z)"
  3810   by (import hollight TREAL_ADD_ASSOC)
  3811 
  3812 lemma TREAL_ADD_LID: "ALL x::hreal * hreal. treal_eq (treal_add (treal_of_num 0) x) x"
  3813   by (import hollight TREAL_ADD_LID)
  3814 
  3815 lemma TREAL_ADD_LINV: "ALL x::hreal * hreal. treal_eq (treal_add (treal_neg x) x) (treal_of_num 0)"
  3816   by (import hollight TREAL_ADD_LINV)
  3817 
  3818 lemma TREAL_MUL_SYM: "ALL (x::hreal * hreal) y::hreal * hreal.
  3819    treal_eq (treal_mul x y) (treal_mul y x)"
  3820   by (import hollight TREAL_MUL_SYM)
  3821 
  3822 lemma TREAL_MUL_ASSOC: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3823    treal_eq (treal_mul x (treal_mul y z)) (treal_mul (treal_mul x y) z)"
  3824   by (import hollight TREAL_MUL_ASSOC)
  3825 
  3826 lemma TREAL_MUL_LID: "ALL x::hreal * hreal.
  3827    treal_eq (treal_mul (treal_of_num (NUMERAL_BIT1 0)) x) x"
  3828   by (import hollight TREAL_MUL_LID)
  3829 
  3830 lemma TREAL_ADD_LDISTRIB: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3831    treal_eq (treal_mul x (treal_add y z))
  3832     (treal_add (treal_mul x y) (treal_mul x z))"
  3833   by (import hollight TREAL_ADD_LDISTRIB)
  3834 
  3835 lemma TREAL_LE_REFL: "ALL x::hreal * hreal. treal_le x x"
  3836   by (import hollight TREAL_LE_REFL)
  3837 
  3838 lemma TREAL_LE_ANTISYM: "ALL (x::hreal * hreal) y::hreal * hreal.
  3839    (treal_le x y & treal_le y x) = treal_eq x y"
  3840   by (import hollight TREAL_LE_ANTISYM)
  3841 
  3842 lemma TREAL_LE_TRANS: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3843    treal_le x y & treal_le y z --> treal_le x z"
  3844   by (import hollight TREAL_LE_TRANS)
  3845 
  3846 lemma TREAL_LE_TOTAL: "ALL (x::hreal * hreal) y::hreal * hreal. treal_le x y | treal_le y x"
  3847   by (import hollight TREAL_LE_TOTAL)
  3848 
  3849 lemma TREAL_LE_LADD_IMP: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal.
  3850    treal_le y z --> treal_le (treal_add x y) (treal_add x z)"
  3851   by (import hollight TREAL_LE_LADD_IMP)
  3852 
  3853 lemma TREAL_LE_MUL: "ALL (x::hreal * hreal) y::hreal * hreal.
  3854    treal_le (treal_of_num 0) x & treal_le (treal_of_num 0) y -->
  3855    treal_le (treal_of_num 0) (treal_mul x y)"
  3856   by (import hollight TREAL_LE_MUL)
  3857 
  3858 lemma TREAL_INV_0: "treal_eq (treal_inv (treal_of_num 0)) (treal_of_num 0)"
  3859   by (import hollight TREAL_INV_0)
  3860 
  3861 lemma TREAL_MUL_LINV: "ALL x::hreal * hreal.
  3862    ~ treal_eq x (treal_of_num 0) -->
  3863    treal_eq (treal_mul (treal_inv x) x) (treal_of_num (NUMERAL_BIT1 0))"
  3864   by (import hollight TREAL_MUL_LINV)
  3865 
  3866 lemma TREAL_OF_NUM_WELLDEF: "ALL (m::nat) n::nat. m = n --> treal_eq (treal_of_num m) (treal_of_num n)"
  3867   by (import hollight TREAL_OF_NUM_WELLDEF)
  3868 
  3869 lemma TREAL_NEG_WELLDEF: "ALL (x1::hreal * hreal) x2::hreal * hreal.
  3870    treal_eq x1 x2 --> treal_eq (treal_neg x1) (treal_neg x2)"
  3871   by (import hollight TREAL_NEG_WELLDEF)
  3872 
  3873 lemma TREAL_ADD_WELLDEFR: "ALL (x1::hreal * hreal) (x2::hreal * hreal) y::hreal * hreal.
  3874    treal_eq x1 x2 --> treal_eq (treal_add x1 y) (treal_add x2 y)"
  3875   by (import hollight TREAL_ADD_WELLDEFR)
  3876 
  3877 lemma TREAL_ADD_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal)
  3878    y2::hreal * hreal.
  3879    treal_eq x1 x2 & treal_eq y1 y2 -->
  3880    treal_eq (treal_add x1 y1) (treal_add x2 y2)"
  3881   by (import hollight TREAL_ADD_WELLDEF)
  3882 
  3883 lemma TREAL_MUL_WELLDEFR: "ALL (x1::hreal * hreal) (x2::hreal * hreal) y::hreal * hreal.
  3884    treal_eq x1 x2 --> treal_eq (treal_mul x1 y) (treal_mul x2 y)"
  3885   by (import hollight TREAL_MUL_WELLDEFR)
  3886 
  3887 lemma TREAL_MUL_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal)
  3888    y2::hreal * hreal.
  3889    treal_eq x1 x2 & treal_eq y1 y2 -->
  3890    treal_eq (treal_mul x1 y1) (treal_mul x2 y2)"
  3891   by (import hollight TREAL_MUL_WELLDEF)
  3892 
  3893 lemma TREAL_EQ_IMP_LE: "ALL (x::hreal * hreal) y::hreal * hreal. treal_eq x y --> treal_le x y"
  3894   by (import hollight TREAL_EQ_IMP_LE)
  3895 
  3896 lemma TREAL_LE_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal)
  3897    y2::hreal * hreal.
  3898    treal_eq x1 x2 & treal_eq y1 y2 --> treal_le x1 y1 = treal_le x2 y2"
  3899   by (import hollight TREAL_LE_WELLDEF)
  3900 
  3901 lemma TREAL_INV_WELLDEF: "ALL (x::hreal * hreal) y::hreal * hreal.
  3902    treal_eq x y --> treal_eq (treal_inv x) (treal_inv y)"
  3903   by (import hollight TREAL_INV_WELLDEF)
  3904 
  3905 typedef (open) real = "{s::hreal * hreal => bool. EX x::hreal * hreal. s = treal_eq x}"  morphisms "dest_real" "mk_real"
  3906   apply (rule light_ex_imp_nonempty[where t="treal_eq (x::hreal * hreal)"])
  3907   by (import hollight TYDEF_real)
  3908 
  3909 syntax
  3910   dest_real :: _ 
  3911 
  3912 syntax
  3913   mk_real :: _ 
  3914 
  3915 lemmas "TYDEF_real_@intern" = typedef_hol2hollight 
  3916   [where a="a :: hollight.real" and r=r ,
  3917    OF type_definition_real]
  3918 
  3919 constdefs
  3920   real_of_num :: "nat => hollight.real" 
  3921   "real_of_num == %m::nat. mk_real (treal_eq (treal_of_num m))"
  3922 
  3923 lemma DEF_real_of_num: "real_of_num = (%m::nat. mk_real (treal_eq (treal_of_num m)))"
  3924   by (import hollight DEF_real_of_num)
  3925 
  3926 constdefs
  3927   real_neg :: "hollight.real => hollight.real" 
  3928   "real_neg ==
  3929 %x1::hollight.real.
  3930    mk_real
  3931     (%u::hreal * hreal.
  3932         EX x1a::hreal * hreal.
  3933            treal_eq (treal_neg x1a) u & dest_real x1 x1a)"
  3934 
  3935 lemma DEF_real_neg: "real_neg =
  3936 (%x1::hollight.real.
  3937     mk_real
  3938      (%u::hreal * hreal.
  3939          EX x1a::hreal * hreal.
  3940             treal_eq (treal_neg x1a) u & dest_real x1 x1a))"
  3941   by (import hollight DEF_real_neg)
  3942 
  3943 constdefs
  3944   real_add :: "hollight.real => hollight.real => hollight.real" 
  3945   "real_add ==
  3946 %(x1::hollight.real) y1::hollight.real.
  3947    mk_real
  3948     (%u::hreal * hreal.
  3949         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3950            treal_eq (treal_add x1a y1a) u &
  3951            dest_real x1 x1a & dest_real y1 y1a)"
  3952 
  3953 lemma DEF_real_add: "real_add =
  3954 (%(x1::hollight.real) y1::hollight.real.
  3955     mk_real
  3956      (%u::hreal * hreal.
  3957          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3958             treal_eq (treal_add x1a y1a) u &
  3959             dest_real x1 x1a & dest_real y1 y1a))"
  3960   by (import hollight DEF_real_add)
  3961 
  3962 constdefs
  3963   real_mul :: "hollight.real => hollight.real => hollight.real" 
  3964   "real_mul ==
  3965 %(x1::hollight.real) y1::hollight.real.
  3966    mk_real
  3967     (%u::hreal * hreal.
  3968         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3969            treal_eq (treal_mul x1a y1a) u &
  3970            dest_real x1 x1a & dest_real y1 y1a)"
  3971 
  3972 lemma DEF_real_mul: "real_mul =
  3973 (%(x1::hollight.real) y1::hollight.real.
  3974     mk_real
  3975      (%u::hreal * hreal.
  3976          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3977             treal_eq (treal_mul x1a y1a) u &
  3978             dest_real x1 x1a & dest_real y1 y1a))"
  3979   by (import hollight DEF_real_mul)
  3980 
  3981 constdefs
  3982   real_le :: "hollight.real => hollight.real => bool" 
  3983   "real_le ==
  3984 %(x1::hollight.real) y1::hollight.real.
  3985    SOME u::bool.
  3986       EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3987          treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a"
  3988 
  3989 lemma DEF_real_le: "real_le =
  3990 (%(x1::hollight.real) y1::hollight.real.
  3991     SOME u::bool.
  3992        EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3993           treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a)"
  3994   by (import hollight DEF_real_le)
  3995 
  3996 constdefs
  3997   real_inv :: "hollight.real => hollight.real" 
  3998   "real_inv ==
  3999 %x::hollight.real.
  4000    mk_real
  4001     (%u::hreal * hreal.
  4002         EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa)"
  4003 
  4004 lemma DEF_real_inv: "real_inv =
  4005 (%x::hollight.real.
  4006     mk_real
  4007      (%u::hreal * hreal.
  4008          EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa))"
  4009   by (import hollight DEF_real_inv)
  4010 
  4011 constdefs
  4012   real_sub :: "hollight.real => hollight.real => hollight.real" 
  4013   "real_sub == %(u::hollight.real) ua::hollight.real. real_add u (real_neg ua)"
  4014 
  4015 lemma DEF_real_sub: "real_sub = (%(u::hollight.real) ua::hollight.real. real_add u (real_neg ua))"
  4016   by (import hollight DEF_real_sub)
  4017 
  4018 constdefs
  4019   real_lt :: "hollight.real => hollight.real => bool" 
  4020   "real_lt == %(u::hollight.real) ua::hollight.real. ~ real_le ua u"
  4021 
  4022 lemma DEF_real_lt: "real_lt = (%(u::hollight.real) ua::hollight.real. ~ real_le ua u)"
  4023   by (import hollight DEF_real_lt)
  4024 
  4025 consts
  4026   real_ge :: "hollight.real => hollight.real => bool" 
  4027 
  4028 defs
  4029   real_ge_def: "hollight.real_ge == %(u::hollight.real) ua::hollight.real. real_le ua u"
  4030 
  4031 lemma DEF_real_ge: "hollight.real_ge = (%(u::hollight.real) ua::hollight.real. real_le ua u)"
  4032   by (import hollight DEF_real_ge)
  4033 
  4034 consts
  4035   real_gt :: "hollight.real => hollight.real => bool" 
  4036 
  4037 defs
  4038   real_gt_def: "hollight.real_gt == %(u::hollight.real) ua::hollight.real. real_lt ua u"
  4039 
  4040 lemma DEF_real_gt: "hollight.real_gt = (%(u::hollight.real) ua::hollight.real. real_lt ua u)"
  4041   by (import hollight DEF_real_gt)
  4042 
  4043 constdefs
  4044   real_abs :: "hollight.real => hollight.real" 
  4045   "real_abs ==
  4046 %u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u)"
  4047 
  4048 lemma DEF_real_abs: "real_abs =
  4049 (%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u))"
  4050   by (import hollight DEF_real_abs)
  4051 
  4052 constdefs
  4053   real_pow :: "hollight.real => nat => hollight.real" 
  4054   "real_pow ==
  4055 SOME real_pow::hollight.real => nat => hollight.real.
  4056    (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  4057    (ALL (x::hollight.real) n::nat.
  4058        real_pow x (Suc n) = real_mul x (real_pow x n))"
  4059 
  4060 lemma DEF_real_pow: "real_pow =
  4061 (SOME real_pow::hollight.real => nat => hollight.real.
  4062     (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  4063     (ALL (x::hollight.real) n::nat.
  4064         real_pow x (Suc n) = real_mul x (real_pow x n)))"
  4065   by (import hollight DEF_real_pow)
  4066 
  4067 constdefs
  4068   real_div :: "hollight.real => hollight.real => hollight.real" 
  4069   "real_div == %(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua)"
  4070 
  4071 lemma DEF_real_div: "real_div = (%(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua))"
  4072   by (import hollight DEF_real_div)
  4073 
  4074 constdefs
  4075   real_max :: "hollight.real => hollight.real => hollight.real" 
  4076   "real_max == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u"
  4077 
  4078 lemma DEF_real_max: "real_max = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u)"
  4079   by (import hollight DEF_real_max)
  4080 
  4081 constdefs
  4082   real_min :: "hollight.real => hollight.real => hollight.real" 
  4083   "real_min == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua"
  4084 
  4085 lemma DEF_real_min: "real_min = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua)"
  4086   by (import hollight DEF_real_min)
  4087 
  4088 lemma REAL_HREAL_LEMMA1: "EX x::hreal => hollight.real.
  4089    (ALL xa::hollight.real.
  4090        real_le (real_of_num 0) xa = (EX y::hreal. xa = x y)) &
  4091    (ALL (y::hreal) z::hreal. hreal_le y z = real_le (x y) (x z))"
  4092   by (import hollight REAL_HREAL_LEMMA1)
  4093 
  4094 lemma REAL_HREAL_LEMMA2: "EX (x::hollight.real => hreal) r::hreal => hollight.real.
  4095    (ALL xa::hreal. x (r xa) = xa) &
  4096    (ALL xa::hollight.real. real_le (real_of_num 0) xa --> r (x xa) = xa) &
  4097    (ALL x::hreal. real_le (real_of_num 0) (r x)) &
  4098    (ALL (x::hreal) y::hreal. hreal_le x y = real_le (r x) (r y))"
  4099   by (import hollight REAL_HREAL_LEMMA2)
  4100 
  4101 lemma REAL_COMPLETE_SOMEPOS: "ALL P::hollight.real => bool.
  4102    (EX x::hollight.real. P x & real_le (real_of_num 0) x) &
  4103    (EX M::hollight.real. ALL x::hollight.real. P x --> real_le x M) -->
  4104    (EX M::hollight.real.
  4105        (ALL x::hollight.real. P x --> real_le x M) &
  4106        (ALL M'::hollight.real.
  4107            (ALL x::hollight.real. P x --> real_le x M') --> real_le M M'))"
  4108   by (import hollight REAL_COMPLETE_SOMEPOS)
  4109 
  4110 lemma REAL_COMPLETE: "ALL P::hollight.real => bool.
  4111    Ex P &
  4112    (EX M::hollight.real. ALL x::hollight.real. P x --> real_le x M) -->
  4113    (EX M::hollight.real.
  4114        (ALL x::hollight.real. P x --> real_le x M) &
  4115        (ALL M'::hollight.real.
  4116            (ALL x::hollight.real. P x --> real_le x M') --> real_le M M'))"
  4117   by (import hollight REAL_COMPLETE)
  4118 
  4119 lemma REAL_ADD_AC: "real_add (m::hollight.real) (n::hollight.real) = real_add n m &
  4120 real_add (real_add m n) (p::hollight.real) = real_add m (real_add n p) &
  4121 real_add m (real_add n p) = real_add n (real_add m p)"
  4122   by (import hollight REAL_ADD_AC)
  4123 
  4124 lemma REAL_ADD_RINV: "ALL x::hollight.real. real_add x (real_neg x) = real_of_num 0"
  4125   by (import hollight REAL_ADD_RINV)
  4126 
  4127 lemma REAL_EQ_ADD_LCANCEL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4128    (real_add x y = real_add x z) = (y = z)"
  4129   by (import hollight REAL_EQ_ADD_LCANCEL)
  4130 
  4131 lemma REAL_EQ_ADD_RCANCEL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4132    (real_add x z = real_add y z) = (x = y)"
  4133   by (import hollight REAL_EQ_ADD_RCANCEL)
  4134 
  4135 lemma REAL_MUL_RZERO: "ALL x::hollight.real. real_mul x (real_of_num 0) = real_of_num 0"
  4136   by (import hollight REAL_MUL_RZERO)
  4137 
  4138 lemma REAL_MUL_LZERO: "ALL x::hollight.real. real_mul (real_of_num 0) x = real_of_num 0"
  4139   by (import hollight REAL_MUL_LZERO)
  4140 
  4141 lemma REAL_NEG_NEG: "ALL x::hollight.real. real_neg (real_neg x) = x"
  4142   by (import hollight REAL_NEG_NEG)
  4143 
  4144 lemma REAL_MUL_RNEG: "ALL (x::hollight.real) y::hollight.real.
  4145    real_mul x (real_neg y) = real_neg (real_mul x y)"
  4146   by (import hollight REAL_MUL_RNEG)
  4147 
  4148 lemma REAL_MUL_LNEG: "ALL (x::hollight.real) y::hollight.real.
  4149    real_mul (real_neg x) y = real_neg (real_mul x y)"
  4150   by (import hollight REAL_MUL_LNEG)
  4151 
  4152 lemma REAL_NEG_ADD: "ALL (x::hollight.real) y::hollight.real.
  4153    real_neg (real_add x y) = real_add (real_neg x) (real_neg y)"
  4154   by (import hollight REAL_NEG_ADD)
  4155 
  4156 lemma REAL_ADD_RID: "ALL x::hollight.real. real_add x (real_of_num 0) = x"
  4157   by (import hollight REAL_ADD_RID)
  4158 
  4159 lemma REAL_NEG_0: "real_neg (real_of_num 0) = real_of_num 0"
  4160   by (import hollight REAL_NEG_0)
  4161 
  4162 lemma REAL_LE_LNEG: "ALL (x::hollight.real) y::hollight.real.
  4163    real_le (real_neg x) y = real_le (real_of_num 0) (real_add x y)"
  4164   by (import hollight REAL_LE_LNEG)
  4165 
  4166 lemma REAL_LE_NEG2: "ALL (x::hollight.real) y::hollight.real.
  4167    real_le (real_neg x) (real_neg y) = real_le y x"
  4168   by (import hollight REAL_LE_NEG2)
  4169 
  4170 lemma REAL_LE_RNEG: "ALL (x::hollight.real) y::hollight.real.
  4171    real_le x (real_neg y) = real_le (real_add x y) (real_of_num 0)"
  4172   by (import hollight REAL_LE_RNEG)
  4173 
  4174 lemma REAL_OF_NUM_POW: "ALL (x::nat) n::nat. real_pow (real_of_num x) n = real_of_num (EXP x n)"
  4175   by (import hollight REAL_OF_NUM_POW)
  4176 
  4177 lemma REAL_POW_NEG: "ALL (x::hollight.real) n::nat.
  4178    real_pow (real_neg x) n =
  4179    COND (EVEN n) (real_pow x n) (real_neg (real_pow x n))"
  4180   by (import hollight REAL_POW_NEG)
  4181 
  4182 lemma REAL_ABS_NUM: "ALL x::nat. real_abs (real_of_num x) = real_of_num x"
  4183   by (import hollight REAL_ABS_NUM)
  4184 
  4185 lemma REAL_ABS_NEG: "ALL x::hollight.real. real_abs (real_neg x) = real_abs x"
  4186   by (import hollight REAL_ABS_NEG)
  4187 
  4188 lemma REAL_LTE_TOTAL: "ALL (x::hollight.real) xa::hollight.real. real_lt x xa | real_le xa x"
  4189   by (import hollight REAL_LTE_TOTAL)
  4190 
  4191 lemma REAL_LET_TOTAL: "ALL (x::hollight.real) xa::hollight.real. real_le x xa | real_lt xa x"
  4192   by (import hollight REAL_LET_TOTAL)
  4193 
  4194 lemma REAL_LT_IMP_LE: "ALL (x::hollight.real) y::hollight.real. real_lt x y --> real_le x y"
  4195   by (import hollight REAL_LT_IMP_LE)
  4196 
  4197 lemma REAL_LTE_TRANS: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4198    real_lt x y & real_le y z --> real_lt x z"
  4199   by (import hollight REAL_LTE_TRANS)
  4200 
  4201 lemma REAL_LET_TRANS: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4202    real_le x y & real_lt y z --> real_lt x z"
  4203   by (import hollight REAL_LET_TRANS)
  4204 
  4205 lemma REAL_LT_TRANS: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4206    real_lt x y & real_lt y z --> real_lt x z"
  4207   by (import hollight REAL_LT_TRANS)
  4208 
  4209 lemma REAL_LE_ADD: "ALL (x::hollight.real) y::hollight.real.
  4210    real_le (real_of_num 0) x & real_le (real_of_num 0) y -->
  4211    real_le (real_of_num 0) (real_add x y)"
  4212   by (import hollight REAL_LE_ADD)
  4213 
  4214 lemma REAL_LTE_ANTISYM: "ALL (x::hollight.real) y::hollight.real. ~ (real_lt x y & real_le y x)"
  4215   by (import hollight REAL_LTE_ANTISYM)
  4216 
  4217 lemma REAL_SUB_LE: "ALL (x::hollight.real) xa::hollight.real.
  4218    real_le (real_of_num 0) (real_sub x xa) = real_le xa x"
  4219   by (import hollight REAL_SUB_LE)
  4220 
  4221 lemma REAL_NEG_SUB: "ALL (x::hollight.real) xa::hollight.real.
  4222    real_neg (real_sub x xa) = real_sub xa x"
  4223   by (import hollight REAL_NEG_SUB)
  4224 
  4225 lemma REAL_LE_LT: "ALL (x::hollight.real) xa::hollight.real.
  4226    real_le x xa = (real_lt x xa | x = xa)"
  4227   by (import hollight REAL_LE_LT)
  4228 
  4229 lemma REAL_SUB_LT: "ALL (x::hollight.real) xa::hollight.real.
  4230    real_lt (real_of_num 0) (real_sub x xa) = real_lt xa x"
  4231   by (import hollight REAL_SUB_LT)
  4232 
  4233 lemma REAL_NOT_LT: "ALL (x::hollight.real) xa::hollight.real. (~ real_lt x xa) = real_le xa x"
  4234   by (import hollight REAL_NOT_LT)
  4235 
  4236 lemma REAL_SUB_0: "ALL (x::hollight.real) y::hollight.real.
  4237    (real_sub x y = real_of_num 0) = (x = y)"
  4238   by (import hollight REAL_SUB_0)
  4239 
  4240 lemma REAL_LT_LE: "ALL (x::hollight.real) y::hollight.real.
  4241    real_lt x y = (real_le x y & x ~= y)"
  4242   by (import hollight REAL_LT_LE)
  4243 
  4244 lemma REAL_LT_REFL: "ALL x::hollight.real. ~ real_lt x x"
  4245   by (import hollight REAL_LT_REFL)
  4246 
  4247 lemma REAL_LTE_ADD: "ALL (x::hollight.real) y::hollight.real.
  4248    real_lt (real_of_num 0) x & real_le (real_of_num 0) y -->
  4249    real_lt (real_of_num 0) (real_add x y)"
  4250   by (import hollight REAL_LTE_ADD)
  4251 
  4252 lemma REAL_LET_ADD: "ALL (x::hollight.real) y::hollight.real.
  4253    real_le (real_of_num 0) x & real_lt (real_of_num 0) y -->
  4254    real_lt (real_of_num 0) (real_add x y)"
  4255   by (import hollight REAL_LET_ADD)
  4256 
  4257 lemma REAL_LT_ADD: "ALL (x::hollight.real) y::hollight.real.
  4258    real_lt (real_of_num 0) x & real_lt (real_of_num 0) y -->
  4259    real_lt (real_of_num 0) (real_add x y)"
  4260   by (import hollight REAL_LT_ADD)
  4261 
  4262 lemma REAL_ENTIRE: "ALL (x::hollight.real) y::hollight.real.
  4263    (real_mul x y = real_of_num 0) = (x = real_of_num 0 | y = real_of_num 0)"
  4264   by (import hollight REAL_ENTIRE)
  4265 
  4266 lemma REAL_LE_NEGTOTAL: "ALL x::hollight.real.
  4267    real_le (real_of_num 0) x | real_le (real_of_num 0) (real_neg x)"
  4268   by (import hollight REAL_LE_NEGTOTAL)
  4269 
  4270 lemma REAL_LE_SQUARE: "ALL x::hollight.real. real_le (real_of_num 0) (real_mul x x)"
  4271   by (import hollight REAL_LE_SQUARE)
  4272 
  4273 lemma REAL_MUL_RID: "ALL x::hollight.real. real_mul x (real_of_num (NUMERAL_BIT1 0)) = x"
  4274   by (import hollight REAL_MUL_RID)
  4275 
  4276 lemma REAL_POW_2: "ALL x::hollight.real.
  4277    real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0)) = real_mul x x"
  4278   by (import hollight REAL_POW_2)
  4279 
  4280 lemma REAL_POLY_CLAUSES: "(ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4281     real_add x (real_add y z) = real_add (real_add x y) z) &
  4282 (ALL (x::hollight.real) y::hollight.real. real_add x y = real_add y x) &
  4283 (ALL x::hollight.real. real_add (real_of_num 0) x = x) &
  4284 (ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4285     real_mul x (real_mul y z) = real_mul (real_mul x y) z) &
  4286 (ALL (x::hollight.real) y::hollight.real. real_mul x y = real_mul y x) &
  4287 (ALL x::hollight.real. real_mul (real_of_num (NUMERAL_BIT1 0)) x = x) &
  4288 (ALL x::hollight.real. real_mul (real_of_num 0) x = real_of_num 0) &
  4289 (ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4290     real_mul x (real_add xa xb) =
  4291     real_add (real_mul x xa) (real_mul x xb)) &
  4292 (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  4293 (ALL (x::hollight.real) xa::nat.
  4294     real_pow x (Suc xa) = real_mul x (real_pow x xa))"
  4295   by (import hollight REAL_POLY_CLAUSES)
  4296 
  4297 lemma REAL_POLY_NEG_CLAUSES: "(ALL x::hollight.real.
  4298     real_neg x = real_mul (real_neg (real_of_num (NUMERAL_BIT1 0))) x) &
  4299 (ALL (x::hollight.real) xa::hollight.real.
  4300     real_sub x xa =
  4301     real_add x (real_mul (real_neg (real_of_num (NUMERAL_BIT1 0))) xa))"
  4302   by (import hollight REAL_POLY_NEG_CLAUSES)
  4303 
  4304 lemma REAL_POS: "ALL x::nat. real_le (real_of_num 0) (real_of_num x)"
  4305   by (import hollight REAL_POS)
  4306 
  4307 lemma REAL_OF_NUM_LT: "ALL (x::nat) xa::nat. real_lt (real_of_num x) (real_of_num xa) = < x xa"
  4308   by (import hollight REAL_OF_NUM_LT)
  4309 
  4310 lemma REAL_OF_NUM_GE: "ALL (x::nat) xa::nat.
  4311    hollight.real_ge (real_of_num x) (real_of_num xa) = >= x xa"
  4312   by (import hollight REAL_OF_NUM_GE)
  4313 
  4314 lemma REAL_OF_NUM_GT: "ALL (x::nat) xa::nat.
  4315    hollight.real_gt (real_of_num x) (real_of_num xa) = > x xa"
  4316   by (import hollight REAL_OF_NUM_GT)
  4317 
  4318 lemma REAL_OF_NUM_SUC: "ALL x::nat.
  4319    real_add (real_of_num x) (real_of_num (NUMERAL_BIT1 0)) =
  4320    real_of_num (Suc x)"
  4321   by (import hollight REAL_OF_NUM_SUC)
  4322 
  4323 lemma REAL_OF_NUM_SUB: "ALL (m::nat) n::nat.
  4324    <= m n --> real_sub (real_of_num n) (real_of_num m) = real_of_num (n - m)"
  4325   by (import hollight REAL_OF_NUM_SUB)
  4326 
  4327 lemma REAL_MUL_AC: "real_mul (m::hollight.real) (n::hollight.real) = real_mul n m &
  4328 real_mul (real_mul m n) (p::hollight.real) = real_mul m (real_mul n p) &
  4329 real_mul m (real_mul n p) = real_mul n (real_mul m p)"
  4330   by (import hollight REAL_MUL_AC)
  4331 
  4332 lemma REAL_ADD_RDISTRIB: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4333    real_mul (real_add x y) z = real_add (real_mul x z) (real_mul y z)"
  4334   by (import hollight REAL_ADD_RDISTRIB)
  4335 
  4336 lemma REAL_LT_LADD_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4337    real_lt y z --> real_lt (real_add x y) (real_add x z)"
  4338   by (import hollight REAL_LT_LADD_IMP)
  4339 
  4340 lemma REAL_LT_MUL: "ALL (x::hollight.real) y::hollight.real.
  4341    real_lt (real_of_num 0) x & real_lt (real_of_num 0) y -->
  4342    real_lt (real_of_num 0) (real_mul x y)"
  4343   by (import hollight REAL_LT_MUL)
  4344 
  4345 lemma REAL_EQ_ADD_LCANCEL_0: "ALL (x::hollight.real) y::hollight.real.
  4346    (real_add x y = x) = (y = real_of_num 0)"
  4347   by (import hollight REAL_EQ_ADD_LCANCEL_0)
  4348 
  4349 lemma REAL_EQ_ADD_RCANCEL_0: "ALL (x::hollight.real) y::hollight.real.
  4350    (real_add x y = y) = (x = real_of_num 0)"
  4351   by (import hollight REAL_EQ_ADD_RCANCEL_0)
  4352 
  4353 lemma REAL_LNEG_UNIQ: "ALL (x::hollight.real) y::hollight.real.
  4354    (real_add x y = real_of_num 0) = (x = real_neg y)"
  4355   by (import hollight REAL_LNEG_UNIQ)
  4356 
  4357 lemma REAL_RNEG_UNIQ: "ALL (x::hollight.real) y::hollight.real.
  4358    (real_add x y = real_of_num 0) = (y = real_neg x)"
  4359   by (import hollight REAL_RNEG_UNIQ)
  4360 
  4361 lemma REAL_NEG_LMUL: "ALL (x::hollight.real) y::hollight.real.
  4362    real_neg (real_mul x y) = real_mul (real_neg x) y"
  4363   by (import hollight REAL_NEG_LMUL)
  4364 
  4365 lemma REAL_NEG_RMUL: "ALL (x::hollight.real) y::hollight.real.
  4366    real_neg (real_mul x y) = real_mul x (real_neg y)"
  4367   by (import hollight REAL_NEG_RMUL)
  4368 
  4369 lemma REAL_NEGNEG: "ALL x::hollight.real. real_neg (real_neg x) = x"
  4370   by (import hollight REAL_NEGNEG)
  4371 
  4372 lemma REAL_NEG_MUL2: "ALL (x::hollight.real) y::hollight.real.
  4373    real_mul (real_neg x) (real_neg y) = real_mul x y"
  4374   by (import hollight REAL_NEG_MUL2)
  4375 
  4376 lemma REAL_LT_LADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4377    real_lt (real_add x y) (real_add x z) = real_lt y z"
  4378   by (import hollight REAL_LT_LADD)
  4379 
  4380 lemma REAL_LT_RADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4381    real_lt (real_add x z) (real_add y z) = real_lt x y"
  4382   by (import hollight REAL_LT_RADD)
  4383 
  4384 lemma REAL_LT_ANTISYM: "ALL (x::hollight.real) y::hollight.real. ~ (real_lt x y & real_lt y x)"
  4385   by (import hollight REAL_LT_ANTISYM)
  4386 
  4387 lemma REAL_LT_GT: "ALL (x::hollight.real) y::hollight.real. real_lt x y --> ~ real_lt y x"
  4388   by (import hollight REAL_LT_GT)
  4389 
  4390 lemma REAL_NOT_EQ: "ALL (x::hollight.real) y::hollight.real.
  4391    (x ~= y) = (real_lt x y | real_lt y x)"
  4392   by (import hollight REAL_NOT_EQ)
  4393 
  4394 lemma REAL_LE_TOTAL: "ALL (x::hollight.real) y::hollight.real. real_le x y | real_le y x"
  4395   by (import hollight REAL_LE_TOTAL)
  4396 
  4397 lemma REAL_LE_REFL: "ALL x::hollight.real. real_le x x"
  4398   by (import hollight REAL_LE_REFL)
  4399 
  4400 lemma REAL_LE_ANTISYM: "ALL (x::hollight.real) y::hollight.real.
  4401    (real_le x y & real_le y x) = (x = y)"
  4402   by (import hollight REAL_LE_ANTISYM)
  4403 
  4404 lemma REAL_LET_ANTISYM: "ALL (x::hollight.real) y::hollight.real. ~ (real_le x y & real_lt y x)"
  4405   by (import hollight REAL_LET_ANTISYM)
  4406 
  4407 lemma REAL_NEG_LT0: "ALL x::hollight.real.
  4408    real_lt (real_neg x) (real_of_num 0) = real_lt (real_of_num 0) x"
  4409   by (import hollight REAL_NEG_LT0)
  4410 
  4411 lemma REAL_NEG_GT0: "ALL x::hollight.real.
  4412    real_lt (real_of_num 0) (real_neg x) = real_lt x (real_of_num 0)"
  4413   by (import hollight REAL_NEG_GT0)
  4414 
  4415 lemma REAL_NEG_LE0: "ALL x::hollight.real.
  4416    real_le (real_neg x) (real_of_num 0) = real_le (real_of_num 0) x"
  4417   by (import hollight REAL_NEG_LE0)
  4418 
  4419 lemma REAL_NEG_GE0: "ALL x::hollight.real.
  4420    real_le (real_of_num 0) (real_neg x) = real_le x (real_of_num 0)"
  4421   by (import hollight REAL_NEG_GE0)
  4422 
  4423 lemma REAL_LT_TOTAL: "ALL (x::hollight.real) y::hollight.real. x = y | real_lt x y | real_lt y x"
  4424   by (import hollight REAL_LT_TOTAL)
  4425 
  4426 lemma REAL_LT_NEGTOTAL: "ALL x::hollight.real.
  4427    x = real_of_num 0 |
  4428    real_lt (real_of_num 0) x | real_lt (real_of_num 0) (real_neg x)"
  4429   by (import hollight REAL_LT_NEGTOTAL)
  4430 
  4431 lemma REAL_LE_01: "real_le (real_of_num 0) (real_of_num (NUMERAL_BIT1 0))"
  4432   by (import hollight REAL_LE_01)
  4433 
  4434 lemma REAL_LT_01: "real_lt (real_of_num 0) (real_of_num (NUMERAL_BIT1 0))"
  4435   by (import hollight REAL_LT_01)
  4436 
  4437 lemma REAL_LE_LADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4438    real_le (real_add x y) (real_add x z) = real_le y z"
  4439   by (import hollight REAL_LE_LADD)
  4440 
  4441 lemma REAL_LE_RADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4442    real_le (real_add x z) (real_add y z) = real_le x y"
  4443   by (import hollight REAL_LE_RADD)
  4444 
  4445 lemma REAL_LT_ADD2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  4446    z::hollight.real.
  4447    real_lt w x & real_lt y z --> real_lt (real_add w y) (real_add x z)"
  4448   by (import hollight REAL_LT_ADD2)
  4449 
  4450 lemma REAL_LE_ADD2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  4451    z::hollight.real.
  4452    real_le w x & real_le y z --> real_le (real_add w y) (real_add x z)"
  4453   by (import hollight REAL_LE_ADD2)
  4454 
  4455 lemma REAL_LT_LNEG: "ALL (x::hollight.real) xa::hollight.real.
  4456    real_lt (real_neg x) xa = real_lt (real_of_num 0) (real_add x xa)"
  4457   by (import hollight REAL_LT_LNEG)
  4458 
  4459 lemma REAL_LT_RNEG: "ALL (x::hollight.real) xa::hollight.real.
  4460    real_lt x (real_neg xa) = real_lt (real_add x xa) (real_of_num 0)"
  4461   by (import hollight REAL_LT_RNEG)
  4462 
  4463 lemma REAL_LT_ADDNEG: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4464    real_lt y (real_add x (real_neg z)) = real_lt (real_add y z) x"
  4465   by (import hollight REAL_LT_ADDNEG)
  4466 
  4467 lemma REAL_LT_ADDNEG2: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4468    real_lt (real_add x (real_neg y)) z = real_lt x (real_add z y)"
  4469   by (import hollight REAL_LT_ADDNEG2)
  4470 
  4471 lemma REAL_LT_ADD1: "ALL (x::hollight.real) y::hollight.real.
  4472    real_le x y --> real_lt x (real_add y (real_of_num (NUMERAL_BIT1 0)))"
  4473   by (import hollight REAL_LT_ADD1)
  4474 
  4475 lemma REAL_SUB_ADD: "ALL (x::hollight.real) y::hollight.real. real_add (real_sub x y) y = x"
  4476   by (import hollight REAL_SUB_ADD)
  4477 
  4478 lemma REAL_SUB_ADD2: "ALL (x::hollight.real) y::hollight.real. real_add y (real_sub x y) = x"
  4479   by (import hollight REAL_SUB_ADD2)
  4480 
  4481 lemma REAL_SUB_REFL: "ALL x::hollight.real. real_sub x x = real_of_num 0"
  4482   by (import hollight REAL_SUB_REFL)
  4483 
  4484 lemma REAL_LE_DOUBLE: "ALL x::hollight.real.
  4485    real_le (real_of_num 0) (real_add x x) = real_le (real_of_num 0) x"
  4486   by (import hollight REAL_LE_DOUBLE)
  4487 
  4488 lemma REAL_LE_NEGL: "ALL x::hollight.real. real_le (real_neg x) x = real_le (real_of_num 0) x"
  4489   by (import hollight REAL_LE_NEGL)
  4490 
  4491 lemma REAL_LE_NEGR: "ALL x::hollight.real. real_le x (real_neg x) = real_le x (real_of_num 0)"
  4492   by (import hollight REAL_LE_NEGR)
  4493 
  4494 lemma REAL_NEG_EQ_0: "ALL x::hollight.real. (real_neg x = real_of_num 0) = (x = real_of_num 0)"
  4495   by (import hollight REAL_NEG_EQ_0)
  4496 
  4497 lemma REAL_ADD_SUB: "ALL (x::hollight.real) y::hollight.real. real_sub (real_add x y) x = y"
  4498   by (import hollight REAL_ADD_SUB)
  4499 
  4500 lemma REAL_NEG_EQ: "ALL (x::hollight.real) y::hollight.real. (real_neg x = y) = (x = real_neg y)"
  4501   by (import hollight REAL_NEG_EQ)
  4502 
  4503 lemma REAL_NEG_MINUS1: "ALL x::hollight.real.
  4504    real_neg x = real_mul (real_neg (real_of_num (NUMERAL_BIT1 0))) x"
  4505   by (import hollight REAL_NEG_MINUS1)
  4506 
  4507 lemma REAL_LT_IMP_NE: "ALL (x::hollight.real) y::hollight.real. real_lt x y --> x ~= y"
  4508   by (import hollight REAL_LT_IMP_NE)
  4509 
  4510 lemma REAL_LE_ADDR: "ALL (x::hollight.real) y::hollight.real.
  4511    real_le x (real_add x y) = real_le (real_of_num 0) y"
  4512   by (import hollight REAL_LE_ADDR)
  4513 
  4514 lemma REAL_LE_ADDL: "ALL (x::hollight.real) y::hollight.real.
  4515    real_le y (real_add x y) = real_le (real_of_num 0) x"
  4516   by (import hollight REAL_LE_ADDL)
  4517 
  4518 lemma REAL_LT_ADDR: "ALL (x::hollight.real) y::hollight.real.
  4519    real_lt x (real_add x y) = real_lt (real_of_num 0) y"
  4520   by (import hollight REAL_LT_ADDR)
  4521 
  4522 lemma REAL_LT_ADDL: "ALL (x::hollight.real) y::hollight.real.
  4523    real_lt y (real_add x y) = real_lt (real_of_num 0) x"
  4524   by (import hollight REAL_LT_ADDL)
  4525 
  4526 lemma REAL_SUB_SUB: "ALL (x::hollight.real) y::hollight.real.
  4527    real_sub (real_sub x y) x = real_neg y"
  4528   by (import hollight REAL_SUB_SUB)
  4529 
  4530 lemma REAL_LT_ADD_SUB: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4531    real_lt (real_add x y) z = real_lt x (real_sub z y)"
  4532   by (import hollight REAL_LT_ADD_SUB)
  4533 
  4534 lemma REAL_LT_SUB_RADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4535    real_lt (real_sub x y) z = real_lt x (real_add z y)"
  4536   by (import hollight REAL_LT_SUB_RADD)
  4537 
  4538 lemma REAL_LT_SUB_LADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4539    real_lt x (real_sub y z) = real_lt (real_add x z) y"
  4540   by (import hollight REAL_LT_SUB_LADD)
  4541 
  4542 lemma REAL_LE_SUB_LADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4543    real_le x (real_sub y z) = real_le (real_add x z) y"
  4544   by (import hollight REAL_LE_SUB_LADD)
  4545 
  4546 lemma REAL_LE_SUB_RADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4547    real_le (real_sub x y) z = real_le x (real_add z y)"
  4548   by (import hollight REAL_LE_SUB_RADD)
  4549 
  4550 lemma REAL_LT_NEG: "ALL (x::hollight.real) y::hollight.real.
  4551    real_lt (real_neg x) (real_neg y) = real_lt y x"
  4552   by (import hollight REAL_LT_NEG)
  4553 
  4554 lemma REAL_LE_NEG: "ALL (x::hollight.real) y::hollight.real.
  4555    real_le (real_neg x) (real_neg y) = real_le y x"
  4556   by (import hollight REAL_LE_NEG)
  4557 
  4558 lemma REAL_ADD2_SUB2: "ALL (a::hollight.real) (b::hollight.real) (c::hollight.real)
  4559    d::hollight.real.
  4560    real_sub (real_add a b) (real_add c d) =
  4561    real_add (real_sub a c) (real_sub b d)"
  4562   by (import hollight REAL_ADD2_SUB2)
  4563 
  4564 lemma REAL_SUB_LZERO: "ALL x::hollight.real. real_sub (real_of_num 0) x = real_neg x"
  4565   by (import hollight REAL_SUB_LZERO)
  4566 
  4567 lemma REAL_SUB_RZERO: "ALL x::hollight.real. real_sub x (real_of_num 0) = x"
  4568   by (import hollight REAL_SUB_RZERO)
  4569 
  4570 lemma REAL_LET_ADD2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  4571    z::hollight.real.
  4572    real_le w x & real_lt y z --> real_lt (real_add w y) (real_add x z)"
  4573   by (import hollight REAL_LET_ADD2)
  4574 
  4575 lemma REAL_LTE_ADD2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  4576    z::hollight.real.
  4577    real_lt w x & real_le y z --> real_lt (real_add w y) (real_add x z)"
  4578   by (import hollight REAL_LTE_ADD2)
  4579 
  4580 lemma REAL_SUB_LNEG: "ALL (x::hollight.real) y::hollight.real.
  4581    real_sub (real_neg x) y = real_neg (real_add x y)"
  4582   by (import hollight REAL_SUB_LNEG)
  4583 
  4584 lemma REAL_SUB_RNEG: "ALL (x::hollight.real) y::hollight.real.
  4585    real_sub x (real_neg y) = real_add x y"
  4586   by (import hollight REAL_SUB_RNEG)
  4587 
  4588 lemma REAL_SUB_NEG2: "ALL (x::hollight.real) y::hollight.real.
  4589    real_sub (real_neg x) (real_neg y) = real_sub y x"
  4590   by (import hollight REAL_SUB_NEG2)
  4591 
  4592 lemma REAL_SUB_TRIANGLE: "ALL (a::hollight.real) (b::hollight.real) c::hollight.real.
  4593    real_add (real_sub a b) (real_sub b c) = real_sub a c"
  4594   by (import hollight REAL_SUB_TRIANGLE)
  4595 
  4596 lemma REAL_EQ_SUB_LADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4597    (x = real_sub y z) = (real_add x z = y)"
  4598   by (import hollight REAL_EQ_SUB_LADD)
  4599 
  4600 lemma REAL_EQ_SUB_RADD: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4601    (real_sub x y = z) = (x = real_add z y)"
  4602   by (import hollight REAL_EQ_SUB_RADD)
  4603 
  4604 lemma REAL_SUB_SUB2: "ALL (x::hollight.real) y::hollight.real. real_sub x (real_sub x y) = y"
  4605   by (import hollight REAL_SUB_SUB2)
  4606 
  4607 lemma REAL_ADD_SUB2: "ALL (x::hollight.real) y::hollight.real.
  4608    real_sub x (real_add x y) = real_neg y"
  4609   by (import hollight REAL_ADD_SUB2)
  4610 
  4611 lemma REAL_EQ_IMP_LE: "ALL (x::hollight.real) y::hollight.real. x = y --> real_le x y"
  4612   by (import hollight REAL_EQ_IMP_LE)
  4613 
  4614 lemma REAL_POS_NZ: "ALL x::hollight.real. real_lt (real_of_num 0) x --> x ~= real_of_num 0"
  4615   by (import hollight REAL_POS_NZ)
  4616 
  4617 lemma REAL_DIFFSQ: "ALL (x::hollight.real) y::hollight.real.
  4618    real_mul (real_add x y) (real_sub x y) =
  4619    real_sub (real_mul x x) (real_mul y y)"
  4620   by (import hollight REAL_DIFFSQ)
  4621 
  4622 lemma REAL_EQ_NEG2: "ALL (x::hollight.real) y::hollight.real. (real_neg x = real_neg y) = (x = y)"
  4623   by (import hollight REAL_EQ_NEG2)
  4624 
  4625 lemma REAL_LT_NEG2: "ALL (x::hollight.real) y::hollight.real.
  4626    real_lt (real_neg x) (real_neg y) = real_lt y x"
  4627   by (import hollight REAL_LT_NEG2)
  4628 
  4629 lemma REAL_SUB_LDISTRIB: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4630    real_mul x (real_sub y z) = real_sub (real_mul x y) (real_mul x z)"
  4631   by (import hollight REAL_SUB_LDISTRIB)
  4632 
  4633 lemma REAL_SUB_RDISTRIB: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4634    real_mul (real_sub x y) z = real_sub (real_mul x z) (real_mul y z)"
  4635   by (import hollight REAL_SUB_RDISTRIB)
  4636 
  4637 lemma REAL_ABS_ZERO: "ALL x::hollight.real. (real_abs x = real_of_num 0) = (x = real_of_num 0)"
  4638   by (import hollight REAL_ABS_ZERO)
  4639 
  4640 lemma REAL_ABS_0: "real_abs (real_of_num 0) = real_of_num 0"
  4641   by (import hollight REAL_ABS_0)
  4642 
  4643 lemma REAL_ABS_1: "real_abs (real_of_num (NUMERAL_BIT1 0)) = real_of_num (NUMERAL_BIT1 0)"
  4644   by (import hollight REAL_ABS_1)
  4645 
  4646 lemma REAL_ABS_TRIANGLE: "ALL (x::hollight.real) y::hollight.real.
  4647    real_le (real_abs (real_add x y)) (real_add (real_abs x) (real_abs y))"
  4648   by (import hollight REAL_ABS_TRIANGLE)
  4649 
  4650 lemma REAL_ABS_TRIANGLE_LE: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4651    real_le (real_add (real_abs x) (real_abs (real_sub y x))) z -->
  4652    real_le (real_abs y) z"
  4653   by (import hollight REAL_ABS_TRIANGLE_LE)
  4654 
  4655 lemma REAL_ABS_TRIANGLE_LT: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4656    real_lt (real_add (real_abs x) (real_abs (real_sub y x))) z -->
  4657    real_lt (real_abs y) z"
  4658   by (import hollight REAL_ABS_TRIANGLE_LT)
  4659 
  4660 lemma REAL_ABS_POS: "ALL x::hollight.real. real_le (real_of_num 0) (real_abs x)"
  4661   by (import hollight REAL_ABS_POS)
  4662 
  4663 lemma REAL_ABS_SUB: "ALL (x::hollight.real) y::hollight.real.
  4664    real_abs (real_sub x y) = real_abs (real_sub y x)"
  4665   by (import hollight REAL_ABS_SUB)
  4666 
  4667 lemma REAL_ABS_NZ: "ALL x::hollight.real.
  4668    (x ~= real_of_num 0) = real_lt (real_of_num 0) (real_abs x)"
  4669   by (import hollight REAL_ABS_NZ)
  4670 
  4671 lemma REAL_ABS_ABS: "ALL x::hollight.real. real_abs (real_abs x) = real_abs x"
  4672   by (import hollight REAL_ABS_ABS)
  4673 
  4674 lemma REAL_ABS_LE: "ALL x::hollight.real. real_le x (real_abs x)"
  4675   by (import hollight REAL_ABS_LE)
  4676 
  4677 lemma REAL_ABS_REFL: "ALL x::hollight.real. (real_abs x = x) = real_le (real_of_num 0) x"
  4678   by (import hollight REAL_ABS_REFL)
  4679 
  4680 lemma REAL_ABS_BETWEEN: "ALL (x::hollight.real) (y::hollight.real) d::hollight.real.
  4681    (real_lt (real_of_num 0) d &
  4682     real_lt (real_sub x d) y & real_lt y (real_add x d)) =
  4683    real_lt (real_abs (real_sub y x)) d"
  4684   by (import hollight REAL_ABS_BETWEEN)
  4685 
  4686 lemma REAL_ABS_BOUND: "ALL (x::hollight.real) (y::hollight.real) d::hollight.real.
  4687    real_lt (real_abs (real_sub x y)) d --> real_lt y (real_add x d)"
  4688   by (import hollight REAL_ABS_BOUND)
  4689 
  4690 lemma REAL_ABS_STILLNZ: "ALL (x::hollight.real) y::hollight.real.
  4691    real_lt (real_abs (real_sub x y)) (real_abs y) --> x ~= real_of_num 0"
  4692   by (import hollight REAL_ABS_STILLNZ)
  4693 
  4694 lemma REAL_ABS_CASES: "ALL x::hollight.real.
  4695    x = real_of_num 0 | real_lt (real_of_num 0) (real_abs x)"
  4696   by (import hollight REAL_ABS_CASES)
  4697 
  4698 lemma REAL_ABS_BETWEEN1: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4699    real_lt x z & real_lt (real_abs (real_sub y x)) (real_sub z x) -->
  4700    real_lt y z"
  4701   by (import hollight REAL_ABS_BETWEEN1)
  4702 
  4703 lemma REAL_ABS_SIGN: "ALL (x::hollight.real) y::hollight.real.
  4704    real_lt (real_abs (real_sub x y)) y --> real_lt (real_of_num 0) x"
  4705   by (import hollight REAL_ABS_SIGN)
  4706 
  4707 lemma REAL_ABS_SIGN2: "ALL (x::hollight.real) y::hollight.real.
  4708    real_lt (real_abs (real_sub x y)) (real_neg y) -->
  4709    real_lt x (real_of_num 0)"
  4710   by (import hollight REAL_ABS_SIGN2)
  4711 
  4712 lemma REAL_ABS_CIRCLE: "ALL (x::hollight.real) (y::hollight.real) h::hollight.real.
  4713    real_lt (real_abs h) (real_sub (real_abs y) (real_abs x)) -->
  4714    real_lt (real_abs (real_add x h)) (real_abs y)"
  4715   by (import hollight REAL_ABS_CIRCLE)
  4716 
  4717 lemma REAL_SUB_ABS: "ALL (x::hollight.real) y::hollight.real.
  4718    real_le (real_sub (real_abs x) (real_abs y)) (real_abs (real_sub x y))"
  4719   by (import hollight REAL_SUB_ABS)
  4720 
  4721 lemma REAL_ABS_SUB_ABS: "ALL (x::hollight.real) y::hollight.real.
  4722    real_le (real_abs (real_sub (real_abs x) (real_abs y)))
  4723     (real_abs (real_sub x y))"
  4724   by (import hollight REAL_ABS_SUB_ABS)
  4725 
  4726 lemma REAL_ABS_BETWEEN2: "ALL (x0::hollight.real) (x::hollight.real) (y0::hollight.real)
  4727    y::hollight.real.
  4728    real_lt x0 y0 &
  4729    real_lt
  4730     (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
  4731       (real_abs (real_sub x x0)))
  4732     (real_sub y0 x0) &
  4733    real_lt
  4734     (real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
  4735       (real_abs (real_sub y y0)))
  4736     (real_sub y0 x0) -->
  4737    real_lt x y"
  4738   by (import hollight REAL_ABS_BETWEEN2)
  4739 
  4740 lemma REAL_ABS_BOUNDS: "ALL (x::hollight.real) k::hollight.real.
  4741    real_le (real_abs x) k = (real_le (real_neg k) x & real_le x k)"
  4742   by (import hollight REAL_ABS_BOUNDS)
  4743 
  4744 lemma REAL_MIN_MAX: "ALL (x::hollight.real) y::hollight.real.
  4745    real_min x y = real_neg (real_max (real_neg x) (real_neg y))"
  4746   by (import hollight REAL_MIN_MAX)
  4747 
  4748 lemma REAL_MAX_MIN: "ALL (x::hollight.real) y::hollight.real.
  4749    real_max x y = real_neg (real_min (real_neg x) (real_neg y))"
  4750   by (import hollight REAL_MAX_MIN)
  4751 
  4752 lemma REAL_MAX_MAX: "ALL (x::hollight.real) y::hollight.real.
  4753    real_le x (real_max x y) & real_le y (real_max x y)"
  4754   by (import hollight REAL_MAX_MAX)
  4755 
  4756 lemma REAL_MIN_MIN: "ALL (x::hollight.real) y::hollight.real.
  4757    real_le (real_min x y) x & real_le (real_min x y) y"
  4758   by (import hollight REAL_MIN_MIN)
  4759 
  4760 lemma REAL_MAX_SYM: "ALL (x::hollight.real) y::hollight.real. real_max x y = real_max y x"
  4761   by (import hollight REAL_MAX_SYM)
  4762 
  4763 lemma REAL_MIN_SYM: "ALL (x::hollight.real) y::hollight.real. real_min x y = real_min y x"
  4764   by (import hollight REAL_MIN_SYM)
  4765 
  4766 lemma REAL_LE_MAX: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4767    real_le z (real_max x y) = (real_le z x | real_le z y)"
  4768   by (import hollight REAL_LE_MAX)
  4769 
  4770 lemma REAL_LE_MIN: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4771    real_le z (real_min x y) = (real_le z x & real_le z y)"
  4772   by (import hollight REAL_LE_MIN)
  4773 
  4774 lemma REAL_LT_MAX: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4775    real_lt z (real_max x y) = (real_lt z x | real_lt z y)"
  4776   by (import hollight REAL_LT_MAX)
  4777 
  4778 lemma REAL_LT_MIN: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4779    real_lt z (real_min x y) = (real_lt z x & real_lt z y)"
  4780   by (import hollight REAL_LT_MIN)
  4781 
  4782 lemma REAL_MAX_LE: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4783    real_le (real_max x y) z = (real_le x z & real_le y z)"
  4784   by (import hollight REAL_MAX_LE)
  4785 
  4786 lemma REAL_MIN_LE: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4787    real_le (real_min x y) z = (real_le x z | real_le y z)"
  4788   by (import hollight REAL_MIN_LE)
  4789 
  4790 lemma REAL_MAX_LT: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4791    real_lt (real_max x y) z = (real_lt x z & real_lt y z)"
  4792   by (import hollight REAL_MAX_LT)
  4793 
  4794 lemma REAL_MIN_LT: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4795    real_lt (real_min x y) z = (real_lt x z | real_lt y z)"
  4796   by (import hollight REAL_MIN_LT)
  4797 
  4798 lemma REAL_MAX_ASSOC: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4799    real_max x (real_max y z) = real_max (real_max x y) z"
  4800   by (import hollight REAL_MAX_ASSOC)
  4801 
  4802 lemma REAL_MIN_ASSOC: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4803    real_min x (real_min y z) = real_min (real_min x y) z"
  4804   by (import hollight REAL_MIN_ASSOC)
  4805 
  4806 lemma REAL_MAX_ACI: "real_max (x::hollight.real) (y::hollight.real) = real_max y x &
  4807 real_max (real_max x y) (z::hollight.real) = real_max x (real_max y z) &
  4808 real_max x (real_max y z) = real_max y (real_max x z) &
  4809 real_max x x = x & real_max x (real_max x y) = real_max x y"
  4810   by (import hollight REAL_MAX_ACI)
  4811 
  4812 lemma REAL_MIN_ACI: "real_min (x::hollight.real) (y::hollight.real) = real_min y x &
  4813 real_min (real_min x y) (z::hollight.real) = real_min x (real_min y z) &
  4814 real_min x (real_min y z) = real_min y (real_min x z) &
  4815 real_min x x = x & real_min x (real_min x y) = real_min x y"
  4816   by (import hollight REAL_MIN_ACI)
  4817 
  4818 lemma REAL_ABS_MUL: "ALL (x::hollight.real) y::hollight.real.
  4819    real_abs (real_mul x y) = real_mul (real_abs x) (real_abs y)"
  4820   by (import hollight REAL_ABS_MUL)
  4821 
  4822 lemma REAL_POW_LE: "ALL (x::hollight.real) n::nat.
  4823    real_le (real_of_num 0) x --> real_le (real_of_num 0) (real_pow x n)"
  4824   by (import hollight REAL_POW_LE)
  4825 
  4826 lemma REAL_POW_LT: "ALL (x::hollight.real) n::nat.
  4827    real_lt (real_of_num 0) x --> real_lt (real_of_num 0) (real_pow x n)"
  4828   by (import hollight REAL_POW_LT)
  4829 
  4830 lemma REAL_ABS_POW: "ALL (x::hollight.real) n::nat.
  4831    real_abs (real_pow x n) = real_pow (real_abs x) n"
  4832   by (import hollight REAL_ABS_POW)
  4833 
  4834 lemma REAL_LE_LMUL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4835    real_le (real_of_num 0) x & real_le xa xb -->
  4836    real_le (real_mul x xa) (real_mul x xb)"
  4837   by (import hollight REAL_LE_LMUL)
  4838 
  4839 lemma REAL_LE_RMUL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4840    real_le x y & real_le (real_of_num 0) z -->
  4841    real_le (real_mul x z) (real_mul y z)"
  4842   by (import hollight REAL_LE_RMUL)
  4843 
  4844 lemma REAL_LT_LMUL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4845    real_lt (real_of_num 0) x & real_lt xa xb -->
  4846    real_lt (real_mul x xa) (real_mul x xb)"
  4847   by (import hollight REAL_LT_LMUL)
  4848 
  4849 lemma REAL_LT_RMUL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4850    real_lt x y & real_lt (real_of_num 0) z -->
  4851    real_lt (real_mul x z) (real_mul y z)"
  4852   by (import hollight REAL_LT_RMUL)
  4853 
  4854 lemma REAL_EQ_MUL_LCANCEL: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4855    (real_mul x y = real_mul x z) = (x = real_of_num 0 | y = z)"
  4856   by (import hollight REAL_EQ_MUL_LCANCEL)
  4857 
  4858 lemma REAL_EQ_MUL_RCANCEL: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4859    (real_mul x xb = real_mul xa xb) = (x = xa | xb = real_of_num 0)"
  4860   by (import hollight REAL_EQ_MUL_RCANCEL)
  4861 
  4862 lemma REAL_MUL_LINV_UNIQ: "ALL (x::hollight.real) y::hollight.real.
  4863    real_mul x y = real_of_num (NUMERAL_BIT1 0) --> real_inv y = x"
  4864   by (import hollight REAL_MUL_LINV_UNIQ)
  4865 
  4866 lemma REAL_MUL_RINV_UNIQ: "ALL (x::hollight.real) xa::hollight.real.
  4867    real_mul x xa = real_of_num (NUMERAL_BIT1 0) --> real_inv x = xa"
  4868   by (import hollight REAL_MUL_RINV_UNIQ)
  4869 
  4870 lemma REAL_INV_INV: "ALL x::hollight.real. real_inv (real_inv x) = x"
  4871   by (import hollight REAL_INV_INV)
  4872 
  4873 lemma REAL_INV_EQ_0: "ALL x::hollight.real. (real_inv x = real_of_num 0) = (x = real_of_num 0)"
  4874   by (import hollight REAL_INV_EQ_0)
  4875 
  4876 lemma REAL_LT_INV: "ALL x::hollight.real.
  4877    real_lt (real_of_num 0) x --> real_lt (real_of_num 0) (real_inv x)"
  4878   by (import hollight REAL_LT_INV)
  4879 
  4880 lemma REAL_LT_INV_EQ: "ALL x::hollight.real.
  4881    real_lt (real_of_num 0) (real_inv x) = real_lt (real_of_num 0) x"
  4882   by (import hollight REAL_LT_INV_EQ)
  4883 
  4884 lemma REAL_INV_NEG: "ALL x::hollight.real. real_inv (real_neg x) = real_neg (real_inv x)"
  4885   by (import hollight REAL_INV_NEG)
  4886 
  4887 lemma REAL_LE_INV_EQ: "ALL x::hollight.real.
  4888    real_le (real_of_num 0) (real_inv x) = real_le (real_of_num 0) x"
  4889   by (import hollight REAL_LE_INV_EQ)
  4890 
  4891 lemma REAL_LE_INV: "ALL x::hollight.real.
  4892    real_le (real_of_num 0) x --> real_le (real_of_num 0) (real_inv x)"
  4893   by (import hollight REAL_LE_INV)
  4894 
  4895 lemma REAL_MUL_RINV: "ALL x::hollight.real.
  4896    x ~= real_of_num 0 -->
  4897    real_mul x (real_inv x) = real_of_num (NUMERAL_BIT1 0)"
  4898   by (import hollight REAL_MUL_RINV)
  4899 
  4900 lemma REAL_INV_1: "real_inv (real_of_num (NUMERAL_BIT1 0)) = real_of_num (NUMERAL_BIT1 0)"
  4901   by (import hollight REAL_INV_1)
  4902 
  4903 lemma REAL_DIV_1: "ALL x::hollight.real. real_div x (real_of_num (NUMERAL_BIT1 0)) = x"
  4904   by (import hollight REAL_DIV_1)
  4905 
  4906 lemma REAL_DIV_REFL: "ALL x::hollight.real.
  4907    x ~= real_of_num 0 --> real_div x x = real_of_num (NUMERAL_BIT1 0)"
  4908   by (import hollight REAL_DIV_REFL)
  4909 
  4910 lemma REAL_DIV_RMUL: "ALL (x::hollight.real) xa::hollight.real.
  4911    xa ~= real_of_num 0 --> real_mul (real_div x xa) xa = x"
  4912   by (import hollight REAL_DIV_RMUL)
  4913 
  4914 lemma REAL_DIV_LMUL: "ALL (x::hollight.real) xa::hollight.real.
  4915    xa ~= real_of_num 0 --> real_mul xa (real_div x xa) = x"
  4916   by (import hollight REAL_DIV_LMUL)
  4917 
  4918 lemma REAL_ABS_INV: "ALL x::hollight.real. real_abs (real_inv x) = real_inv (real_abs x)"
  4919   by (import hollight REAL_ABS_INV)
  4920 
  4921 lemma REAL_ABS_DIV: "ALL (x::hollight.real) xa::hollight.real.
  4922    real_abs (real_div x xa) = real_div (real_abs x) (real_abs xa)"
  4923   by (import hollight REAL_ABS_DIV)
  4924 
  4925 lemma REAL_INV_MUL: "ALL (x::hollight.real) y::hollight.real.
  4926    real_inv (real_mul x y) = real_mul (real_inv x) (real_inv y)"
  4927   by (import hollight REAL_INV_MUL)
  4928 
  4929 lemma REAL_INV_DIV: "ALL (x::hollight.real) xa::hollight.real.
  4930    real_inv (real_div x xa) = real_div xa x"
  4931   by (import hollight REAL_INV_DIV)
  4932 
  4933 lemma REAL_POW_MUL: "ALL (x::hollight.real) (y::hollight.real) n::nat.
  4934    real_pow (real_mul x y) n = real_mul (real_pow x n) (real_pow y n)"
  4935   by (import hollight REAL_POW_MUL)
  4936 
  4937 lemma REAL_POW_INV: "ALL (x::hollight.real) n::nat.
  4938    real_pow (real_inv x) n = real_inv (real_pow x n)"
  4939   by (import hollight REAL_POW_INV)
  4940 
  4941 lemma REAL_POW_DIV: "ALL (x::hollight.real) (xa::hollight.real) xb::nat.
  4942    real_pow (real_div x xa) xb = real_div (real_pow x xb) (real_pow xa xb)"
  4943   by (import hollight REAL_POW_DIV)
  4944 
  4945 lemma REAL_POW_ADD: "ALL (x::hollight.real) (m::nat) n::nat.
  4946    real_pow x (m + n) = real_mul (real_pow x m) (real_pow x n)"
  4947   by (import hollight REAL_POW_ADD)
  4948 
  4949 lemma REAL_POW_NZ: "ALL (x::hollight.real) n::nat.
  4950    x ~= real_of_num 0 --> real_pow x n ~= real_of_num 0"
  4951   by (import hollight REAL_POW_NZ)
  4952 
  4953 lemma REAL_POW_SUB: "ALL (x::hollight.real) (m::nat) n::nat.
  4954    x ~= real_of_num 0 & <= m n -->
  4955    real_pow x (n - m) = real_div (real_pow x n) (real_pow x m)"
  4956   by (import hollight REAL_POW_SUB)
  4957 
  4958 lemma REAL_LT_IMP_NZ: "ALL x::hollight.real. real_lt (real_of_num 0) x --> x ~= real_of_num 0"
  4959   by (import hollight REAL_LT_IMP_NZ)
  4960 
  4961 lemma REAL_LT_LCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4962    real_lt (real_of_num 0) x & real_lt (real_mul x y) (real_mul x z) -->
  4963    real_lt y z"
  4964   by (import hollight REAL_LT_LCANCEL_IMP)
  4965 
  4966 lemma REAL_LT_RCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4967    real_lt (real_of_num 0) xb & real_lt (real_mul x xb) (real_mul xa xb) -->
  4968    real_lt x xa"
  4969   by (import hollight REAL_LT_RCANCEL_IMP)
  4970 
  4971 lemma REAL_LE_LCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4972    real_lt (real_of_num 0) x & real_le (real_mul x y) (real_mul x z) -->
  4973    real_le y z"
  4974   by (import hollight REAL_LE_LCANCEL_IMP)
  4975 
  4976 lemma REAL_LE_RCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4977    real_lt (real_of_num 0) xb & real_le (real_mul x xb) (real_mul xa xb) -->
  4978    real_le x xa"
  4979   by (import hollight REAL_LE_RCANCEL_IMP)
  4980 
  4981 lemma REAL_LE_RMUL_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4982    real_lt (real_of_num 0) z -->
  4983    real_le (real_mul x z) (real_mul y z) = real_le x y"
  4984   by (import hollight REAL_LE_RMUL_EQ)
  4985 
  4986 lemma REAL_LE_LMUL_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  4987    real_lt (real_of_num 0) z -->
  4988    real_le (real_mul z x) (real_mul z y) = real_le x y"
  4989   by (import hollight REAL_LE_LMUL_EQ)
  4990 
  4991 lemma REAL_LT_RMUL_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4992    real_lt (real_of_num 0) xb -->
  4993    real_lt (real_mul x xb) (real_mul xa xb) = real_lt x xa"
  4994   by (import hollight REAL_LT_RMUL_EQ)
  4995 
  4996 lemma REAL_LT_LMUL_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  4997    real_lt (real_of_num 0) xb -->
  4998    real_lt (real_mul xb x) (real_mul xb xa) = real_lt x xa"
  4999   by (import hollight REAL_LT_LMUL_EQ)
  5000 
  5001 lemma REAL_LE_RDIV_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  5002    real_lt (real_of_num 0) z -->
  5003    real_le x (real_div y z) = real_le (real_mul x z) y"
  5004   by (import hollight REAL_LE_RDIV_EQ)
  5005 
  5006 lemma REAL_LE_LDIV_EQ: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  5007    real_lt (real_of_num 0) z -->
  5008    real_le (real_div x z) y = real_le x (real_mul y z)"
  5009   by (import hollight REAL_LE_LDIV_EQ)
  5010 
  5011 lemma REAL_LT_RDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5012    real_lt (real_of_num 0) xb -->
  5013    real_lt x (real_div xa xb) = real_lt (real_mul x xb) xa"
  5014   by (import hollight REAL_LT_RDIV_EQ)
  5015 
  5016 lemma REAL_LT_LDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5017    real_lt (real_of_num 0) xb -->
  5018    real_lt (real_div x xb) xa = real_lt x (real_mul xa xb)"
  5019   by (import hollight REAL_LT_LDIV_EQ)
  5020 
  5021 lemma REAL_EQ_RDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5022    real_lt (real_of_num 0) xb -->
  5023    (x = real_div xa xb) = (real_mul x xb = xa)"
  5024   by (import hollight REAL_EQ_RDIV_EQ)
  5025 
  5026 lemma REAL_EQ_LDIV_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5027    real_lt (real_of_num 0) xb -->
  5028    (real_div x xb = xa) = (x = real_mul xa xb)"
  5029   by (import hollight REAL_EQ_LDIV_EQ)
  5030 
  5031 lemma REAL_LT_DIV2_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5032    real_lt (real_of_num 0) xb -->
  5033    real_lt (real_div x xb) (real_div xa xb) = real_lt x xa"
  5034   by (import hollight REAL_LT_DIV2_EQ)
  5035 
  5036 lemma REAL_LE_DIV2_EQ: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5037    real_lt (real_of_num 0) xb -->
  5038    real_le (real_div x xb) (real_div xa xb) = real_le x xa"
  5039   by (import hollight REAL_LE_DIV2_EQ)
  5040 
  5041 lemma REAL_MUL_2: "ALL x::hollight.real.
  5042    real_mul (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) x = real_add x x"
  5043   by (import hollight REAL_MUL_2)
  5044 
  5045 lemma REAL_POW_EQ_0: "ALL (x::hollight.real) n::nat.
  5046    (real_pow x n = real_of_num 0) = (x = real_of_num 0 & n ~= 0)"
  5047   by (import hollight REAL_POW_EQ_0)
  5048 
  5049 lemma REAL_LE_MUL2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  5050    z::hollight.real.
  5051    real_le (real_of_num 0) w &
  5052    real_le w x & real_le (real_of_num 0) y & real_le y z -->
  5053    real_le (real_mul w y) (real_mul x z)"
  5054   by (import hollight REAL_LE_MUL2)
  5055 
  5056 lemma REAL_LT_MUL2: "ALL (w::hollight.real) (x::hollight.real) (y::hollight.real)
  5057    z::hollight.real.
  5058    real_le (real_of_num 0) w &
  5059    real_lt w x & real_le (real_of_num 0) y & real_lt y z -->
  5060    real_lt (real_mul w y) (real_mul x z)"
  5061   by (import hollight REAL_LT_MUL2)
  5062 
  5063 lemma REAL_LT_SQUARE: "ALL x::hollight.real.
  5064    real_lt (real_of_num 0) (real_mul x x) = (x ~= real_of_num 0)"
  5065   by (import hollight REAL_LT_SQUARE)
  5066 
  5067 lemma REAL_INV_LE_1: "ALL x::hollight.real.
  5068    real_le (real_of_num (NUMERAL_BIT1 0)) x -->
  5069    real_le (real_inv x) (real_of_num (NUMERAL_BIT1 0))"
  5070   by (import hollight REAL_INV_LE_1)
  5071 
  5072 lemma REAL_POW_LE_1: "ALL (n::nat) x::hollight.real.
  5073    real_le (real_of_num (NUMERAL_BIT1 0)) x -->
  5074    real_le (real_of_num (NUMERAL_BIT1 0)) (real_pow x n)"
  5075   by (import hollight REAL_POW_LE_1)
  5076 
  5077 lemma REAL_POW_1_LE: "ALL (n::nat) x::hollight.real.
  5078    real_le (real_of_num 0) x & real_le x (real_of_num (NUMERAL_BIT1 0)) -->
  5079    real_le (real_pow x n) (real_of_num (NUMERAL_BIT1 0))"
  5080   by (import hollight REAL_POW_1_LE)
  5081 
  5082 lemma REAL_POW_1: "ALL x::hollight.real. real_pow x (NUMERAL_BIT1 0) = x"
  5083   by (import hollight REAL_POW_1)
  5084 
  5085 lemma REAL_POW_ONE: "ALL n::nat.
  5086    real_pow (real_of_num (NUMERAL_BIT1 0)) n = real_of_num (NUMERAL_BIT1 0)"
  5087   by (import hollight REAL_POW_ONE)
  5088 
  5089 lemma REAL_LT_INV2: "ALL (x::hollight.real) y::hollight.real.
  5090    real_lt (real_of_num 0) x & real_lt x y -->
  5091    real_lt (real_inv y) (real_inv x)"
  5092   by (import hollight REAL_LT_INV2)
  5093 
  5094 lemma REAL_LE_INV2: "ALL (x::hollight.real) y::hollight.real.
  5095    real_lt (real_of_num 0) x & real_le x y -->
  5096    real_le (real_inv y) (real_inv x)"
  5097   by (import hollight REAL_LE_INV2)
  5098 
  5099 lemma REAL_INV_1_LE: "ALL x::hollight.real.
  5100    real_lt (real_of_num 0) x & real_le x (real_of_num (NUMERAL_BIT1 0)) -->
  5101    real_le (real_of_num (NUMERAL_BIT1 0)) (real_inv x)"
  5102   by (import hollight REAL_INV_1_LE)
  5103 
  5104 lemma REAL_SUB_INV: "ALL (x::hollight.real) xa::hollight.real.
  5105    x ~= real_of_num 0 & xa ~= real_of_num 0 -->
  5106    real_sub (real_inv x) (real_inv xa) =
  5107    real_div (real_sub xa x) (real_mul x xa)"
  5108   by (import hollight REAL_SUB_INV)
  5109 
  5110 lemma REAL_DOWN: "ALL d::hollight.real.
  5111    real_lt (real_of_num 0) d -->
  5112    (EX x::hollight.real. real_lt (real_of_num 0) x & real_lt x d)"
  5113   by (import hollight REAL_DOWN)
  5114 
  5115 lemma REAL_DOWN2: "ALL (d1::hollight.real) d2::hollight.real.
  5116    real_lt (real_of_num 0) d1 & real_lt (real_of_num 0) d2 -->
  5117    (EX e::hollight.real.
  5118        real_lt (real_of_num 0) e & real_lt e d1 & real_lt e d2)"
  5119   by (import hollight REAL_DOWN2)
  5120 
  5121 lemma REAL_POW_LE2: "ALL (n::nat) (x::hollight.real) y::hollight.real.
  5122    real_le (real_of_num 0) x & real_le x y -->
  5123    real_le (real_pow x n) (real_pow y n)"
  5124   by (import hollight REAL_POW_LE2)
  5125 
  5126 lemma REAL_POW_MONO: "ALL (m::nat) (n::nat) x::hollight.real.
  5127    real_le (real_of_num (NUMERAL_BIT1 0)) x & <= m n -->
  5128    real_le (real_pow x m) (real_pow x n)"
  5129   by (import hollight REAL_POW_MONO)
  5130 
  5131 lemma REAL_POW_LT2: "ALL (n::nat) (x::hollight.real) y::hollight.real.
  5132    n ~= 0 & real_le (real_of_num 0) x & real_lt x y -->
  5133    real_lt (real_pow x n) (real_pow y n)"
  5134   by (import hollight REAL_POW_LT2)
  5135 
  5136 lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::hollight.real.
  5137    real_lt (real_of_num (NUMERAL_BIT1 0)) x & < m n -->
  5138    real_lt (real_pow x m) (real_pow x n)"
  5139   by (import hollight REAL_POW_MONO_LT)
  5140 
  5141 lemma REAL_POW_POW: "ALL (x::hollight.real) (m::nat) n::nat.
  5142    real_pow (real_pow x m) n = real_pow x (m * n)"
  5143   by (import hollight REAL_POW_POW)
  5144 
  5145 lemma REAL_EQ_RCANCEL_IMP: "ALL (x::hollight.real) (y::hollight.real) z::hollight.real.
  5146    z ~= real_of_num 0 & real_mul x z = real_mul y z --> x = y"
  5147   by (import hollight REAL_EQ_RCANCEL_IMP)
  5148 
  5149 lemma REAL_EQ_LCANCEL_IMP: "ALL (x::hollight.real) (xa::hollight.real) xb::hollight.real.
  5150    xb ~= real_of_num 0 & real_mul xb x = real_mul xb xa --> x = xa"
  5151   by (import hollight REAL_EQ_LCANCEL_IMP)
  5152 
  5153 lemma REAL_LT_DIV: "ALL (x::hollight.real) xa::hollight.real.
  5154    real_lt (real_of_num 0) x & real_lt (real_of_num 0) xa -->
  5155    real_lt (real_of_num 0) (real_div x xa)"
  5156   by (import hollight REAL_LT_DIV)
  5157 
  5158 lemma REAL_LE_DIV: "ALL (x::hollight.real) xa::hollight.real.
  5159    real_le (real_of_num 0) x & real_le (real_of_num 0) xa -->
  5160    real_le (real_of_num 0) (real_div x xa)"
  5161   by (import hollight REAL_LE_DIV)
  5162 
  5163 lemma REAL_DIV_POW2: "ALL (x::hollight.real) (m::nat) n::nat.
  5164    x ~= real_of_num 0 -->
  5165    real_div (real_pow x m) (real_pow x n) =
  5166    COND (<= n m) (real_pow x (m - n)) (real_inv (real_pow x (n - m)))"
  5167   by (import hollight REAL_DIV_POW2)
  5168 
  5169 lemma REAL_DIV_POW2_ALT: "ALL (x::hollight.real) (m::nat) n::nat.
  5170    x ~= real_of_num 0 -->
  5171    real_div (real_pow x m) (real_pow x n) =
  5172    COND (< n m) (real_pow x (m - n)) (real_inv (real_pow x (n - m)))"
  5173   by (import hollight REAL_DIV_POW2_ALT)
  5174 
  5175 lemma REAL_LT_POW2: "ALL x::nat.
  5176    real_lt (real_of_num 0)
  5177     (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) x)"
  5178   by (import hollight REAL_LT_POW2)
  5179 
  5180 lemma REAL_LE_POW2: "ALL n::nat.
  5181    real_le (real_of_num (NUMERAL_BIT1 0))
  5182     (real_pow (real_of_num (NUMERAL_BIT0 (NUMERAL_BIT1 0))) n)"
  5183   by (import hollight REAL_LE_POW2)
  5184 
  5185 lemma REAL_POW2_ABS: "ALL x::hollight.real.
  5186    real_pow (real_abs x) (NUMERAL_BIT0 (NUMERAL_BIT1 0)) =
  5187    real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0))"
  5188   by (import hollight REAL_POW2_ABS)
  5189 
  5190 lemma REAL_LE_SQUARE_ABS: "ALL (x::hollight.real) y::hollight.real.
  5191    real_le (real_abs x) (real_abs y) =
  5192    real_le (real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
  5193     (real_pow y (NUMERAL_BIT0 (NUMERAL_BIT1 0)))"
  5194   by (import hollight REAL_LE_SQUARE_ABS)
  5195 
  5196 lemma REAL_SOS_EQ_0: "ALL (x::hollight.real) y::hollight.real.
  5197    (real_add (real_pow x (NUMERAL_BIT0 (NUMERAL_BIT1 0)))
  5198      (real_pow y (NUMERAL_BIT0 (NUMERAL_BIT1 0))) =
  5199     real_of_num 0) =
  5200    (x = real_of_num 0 & y = real_of_num 0)"
  5201   by (import hollight REAL_SOS_EQ_0)
  5202 
  5203 lemma REAL_WLOG_LE: "(ALL (x::hollight.real) y::hollight.real.
  5204     (P::hollight.real => hollight.real => bool) x y = P y x) &
  5205 (ALL (x::hollight.real) y::hollight.real. real_le x y --> P x y) -->
  5206 (ALL x::hollight.real. All (P x))"
  5207   by (import hollight REAL_WLOG_LE)
  5208 
  5209 lemma REAL_WLOG_LT: "(ALL x::hollight.real. (P::hollight.real => hollight.real => bool) x x) &
  5210 (ALL (x::hollight.real) y::hollight.real. P x y = P y x) &
  5211 (ALL (x::hollight.real) y::hollight.real. real_lt x y --> P x y) -->
  5212 (ALL x::hollight.real. All (P x))"
  5213   by (import hollight REAL_WLOG_LT)
  5214 
  5215 constdefs
  5216   mod_real :: "hollight.real => hollight.real => hollight.real => bool" 
  5217   "mod_real ==
  5218 %(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5219    EX q::hollight.real. real_sub ua ub = real_mul q u"
  5220 
  5221 lemma DEF_mod_real: "mod_real =
  5222 (%(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5223     EX q::hollight.real. real_sub ua ub = real_mul q u)"
  5224   by (import hollight DEF_mod_real)
  5225 
  5226 constdefs
  5227   DECIMAL :: "nat => nat => hollight.real" 
  5228   "DECIMAL == %(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua)"
  5229 
  5230 lemma DEF_DECIMAL: "DECIMAL = (%(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua))"
  5231   by (import hollight DEF_DECIMAL)
  5232 
  5233 lemma RAT_LEMMA1: "(y1::hollight.real) ~= real_of_num 0 &
  5234 (y2::hollight.real) ~= real_of_num 0 -->
  5235 real_add (real_div (x1::hollight.real) y1)
  5236  (real_div (x2::hollight.real) y2) =
  5237 real_mul (real_add (real_mul x1 y2) (real_mul x2 y1))
  5238  (real_mul (real_inv y1) (real_inv y2))"
  5239   by (import hollight RAT_LEMMA1)
  5240 
  5241 lemma RAT_LEMMA2: "real_lt (real_of_num 0) (y1::hollight.real) &
  5242 real_lt (real_of_num 0) (y2::hollight.real) -->
  5243 real_add (real_div (x1::hollight.real) y1)
  5244  (real_div (x2::hollight.real) y2) =
  5245 real_mul (real_add (real_mul x1 y2) (real_mul x2 y1))
  5246  (real_mul (real_inv y1) (real_inv y2))"
  5247   by (import hollight RAT_LEMMA2)
  5248 
  5249 lemma RAT_LEMMA3: "real_lt (real_of_num 0) (y1::hollight.real) &
  5250 real_lt (real_of_num 0) (y2::hollight.real) -->
  5251 real_sub (real_div (x1::hollight.real) y1)
  5252  (real_div (x2::hollight.real) y2) =
  5253 real_mul (real_sub (real_mul x1 y2) (real_mul x2 y1))
  5254  (real_mul (real_inv y1) (real_inv y2))"
  5255   by (import hollight RAT_LEMMA3)
  5256 
  5257 lemma RAT_LEMMA4: "real_lt (real_of_num 0) (y1::hollight.real) &
  5258 real_lt (real_of_num 0) (y2::hollight.real) -->
  5259 real_le (real_div (x1::hollight.real) y1)
  5260  (real_div (x2::hollight.real) y2) =
  5261 real_le (real_mul x1 y2) (real_mul x2 y1)"
  5262   by (import hollight RAT_LEMMA4)
  5263 
  5264 lemma RAT_LEMMA5: "real_lt (real_of_num 0) (y1::hollight.real) &
  5265 real_lt (real_of_num 0) (y2::hollight.real) -->
  5266 (real_div (x1::hollight.real) y1 = real_div (x2::hollight.real) y2) =
  5267 (real_mul x1 y2 = real_mul x2 y1)"
  5268   by (import hollight RAT_LEMMA5)
  5269 
  5270 constdefs
  5271   is_int :: "hollight.real => bool" 
  5272   "is_int ==
  5273 %u::hollight.real.
  5274    EX n::nat. u = real_of_num n | u = real_neg (real_of_num n)"
  5275 
  5276 lemma DEF_is_int: "is_int =
  5277 (%u::hollight.real.
  5278     EX n::nat. u = real_of_num n | u = real_neg (real_of_num n))"
  5279   by (import hollight DEF_is_int)
  5280 
  5281 typedef (open) int = "Collect is_int"  morphisms "dest_int" "mk_int"
  5282   apply (rule light_ex_imp_nonempty[where t="real_of_num (NUMERAL 0)"])
  5283   by (import hollight TYDEF_int)
  5284 
  5285 syntax
  5286   dest_int :: _ 
  5287 
  5288 syntax
  5289   mk_int :: _ 
  5290 
  5291 lemmas "TYDEF_int_@intern" = typedef_hol2hollight 
  5292   [where a="a :: hollight.int" and r=r ,
  5293    OF type_definition_int]
  5294 
  5295 lemma dest_int_rep: "ALL x::hollight.int.
  5296    EX n::nat.
  5297       dest_int x = real_of_num n | dest_int x = real_neg (real_of_num n)"
  5298   by (import hollight dest_int_rep)
  5299 
  5300 constdefs
  5301   int_le :: "hollight.int => hollight.int => bool" 
  5302   "int_le ==
  5303 %(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua)"
  5304 
  5305 lemma DEF_int_le: "int_le =
  5306 (%(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua))"
  5307   by (import hollight DEF_int_le)
  5308 
  5309 constdefs
  5310   int_lt :: "hollight.int => hollight.int => bool" 
  5311   "int_lt ==
  5312 %(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua)"
  5313 
  5314 lemma DEF_int_lt: "int_lt =
  5315 (%(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua))"
  5316   by (import hollight DEF_int_lt)
  5317 
  5318 constdefs
  5319   int_ge :: "hollight.int => hollight.int => bool" 
  5320   "int_ge ==
  5321 %(u::hollight.int) ua::hollight.int.
  5322    hollight.real_ge (dest_int u) (dest_int ua)"
  5323 
  5324 lemma DEF_int_ge: "int_ge =
  5325 (%(u::hollight.int) ua::hollight.int.
  5326     hollight.real_ge (dest_int u) (dest_int ua))"
  5327   by (import hollight DEF_int_ge)
  5328 
  5329 constdefs
  5330   int_gt :: "hollight.int => hollight.int => bool" 
  5331   "int_gt ==
  5332 %(u::hollight.int) ua::hollight.int.
  5333    hollight.real_gt (dest_int u) (dest_int ua)"
  5334 
  5335 lemma DEF_int_gt: "int_gt =
  5336 (%(u::hollight.int) ua::hollight.int.
  5337     hollight.real_gt (dest_int u) (dest_int ua))"
  5338   by (import hollight DEF_int_gt)
  5339 
  5340 constdefs
  5341   int_of_num :: "nat => hollight.int" 
  5342   "int_of_num == %u::nat. mk_int (real_of_num u)"
  5343 
  5344 lemma DEF_int_of_num: "int_of_num = (%u::nat. mk_int (real_of_num u))"
  5345   by (import hollight DEF_int_of_num)
  5346 
  5347 lemma int_of_num_th: "ALL x::nat. dest_int (int_of_num x) = real_of_num x"
  5348   by (import hollight int_of_num_th)
  5349 
  5350 constdefs
  5351   int_neg :: "hollight.int => hollight.int" 
  5352   "int_neg == %u::hollight.int. mk_int (real_neg (dest_int u))"
  5353 
  5354 lemma DEF_int_neg: "int_neg = (%u::hollight.int. mk_int (real_neg (dest_int u)))"
  5355   by (import hollight DEF_int_neg)
  5356 
  5357 lemma int_neg_th: "ALL x::hollight.int. dest_int (int_neg x) = real_neg (dest_int x)"
  5358   by (import hollight int_neg_th)
  5359 
  5360 constdefs
  5361   int_add :: "hollight.int => hollight.int => hollight.int" 
  5362   "int_add ==
  5363 %(u::hollight.int) ua::hollight.int.
  5364    mk_int (real_add (dest_int u) (dest_int ua))"
  5365 
  5366 lemma DEF_int_add: "int_add =
  5367 (%(u::hollight.int) ua::hollight.int.
  5368     mk_int (real_add (dest_int u) (dest_int ua)))"
  5369   by (import hollight DEF_int_add)
  5370 
  5371 lemma int_add_th: "ALL (x::hollight.int) xa::hollight.int.
  5372    dest_int (int_add x xa) = real_add (dest_int x) (dest_int xa)"
  5373   by (import hollight int_add_th)
  5374 
  5375 constdefs
  5376   int_sub :: "hollight.int => hollight.int => hollight.int" 
  5377   "int_sub ==
  5378 %(u::hollight.int) ua::hollight.int.
  5379    mk_int (real_sub (dest_int u) (dest_int ua))"
  5380 
  5381 lemma DEF_int_sub: "int_sub =
  5382 (%(u::hollight.int) ua::hollight.int.
  5383     mk_int (real_sub (dest_int u) (dest_int ua)))"
  5384   by (import hollight DEF_int_sub)
  5385 
  5386 lemma int_sub_th: "ALL (x::hollight.int) xa::hollight.int.
  5387    dest_int (int_sub x xa) = real_sub (dest_int x) (dest_int xa)"
  5388   by (import hollight int_sub_th)
  5389 
  5390 constdefs
  5391   int_mul :: "hollight.int => hollight.int => hollight.int" 
  5392   "int_mul ==
  5393 %(u::hollight.int) ua::hollight.int.
  5394    mk_int (real_mul (dest_int u) (dest_int ua))"
  5395 
  5396 lemma DEF_int_mul: "int_mul =
  5397 (%(u::hollight.int) ua::hollight.int.
  5398     mk_int (real_mul (dest_int u) (dest_int ua)))"
  5399   by (import hollight DEF_int_mul)
  5400 
  5401 lemma int_mul_th: "ALL (x::hollight.int) y::hollight.int.
  5402    dest_int (int_mul x y) = real_mul (dest_int x) (dest_int y)"
  5403   by (import hollight int_mul_th)
  5404 
  5405 constdefs
  5406   int_abs :: "hollight.int => hollight.int" 
  5407   "int_abs == %u::hollight.int. mk_int (real_abs (dest_int u))"
  5408 
  5409 lemma DEF_int_abs: "int_abs = (%u::hollight.int. mk_int (real_abs (dest_int u)))"
  5410   by (import hollight DEF_int_abs)
  5411 
  5412 lemma int_abs_th: "ALL x::hollight.int. dest_int (int_abs x) = real_abs (dest_int x)"
  5413   by (import hollight int_abs_th)
  5414 
  5415 constdefs
  5416   int_max :: "hollight.int => hollight.int => hollight.int" 
  5417   "int_max ==
  5418 %(u::hollight.int) ua::hollight.int.
  5419    mk_int (real_max (dest_int u) (dest_int ua))"
  5420 
  5421 lemma DEF_int_max: "int_max =
  5422 (%(u::hollight.int) ua::hollight.int.
  5423     mk_int (real_max (dest_int u) (dest_int ua)))"
  5424   by (import hollight DEF_int_max)
  5425 
  5426 lemma int_max_th: "ALL (x::hollight.int) y::hollight.int.
  5427    dest_int (int_max x y) = real_max (dest_int x) (dest_int y)"
  5428   by (import hollight int_max_th)
  5429 
  5430 constdefs
  5431   int_min :: "hollight.int => hollight.int => hollight.int" 
  5432   "int_min ==
  5433 %(u::hollight.int) ua::hollight.int.
  5434    mk_int (real_min (dest_int u) (dest_int ua))"
  5435 
  5436 lemma DEF_int_min: "int_min =
  5437 (%(u::hollight.int) ua::hollight.int.
  5438     mk_int (real_min (dest_int u) (dest_int ua)))"
  5439   by (import hollight DEF_int_min)
  5440 
  5441 lemma int_min_th: "ALL (x::hollight.int) y::hollight.int.
  5442    dest_int (int_min x y) = real_min (dest_int x) (dest_int y)"
  5443   by (import hollight int_min_th)
  5444 
  5445 constdefs
  5446   int_pow :: "hollight.int => nat => hollight.int" 
  5447   "int_pow == %(u::hollight.int) ua::nat. mk_int (real_pow (dest_int u) ua)"
  5448 
  5449 lemma DEF_int_pow: "int_pow = (%(u::hollight.int) ua::nat. mk_int (real_pow (dest_int u) ua))"
  5450   by (import hollight DEF_int_pow)
  5451 
  5452 lemma int_pow_th: "ALL (x::hollight.int) xa::nat.
  5453    dest_int (int_pow x xa) = real_pow (dest_int x) xa"
  5454   by (import hollight int_pow_th)
  5455 
  5456 lemma INT_IMAGE: "ALL x::hollight.int.
  5457    (EX n::nat. x = int_of_num n) | (EX n::nat. x = int_neg (int_of_num n))"
  5458   by (import hollight INT_IMAGE)
  5459 
  5460 lemma INT_LT_DISCRETE: "ALL (x::hollight.int) y::hollight.int.
  5461    int_lt x y = int_le (int_add x (int_of_num (NUMERAL_BIT1 0))) y"
  5462   by (import hollight INT_LT_DISCRETE)
  5463 
  5464 lemma INT_GT_DISCRETE: "ALL (x::hollight.int) xa::hollight.int.
  5465    int_gt x xa = int_ge x (int_add xa (int_of_num (NUMERAL_BIT1 0)))"
  5466   by (import hollight INT_GT_DISCRETE)
  5467 
  5468 lemma INT_FORALL_POS: "(ALL n::nat. (P::hollight.int => bool) (int_of_num n)) =
  5469 (ALL i::hollight.int. int_le (int_of_num 0) i --> P i)"
  5470   by (import hollight INT_FORALL_POS)
  5471 
  5472 lemma INT_ABS_MUL_1: "ALL (x::hollight.int) y::hollight.int.
  5473    (int_abs (int_mul x y) = int_of_num (NUMERAL_BIT1 0)) =
  5474    (int_abs x = int_of_num (NUMERAL_BIT1 0) &
  5475     int_abs y = int_of_num (NUMERAL_BIT1 0))"
  5476   by (import hollight INT_ABS_MUL_1)
  5477 
  5478 lemma INT_POW: "int_pow (x::hollight.int) 0 = int_of_num (NUMERAL_BIT1 0) &
  5479 (ALL xa::nat. int_pow x (Suc xa) = int_mul x (int_pow x xa))"
  5480   by (import hollight INT_POW)
  5481 
  5482 lemma INT_ABS: "ALL x::hollight.int.
  5483    int_abs x = COND (int_le (int_of_num 0) x) x (int_neg x)"
  5484   by (import hollight INT_ABS)
  5485 
  5486 lemma INT_GE: "ALL (x::hollight.int) xa::hollight.int. int_ge x xa = int_le xa x"
  5487   by (import hollight INT_GE)
  5488 
  5489 lemma INT_GT: "ALL (x::hollight.int) xa::hollight.int. int_gt x xa = int_lt xa x"
  5490   by (import hollight INT_GT)
  5491 
  5492 lemma INT_LT: "ALL (x::hollight.int) xa::hollight.int. int_lt x xa = (~ int_le xa x)"
  5493   by (import hollight INT_LT)
  5494 
  5495 lemma INT_ARCH: "ALL (x::hollight.int) d::hollight.int.
  5496    d ~= int_of_num 0 --> (EX c::hollight.int. int_lt x (int_mul c d))"
  5497   by (import hollight INT_ARCH)
  5498 
  5499 constdefs
  5500   mod_int :: "hollight.int => hollight.int => hollight.int => bool" 
  5501   "mod_int ==
  5502 %(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5503    EX q::hollight.int. int_sub ua ub = int_mul q u"
  5504 
  5505 lemma DEF_mod_int: "mod_int =
  5506 (%(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5507     EX q::hollight.int. int_sub ua ub = int_mul q u)"
  5508   by (import hollight DEF_mod_int)
  5509 
  5510 constdefs
  5511   IN :: "'A => ('A => bool) => bool" 
  5512   "IN == %(u::'A::type) ua::'A::type => bool. ua u"
  5513 
  5514 lemma DEF_IN: "IN = (%(u::'A::type) ua::'A::type => bool. ua u)"
  5515   by (import hollight DEF_IN)
  5516 
  5517 lemma EXTENSION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5518    (x = xa) = (ALL xb::'A::type. IN xb x = IN xb xa)"
  5519   by (import hollight EXTENSION)
  5520 
  5521 constdefs
  5522   GSPEC :: "('A => bool) => 'A => bool" 
  5523   "GSPEC == %u::'A::type => bool. u"
  5524 
  5525 lemma DEF_GSPEC: "GSPEC = (%u::'A::type => bool. u)"
  5526   by (import hollight DEF_GSPEC)
  5527 
  5528 constdefs
  5529   SETSPEC :: "'q_37056 => bool => 'q_37056 => bool" 
  5530   "SETSPEC == %(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub"
  5531 
  5532 lemma DEF_SETSPEC: "SETSPEC = (%(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub)"
  5533   by (import hollight DEF_SETSPEC)
  5534 
  5535 lemma IN_ELIM_THM: "(ALL (P::(bool => 'q_37089::type => bool) => bool) x::'q_37089::type.
  5536     IN x (GSPEC (%v::'q_37089::type. P (SETSPEC v))) =
  5537     P (%(p::bool) t::'q_37089::type. p & x = t)) &
  5538 (ALL (p::'q_37120::type => bool) x::'q_37120::type.
  5539     IN x
  5540      (GSPEC (%v::'q_37120::type. EX y::'q_37120::type. SETSPEC v (p y) y)) =
  5541     p x) &
  5542 (ALL (P::(bool => 'q_37148::type => bool) => bool) x::'q_37148::type.
  5543     GSPEC (%v::'q_37148::type. P (SETSPEC v)) x =
  5544     P (%(p::bool) t::'q_37148::type. p & x = t)) &
  5545 (ALL (p::'q_37177::type => bool) x::'q_37177::type.
  5546     GSPEC (%v::'q_37177::type. EX y::'q_37177::type. SETSPEC v (p y) y) x =
  5547     p x) &
  5548 (ALL (p::'q_37194::type => bool) x::'q_37194::type. IN x p = p x)"
  5549   by (import hollight IN_ELIM_THM)
  5550 
  5551 constdefs
  5552   EMPTY :: "'A => bool" 
  5553   "EMPTY == %x::'A::type. False"
  5554 
  5555 lemma DEF_EMPTY: "EMPTY = (%x::'A::type. False)"
  5556   by (import hollight DEF_EMPTY)
  5557 
  5558 constdefs
  5559   INSERT :: "'A => ('A => bool) => 'A => bool" 
  5560   "INSERT == %(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u"
  5561 
  5562 lemma DEF_INSERT: "INSERT =
  5563 (%(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u)"
  5564   by (import hollight DEF_INSERT)
  5565 
  5566 consts
  5567   UNIV :: "'A => bool" 
  5568 
  5569 defs
  5570   UNIV_def: "hollight.UNIV == %x::'A::type. True"
  5571 
  5572 lemma DEF_UNIV: "hollight.UNIV = (%x::'A::type. True)"
  5573   by (import hollight DEF_UNIV)
  5574 
  5575 consts
  5576   UNION :: "('A => bool) => ('A => bool) => 'A => bool" 
  5577 
  5578 defs
  5579   UNION_def: "hollight.UNION ==
  5580 %(u::'A::type => bool) ua::'A::type => bool.
  5581    GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u | IN x ua) x)"
  5582 
  5583 lemma DEF_UNION: "hollight.UNION =
  5584 (%(u::'A::type => bool) ua::'A::type => bool.
  5585     GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u | IN x ua) x))"
  5586   by (import hollight DEF_UNION)
  5587 
  5588 constdefs
  5589   UNIONS :: "(('A => bool) => bool) => 'A => bool" 
  5590   "UNIONS ==
  5591 %u::('A::type => bool) => bool.
  5592    GSPEC
  5593     (%ua::'A::type.
  5594         EX x::'A::type.
  5595            SETSPEC ua (EX ua::'A::type => bool. IN ua u & IN x ua) x)"
  5596 
  5597 lemma DEF_UNIONS: "UNIONS =
  5598 (%u::('A::type => bool) => bool.
  5599     GSPEC
  5600      (%ua::'A::type.
  5601          EX x::'A::type.
  5602             SETSPEC ua (EX ua::'A::type => bool. IN ua u & IN x ua) x))"
  5603   by (import hollight DEF_UNIONS)
  5604 
  5605 consts
  5606   INTER :: "('A => bool) => ('A => bool) => 'A => bool" 
  5607 
  5608 defs
  5609   INTER_def: "hollight.INTER ==
  5610 %(u::'A::type => bool) ua::'A::type => bool.
  5611    GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & IN x ua) x)"
  5612 
  5613 lemma DEF_INTER: "hollight.INTER =
  5614 (%(u::'A::type => bool) ua::'A::type => bool.
  5615     GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & IN x ua) x))"
  5616   by (import hollight DEF_INTER)
  5617 
  5618 constdefs
  5619   INTERS :: "(('A => bool) => bool) => 'A => bool" 
  5620   "INTERS ==
  5621 %u::('A::type => bool) => bool.
  5622    GSPEC
  5623     (%ua::'A::type.
  5624         EX x::'A::type.
  5625            SETSPEC ua (ALL ua::'A::type => bool. IN ua u --> IN x ua) x)"
  5626 
  5627 lemma DEF_INTERS: "INTERS =
  5628 (%u::('A::type => bool) => bool.
  5629     GSPEC
  5630      (%ua::'A::type.
  5631          EX x::'A::type.
  5632             SETSPEC ua (ALL ua::'A::type => bool. IN ua u --> IN x ua) x))"
  5633   by (import hollight DEF_INTERS)
  5634 
  5635 constdefs
  5636   DIFF :: "('A => bool) => ('A => bool) => 'A => bool" 
  5637   "DIFF ==
  5638 %(u::'A::type => bool) ua::'A::type => bool.
  5639    GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & ~ IN x ua) x)"
  5640 
  5641 lemma DEF_DIFF: "DIFF =
  5642 (%(u::'A::type => bool) ua::'A::type => bool.
  5643     GSPEC
  5644      (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & ~ IN x ua) x))"
  5645   by (import hollight DEF_DIFF)
  5646 
  5647 lemma INSERT: "INSERT (x::'A::type) (s::'A::type => bool) =
  5648 GSPEC (%u::'A::type. EX y::'A::type. SETSPEC u (IN y s | y = x) y)"
  5649   by (import hollight INSERT)
  5650 
  5651 constdefs
  5652   DELETE :: "('A => bool) => 'A => 'A => bool" 
  5653   "DELETE ==
  5654 %(u::'A::type => bool) ua::'A::type.
  5655    GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y)"
  5656 
  5657 lemma DEF_DELETE: "DELETE =
  5658 (%(u::'A::type => bool) ua::'A::type.
  5659     GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y))"
  5660   by (import hollight DEF_DELETE)
  5661 
  5662 constdefs
  5663   SUBSET :: "('A => bool) => ('A => bool) => bool" 
  5664   "SUBSET ==
  5665 %(u::'A::type => bool) ua::'A::type => bool.
  5666    ALL x::'A::type. IN x u --> IN x ua"
  5667 
  5668 lemma DEF_SUBSET: "SUBSET =
  5669 (%(u::'A::type => bool) ua::'A::type => bool.
  5670     ALL x::'A::type. IN x u --> IN x ua)"
  5671   by (import hollight DEF_SUBSET)
  5672 
  5673 constdefs
  5674   PSUBSET :: "('A => bool) => ('A => bool) => bool" 
  5675   "PSUBSET ==
  5676 %(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua"
  5677 
  5678 lemma DEF_PSUBSET: "PSUBSET =
  5679 (%(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua)"
  5680   by (import hollight DEF_PSUBSET)
  5681 
  5682 constdefs
  5683   DISJOINT :: "('A => bool) => ('A => bool) => bool" 
  5684   "DISJOINT ==
  5685 %(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY"
  5686 
  5687 lemma DEF_DISJOINT: "DISJOINT =
  5688 (%(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY)"
  5689   by (import hollight DEF_DISJOINT)
  5690 
  5691 constdefs
  5692   SING :: "('A => bool) => bool" 
  5693   "SING == %u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY"
  5694 
  5695 lemma DEF_SING: "SING = (%u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY)"
  5696   by (import hollight DEF_SING)
  5697 
  5698 constdefs
  5699   FINITE :: "('A => bool) => bool" 
  5700   "FINITE ==
  5701 %a::'A::type => bool.
  5702    ALL FINITE'::('A::type => bool) => bool.
  5703       (ALL a::'A::type => bool.
  5704           a = EMPTY |
  5705           (EX (x::'A::type) s::'A::type => bool.
  5706               a = INSERT x s & FINITE' s) -->
  5707           FINITE' a) -->
  5708       FINITE' a"
  5709 
  5710 lemma DEF_FINITE: "FINITE =
  5711 (%a::'A::type => bool.
  5712     ALL FINITE'::('A::type => bool) => bool.
  5713        (ALL a::'A::type => bool.
  5714            a = EMPTY |
  5715            (EX (x::'A::type) s::'A::type => bool.
  5716                a = INSERT x s & FINITE' s) -->
  5717            FINITE' a) -->
  5718        FINITE' a)"
  5719   by (import hollight DEF_FINITE)
  5720 
  5721 constdefs
  5722   INFINITE :: "('A => bool) => bool" 
  5723   "INFINITE == %u::'A::type => bool. ~ FINITE u"
  5724 
  5725 lemma DEF_INFINITE: "INFINITE = (%u::'A::type => bool. ~ FINITE u)"
  5726   by (import hollight DEF_INFINITE)
  5727 
  5728 constdefs
  5729   IMAGE :: "('A => 'B) => ('A => bool) => 'B => bool" 
  5730   "IMAGE ==
  5731 %(u::'A::type => 'B::type) ua::'A::type => bool.
  5732    GSPEC
  5733     (%ub::'B::type.
  5734         EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y)"
  5735 
  5736 lemma DEF_IMAGE: "IMAGE =
  5737 (%(u::'A::type => 'B::type) ua::'A::type => bool.
  5738     GSPEC
  5739      (%ub::'B::type.
  5740          EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y))"
  5741   by (import hollight DEF_IMAGE)
  5742 
  5743 constdefs
  5744   INJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
  5745   "INJ ==
  5746 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5747    (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5748    (ALL (x::'A::type) y::'A::type. IN x ua & IN y ua & u x = u y --> x = y)"
  5749 
  5750 lemma DEF_INJ: "INJ =
  5751 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5752     (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5753     (ALL (x::'A::type) y::'A::type.
  5754         IN x ua & IN y ua & u x = u y --> x = y))"
  5755   by (import hollight DEF_INJ)
  5756 
  5757 constdefs
  5758   SURJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
  5759   "SURJ ==
  5760 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5761    (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5762    (ALL x::'B::type. IN x ub --> (EX y::'A::type. IN y ua & u y = x))"
  5763 
  5764 lemma DEF_SURJ: "SURJ =
  5765 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5766     (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5767     (ALL x::'B::type. IN x ub --> (EX y::'A::type. IN y ua & u y = x)))"
  5768   by (import hollight DEF_SURJ)
  5769 
  5770 constdefs
  5771   BIJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
  5772   "BIJ ==
  5773 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5774    INJ u ua ub & SURJ u ua ub"
  5775 
  5776 lemma DEF_BIJ: "BIJ =
  5777 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5778     INJ u ua ub & SURJ u ua ub)"
  5779   by (import hollight DEF_BIJ)
  5780 
  5781 constdefs
  5782   CHOICE :: "('A => bool) => 'A" 
  5783   "CHOICE == %u::'A::type => bool. SOME x::'A::type. IN x u"
  5784 
  5785 lemma DEF_CHOICE: "CHOICE = (%u::'A::type => bool. SOME x::'A::type. IN x u)"
  5786   by (import hollight DEF_CHOICE)
  5787 
  5788 constdefs
  5789   REST :: "('A => bool) => 'A => bool" 
  5790   "REST == %u::'A::type => bool. DELETE u (CHOICE u)"
  5791 
  5792 lemma DEF_REST: "REST = (%u::'A::type => bool. DELETE u (CHOICE u))"
  5793   by (import hollight DEF_REST)
  5794 
  5795 constdefs
  5796   CARD_GE :: "('q_37693 => bool) => ('q_37690 => bool) => bool" 
  5797   "CARD_GE ==
  5798 %(u::'q_37693::type => bool) ua::'q_37690::type => bool.
  5799    EX f::'q_37693::type => 'q_37690::type.
  5800       ALL y::'q_37690::type.
  5801          IN y ua --> (EX x::'q_37693::type. IN x u & y = f x)"
  5802 
  5803 lemma DEF_CARD_GE: "CARD_GE =
  5804 (%(u::'q_37693::type => bool) ua::'q_37690::type => bool.
  5805     EX f::'q_37693::type => 'q_37690::type.
  5806        ALL y::'q_37690::type.
  5807           IN y ua --> (EX x::'q_37693::type. IN x u & y = f x))"
  5808   by (import hollight DEF_CARD_GE)
  5809 
  5810 constdefs
  5811   CARD_LE :: "('q_37702 => bool) => ('q_37701 => bool) => bool" 
  5812   "CARD_LE ==
  5813 %(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u"
  5814 
  5815 lemma DEF_CARD_LE: "CARD_LE =
  5816 (%(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u)"
  5817   by (import hollight DEF_CARD_LE)
  5818 
  5819 constdefs
  5820   CARD_EQ :: "('q_37712 => bool) => ('q_37713 => bool) => bool" 
  5821   "CARD_EQ ==
  5822 %(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5823    CARD_LE u ua & CARD_LE ua u"
  5824 
  5825 lemma DEF_CARD_EQ: "CARD_EQ =
  5826 (%(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5827     CARD_LE u ua & CARD_LE ua u)"
  5828   by (import hollight DEF_CARD_EQ)
  5829 
  5830 constdefs
  5831   CARD_GT :: "('q_37727 => bool) => ('q_37728 => bool) => bool" 
  5832   "CARD_GT ==
  5833 %(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5834    CARD_GE u ua & ~ CARD_GE ua u"
  5835 
  5836 lemma DEF_CARD_GT: "CARD_GT =
  5837 (%(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5838     CARD_GE u ua & ~ CARD_GE ua u)"
  5839   by (import hollight DEF_CARD_GT)
  5840 
  5841 constdefs
  5842   CARD_LT :: "('q_37743 => bool) => ('q_37744 => bool) => bool" 
  5843   "CARD_LT ==
  5844 %(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5845    CARD_LE u ua & ~ CARD_LE ua u"
  5846 
  5847 lemma DEF_CARD_LT: "CARD_LT =
  5848 (%(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5849     CARD_LE u ua & ~ CARD_LE ua u)"
  5850   by (import hollight DEF_CARD_LT)
  5851 
  5852 constdefs
  5853   COUNTABLE :: "('q_37757 => bool) => bool" 
  5854   "(op ==::(('q_37757::type => bool) => bool)
  5855         => (('q_37757::type => bool) => bool) => prop)
  5856  (COUNTABLE::('q_37757::type => bool) => bool)
  5857  ((CARD_GE::(nat => bool) => ('q_37757::type => bool) => bool)
  5858    (hollight.UNIV::nat => bool))"
  5859 
  5860 lemma DEF_COUNTABLE: "(op =::(('q_37757::type => bool) => bool)
  5861        => (('q_37757::type => bool) => bool) => bool)
  5862  (COUNTABLE::('q_37757::type => bool) => bool)
  5863  ((CARD_GE::(nat => bool) => ('q_37757::type => bool) => bool)
  5864    (hollight.UNIV::nat => bool))"
  5865   by (import hollight DEF_COUNTABLE)
  5866 
  5867 lemma NOT_IN_EMPTY: "ALL x::'A::type. ~ IN x EMPTY"
  5868   by (import hollight NOT_IN_EMPTY)
  5869 
  5870 lemma IN_UNIV: "ALL x::'A::type. IN x hollight.UNIV"
  5871   by (import hollight IN_UNIV)
  5872 
  5873 lemma IN_UNION: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  5874    IN xb (hollight.UNION x xa) = (IN xb x | IN xb xa)"
  5875   by (import hollight IN_UNION)
  5876 
  5877 lemma IN_UNIONS: "ALL (x::('A::type => bool) => bool) xa::'A::type.
  5878    IN xa (UNIONS x) = (EX t::'A::type => bool. IN t x & IN xa t)"
  5879   by (import hollight IN_UNIONS)
  5880 
  5881 lemma IN_INTER: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  5882    IN xb (hollight.INTER x xa) = (IN xb x & IN xb xa)"
  5883   by (import hollight IN_INTER)
  5884 
  5885 lemma IN_INTERS: "ALL (x::('A::type => bool) => bool) xa::'A::type.
  5886    IN xa (INTERS x) = (ALL t::'A::type => bool. IN t x --> IN xa t)"
  5887   by (import hollight IN_INTERS)
  5888 
  5889 lemma IN_DIFF: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  5890    IN xb (DIFF x xa) = (IN xb x & ~ IN xb xa)"
  5891   by (import hollight IN_DIFF)
  5892 
  5893 lemma IN_INSERT: "ALL (x::'A::type) (xa::'A::type) xb::'A::type => bool.
  5894    IN x (INSERT xa xb) = (x = xa | IN x xb)"
  5895   by (import hollight IN_INSERT)
  5896 
  5897 lemma IN_DELETE: "ALL (x::'A::type => bool) (xa::'A::type) xb::'A::type.
  5898    IN xa (DELETE x xb) = (IN xa x & xa ~= xb)"
  5899   by (import hollight IN_DELETE)
  5900 
  5901 lemma IN_SING: "ALL (x::'A::type) xa::'A::type. IN x (INSERT xa EMPTY) = (x = xa)"
  5902   by (import hollight IN_SING)
  5903 
  5904 lemma IN_IMAGE: "ALL (x::'B::type) (xa::'A::type => bool) xb::'A::type => 'B::type.
  5905    IN x (IMAGE xb xa) = (EX xc::'A::type. x = xb xc & IN xc xa)"
  5906   by (import hollight IN_IMAGE)
  5907 
  5908 lemma IN_REST: "ALL (x::'A::type) xa::'A::type => bool.
  5909    IN x (REST xa) = (IN x xa & x ~= CHOICE xa)"
  5910   by (import hollight IN_REST)
  5911 
  5912 lemma CHOICE_DEF: "ALL x::'A::type => bool. x ~= EMPTY --> IN (CHOICE x) x"
  5913   by (import hollight CHOICE_DEF)
  5914 
  5915 lemma NOT_EQUAL_SETS: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5916    (x ~= xa) = (EX xb::'A::type. IN xb xa = (~ IN xb x))"
  5917   by (import hollight NOT_EQUAL_SETS)
  5918 
  5919 lemma MEMBER_NOT_EMPTY: "ALL x::'A::type => bool. (EX xa::'A::type. IN xa x) = (x ~= EMPTY)"
  5920   by (import hollight MEMBER_NOT_EMPTY)
  5921 
  5922 lemma UNIV_NOT_EMPTY: "(Not::bool => bool)
  5923  ((op =::('A::type => bool) => ('A::type => bool) => bool)
  5924    (hollight.UNIV::'A::type => bool) (EMPTY::'A::type => bool))"
  5925   by (import hollight UNIV_NOT_EMPTY)
  5926 
  5927 lemma EMPTY_NOT_UNIV: "(Not::bool => bool)
  5928  ((op =::('A::type => bool) => ('A::type => bool) => bool)
  5929    (EMPTY::'A::type => bool) (hollight.UNIV::'A::type => bool))"
  5930   by (import hollight EMPTY_NOT_UNIV)
  5931 
  5932 lemma EQ_UNIV: "(ALL x::'A::type. IN x (s::'A::type => bool)) = (s = hollight.UNIV)"
  5933   by (import hollight EQ_UNIV)
  5934 
  5935 lemma SUBSET_TRANS: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  5936    SUBSET x xa & SUBSET xa xb --> SUBSET x xb"
  5937   by (import hollight SUBSET_TRANS)
  5938 
  5939 lemma SUBSET_REFL: "ALL x::'A::type => bool. SUBSET x x"
  5940   by (import hollight SUBSET_REFL)
  5941 
  5942 lemma SUBSET_ANTISYM: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5943    SUBSET x xa & SUBSET xa x --> x = xa"
  5944   by (import hollight SUBSET_ANTISYM)
  5945 
  5946 lemma EMPTY_SUBSET: "(All::(('A::type => bool) => bool) => bool)
  5947  ((SUBSET::('A::type => bool) => ('A::type => bool) => bool)
  5948    (EMPTY::'A::type => bool))"
  5949   by (import hollight EMPTY_SUBSET)
  5950 
  5951 lemma SUBSET_EMPTY: "ALL x::'A::type => bool. SUBSET x EMPTY = (x = EMPTY)"
  5952   by (import hollight SUBSET_EMPTY)
  5953 
  5954 lemma SUBSET_UNIV: "ALL x::'A::type => bool. SUBSET x hollight.UNIV"
  5955   by (import hollight SUBSET_UNIV)
  5956 
  5957 lemma UNIV_SUBSET: "ALL x::'A::type => bool. SUBSET hollight.UNIV x = (x = hollight.UNIV)"
  5958   by (import hollight UNIV_SUBSET)
  5959 
  5960 lemma PSUBSET_TRANS: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  5961    PSUBSET x xa & PSUBSET xa xb --> PSUBSET x xb"
  5962   by (import hollight PSUBSET_TRANS)
  5963 
  5964 lemma PSUBSET_SUBSET_TRANS: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  5965    PSUBSET x xa & SUBSET xa xb --> PSUBSET x xb"
  5966   by (import hollight PSUBSET_SUBSET_TRANS)
  5967 
  5968 lemma SUBSET_PSUBSET_TRANS: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  5969    SUBSET x xa & PSUBSET xa xb --> PSUBSET x xb"
  5970   by (import hollight SUBSET_PSUBSET_TRANS)
  5971 
  5972 lemma PSUBSET_IRREFL: "ALL x::'A::type => bool. ~ PSUBSET x x"
  5973   by (import hollight PSUBSET_IRREFL)
  5974 
  5975 lemma NOT_PSUBSET_EMPTY: "ALL x::'A::type => bool. ~ PSUBSET x EMPTY"
  5976   by (import hollight NOT_PSUBSET_EMPTY)
  5977 
  5978 lemma NOT_UNIV_PSUBSET: "ALL x::'A::type => bool. ~ PSUBSET hollight.UNIV x"
  5979   by (import hollight NOT_UNIV_PSUBSET)
  5980 
  5981 lemma PSUBSET_UNIV: "ALL x::'A::type => bool.
  5982    PSUBSET x hollight.UNIV = (EX xa::'A::type. ~ IN xa x)"
  5983   by (import hollight PSUBSET_UNIV)
  5984 
  5985 lemma UNION_ASSOC: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  5986    hollight.UNION (hollight.UNION x xa) xb =
  5987    hollight.UNION x (hollight.UNION xa xb)"
  5988   by (import hollight UNION_ASSOC)
  5989 
  5990 lemma UNION_IDEMPOT: "ALL x::'A::type => bool. hollight.UNION x x = x"
  5991   by (import hollight UNION_IDEMPOT)
  5992 
  5993 lemma UNION_COMM: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5994    hollight.UNION x xa = hollight.UNION xa x"
  5995   by (import hollight UNION_COMM)
  5996 
  5997 lemma SUBSET_UNION: "(ALL (x::'A::type => bool) xa::'A::type => bool.
  5998     SUBSET x (hollight.UNION x xa)) &
  5999 (ALL (x::'A::type => bool) xa::'A::type => bool.
  6000     SUBSET x (hollight.UNION xa x))"
  6001   by (import hollight SUBSET_UNION)
  6002 
  6003 lemma SUBSET_UNION_ABSORPTION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6004    SUBSET x xa = (hollight.UNION x xa = xa)"
  6005   by (import hollight SUBSET_UNION_ABSORPTION)
  6006 
  6007 lemma UNION_EMPTY: "(ALL x::'A::type => bool. hollight.UNION EMPTY x = x) &
  6008 (ALL x::'A::type => bool. hollight.UNION x EMPTY = x)"
  6009   by (import hollight UNION_EMPTY)
  6010 
  6011 lemma UNION_UNIV: "(ALL x::'A::type => bool. hollight.UNION hollight.UNIV x = hollight.UNIV) &
  6012 (ALL x::'A::type => bool. hollight.UNION x hollight.UNIV = hollight.UNIV)"
  6013   by (import hollight UNION_UNIV)
  6014 
  6015 lemma EMPTY_UNION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6016    (hollight.UNION x xa = EMPTY) = (x = EMPTY & xa = EMPTY)"
  6017   by (import hollight EMPTY_UNION)
  6018 
  6019 lemma UNION_SUBSET: "ALL (x::'q_38594::type => bool) (xa::'q_38594::type => bool)
  6020    xb::'q_38594::type => bool.
  6021    SUBSET (hollight.UNION x xa) xb = (SUBSET x xb & SUBSET xa xb)"
  6022   by (import hollight UNION_SUBSET)
  6023 
  6024 lemma INTER_ASSOC: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  6025    hollight.INTER (hollight.INTER x xa) xb =
  6026    hollight.INTER x (hollight.INTER xa xb)"
  6027   by (import hollight INTER_ASSOC)
  6028 
  6029 lemma INTER_IDEMPOT: "ALL x::'A::type => bool. hollight.INTER x x = x"
  6030   by (import hollight INTER_IDEMPOT)
  6031 
  6032 lemma INTER_COMM: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6033    hollight.INTER x xa = hollight.INTER xa x"
  6034   by (import hollight INTER_COMM)
  6035 
  6036 lemma INTER_SUBSET: "(ALL (x::'A::type => bool) xa::'A::type => bool.
  6037     SUBSET (hollight.INTER x xa) x) &
  6038 (ALL (x::'A::type => bool) xa::'A::type => bool.
  6039     SUBSET (hollight.INTER xa x) x)"
  6040   by (import hollight INTER_SUBSET)
  6041 
  6042 lemma SUBSET_INTER_ABSORPTION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6043    SUBSET x xa = (hollight.INTER x xa = x)"
  6044   by (import hollight SUBSET_INTER_ABSORPTION)
  6045 
  6046 lemma INTER_EMPTY: "(ALL x::'A::type => bool. hollight.INTER EMPTY x = EMPTY) &
  6047 (ALL x::'A::type => bool. hollight.INTER x EMPTY = EMPTY)"
  6048   by (import hollight INTER_EMPTY)
  6049 
  6050 lemma INTER_UNIV: "(ALL x::'A::type => bool. hollight.INTER hollight.UNIV x = x) &
  6051 (ALL x::'A::type => bool. hollight.INTER x hollight.UNIV = x)"
  6052   by (import hollight INTER_UNIV)
  6053 
  6054 lemma UNION_OVER_INTER: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  6055    hollight.INTER x (hollight.UNION xa xb) =
  6056    hollight.UNION (hollight.INTER x xa) (hollight.INTER x xb)"
  6057   by (import hollight UNION_OVER_INTER)
  6058 
  6059 lemma INTER_OVER_UNION: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  6060    hollight.UNION x (hollight.INTER xa xb) =
  6061    hollight.INTER (hollight.UNION x xa) (hollight.UNION x xb)"
  6062   by (import hollight INTER_OVER_UNION)
  6063 
  6064 lemma IN_DISJOINT: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6065    DISJOINT x xa = (~ (EX xb::'A::type. IN xb x & IN xb xa))"
  6066   by (import hollight IN_DISJOINT)
  6067 
  6068 lemma DISJOINT_SYM: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6069    DISJOINT x xa = DISJOINT xa x"
  6070   by (import hollight DISJOINT_SYM)
  6071 
  6072 lemma DISJOINT_EMPTY: "ALL x::'A::type => bool. DISJOINT EMPTY x & DISJOINT x EMPTY"
  6073   by (import hollight DISJOINT_EMPTY)
  6074 
  6075 lemma DISJOINT_EMPTY_REFL: "ALL x::'A::type => bool. (x = EMPTY) = DISJOINT x x"
  6076   by (import hollight DISJOINT_EMPTY_REFL)
  6077 
  6078 lemma DISJOINT_UNION: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type => bool.
  6079    DISJOINT (hollight.UNION x xa) xb = (DISJOINT x xb & DISJOINT xa xb)"
  6080   by (import hollight DISJOINT_UNION)
  6081 
  6082 lemma DIFF_EMPTY: "ALL x::'A::type => bool. DIFF x EMPTY = x"
  6083   by (import hollight DIFF_EMPTY)
  6084 
  6085 lemma EMPTY_DIFF: "ALL x::'A::type => bool. DIFF EMPTY x = EMPTY"
  6086   by (import hollight EMPTY_DIFF)
  6087 
  6088 lemma DIFF_UNIV: "ALL x::'A::type => bool. DIFF x hollight.UNIV = EMPTY"
  6089   by (import hollight DIFF_UNIV)
  6090 
  6091 lemma DIFF_DIFF: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6092    DIFF (DIFF x xa) xa = DIFF x xa"
  6093   by (import hollight DIFF_DIFF)
  6094 
  6095 lemma DIFF_EQ_EMPTY: "ALL x::'A::type => bool. DIFF x x = EMPTY"
  6096   by (import hollight DIFF_EQ_EMPTY)
  6097 
  6098 lemma SUBSET_DIFF: "ALL (x::'q_39012::type => bool) xa::'q_39012::type => bool.
  6099    SUBSET (DIFF x xa) x"
  6100   by (import hollight SUBSET_DIFF)
  6101 
  6102 lemma COMPONENT: "ALL (x::'A::type) s::'A::type => bool. IN x (INSERT x s)"
  6103   by (import hollight COMPONENT)
  6104 
  6105 lemma DECOMPOSITION: "ALL (s::'A::type => bool) x::'A::type.
  6106    IN x s = (EX t::'A::type => bool. s = INSERT x t & ~ IN x t)"
  6107   by (import hollight DECOMPOSITION)
  6108 
  6109 lemma SET_CASES: "ALL s::'A::type => bool.
  6110    s = EMPTY |
  6111    (EX (x::'A::type) t::'A::type => bool. s = INSERT x t & ~ IN x t)"
  6112   by (import hollight SET_CASES)
  6113 
  6114 lemma ABSORPTION: "ALL (x::'A::type) xa::'A::type => bool. IN x xa = (INSERT x xa = xa)"
  6115   by (import hollight ABSORPTION)
  6116 
  6117 lemma INSERT_INSERT: "ALL (x::'A::type) xa::'A::type => bool. INSERT x (INSERT x xa) = INSERT x xa"
  6118   by (import hollight INSERT_INSERT)
  6119 
  6120 lemma INSERT_COMM: "ALL (x::'A::type) (xa::'A::type) xb::'A::type => bool.
  6121    INSERT x (INSERT xa xb) = INSERT xa (INSERT x xb)"
  6122   by (import hollight INSERT_COMM)
  6123 
  6124 lemma INSERT_UNIV: "ALL x::'A::type. INSERT x hollight.UNIV = hollight.UNIV"
  6125   by (import hollight INSERT_UNIV)
  6126 
  6127 lemma NOT_INSERT_EMPTY: "ALL (x::'A::type) xa::'A::type => bool. INSERT x xa ~= EMPTY"
  6128   by (import hollight NOT_INSERT_EMPTY)
  6129 
  6130 lemma NOT_EMPTY_INSERT: "ALL (x::'A::type) xa::'A::type => bool. EMPTY ~= INSERT x xa"
  6131   by (import hollight NOT_EMPTY_INSERT)
  6132 
  6133 lemma INSERT_UNION: "ALL (x::'A::type) (s::'A::type => bool) t::'A::type => bool.
  6134    hollight.UNION (INSERT x s) t =
  6135    COND (IN x t) (hollight.UNION s t) (INSERT x (hollight.UNION s t))"
  6136   by (import hollight INSERT_UNION)
  6137 
  6138 lemma INSERT_UNION_EQ: "ALL (x::'A::type) (xa::'A::type => bool) xb::'A::type => bool.
  6139    hollight.UNION (INSERT x xa) xb = INSERT x (hollight.UNION xa xb)"
  6140   by (import hollight INSERT_UNION_EQ)
  6141 
  6142 lemma INSERT_INTER: "ALL (x::'A::type) (s::'A::type => bool) t::'A::type => bool.
  6143    hollight.INTER (INSERT x s) t =
  6144    COND (IN x t) (INSERT x (hollight.INTER s t)) (hollight.INTER s t)"
  6145   by (import hollight INSERT_INTER)
  6146 
  6147 lemma DISJOINT_INSERT: "ALL (x::'A::type) (xa::'A::type => bool) xb::'A::type => bool.
  6148    DISJOINT (INSERT x xa) xb = (DISJOINT xa xb & ~ IN x xb)"
  6149   by (import hollight DISJOINT_INSERT)
  6150 
  6151 lemma INSERT_SUBSET: "ALL (x::'A::type) (xa::'A::type => bool) xb::'A::type => bool.
  6152    SUBSET (INSERT x xa) xb = (IN x xb & SUBSET xa xb)"
  6153   by (import hollight INSERT_SUBSET)
  6154 
  6155 lemma SUBSET_INSERT: "ALL (x::'A::type) xa::'A::type => bool.
  6156    ~ IN x xa -->
  6157    (ALL xb::'A::type => bool. SUBSET xa (INSERT x xb) = SUBSET xa xb)"
  6158   by (import hollight SUBSET_INSERT)
  6159 
  6160 lemma INSERT_DIFF: "ALL (s::'A::type => bool) (t::'A::type => bool) x::'A::type.
  6161    DIFF (INSERT x s) t = COND (IN x t) (DIFF s t) (INSERT x (DIFF s t))"
  6162   by (import hollight INSERT_DIFF)
  6163 
  6164 lemma INSERT_AC: "INSERT (x::'q_39468::type)
  6165  (INSERT (y::'q_39468::type) (s::'q_39468::type => bool)) =
  6166 INSERT y (INSERT x s) &
  6167 INSERT x (INSERT x s) = INSERT x s"
  6168   by (import hollight INSERT_AC)
  6169 
  6170 lemma INTER_ACI: "hollight.INTER (p::'q_39535::type => bool) (q::'q_39535::type => bool) =
  6171 hollight.INTER q p &
  6172 hollight.INTER (hollight.INTER p q) (r::'q_39535::type => bool) =
  6173 hollight.INTER p (hollight.INTER q r) &
  6174 hollight.INTER p (hollight.INTER q r) =
  6175 hollight.INTER q (hollight.INTER p r) &
  6176 hollight.INTER p p = p &
  6177 hollight.INTER p (hollight.INTER p q) = hollight.INTER p q"
  6178   by (import hollight INTER_ACI)
  6179 
  6180 lemma UNION_ACI: "hollight.UNION (p::'q_39601::type => bool) (q::'q_39601::type => bool) =
  6181 hollight.UNION q p &
  6182 hollight.UNION (hollight.UNION p q) (r::'q_39601::type => bool) =
  6183 hollight.UNION p (hollight.UNION q r) &
  6184 hollight.UNION p (hollight.UNION q r) =
  6185 hollight.UNION q (hollight.UNION p r) &
  6186 hollight.UNION p p = p &
  6187 hollight.UNION p (hollight.UNION p q) = hollight.UNION p q"
  6188   by (import hollight UNION_ACI)
  6189 
  6190 lemma DELETE_NON_ELEMENT: "ALL (x::'A::type) xa::'A::type => bool. (~ IN x xa) = (DELETE xa x = xa)"
  6191   by (import hollight DELETE_NON_ELEMENT)
  6192 
  6193 lemma IN_DELETE_EQ: "ALL (s::'A::type => bool) (x::'A::type) x'::'A::type.
  6194    (IN x s = IN x' s) = (IN x (DELETE s x') = IN x' (DELETE s x))"
  6195   by (import hollight IN_DELETE_EQ)
  6196 
  6197 lemma EMPTY_DELETE: "ALL x::'A::type. DELETE EMPTY x = EMPTY"
  6198   by (import hollight EMPTY_DELETE)
  6199 
  6200 lemma DELETE_DELETE: "ALL (x::'A::type) xa::'A::type => bool. DELETE (DELETE xa x) x = DELETE xa x"
  6201   by (import hollight DELETE_DELETE)
  6202 
  6203 lemma DELETE_COMM: "ALL (x::'A::type) (xa::'A::type) xb::'A::type => bool.
  6204    DELETE (DELETE xb x) xa = DELETE (DELETE xb xa) x"
  6205   by (import hollight DELETE_COMM)
  6206 
  6207 lemma DELETE_SUBSET: "ALL (x::'A::type) xa::'A::type => bool. SUBSET (DELETE xa x) xa"
  6208   by (import hollight DELETE_SUBSET)
  6209 
  6210 lemma SUBSET_DELETE: "ALL (x::'A::type) (xa::'A::type => bool) xb::'A::type => bool.
  6211    SUBSET xa (DELETE xb x) = (~ IN x xa & SUBSET xa xb)"
  6212   by (import hollight SUBSET_DELETE)
  6213 
  6214 lemma SUBSET_INSERT_DELETE: "ALL (x::'A::type) (xa::'A::type => bool) xb::'A::type => bool.
  6215    SUBSET xa (INSERT x xb) = SUBSET (DELETE xa x) xb"
  6216   by (import hollight SUBSET_INSERT_DELETE)
  6217 
  6218 lemma DIFF_INSERT: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  6219    DIFF x (INSERT xb xa) = DIFF (DELETE x xb) xa"
  6220   by (import hollight DIFF_INSERT)
  6221 
  6222 lemma PSUBSET_INSERT_SUBSET: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6223    PSUBSET x xa = (EX xb::'A::type. ~ IN xb x & SUBSET (INSERT xb x) xa)"
  6224   by (import hollight PSUBSET_INSERT_SUBSET)
  6225 
  6226 lemma PSUBSET_MEMBER: "ALL (x::'A::type => bool) xa::'A::type => bool.
  6227    PSUBSET x xa = (SUBSET x xa & (EX y::'A::type. IN y xa & ~ IN y x))"
  6228   by (import hollight PSUBSET_MEMBER)
  6229 
  6230 lemma DELETE_INSERT: "ALL (x::'A::type) (y::'A::type) s::'A::type => bool.
  6231    DELETE (INSERT x s) y = COND (x = y) (DELETE s y) (INSERT x (DELETE s y))"
  6232   by (import hollight DELETE_INSERT)
  6233 
  6234 lemma INSERT_DELETE: "ALL (x::'A::type) xa::'A::type => bool.
  6235    IN x xa --> INSERT x (DELETE xa x) = xa"
  6236   by (import hollight INSERT_DELETE)
  6237 
  6238 lemma DELETE_INTER: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  6239    hollight.INTER (DELETE x xb) xa = DELETE (hollight.INTER x xa) xb"
  6240   by (import hollight DELETE_INTER)
  6241 
  6242 lemma DISJOINT_DELETE_SYM: "ALL (x::'A::type => bool) (xa::'A::type => bool) xb::'A::type.
  6243    DISJOINT (DELETE x xb) xa = DISJOINT (DELETE xa xb) x"
  6244   by (import hollight DISJOINT_DELETE_SYM)
  6245 
  6246 lemma UNIONS_0: "(op =::('q_40008::type => bool) => ('q_40008::type => bool) => bool)
  6247  ((UNIONS::(('q_40008::type => bool) => bool) => 'q_40008::type => bool)
  6248    (EMPTY::('q_40008::type => bool) => bool))
  6249  (EMPTY::'q_40008::type => bool)"
  6250   by (import hollight UNIONS_0)
  6251 
  6252 lemma UNIONS_1: "UNIONS (INSERT (s::'q_40014::type => bool) EMPTY) = s"
  6253   by (import hollight UNIONS_1)
  6254 
  6255 lemma UNIONS_2: "UNIONS
  6256  (INSERT (s::'q_40034::type => bool)
  6257    (INSERT (t::'q_40034::type => bool) EMPTY)) =
  6258 hollight.UNION s t"
  6259   by (import hollight UNIONS_2)
  6260 
  6261 lemma UNIONS_INSERT: "UNIONS
  6262  (INSERT (s::'q_40048::type => bool)
  6263    (u::('q_40048::type => bool) => bool)) =
  6264 hollight.UNION s (UNIONS u)"
  6265   by (import hollight UNIONS_INSERT)
  6266 
  6267 lemma FORALL_IN_UNIONS: "ALL (x::'q_40090::type => bool) xa::('q_40090::type => bool) => bool.
  6268    (ALL xb::'q_40090::type. IN xb (UNIONS xa) --> x xb) =
  6269    (ALL (t::'q_40090::type => bool) xb::'q_40090::type.
  6270        IN t xa & IN xb t --> x xb)"
  6271   by (import hollight FORALL_IN_UNIONS)
  6272 
  6273 lemma EMPTY_UNIONS: "ALL x::('q_40116::type => bool) => bool.
  6274    (UNIONS x = EMPTY) =
  6275    (ALL xa::'q_40116::type =&g