src/HOL/Import/HOLLight/HOLLight.thy
changeset 35416 d8d7d1b785af
parent 34974 18b41bba42b5
child 43786 fea3ed6951e3
equal deleted inserted replaced
35342:4dc65845eab3 35416:d8d7d1b785af
    93   by (import hollight SELECT_UNIQUE)
    93   by (import hollight SELECT_UNIQUE)
    94 
    94 
    95 lemma EXCLUDED_MIDDLE: "ALL t::bool. t | ~ t"
    95 lemma EXCLUDED_MIDDLE: "ALL t::bool. t | ~ t"
    96   by (import hollight EXCLUDED_MIDDLE)
    96   by (import hollight EXCLUDED_MIDDLE)
    97 
    97 
    98 constdefs
    98 definition COND :: "bool => 'A => 'A => 'A" where 
    99   COND :: "bool => 'A => 'A => 'A" 
       
   100   "COND ==
    99   "COND ==
   101 %(t::bool) (t1::'A::type) t2::'A::type.
   100 %(t::bool) (t1::'A::type) t2::'A::type.
   102    SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
   101    SOME x::'A::type. (t = True --> x = t1) & (t = False --> x = t2)"
   103 
   102 
   104 lemma DEF_COND: "COND =
   103 lemma DEF_COND: "COND =
   171 lemma th_cond: "(P::'A::type => bool => bool) (COND (b::bool) (x::'A::type) (y::'A::type))
   170 lemma th_cond: "(P::'A::type => bool => bool) (COND (b::bool) (x::'A::type) (y::'A::type))
   172  b =
   171  b =
   173 (b & P x True | ~ b & P y False)"
   172 (b & P x True | ~ b & P y False)"
   174   by (import hollight th_cond)
   173   by (import hollight th_cond)
   175 
   174 
   176 constdefs
   175 definition LET_END :: "'A => 'A" where 
   177   LET_END :: "'A => 'A" 
       
   178   "LET_END == %t::'A::type. t"
   176   "LET_END == %t::'A::type. t"
   179 
   177 
   180 lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
   178 lemma DEF_LET_END: "LET_END = (%t::'A::type. t)"
   181   by (import hollight DEF_LET_END)
   179   by (import hollight DEF_LET_END)
   182 
   180 
   183 constdefs
   181 definition GABS :: "('A => bool) => 'A" where 
   184   GABS :: "('A => bool) => 'A" 
       
   185   "(op ==::(('A::type => bool) => 'A::type)
   182   "(op ==::(('A::type => bool) => 'A::type)
   186         => (('A::type => bool) => 'A::type) => prop)
   183         => (('A::type => bool) => 'A::type) => prop)
   187  (GABS::('A::type => bool) => 'A::type)
   184  (GABS::('A::type => bool) => 'A::type)
   188  (Eps::('A::type => bool) => 'A::type)"
   185  (Eps::('A::type => bool) => 'A::type)"
   189 
   186 
   191        => (('A::type => bool) => 'A::type) => bool)
   188        => (('A::type => bool) => 'A::type) => bool)
   192  (GABS::('A::type => bool) => 'A::type)
   189  (GABS::('A::type => bool) => 'A::type)
   193  (Eps::('A::type => bool) => 'A::type)"
   190  (Eps::('A::type => bool) => 'A::type)"
   194   by (import hollight DEF_GABS)
   191   by (import hollight DEF_GABS)
   195 
   192 
   196 constdefs
   193 definition GEQ :: "'A => 'A => bool" where 
   197   GEQ :: "'A => 'A => bool" 
       
   198   "(op ==::('A::type => 'A::type => bool)
   194   "(op ==::('A::type => 'A::type => bool)
   199         => ('A::type => 'A::type => bool) => prop)
   195         => ('A::type => 'A::type => bool) => prop)
   200  (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
   196  (GEQ::'A::type => 'A::type => bool) (op =::'A::type => 'A::type => bool)"
   201 
   197 
   202 lemma DEF_GEQ: "(op =::('A::type => 'A::type => bool)
   198 lemma DEF_GEQ: "(op =::('A::type => 'A::type => bool)
   206 
   202 
   207 lemma PAIR_EXISTS_THM: "EX (x::'A::type => 'B::type => bool) (a::'A::type) b::'B::type.
   203 lemma PAIR_EXISTS_THM: "EX (x::'A::type => 'B::type => bool) (a::'A::type) b::'B::type.
   208    x = Pair_Rep a b"
   204    x = Pair_Rep a b"
   209   by (import hollight PAIR_EXISTS_THM)
   205   by (import hollight PAIR_EXISTS_THM)
   210 
   206 
   211 constdefs
   207 definition CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" where 
   212   CURRY :: "('A * 'B => 'C) => 'A => 'B => 'C" 
       
   213   "CURRY ==
   208   "CURRY ==
   214 %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   209 %(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   215    u (ua, ub)"
   210    u (ua, ub)"
   216 
   211 
   217 lemma DEF_CURRY: "CURRY =
   212 lemma DEF_CURRY: "CURRY =
   218 (%(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   213 (%(u::'A::type * 'B::type => 'C::type) (ua::'A::type) ub::'B::type.
   219     u (ua, ub))"
   214     u (ua, ub))"
   220   by (import hollight DEF_CURRY)
   215   by (import hollight DEF_CURRY)
   221 
   216 
   222 constdefs
   217 definition UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" where 
   223   UNCURRY :: "('A => 'B => 'C) => 'A * 'B => 'C" 
       
   224   "UNCURRY ==
   218   "UNCURRY ==
   225 %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   219 %(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   226    u (fst ua) (snd ua)"
   220    u (fst ua) (snd ua)"
   227 
   221 
   228 lemma DEF_UNCURRY: "UNCURRY =
   222 lemma DEF_UNCURRY: "UNCURRY =
   229 (%(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   223 (%(u::'A::type => 'B::type => 'C::type) ua::'A::type * 'B::type.
   230     u (fst ua) (snd ua))"
   224     u (fst ua) (snd ua))"
   231   by (import hollight DEF_UNCURRY)
   225   by (import hollight DEF_UNCURRY)
   232 
   226 
   233 constdefs
   227 definition PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" where 
   234   PASSOC :: "(('A * 'B) * 'C => 'D) => 'A * 'B * 'C => 'D" 
       
   235   "PASSOC ==
   228   "PASSOC ==
   236 %(u::('A::type * 'B::type) * 'C::type => 'D::type)
   229 %(u::('A::type * 'B::type) * 'C::type => 'D::type)
   237    ua::'A::type * 'B::type * 'C::type.
   230    ua::'A::type * 'B::type * 'C::type.
   238    u ((fst ua, fst (snd ua)), snd (snd ua))"
   231    u ((fst ua, fst (snd ua)), snd (snd ua))"
   239 
   232 
   289 
   282 
   290 lemma MULT_EQ_1: "ALL (m::nat) n::nat.
   283 lemma MULT_EQ_1: "ALL (m::nat) n::nat.
   291    (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   284    (m * n = NUMERAL_BIT1 0) = (m = NUMERAL_BIT1 0 & n = NUMERAL_BIT1 0)"
   292   by (import hollight MULT_EQ_1)
   285   by (import hollight MULT_EQ_1)
   293 
   286 
   294 constdefs
   287 definition EXP :: "nat => nat => nat" where 
   295   EXP :: "nat => nat => nat" 
       
   296   "EXP ==
   288   "EXP ==
   297 SOME EXP::nat => nat => nat.
   289 SOME EXP::nat => nat => nat.
   298    (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   290    (ALL m::nat. EXP m 0 = NUMERAL_BIT1 0) &
   299    (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n)"
   291    (ALL (m::nat) n::nat. EXP m (Suc n) = m * EXP m n)"
   300 
   292 
   547 lemma num_MAX: "ALL P::nat => bool.
   539 lemma num_MAX: "ALL P::nat => bool.
   548    (Ex P & (EX M::nat. ALL x::nat. P x --> <= x M)) =
   540    (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))"
   541    (EX m::nat. P m & (ALL x::nat. P x --> <= x m))"
   550   by (import hollight num_MAX)
   542   by (import hollight num_MAX)
   551 
   543 
   552 constdefs
   544 definition EVEN :: "nat => bool" where 
   553   EVEN :: "nat => bool" 
       
   554   "EVEN ==
   545   "EVEN ==
   555 SOME EVEN::nat => bool.
   546 SOME EVEN::nat => bool.
   556    EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   547    EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n))"
   557 
   548 
   558 lemma DEF_EVEN: "EVEN =
   549 lemma DEF_EVEN: "EVEN =
   559 (SOME EVEN::nat => bool.
   550 (SOME EVEN::nat => bool.
   560     EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   551     EVEN 0 = True & (ALL n::nat. EVEN (Suc n) = (~ EVEN n)))"
   561   by (import hollight DEF_EVEN)
   552   by (import hollight DEF_EVEN)
   562 
   553 
   563 constdefs
   554 definition ODD :: "nat => bool" where 
   564   ODD :: "nat => bool" 
       
   565   "ODD ==
   555   "ODD ==
   566 SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   556 SOME ODD::nat => bool. ODD 0 = False & (ALL n::nat. ODD (Suc n) = (~ ODD n))"
   567 
   557 
   568 lemma DEF_ODD: "ODD =
   558 lemma DEF_ODD: "ODD =
   569 (SOME ODD::nat => bool.
   559 (SOME ODD::nat => bool.
   639   by (import hollight SUB_ADD)
   629   by (import hollight SUB_ADD)
   640 
   630 
   641 lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
   631 lemma SUC_SUB1: "ALL x::nat. Suc x - NUMERAL_BIT1 0 = x"
   642   by (import hollight SUC_SUB1)
   632   by (import hollight SUC_SUB1)
   643 
   633 
   644 constdefs
   634 definition FACT :: "nat => nat" where 
   645   FACT :: "nat => nat" 
       
   646   "FACT ==
   635   "FACT ==
   647 SOME FACT::nat => nat.
   636 SOME FACT::nat => nat.
   648    FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   637    FACT 0 = NUMERAL_BIT1 0 & (ALL n::nat. FACT (Suc n) = Suc n * FACT n)"
   649 
   638 
   650 lemma DEF_FACT: "FACT =
   639 lemma DEF_FACT: "FACT =
   667 lemma DIVMOD_EXIST_0: "ALL (m::nat) n::nat.
   656 lemma DIVMOD_EXIST_0: "ALL (m::nat) n::nat.
   668    EX (x::nat) xa::nat.
   657    EX (x::nat) xa::nat.
   669       COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
   658       COND (n = 0) (x = 0 & xa = 0) (m = x * n + xa & < xa n)"
   670   by (import hollight DIVMOD_EXIST_0)
   659   by (import hollight DIVMOD_EXIST_0)
   671 
   660 
   672 constdefs
   661 definition DIV :: "nat => nat => nat" where 
   673   DIV :: "nat => nat => nat" 
       
   674   "DIV ==
   662   "DIV ==
   675 SOME q::nat => nat => nat.
   663 SOME q::nat => nat => nat.
   676    EX r::nat => nat => nat.
   664    EX r::nat => nat => nat.
   677       ALL (m::nat) n::nat.
   665       ALL (m::nat) n::nat.
   678          COND (n = 0) (q m n = 0 & r m n = 0)
   666          COND (n = 0) (q m n = 0 & r m n = 0)
   684        ALL (m::nat) n::nat.
   672        ALL (m::nat) n::nat.
   685           COND (n = 0) (q m n = 0 & r m n = 0)
   673           COND (n = 0) (q m n = 0 & r m n = 0)
   686            (m = q m n * n + r m n & < (r m n) n))"
   674            (m = q m n * n + r m n & < (r m n) n))"
   687   by (import hollight DEF_DIV)
   675   by (import hollight DEF_DIV)
   688 
   676 
   689 constdefs
   677 definition MOD :: "nat => nat => nat" where 
   690   MOD :: "nat => nat => nat" 
       
   691   "MOD ==
   678   "MOD ==
   692 SOME r::nat => nat => nat.
   679 SOME r::nat => nat => nat.
   693    ALL (m::nat) n::nat.
   680    ALL (m::nat) n::nat.
   694       COND (n = 0) (DIV m n = 0 & r m n = 0)
   681       COND (n = 0) (DIV m n = 0 & r m n = 0)
   695        (m = DIV m n * n + r m n & < (r m n) n)"
   682        (m = DIV m n * n + r m n & < (r m n) n)"
   875 lemma DIVMOD_ELIM_THM: "(P::nat => nat => bool) (DIV (m::nat) (n::nat)) (MOD m n) =
   862 lemma DIVMOD_ELIM_THM: "(P::nat => nat => bool) (DIV (m::nat) (n::nat)) (MOD m n) =
   876 (n = 0 & P 0 0 |
   863 (n = 0 & P 0 0 |
   877  n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   864  n ~= 0 & (ALL (q::nat) r::nat. m = q * n + r & < r n --> P q r))"
   878   by (import hollight DIVMOD_ELIM_THM)
   865   by (import hollight DIVMOD_ELIM_THM)
   879 
   866 
   880 constdefs
   867 definition eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" where 
   881   eqeq :: "'q_9910 => 'q_9909 => ('q_9910 => 'q_9909 => bool) => bool" 
       
   882   "eqeq ==
   868   "eqeq ==
   883 %(u::'q_9910::type) (ua::'q_9909::type)
   869 %(u::'q_9910::type) (ua::'q_9909::type)
   884    ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
   870    ub::'q_9910::type => 'q_9909::type => bool. ub u ua"
   885 
   871 
   886 lemma DEF__equal__equal_: "eqeq =
   872 lemma DEF__equal__equal_: "eqeq =
   887 (%(u::'q_9910::type) (ua::'q_9909::type)
   873 (%(u::'q_9910::type) (ua::'q_9909::type)
   888     ub::'q_9910::type => 'q_9909::type => bool. ub u ua)"
   874     ub::'q_9910::type => 'q_9909::type => bool. ub u ua)"
   889   by (import hollight DEF__equal__equal_)
   875   by (import hollight DEF__equal__equal_)
   890 
   876 
   891 constdefs
   877 definition mod_nat :: "nat => nat => nat => bool" where 
   892   mod_nat :: "nat => nat => nat => bool" 
       
   893   "mod_nat ==
   878   "mod_nat ==
   894 %(u::nat) (ua::nat) ub::nat. EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2"
   879 %(u::nat) (ua::nat) ub::nat. EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2"
   895 
   880 
   896 lemma DEF_mod_nat: "mod_nat =
   881 lemma DEF_mod_nat: "mod_nat =
   897 (%(u::nat) (ua::nat) ub::nat.
   882 (%(u::nat) (ua::nat) ub::nat.
   898     EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2)"
   883     EX (q1::nat) q2::nat. ua + u * q1 = ub + u * q2)"
   899   by (import hollight DEF_mod_nat)
   884   by (import hollight DEF_mod_nat)
   900 
   885 
   901 constdefs
   886 definition minimal :: "(nat => bool) => nat" where 
   902   minimal :: "(nat => bool) => nat" 
       
   903   "minimal == %u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m)"
   887   "minimal == %u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m)"
   904 
   888 
   905 lemma DEF_minimal: "minimal =
   889 lemma DEF_minimal: "minimal =
   906 (%u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m))"
   890 (%u::nat => bool. SOME n::nat. u n & (ALL m::nat. < m n --> ~ u m))"
   907   by (import hollight DEF_minimal)
   891   by (import hollight DEF_minimal)
   908 
   892 
   909 lemma MINIMAL: "ALL P::nat => bool.
   893 lemma MINIMAL: "ALL P::nat => bool.
   910    Ex P = (P (minimal P) & (ALL x::nat. < x (minimal P) --> ~ P x))"
   894    Ex P = (P (minimal P) & (ALL x::nat. < x (minimal P) --> ~ P x))"
   911   by (import hollight MINIMAL)
   895   by (import hollight MINIMAL)
   912 
   896 
   913 constdefs
   897 definition WF :: "('A => 'A => bool) => bool" where 
   914   WF :: "('A => 'A => bool) => bool" 
       
   915   "WF ==
   898   "WF ==
   916 %u::'A::type => 'A::type => bool.
   899 %u::'A::type => 'A::type => bool.
   917    ALL P::'A::type => bool.
   900    ALL P::'A::type => bool.
   918       Ex P --> (EX x::'A::type. P x & (ALL y::'A::type. u y x --> ~ P y))"
   901       Ex P --> (EX x::'A::type. P x & (ALL y::'A::type. u y x --> ~ P y))"
   919 
   902 
  1603        (P x1 y1 = P x2 y2) = (x1 = x2 & y1 = y2)) -->
  1586        (P x1 y1 = P x2 y2) = (x1 = x2 & y1 = y2)) -->
  1604    (EX (x::'C::type => 'A::type) Y::'C::type => 'B::type.
  1587    (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)"
  1588        ALL (xa::'A::type) y::'B::type. x (P xa y) = xa & Y (P xa y) = y)"
  1606   by (import hollight INJ_INVERSE2)
  1589   by (import hollight INJ_INVERSE2)
  1607 
  1590 
  1608 constdefs
  1591 definition NUMPAIR :: "nat => nat => nat" where 
  1609   NUMPAIR :: "nat => nat => nat" 
       
  1610   "NUMPAIR ==
  1592   "NUMPAIR ==
  1611 %(u::nat) ua::nat.
  1593 %(u::nat) ua::nat.
  1612    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  1594    EXP (NUMERAL_BIT0 (NUMERAL_BIT1 0)) u *
  1613    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0)"
  1595    (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua + NUMERAL_BIT1 0)"
  1614 
  1596 
  1624 
  1606 
  1625 lemma NUMPAIR_INJ: "ALL (x1::nat) (y1::nat) (x2::nat) y2::nat.
  1607 lemma NUMPAIR_INJ: "ALL (x1::nat) (y1::nat) (x2::nat) y2::nat.
  1626    (NUMPAIR x1 y1 = NUMPAIR x2 y2) = (x1 = x2 & y1 = y2)"
  1608    (NUMPAIR x1 y1 = NUMPAIR x2 y2) = (x1 = x2 & y1 = y2)"
  1627   by (import hollight NUMPAIR_INJ)
  1609   by (import hollight NUMPAIR_INJ)
  1628 
  1610 
  1629 constdefs
  1611 definition NUMFST :: "nat => nat" where 
  1630   NUMFST :: "nat => nat" 
       
  1631   "NUMFST ==
  1612   "NUMFST ==
  1632 SOME X::nat => nat.
  1613 SOME X::nat => nat.
  1633    EX Y::nat => nat.
  1614    EX Y::nat => nat.
  1634       ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1615       ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1635 
  1616 
  1637 (SOME X::nat => nat.
  1618 (SOME X::nat => nat.
  1638     EX Y::nat => nat.
  1619     EX Y::nat => nat.
  1639        ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1620        ALL (x::nat) y::nat. X (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1640   by (import hollight DEF_NUMFST)
  1621   by (import hollight DEF_NUMFST)
  1641 
  1622 
  1642 constdefs
  1623 definition NUMSND :: "nat => nat" where 
  1643   NUMSND :: "nat => nat" 
       
  1644   "NUMSND ==
  1624   "NUMSND ==
  1645 SOME Y::nat => nat.
  1625 SOME Y::nat => nat.
  1646    ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1626    ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y"
  1647 
  1627 
  1648 lemma DEF_NUMSND: "NUMSND =
  1628 lemma DEF_NUMSND: "NUMSND =
  1649 (SOME Y::nat => nat.
  1629 (SOME Y::nat => nat.
  1650     ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1630     ALL (x::nat) y::nat. NUMFST (NUMPAIR x y) = x & Y (NUMPAIR x y) = y)"
  1651   by (import hollight DEF_NUMSND)
  1631   by (import hollight DEF_NUMSND)
  1652 
  1632 
  1653 constdefs
  1633 definition NUMSUM :: "bool => nat => nat" where 
  1654   NUMSUM :: "bool => nat => nat" 
       
  1655   "NUMSUM ==
  1634   "NUMSUM ==
  1656 %(u::bool) ua::nat.
  1635 %(u::bool) ua::nat.
  1657    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  1636    COND u (Suc (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua))
  1658     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua)"
  1637     (NUMERAL_BIT0 (NUMERAL_BIT1 0) * ua)"
  1659 
  1638 
  1665 
  1644 
  1666 lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
  1645 lemma NUMSUM_INJ: "ALL (b1::bool) (x1::nat) (b2::bool) x2::nat.
  1667    (NUMSUM b1 x1 = NUMSUM b2 x2) = (b1 = b2 & x1 = x2)"
  1646    (NUMSUM b1 x1 = NUMSUM b2 x2) = (b1 = b2 & x1 = x2)"
  1668   by (import hollight NUMSUM_INJ)
  1647   by (import hollight NUMSUM_INJ)
  1669 
  1648 
  1670 constdefs
  1649 definition NUMLEFT :: "nat => bool" where 
  1671   NUMLEFT :: "nat => bool" 
       
  1672   "NUMLEFT ==
  1650   "NUMLEFT ==
  1673 SOME X::nat => bool.
  1651 SOME X::nat => bool.
  1674    EX Y::nat => nat.
  1652    EX Y::nat => nat.
  1675       ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1653       ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1676 
  1654 
  1678 (SOME X::nat => bool.
  1656 (SOME X::nat => bool.
  1679     EX Y::nat => nat.
  1657     EX Y::nat => nat.
  1680        ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1658        ALL (x::bool) y::nat. X (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1681   by (import hollight DEF_NUMLEFT)
  1659   by (import hollight DEF_NUMLEFT)
  1682 
  1660 
  1683 constdefs
  1661 definition NUMRIGHT :: "nat => nat" where 
  1684   NUMRIGHT :: "nat => nat" 
       
  1685   "NUMRIGHT ==
  1662   "NUMRIGHT ==
  1686 SOME Y::nat => nat.
  1663 SOME Y::nat => nat.
  1687    ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1664    ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y"
  1688 
  1665 
  1689 lemma DEF_NUMRIGHT: "NUMRIGHT =
  1666 lemma DEF_NUMRIGHT: "NUMRIGHT =
  1690 (SOME Y::nat => nat.
  1667 (SOME Y::nat => nat.
  1691     ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1668     ALL (x::bool) y::nat. NUMLEFT (NUMSUM x y) = x & Y (NUMSUM x y) = y)"
  1692   by (import hollight DEF_NUMRIGHT)
  1669   by (import hollight DEF_NUMRIGHT)
  1693 
  1670 
  1694 constdefs
  1671 definition INJN :: "nat => nat => 'A => bool" where 
  1695   INJN :: "nat => nat => 'A => bool" 
       
  1696   "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
  1672   "INJN == %(u::nat) (n::nat) a::'A::type. n = u"
  1697 
  1673 
  1698 lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
  1674 lemma DEF_INJN: "INJN = (%(u::nat) (n::nat) a::'A::type. n = u)"
  1699   by (import hollight DEF_INJN)
  1675   by (import hollight DEF_INJN)
  1700 
  1676 
  1708              ((INJN::nat => nat => 'A::type => bool) n1)
  1684              ((INJN::nat => nat => 'A::type => bool) n1)
  1709              ((INJN::nat => nat => 'A::type => bool) n2))
  1685              ((INJN::nat => nat => 'A::type => bool) n2))
  1710            ((op =::nat => nat => bool) n1 n2)))"
  1686            ((op =::nat => nat => bool) n1 n2)))"
  1711   by (import hollight INJN_INJ)
  1687   by (import hollight INJN_INJ)
  1712 
  1688 
  1713 constdefs
  1689 definition INJA :: "'A => nat => 'A => bool" where 
  1714   INJA :: "'A => nat => 'A => bool" 
       
  1715   "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
  1690   "INJA == %(u::'A::type) (n::nat) b::'A::type. b = u"
  1716 
  1691 
  1717 lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
  1692 lemma DEF_INJA: "INJA = (%(u::'A::type) (n::nat) b::'A::type. b = u)"
  1718   by (import hollight DEF_INJA)
  1693   by (import hollight DEF_INJA)
  1719 
  1694 
  1720 lemma INJA_INJ: "ALL (a1::'A::type) a2::'A::type. (INJA a1 = INJA a2) = (a1 = a2)"
  1695 lemma INJA_INJ: "ALL (a1::'A::type) a2::'A::type. (INJA a1 = INJA a2) = (a1 = a2)"
  1721   by (import hollight INJA_INJ)
  1696   by (import hollight INJA_INJ)
  1722 
  1697 
  1723 constdefs
  1698 definition INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" where 
  1724   INJF :: "(nat => nat => 'A => bool) => nat => 'A => bool" 
       
  1725   "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
  1699   "INJF == %(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n)"
  1726 
  1700 
  1727 lemma DEF_INJF: "INJF =
  1701 lemma DEF_INJF: "INJF =
  1728 (%(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n))"
  1702 (%(u::nat => nat => 'A::type => bool) n::nat. u (NUMFST n) (NUMSND n))"
  1729   by (import hollight DEF_INJF)
  1703   by (import hollight DEF_INJF)
  1730 
  1704 
  1731 lemma INJF_INJ: "ALL (f1::nat => nat => 'A::type => bool) f2::nat => nat => 'A::type => bool.
  1705 lemma INJF_INJ: "ALL (f1::nat => nat => 'A::type => bool) f2::nat => nat => 'A::type => bool.
  1732    (INJF f1 = INJF f2) = (f1 = f2)"
  1706    (INJF f1 = INJF f2) = (f1 = f2)"
  1733   by (import hollight INJF_INJ)
  1707   by (import hollight INJF_INJ)
  1734 
  1708 
  1735 constdefs
  1709 definition INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" where 
  1736   INJP :: "(nat => 'A => bool) => (nat => 'A => bool) => nat => 'A => bool" 
       
  1737   "INJP ==
  1710   "INJP ==
  1738 %(u::nat => 'A::type => bool) (ua::nat => 'A::type => bool) (n::nat)
  1711 %(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)"
  1712    a::'A::type. COND (NUMLEFT n) (u (NUMRIGHT n) a) (ua (NUMRIGHT n) a)"
  1740 
  1713 
  1741 lemma DEF_INJP: "INJP =
  1714 lemma DEF_INJP: "INJP =
  1746 lemma INJP_INJ: "ALL (f1::nat => 'A::type => bool) (f1'::nat => 'A::type => bool)
  1719 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.
  1720    (f2::nat => 'A::type => bool) f2'::nat => 'A::type => bool.
  1748    (INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
  1721    (INJP f1 f2 = INJP f1' f2') = (f1 = f1' & f2 = f2')"
  1749   by (import hollight INJP_INJ)
  1722   by (import hollight INJP_INJ)
  1750 
  1723 
  1751 constdefs
  1724 definition ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" where 
  1752   ZCONSTR :: "nat => 'A => (nat => nat => 'A => bool) => nat => 'A => bool" 
       
  1753   "ZCONSTR ==
  1725   "ZCONSTR ==
  1754 %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1726 %(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1755    INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
  1727    INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub))"
  1756 
  1728 
  1757 lemma DEF_ZCONSTR: "ZCONSTR =
  1729 lemma DEF_ZCONSTR: "ZCONSTR =
  1758 (%(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1730 (%(u::nat) (ua::'A::type) ub::nat => nat => 'A::type => bool.
  1759     INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub)))"
  1731     INJP (INJN (Suc u)) (INJP (INJA ua) (INJF ub)))"
  1760   by (import hollight DEF_ZCONSTR)
  1732   by (import hollight DEF_ZCONSTR)
  1761 
  1733 
  1762 constdefs
  1734 definition ZBOT :: "nat => 'A => bool" where 
  1763   ZBOT :: "nat => 'A => bool" 
       
  1764   "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1735   "ZBOT == INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1765 
  1736 
  1766 lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1737 lemma DEF_ZBOT: "ZBOT = INJP (INJN 0) (SOME z::nat => 'A::type => bool. True)"
  1767   by (import hollight DEF_ZBOT)
  1738   by (import hollight DEF_ZBOT)
  1768 
  1739 
  1769 lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'A::type) xb::nat => nat => 'A::type => bool.
  1740 lemma ZCONSTR_ZBOT: "ALL (x::nat) (xa::'A::type) xb::nat => nat => 'A::type => bool.
  1770    ZCONSTR x xa xb ~= ZBOT"
  1741    ZCONSTR x xa xb ~= ZBOT"
  1771   by (import hollight ZCONSTR_ZBOT)
  1742   by (import hollight ZCONSTR_ZBOT)
  1772 
  1743 
  1773 constdefs
  1744 definition ZRECSPACE :: "(nat => 'A => bool) => bool" where 
  1774   ZRECSPACE :: "(nat => 'A => bool) => bool" 
       
  1775   "ZRECSPACE ==
  1745   "ZRECSPACE ==
  1776 %a::nat => 'A::type => bool.
  1746 %a::nat => 'A::type => bool.
  1777    ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  1747    ALL ZRECSPACE'::(nat => 'A::type => bool) => bool.
  1778       (ALL a::nat => 'A::type => bool.
  1748       (ALL a::nat => 'A::type => bool.
  1779           a = ZBOT |
  1749           a = ZBOT |
  1807 
  1777 
  1808 lemmas "TYDEF_recspace_@intern" = typedef_hol2hollight 
  1778 lemmas "TYDEF_recspace_@intern" = typedef_hol2hollight 
  1809   [where a="a :: 'A recspace" and r=r ,
  1779   [where a="a :: 'A recspace" and r=r ,
  1810    OF type_definition_recspace]
  1780    OF type_definition_recspace]
  1811 
  1781 
  1812 constdefs
  1782 definition BOTTOM :: "'A recspace" where 
  1813   BOTTOM :: "'A recspace" 
       
  1814   "(op ==::'A::type recspace => 'A::type recspace => prop)
  1783   "(op ==::'A::type recspace => 'A::type recspace => prop)
  1815  (BOTTOM::'A::type recspace)
  1784  (BOTTOM::'A::type recspace)
  1816  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1785  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1817    (ZBOT::nat => 'A::type => bool))"
  1786    (ZBOT::nat => 'A::type => bool))"
  1818 
  1787 
  1820  (BOTTOM::'A::type recspace)
  1789  (BOTTOM::'A::type recspace)
  1821  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1790  ((_mk_rec::(nat => 'A::type => bool) => 'A::type recspace)
  1822    (ZBOT::nat => 'A::type => bool))"
  1791    (ZBOT::nat => 'A::type => bool))"
  1823   by (import hollight DEF_BOTTOM)
  1792   by (import hollight DEF_BOTTOM)
  1824 
  1793 
  1825 constdefs
  1794 definition CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" where 
  1826   CONSTR :: "nat => 'A => (nat => 'A recspace) => 'A recspace" 
       
  1827   "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1795   "(op ==::(nat => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1828         => (nat
  1796         => (nat
  1829             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1797             => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1830            => prop)
  1798            => prop)
  1831  (CONSTR::nat
  1799  (CONSTR::nat
  1898    EX f::'A::type recspace => 'B::type.
  1866    EX f::'A::type recspace => 'B::type.
  1899       ALL (c::nat) (i::'A::type) r::nat => 'A::type recspace.
  1867       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))"
  1868          f (CONSTR c i r) = Fn c i r (%n::nat. f (r n))"
  1901   by (import hollight CONSTR_REC)
  1869   by (import hollight CONSTR_REC)
  1902 
  1870 
  1903 constdefs
  1871 definition FCONS :: "'A => (nat => 'A) => nat => 'A" where 
  1904   FCONS :: "'A => (nat => 'A) => nat => 'A" 
       
  1905   "FCONS ==
  1872   "FCONS ==
  1906 SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  1873 SOME FCONS::'A::type => (nat => 'A::type) => nat => 'A::type.
  1907    (ALL (a::'A::type) f::nat => 'A::type. FCONS a f 0 = a) &
  1874    (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)"
  1875    (ALL (a::'A::type) (f::nat => 'A::type) n::nat. FCONS a f (Suc n) = f n)"
  1909 
  1876 
  1915   by (import hollight DEF_FCONS)
  1882   by (import hollight DEF_FCONS)
  1916 
  1883 
  1917 lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
  1884 lemma FCONS_UNDO: "ALL f::nat => 'A::type. f = FCONS (f 0) (f o Suc)"
  1918   by (import hollight FCONS_UNDO)
  1885   by (import hollight FCONS_UNDO)
  1919 
  1886 
  1920 constdefs
  1887 definition FNIL :: "nat => 'A" where 
  1921   FNIL :: "nat => 'A" 
       
  1922   "FNIL == %u::nat. SOME x::'A::type. True"
  1888   "FNIL == %u::nat. SOME x::'A::type. True"
  1923 
  1889 
  1924 lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
  1890 lemma DEF_FNIL: "FNIL = (%u::nat. SOME x::'A::type. True)"
  1925   by (import hollight DEF_FNIL)
  1891   by (import hollight DEF_FNIL)
  1926 
  1892 
  1993 
  1959 
  1994 lemmas "TYDEF_option_@intern" = typedef_hol2hollight 
  1960 lemmas "TYDEF_option_@intern" = typedef_hol2hollight 
  1995   [where a="a :: 'A hollight.option" and r=r ,
  1961   [where a="a :: 'A hollight.option" and r=r ,
  1996    OF type_definition_option]
  1962    OF type_definition_option]
  1997 
  1963 
  1998 constdefs
  1964 definition NONE :: "'A hollight.option" where 
  1999   NONE :: "'A hollight.option" 
       
  2000   "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
  1965   "(op ==::'A::type hollight.option => 'A::type hollight.option => prop)
  2001  (NONE::'A::type hollight.option)
  1966  (NONE::'A::type hollight.option)
  2002  ((_mk_option::'A::type recspace => 'A::type hollight.option)
  1967  ((_mk_option::'A::type recspace => 'A::type hollight.option)
  2003    ((CONSTR::nat
  1968    ((CONSTR::nat
  2004              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  1969              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2091 
  2056 
  2092 lemmas "TYDEF_list_@intern" = typedef_hol2hollight 
  2057 lemmas "TYDEF_list_@intern" = typedef_hol2hollight 
  2093   [where a="a :: 'A hollight.list" and r=r ,
  2058   [where a="a :: 'A hollight.list" and r=r ,
  2094    OF type_definition_list]
  2059    OF type_definition_list]
  2095 
  2060 
  2096 constdefs
  2061 definition NIL :: "'A hollight.list" where 
  2097   NIL :: "'A hollight.list" 
       
  2098   "(op ==::'A::type hollight.list => 'A::type hollight.list => prop)
  2062   "(op ==::'A::type hollight.list => 'A::type hollight.list => prop)
  2099  (NIL::'A::type hollight.list)
  2063  (NIL::'A::type hollight.list)
  2100  ((_mk_list::'A::type recspace => 'A::type hollight.list)
  2064  ((_mk_list::'A::type recspace => 'A::type hollight.list)
  2101    ((CONSTR::nat
  2065    ((CONSTR::nat
  2102              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2066              => 'A::type => (nat => 'A::type recspace) => 'A::type recspace)
  2112      (0::nat)
  2076      (0::nat)
  2113      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2077      ((Eps::('A::type => bool) => 'A::type) (%v::'A::type. True::bool))
  2114      (%n::nat. BOTTOM::'A::type recspace)))"
  2078      (%n::nat. BOTTOM::'A::type recspace)))"
  2115   by (import hollight DEF_NIL)
  2079   by (import hollight DEF_NIL)
  2116 
  2080 
  2117 constdefs
  2081 definition CONS :: "'A => 'A hollight.list => 'A hollight.list" where 
  2118   CONS :: "'A => 'A hollight.list => 'A hollight.list" 
       
  2119   "(op ==::('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2082   "(op ==::('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2120         => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2083         => ('A::type => 'A::type hollight.list => 'A::type hollight.list)
  2121            => prop)
  2084            => prop)
  2122  (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
  2085  (CONS::'A::type => 'A::type hollight.list => 'A::type hollight.list)
  2123  (%(a0::'A::type) a1::'A::type hollight.list.
  2086  (%(a0::'A::type) a1::'A::type hollight.list.
  2158 
  2121 
  2159 lemma bool_RECURSION: "ALL (a::'A::type) b::'A::type.
  2122 lemma bool_RECURSION: "ALL (a::'A::type) b::'A::type.
  2160    EX x::bool => 'A::type. x False = a & x True = b"
  2123    EX x::bool => 'A::type. x False = a & x True = b"
  2161   by (import hollight bool_RECURSION)
  2124   by (import hollight bool_RECURSION)
  2162 
  2125 
  2163 constdefs
  2126 definition ISO :: "('A => 'B) => ('B => 'A) => bool" where 
  2164   ISO :: "('A => 'B) => ('B => 'A) => bool" 
       
  2165   "ISO ==
  2127   "ISO ==
  2166 %(u::'A::type => 'B::type) ua::'B::type => 'A::type.
  2128 %(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)"
  2129    (ALL x::'B::type. u (ua x) = x) & (ALL y::'A::type. ua (u y) = y)"
  2168 
  2130 
  2169 lemma DEF_ISO: "ISO =
  2131 lemma DEF_ISO: "ISO =
  2242      ((Suc::nat => nat) (0::nat))
  2204      ((Suc::nat => nat) (0::nat))
  2243      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2205      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2244      (%n::nat. BOTTOM::bool recspace)))"
  2206      (%n::nat. BOTTOM::bool recspace)))"
  2245   by (import hollight DEF__10303)
  2207   by (import hollight DEF__10303)
  2246 
  2208 
  2247 constdefs
  2209 definition two_1 :: "N_2" where 
  2248   two_1 :: "N_2" 
       
  2249   "two_1 == _10302"
  2210   "two_1 == _10302"
  2250 
  2211 
  2251 lemma DEF_two_1: "two_1 = _10302"
  2212 lemma DEF_two_1: "two_1 = _10302"
  2252   by (import hollight DEF_two_1)
  2213   by (import hollight DEF_two_1)
  2253 
  2214 
  2254 constdefs
  2215 definition two_2 :: "N_2" where 
  2255   two_2 :: "N_2" 
       
  2256   "two_2 == _10303"
  2216   "two_2 == _10303"
  2257 
  2217 
  2258 lemma DEF_two_2: "two_2 = _10303"
  2218 lemma DEF_two_2: "two_2 = _10303"
  2259   by (import hollight DEF_two_2)
  2219   by (import hollight DEF_two_2)
  2260 
  2220 
  2335      ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
  2295      ((Suc::nat => nat) ((Suc::nat => nat) (0::nat)))
  2336      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2296      ((Eps::(bool => bool) => bool) (%x::bool. True::bool))
  2337      (%n::nat. BOTTOM::bool recspace)))"
  2297      (%n::nat. BOTTOM::bool recspace)))"
  2338   by (import hollight DEF__10328)
  2298   by (import hollight DEF__10328)
  2339 
  2299 
  2340 constdefs
  2300 definition three_1 :: "N_3" where 
  2341   three_1 :: "N_3" 
       
  2342   "three_1 == _10326"
  2301   "three_1 == _10326"
  2343 
  2302 
  2344 lemma DEF_three_1: "three_1 = _10326"
  2303 lemma DEF_three_1: "three_1 = _10326"
  2345   by (import hollight DEF_three_1)
  2304   by (import hollight DEF_three_1)
  2346 
  2305 
  2347 constdefs
  2306 definition three_2 :: "N_3" where 
  2348   three_2 :: "N_3" 
       
  2349   "three_2 == _10327"
  2307   "three_2 == _10327"
  2350 
  2308 
  2351 lemma DEF_three_2: "three_2 = _10327"
  2309 lemma DEF_three_2: "three_2 = _10327"
  2352   by (import hollight DEF_three_2)
  2310   by (import hollight DEF_three_2)
  2353 
  2311 
  2354 constdefs
  2312 definition three_3 :: "N_3" where 
  2355   three_3 :: "N_3" 
       
  2356   "three_3 == _10328"
  2313   "three_3 == _10328"
  2357 
  2314 
  2358 lemma DEF_three_3: "three_3 = _10328"
  2315 lemma DEF_three_3: "three_3 = _10328"
  2359   by (import hollight DEF_three_3)
  2316   by (import hollight DEF_three_3)
  2360 
  2317 
  2363    (ALL (a0::'A::type) a1::'A::type hollight.list.
  2320    (ALL (a0::'A::type) a1::'A::type hollight.list.
  2364        P a1 --> P (CONS a0 a1)) -->
  2321        P a1 --> P (CONS a0 a1)) -->
  2365    All P"
  2322    All P"
  2366   by (import hollight list_INDUCT)
  2323   by (import hollight list_INDUCT)
  2367 
  2324 
  2368 constdefs
  2325 definition HD :: "'A hollight.list => 'A" where 
  2369   HD :: "'A hollight.list => 'A" 
       
  2370   "HD ==
  2326   "HD ==
  2371 SOME HD::'A::type hollight.list => 'A::type.
  2327 SOME HD::'A::type hollight.list => 'A::type.
  2372    ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h"
  2328    ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h"
  2373 
  2329 
  2374 lemma DEF_HD: "HD =
  2330 lemma DEF_HD: "HD =
  2375 (SOME HD::'A::type hollight.list => 'A::type.
  2331 (SOME HD::'A::type hollight.list => 'A::type.
  2376     ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h)"
  2332     ALL (t::'A::type hollight.list) h::'A::type. HD (CONS h t) = h)"
  2377   by (import hollight DEF_HD)
  2333   by (import hollight DEF_HD)
  2378 
  2334 
  2379 constdefs
  2335 definition TL :: "'A hollight.list => 'A hollight.list" where 
  2380   TL :: "'A hollight.list => 'A hollight.list" 
       
  2381   "TL ==
  2336   "TL ==
  2382 SOME TL::'A::type hollight.list => 'A::type hollight.list.
  2337 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"
  2338    ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t"
  2384 
  2339 
  2385 lemma DEF_TL: "TL =
  2340 lemma DEF_TL: "TL =
  2386 (SOME TL::'A::type hollight.list => 'A::type hollight.list.
  2341 (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)"
  2342     ALL (h::'A::type) t::'A::type hollight.list. TL (CONS h t) = t)"
  2388   by (import hollight DEF_TL)
  2343   by (import hollight DEF_TL)
  2389 
  2344 
  2390 constdefs
  2345 definition APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" where 
  2391   APPEND :: "'A hollight.list => 'A hollight.list => 'A hollight.list" 
       
  2392   "APPEND ==
  2346   "APPEND ==
  2393 SOME APPEND::'A::type hollight.list
  2347 SOME APPEND::'A::type hollight.list
  2394              => 'A::type hollight.list => 'A::type hollight.list.
  2348              => 'A::type hollight.list => 'A::type hollight.list.
  2395    (ALL l::'A::type hollight.list. APPEND NIL l = l) &
  2349    (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.
  2350    (ALL (h::'A::type) (t::'A::type hollight.list) l::'A::type hollight.list.
  2403     (ALL (h::'A::type) (t::'A::type hollight.list)
  2357     (ALL (h::'A::type) (t::'A::type hollight.list)
  2404         l::'A::type hollight.list.
  2358         l::'A::type hollight.list.
  2405         APPEND (CONS h t) l = CONS h (APPEND t l)))"
  2359         APPEND (CONS h t) l = CONS h (APPEND t l)))"
  2406   by (import hollight DEF_APPEND)
  2360   by (import hollight DEF_APPEND)
  2407 
  2361 
  2408 constdefs
  2362 definition REVERSE :: "'A hollight.list => 'A hollight.list" where 
  2409   REVERSE :: "'A hollight.list => 'A hollight.list" 
       
  2410   "REVERSE ==
  2363   "REVERSE ==
  2411 SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
  2364 SOME REVERSE::'A::type hollight.list => 'A::type hollight.list.
  2412    REVERSE NIL = NIL &
  2365    REVERSE NIL = NIL &
  2413    (ALL (l::'A::type hollight.list) x::'A::type.
  2366    (ALL (l::'A::type hollight.list) x::'A::type.
  2414        REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL))"
  2367        REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL))"
  2418     REVERSE NIL = NIL &
  2371     REVERSE NIL = NIL &
  2419     (ALL (l::'A::type hollight.list) x::'A::type.
  2372     (ALL (l::'A::type hollight.list) x::'A::type.
  2420         REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL)))"
  2373         REVERSE (CONS x l) = APPEND (REVERSE l) (CONS x NIL)))"
  2421   by (import hollight DEF_REVERSE)
  2374   by (import hollight DEF_REVERSE)
  2422 
  2375 
  2423 constdefs
  2376 definition LENGTH :: "'A hollight.list => nat" where 
  2424   LENGTH :: "'A hollight.list => nat" 
       
  2425   "LENGTH ==
  2377   "LENGTH ==
  2426 SOME LENGTH::'A::type hollight.list => nat.
  2378 SOME LENGTH::'A::type hollight.list => nat.
  2427    LENGTH NIL = 0 &
  2379    LENGTH NIL = 0 &
  2428    (ALL (h::'A::type) t::'A::type hollight.list.
  2380    (ALL (h::'A::type) t::'A::type hollight.list.
  2429        LENGTH (CONS h t) = Suc (LENGTH t))"
  2381        LENGTH (CONS h t) = Suc (LENGTH t))"
  2433     LENGTH NIL = 0 &
  2385     LENGTH NIL = 0 &
  2434     (ALL (h::'A::type) t::'A::type hollight.list.
  2386     (ALL (h::'A::type) t::'A::type hollight.list.
  2435         LENGTH (CONS h t) = Suc (LENGTH t)))"
  2387         LENGTH (CONS h t) = Suc (LENGTH t)))"
  2436   by (import hollight DEF_LENGTH)
  2388   by (import hollight DEF_LENGTH)
  2437 
  2389 
  2438 constdefs
  2390 definition MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" where 
  2439   MAP :: "('A => 'B) => 'A hollight.list => 'B hollight.list" 
       
  2440   "MAP ==
  2391   "MAP ==
  2441 SOME MAP::('A::type => 'B::type)
  2392 SOME MAP::('A::type => 'B::type)
  2442           => 'A::type hollight.list => 'B::type hollight.list.
  2393           => 'A::type hollight.list => 'B::type hollight.list.
  2443    (ALL f::'A::type => 'B::type. MAP f NIL = NIL) &
  2394    (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.
  2395    (ALL (f::'A::type => 'B::type) (h::'A::type) t::'A::type hollight.list.
  2450     (ALL f::'A::type => 'B::type. MAP f NIL = NIL) &
  2401     (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.
  2402     (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)))"
  2403         MAP f (CONS h t) = CONS (f h) (MAP f t)))"
  2453   by (import hollight DEF_MAP)
  2404   by (import hollight DEF_MAP)
  2454 
  2405 
  2455 constdefs
  2406 definition LAST :: "'A hollight.list => 'A" where 
  2456   LAST :: "'A hollight.list => 'A" 
       
  2457   "LAST ==
  2407   "LAST ==
  2458 SOME LAST::'A::type hollight.list => 'A::type.
  2408 SOME LAST::'A::type hollight.list => 'A::type.
  2459    ALL (h::'A::type) t::'A::type hollight.list.
  2409    ALL (h::'A::type) t::'A::type hollight.list.
  2460       LAST (CONS h t) = COND (t = NIL) h (LAST t)"
  2410       LAST (CONS h t) = COND (t = NIL) h (LAST t)"
  2461 
  2411 
  2463 (SOME LAST::'A::type hollight.list => 'A::type.
  2413 (SOME LAST::'A::type hollight.list => 'A::type.
  2464     ALL (h::'A::type) t::'A::type hollight.list.
  2414     ALL (h::'A::type) t::'A::type hollight.list.
  2465        LAST (CONS h t) = COND (t = NIL) h (LAST t))"
  2415        LAST (CONS h t) = COND (t = NIL) h (LAST t))"
  2466   by (import hollight DEF_LAST)
  2416   by (import hollight DEF_LAST)
  2467 
  2417 
  2468 constdefs
  2418 definition REPLICATE :: "nat => 'q_16860 => 'q_16860 hollight.list" where 
  2469   REPLICATE :: "nat => 'q_16860 => 'q_16860 hollight.list" 
       
  2470   "REPLICATE ==
  2419   "REPLICATE ==
  2471 SOME REPLICATE::nat => 'q_16860::type => 'q_16860::type hollight.list.
  2420 SOME REPLICATE::nat => 'q_16860::type => 'q_16860::type hollight.list.
  2472    (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2421    (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2473    (ALL (n::nat) x::'q_16860::type.
  2422    (ALL (n::nat) x::'q_16860::type.
  2474        REPLICATE (Suc n) x = CONS x (REPLICATE n x))"
  2423        REPLICATE (Suc n) x = CONS x (REPLICATE n x))"
  2478     (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2427     (ALL x::'q_16860::type. REPLICATE 0 x = NIL) &
  2479     (ALL (n::nat) x::'q_16860::type.
  2428     (ALL (n::nat) x::'q_16860::type.
  2480         REPLICATE (Suc n) x = CONS x (REPLICATE n x)))"
  2429         REPLICATE (Suc n) x = CONS x (REPLICATE n x)))"
  2481   by (import hollight DEF_REPLICATE)
  2430   by (import hollight DEF_REPLICATE)
  2482 
  2431 
  2483 constdefs
  2432 definition NULL :: "'q_16875 hollight.list => bool" where 
  2484   NULL :: "'q_16875 hollight.list => bool" 
       
  2485   "NULL ==
  2433   "NULL ==
  2486 SOME NULL::'q_16875::type hollight.list => bool.
  2434 SOME NULL::'q_16875::type hollight.list => bool.
  2487    NULL NIL = True &
  2435    NULL NIL = True &
  2488    (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2436    (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2489        NULL (CONS h t) = False)"
  2437        NULL (CONS h t) = False)"
  2493     NULL NIL = True &
  2441     NULL NIL = True &
  2494     (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2442     (ALL (h::'q_16875::type) t::'q_16875::type hollight.list.
  2495         NULL (CONS h t) = False))"
  2443         NULL (CONS h t) = False))"
  2496   by (import hollight DEF_NULL)
  2444   by (import hollight DEF_NULL)
  2497 
  2445 
  2498 constdefs
  2446 definition ALL_list :: "('q_16895 => bool) => 'q_16895 hollight.list => bool" where 
  2499   ALL_list :: "('q_16895 => bool) => 'q_16895 hollight.list => bool" 
       
  2500   "ALL_list ==
  2447   "ALL_list ==
  2501 SOME u::('q_16895::type => bool) => 'q_16895::type hollight.list => bool.
  2448 SOME u::('q_16895::type => bool) => 'q_16895::type hollight.list => bool.
  2502    (ALL P::'q_16895::type => bool. u P NIL = True) &
  2449    (ALL P::'q_16895::type => bool. u P NIL = True) &
  2503    (ALL (h::'q_16895::type) (P::'q_16895::type => bool)
  2450    (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))"
  2451        t::'q_16895::type hollight.list. u P (CONS h t) = (P h & u P t))"
  2525     (ALL P::'q_16916::type => bool. u P NIL = False) &
  2472     (ALL P::'q_16916::type => bool. u P NIL = False) &
  2526     (ALL (h::'q_16916::type) (P::'q_16916::type => bool)
  2473     (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)))"
  2474         t::'q_16916::type hollight.list. u P (CONS h t) = (P h | u P t)))"
  2528   by (import hollight DEF_EX)
  2475   by (import hollight DEF_EX)
  2529 
  2476 
  2530 constdefs
  2477 definition ITLIST :: "('q_16939 => 'q_16938 => 'q_16938)
  2531   ITLIST :: "('q_16939 => 'q_16938 => 'q_16938)
  2478 => 'q_16939 hollight.list => 'q_16938 => 'q_16938" where 
  2532 => 'q_16939 hollight.list => 'q_16938 => 'q_16938" 
       
  2533   "ITLIST ==
  2479   "ITLIST ==
  2534 SOME ITLIST::('q_16939::type => 'q_16938::type => 'q_16938::type)
  2480 SOME ITLIST::('q_16939::type => 'q_16938::type => 'q_16938::type)
  2535              => 'q_16939::type hollight.list
  2481              => 'q_16939::type hollight.list
  2536                 => 'q_16938::type => 'q_16938::type.
  2482                 => 'q_16938::type => 'q_16938::type.
  2537    (ALL (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2483    (ALL (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2551         (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2497         (f::'q_16939::type => 'q_16938::type => 'q_16938::type)
  2552         (t::'q_16939::type hollight.list) b::'q_16938::type.
  2498         (t::'q_16939::type hollight.list) b::'q_16938::type.
  2553         ITLIST f (CONS h t) b = f h (ITLIST f t b)))"
  2499         ITLIST f (CONS h t) b = f h (ITLIST f t b)))"
  2554   by (import hollight DEF_ITLIST)
  2500   by (import hollight DEF_ITLIST)
  2555 
  2501 
  2556 constdefs
  2502 definition MEM :: "'q_16964 => 'q_16964 hollight.list => bool" where 
  2557   MEM :: "'q_16964 => 'q_16964 hollight.list => bool" 
       
  2558   "MEM ==
  2503   "MEM ==
  2559 SOME MEM::'q_16964::type => 'q_16964::type hollight.list => bool.
  2504 SOME MEM::'q_16964::type => 'q_16964::type hollight.list => bool.
  2560    (ALL x::'q_16964::type. MEM x NIL = False) &
  2505    (ALL x::'q_16964::type. MEM x NIL = False) &
  2561    (ALL (h::'q_16964::type) (x::'q_16964::type)
  2506    (ALL (h::'q_16964::type) (x::'q_16964::type)
  2562        t::'q_16964::type hollight.list.
  2507        t::'q_16964::type hollight.list.
  2568     (ALL (h::'q_16964::type) (x::'q_16964::type)
  2513     (ALL (h::'q_16964::type) (x::'q_16964::type)
  2569         t::'q_16964::type hollight.list.
  2514         t::'q_16964::type hollight.list.
  2570         MEM x (CONS h t) = (x = h | MEM x t)))"
  2515         MEM x (CONS h t) = (x = h | MEM x t)))"
  2571   by (import hollight DEF_MEM)
  2516   by (import hollight DEF_MEM)
  2572 
  2517 
  2573 constdefs
  2518 definition ALL2 :: "('q_16997 => 'q_17004 => bool)
  2574   ALL2 :: "('q_16997 => 'q_17004 => bool)
  2519 => 'q_16997 hollight.list => 'q_17004 hollight.list => bool" where 
  2575 => 'q_16997 hollight.list => 'q_17004 hollight.list => bool" 
       
  2576   "ALL2 ==
  2520   "ALL2 ==
  2577 SOME ALL2::('q_16997::type => 'q_17004::type => bool)
  2521 SOME ALL2::('q_16997::type => 'q_17004::type => bool)
  2578            => 'q_16997::type hollight.list
  2522            => 'q_16997::type hollight.list
  2579               => 'q_17004::type hollight.list => bool.
  2523               => 'q_17004::type hollight.list => bool.
  2580    (ALL (P::'q_16997::type => 'q_17004::type => bool)
  2524    (ALL (P::'q_16997::type => 'q_17004::type => bool)
  2602 ALL2 P NIL (CONS (h2::'q_17058::type) (t2::'q_17058::type hollight.list)) =
  2546 ALL2 P NIL (CONS (h2::'q_17058::type) (t2::'q_17058::type hollight.list)) =
  2603 False &
  2547 False &
  2604 ALL2 P (CONS h1 t1) (CONS h2 t2) = (P h1 h2 & ALL2 P t1 t2)"
  2548 ALL2 P (CONS h1 t1) (CONS h2 t2) = (P h1 h2 & ALL2 P t1 t2)"
  2605   by (import hollight ALL2)
  2549   by (import hollight ALL2)
  2606 
  2550 
  2607 constdefs
  2551 definition MAP2 :: "('q_17089 => 'q_17096 => 'q_17086)
  2608   MAP2 :: "('q_17089 => 'q_17096 => 'q_17086)
       
  2609 => 'q_17089 hollight.list
  2552 => 'q_17089 hollight.list
  2610    => 'q_17096 hollight.list => 'q_17086 hollight.list" 
  2553    => 'q_17096 hollight.list => 'q_17086 hollight.list" where 
  2611   "MAP2 ==
  2554   "MAP2 ==
  2612 SOME MAP2::('q_17089::type => 'q_17096::type => 'q_17086::type)
  2555 SOME MAP2::('q_17089::type => 'q_17096::type => 'q_17086::type)
  2613            => 'q_17089::type hollight.list
  2556            => 'q_17089::type hollight.list
  2614               => 'q_17096::type hollight.list
  2557               => 'q_17096::type hollight.list
  2615                  => 'q_17086::type hollight.list.
  2558                  => 'q_17086::type hollight.list.
  2637 MAP2 f (CONS (h1::'q_17131::type) (t1::'q_17131::type hollight.list))
  2580 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)) =
  2581  (CONS (h2::'q_17130::type) (t2::'q_17130::type hollight.list)) =
  2639 CONS (f h1 h2) (MAP2 f t1 t2)"
  2582 CONS (f h1 h2) (MAP2 f t1 t2)"
  2640   by (import hollight MAP2)
  2583   by (import hollight MAP2)
  2641 
  2584 
  2642 constdefs
  2585 definition EL :: "nat => 'q_17157 hollight.list => 'q_17157" where 
  2643   EL :: "nat => 'q_17157 hollight.list => 'q_17157" 
       
  2644   "EL ==
  2586   "EL ==
  2645 SOME EL::nat => 'q_17157::type hollight.list => 'q_17157::type.
  2587 SOME EL::nat => 'q_17157::type hollight.list => 'q_17157::type.
  2646    (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2588    (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2647    (ALL (n::nat) l::'q_17157::type hollight.list.
  2589    (ALL (n::nat) l::'q_17157::type hollight.list.
  2648        EL (Suc n) l = EL n (TL l))"
  2590        EL (Suc n) l = EL n (TL l))"
  2652     (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2594     (ALL l::'q_17157::type hollight.list. EL 0 l = HD l) &
  2653     (ALL (n::nat) l::'q_17157::type hollight.list.
  2595     (ALL (n::nat) l::'q_17157::type hollight.list.
  2654         EL (Suc n) l = EL n (TL l)))"
  2596         EL (Suc n) l = EL n (TL l)))"
  2655   by (import hollight DEF_EL)
  2597   by (import hollight DEF_EL)
  2656 
  2598 
  2657 constdefs
  2599 definition FILTER :: "('q_17182 => bool) => 'q_17182 hollight.list => 'q_17182 hollight.list" where 
  2658   FILTER :: "('q_17182 => bool) => 'q_17182 hollight.list => 'q_17182 hollight.list" 
       
  2659   "FILTER ==
  2600   "FILTER ==
  2660 SOME FILTER::('q_17182::type => bool)
  2601 SOME FILTER::('q_17182::type => bool)
  2661              => 'q_17182::type hollight.list
  2602              => 'q_17182::type hollight.list
  2662                 => 'q_17182::type hollight.list.
  2603                 => 'q_17182::type hollight.list.
  2663    (ALL P::'q_17182::type => bool. FILTER P NIL = NIL) &
  2604    (ALL P::'q_17182::type => bool. FILTER P NIL = NIL) &
  2674         t::'q_17182::type hollight.list.
  2615         t::'q_17182::type hollight.list.
  2675         FILTER P (CONS h t) =
  2616         FILTER P (CONS h t) =
  2676         COND (P h) (CONS h (FILTER P t)) (FILTER P t)))"
  2617         COND (P h) (CONS h (FILTER P t)) (FILTER P t)))"
  2677   by (import hollight DEF_FILTER)
  2618   by (import hollight DEF_FILTER)
  2678 
  2619 
  2679 constdefs
  2620 definition ASSOC :: "'q_17211 => ('q_17211 * 'q_17205) hollight.list => 'q_17205" where 
  2680   ASSOC :: "'q_17211 => ('q_17211 * 'q_17205) hollight.list => 'q_17205" 
       
  2681   "ASSOC ==
  2621   "ASSOC ==
  2682 SOME ASSOC::'q_17211::type
  2622 SOME ASSOC::'q_17211::type
  2683             => ('q_17211::type * 'q_17205::type) hollight.list
  2623             => ('q_17211::type * 'q_17205::type) hollight.list
  2684                => 'q_17205::type.
  2624                => 'q_17205::type.
  2685    ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2625    ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2693     ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2633     ALL (h::'q_17211::type * 'q_17205::type) (a::'q_17211::type)
  2694        t::('q_17211::type * 'q_17205::type) hollight.list.
  2634        t::('q_17211::type * 'q_17205::type) hollight.list.
  2695        ASSOC a (CONS h t) = COND (fst h = a) (snd h) (ASSOC a t))"
  2635        ASSOC a (CONS h t) = COND (fst h = a) (snd h) (ASSOC a t))"
  2696   by (import hollight DEF_ASSOC)
  2636   by (import hollight DEF_ASSOC)
  2697 
  2637 
  2698 constdefs
  2638 definition ITLIST2 :: "('q_17235 => 'q_17243 => 'q_17233 => 'q_17233)
  2699   ITLIST2 :: "('q_17235 => 'q_17243 => 'q_17233 => 'q_17233)
  2639 => 'q_17235 hollight.list => 'q_17243 hollight.list => 'q_17233 => 'q_17233" where 
  2700 => 'q_17235 hollight.list => 'q_17243 hollight.list => 'q_17233 => 'q_17233" 
       
  2701   "ITLIST2 ==
  2640   "ITLIST2 ==
  2702 SOME ITLIST2::('q_17235::type
  2641 SOME ITLIST2::('q_17235::type
  2703                => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2642                => 'q_17243::type => 'q_17233::type => 'q_17233::type)
  2704               => 'q_17235::type hollight.list
  2643               => 'q_17235::type hollight.list
  2705                  => 'q_17243::type hollight.list
  2644                  => 'q_17243::type hollight.list
  3039     (Q::'A::type => 'B::type => bool) x y) -->
  2978     (Q::'A::type => 'B::type => bool) x y) -->
  3040 ALL2 P (l::'A::type hollight.list) (l'::'B::type hollight.list) -->
  2979 ALL2 P (l::'A::type hollight.list) (l'::'B::type hollight.list) -->
  3041 ALL2 Q l l'"
  2980 ALL2 Q l l'"
  3042   by (import hollight MONO_ALL2)
  2981   by (import hollight MONO_ALL2)
  3043 
  2982 
  3044 constdefs
  2983 definition dist :: "nat * nat => nat" where 
  3045   dist :: "nat * nat => nat" 
       
  3046   "dist == %u::nat * nat. fst u - snd u + (snd u - fst u)"
  2984   "dist == %u::nat * nat. fst u - snd u + (snd u - fst u)"
  3047 
  2985 
  3048 lemma DEF_dist: "dist = (%u::nat * nat. fst u - snd u + (snd u - fst u))"
  2986 lemma DEF_dist: "dist = (%u::nat * nat. fst u - snd u + (snd u - fst u))"
  3049   by (import hollight DEF_dist)
  2987   by (import hollight DEF_dist)
  3050 
  2988 
  3131 lemma BOUNDS_IGNORE: "ALL (P::nat => nat) Q::nat => nat.
  3069 lemma BOUNDS_IGNORE: "ALL (P::nat => nat) Q::nat => nat.
  3132    (EX B::nat. ALL i::nat. <= (P i) (Q i + B)) =
  3070    (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))"
  3071    (EX (x::nat) N::nat. ALL i::nat. <= N i --> <= (P i) (Q i + x))"
  3134   by (import hollight BOUNDS_IGNORE)
  3072   by (import hollight BOUNDS_IGNORE)
  3135 
  3073 
  3136 constdefs
  3074 definition is_nadd :: "(nat => nat) => bool" where 
  3137   is_nadd :: "(nat => nat) => bool" 
       
  3138   "is_nadd ==
  3075   "is_nadd ==
  3139 %u::nat => nat.
  3076 %u::nat => nat.
  3140    EX B::nat.
  3077    EX B::nat.
  3141       ALL (m::nat) n::nat. <= (dist (m * u n, n * u m)) (B * (m + n))"
  3078       ALL (m::nat) n::nat. <= (dist (m * u n, n * u m)) (B * (m + n))"
  3142 
  3079 
  3209               (n * dest_nadd x (dest_nadd y n),
  3146               (n * dest_nadd x (dest_nadd y n),
  3210                dest_nadd x n * dest_nadd y n))
  3147                dest_nadd x n * dest_nadd y n))
  3211           (A * n + B)"
  3148           (A * n + B)"
  3212   by (import hollight NADD_ALTMUL)
  3149   by (import hollight NADD_ALTMUL)
  3213 
  3150 
  3214 constdefs
  3151 definition nadd_eq :: "nadd => nadd => bool" where 
  3215   nadd_eq :: "nadd => nadd => bool" 
       
  3216   "nadd_eq ==
  3152   "nadd_eq ==
  3217 %(u::nadd) ua::nadd.
  3153 %(u::nadd) ua::nadd.
  3218    EX B::nat. ALL n::nat. <= (dist (dest_nadd u n, dest_nadd ua n)) B"
  3154    EX B::nat. ALL n::nat. <= (dist (dest_nadd u n, dest_nadd ua n)) B"
  3219 
  3155 
  3220 lemma DEF_nadd_eq: "nadd_eq =
  3156 lemma DEF_nadd_eq: "nadd_eq =
  3229   by (import hollight NADD_EQ_SYM)
  3165   by (import hollight NADD_EQ_SYM)
  3230 
  3166 
  3231 lemma NADD_EQ_TRANS: "ALL (x::nadd) (y::nadd) z::nadd. nadd_eq x y & nadd_eq y z --> nadd_eq x z"
  3167 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)
  3168   by (import hollight NADD_EQ_TRANS)
  3233 
  3169 
  3234 constdefs
  3170 definition nadd_of_num :: "nat => nadd" where 
  3235   nadd_of_num :: "nat => nadd" 
       
  3236   "nadd_of_num == %u::nat. mk_nadd (op * u)"
  3171   "nadd_of_num == %u::nat. mk_nadd (op * u)"
  3237 
  3172 
  3238 lemma DEF_nadd_of_num: "nadd_of_num = (%u::nat. mk_nadd (op * u))"
  3173 lemma DEF_nadd_of_num: "nadd_of_num = (%u::nat. mk_nadd (op * u))"
  3239   by (import hollight DEF_nadd_of_num)
  3174   by (import hollight DEF_nadd_of_num)
  3240 
  3175 
  3245   by (import hollight NADD_OF_NUM_WELLDEF)
  3180   by (import hollight NADD_OF_NUM_WELLDEF)
  3246 
  3181 
  3247 lemma NADD_OF_NUM_EQ: "ALL (m::nat) n::nat. nadd_eq (nadd_of_num m) (nadd_of_num n) = (m = n)"
  3182 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)
  3183   by (import hollight NADD_OF_NUM_EQ)
  3249 
  3184 
  3250 constdefs
  3185 definition nadd_le :: "nadd => nadd => bool" where 
  3251   nadd_le :: "nadd => nadd => bool" 
       
  3252   "nadd_le ==
  3186   "nadd_le ==
  3253 %(u::nadd) ua::nadd.
  3187 %(u::nadd) ua::nadd.
  3254    EX B::nat. ALL n::nat. <= (dest_nadd u n) (dest_nadd ua n + B)"
  3188    EX B::nat. ALL n::nat. <= (dest_nadd u n) (dest_nadd ua n + B)"
  3255 
  3189 
  3256 lemma DEF_nadd_le: "nadd_le =
  3190 lemma DEF_nadd_le: "nadd_le =
  3287   by (import hollight NADD_ARCH)
  3221   by (import hollight NADD_ARCH)
  3288 
  3222 
  3289 lemma NADD_OF_NUM_LE: "ALL (m::nat) n::nat. nadd_le (nadd_of_num m) (nadd_of_num n) = <= m n"
  3223 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)
  3224   by (import hollight NADD_OF_NUM_LE)
  3291 
  3225 
  3292 constdefs
  3226 definition nadd_add :: "nadd => nadd => nadd" where 
  3293   nadd_add :: "nadd => nadd => nadd" 
       
  3294   "nadd_add ==
  3227   "nadd_add ==
  3295 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n)"
  3228 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n)"
  3296 
  3229 
  3297 lemma DEF_nadd_add: "nadd_add =
  3230 lemma DEF_nadd_add: "nadd_add =
  3298 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n))"
  3231 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u n + dest_nadd ua n))"
  3330 lemma NADD_OF_NUM_ADD: "ALL (x::nat) xa::nat.
  3263 lemma NADD_OF_NUM_ADD: "ALL (x::nat) xa::nat.
  3331    nadd_eq (nadd_add (nadd_of_num x) (nadd_of_num xa))
  3264    nadd_eq (nadd_add (nadd_of_num x) (nadd_of_num xa))
  3332     (nadd_of_num (x + xa))"
  3265     (nadd_of_num (x + xa))"
  3333   by (import hollight NADD_OF_NUM_ADD)
  3266   by (import hollight NADD_OF_NUM_ADD)
  3334 
  3267 
  3335 constdefs
  3268 definition nadd_mul :: "nadd => nadd => nadd" where 
  3336   nadd_mul :: "nadd => nadd => nadd" 
       
  3337   "nadd_mul ==
  3269   "nadd_mul ==
  3338 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n))"
  3270 %(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n))"
  3339 
  3271 
  3340 lemma DEF_nadd_mul: "nadd_mul =
  3272 lemma DEF_nadd_mul: "nadd_mul =
  3341 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n)))"
  3273 (%(u::nadd) ua::nadd. mk_nadd (%n::nat. dest_nadd u (dest_nadd ua n)))"
  3436 lemma NADD_LBOUND: "ALL x::nadd.
  3368 lemma NADD_LBOUND: "ALL x::nadd.
  3437    ~ nadd_eq x (nadd_of_num 0) -->
  3369    ~ nadd_eq x (nadd_of_num 0) -->
  3438    (EX (A::nat) N::nat. ALL n::nat. <= N n --> <= n (A * dest_nadd x n))"
  3370    (EX (A::nat) N::nat. ALL n::nat. <= N n --> <= n (A * dest_nadd x n))"
  3439   by (import hollight NADD_LBOUND)
  3371   by (import hollight NADD_LBOUND)
  3440 
  3372 
  3441 constdefs
  3373 definition nadd_rinv :: "nadd => nat => nat" where 
  3442   nadd_rinv :: "nadd => nat => nat" 
       
  3443   "nadd_rinv == %(u::nadd) n::nat. DIV (n * n) (dest_nadd u n)"
  3374   "nadd_rinv == %(u::nadd) n::nat. DIV (n * n) (dest_nadd u n)"
  3444 
  3375 
  3445 lemma DEF_nadd_rinv: "nadd_rinv = (%(u::nadd) n::nat. DIV (n * n) (dest_nadd u n))"
  3376 lemma DEF_nadd_rinv: "nadd_rinv = (%(u::nadd) n::nat. DIV (n * n) (dest_nadd u n))"
  3446   by (import hollight DEF_nadd_rinv)
  3377   by (import hollight DEF_nadd_rinv)
  3447 
  3378 
  3526    (EX B::nat.
  3457    (EX B::nat.
  3527        ALL (m::nat) n::nat.
  3458        ALL (m::nat) n::nat.
  3528           <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
  3459           <= (dist (m * nadd_rinv x n, n * nadd_rinv x m)) (B * (m + n)))"
  3529   by (import hollight NADD_MUL_LINV_LEMMA8)
  3460   by (import hollight NADD_MUL_LINV_LEMMA8)
  3530 
  3461 
  3531 constdefs
  3462 definition nadd_inv :: "nadd => nadd" where 
  3532   nadd_inv :: "nadd => nadd" 
       
  3533   "nadd_inv ==
  3463   "nadd_inv ==
  3534 %u::nadd.
  3464 %u::nadd.
  3535    COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0) (mk_nadd (nadd_rinv u))"
  3465    COND (nadd_eq u (nadd_of_num 0)) (nadd_of_num 0) (mk_nadd (nadd_rinv u))"
  3536 
  3466 
  3537 lemma DEF_nadd_inv: "nadd_inv =
  3467 lemma DEF_nadd_inv: "nadd_inv =
  3568 
  3498 
  3569 lemmas "TYDEF_hreal_@intern" = typedef_hol2hollight 
  3499 lemmas "TYDEF_hreal_@intern" = typedef_hol2hollight 
  3570   [where a="a :: hreal" and r=r ,
  3500   [where a="a :: hreal" and r=r ,
  3571    OF type_definition_hreal]
  3501    OF type_definition_hreal]
  3572 
  3502 
  3573 constdefs
  3503 definition hreal_of_num :: "nat => hreal" where 
  3574   hreal_of_num :: "nat => hreal" 
       
  3575   "hreal_of_num == %m::nat. mk_hreal (nadd_eq (nadd_of_num m))"
  3504   "hreal_of_num == %m::nat. mk_hreal (nadd_eq (nadd_of_num m))"
  3576 
  3505 
  3577 lemma DEF_hreal_of_num: "hreal_of_num = (%m::nat. mk_hreal (nadd_eq (nadd_of_num m)))"
  3506 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)
  3507   by (import hollight DEF_hreal_of_num)
  3579 
  3508 
  3580 constdefs
  3509 definition hreal_add :: "hreal => hreal => hreal" where 
  3581   hreal_add :: "hreal => hreal => hreal" 
       
  3582   "hreal_add ==
  3510   "hreal_add ==
  3583 %(x::hreal) y::hreal.
  3511 %(x::hreal) y::hreal.
  3584    mk_hreal
  3512    mk_hreal
  3585     (%u::nadd.
  3513     (%u::nadd.
  3586         EX (xa::nadd) ya::nadd.
  3514         EX (xa::nadd) ya::nadd.
  3592      (%u::nadd.
  3520      (%u::nadd.
  3593          EX (xa::nadd) ya::nadd.
  3521          EX (xa::nadd) ya::nadd.
  3594             nadd_eq (nadd_add xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3522             nadd_eq (nadd_add xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3595   by (import hollight DEF_hreal_add)
  3523   by (import hollight DEF_hreal_add)
  3596 
  3524 
  3597 constdefs
  3525 definition hreal_mul :: "hreal => hreal => hreal" where 
  3598   hreal_mul :: "hreal => hreal => hreal" 
       
  3599   "hreal_mul ==
  3526   "hreal_mul ==
  3600 %(x::hreal) y::hreal.
  3527 %(x::hreal) y::hreal.
  3601    mk_hreal
  3528    mk_hreal
  3602     (%u::nadd.
  3529     (%u::nadd.
  3603         EX (xa::nadd) ya::nadd.
  3530         EX (xa::nadd) ya::nadd.
  3609      (%u::nadd.
  3536      (%u::nadd.
  3610          EX (xa::nadd) ya::nadd.
  3537          EX (xa::nadd) ya::nadd.
  3611             nadd_eq (nadd_mul xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3538             nadd_eq (nadd_mul xa ya) u & dest_hreal x xa & dest_hreal y ya))"
  3612   by (import hollight DEF_hreal_mul)
  3539   by (import hollight DEF_hreal_mul)
  3613 
  3540 
  3614 constdefs
  3541 definition hreal_le :: "hreal => hreal => bool" where 
  3615   hreal_le :: "hreal => hreal => bool" 
       
  3616   "hreal_le ==
  3542   "hreal_le ==
  3617 %(x::hreal) y::hreal.
  3543 %(x::hreal) y::hreal.
  3618    SOME u::bool.
  3544    SOME u::bool.
  3619       EX (xa::nadd) ya::nadd.
  3545       EX (xa::nadd) ya::nadd.
  3620          nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya"
  3546          nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya"
  3624     SOME u::bool.
  3550     SOME u::bool.
  3625        EX (xa::nadd) ya::nadd.
  3551        EX (xa::nadd) ya::nadd.
  3626           nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya)"
  3552           nadd_le xa ya = u & dest_hreal x xa & dest_hreal y ya)"
  3627   by (import hollight DEF_hreal_le)
  3553   by (import hollight DEF_hreal_le)
  3628 
  3554 
  3629 constdefs
  3555 definition hreal_inv :: "hreal => hreal" where 
  3630   hreal_inv :: "hreal => hreal" 
       
  3631   "hreal_inv ==
  3556   "hreal_inv ==
  3632 %x::hreal.
  3557 %x::hreal.
  3633    mk_hreal
  3558    mk_hreal
  3634     (%u::nadd. EX xa::nadd. nadd_eq (nadd_inv xa) u & dest_hreal x xa)"
  3559     (%u::nadd. EX xa::nadd. nadd_eq (nadd_inv xa) u & dest_hreal x xa)"
  3635 
  3560 
  3683 
  3608 
  3684 lemma HREAL_LE_MUL_RCANCEL_IMP: "ALL (a::hreal) (b::hreal) c::hreal.
  3609 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)"
  3610    hreal_le a b --> hreal_le (hreal_mul a c) (hreal_mul b c)"
  3686   by (import hollight HREAL_LE_MUL_RCANCEL_IMP)
  3611   by (import hollight HREAL_LE_MUL_RCANCEL_IMP)
  3687 
  3612 
  3688 constdefs
  3613 definition treal_of_num :: "nat => hreal * hreal" where 
  3689   treal_of_num :: "nat => hreal * hreal" 
       
  3690   "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num 0)"
  3614   "treal_of_num == %u::nat. (hreal_of_num u, hreal_of_num 0)"
  3691 
  3615 
  3692 lemma DEF_treal_of_num: "treal_of_num = (%u::nat. (hreal_of_num u, hreal_of_num 0))"
  3616 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)
  3617   by (import hollight DEF_treal_of_num)
  3694 
  3618 
  3695 constdefs
  3619 definition treal_neg :: "hreal * hreal => hreal * hreal" where 
  3696   treal_neg :: "hreal * hreal => hreal * hreal" 
       
  3697   "treal_neg == %u::hreal * hreal. (snd u, fst u)"
  3620   "treal_neg == %u::hreal * hreal. (snd u, fst u)"
  3698 
  3621 
  3699 lemma DEF_treal_neg: "treal_neg = (%u::hreal * hreal. (snd u, fst u))"
  3622 lemma DEF_treal_neg: "treal_neg = (%u::hreal * hreal. (snd u, fst u))"
  3700   by (import hollight DEF_treal_neg)
  3623   by (import hollight DEF_treal_neg)
  3701 
  3624 
  3702 constdefs
  3625 definition treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
  3703   treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" 
       
  3704   "treal_add ==
  3626   "treal_add ==
  3705 %(u::hreal * hreal) ua::hreal * hreal.
  3627 %(u::hreal * hreal) ua::hreal * hreal.
  3706    (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua))"
  3628    (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua))"
  3707 
  3629 
  3708 lemma DEF_treal_add: "treal_add =
  3630 lemma DEF_treal_add: "treal_add =
  3709 (%(u::hreal * hreal) ua::hreal * hreal.
  3631 (%(u::hreal * hreal) ua::hreal * hreal.
  3710     (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua)))"
  3632     (hreal_add (fst u) (fst ua), hreal_add (snd u) (snd ua)))"
  3711   by (import hollight DEF_treal_add)
  3633   by (import hollight DEF_treal_add)
  3712 
  3634 
  3713 constdefs
  3635 definition treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" where 
  3714   treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" 
       
  3715   "treal_mul ==
  3636   "treal_mul ==
  3716 %(u::hreal * hreal) ua::hreal * hreal.
  3637 %(u::hreal * hreal) ua::hreal * hreal.
  3717    (hreal_add (hreal_mul (fst u) (fst ua)) (hreal_mul (snd u) (snd ua)),
  3638    (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)))"
  3639     hreal_add (hreal_mul (fst u) (snd ua)) (hreal_mul (snd u) (fst ua)))"
  3719 
  3640 
  3721 (%(u::hreal * hreal) ua::hreal * hreal.
  3642 (%(u::hreal * hreal) ua::hreal * hreal.
  3722     (hreal_add (hreal_mul (fst u) (fst ua)) (hreal_mul (snd u) (snd ua)),
  3643     (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))))"
  3644      hreal_add (hreal_mul (fst u) (snd ua)) (hreal_mul (snd u) (fst ua))))"
  3724   by (import hollight DEF_treal_mul)
  3645   by (import hollight DEF_treal_mul)
  3725 
  3646 
  3726 constdefs
  3647 definition treal_le :: "hreal * hreal => hreal * hreal => bool" where 
  3727   treal_le :: "hreal * hreal => hreal * hreal => bool" 
       
  3728   "treal_le ==
  3648   "treal_le ==
  3729 %(u::hreal * hreal) ua::hreal * hreal.
  3649 %(u::hreal * hreal) ua::hreal * hreal.
  3730    hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u))"
  3650    hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u))"
  3731 
  3651 
  3732 lemma DEF_treal_le: "treal_le =
  3652 lemma DEF_treal_le: "treal_le =
  3733 (%(u::hreal * hreal) ua::hreal * hreal.
  3653 (%(u::hreal * hreal) ua::hreal * hreal.
  3734     hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u)))"
  3654     hreal_le (hreal_add (fst u) (snd ua)) (hreal_add (fst ua) (snd u)))"
  3735   by (import hollight DEF_treal_le)
  3655   by (import hollight DEF_treal_le)
  3736 
  3656 
  3737 constdefs
  3657 definition treal_inv :: "hreal * hreal => hreal * hreal" where 
  3738   treal_inv :: "hreal * hreal => hreal * hreal" 
       
  3739   "treal_inv ==
  3658   "treal_inv ==
  3740 %u::hreal * hreal.
  3659 %u::hreal * hreal.
  3741    COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
  3660    COND (fst u = snd u) (hreal_of_num 0, hreal_of_num 0)
  3742     (COND (hreal_le (snd u) (fst u))
  3661     (COND (hreal_le (snd u) (fst u))
  3743       (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
  3662       (hreal_inv (SOME d::hreal. fst u = hreal_add (snd u) d),
  3753         hreal_of_num 0)
  3672         hreal_of_num 0)
  3754        (hreal_of_num 0,
  3673        (hreal_of_num 0,
  3755         hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d))))"
  3674         hreal_inv (SOME d::hreal. snd u = hreal_add (fst u) d))))"
  3756   by (import hollight DEF_treal_inv)
  3675   by (import hollight DEF_treal_inv)
  3757 
  3676 
  3758 constdefs
  3677 definition treal_eq :: "hreal * hreal => hreal * hreal => bool" where 
  3759   treal_eq :: "hreal * hreal => hreal * hreal => bool" 
       
  3760   "treal_eq ==
  3678   "treal_eq ==
  3761 %(u::hreal * hreal) ua::hreal * hreal.
  3679 %(u::hreal * hreal) ua::hreal * hreal.
  3762    hreal_add (fst u) (snd ua) = hreal_add (fst ua) (snd u)"
  3680    hreal_add (fst u) (snd ua) = hreal_add (fst ua) (snd u)"
  3763 
  3681 
  3764 lemma DEF_treal_eq: "treal_eq =
  3682 lemma DEF_treal_eq: "treal_eq =
  3914 
  3832 
  3915 lemmas "TYDEF_real_@intern" = typedef_hol2hollight 
  3833 lemmas "TYDEF_real_@intern" = typedef_hol2hollight 
  3916   [where a="a :: hollight.real" and r=r ,
  3834   [where a="a :: hollight.real" and r=r ,
  3917    OF type_definition_real]
  3835    OF type_definition_real]
  3918 
  3836 
  3919 constdefs
  3837 definition real_of_num :: "nat => hollight.real" where 
  3920   real_of_num :: "nat => hollight.real" 
       
  3921   "real_of_num == %m::nat. mk_real (treal_eq (treal_of_num m))"
  3838   "real_of_num == %m::nat. mk_real (treal_eq (treal_of_num m))"
  3922 
  3839 
  3923 lemma DEF_real_of_num: "real_of_num = (%m::nat. mk_real (treal_eq (treal_of_num m)))"
  3840 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)
  3841   by (import hollight DEF_real_of_num)
  3925 
  3842 
  3926 constdefs
  3843 definition real_neg :: "hollight.real => hollight.real" where 
  3927   real_neg :: "hollight.real => hollight.real" 
       
  3928   "real_neg ==
  3844   "real_neg ==
  3929 %x1::hollight.real.
  3845 %x1::hollight.real.
  3930    mk_real
  3846    mk_real
  3931     (%u::hreal * hreal.
  3847     (%u::hreal * hreal.
  3932         EX x1a::hreal * hreal.
  3848         EX x1a::hreal * hreal.
  3938      (%u::hreal * hreal.
  3854      (%u::hreal * hreal.
  3939          EX x1a::hreal * hreal.
  3855          EX x1a::hreal * hreal.
  3940             treal_eq (treal_neg x1a) u & dest_real x1 x1a))"
  3856             treal_eq (treal_neg x1a) u & dest_real x1 x1a))"
  3941   by (import hollight DEF_real_neg)
  3857   by (import hollight DEF_real_neg)
  3942 
  3858 
  3943 constdefs
  3859 definition real_add :: "hollight.real => hollight.real => hollight.real" where 
  3944   real_add :: "hollight.real => hollight.real => hollight.real" 
       
  3945   "real_add ==
  3860   "real_add ==
  3946 %(x1::hollight.real) y1::hollight.real.
  3861 %(x1::hollight.real) y1::hollight.real.
  3947    mk_real
  3862    mk_real
  3948     (%u::hreal * hreal.
  3863     (%u::hreal * hreal.
  3949         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3864         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3957          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3872          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3958             treal_eq (treal_add x1a y1a) u &
  3873             treal_eq (treal_add x1a y1a) u &
  3959             dest_real x1 x1a & dest_real y1 y1a))"
  3874             dest_real x1 x1a & dest_real y1 y1a))"
  3960   by (import hollight DEF_real_add)
  3875   by (import hollight DEF_real_add)
  3961 
  3876 
  3962 constdefs
  3877 definition real_mul :: "hollight.real => hollight.real => hollight.real" where 
  3963   real_mul :: "hollight.real => hollight.real => hollight.real" 
       
  3964   "real_mul ==
  3878   "real_mul ==
  3965 %(x1::hollight.real) y1::hollight.real.
  3879 %(x1::hollight.real) y1::hollight.real.
  3966    mk_real
  3880    mk_real
  3967     (%u::hreal * hreal.
  3881     (%u::hreal * hreal.
  3968         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3882         EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3976          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3890          EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3977             treal_eq (treal_mul x1a y1a) u &
  3891             treal_eq (treal_mul x1a y1a) u &
  3978             dest_real x1 x1a & dest_real y1 y1a))"
  3892             dest_real x1 x1a & dest_real y1 y1a))"
  3979   by (import hollight DEF_real_mul)
  3893   by (import hollight DEF_real_mul)
  3980 
  3894 
  3981 constdefs
  3895 definition real_le :: "hollight.real => hollight.real => bool" where 
  3982   real_le :: "hollight.real => hollight.real => bool" 
       
  3983   "real_le ==
  3896   "real_le ==
  3984 %(x1::hollight.real) y1::hollight.real.
  3897 %(x1::hollight.real) y1::hollight.real.
  3985    SOME u::bool.
  3898    SOME u::bool.
  3986       EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3899       EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3987          treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a"
  3900          treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a"
  3991     SOME u::bool.
  3904     SOME u::bool.
  3992        EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3905        EX (x1a::hreal * hreal) y1a::hreal * hreal.
  3993           treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a)"
  3906           treal_le x1a y1a = u & dest_real x1 x1a & dest_real y1 y1a)"
  3994   by (import hollight DEF_real_le)
  3907   by (import hollight DEF_real_le)
  3995 
  3908 
  3996 constdefs
  3909 definition real_inv :: "hollight.real => hollight.real" where 
  3997   real_inv :: "hollight.real => hollight.real" 
       
  3998   "real_inv ==
  3910   "real_inv ==
  3999 %x::hollight.real.
  3911 %x::hollight.real.
  4000    mk_real
  3912    mk_real
  4001     (%u::hreal * hreal.
  3913     (%u::hreal * hreal.
  4002         EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa)"
  3914         EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa)"
  4006     mk_real
  3918     mk_real
  4007      (%u::hreal * hreal.
  3919      (%u::hreal * hreal.
  4008          EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa))"
  3920          EX xa::hreal * hreal. treal_eq (treal_inv xa) u & dest_real x xa))"
  4009   by (import hollight DEF_real_inv)
  3921   by (import hollight DEF_real_inv)
  4010 
  3922 
  4011 constdefs
  3923 definition real_sub :: "hollight.real => hollight.real => hollight.real" where 
  4012   real_sub :: "hollight.real => hollight.real => hollight.real" 
       
  4013   "real_sub == %(u::hollight.real) ua::hollight.real. real_add u (real_neg ua)"
  3924   "real_sub == %(u::hollight.real) ua::hollight.real. real_add u (real_neg ua)"
  4014 
  3925 
  4015 lemma DEF_real_sub: "real_sub = (%(u::hollight.real) ua::hollight.real. real_add u (real_neg ua))"
  3926 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)
  3927   by (import hollight DEF_real_sub)
  4017 
  3928 
  4018 constdefs
  3929 definition real_lt :: "hollight.real => hollight.real => bool" where 
  4019   real_lt :: "hollight.real => hollight.real => bool" 
       
  4020   "real_lt == %(u::hollight.real) ua::hollight.real. ~ real_le ua u"
  3930   "real_lt == %(u::hollight.real) ua::hollight.real. ~ real_le ua u"
  4021 
  3931 
  4022 lemma DEF_real_lt: "real_lt = (%(u::hollight.real) ua::hollight.real. ~ real_le ua u)"
  3932 lemma DEF_real_lt: "real_lt = (%(u::hollight.real) ua::hollight.real. ~ real_le ua u)"
  4023   by (import hollight DEF_real_lt)
  3933   by (import hollight DEF_real_lt)
  4024 
  3934 
  4038   real_gt_def: "hollight.real_gt == %(u::hollight.real) ua::hollight.real. real_lt ua u"
  3948   real_gt_def: "hollight.real_gt == %(u::hollight.real) ua::hollight.real. real_lt ua u"
  4039 
  3949 
  4040 lemma DEF_real_gt: "hollight.real_gt = (%(u::hollight.real) ua::hollight.real. real_lt ua u)"
  3950 lemma DEF_real_gt: "hollight.real_gt = (%(u::hollight.real) ua::hollight.real. real_lt ua u)"
  4041   by (import hollight DEF_real_gt)
  3951   by (import hollight DEF_real_gt)
  4042 
  3952 
  4043 constdefs
  3953 definition real_abs :: "hollight.real => hollight.real" where 
  4044   real_abs :: "hollight.real => hollight.real" 
       
  4045   "real_abs ==
  3954   "real_abs ==
  4046 %u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u)"
  3955 %u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u)"
  4047 
  3956 
  4048 lemma DEF_real_abs: "real_abs =
  3957 lemma DEF_real_abs: "real_abs =
  4049 (%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u))"
  3958 (%u::hollight.real. COND (real_le (real_of_num 0) u) u (real_neg u))"
  4050   by (import hollight DEF_real_abs)
  3959   by (import hollight DEF_real_abs)
  4051 
  3960 
  4052 constdefs
  3961 definition real_pow :: "hollight.real => nat => hollight.real" where 
  4053   real_pow :: "hollight.real => nat => hollight.real" 
       
  4054   "real_pow ==
  3962   "real_pow ==
  4055 SOME real_pow::hollight.real => nat => hollight.real.
  3963 SOME real_pow::hollight.real => nat => hollight.real.
  4056    (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  3964    (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  4057    (ALL (x::hollight.real) n::nat.
  3965    (ALL (x::hollight.real) n::nat.
  4058        real_pow x (Suc n) = real_mul x (real_pow x n))"
  3966        real_pow x (Suc n) = real_mul x (real_pow x n))"
  4062     (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  3970     (ALL x::hollight.real. real_pow x 0 = real_of_num (NUMERAL_BIT1 0)) &
  4063     (ALL (x::hollight.real) n::nat.
  3971     (ALL (x::hollight.real) n::nat.
  4064         real_pow x (Suc n) = real_mul x (real_pow x n)))"
  3972         real_pow x (Suc n) = real_mul x (real_pow x n)))"
  4065   by (import hollight DEF_real_pow)
  3973   by (import hollight DEF_real_pow)
  4066 
  3974 
  4067 constdefs
  3975 definition real_div :: "hollight.real => hollight.real => hollight.real" where 
  4068   real_div :: "hollight.real => hollight.real => hollight.real" 
       
  4069   "real_div == %(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua)"
  3976   "real_div == %(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua)"
  4070 
  3977 
  4071 lemma DEF_real_div: "real_div = (%(u::hollight.real) ua::hollight.real. real_mul u (real_inv ua))"
  3978 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)
  3979   by (import hollight DEF_real_div)
  4073 
  3980 
  4074 constdefs
  3981 definition real_max :: "hollight.real => hollight.real => hollight.real" where 
  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"
  3982   "real_max == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u"
  4077 
  3983 
  4078 lemma DEF_real_max: "real_max = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) ua u)"
  3984 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)
  3985   by (import hollight DEF_real_max)
  4080 
  3986 
  4081 constdefs
  3987 definition real_min :: "hollight.real => hollight.real => hollight.real" where 
  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"
  3988   "real_min == %(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua"
  4084 
  3989 
  4085 lemma DEF_real_min: "real_min = (%(u::hollight.real) ua::hollight.real. COND (real_le u ua) u ua)"
  3990 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)
  3991   by (import hollight DEF_real_min)
  4087 
  3992 
  5210 (ALL (x::hollight.real) y::hollight.real. P x y = P y x) &
  5115 (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) -->
  5116 (ALL (x::hollight.real) y::hollight.real. real_lt x y --> P x y) -->
  5212 (ALL x::hollight.real. All (P x))"
  5117 (ALL x::hollight.real. All (P x))"
  5213   by (import hollight REAL_WLOG_LT)
  5118   by (import hollight REAL_WLOG_LT)
  5214 
  5119 
  5215 constdefs
  5120 definition mod_real :: "hollight.real => hollight.real => hollight.real => bool" where 
  5216   mod_real :: "hollight.real => hollight.real => hollight.real => bool" 
       
  5217   "mod_real ==
  5121   "mod_real ==
  5218 %(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5122 %(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5219    EX q::hollight.real. real_sub ua ub = real_mul q u"
  5123    EX q::hollight.real. real_sub ua ub = real_mul q u"
  5220 
  5124 
  5221 lemma DEF_mod_real: "mod_real =
  5125 lemma DEF_mod_real: "mod_real =
  5222 (%(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5126 (%(u::hollight.real) (ua::hollight.real) ub::hollight.real.
  5223     EX q::hollight.real. real_sub ua ub = real_mul q u)"
  5127     EX q::hollight.real. real_sub ua ub = real_mul q u)"
  5224   by (import hollight DEF_mod_real)
  5128   by (import hollight DEF_mod_real)
  5225 
  5129 
  5226 constdefs
  5130 definition DECIMAL :: "nat => nat => hollight.real" where 
  5227   DECIMAL :: "nat => nat => hollight.real" 
       
  5228   "DECIMAL == %(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua)"
  5131   "DECIMAL == %(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua)"
  5229 
  5132 
  5230 lemma DEF_DECIMAL: "DECIMAL = (%(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua))"
  5133 lemma DEF_DECIMAL: "DECIMAL = (%(u::nat) ua::nat. real_div (real_of_num u) (real_of_num ua))"
  5231   by (import hollight DEF_DECIMAL)
  5134   by (import hollight DEF_DECIMAL)
  5232 
  5135 
  5265 real_lt (real_of_num 0) (y2::hollight.real) -->
  5168 real_lt (real_of_num 0) (y2::hollight.real) -->
  5266 (real_div (x1::hollight.real) y1 = real_div (x2::hollight.real) y2) =
  5169 (real_div (x1::hollight.real) y1 = real_div (x2::hollight.real) y2) =
  5267 (real_mul x1 y2 = real_mul x2 y1)"
  5170 (real_mul x1 y2 = real_mul x2 y1)"
  5268   by (import hollight RAT_LEMMA5)
  5171   by (import hollight RAT_LEMMA5)
  5269 
  5172 
  5270 constdefs
  5173 definition is_int :: "hollight.real => bool" where 
  5271   is_int :: "hollight.real => bool" 
       
  5272   "is_int ==
  5174   "is_int ==
  5273 %u::hollight.real.
  5175 %u::hollight.real.
  5274    EX n::nat. u = real_of_num n | u = real_neg (real_of_num n)"
  5176    EX n::nat. u = real_of_num n | u = real_neg (real_of_num n)"
  5275 
  5177 
  5276 lemma DEF_is_int: "is_int =
  5178 lemma DEF_is_int: "is_int =
  5295 lemma dest_int_rep: "ALL x::hollight.int.
  5197 lemma dest_int_rep: "ALL x::hollight.int.
  5296    EX n::nat.
  5198    EX n::nat.
  5297       dest_int x = real_of_num n | dest_int x = real_neg (real_of_num n)"
  5199       dest_int x = real_of_num n | dest_int x = real_neg (real_of_num n)"
  5298   by (import hollight dest_int_rep)
  5200   by (import hollight dest_int_rep)
  5299 
  5201 
  5300 constdefs
  5202 definition int_le :: "hollight.int => hollight.int => bool" where 
  5301   int_le :: "hollight.int => hollight.int => bool" 
       
  5302   "int_le ==
  5203   "int_le ==
  5303 %(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua)"
  5204 %(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua)"
  5304 
  5205 
  5305 lemma DEF_int_le: "int_le =
  5206 lemma DEF_int_le: "int_le =
  5306 (%(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua))"
  5207 (%(u::hollight.int) ua::hollight.int. real_le (dest_int u) (dest_int ua))"
  5307   by (import hollight DEF_int_le)
  5208   by (import hollight DEF_int_le)
  5308 
  5209 
  5309 constdefs
  5210 definition int_lt :: "hollight.int => hollight.int => bool" where 
  5310   int_lt :: "hollight.int => hollight.int => bool" 
       
  5311   "int_lt ==
  5211   "int_lt ==
  5312 %(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua)"
  5212 %(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua)"
  5313 
  5213 
  5314 lemma DEF_int_lt: "int_lt =
  5214 lemma DEF_int_lt: "int_lt =
  5315 (%(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua))"
  5215 (%(u::hollight.int) ua::hollight.int. real_lt (dest_int u) (dest_int ua))"
  5316   by (import hollight DEF_int_lt)
  5216   by (import hollight DEF_int_lt)
  5317 
  5217 
  5318 constdefs
  5218 definition int_ge :: "hollight.int => hollight.int => bool" where 
  5319   int_ge :: "hollight.int => hollight.int => bool" 
       
  5320   "int_ge ==
  5219   "int_ge ==
  5321 %(u::hollight.int) ua::hollight.int.
  5220 %(u::hollight.int) ua::hollight.int.
  5322    hollight.real_ge (dest_int u) (dest_int ua)"
  5221    hollight.real_ge (dest_int u) (dest_int ua)"
  5323 
  5222 
  5324 lemma DEF_int_ge: "int_ge =
  5223 lemma DEF_int_ge: "int_ge =
  5325 (%(u::hollight.int) ua::hollight.int.
  5224 (%(u::hollight.int) ua::hollight.int.
  5326     hollight.real_ge (dest_int u) (dest_int ua))"
  5225     hollight.real_ge (dest_int u) (dest_int ua))"
  5327   by (import hollight DEF_int_ge)
  5226   by (import hollight DEF_int_ge)
  5328 
  5227 
  5329 constdefs
  5228 definition int_gt :: "hollight.int => hollight.int => bool" where 
  5330   int_gt :: "hollight.int => hollight.int => bool" 
       
  5331   "int_gt ==
  5229   "int_gt ==
  5332 %(u::hollight.int) ua::hollight.int.
  5230 %(u::hollight.int) ua::hollight.int.
  5333    hollight.real_gt (dest_int u) (dest_int ua)"
  5231    hollight.real_gt (dest_int u) (dest_int ua)"
  5334 
  5232 
  5335 lemma DEF_int_gt: "int_gt =
  5233 lemma DEF_int_gt: "int_gt =
  5336 (%(u::hollight.int) ua::hollight.int.
  5234 (%(u::hollight.int) ua::hollight.int.
  5337     hollight.real_gt (dest_int u) (dest_int ua))"
  5235     hollight.real_gt (dest_int u) (dest_int ua))"
  5338   by (import hollight DEF_int_gt)
  5236   by (import hollight DEF_int_gt)
  5339 
  5237 
  5340 constdefs
  5238 definition int_of_num :: "nat => hollight.int" where 
  5341   int_of_num :: "nat => hollight.int" 
       
  5342   "int_of_num == %u::nat. mk_int (real_of_num u)"
  5239   "int_of_num == %u::nat. mk_int (real_of_num u)"
  5343 
  5240 
  5344 lemma DEF_int_of_num: "int_of_num = (%u::nat. mk_int (real_of_num u))"
  5241 lemma DEF_int_of_num: "int_of_num = (%u::nat. mk_int (real_of_num u))"
  5345   by (import hollight DEF_int_of_num)
  5242   by (import hollight DEF_int_of_num)
  5346 
  5243 
  5347 lemma int_of_num_th: "ALL x::nat. dest_int (int_of_num x) = real_of_num x"
  5244 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)
  5245   by (import hollight int_of_num_th)
  5349 
  5246 
  5350 constdefs
  5247 definition int_neg :: "hollight.int => hollight.int" where 
  5351   int_neg :: "hollight.int => hollight.int" 
       
  5352   "int_neg == %u::hollight.int. mk_int (real_neg (dest_int u))"
  5248   "int_neg == %u::hollight.int. mk_int (real_neg (dest_int u))"
  5353 
  5249 
  5354 lemma DEF_int_neg: "int_neg = (%u::hollight.int. mk_int (real_neg (dest_int u)))"
  5250 lemma DEF_int_neg: "int_neg = (%u::hollight.int. mk_int (real_neg (dest_int u)))"
  5355   by (import hollight DEF_int_neg)
  5251   by (import hollight DEF_int_neg)
  5356 
  5252 
  5357 lemma int_neg_th: "ALL x::hollight.int. dest_int (int_neg x) = real_neg (dest_int x)"
  5253 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)
  5254   by (import hollight int_neg_th)
  5359 
  5255 
  5360 constdefs
  5256 definition int_add :: "hollight.int => hollight.int => hollight.int" where 
  5361   int_add :: "hollight.int => hollight.int => hollight.int" 
       
  5362   "int_add ==
  5257   "int_add ==
  5363 %(u::hollight.int) ua::hollight.int.
  5258 %(u::hollight.int) ua::hollight.int.
  5364    mk_int (real_add (dest_int u) (dest_int ua))"
  5259    mk_int (real_add (dest_int u) (dest_int ua))"
  5365 
  5260 
  5366 lemma DEF_int_add: "int_add =
  5261 lemma DEF_int_add: "int_add =
  5370 
  5265 
  5371 lemma int_add_th: "ALL (x::hollight.int) xa::hollight.int.
  5266 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)"
  5267    dest_int (int_add x xa) = real_add (dest_int x) (dest_int xa)"
  5373   by (import hollight int_add_th)
  5268   by (import hollight int_add_th)
  5374 
  5269 
  5375 constdefs
  5270 definition int_sub :: "hollight.int => hollight.int => hollight.int" where 
  5376   int_sub :: "hollight.int => hollight.int => hollight.int" 
       
  5377   "int_sub ==
  5271   "int_sub ==
  5378 %(u::hollight.int) ua::hollight.int.
  5272 %(u::hollight.int) ua::hollight.int.
  5379    mk_int (real_sub (dest_int u) (dest_int ua))"
  5273    mk_int (real_sub (dest_int u) (dest_int ua))"
  5380 
  5274 
  5381 lemma DEF_int_sub: "int_sub =
  5275 lemma DEF_int_sub: "int_sub =
  5385 
  5279 
  5386 lemma int_sub_th: "ALL (x::hollight.int) xa::hollight.int.
  5280 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)"
  5281    dest_int (int_sub x xa) = real_sub (dest_int x) (dest_int xa)"
  5388   by (import hollight int_sub_th)
  5282   by (import hollight int_sub_th)
  5389 
  5283 
  5390 constdefs
  5284 definition int_mul :: "hollight.int => hollight.int => hollight.int" where 
  5391   int_mul :: "hollight.int => hollight.int => hollight.int" 
       
  5392   "int_mul ==
  5285   "int_mul ==
  5393 %(u::hollight.int) ua::hollight.int.
  5286 %(u::hollight.int) ua::hollight.int.
  5394    mk_int (real_mul (dest_int u) (dest_int ua))"
  5287    mk_int (real_mul (dest_int u) (dest_int ua))"
  5395 
  5288 
  5396 lemma DEF_int_mul: "int_mul =
  5289 lemma DEF_int_mul: "int_mul =
  5400 
  5293 
  5401 lemma int_mul_th: "ALL (x::hollight.int) y::hollight.int.
  5294 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)"
  5295    dest_int (int_mul x y) = real_mul (dest_int x) (dest_int y)"
  5403   by (import hollight int_mul_th)
  5296   by (import hollight int_mul_th)
  5404 
  5297 
  5405 constdefs
  5298 definition int_abs :: "hollight.int => hollight.int" where 
  5406   int_abs :: "hollight.int => hollight.int" 
       
  5407   "int_abs == %u::hollight.int. mk_int (real_abs (dest_int u))"
  5299   "int_abs == %u::hollight.int. mk_int (real_abs (dest_int u))"
  5408 
  5300 
  5409 lemma DEF_int_abs: "int_abs = (%u::hollight.int. mk_int (real_abs (dest_int u)))"
  5301 lemma DEF_int_abs: "int_abs = (%u::hollight.int. mk_int (real_abs (dest_int u)))"
  5410   by (import hollight DEF_int_abs)
  5302   by (import hollight DEF_int_abs)
  5411 
  5303 
  5412 lemma int_abs_th: "ALL x::hollight.int. dest_int (int_abs x) = real_abs (dest_int x)"
  5304 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)
  5305   by (import hollight int_abs_th)
  5414 
  5306 
  5415 constdefs
  5307 definition int_max :: "hollight.int => hollight.int => hollight.int" where 
  5416   int_max :: "hollight.int => hollight.int => hollight.int" 
       
  5417   "int_max ==
  5308   "int_max ==
  5418 %(u::hollight.int) ua::hollight.int.
  5309 %(u::hollight.int) ua::hollight.int.
  5419    mk_int (real_max (dest_int u) (dest_int ua))"
  5310    mk_int (real_max (dest_int u) (dest_int ua))"
  5420 
  5311 
  5421 lemma DEF_int_max: "int_max =
  5312 lemma DEF_int_max: "int_max =
  5425 
  5316 
  5426 lemma int_max_th: "ALL (x::hollight.int) y::hollight.int.
  5317 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)"
  5318    dest_int (int_max x y) = real_max (dest_int x) (dest_int y)"
  5428   by (import hollight int_max_th)
  5319   by (import hollight int_max_th)
  5429 
  5320 
  5430 constdefs
  5321 definition int_min :: "hollight.int => hollight.int => hollight.int" where 
  5431   int_min :: "hollight.int => hollight.int => hollight.int" 
       
  5432   "int_min ==
  5322   "int_min ==
  5433 %(u::hollight.int) ua::hollight.int.
  5323 %(u::hollight.int) ua::hollight.int.
  5434    mk_int (real_min (dest_int u) (dest_int ua))"
  5324    mk_int (real_min (dest_int u) (dest_int ua))"
  5435 
  5325 
  5436 lemma DEF_int_min: "int_min =
  5326 lemma DEF_int_min: "int_min =
  5440 
  5330 
  5441 lemma int_min_th: "ALL (x::hollight.int) y::hollight.int.
  5331 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)"
  5332    dest_int (int_min x y) = real_min (dest_int x) (dest_int y)"
  5443   by (import hollight int_min_th)
  5333   by (import hollight int_min_th)
  5444 
  5334 
  5445 constdefs
  5335 definition int_pow :: "hollight.int => nat => hollight.int" where 
  5446   int_pow :: "hollight.int => nat => hollight.int" 
       
  5447   "int_pow == %(u::hollight.int) ua::nat. mk_int (real_pow (dest_int u) ua)"
  5336   "int_pow == %(u::hollight.int) ua::nat. mk_int (real_pow (dest_int u) ua)"
  5448 
  5337 
  5449 lemma DEF_int_pow: "int_pow = (%(u::hollight.int) ua::nat. mk_int (real_pow (dest_int u) ua))"
  5338 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)
  5339   by (import hollight DEF_int_pow)
  5451 
  5340 
  5494 
  5383 
  5495 lemma INT_ARCH: "ALL (x::hollight.int) d::hollight.int.
  5384 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))"
  5385    d ~= int_of_num 0 --> (EX c::hollight.int. int_lt x (int_mul c d))"
  5497   by (import hollight INT_ARCH)
  5386   by (import hollight INT_ARCH)
  5498 
  5387 
  5499 constdefs
  5388 definition mod_int :: "hollight.int => hollight.int => hollight.int => bool" where 
  5500   mod_int :: "hollight.int => hollight.int => hollight.int => bool" 
       
  5501   "mod_int ==
  5389   "mod_int ==
  5502 %(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5390 %(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5503    EX q::hollight.int. int_sub ua ub = int_mul q u"
  5391    EX q::hollight.int. int_sub ua ub = int_mul q u"
  5504 
  5392 
  5505 lemma DEF_mod_int: "mod_int =
  5393 lemma DEF_mod_int: "mod_int =
  5506 (%(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5394 (%(u::hollight.int) (ua::hollight.int) ub::hollight.int.
  5507     EX q::hollight.int. int_sub ua ub = int_mul q u)"
  5395     EX q::hollight.int. int_sub ua ub = int_mul q u)"
  5508   by (import hollight DEF_mod_int)
  5396   by (import hollight DEF_mod_int)
  5509 
  5397 
  5510 constdefs
  5398 definition IN :: "'A => ('A => bool) => bool" where 
  5511   IN :: "'A => ('A => bool) => bool" 
       
  5512   "IN == %(u::'A::type) ua::'A::type => bool. ua u"
  5399   "IN == %(u::'A::type) ua::'A::type => bool. ua u"
  5513 
  5400 
  5514 lemma DEF_IN: "IN = (%(u::'A::type) ua::'A::type => bool. ua u)"
  5401 lemma DEF_IN: "IN = (%(u::'A::type) ua::'A::type => bool. ua u)"
  5515   by (import hollight DEF_IN)
  5402   by (import hollight DEF_IN)
  5516 
  5403 
  5517 lemma EXTENSION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5404 lemma EXTENSION: "ALL (x::'A::type => bool) xa::'A::type => bool.
  5518    (x = xa) = (ALL xb::'A::type. IN xb x = IN xb xa)"
  5405    (x = xa) = (ALL xb::'A::type. IN xb x = IN xb xa)"
  5519   by (import hollight EXTENSION)
  5406   by (import hollight EXTENSION)
  5520 
  5407 
  5521 constdefs
  5408 definition GSPEC :: "('A => bool) => 'A => bool" where 
  5522   GSPEC :: "('A => bool) => 'A => bool" 
       
  5523   "GSPEC == %u::'A::type => bool. u"
  5409   "GSPEC == %u::'A::type => bool. u"
  5524 
  5410 
  5525 lemma DEF_GSPEC: "GSPEC = (%u::'A::type => bool. u)"
  5411 lemma DEF_GSPEC: "GSPEC = (%u::'A::type => bool. u)"
  5526   by (import hollight DEF_GSPEC)
  5412   by (import hollight DEF_GSPEC)
  5527 
  5413 
  5528 constdefs
  5414 definition SETSPEC :: "'q_37056 => bool => 'q_37056 => bool" where 
  5529   SETSPEC :: "'q_37056 => bool => 'q_37056 => bool" 
       
  5530   "SETSPEC == %(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub"
  5415   "SETSPEC == %(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub"
  5531 
  5416 
  5532 lemma DEF_SETSPEC: "SETSPEC = (%(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub)"
  5417 lemma DEF_SETSPEC: "SETSPEC = (%(u::'q_37056::type) (ua::bool) ub::'q_37056::type. ua & u = ub)"
  5533   by (import hollight DEF_SETSPEC)
  5418   by (import hollight DEF_SETSPEC)
  5534 
  5419 
  5546     GSPEC (%v::'q_37177::type. EX y::'q_37177::type. SETSPEC v (p y) y) x =
  5431     GSPEC (%v::'q_37177::type. EX y::'q_37177::type. SETSPEC v (p y) y) x =
  5547     p x) &
  5432     p x) &
  5548 (ALL (p::'q_37194::type => bool) x::'q_37194::type. IN x p = p x)"
  5433 (ALL (p::'q_37194::type => bool) x::'q_37194::type. IN x p = p x)"
  5549   by (import hollight IN_ELIM_THM)
  5434   by (import hollight IN_ELIM_THM)
  5550 
  5435 
  5551 constdefs
  5436 definition EMPTY :: "'A => bool" where 
  5552   EMPTY :: "'A => bool" 
       
  5553   "EMPTY == %x::'A::type. False"
  5437   "EMPTY == %x::'A::type. False"
  5554 
  5438 
  5555 lemma DEF_EMPTY: "EMPTY = (%x::'A::type. False)"
  5439 lemma DEF_EMPTY: "EMPTY = (%x::'A::type. False)"
  5556   by (import hollight DEF_EMPTY)
  5440   by (import hollight DEF_EMPTY)
  5557 
  5441 
  5558 constdefs
  5442 definition INSERT :: "'A => ('A => bool) => 'A => bool" where 
  5559   INSERT :: "'A => ('A => bool) => 'A => bool" 
       
  5560   "INSERT == %(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u"
  5443   "INSERT == %(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u"
  5561 
  5444 
  5562 lemma DEF_INSERT: "INSERT =
  5445 lemma DEF_INSERT: "INSERT =
  5563 (%(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u)"
  5446 (%(u::'A::type) (ua::'A::type => bool) y::'A::type. IN y ua | y = u)"
  5564   by (import hollight DEF_INSERT)
  5447   by (import hollight DEF_INSERT)
  5583 lemma DEF_UNION: "hollight.UNION =
  5466 lemma DEF_UNION: "hollight.UNION =
  5584 (%(u::'A::type => bool) ua::'A::type => bool.
  5467 (%(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))"
  5468     GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u | IN x ua) x))"
  5586   by (import hollight DEF_UNION)
  5469   by (import hollight DEF_UNION)
  5587 
  5470 
  5588 constdefs
  5471 definition UNIONS :: "(('A => bool) => bool) => 'A => bool" where 
  5589   UNIONS :: "(('A => bool) => bool) => 'A => bool" 
       
  5590   "UNIONS ==
  5472   "UNIONS ==
  5591 %u::('A::type => bool) => bool.
  5473 %u::('A::type => bool) => bool.
  5592    GSPEC
  5474    GSPEC
  5593     (%ua::'A::type.
  5475     (%ua::'A::type.
  5594         EX x::'A::type.
  5476         EX x::'A::type.
  5613 lemma DEF_INTER: "hollight.INTER =
  5495 lemma DEF_INTER: "hollight.INTER =
  5614 (%(u::'A::type => bool) ua::'A::type => bool.
  5496 (%(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))"
  5497     GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & IN x ua) x))"
  5616   by (import hollight DEF_INTER)
  5498   by (import hollight DEF_INTER)
  5617 
  5499 
  5618 constdefs
  5500 definition INTERS :: "(('A => bool) => bool) => 'A => bool" where 
  5619   INTERS :: "(('A => bool) => bool) => 'A => bool" 
       
  5620   "INTERS ==
  5501   "INTERS ==
  5621 %u::('A::type => bool) => bool.
  5502 %u::('A::type => bool) => bool.
  5622    GSPEC
  5503    GSPEC
  5623     (%ua::'A::type.
  5504     (%ua::'A::type.
  5624         EX x::'A::type.
  5505         EX x::'A::type.
  5630      (%ua::'A::type.
  5511      (%ua::'A::type.
  5631          EX x::'A::type.
  5512          EX x::'A::type.
  5632             SETSPEC ua (ALL ua::'A::type => bool. IN ua u --> IN x ua) x))"
  5513             SETSPEC ua (ALL ua::'A::type => bool. IN ua u --> IN x ua) x))"
  5633   by (import hollight DEF_INTERS)
  5514   by (import hollight DEF_INTERS)
  5634 
  5515 
  5635 constdefs
  5516 definition DIFF :: "('A => bool) => ('A => bool) => 'A => bool" where 
  5636   DIFF :: "('A => bool) => ('A => bool) => 'A => bool" 
       
  5637   "DIFF ==
  5517   "DIFF ==
  5638 %(u::'A::type => bool) ua::'A::type => bool.
  5518 %(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)"
  5519    GSPEC (%ub::'A::type. EX x::'A::type. SETSPEC ub (IN x u & ~ IN x ua) x)"
  5640 
  5520 
  5641 lemma DEF_DIFF: "DIFF =
  5521 lemma DEF_DIFF: "DIFF =
  5646 
  5526 
  5647 lemma INSERT: "INSERT (x::'A::type) (s::'A::type => bool) =
  5527 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)"
  5528 GSPEC (%u::'A::type. EX y::'A::type. SETSPEC u (IN y s | y = x) y)"
  5649   by (import hollight INSERT)
  5529   by (import hollight INSERT)
  5650 
  5530 
  5651 constdefs
  5531 definition DELETE :: "('A => bool) => 'A => 'A => bool" where 
  5652   DELETE :: "('A => bool) => 'A => 'A => bool" 
       
  5653   "DELETE ==
  5532   "DELETE ==
  5654 %(u::'A::type => bool) ua::'A::type.
  5533 %(u::'A::type => bool) ua::'A::type.
  5655    GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y)"
  5534    GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y)"
  5656 
  5535 
  5657 lemma DEF_DELETE: "DELETE =
  5536 lemma DEF_DELETE: "DELETE =
  5658 (%(u::'A::type => bool) ua::'A::type.
  5537 (%(u::'A::type => bool) ua::'A::type.
  5659     GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y))"
  5538     GSPEC (%ub::'A::type. EX y::'A::type. SETSPEC ub (IN y u & y ~= ua) y))"
  5660   by (import hollight DEF_DELETE)
  5539   by (import hollight DEF_DELETE)
  5661 
  5540 
  5662 constdefs
  5541 definition SUBSET :: "('A => bool) => ('A => bool) => bool" where 
  5663   SUBSET :: "('A => bool) => ('A => bool) => bool" 
       
  5664   "SUBSET ==
  5542   "SUBSET ==
  5665 %(u::'A::type => bool) ua::'A::type => bool.
  5543 %(u::'A::type => bool) ua::'A::type => bool.
  5666    ALL x::'A::type. IN x u --> IN x ua"
  5544    ALL x::'A::type. IN x u --> IN x ua"
  5667 
  5545 
  5668 lemma DEF_SUBSET: "SUBSET =
  5546 lemma DEF_SUBSET: "SUBSET =
  5669 (%(u::'A::type => bool) ua::'A::type => bool.
  5547 (%(u::'A::type => bool) ua::'A::type => bool.
  5670     ALL x::'A::type. IN x u --> IN x ua)"
  5548     ALL x::'A::type. IN x u --> IN x ua)"
  5671   by (import hollight DEF_SUBSET)
  5549   by (import hollight DEF_SUBSET)
  5672 
  5550 
  5673 constdefs
  5551 definition PSUBSET :: "('A => bool) => ('A => bool) => bool" where 
  5674   PSUBSET :: "('A => bool) => ('A => bool) => bool" 
       
  5675   "PSUBSET ==
  5552   "PSUBSET ==
  5676 %(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua"
  5553 %(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua"
  5677 
  5554 
  5678 lemma DEF_PSUBSET: "PSUBSET =
  5555 lemma DEF_PSUBSET: "PSUBSET =
  5679 (%(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua)"
  5556 (%(u::'A::type => bool) ua::'A::type => bool. SUBSET u ua & u ~= ua)"
  5680   by (import hollight DEF_PSUBSET)
  5557   by (import hollight DEF_PSUBSET)
  5681 
  5558 
  5682 constdefs
  5559 definition DISJOINT :: "('A => bool) => ('A => bool) => bool" where 
  5683   DISJOINT :: "('A => bool) => ('A => bool) => bool" 
       
  5684   "DISJOINT ==
  5560   "DISJOINT ==
  5685 %(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY"
  5561 %(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY"
  5686 
  5562 
  5687 lemma DEF_DISJOINT: "DISJOINT =
  5563 lemma DEF_DISJOINT: "DISJOINT =
  5688 (%(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY)"
  5564 (%(u::'A::type => bool) ua::'A::type => bool. hollight.INTER u ua = EMPTY)"
  5689   by (import hollight DEF_DISJOINT)
  5565   by (import hollight DEF_DISJOINT)
  5690 
  5566 
  5691 constdefs
  5567 definition SING :: "('A => bool) => bool" where 
  5692   SING :: "('A => bool) => bool" 
       
  5693   "SING == %u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY"
  5568   "SING == %u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY"
  5694 
  5569 
  5695 lemma DEF_SING: "SING = (%u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY)"
  5570 lemma DEF_SING: "SING = (%u::'A::type => bool. EX x::'A::type. u = INSERT x EMPTY)"
  5696   by (import hollight DEF_SING)
  5571   by (import hollight DEF_SING)
  5697 
  5572 
  5698 constdefs
  5573 definition FINITE :: "('A => bool) => bool" where 
  5699   FINITE :: "('A => bool) => bool" 
       
  5700   "FINITE ==
  5574   "FINITE ==
  5701 %a::'A::type => bool.
  5575 %a::'A::type => bool.
  5702    ALL FINITE'::('A::type => bool) => bool.
  5576    ALL FINITE'::('A::type => bool) => bool.
  5703       (ALL a::'A::type => bool.
  5577       (ALL a::'A::type => bool.
  5704           a = EMPTY |
  5578           a = EMPTY |
  5716                a = INSERT x s & FINITE' s) -->
  5590                a = INSERT x s & FINITE' s) -->
  5717            FINITE' a) -->
  5591            FINITE' a) -->
  5718        FINITE' a)"
  5592        FINITE' a)"
  5719   by (import hollight DEF_FINITE)
  5593   by (import hollight DEF_FINITE)
  5720 
  5594 
  5721 constdefs
  5595 definition INFINITE :: "('A => bool) => bool" where 
  5722   INFINITE :: "('A => bool) => bool" 
       
  5723   "INFINITE == %u::'A::type => bool. ~ FINITE u"
  5596   "INFINITE == %u::'A::type => bool. ~ FINITE u"
  5724 
  5597 
  5725 lemma DEF_INFINITE: "INFINITE = (%u::'A::type => bool. ~ FINITE u)"
  5598 lemma DEF_INFINITE: "INFINITE = (%u::'A::type => bool. ~ FINITE u)"
  5726   by (import hollight DEF_INFINITE)
  5599   by (import hollight DEF_INFINITE)
  5727 
  5600 
  5728 constdefs
  5601 definition IMAGE :: "('A => 'B) => ('A => bool) => 'B => bool" where 
  5729   IMAGE :: "('A => 'B) => ('A => bool) => 'B => bool" 
       
  5730   "IMAGE ==
  5602   "IMAGE ==
  5731 %(u::'A::type => 'B::type) ua::'A::type => bool.
  5603 %(u::'A::type => 'B::type) ua::'A::type => bool.
  5732    GSPEC
  5604    GSPEC
  5733     (%ub::'B::type.
  5605     (%ub::'B::type.
  5734         EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y)"
  5606         EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y)"
  5738     GSPEC
  5610     GSPEC
  5739      (%ub::'B::type.
  5611      (%ub::'B::type.
  5740          EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y))"
  5612          EX y::'B::type. SETSPEC ub (EX x::'A::type. IN x ua & y = u x) y))"
  5741   by (import hollight DEF_IMAGE)
  5613   by (import hollight DEF_IMAGE)
  5742 
  5614 
  5743 constdefs
  5615 definition INJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" where 
  5744   INJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
       
  5745   "INJ ==
  5616   "INJ ==
  5746 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5617 %(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) &
  5618    (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)"
  5619    (ALL (x::'A::type) y::'A::type. IN x ua & IN y ua & u x = u y --> x = y)"
  5749 
  5620 
  5752     (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5623     (ALL x::'A::type. IN x ua --> IN (u x) ub) &
  5753     (ALL (x::'A::type) y::'A::type.
  5624     (ALL (x::'A::type) y::'A::type.
  5754         IN x ua & IN y ua & u x = u y --> x = y))"
  5625         IN x ua & IN y ua & u x = u y --> x = y))"
  5755   by (import hollight DEF_INJ)
  5626   by (import hollight DEF_INJ)
  5756 
  5627 
  5757 constdefs
  5628 definition SURJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" where 
  5758   SURJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
       
  5759   "SURJ ==
  5629   "SURJ ==
  5760 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5630 %(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) &
  5631    (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))"
  5632    (ALL x::'B::type. IN x ub --> (EX y::'A::type. IN y ua & u y = x))"
  5763 
  5633 
  5765 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5635 (%(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) &
  5636     (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)))"
  5637     (ALL x::'B::type. IN x ub --> (EX y::'A::type. IN y ua & u y = x)))"
  5768   by (import hollight DEF_SURJ)
  5638   by (import hollight DEF_SURJ)
  5769 
  5639 
  5770 constdefs
  5640 definition BIJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" where 
  5771   BIJ :: "('A => 'B) => ('A => bool) => ('B => bool) => bool" 
       
  5772   "BIJ ==
  5641   "BIJ ==
  5773 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5642 %(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5774    INJ u ua ub & SURJ u ua ub"
  5643    INJ u ua ub & SURJ u ua ub"
  5775 
  5644 
  5776 lemma DEF_BIJ: "BIJ =
  5645 lemma DEF_BIJ: "BIJ =
  5777 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5646 (%(u::'A::type => 'B::type) (ua::'A::type => bool) ub::'B::type => bool.
  5778     INJ u ua ub & SURJ u ua ub)"
  5647     INJ u ua ub & SURJ u ua ub)"
  5779   by (import hollight DEF_BIJ)
  5648   by (import hollight DEF_BIJ)
  5780 
  5649 
  5781 constdefs
  5650 definition CHOICE :: "('A => bool) => 'A" where 
  5782   CHOICE :: "('A => bool) => 'A" 
       
  5783   "CHOICE == %u::'A::type => bool. SOME x::'A::type. IN x u"
  5651   "CHOICE == %u::'A::type => bool. SOME x::'A::type. IN x u"
  5784 
  5652 
  5785 lemma DEF_CHOICE: "CHOICE = (%u::'A::type => bool. SOME x::'A::type. IN x u)"
  5653 lemma DEF_CHOICE: "CHOICE = (%u::'A::type => bool. SOME x::'A::type. IN x u)"
  5786   by (import hollight DEF_CHOICE)
  5654   by (import hollight DEF_CHOICE)
  5787 
  5655 
  5788 constdefs
  5656 definition REST :: "('A => bool) => 'A => bool" where 
  5789   REST :: "('A => bool) => 'A => bool" 
       
  5790   "REST == %u::'A::type => bool. DELETE u (CHOICE u)"
  5657   "REST == %u::'A::type => bool. DELETE u (CHOICE u)"
  5791 
  5658 
  5792 lemma DEF_REST: "REST = (%u::'A::type => bool. DELETE u (CHOICE u))"
  5659 lemma DEF_REST: "REST = (%u::'A::type => bool. DELETE u (CHOICE u))"
  5793   by (import hollight DEF_REST)
  5660   by (import hollight DEF_REST)
  5794 
  5661 
  5795 constdefs
  5662 definition CARD_GE :: "('q_37693 => bool) => ('q_37690 => bool) => bool" where 
  5796   CARD_GE :: "('q_37693 => bool) => ('q_37690 => bool) => bool" 
       
  5797   "CARD_GE ==
  5663   "CARD_GE ==
  5798 %(u::'q_37693::type => bool) ua::'q_37690::type => bool.
  5664 %(u::'q_37693::type => bool) ua::'q_37690::type => bool.
  5799    EX f::'q_37693::type => 'q_37690::type.
  5665    EX f::'q_37693::type => 'q_37690::type.
  5800       ALL y::'q_37690::type.
  5666       ALL y::'q_37690::type.
  5801          IN y ua --> (EX x::'q_37693::type. IN x u & y = f x)"
  5667          IN y ua --> (EX x::'q_37693::type. IN x u & y = f x)"
  5805     EX f::'q_37693::type => 'q_37690::type.
  5671     EX f::'q_37693::type => 'q_37690::type.
  5806        ALL y::'q_37690::type.
  5672        ALL y::'q_37690::type.
  5807           IN y ua --> (EX x::'q_37693::type. IN x u & y = f x))"
  5673           IN y ua --> (EX x::'q_37693::type. IN x u & y = f x))"
  5808   by (import hollight DEF_CARD_GE)
  5674   by (import hollight DEF_CARD_GE)
  5809 
  5675 
  5810 constdefs
  5676 definition CARD_LE :: "('q_37702 => bool) => ('q_37701 => bool) => bool" where 
  5811   CARD_LE :: "('q_37702 => bool) => ('q_37701 => bool) => bool" 
       
  5812   "CARD_LE ==
  5677   "CARD_LE ==
  5813 %(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u"
  5678 %(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u"
  5814 
  5679 
  5815 lemma DEF_CARD_LE: "CARD_LE =
  5680 lemma DEF_CARD_LE: "CARD_LE =
  5816 (%(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u)"
  5681 (%(u::'q_37702::type => bool) ua::'q_37701::type => bool. CARD_GE ua u)"
  5817   by (import hollight DEF_CARD_LE)
  5682   by (import hollight DEF_CARD_LE)
  5818 
  5683 
  5819 constdefs
  5684 definition CARD_EQ :: "('q_37712 => bool) => ('q_37713 => bool) => bool" where 
  5820   CARD_EQ :: "('q_37712 => bool) => ('q_37713 => bool) => bool" 
       
  5821   "CARD_EQ ==
  5685   "CARD_EQ ==
  5822 %(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5686 %(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5823    CARD_LE u ua & CARD_LE ua u"
  5687    CARD_LE u ua & CARD_LE ua u"
  5824 
  5688 
  5825 lemma DEF_CARD_EQ: "CARD_EQ =
  5689 lemma DEF_CARD_EQ: "CARD_EQ =
  5826 (%(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5690 (%(u::'q_37712::type => bool) ua::'q_37713::type => bool.
  5827     CARD_LE u ua & CARD_LE ua u)"
  5691     CARD_LE u ua & CARD_LE ua u)"
  5828   by (import hollight DEF_CARD_EQ)
  5692   by (import hollight DEF_CARD_EQ)
  5829 
  5693 
  5830 constdefs
  5694 definition CARD_GT :: "('q_37727 => bool) => ('q_37728 => bool) => bool" where 
  5831   CARD_GT :: "('q_37727 => bool) => ('q_37728 => bool) => bool" 
       
  5832   "CARD_GT ==
  5695   "CARD_GT ==
  5833 %(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5696 %(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5834    CARD_GE u ua & ~ CARD_GE ua u"
  5697    CARD_GE u ua & ~ CARD_GE ua u"
  5835 
  5698 
  5836 lemma DEF_CARD_GT: "CARD_GT =
  5699 lemma DEF_CARD_GT: "CARD_GT =
  5837 (%(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5700 (%(u::'q_37727::type => bool) ua::'q_37728::type => bool.
  5838     CARD_GE u ua & ~ CARD_GE ua u)"
  5701     CARD_GE u ua & ~ CARD_GE ua u)"
  5839   by (import hollight DEF_CARD_GT)
  5702   by (import hollight DEF_CARD_GT)
  5840 
  5703 
  5841 constdefs
  5704 definition CARD_LT :: "('q_37743 => bool) => ('q_37744 => bool) => bool" where 
  5842   CARD_LT :: "('q_37743 => bool) => ('q_37744 => bool) => bool" 
       
  5843   "CARD_LT ==
  5705   "CARD_LT ==
  5844 %(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5706 %(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5845    CARD_LE u ua & ~ CARD_LE ua u"
  5707    CARD_LE u ua & ~ CARD_LE ua u"
  5846 
  5708 
  5847 lemma DEF_CARD_LT: "CARD_LT =
  5709 lemma DEF_CARD_LT: "CARD_LT =
  5848 (%(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5710 (%(u::'q_37743::type => bool) ua::'q_37744::type => bool.
  5849     CARD_LE u ua & ~ CARD_LE ua u)"
  5711     CARD_LE u ua & ~ CARD_LE ua u)"
  5850   by (import hollight DEF_CARD_LT)
  5712   by (import hollight DEF_CARD_LT)
  5851 
  5713 
  5852 constdefs
  5714 definition COUNTABLE :: "('q_37757 => bool) => bool" where 
  5853   COUNTABLE :: "('q_37757 => bool) => bool" 
       
  5854   "(op ==::(('q_37757::type => bool) => bool)
  5715   "(op ==::(('q_37757::type => bool) => bool)
  5855         => (('q_37757::type => bool) => bool) => prop)
  5716         => (('q_37757::type => bool) => bool) => prop)
  5856  (COUNTABLE::('q_37757::type => bool) => bool)
  5717  (COUNTABLE::('q_37757::type => bool) => bool)
  5857  ((CARD_GE::(nat => bool) => ('q_37757::type => bool) => bool)
  5718  ((CARD_GE::(nat => bool) => ('q_37757::type => bool) => bool)
  5858    (hollight.UNIV::nat => bool))"
  5719    (hollight.UNIV::nat => bool))"
  6468 
  6329 
  6469 lemma FINITE_DIFF: "ALL (s::'q_41764::type => bool) t::'q_41764::type => bool.
  6330 lemma FINITE_DIFF: "ALL (s::'q_41764::type => bool) t::'q_41764::type => bool.
  6470    FINITE s --> FINITE (DIFF s t)"
  6331    FINITE s --> FINITE (DIFF s t)"
  6471   by (import hollight FINITE_DIFF)
  6332   by (import hollight FINITE_DIFF)
  6472 
  6333 
  6473 constdefs
  6334 definition FINREC :: "('q_41824 => 'q_41823 => 'q_41823)
  6474   FINREC :: "('q_41824 => 'q_41823 => 'q_41823)
  6335 => 'q_41823 => ('q_41824 => bool) => 'q_41823 => nat => bool" where 
  6475 => 'q_41823 => ('q_41824 => bool) => 'q_41823 => nat => bool" 
       
  6476   "FINREC ==
  6336   "FINREC ==
  6477 SOME FINREC::('q_41824::type => 'q_41823::type => 'q_41823::type)
  6337 SOME FINREC::('q_41824::type => 'q_41823::type => 'q_41823::type)
  6478              => 'q_41823::type
  6338              => 'q_41823::type
  6479                 => ('q_41824::type => bool)
  6339                 => ('q_41824::type => bool)
  6480                    => 'q_41823::type => nat => bool.
  6340                    => 'q_41823::type => nat => bool.
  6556        g EMPTY = b &
  6416        g EMPTY = b &
  6557        (ALL (x::'A::type) s::'A::type => bool.
  6417        (ALL (x::'A::type) s::'A::type => bool.
  6558            FINITE s --> g (INSERT x s) = COND (IN x s) (g s) (f x (g s))))"
  6418            FINITE s --> g (INSERT x s) = COND (IN x s) (g s) (f x (g s))))"
  6559   by (import hollight SET_RECURSION_LEMMA)
  6419   by (import hollight SET_RECURSION_LEMMA)
  6560 
  6420 
  6561 constdefs
  6421 definition ITSET :: "('q_42525 => 'q_42524 => 'q_42524)
  6562   ITSET :: "('q_42525 => 'q_42524 => 'q_42524)
  6422 => ('q_42525 => bool) => 'q_42524 => 'q_42524" where 
  6563 => ('q_42525 => bool) => 'q_42524 => 'q_42524" 
       
  6564   "ITSET ==
  6423   "ITSET ==
  6565 %(u::'q_42525::type => 'q_42524::type => 'q_42524::type)
  6424 %(u::'q_42525::type => 'q_42524::type => 'q_42524::type)
  6566    (ua::'q_42525::type => bool) ub::'q_42524::type.
  6425    (ua::'q_42525::type => bool) ub::'q_42524::type.
  6567    (SOME g::('q_42525::type => bool) => 'q_42524::type.
  6426    (SOME g::('q_42525::type => bool) => 'q_42524::type.
  6568        g EMPTY = ub &
  6427        g EMPTY = ub &
  6628     (GSPEC
  6487     (GSPEC
  6629       (%u::'A::type.
  6488       (%u::'A::type.
  6630           EX x::'A::type. SETSPEC u (IN x s & (P::'A::type => bool) x) x))"
  6489           EX x::'A::type. SETSPEC u (IN x s & (P::'A::type => bool) x) x))"
  6631   by (import hollight FINITE_RESTRICT)
  6490   by (import hollight FINITE_RESTRICT)
  6632 
  6491 
  6633 constdefs
  6492 definition CARD :: "('q_42918 => bool) => nat" where 
  6634   CARD :: "('q_42918 => bool) => nat" 
       
  6635   "CARD == %u::'q_42918::type => bool. ITSET (%x::'q_42918::type. Suc) u 0"
  6493   "CARD == %u::'q_42918::type => bool. ITSET (%x::'q_42918::type. Suc) u 0"
  6636 
  6494 
  6637 lemma DEF_CARD: "CARD = (%u::'q_42918::type => bool. ITSET (%x::'q_42918::type. Suc) u 0)"
  6495 lemma DEF_CARD: "CARD = (%u::'q_42918::type => bool. ITSET (%x::'q_42918::type. Suc) u 0)"
  6638   by (import hollight DEF_CARD)
  6496   by (import hollight DEF_CARD)
  6639 
  6497 
  6672    u::'q_43163::type => bool.
  6530    u::'q_43163::type => bool.
  6673    FINITE u & hollight.INTER s t = EMPTY & hollight.UNION s t = u -->
  6531    FINITE u & hollight.INTER s t = EMPTY & hollight.UNION s t = u -->
  6674    CARD s + CARD t = CARD u"
  6532    CARD s + CARD t = CARD u"
  6675   by (import hollight CARD_UNION_EQ)
  6533   by (import hollight CARD_UNION_EQ)
  6676 
  6534 
  6677 constdefs
  6535 definition HAS_SIZE :: "('q_43199 => bool) => nat => bool" where 
  6678   HAS_SIZE :: "('q_43199 => bool) => nat => bool" 
       
  6679   "HAS_SIZE == %(u::'q_43199::type => bool) ua::nat. FINITE u & CARD u = ua"
  6536   "HAS_SIZE == %(u::'q_43199::type => bool) ua::nat. FINITE u & CARD u = ua"
  6680 
  6537 
  6681 lemma DEF_HAS_SIZE: "HAS_SIZE = (%(u::'q_43199::type => bool) ua::nat. FINITE u & CARD u = ua)"
  6538 lemma DEF_HAS_SIZE: "HAS_SIZE = (%(u::'q_43199::type => bool) ua::nat. FINITE u & CARD u = ua)"
  6682   by (import hollight DEF_HAS_SIZE)
  6539   by (import hollight DEF_HAS_SIZE)
  6683 
  6540 
  6942    (EX f::nat => 'A::type.
  6799    (EX f::nat => 'A::type.
  6943        (ALL m::nat. < m n --> IN (f m) x) &
  6800        (ALL m::nat. < m n --> IN (f m) x) &
  6944        (ALL xa::'A::type. IN xa x --> (EX! m::nat. < m n & f m = xa)))"
  6801        (ALL xa::'A::type. IN xa x --> (EX! m::nat. < m n & f m = xa)))"
  6945   by (import hollight HAS_SIZE_INDEX)
  6802   by (import hollight HAS_SIZE_INDEX)
  6946 
  6803 
  6947 constdefs
  6804 definition set_of_list :: "'q_45968 hollight.list => 'q_45968 => bool" where 
  6948   set_of_list :: "'q_45968 hollight.list => 'q_45968 => bool" 
       
  6949   "set_of_list ==
  6805   "set_of_list ==
  6950 SOME set_of_list::'q_45968::type hollight.list => 'q_45968::type => bool.
  6806 SOME set_of_list::'q_45968::type hollight.list => 'q_45968::type => bool.
  6951    set_of_list NIL = EMPTY &
  6807    set_of_list NIL = EMPTY &
  6952    (ALL (h::'q_45968::type) t::'q_45968::type hollight.list.
  6808    (ALL (h::'q_45968::type) t::'q_45968::type hollight.list.
  6953        set_of_list (CONS h t) = INSERT h (set_of_list t))"
  6809        set_of_list (CONS h t) = INSERT h (set_of_list t))"
  6957     set_of_list NIL = EMPTY &
  6813     set_of_list NIL = EMPTY &
  6958     (ALL (h::'q_45968::type) t::'q_45968::type hollight.list.
  6814     (ALL (h::'q_45968::type) t::'q_45968::type hollight.list.
  6959         set_of_list (CONS h t) = INSERT h (set_of_list t)))"
  6815         set_of_list (CONS h t) = INSERT h (set_of_list t)))"
  6960   by (import hollight DEF_set_of_list)
  6816   by (import hollight DEF_set_of_list)
  6961 
  6817 
  6962 constdefs
  6818 definition list_of_set :: "('q_45986 => bool) => 'q_45986 hollight.list" where 
  6963   list_of_set :: "('q_45986 => bool) => 'q_45986 hollight.list" 
       
  6964   "list_of_set ==
  6819   "list_of_set ==
  6965 %u::'q_45986::type => bool.
  6820 %u::'q_45986::type => bool.
  6966    SOME l::'q_45986::type hollight.list.
  6821    SOME l::'q_45986::type hollight.list.
  6967       set_of_list l = u & LENGTH l = CARD u"
  6822       set_of_list l = u & LENGTH l = CARD u"
  6968 
  6823 
  6997 lemma SET_OF_LIST_APPEND: "ALL (x::'q_46139::type hollight.list) xa::'q_46139::type hollight.list.
  6852 lemma SET_OF_LIST_APPEND: "ALL (x::'q_46139::type hollight.list) xa::'q_46139::type hollight.list.
  6998    set_of_list (APPEND x xa) =
  6853    set_of_list (APPEND x xa) =
  6999    hollight.UNION (set_of_list x) (set_of_list xa)"
  6854    hollight.UNION (set_of_list x) (set_of_list xa)"
  7000   by (import hollight SET_OF_LIST_APPEND)
  6855   by (import hollight SET_OF_LIST_APPEND)
  7001 
  6856 
  7002 constdefs
  6857 definition pairwise :: "('q_46198 => 'q_46198 => bool) => ('q_46198 => bool) => bool" where 
  7003   pairwise :: "('q_46198 => 'q_46198 => bool) => ('q_46198 => bool) => bool" 
       
  7004   "pairwise ==
  6858   "pairwise ==
  7005 %(u::'q_46198::type => 'q_46198::type => bool) ua::'q_46198::type => bool.
  6859 %(u::'q_46198::type => 'q_46198::type => bool) ua::'q_46198::type => bool.
  7006    ALL (x::'q_46198::type) y::'q_46198::type.
  6860    ALL (x::'q_46198::type) y::'q_46198::type.
  7007       IN x ua & IN y ua & x ~= y --> u x y"
  6861       IN x ua & IN y ua & x ~= y --> u x y"
  7008 
  6862 
  7010 (%(u::'q_46198::type => 'q_46198::type => bool) ua::'q_46198::type => bool.
  6864 (%(u::'q_46198::type => 'q_46198::type => bool) ua::'q_46198::type => bool.
  7011     ALL (x::'q_46198::type) y::'q_46198::type.
  6865     ALL (x::'q_46198::type) y::'q_46198::type.
  7012        IN x ua & IN y ua & x ~= y --> u x y)"
  6866        IN x ua & IN y ua & x ~= y --> u x y)"
  7013   by (import hollight DEF_pairwise)
  6867   by (import hollight DEF_pairwise)
  7014 
  6868 
  7015 constdefs
  6869 definition PAIRWISE :: "('q_46220 => 'q_46220 => bool) => 'q_46220 hollight.list => bool" where 
  7016   PAIRWISE :: "('q_46220 => 'q_46220 => bool) => 'q_46220 hollight.list => bool" 
       
  7017   "PAIRWISE ==
  6870   "PAIRWISE ==
  7018 SOME PAIRWISE::('q_46220::type => 'q_46220::type => bool)
  6871 SOME PAIRWISE::('q_46220::type => 'q_46220::type => bool)
  7019                => 'q_46220::type hollight.list => bool.
  6872                => 'q_46220::type hollight.list => bool.
  7020    (ALL r::'q_46220::type => 'q_46220::type => bool.
  6873    (ALL r::'q_46220::type => 'q_46220::type => bool.
  7021        PAIRWISE r NIL = True) &
  6874        PAIRWISE r NIL = True) &
  7073      ((INSERT::'A::type => ('A::type => bool) => 'A::type => bool)
  6926      ((INSERT::'A::type => ('A::type => bool) => 'A::type => bool)
  7074        ((Eps::('A::type => bool) => 'A::type) (%z::'A::type. True::bool))
  6927        ((Eps::('A::type => bool) => 'A::type) (%z::'A::type. True::bool))
  7075        (EMPTY::'A::type => bool))))"
  6928        (EMPTY::'A::type => bool))))"
  7076   by (import hollight FINITE_IMAGE_IMAGE)
  6929   by (import hollight FINITE_IMAGE_IMAGE)
  7077 
  6930 
  7078 constdefs
  6931 definition dimindex :: "('A => bool) => nat" where 
  7079   dimindex :: "('A => bool) => nat" 
       
  7080   "(op ==::(('A::type => bool) => nat) => (('A::type => bool) => nat) => prop)
  6932   "(op ==::(('A::type => bool) => nat) => (('A::type => bool) => nat) => prop)
  7081  (dimindex::('A::type => bool) => nat)
  6933  (dimindex::('A::type => bool) => nat)
  7082  (%u::'A::type => bool.
  6934  (%u::'A::type => bool.
  7083      (COND::bool => nat => nat => nat)
  6935      (COND::bool => nat => nat => nat)
  7084       ((FINITE::('A::type => bool) => bool)
  6936       ((FINITE::('A::type => bool) => bool)
  7123 
  6975 
  7124 lemma DIMINDEX_FINITE_IMAGE: "ALL (s::'A::type finite_image => bool) t::'A::type => bool.
  6976 lemma DIMINDEX_FINITE_IMAGE: "ALL (s::'A::type finite_image => bool) t::'A::type => bool.
  7125    dimindex s = dimindex t"
  6977    dimindex s = dimindex t"
  7126   by (import hollight DIMINDEX_FINITE_IMAGE)
  6978   by (import hollight DIMINDEX_FINITE_IMAGE)
  7127 
  6979 
  7128 constdefs
  6980 definition finite_index :: "nat => 'A" where 
  7129   finite_index :: "nat => 'A" 
       
  7130   "(op ==::(nat => 'A::type) => (nat => 'A::type) => prop)
  6981   "(op ==::(nat => 'A::type) => (nat => 'A::type) => prop)
  7131  (finite_index::nat => 'A::type)
  6982  (finite_index::nat => 'A::type)
  7132  ((Eps::((nat => 'A::type) => bool) => nat => 'A::type)
  6983  ((Eps::((nat => 'A::type) => bool) => nat => 'A::type)
  7133    (%f::nat => 'A::type.
  6984    (%f::nat => 'A::type.
  7134        (All::('A::type => bool) => bool)
  6985        (All::('A::type => bool) => bool)
  7285                     (($::('A::type, 'B::type) cart => nat => 'A::type) x xa)
  7136                     (($::('A::type, 'B::type) cart => nat => 'A::type) x xa)
  7286                     (($::('A::type, 'B::type) cart => nat => 'A::type) y
  7137                     (($::('A::type, 'B::type) cart => nat => 'A::type) y
  7287                       xa))))))"
  7138                       xa))))))"
  7288   by (import hollight CART_EQ)
  7139   by (import hollight CART_EQ)
  7289 
  7140 
  7290 constdefs
  7141 definition lambda :: "(nat => 'A) => ('A, 'B) cart" where 
  7291   lambda :: "(nat => 'A) => ('A, 'B) cart" 
       
  7292   "(op ==::((nat => 'A::type) => ('A::type, 'B::type) cart)
  7142   "(op ==::((nat => 'A::type) => ('A::type, 'B::type) cart)
  7293         => ((nat => 'A::type) => ('A::type, 'B::type) cart) => prop)
  7143         => ((nat => 'A::type) => ('A::type, 'B::type) cart) => prop)
  7294  (lambda::(nat => 'A::type) => ('A::type, 'B::type) cart)
  7144  (lambda::(nat => 'A::type) => ('A::type, 'B::type) cart)
  7295  (%u::nat => 'A::type.
  7145  (%u::nat => 'A::type.
  7296      (Eps::(('A::type, 'B::type) cart => bool) => ('A::type, 'B::type) cart)
  7146      (Eps::(('A::type, 'B::type) cart => bool) => ('A::type, 'B::type) cart)
  7386 
  7236 
  7387 lemmas "TYDEF_finite_sum_@intern" = typedef_hol2hollight 
  7237 lemmas "TYDEF_finite_sum_@intern" = typedef_hol2hollight 
  7388   [where a="a :: ('A, 'B) finite_sum" and r=r ,
  7238   [where a="a :: ('A, 'B) finite_sum" and r=r ,
  7389    OF type_definition_finite_sum]
  7239    OF type_definition_finite_sum]
  7390 
  7240 
  7391 constdefs
  7241 definition pastecart :: "('A, 'M) cart => ('A, 'N) cart => ('A, ('M, 'N) finite_sum) cart" where 
  7392   pastecart :: "('A, 'M) cart => ('A, 'N) cart => ('A, ('M, 'N) finite_sum) cart" 
       
  7393   "(op ==::(('A::type, 'M::type) cart
  7242   "(op ==::(('A::type, 'M::type) cart
  7394          => ('A::type, 'N::type) cart
  7243          => ('A::type, 'N::type) cart
  7395             => ('A::type, ('M::type, 'N::type) finite_sum) cart)
  7244             => ('A::type, ('M::type, 'N::type) finite_sum) cart)
  7396         => (('A::type, 'M::type) cart
  7245         => (('A::type, 'M::type) cart
  7397             => ('A::type, 'N::type) cart
  7246             => ('A::type, 'N::type) cart
  7437              ((op -::nat => nat => nat) i
  7286              ((op -::nat => nat => nat) i
  7438                ((dimindex::('M::type => bool) => nat)
  7287                ((dimindex::('M::type => bool) => nat)
  7439                  (hollight.UNIV::'M::type => bool))))))"
  7288                  (hollight.UNIV::'M::type => bool))))))"
  7440   by (import hollight DEF_pastecart)
  7289   by (import hollight DEF_pastecart)
  7441 
  7290 
  7442 constdefs
  7291 definition fstcart :: "('A, ('M, 'N) finite_sum) cart => ('A, 'M) cart" where 
  7443   fstcart :: "('A, ('M, 'N) finite_sum) cart => ('A, 'M) cart" 
       
  7444   "fstcart ==
  7292   "fstcart ==
  7445 %u::('A::type, ('M::type, 'N::type) finite_sum) cart. lambda ($ u)"
  7293 %u::('A::type, ('M::type, 'N::type) finite_sum) cart. lambda ($ u)"
  7446 
  7294 
  7447 lemma DEF_fstcart: "fstcart =
  7295 lemma DEF_fstcart: "fstcart =
  7448 (%u::('A::type, ('M::type, 'N::type) finite_sum) cart. lambda ($ u))"
  7296 (%u::('A::type, ('M::type, 'N::type) finite_sum) cart. lambda ($ u))"
  7449   by (import hollight DEF_fstcart)
  7297   by (import hollight DEF_fstcart)
  7450 
  7298 
  7451 constdefs
  7299 definition sndcart :: "('A, ('M, 'N) finite_sum) cart => ('A, 'N) cart" where 
  7452   sndcart :: "('A, ('M, 'N) finite_sum) cart => ('A, 'N) cart" 
       
  7453   "(op ==::(('A::type, ('M::type, 'N::type) finite_sum) cart
  7300   "(op ==::(('A::type, ('M::type, 'N::type) finite_sum) cart
  7454          => ('A::type, 'N::type) cart)
  7301          => ('A::type, 'N::type) cart)
  7455         => (('A::type, ('M::type, 'N::type) finite_sum) cart
  7302         => (('A::type, ('M::type, 'N::type) finite_sum) cart
  7456             => ('A::type, 'N::type) cart)
  7303             => ('A::type, 'N::type) cart)
  7457            => prop)
  7304            => prop)
  7614    (ALL (xb::'q_48090::type) y::'q_48090::type.
  7461    (ALL (xb::'q_48090::type) y::'q_48090::type.
  7615        xa xb = xa y --> x xb = x y) =
  7462        xa xb = xa y --> x xb = x y) =
  7616    (EX xb::'q_48070::type => 'q_48091::type. x = xb o xa)"
  7463    (EX xb::'q_48070::type => 'q_48091::type. x = xb o xa)"
  7617   by (import hollight FUNCTION_FACTORS_LEFT)
  7464   by (import hollight FUNCTION_FACTORS_LEFT)
  7618 
  7465 
  7619 constdefs
  7466 definition dotdot :: "nat => nat => nat => bool" where 
  7620   dotdot :: "nat => nat => nat => bool" 
       
  7621   "dotdot ==
  7467   "dotdot ==
  7622 %(u::nat) ua::nat.
  7468 %(u::nat) ua::nat.
  7623    GSPEC (%ub::nat. EX x::nat. SETSPEC ub (<= u x & <= x ua) x)"
  7469    GSPEC (%ub::nat. EX x::nat. SETSPEC ub (<= u x & <= x ua) x)"
  7624 
  7470 
  7625 lemma DEF__dot__dot_: "dotdot =
  7471 lemma DEF__dot__dot_: "dotdot =
  7716 
  7562 
  7717 lemma SUBSET_NUMSEG: "ALL (m::nat) (n::nat) (p::nat) q::nat.
  7563 lemma SUBSET_NUMSEG: "ALL (m::nat) (n::nat) (p::nat) q::nat.
  7718    SUBSET (dotdot m n) (dotdot p q) = (< n m | <= p m & <= n q)"
  7564    SUBSET (dotdot m n) (dotdot p q) = (< n m | <= p m & <= n q)"
  7719   by (import hollight SUBSET_NUMSEG)
  7565   by (import hollight SUBSET_NUMSEG)
  7720 
  7566 
  7721 constdefs
  7567 definition neutral :: "('q_48985 => 'q_48985 => 'q_48985) => 'q_48985" where 
  7722   neutral :: "('q_48985 => 'q_48985 => 'q_48985) => 'q_48985" 
       
  7723   "neutral ==
  7568   "neutral ==
  7724 %u::'q_48985::type => 'q_48985::type => 'q_48985::type.
  7569 %u::'q_48985::type => 'q_48985::type => 'q_48985::type.
  7725    SOME x::'q_48985::type. ALL y::'q_48985::type. u x y = y & u y x = y"
  7570    SOME x::'q_48985::type. ALL y::'q_48985::type. u x y = y & u y x = y"
  7726 
  7571 
  7727 lemma DEF_neutral: "neutral =
  7572 lemma DEF_neutral: "neutral =
  7728 (%u::'q_48985::type => 'q_48985::type => 'q_48985::type.
  7573 (%u::'q_48985::type => 'q_48985::type => 'q_48985::type.
  7729     SOME x::'q_48985::type. ALL y::'q_48985::type. u x y = y & u y x = y)"
  7574     SOME x::'q_48985::type. ALL y::'q_48985::type. u x y = y & u y x = y)"
  7730   by (import hollight DEF_neutral)
  7575   by (import hollight DEF_neutral)
  7731 
  7576 
  7732 constdefs
  7577 definition monoidal :: "('A => 'A => 'A) => bool" where 
  7733   monoidal :: "('A => 'A => 'A) => bool" 
       
  7734   "monoidal ==
  7578   "monoidal ==
  7735 %u::'A::type => 'A::type => 'A::type.
  7579 %u::'A::type => 'A::type => 'A::type.
  7736    (ALL (x::'A::type) y::'A::type. u x y = u y x) &
  7580    (ALL (x::'A::type) y::'A::type. u x y = u y x) &
  7737    (ALL (x::'A::type) (y::'A::type) z::'A::type.
  7581    (ALL (x::'A::type) (y::'A::type) z::'A::type.
  7738        u x (u y z) = u (u x y) z) &
  7582        u x (u y z) = u (u x y) z) &
  7744     (ALL (x::'A::type) (y::'A::type) z::'A::type.
  7588     (ALL (x::'A::type) (y::'A::type) z::'A::type.
  7745         u x (u y z) = u (u x y) z) &
  7589         u x (u y z) = u (u x y) z) &
  7746     (ALL x::'A::type. u (neutral u) x = x))"
  7590     (ALL x::'A::type. u (neutral u) x = x))"
  7747   by (import hollight DEF_monoidal)
  7591   by (import hollight DEF_monoidal)
  7748 
  7592 
  7749 constdefs
  7593 definition support :: "('B => 'B => 'B) => ('A => 'B) => ('A => bool) => 'A => bool" where 
  7750   support :: "('B => 'B => 'B) => ('A => 'B) => ('A => bool) => 'A => bool" 
       
  7751   "support ==
  7594   "support ==
  7752 %(u::'B::type => 'B::type => 'B::type) (ua::'A::type => 'B::type)
  7595 %(u::'B::type => 'B::type => 'B::type) (ua::'A::type => 'B::type)
  7753    ub::'A::type => bool.
  7596    ub::'A::type => bool.
  7754    GSPEC
  7597    GSPEC
  7755     (%uc::'A::type.
  7598     (%uc::'A::type.
  7761     GSPEC
  7604     GSPEC
  7762      (%uc::'A::type.
  7605      (%uc::'A::type.
  7763          EX x::'A::type. SETSPEC uc (IN x ub & ua x ~= neutral u) x))"
  7606          EX x::'A::type. SETSPEC uc (IN x ub & ua x ~= neutral u) x))"
  7764   by (import hollight DEF_support)
  7607   by (import hollight DEF_support)
  7765 
  7608 
  7766 constdefs
  7609 definition iterate :: "('q_49090 => 'q_49090 => 'q_49090)
  7767   iterate :: "('q_49090 => 'q_49090 => 'q_49090)
  7610 => ('A => bool) => ('A => 'q_49090) => 'q_49090" where 
  7768 => ('A => bool) => ('A => 'q_49090) => 'q_49090" 
       
  7769   "iterate ==
  7611   "iterate ==
  7770 %(u::'q_49090::type => 'q_49090::type => 'q_49090::type)
  7612 %(u::'q_49090::type => 'q_49090::type => 'q_49090::type)
  7771    (ua::'A::type => bool) ub::'A::type => 'q_49090::type.
  7613    (ua::'A::type => bool) ub::'A::type => 'q_49090::type.
  7772    ITSET (%x::'A::type. u (ub x)) (support u ub ua) (neutral u)"
  7614    ITSET (%x::'A::type. u (ub x)) (support u ub ua) (neutral u)"
  7773 
  7615 
  8015        (ALL y::'B::type. IN y t --> (EX! x::'A::type. IN x s & h x = y)) &
  7857        (ALL y::'B::type. IN y t --> (EX! x::'A::type. IN x s & h x = y)) &
  8016        (ALL x::'A::type. IN x s --> IN (h x) t & g (h x) = f x) -->
  7858        (ALL x::'A::type. IN x s --> IN (h x) t & g (h x) = f x) -->
  8017        iterate u_4247 s f = iterate u_4247 t g)"
  7859        iterate u_4247 s f = iterate u_4247 t g)"
  8018   by (import hollight ITERATE_EQ_GENERAL)
  7860   by (import hollight ITERATE_EQ_GENERAL)
  8019 
  7861 
  8020 constdefs
  7862 definition nsum :: "('q_51017 => bool) => ('q_51017 => nat) => nat" where 
  8021   nsum :: "('q_51017 => bool) => ('q_51017 => nat) => nat" 
       
  8022   "(op ==::(('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  7863   "(op ==::(('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8023         => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  7864         => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8024            => prop)
  7865            => prop)
  8025  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  7866  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8026  ((iterate::(nat => nat => nat)
  7867  ((iterate::(nat => nat => nat)
  8963    (ALL y::'B::type. IN y xa --> (EX! xa::'A::type. IN xa x & xd xa = y)) &
  8804    (ALL y::'B::type. IN y xa --> (EX! xa::'A::type. IN xa x & xd xa = y)) &
  8964    (ALL xe::'A::type. IN xe x --> IN (xd xe) xa & xc (xd xe) = xb xe) -->
  8805    (ALL xe::'A::type. IN xe x --> IN (xd xe) xa & xc (xd xe) = xb xe) -->
  8965    hollight.sum x xb = hollight.sum xa xc"
  8806    hollight.sum x xb = hollight.sum xa xc"
  8966   by (import hollight SUM_EQ_GENERAL)
  8807   by (import hollight SUM_EQ_GENERAL)
  8967 
  8808 
  8968 constdefs
  8809 definition CASEWISE :: "(('q_57926 => 'q_57930) * ('q_57931 => 'q_57926 => 'q_57890)) hollight.list
  8969   CASEWISE :: "(('q_57926 => 'q_57930) * ('q_57931 => 'q_57926 => 'q_57890)) hollight.list
  8810 => 'q_57931 => 'q_57930 => 'q_57890" where 
  8970 => 'q_57931 => 'q_57930 => 'q_57890" 
       
  8971   "CASEWISE ==
  8811   "CASEWISE ==
  8972 SOME CASEWISE::(('q_57926::type => 'q_57930::type) *
  8812 SOME CASEWISE::(('q_57926::type => 'q_57930::type) *
  8973                 ('q_57931::type
  8813                 ('q_57931::type
  8974                  => 'q_57926::type => 'q_57890::type)) hollight.list
  8814                  => 'q_57926::type => 'q_57890::type)) hollight.list
  8975                => 'q_57931::type => 'q_57930::type => 'q_57890::type.
  8815                => 'q_57931::type => 'q_57930::type => 'q_57890::type.
  9082              GEQ (f (s, t))
  8922              GEQ (f (s, t))
  9083               (ALL xb::'P::type. CASEWISE x xa (s xb) = t xa xb)))
  8923               (ALL xb::'P::type. CASEWISE x xa (s xb) = t xa xb)))
  9084     x"
  8924     x"
  9085   by (import hollight CASEWISE_WORKS)
  8925   by (import hollight CASEWISE_WORKS)
  9086 
  8926 
  9087 constdefs
  8927 definition admissible :: "('q_58228 => 'q_58221 => bool)
  9088   admissible :: "('q_58228 => 'q_58221 => bool)
       
  9089 => (('q_58228 => 'q_58224) => 'q_58234 => bool)
  8928 => (('q_58228 => 'q_58224) => 'q_58234 => bool)
  9090    => ('q_58234 => 'q_58221)
  8929    => ('q_58234 => 'q_58221)
  9091       => (('q_58228 => 'q_58224) => 'q_58234 => 'q_58229) => bool" 
  8930       => (('q_58228 => 'q_58224) => 'q_58234 => 'q_58229) => bool" where 
  9092   "admissible ==
  8931   "admissible ==
  9093 %(u::'q_58228::type => 'q_58221::type => bool)
  8932 %(u::'q_58228::type => 'q_58221::type => bool)
  9094    (ua::('q_58228::type => 'q_58224::type) => 'q_58234::type => bool)
  8933    (ua::('q_58228::type => 'q_58224::type) => 'q_58234::type => bool)
  9095    (ub::'q_58234::type => 'q_58221::type)
  8934    (ub::'q_58234::type => 'q_58221::type)
  9096    uc::('q_58228::type => 'q_58224::type)
  8935    uc::('q_58228::type => 'q_58224::type)
  9112        ua f a &
  8951        ua f a &
  9113        ua g a & (ALL z::'q_58228::type. u z (ub a) --> f z = g z) -->
  8952        ua g a & (ALL z::'q_58228::type. u z (ub a) --> f z = g z) -->
  9114        uc f a = uc g a)"
  8953        uc f a = uc g a)"
  9115   by (import hollight DEF_admissible)
  8954   by (import hollight DEF_admissible)
  9116 
  8955 
  9117 constdefs
  8956 definition tailadmissible :: "('A => 'A => bool)
  9118   tailadmissible :: "('A => 'A => bool)
       
  9119 => (('A => 'B) => 'P => bool)
  8957 => (('A => 'B) => 'P => bool)
  9120    => ('P => 'A) => (('A => 'B) => 'P => 'B) => bool" 
  8958    => ('P => 'A) => (('A => 'B) => 'P => 'B) => bool" where 
  9121   "tailadmissible ==
  8959   "tailadmissible ==
  9122 %(u::'A::type => 'A::type => bool)
  8960 %(u::'A::type => 'A::type => bool)
  9123    (ua::('A::type => 'B::type) => 'P::type => bool)
  8961    (ua::('A::type => 'B::type) => 'P::type => bool)
  9124    (ub::'P::type => 'A::type)
  8962    (ub::'P::type => 'A::type)
  9125    uc::('A::type => 'B::type) => 'P::type => 'B::type.
  8963    uc::('A::type => 'B::type) => 'P::type => 'B::type.
  9149            P f a = P g a & G f a = G g a & H f a = H g a) &
  8987            P f a = P g a & G f a = G g a & H f a = H g a) &
  9150        (ALL (f::'A::type => 'B::type) a::'P::type.
  8988        (ALL (f::'A::type => 'B::type) a::'P::type.
  9151            ua f a --> uc f a = COND (P f a) (f (G f a)) (H f a)))"
  8989            ua f a --> uc f a = COND (P f a) (f (G f a)) (H f a)))"
  9152   by (import hollight DEF_tailadmissible)
  8990   by (import hollight DEF_tailadmissible)
  9153 
  8991 
  9154 constdefs
  8992 definition superadmissible :: "('q_58378 => 'q_58378 => bool)
  9155   superadmissible :: "('q_58378 => 'q_58378 => bool)
       
  9156 => (('q_58378 => 'q_58380) => 'q_58386 => bool)
  8993 => (('q_58378 => 'q_58380) => 'q_58386 => bool)
  9157    => ('q_58386 => 'q_58378)
  8994    => ('q_58386 => 'q_58378)
  9158       => (('q_58378 => 'q_58380) => 'q_58386 => 'q_58380) => bool" 
  8995       => (('q_58378 => 'q_58380) => 'q_58386 => 'q_58380) => bool" where 
  9159   "superadmissible ==
  8996   "superadmissible ==
  9160 %(u::'q_58378::type => 'q_58378::type => bool)
  8997 %(u::'q_58378::type => 'q_58378::type => bool)
  9161    (ua::('q_58378::type => 'q_58380::type) => 'q_58386::type => bool)
  8998    (ua::('q_58378::type => 'q_58380::type) => 'q_58386::type => bool)
  9162    (ub::'q_58386::type => 'q_58378::type)
  8999    (ub::'q_58386::type => 'q_58378::type)
  9163    uc::('q_58378::type => 'q_58380::type)
  9000    uc::('q_58378::type => 'q_58380::type)