src/HOL/Import/Importer.thy
author haftmann
Sun, 04 Mar 2012 00:03:21 +0100
changeset 46801 b778cc539601
child 46805 50dbdb9e28ad
permissions -rw-r--r--
actually add "the" Importer theory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46801
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     1
(*  Title:      HOL/Import/Importer.thy
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     2
    Author:     Sebastian Skalberg, TU Muenchen
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     3
*)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     4
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     5
theory Importer
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     6
imports Main
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     7
uses "shuffler.ML" ("import_rews.ML") ("proof_kernel.ML") ("replay.ML") ("import.ML") ("import_syntax.ML")
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     8
begin
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
     9
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    10
setup Shuffler.setup
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    11
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    12
lemma conj_norm [shuffle_rule]: "(A & B ==> PROP C) == ([| A ; B |] ==> PROP C)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    13
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    14
  assume "A & B ==> PROP C" A B
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    15
  thus "PROP C"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    16
    by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    17
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    18
  assume "[| A; B |] ==> PROP C" "A & B"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    19
  thus "PROP C"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    20
    by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    21
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    22
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    23
lemma imp_norm [shuffle_rule]: "(Trueprop (A --> B)) == (A ==> B)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    24
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    25
  assume "A --> B" A
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    26
  thus B ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    27
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    28
  assume "A ==> B"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    29
  thus "A --> B"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    30
    by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    31
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    32
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    33
lemma all_norm [shuffle_rule]: "(Trueprop (ALL x. P x)) == (!!x. P x)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    34
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    35
  fix x
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    36
  assume "ALL x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    37
  thus "P x" ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    38
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    39
  assume "!!x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    40
  thus "ALL x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    41
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    42
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    43
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    44
lemma ex_norm [shuffle_rule]: "(EX x. P x ==> PROP Q) == (!!x. P x ==> PROP Q)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    45
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    46
  fix x
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    47
  assume ex: "EX x. P x ==> PROP Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    48
  assume "P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    49
  hence "EX x. P x" ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    50
  with ex show "PROP Q" .
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    51
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    52
  assume allx: "!!x. P x ==> PROP Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    53
  assume "EX x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    54
  hence p: "P (SOME x. P x)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    55
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    56
  from allx
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    57
  have "P (SOME x. P x) ==> PROP Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    58
    .
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    59
  with p
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    60
  show "PROP Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    61
    by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    62
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    63
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    64
lemma eq_norm [shuffle_rule]: "Trueprop (t = u) == (t == u)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    65
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    66
  assume "t = u"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    67
  thus "t == u" by simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    68
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    69
  assume "t == u"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    70
  thus "t = u"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    71
    by simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    72
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    73
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    74
section {* General Setup *}
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    75
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    76
lemma eq_imp: "P = Q \<Longrightarrow> P \<longrightarrow> Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    77
  by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    78
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    79
lemma HOLallI: "(!! bogus. P bogus) \<Longrightarrow> (ALL bogus. P bogus)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    80
proof -
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    81
  assume "!! bogus. P bogus"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    82
  thus "ALL x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    83
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    84
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    85
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    86
consts
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    87
  ONE_ONE :: "('a => 'b) => bool"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    88
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    89
defs
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    90
  ONE_ONE_DEF: "ONE_ONE f == ALL x y. f x = f y --> x = y"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    91
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    92
lemma ONE_ONE_rew: "ONE_ONE f = inj_on f UNIV"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    93
  by (simp add: ONE_ONE_DEF inj_on_def)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    94
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    95
lemma INFINITY_AX: "EX (f::ind \<Rightarrow> ind). (inj f & ~(surj f))"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    96
proof (rule exI,safe)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    97
  show "inj Suc_Rep"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    98
    by (rule injI) (rule Suc_Rep_inject)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
    99
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   100
  assume "surj Suc_Rep"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   101
  hence "ALL y. EX x. y = Suc_Rep x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   102
    by (simp add: surj_def)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   103
  hence "EX x. Zero_Rep = Suc_Rep x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   104
    by (rule spec)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   105
  thus False
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   106
  proof (rule exE)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   107
    fix x
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   108
    assume "Zero_Rep = Suc_Rep x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   109
    hence "Suc_Rep x = Zero_Rep"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   110
      ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   111
    with Suc_Rep_not_Zero_Rep
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   112
    show False
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   113
      ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   114
  qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   115
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   116
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   117
lemma EXISTS_DEF: "Ex P = P (Eps P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   118
proof (rule iffI)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   119
  assume "Ex P"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   120
  thus "P (Eps P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   121
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   122
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   123
  assume "P (Eps P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   124
  thus "Ex P"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   125
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   126
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   127
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   128
consts
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   129
  TYPE_DEFINITION :: "('a => bool) => ('b => 'a) => bool"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   130
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   131
defs
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   132
  TYPE_DEFINITION: "TYPE_DEFINITION p rep == ((ALL x y. (rep x = rep y) --> (x = y)) & (ALL x. (p x = (EX y. x = rep y))))"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   133
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   134
lemma ex_imp_nonempty: "Ex P ==> EX x. x : (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   135
  by simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   136
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   137
lemma light_ex_imp_nonempty: "P t ==> EX x. x : (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   138
proof -
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   139
  assume "P t"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   140
  hence "EX x. P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   141
    ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   142
  thus ?thesis
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   143
    by (rule ex_imp_nonempty)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   144
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   145
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   146
lemma light_imp_as: "[| Q --> P; P --> Q |] ==> P = Q"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   147
  by blast
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   148
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   149
lemma typedef_hol2hol4:
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   150
  assumes a: "type_definition (Rep::'a=>'b) Abs (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   151
  shows "EX rep. TYPE_DEFINITION P (rep::'a=>'b)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   152
proof -
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   153
  from a
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   154
  have td: "(ALL x. P (Rep x)) & (ALL x. Abs (Rep x) = x) & (ALL y. P y \<longrightarrow> Rep (Abs y) = y)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   155
    by (simp add: type_definition_def)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   156
  have ed: "TYPE_DEFINITION P Rep"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   157
  proof (auto simp add: TYPE_DEFINITION)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   158
    fix x y
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   159
    assume b: "Rep x = Rep y"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   160
    from td have "x = Abs (Rep x)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   161
      by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   162
    also have "Abs (Rep x) = Abs (Rep y)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   163
      by (simp add: b)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   164
    also from td have "Abs (Rep y) = y"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   165
      by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   166
    finally show "x = y" .
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   167
  next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   168
    fix x
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   169
    assume "P x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   170
    with td
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   171
    have "Rep (Abs x) = x"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   172
      by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   173
    hence "x = Rep (Abs x)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   174
      ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   175
    thus "EX y. x = Rep y"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   176
      ..
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   177
  next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   178
    fix y
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   179
    from td
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   180
    show "P (Rep y)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   181
      by auto
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   182
  qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   183
  show ?thesis
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   184
    apply (rule exI [of _ Rep])
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   185
    apply (rule ed)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   186
    .
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   187
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   188
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   189
lemma typedef_hol2hollight:
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   190
  assumes a: "type_definition (Rep::'a=>'b) Abs (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   191
  shows "(Abs (Rep a) = a) & (P r = (Rep (Abs r) = r))"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   192
proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   193
  from a
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   194
  show "Abs (Rep a) = a"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   195
    by (rule type_definition.Rep_inverse)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   196
next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   197
  show "P r = (Rep (Abs r) = r)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   198
  proof
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   199
    assume "P r"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   200
    hence "r \<in> (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   201
      by simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   202
    with a
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   203
    show "Rep (Abs r) = r"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   204
      by (rule type_definition.Abs_inverse)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   205
  next
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   206
    assume ra: "Rep (Abs r) = r"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   207
    from a
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   208
    have "Rep (Abs r) \<in> (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   209
      by (rule type_definition.Rep)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   210
    thus "P r"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   211
      by (simp add: ra)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   212
  qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   213
qed
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   214
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   215
lemma termspec_help: "[| Ex P ; c == Eps P |] ==> P c"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   216
  apply simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   217
  apply (rule someI_ex)
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   218
  .
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   219
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   220
lemma typedef_helper: "EX x. P x \<Longrightarrow> EX x. x \<in> (Collect P)"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   221
  by simp
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   222
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   223
use "import_rews.ML"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   224
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   225
setup importer_setup
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   226
parse_ast_translation smarter_trueprop_parsing
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   227
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   228
use "proof_kernel.ML"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   229
use "replay.ML"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   230
use "import.ML"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   231
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   232
setup Import.setup
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   233
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   234
use "import_syntax.ML"
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   235
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   236
ML {* Importer_Import_Syntax.setup() *}
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   237
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   238
end
b778cc539601 actually add "the" Importer theory
haftmann
parents:
diff changeset
   239