src/HOL/Import/HOLLight/HOLLight.thy
changeset 34974 18b41bba42b5
parent 19233 77ca20b0ed77
child 35416 d8d7d1b785af
equal deleted inserted replaced
34973:ae634fad947e 34974:18b41bba42b5
  1117 lemma ARITH_ADD: "(op &::bool => bool => bool)
  1117 lemma ARITH_ADD: "(op &::bool => bool => bool)
  1118  ((All::(nat => bool) => bool)
  1118  ((All::(nat => bool) => bool)
  1119    (%x::nat.
  1119    (%x::nat.
  1120        (All::(nat => bool) => bool)
  1120        (All::(nat => bool) => bool)
  1121         (%xa::nat.
  1121         (%xa::nat.
  1122             (op =::nat => nat => bool) ((HOL.plus::nat => nat => nat) x xa)
  1122             (op =::nat => nat => bool) ((plus::nat => nat => nat) x xa)
  1123              ((HOL.plus::nat => nat => nat) x xa))))
  1123              ((plus::nat => nat => nat) x xa))))
  1124  ((op &::bool => bool => bool)
  1124  ((op &::bool => bool => bool)
  1125    ((op =::nat => nat => bool) ((HOL.plus::nat => nat => nat) (0::nat) (0::nat))
  1125    ((op =::nat => nat => bool) ((plus::nat => nat => nat) (0::nat) (0::nat))
  1126      (0::nat))
  1126      (0::nat))
  1127    ((op &::bool => bool => bool)
  1127    ((op &::bool => bool => bool)
  1128      ((All::(nat => bool) => bool)
  1128      ((All::(nat => bool) => bool)
  1129        (%x::nat.
  1129        (%x::nat.
  1130            (op =::nat => nat => bool)
  1130            (op =::nat => nat => bool)
  1131             ((HOL.plus::nat => nat => nat) (0::nat)
  1131             ((plus::nat => nat => nat) (0::nat)
  1132               ((NUMERAL_BIT0::nat => nat) x))
  1132               ((NUMERAL_BIT0::nat => nat) x))
  1133             ((NUMERAL_BIT0::nat => nat) x)))
  1133             ((NUMERAL_BIT0::nat => nat) x)))
  1134      ((op &::bool => bool => bool)
  1134      ((op &::bool => bool => bool)
  1135        ((All::(nat => bool) => bool)
  1135        ((All::(nat => bool) => bool)
  1136          (%x::nat.
  1136          (%x::nat.
  1137              (op =::nat => nat => bool)
  1137              (op =::nat => nat => bool)
  1138               ((HOL.plus::nat => nat => nat) (0::nat)
  1138               ((plus::nat => nat => nat) (0::nat)
  1139                 ((NUMERAL_BIT1::nat => nat) x))
  1139                 ((NUMERAL_BIT1::nat => nat) x))
  1140               ((NUMERAL_BIT1::nat => nat) x)))
  1140               ((NUMERAL_BIT1::nat => nat) x)))
  1141        ((op &::bool => bool => bool)
  1141        ((op &::bool => bool => bool)
  1142          ((All::(nat => bool) => bool)
  1142          ((All::(nat => bool) => bool)
  1143            (%x::nat.
  1143            (%x::nat.
  1144                (op =::nat => nat => bool)
  1144                (op =::nat => nat => bool)
  1145                 ((HOL.plus::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  1145                 ((plus::nat => nat => nat) ((NUMERAL_BIT0::nat => nat) x)
  1146                   (0::nat))
  1146                   (0::nat))
  1147                 ((NUMERAL_BIT0::nat => nat) x)))
  1147                 ((NUMERAL_BIT0::nat => nat) x)))
  1148          ((op &::bool => bool => bool)
  1148          ((op &::bool => bool => bool)
  1149            ((All::(nat => bool) => bool)
  1149            ((All::(nat => bool) => bool)
  1150              (%x::nat.
  1150              (%x::nat.
  1151                  (op =::nat => nat => bool)
  1151                  (op =::nat => nat => bool)
  1152                   ((HOL.plus::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  1152                   ((plus::nat => nat => nat) ((NUMERAL_BIT1::nat => nat) x)
  1153                     (0::nat))
  1153                     (0::nat))
  1154                   ((NUMERAL_BIT1::nat => nat) x)))
  1154                   ((NUMERAL_BIT1::nat => nat) x)))
  1155            ((op &::bool => bool => bool)
  1155            ((op &::bool => bool => bool)
  1156              ((All::(nat => bool) => bool)
  1156              ((All::(nat => bool) => bool)
  1157                (%x::nat.
  1157                (%x::nat.
  1158                    (All::(nat => bool) => bool)
  1158                    (All::(nat => bool) => bool)
  1159                     (%xa::nat.
  1159                     (%xa::nat.
  1160                         (op =::nat => nat => bool)
  1160                         (op =::nat => nat => bool)
  1161                          ((HOL.plus::nat => nat => nat)
  1161                          ((plus::nat => nat => nat)
  1162                            ((NUMERAL_BIT0::nat => nat) x)
  1162                            ((NUMERAL_BIT0::nat => nat) x)
  1163                            ((NUMERAL_BIT0::nat => nat) xa))
  1163                            ((NUMERAL_BIT0::nat => nat) xa))
  1164                          ((NUMERAL_BIT0::nat => nat)
  1164                          ((NUMERAL_BIT0::nat => nat)
  1165                            ((HOL.plus::nat => nat => nat) x xa)))))
  1165                            ((plus::nat => nat => nat) x xa)))))
  1166              ((op &::bool => bool => bool)
  1166              ((op &::bool => bool => bool)
  1167                ((All::(nat => bool) => bool)
  1167                ((All::(nat => bool) => bool)
  1168                  (%x::nat.
  1168                  (%x::nat.
  1169                      (All::(nat => bool) => bool)
  1169                      (All::(nat => bool) => bool)
  1170                       (%xa::nat.
  1170                       (%xa::nat.
  1171                           (op =::nat => nat => bool)
  1171                           (op =::nat => nat => bool)
  1172                            ((HOL.plus::nat => nat => nat)
  1172                            ((plus::nat => nat => nat)
  1173                              ((NUMERAL_BIT0::nat => nat) x)
  1173                              ((NUMERAL_BIT0::nat => nat) x)
  1174                              ((NUMERAL_BIT1::nat => nat) xa))
  1174                              ((NUMERAL_BIT1::nat => nat) xa))
  1175                            ((NUMERAL_BIT1::nat => nat)
  1175                            ((NUMERAL_BIT1::nat => nat)
  1176                              ((HOL.plus::nat => nat => nat) x xa)))))
  1176                              ((plus::nat => nat => nat) x xa)))))
  1177                ((op &::bool => bool => bool)
  1177                ((op &::bool => bool => bool)
  1178                  ((All::(nat => bool) => bool)
  1178                  ((All::(nat => bool) => bool)
  1179                    (%x::nat.
  1179                    (%x::nat.
  1180                        (All::(nat => bool) => bool)
  1180                        (All::(nat => bool) => bool)
  1181                         (%xa::nat.
  1181                         (%xa::nat.
  1182                             (op =::nat => nat => bool)
  1182                             (op =::nat => nat => bool)
  1183                              ((HOL.plus::nat => nat => nat)
  1183                              ((plus::nat => nat => nat)
  1184                                ((NUMERAL_BIT1::nat => nat) x)
  1184                                ((NUMERAL_BIT1::nat => nat) x)
  1185                                ((NUMERAL_BIT0::nat => nat) xa))
  1185                                ((NUMERAL_BIT0::nat => nat) xa))
  1186                              ((NUMERAL_BIT1::nat => nat)
  1186                              ((NUMERAL_BIT1::nat => nat)
  1187                                ((HOL.plus::nat => nat => nat) x xa)))))
  1187                                ((plus::nat => nat => nat) x xa)))))
  1188                  ((All::(nat => bool) => bool)
  1188                  ((All::(nat => bool) => bool)
  1189                    (%x::nat.
  1189                    (%x::nat.
  1190                        (All::(nat => bool) => bool)
  1190                        (All::(nat => bool) => bool)
  1191                         (%xa::nat.
  1191                         (%xa::nat.
  1192                             (op =::nat => nat => bool)
  1192                             (op =::nat => nat => bool)
  1193                              ((HOL.plus::nat => nat => nat)
  1193                              ((plus::nat => nat => nat)
  1194                                ((NUMERAL_BIT1::nat => nat) x)
  1194                                ((NUMERAL_BIT1::nat => nat) x)
  1195                                ((NUMERAL_BIT1::nat => nat) xa))
  1195                                ((NUMERAL_BIT1::nat => nat) xa))
  1196                              ((NUMERAL_BIT0::nat => nat)
  1196                              ((NUMERAL_BIT0::nat => nat)
  1197                                ((Suc::nat => nat)
  1197                                ((Suc::nat => nat)
  1198                                  ((HOL.plus::nat => nat => nat) x
  1198                                  ((plus::nat => nat => nat) x
  1199                                    xa))))))))))))))"
  1199                                    xa))))))))))))))"
  1200   by (import hollight ARITH_ADD)
  1200   by (import hollight ARITH_ADD)
  1201 
  1201 
  1202 lemma ARITH_MULT: "(op &::bool => bool => bool)
  1202 lemma ARITH_MULT: "(op &::bool => bool => bool)
  1203  ((All::(nat => bool) => bool)
  1203  ((All::(nat => bool) => bool)
  1256                       (%xa::nat.
  1256                       (%xa::nat.
  1257                           (op =::nat => nat => bool)
  1257                           (op =::nat => nat => bool)
  1258                            ((op *::nat => nat => nat)
  1258                            ((op *::nat => nat => nat)
  1259                              ((NUMERAL_BIT0::nat => nat) x)
  1259                              ((NUMERAL_BIT0::nat => nat) x)
  1260                              ((NUMERAL_BIT1::nat => nat) xa))
  1260                              ((NUMERAL_BIT1::nat => nat) xa))
  1261                            ((HOL.plus::nat => nat => nat)
  1261                            ((plus::nat => nat => nat)
  1262                              ((NUMERAL_BIT0::nat => nat) x)
  1262                              ((NUMERAL_BIT0::nat => nat) x)
  1263                              ((NUMERAL_BIT0::nat => nat)
  1263                              ((NUMERAL_BIT0::nat => nat)
  1264                                ((NUMERAL_BIT0::nat => nat)
  1264                                ((NUMERAL_BIT0::nat => nat)
  1265                                  ((op *::nat => nat => nat) x xa)))))))
  1265                                  ((op *::nat => nat => nat) x xa)))))))
  1266                ((op &::bool => bool => bool)
  1266                ((op &::bool => bool => bool)
  1270                         (%xa::nat.
  1270                         (%xa::nat.
  1271                             (op =::nat => nat => bool)
  1271                             (op =::nat => nat => bool)
  1272                              ((op *::nat => nat => nat)
  1272                              ((op *::nat => nat => nat)
  1273                                ((NUMERAL_BIT1::nat => nat) x)
  1273                                ((NUMERAL_BIT1::nat => nat) x)
  1274                                ((NUMERAL_BIT0::nat => nat) xa))
  1274                                ((NUMERAL_BIT0::nat => nat) xa))
  1275                              ((HOL.plus::nat => nat => nat)
  1275                              ((plus::nat => nat => nat)
  1276                                ((NUMERAL_BIT0::nat => nat) xa)
  1276                                ((NUMERAL_BIT0::nat => nat) xa)
  1277                                ((NUMERAL_BIT0::nat => nat)
  1277                                ((NUMERAL_BIT0::nat => nat)
  1278                                  ((NUMERAL_BIT0::nat => nat)
  1278                                  ((NUMERAL_BIT0::nat => nat)
  1279                                    ((op *::nat => nat => nat) x xa)))))))
  1279                                    ((op *::nat => nat => nat) x xa)))))))
  1280                  ((All::(nat => bool) => bool)
  1280                  ((All::(nat => bool) => bool)
  1283                         (%xa::nat.
  1283                         (%xa::nat.
  1284                             (op =::nat => nat => bool)
  1284                             (op =::nat => nat => bool)
  1285                              ((op *::nat => nat => nat)
  1285                              ((op *::nat => nat => nat)
  1286                                ((NUMERAL_BIT1::nat => nat) x)
  1286                                ((NUMERAL_BIT1::nat => nat) x)
  1287                                ((NUMERAL_BIT1::nat => nat) xa))
  1287                                ((NUMERAL_BIT1::nat => nat) xa))
  1288                              ((HOL.plus::nat => nat => nat)
  1288                              ((plus::nat => nat => nat)
  1289                                ((NUMERAL_BIT1::nat => nat) x)
  1289                                ((NUMERAL_BIT1::nat => nat) x)
  1290                                ((HOL.plus::nat => nat => nat)
  1290                                ((plus::nat => nat => nat)
  1291                                  ((NUMERAL_BIT0::nat => nat) xa)
  1291                                  ((NUMERAL_BIT0::nat => nat) xa)
  1292                                  ((NUMERAL_BIT0::nat => nat)
  1292                                  ((NUMERAL_BIT0::nat => nat)
  1293                                    ((NUMERAL_BIT0::nat => nat)
  1293                                    ((NUMERAL_BIT0::nat => nat)
  1294                                      ((op *::nat => nat => nat) x
  1294                                      ((op *::nat => nat => nat) x
  1295  xa))))))))))))))))"
  1295  xa))))))))))))))))"
  7460  (%u::('A::type, ('M::type, 'N::type) finite_sum) cart.
  7460  (%u::('A::type, ('M::type, 'N::type) finite_sum) cart.
  7461      (lambda::(nat => 'A::type) => ('A::type, 'N::type) cart)
  7461      (lambda::(nat => 'A::type) => ('A::type, 'N::type) cart)
  7462       (%i::nat.
  7462       (%i::nat.
  7463           ($::('A::type, ('M::type, 'N::type) finite_sum) cart
  7463           ($::('A::type, ('M::type, 'N::type) finite_sum) cart
  7464               => nat => 'A::type)
  7464               => nat => 'A::type)
  7465            u ((HOL.plus::nat => nat => nat) i
  7465            u ((plus::nat => nat => nat) i
  7466                ((dimindex::('M::type => bool) => nat)
  7466                ((dimindex::('M::type => bool) => nat)
  7467                  (hollight.UNIV::'M::type => bool)))))"
  7467                  (hollight.UNIV::'M::type => bool)))))"
  7468 
  7468 
  7469 lemma DEF_sndcart: "(op =::(('A::type, ('M::type, 'N::type) finite_sum) cart
  7469 lemma DEF_sndcart: "(op =::(('A::type, ('M::type, 'N::type) finite_sum) cart
  7470         => ('A::type, 'N::type) cart)
  7470         => ('A::type, 'N::type) cart)
  7476  (%u::('A::type, ('M::type, 'N::type) finite_sum) cart.
  7476  (%u::('A::type, ('M::type, 'N::type) finite_sum) cart.
  7477      (lambda::(nat => 'A::type) => ('A::type, 'N::type) cart)
  7477      (lambda::(nat => 'A::type) => ('A::type, 'N::type) cart)
  7478       (%i::nat.
  7478       (%i::nat.
  7479           ($::('A::type, ('M::type, 'N::type) finite_sum) cart
  7479           ($::('A::type, ('M::type, 'N::type) finite_sum) cart
  7480               => nat => 'A::type)
  7480               => nat => 'A::type)
  7481            u ((HOL.plus::nat => nat => nat) i
  7481            u ((plus::nat => nat => nat) i
  7482                ((dimindex::('M::type => bool) => nat)
  7482                ((dimindex::('M::type => bool) => nat)
  7483                  (hollight.UNIV::'M::type => bool)))))"
  7483                  (hollight.UNIV::'M::type => bool)))))"
  7484   by (import hollight DEF_sndcart)
  7484   by (import hollight DEF_sndcart)
  7485 
  7485 
  7486 lemma DIMINDEX_HAS_SIZE_FINITE_SUM: "(HAS_SIZE::(('M::type, 'N::type) finite_sum => bool) => nat => bool)
  7486 lemma DIMINDEX_HAS_SIZE_FINITE_SUM: "(HAS_SIZE::(('M::type, 'N::type) finite_sum => bool) => nat => bool)
  7487  (hollight.UNIV::('M::type, 'N::type) finite_sum => bool)
  7487  (hollight.UNIV::('M::type, 'N::type) finite_sum => bool)
  7488  ((HOL.plus::nat => nat => nat)
  7488  ((plus::nat => nat => nat)
  7489    ((dimindex::('M::type => bool) => nat) (hollight.UNIV::'M::type => bool))
  7489    ((dimindex::('M::type => bool) => nat) (hollight.UNIV::'M::type => bool))
  7490    ((dimindex::('N::type => bool) => nat)
  7490    ((dimindex::('N::type => bool) => nat)
  7491      (hollight.UNIV::'N::type => bool)))"
  7491      (hollight.UNIV::'N::type => bool)))"
  7492   by (import hollight DIMINDEX_HAS_SIZE_FINITE_SUM)
  7492   by (import hollight DIMINDEX_HAS_SIZE_FINITE_SUM)
  7493 
  7493 
  7494 lemma DIMINDEX_FINITE_SUM: "(op =::nat => nat => bool)
  7494 lemma DIMINDEX_FINITE_SUM: "(op =::nat => nat => bool)
  7495  ((dimindex::(('M::type, 'N::type) finite_sum => bool) => nat)
  7495  ((dimindex::(('M::type, 'N::type) finite_sum => bool) => nat)
  7496    (hollight.UNIV::('M::type, 'N::type) finite_sum => bool))
  7496    (hollight.UNIV::('M::type, 'N::type) finite_sum => bool))
  7497  ((HOL.plus::nat => nat => nat)
  7497  ((plus::nat => nat => nat)
  7498    ((dimindex::('M::type => bool) => nat) (hollight.UNIV::'M::type => bool))
  7498    ((dimindex::('M::type => bool) => nat) (hollight.UNIV::'M::type => bool))
  7499    ((dimindex::('N::type => bool) => nat)
  7499    ((dimindex::('N::type => bool) => nat)
  7500      (hollight.UNIV::'N::type => bool)))"
  7500      (hollight.UNIV::'N::type => bool)))"
  7501   by (import hollight DIMINDEX_FINITE_SUM)
  7501   by (import hollight DIMINDEX_FINITE_SUM)
  7502 
  7502 
  8023         => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8023         => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8024            => prop)
  8024            => prop)
  8025  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8025  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8026  ((iterate::(nat => nat => nat)
  8026  ((iterate::(nat => nat => nat)
  8027             => ('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8027             => ('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8028    (HOL.plus::nat => nat => nat))"
  8028    (plus::nat => nat => nat))"
  8029 
  8029 
  8030 lemma DEF_nsum: "(op =::(('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8030 lemma DEF_nsum: "(op =::(('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8031        => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8031        => (('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8032           => bool)
  8032           => bool)
  8033  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8033  (nsum::('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8034  ((iterate::(nat => nat => nat)
  8034  ((iterate::(nat => nat => nat)
  8035             => ('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8035             => ('q_51017::type => bool) => ('q_51017::type => nat) => nat)
  8036    (HOL.plus::nat => nat => nat))"
  8036    (plus::nat => nat => nat))"
  8037   by (import hollight DEF_nsum)
  8037   by (import hollight DEF_nsum)
  8038 
  8038 
  8039 lemma NEUTRAL_ADD: "(op =::nat => nat => bool)
  8039 lemma NEUTRAL_ADD: "(op =::nat => nat => bool)
  8040  ((neutral::(nat => nat => nat) => nat) (HOL.plus::nat => nat => nat)) (0::nat)"
  8040  ((neutral::(nat => nat => nat) => nat) (plus::nat => nat => nat)) (0::nat)"
  8041   by (import hollight NEUTRAL_ADD)
  8041   by (import hollight NEUTRAL_ADD)
  8042 
  8042 
  8043 lemma NEUTRAL_MUL: "neutral op * = NUMERAL_BIT1 0"
  8043 lemma NEUTRAL_MUL: "neutral op * = NUMERAL_BIT1 0"
  8044   by (import hollight NEUTRAL_MUL)
  8044   by (import hollight NEUTRAL_MUL)
  8045 
  8045 
  8046 lemma MONOIDAL_ADD: "(monoidal::(nat => nat => nat) => bool) (HOL.plus::nat => nat => nat)"
  8046 lemma MONOIDAL_ADD: "(monoidal::(nat => nat => nat) => bool) (plus::nat => nat => nat)"
  8047   by (import hollight MONOIDAL_ADD)
  8047   by (import hollight MONOIDAL_ADD)
  8048 
  8048 
  8049 lemma MONOIDAL_MUL: "(monoidal::(nat => nat => nat) => bool) (op *::nat => nat => nat)"
  8049 lemma MONOIDAL_MUL: "(monoidal::(nat => nat => nat) => bool) (op *::nat => nat => nat)"
  8050   by (import hollight MONOIDAL_MUL)
  8050   by (import hollight MONOIDAL_MUL)
  8051 
  8051 
  8066    t::'q_51175::type => bool.
  8066    t::'q_51175::type => bool.
  8067    FINITE s & SUBSET t s --> nsum (DIFF s t) f = nsum s f - nsum t f"
  8067    FINITE s & SUBSET t s --> nsum (DIFF s t) f = nsum s f - nsum t f"
  8068   by (import hollight NSUM_DIFF)
  8068   by (import hollight NSUM_DIFF)
  8069 
  8069 
  8070 lemma NSUM_SUPPORT: "ALL (x::'q_51214::type => nat) xa::'q_51214::type => bool.
  8070 lemma NSUM_SUPPORT: "ALL (x::'q_51214::type => nat) xa::'q_51214::type => bool.
  8071    FINITE (support HOL.plus x xa) --> nsum (support HOL.plus x xa) x = nsum xa x"
  8071    FINITE (support plus x xa) --> nsum (support plus x xa) x = nsum xa x"
  8072   by (import hollight NSUM_SUPPORT)
  8072   by (import hollight NSUM_SUPPORT)
  8073 
  8073 
  8074 lemma NSUM_ADD: "ALL (f::'q_51260::type => nat) (g::'q_51260::type => nat)
  8074 lemma NSUM_ADD: "ALL (f::'q_51260::type => nat) (g::'q_51260::type => nat)
  8075    s::'q_51260::type => bool.
  8075    s::'q_51260::type => bool.
  8076    FINITE s --> nsum s (%x::'q_51260::type. f x + g x) = nsum s f + nsum s g"
  8076    FINITE s --> nsum s (%x::'q_51260::type. f x + g x) = nsum s f + nsum s g"