src/Sequents/LK0.thy
author wenzelm
Sat, 07 Apr 2012 16:41:59 +0200
changeset 47389 e8552cba702d
parent 45602 2a858377c3d2
child 51309 473303ef6e34
permissions -rw-r--r--
explicit checks stable_finished_theory/stable_command allow parallel asynchronous command transactions; tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41959
b460124855b8 tuned headers;
wenzelm
parents: 39159
diff changeset
     1
(*  Title:      Sequents/LK0.thy
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     4
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     5
There may be printing problems if a seqent is in expanded normal form
35113
1a0c129bb2e0 modernized translations;
wenzelm
parents: 30549
diff changeset
     6
(eta-expanded, beta-contracted).
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     7
*)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
     8
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
     9
header {* Classical First-Order Sequent Calculus *}
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    10
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    11
theory LK0
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    12
imports Sequents
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    13
begin
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    14
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    15
classes "term"
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35417
diff changeset
    16
default_sort "term"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    17
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    18
consts
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    19
21524
7843e2fd14a9 updated (binder) syntax/notation;
wenzelm
parents: 21428
diff changeset
    20
  Trueprop       :: "two_seqi"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    21
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    22
  True         :: o
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    23
  False        :: o
22894
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    24
  equal        :: "['a,'a] => o"     (infixl "=" 50)
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    25
  Not          :: "o => o"           ("~ _" [40] 40)
22894
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    26
  conj         :: "[o,o] => o"       (infixr "&" 35)
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    27
  disj         :: "[o,o] => o"       (infixr "|" 30)
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    28
  imp          :: "[o,o] => o"       (infixr "-->" 25)
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    29
  iff          :: "[o,o] => o"       (infixr "<->" 25)
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    30
  The          :: "('a => o) => 'a"  (binder "THE " 10)
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    31
  All          :: "('a => o) => o"   (binder "ALL " 10)
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    32
  Ex           :: "('a => o) => o"   (binder "EX " 10)
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    33
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    34
syntax
35113
1a0c129bb2e0 modernized translations;
wenzelm
parents: 30549
diff changeset
    35
 "_Trueprop"    :: "two_seqe" ("((_)/ |- (_))" [6,6] 5)
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    36
35113
1a0c129bb2e0 modernized translations;
wenzelm
parents: 30549
diff changeset
    37
parse_translation {* [(@{syntax_const "_Trueprop"}, two_seq_tr @{const_syntax Trueprop})] *}
1a0c129bb2e0 modernized translations;
wenzelm
parents: 30549
diff changeset
    38
print_translation {* [(@{const_syntax Trueprop}, two_seq_tr' @{syntax_const "_Trueprop"})] *}
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    39
22894
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    40
abbreviation
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    41
  not_equal  (infixl "~=" 50) where
619b270607ac eliminated unnamed infixes;
wenzelm
parents: 21588
diff changeset
    42
  "x ~= y == ~ (x = y)"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    43
35355
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    44
notation (xsymbols)
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    45
  Not  ("\<not> _" [40] 40) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    46
  conj  (infixr "\<and>" 35) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    47
  disj  (infixr "\<or>" 30) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    48
  imp  (infixr "\<longrightarrow>" 25) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    49
  iff  (infixr "\<longleftrightarrow>" 25) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    50
  All  (binder "\<forall>" 10) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    51
  Ex  (binder "\<exists>" 10) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    52
  not_equal  (infixl "\<noteq>" 50)
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    53
35355
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    54
notation (HTML output)
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    55
  Not  ("\<not> _" [40] 40) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    56
  conj  (infixr "\<and>" 35) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    57
  disj  (infixr "\<or>" 30) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    58
  All  (binder "\<forall>" 10) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    59
  Ex  (binder "\<exists>" 10) and
613e133966ea modernized syntax declarations, and make them actually work with authentic syntax;
wenzelm
parents: 35113
diff changeset
    60
  not_equal  (infixl "\<noteq>" 50)
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    61
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    62
axioms
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    63
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    64
  (*Structural rules: contraction, thinning, exchange [Soren Heilmann] *)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    65
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    66
  contRS: "$H |- $E, $S, $S, $F ==> $H |- $E, $S, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    67
  contLS: "$H, $S, $S, $G |- $E ==> $H, $S, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    68
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    69
  thinRS: "$H |- $E, $F ==> $H |- $E, $S, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    70
  thinLS: "$H, $G |- $E ==> $H, $S, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    71
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    72
  exchRS: "$H |- $E, $R, $S, $F ==> $H |- $E, $S, $R, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    73
  exchLS: "$H, $R, $S, $G |- $E ==> $H, $S, $R, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    74
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    75
  cut:   "[| $H |- $E, P;  $H, P |- $E |] ==> $H |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    76
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    77
  (*Propositional rules*)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    78
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    79
  basic: "$H, P, $G |- $E, P, $F"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    80
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    81
  conjR: "[| $H|- $E, P, $F;  $H|- $E, Q, $F |] ==> $H|- $E, P&Q, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    82
  conjL: "$H, P, Q, $G |- $E ==> $H, P & Q, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    83
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    84
  disjR: "$H |- $E, P, Q, $F ==> $H |- $E, P|Q, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    85
  disjL: "[| $H, P, $G |- $E;  $H, Q, $G |- $E |] ==> $H, P|Q, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    86
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    87
  impR:  "$H, P |- $E, Q, $F ==> $H |- $E, P-->Q, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    88
  impL:  "[| $H,$G |- $E,P;  $H, Q, $G |- $E |] ==> $H, P-->Q, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    89
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    90
  notR:  "$H, P |- $E, $F ==> $H |- $E, ~P, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    91
  notL:  "$H, $G |- $E, P ==> $H, ~P, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    92
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    93
  FalseL: "$H, False, $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    94
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    95
  True_def: "True == False-->False"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
    96
  iff_def:  "P<->Q == (P-->Q) & (Q-->P)"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    97
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    98
  (*Quantifiers*)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
    99
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   100
  allR:  "(!!x.$H |- $E, P(x), $F) ==> $H |- $E, ALL x. P(x), $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   101
  allL:  "$H, P(x), $G, ALL x. P(x) |- $E ==> $H, ALL x. P(x), $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   102
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   103
  exR:   "$H |- $E, P(x), $F, EX x. P(x) ==> $H |- $E, EX x. P(x), $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   104
  exL:   "(!!x.$H, P(x), $G |- $E) ==> $H, EX x. P(x), $G |- $E"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   105
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   106
  (*Equality*)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   107
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   108
  refl:  "$H |- $E, a=a, $F"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   109
  subst: "$H(a), $G(a) |- $E(a) ==> $H(b), a=b, $G(b) |- $E(b)"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   110
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   111
  (* Reflection *)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   112
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   113
  eq_reflection:  "|- x=y ==> (x==y)"
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   114
  iff_reflection: "|- P<->Q ==> (P==Q)"
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   115
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   116
  (*Descriptions*)
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   117
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 16019
diff changeset
   118
  The: "[| $H |- $E, P(a), $F;  !!x.$H, P(x) |- $E, x=a, $F |] ==>
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   119
          $H |- $E, P(THE x. P(x)), $F"
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   120
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35113
diff changeset
   121
definition If :: "[o, 'a, 'a] => 'a" ("(if (_)/ then (_)/ else (_))" 10) where 
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   122
   "If(P,x,y) == THE z::'a. (P --> z=x) & (~P --> z=y)"
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   123
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   124
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   125
(** Structural Rules on formulas **)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   126
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   127
(*contraction*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   128
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   129
lemma contR: "$H |- $E, P, P, $F ==> $H |- $E, P, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   130
  by (rule contRS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   131
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   132
lemma contL: "$H, P, P, $G |- $E ==> $H, P, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   133
  by (rule contLS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   134
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   135
(*thinning*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   136
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   137
lemma thinR: "$H |- $E, $F ==> $H |- $E, P, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   138
  by (rule thinRS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   139
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   140
lemma thinL: "$H, $G |- $E ==> $H, P, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   141
  by (rule thinLS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   142
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   143
(*exchange*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   144
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   145
lemma exchR: "$H |- $E, Q, P, $F ==> $H |- $E, P, Q, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   146
  by (rule exchRS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   147
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   148
lemma exchL: "$H, Q, P, $G |- $E ==> $H, P, Q, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   149
  by (rule exchLS)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   150
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   151
ML {*
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   152
(*Cut and thin, replacing the right-side formula*)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27146
diff changeset
   153
fun cutR_tac ctxt s i =
27239
f2f42f9fa09d pervasive RuleInsts;
wenzelm
parents: 27208
diff changeset
   154
  res_inst_tac ctxt [(("P", 0), s) ] @{thm cut} i  THEN  rtac @{thm thinR} i
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   155
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   156
(*Cut and thin, replacing the left-side formula*)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27146
diff changeset
   157
fun cutL_tac ctxt s i =
27239
f2f42f9fa09d pervasive RuleInsts;
wenzelm
parents: 27208
diff changeset
   158
  res_inst_tac ctxt [(("P", 0), s)] @{thm cut} i  THEN  rtac @{thm thinL} (i+1)
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   159
*}
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   160
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   161
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   162
(** If-and-only-if rules **)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   163
lemma iffR: 
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   164
    "[| $H,P |- $E,Q,$F;  $H,Q |- $E,P,$F |] ==> $H |- $E, P <-> Q, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   165
  apply (unfold iff_def)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   166
  apply (assumption | rule conjR impR)+
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   167
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   168
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   169
lemma iffL: 
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   170
    "[| $H,$G |- $E,P,Q;  $H,Q,P,$G |- $E |] ==> $H, P <-> Q, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   171
  apply (unfold iff_def)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   172
  apply (assumption | rule conjL impL basic)+
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   173
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   174
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   175
lemma iff_refl: "$H |- $E, (P <-> P), $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   176
  apply (rule iffR basic)+
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   177
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   178
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   179
lemma TrueR: "$H |- $E, True, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   180
  apply (unfold True_def)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   181
  apply (rule impR)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   182
  apply (rule basic)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   183
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   184
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   185
(*Descriptions*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   186
lemma the_equality:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   187
  assumes p1: "$H |- $E, P(a), $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   188
    and p2: "!!x. $H, P(x) |- $E, x=a, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   189
  shows "$H |- $E, (THE x. P(x)) = a, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   190
  apply (rule cut)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   191
   apply (rule_tac [2] p2)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   192
  apply (rule The, rule thinR, rule exchRS, rule p1)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   193
  apply (rule thinR, rule exchRS, rule p2)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   194
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   195
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   196
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   197
(** Weakened quantifier rules.  Incomplete, they let the search terminate.**)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   198
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   199
lemma allL_thin: "$H, P(x), $G |- $E ==> $H, ALL x. P(x), $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   200
  apply (rule allL)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   201
  apply (erule thinL)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   202
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   203
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   204
lemma exR_thin: "$H |- $E, P(x), $F ==> $H |- $E, EX x. P(x), $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   205
  apply (rule exR)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   206
  apply (erule thinR)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   207
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   208
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   209
(*The rules of LK*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   210
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   211
ML {*
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   212
val prop_pack = empty_pack add_safes
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   213
                [@{thm basic}, @{thm refl}, @{thm TrueR}, @{thm FalseL},
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   214
                 @{thm conjL}, @{thm conjR}, @{thm disjL}, @{thm disjR}, @{thm impL}, @{thm impR},
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   215
                 @{thm notL}, @{thm notR}, @{thm iffL}, @{thm iffR}];
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   216
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   217
val LK_pack = prop_pack add_safes   [@{thm allR}, @{thm exL}]
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   218
                        add_unsafes [@{thm allL_thin}, @{thm exR_thin}, @{thm the_equality}];
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   219
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   220
val LK_dup_pack = prop_pack add_safes   [@{thm allR}, @{thm exL}]
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   221
                            add_unsafes [@{thm allL}, @{thm exR}, @{thm the_equality}];
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   222
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   223
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   224
fun lemma_tac th i =
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   225
    rtac (@{thm thinR} RS @{thm cut}) i THEN REPEAT (rtac @{thm thinL} i) THEN rtac th i;
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   226
*}
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   227
42814
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 41959
diff changeset
   228
method_setup fast_prop = {* Scan.succeed (K (SIMPLE_METHOD' (fast_tac prop_pack))) *}
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 41959
diff changeset
   229
method_setup fast = {* Scan.succeed (K (SIMPLE_METHOD' (fast_tac LK_pack))) *}
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 41959
diff changeset
   230
method_setup fast_dup = {* Scan.succeed (K (SIMPLE_METHOD' (fast_tac LK_dup_pack))) *}
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 41959
diff changeset
   231
method_setup best = {* Scan.succeed (K (SIMPLE_METHOD' (best_tac LK_pack))) *}
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 41959
diff changeset
   232
method_setup best_dup = {* Scan.succeed (K (SIMPLE_METHOD' (best_tac LK_dup_pack))) *}
7093
b2ee0e5d1a7f renamed theory LK to LK0
paulson
parents:
diff changeset
   233
7118
ee384c7b7416 adding missing declarations for the <<...>> notation
paulson
parents: 7093
diff changeset
   234
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   235
lemma mp_R:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   236
  assumes major: "$H |- $E, $F, P --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   237
    and minor: "$H |- $E, $F, P"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   238
  shows "$H |- $E, Q, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   239
  apply (rule thinRS [THEN cut], rule major)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   240
  apply (tactic "step_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   241
  apply (rule thinR, rule minor)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   242
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   243
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   244
lemma mp_L:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   245
  assumes major: "$H, $G |- $E, P --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   246
    and minor: "$H, $G, Q |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   247
  shows "$H, P, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   248
  apply (rule thinL [THEN cut], rule major)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   249
  apply (tactic "step_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   250
  apply (rule thinL, rule minor)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   251
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   252
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   253
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   254
(** Two rules to generate left- and right- rules from implications **)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   255
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   256
lemma R_of_imp:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   257
  assumes major: "|- P --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   258
    and minor: "$H |- $E, $F, P"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   259
  shows "$H |- $E, Q, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   260
  apply (rule mp_R)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   261
   apply (rule_tac [2] minor)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   262
  apply (rule thinRS, rule major [THEN thinLS])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   263
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   264
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   265
lemma L_of_imp:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   266
  assumes major: "|- P --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   267
    and minor: "$H, $G, Q |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   268
  shows "$H, P, $G |- $E"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   269
  apply (rule mp_L)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   270
   apply (rule_tac [2] minor)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   271
  apply (rule thinRS, rule major [THEN thinLS])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   272
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   273
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   274
(*Can be used to create implications in a subgoal*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   275
lemma backwards_impR:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   276
  assumes prem: "$H, $G |- $E, $F, P --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   277
  shows "$H, P, $G |- $E, Q, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   278
  apply (rule mp_L)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   279
   apply (rule_tac [2] basic)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   280
  apply (rule thinR, rule prem)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   281
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   282
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   283
lemma conjunct1: "|-P&Q ==> |-P"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   284
  apply (erule thinR [THEN cut])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   285
  apply fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   286
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   287
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   288
lemma conjunct2: "|-P&Q ==> |-Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   289
  apply (erule thinR [THEN cut])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   290
  apply fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   291
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   292
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   293
lemma spec: "|- (ALL x. P(x)) ==> |- P(x)"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   294
  apply (erule thinR [THEN cut])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   295
  apply fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   296
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   297
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   298
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   299
(** Equality **)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   300
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   301
lemma sym: "|- a=b --> b=a"
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   302
  by (tactic {* safe_tac (LK_pack add_safes [@{thm subst}]) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   303
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   304
lemma trans: "|- a=b --> b=c --> a=c"
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38499
diff changeset
   305
  by (tactic {* safe_tac (LK_pack add_safes [@{thm subst}]) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   306
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   307
(* Symmetry of equality in hypotheses *)
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 42814
diff changeset
   308
lemmas symL = sym [THEN L_of_imp]
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   309
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   310
(* Symmetry of equality in hypotheses *)
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 42814
diff changeset
   311
lemmas symR = sym [THEN R_of_imp]
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   312
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   313
lemma transR: "[| $H|- $E, $F, a=b;  $H|- $E, $F, b=c |] ==> $H|- $E, a=c, $F"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   314
  by (rule trans [THEN R_of_imp, THEN mp_R])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   315
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   316
(* Two theorms for rewriting only one instance of a definition:
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   317
   the first for definitions of formulae and the second for terms *)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   318
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   319
lemma def_imp_iff: "(A == B) ==> |- A <-> B"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   320
  apply unfold
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   321
  apply (rule iff_refl)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   322
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   323
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   324
lemma meta_eq_to_obj_eq: "(A == B) ==> |- A = B"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   325
  apply unfold
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   326
  apply (rule refl)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   327
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   328
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   329
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   330
(** if-then-else rules **)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   331
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   332
lemma if_True: "|- (if True then x else y) = x"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   333
  unfolding If_def by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   334
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   335
lemma if_False: "|- (if False then x else y) = y"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   336
  unfolding If_def by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   337
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   338
lemma if_P: "|- P ==> |- (if P then x else y) = x"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   339
  apply (unfold If_def)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   340
  apply (erule thinR [THEN cut])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   341
  apply fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   342
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   343
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   344
lemma if_not_P: "|- ~P ==> |- (if P then x else y) = y";
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   345
  apply (unfold If_def)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   346
  apply (erule thinR [THEN cut])
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   347
  apply fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   348
  done
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   349
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents: 17481
diff changeset
   350
end