src/HOL/Import/HOLLightList.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Sat, 16 Jul 2011 00:01:17 +0200
changeset 43843 16f2fd9103bd
parent 43785 2bd54d4b5f3d
child 45827 66c68453455c
permissions -rw-r--r--
HOL/Import: Fix errors with _mk_list
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43785
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
(*  Title:      HOL/Import/HOLLightList.thy
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     2
    Author:     Cezary Kaliszyk
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
*)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
header {* Compatibility theorems for HOL Light lists *}
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
theory HOLLightList
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     8
imports List
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
begin
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    10
43843
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
    11
lemma FINITE_SET_OF_LIST:
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
    12
  "finite (set l)"
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
    13
  by simp
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
    14
43785
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
lemma AND_ALL2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
  "(list_all2 P l m \<and> list_all2 Q l m) = list_all2 (\<lambda>x y. P x y \<and> Q x y) l m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
  by (induct l m rule: list_induct2') auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
lemma MEM_EXISTS_EL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
  "(x \<in> set l) = (\<exists>i<length l. x = l ! i)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
  by (auto simp add: in_set_conv_nth)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
lemma INJECTIVE_MAP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    24
  "(\<forall>l m. map f l = map f m --> l = m) = (\<forall>x y. f x = f y --> x = y)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
proof (intro iffI allI impI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
  fix x y
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
  assume "\<forall>l m. map f l = map f m \<longrightarrow> l = m" "f x = f y"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    28
  then show "x = y"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
    by (drule_tac x="[x]" in spec) (drule_tac x="[y]" in spec, simp)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    30
next
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
  fix l m
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
  assume a: "\<forall>x y. f x = f y \<longrightarrow> x = y"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    33
  assume "map f l = map f m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
  then show "l = m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
    by (induct l m rule: list_induct2') (simp_all add: a)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
qed
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    38
lemma SURJECTIVE_MAP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
  "(\<forall>m. EX l. map f l = m) = (\<forall>y. EX x. f x = y)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
  apply (intro iffI allI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    41
  apply (drule_tac x="[y]" in spec)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    42
  apply (elim exE)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    43
  apply (case_tac l)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    44
  apply simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    45
  apply (rule_tac x="a" in exI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    46
  apply simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    47
  apply (induct_tac m)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    48
  apply simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    49
  apply (drule_tac x="a" in spec)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
  apply (elim exE)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
  apply (rule_tac x="x # l" in exI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
  apply simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    53
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    55
lemma LENGTH_TL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    56
  "l \<noteq> [] \<longrightarrow> length (tl l) = length l - 1"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    58
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    59
lemma DEF_APPEND:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    60
  "op @ = (SOME APPEND. (\<forall>l. APPEND [] l = l) \<and> (\<forall>h t l. APPEND (h # t) l = h # APPEND t l))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    61
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    62
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    63
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    64
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    65
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    66
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    67
lemma DEF_REVERSE:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    68
  "rev = (SOME REVERSE. REVERSE [] = [] \<and> (\<forall>l x. REVERSE (x # l) = (REVERSE l) @ [x]))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    69
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    70
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    71
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    72
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    73
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    74
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    75
lemma DEF_LENGTH:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    76
  "length = (SOME LENGTH. LENGTH [] = 0 \<and> (\<forall>h t. LENGTH (h # t) = Suc (LENGTH t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    77
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    78
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    79
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    80
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    81
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    82
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    83
lemma DEF_MAP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    84
  "map = (SOME MAP. (\<forall>f. MAP f [] = []) \<and> (\<forall>f h t. MAP f (h # t) = f h # MAP f t))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    85
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    86
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    87
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    88
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    89
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    90
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    91
lemma DEF_REPLICATE:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    92
  "replicate =
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    93
    (SOME REPLICATE. (\<forall>x. REPLICATE 0 x = []) \<and> (\<forall>n x. REPLICATE (Suc n) x = x # REPLICATE n x))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    94
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    95
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    96
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    97
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    98
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    99
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   100
lemma DEF_ITLIST:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   101
  "foldr = (SOME ITLIST. (\<forall>f b. ITLIST f [] b = b) \<and> (\<forall>h f t b. ITLIST f (h # t) b = f h (ITLIST f t b)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   102
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   103
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   104
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   105
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   106
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   107
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   108
lemma DEF_ALL2: "list_all2 =
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   109
  (SOME ALL2.
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   110
    (\<forall>P l2. ALL2 P [] l2 = (l2 = [])) \<and>
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   111
    (\<forall>h1 P t1 l2.
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   112
      ALL2 P (h1 # t1) l2 = (if l2 = [] then False else P h1 (hd l2) \<and> ALL2 P t1 (tl l2))))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   113
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   114
  apply (auto)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   115
  apply (case_tac l2, simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   116
  apply (case_tac l2, simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   117
  apply (case_tac l2, simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   118
  apply (simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   119
  apply (intro allI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   120
  apply (induct_tac xa xb rule: list_induct2')
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   121
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   122
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   123
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   124
lemma ALL2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   125
 "list_all2 P [] [] = True \<and>
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   126
  list_all2 P (h1 # t1) [] = False \<and>
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   127
  list_all2 P [] (h2 # t2) = False \<and>
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   128
  list_all2 P (h1 # t1) (h2 # t2) = (P h1 h2 \<and> list_all2 P t1 t2)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   129
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   130
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   131
lemma DEF_FILTER:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   132
  "filter = (SOME FILTER. (\<forall>P. FILTER P [] = []) \<and>
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   133
     (\<forall>h P t. FILTER P (h # t) = (if P h then h # FILTER P t else FILTER P t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   134
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   135
  apply (auto simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   136
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   137
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   138
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   139
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   140
fun map2 where
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   141
  "map2 f [] [] = []"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   142
| "map2 f (h1 # t1) (h2 # t2) = (f h1 h2) # (map2 f t1 t2)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   143
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   144
lemma MAP2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   145
  "map2 f [] [] = [] \<and> map2 f (h1 # t1) (h2 # t2) = f h1 h2 # map2 f t1 t2"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   146
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   147
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   148
fun fold2 where
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   149
  "fold2 f [] [] b = b"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   150
| "fold2 f (h1 # t1) (h2 # t2) b = f h1 h2 (fold2 f t1 t2 b)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   151
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   152
lemma ITLIST2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   153
  "fold2 f [] [] b = b \<and> fold2 f (h1 # t1) (h2 # t2) b = f h1 h2 (fold2 f t1 t2 b)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   154
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   155
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   156
definition [simp]: "list_el x xs = nth xs x"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   157
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   158
lemma ZIP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   159
  "zip [] [] = [] \<and> zip (h1 # t1) (h2 # t2) = (h1, h2) # (zip t1 t2)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   160
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   161
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   162
lemma LAST_CLAUSES:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   163
  "last [h] = h \<and> last (h # k # t) = last (k # t)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   164
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   165
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   166
lemma DEF_NULL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   167
  "List.null = (SOME NULL. NULL [] = True \<and> (\<forall>h t. NULL (h # t) = False))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   168
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   169
  apply (auto simp add: fun_eq_iff null_def)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   170
  apply (case_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   171
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   172
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   173
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   174
lemma DEF_ALL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   175
  "list_all = (SOME u. (\<forall>P. u P [] = True) \<and> (\<forall>h P t. u P (h # t) = (P h \<and> u P t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   176
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   177
  apply auto[1]
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   178
  apply (simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   179
  apply (intro allI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   180
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   181
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   182
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   183
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   184
lemma MAP_EQ:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   185
  "list_all (\<lambda>x. f x = g x) l \<longrightarrow> map f l = map g l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   186
  by (induct l) auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   187
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   188
definition [simp]: "list_mem x xs = List.member xs x"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   189
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   190
lemma DEF_MEM:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   191
  "list_mem = (SOME MEM. (\<forall>x. MEM x [] = False) \<and> (\<forall>h x t. MEM x (h # t) = (x = h \<or> MEM x t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   192
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   193
  apply (auto simp add: member_def)[1]
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   194
  apply (simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   195
  apply (intro allI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   196
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   197
  apply (simp_all add: member_def)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   198
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   199
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   200
lemma DEF_EX:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   201
  "list_ex = (SOME u. (\<forall>P. u P [] = False) \<and> (\<forall>h P t. u P (h # t) = (P h \<or> u P t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   202
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   203
  apply (auto)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   204
  apply (simp add: fun_eq_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   205
  apply (intro allI)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   206
  apply (induct_tac xa)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   207
  apply (simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   208
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   209
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   210
lemma ALL_IMP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   211
  "(\<forall>x. x \<in> set l \<and> P x \<longrightarrow> Q x) \<and> list_all P l \<longrightarrow> list_all Q l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   212
  by (simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   213
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   214
lemma NOT_EX: "(\<not> list_ex P l) = list_all (\<lambda>x. \<not> P x) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   215
  by (simp add: list_all_iff list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   216
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   217
lemma NOT_ALL: "(\<not> list_all P l) = list_ex (\<lambda>x. \<not> P x) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   218
  by (simp add: list_all_iff list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   219
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   220
lemma ALL_MAP: "list_all P (map f l) = list_all (P o f) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   221
  by (simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   222
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   223
lemma ALL_T: "list_all (\<lambda>x. True) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   224
  by (simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   225
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   226
lemma MAP_EQ_ALL2: "list_all2 (\<lambda>x y. f x = f y) l m \<longrightarrow> map f l = map f m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   227
  by (induct l m rule: list_induct2') simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   228
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   229
lemma ALL2_MAP: "list_all2 P (map f l) l = list_all (\<lambda>a. P (f a) a) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   230
  by (induct l) simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   231
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   232
lemma MAP_EQ_DEGEN: "list_all (\<lambda>x. f x = x) l --> map f l = l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   233
  by (induct l) simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   234
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   235
lemma ALL2_AND_RIGHT:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   236
   "list_all2 (\<lambda>x y. P x \<and> Q x y) l m = (list_all P l \<and> list_all2 Q l m)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   237
  by (induct l m rule: list_induct2') auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   238
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   239
lemma ITLIST_EXTRA:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   240
  "foldr f (l @ [a]) b = foldr f l (f a b)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   241
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   242
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   243
lemma ALL_MP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   244
  "list_all (\<lambda>x. P x \<longrightarrow> Q x) l \<and> list_all P l \<longrightarrow> list_all Q l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   245
  by (simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   246
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   247
lemma AND_ALL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   248
  "(list_all P l \<and> list_all Q l) = list_all (\<lambda>x. P x \<and> Q x) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   249
  by (auto simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   250
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   251
lemma EX_IMP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   252
  "(\<forall>x. x\<in>set l \<and> P x \<longrightarrow> Q x) \<and> list_ex P l \<longrightarrow> list_ex Q l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   253
  by (auto simp add: list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   254
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   255
lemma ALL_MEM:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   256
  "(\<forall>x. x\<in>set l \<longrightarrow> P x) = list_all P l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   257
  by (auto simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   258
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   259
lemma EX_MAP:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   260
  "ALL P f l. list_ex P (map f l) = list_ex (P o f) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   261
  by (simp add: list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   262
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   263
lemma EXISTS_EX:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   264
  "\<forall>P l. (EX x. list_ex (P x) l) = list_ex (\<lambda>s. EX x. P x s) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   265
  by (auto simp add: list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   266
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   267
lemma FORALL_ALL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   268
  "\<forall>P l. (\<forall>x. list_all (P x) l) = list_all (\<lambda>s. \<forall>x. P x s) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   269
  by (auto simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   270
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   271
lemma MEM_APPEND: "\<forall>x l1 l2. (x\<in>set (l1 @ l2)) = (x\<in>set l1 \<or> x\<in>set l2)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   272
  by simp
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   273
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   274
lemma MEM_MAP: "\<forall>f y l. (y\<in>set (map f l)) = (EX x. x\<in>set l \<and> y = f x)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   275
  by auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   276
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   277
lemma MEM_FILTER: "\<forall>P l x. (x\<in>set (filter P l)) = (P x \<and> x\<in>set l)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   278
  by auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   279
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   280
lemma EX_MEM: "(EX x. P x \<and> x\<in>set l) = list_ex P l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   281
  by (auto simp add: list_ex_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   282
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   283
lemma ALL2_MAP2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   284
  "list_all2 P (map f l) (map g m) = list_all2 (\<lambda>x y. P (f x) (g y)) l m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   285
  by (simp add: list_all2_map1 list_all2_map2)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   286
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   287
lemma ALL2_ALL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   288
  "list_all2 P l l = list_all (\<lambda>x. P x x) l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   289
  by (induct l) simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   290
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   291
lemma LENGTH_MAP2:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   292
  "length l = length m \<longrightarrow> length (map2 f l m) = length m"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   293
  by (induct l m rule: list_induct2') simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   294
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   295
lemma DEF_set_of_list:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   296
  "set = (SOME sol. sol [] = {} \<and> (\<forall>h t. sol (h # t) = insert h (sol t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   297
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   298
  apply (simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   299
  apply (rule ext)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   300
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   301
  apply simp_all
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   302
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   303
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   304
lemma IN_SET_OF_LIST:
43843
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
   305
  "(x : set l) = (x : set l)"
16f2fd9103bd HOL/Import: Fix errors with _mk_list
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 43785
diff changeset
   306
  by simp
43785
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   307
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   308
lemma DEF_BUTLAST:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   309
  "butlast = (SOME B. B [] = [] \<and> (\<forall>h t. B (h # t) = (if t = [] then [] else h # B t)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   310
  apply (rule some_equality[symmetric])
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   311
  apply auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   312
  apply (rule ext)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   313
  apply (induct_tac x)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   314
  apply auto
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   315
  done
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   316
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   317
lemma MONO_ALL:
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   318
  "(ALL x. P x \<longrightarrow> Q x) \<longrightarrow> list_all P l \<longrightarrow> list_all Q l"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   319
  by (simp add: list_all_iff)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   320
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   321
lemma EL_TL: "l \<noteq> [] \<Longrightarrow> tl l ! x = l ! (x + 1)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   322
  by (induct l) (simp_all)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   323
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   324
(* Assume the same behaviour outside of the usual domain.
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   325
   For HD, LAST, EL it follows from "undefined = SOME _. False".
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   326
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   327
   The definitions of TL and ZIP are different for empty lists.
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   328
 *)
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   329
axioms
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   330
  DEF_HD: "hd = (SOME HD. \<forall>t h. HD (h # t) = h)"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   331
  DEF_LAST: "last =
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   332
    (SOME LAST. \<forall>h t. LAST (h # t) = (if t = [] then h else LAST t))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   333
  DEF_EL: "list_el =
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   334
    (SOME EL. (\<forall>l. EL 0 l = hd l) \<and> (\<forall>n l. EL (Suc n) l = EL n (tl l)))"
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   335
2bd54d4b5f3d HOL/Import for HOLLight revival: Proper theory headers, update generation scripts to SVN version of HOL Light, add some constant maps and compatibility theorems
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   336
end