src/Sequents/LK.thy
author blanchet
Fri, 14 Mar 2014 10:08:33 +0100
changeset 56123 a27859b0ef7d
parent 55233 3229614ca9c5
child 59498 50b60f501b05
permissions -rw-r--r--
document the new 'nonexhaustive' option (cf. 52e8f110fec3)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41959
b460124855b8 tuned headers;
wenzelm
parents: 30607
diff changeset
     1
(*  Title:      Sequents/LK.thy
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
     4
7094
6f18ae72a90e a new theory containing just an axiom needed to derive imp_cong
paulson
parents: 6456
diff changeset
     5
Axiom to express monotonicity (a variant of the deduction theorem).  Makes the
6f18ae72a90e a new theory containing just an axiom needed to derive imp_cong
paulson
parents: 6456
diff changeset
     6
link between |- and ==>, needed for instance to prove imp_cong.
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
     7
7117
37eccadf6b8a congruence rule for |-
paulson
parents: 7094
diff changeset
     8
Axiom left_cong allows the simplifier to use left-side formulas.  Ideally it
37eccadf6b8a congruence rule for |-
paulson
parents: 7094
diff changeset
     9
should be derived from lower-level axioms.
37eccadf6b8a congruence rule for |-
paulson
parents: 7094
diff changeset
    10
7094
6f18ae72a90e a new theory containing just an axiom needed to derive imp_cong
paulson
parents: 6456
diff changeset
    11
CANNOT be added to LK0.thy because modal logic is built upon it, and
6f18ae72a90e a new theory containing just an axiom needed to derive imp_cong
paulson
parents: 6456
diff changeset
    12
various modal rules would become inconsistent.
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    13
*)
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    14
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    15
theory LK
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    16
imports LK0
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    17
begin
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    18
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    19
axiomatization where
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    20
  monotonic:  "($H |- P ==> $H |- Q) ==> $H, P |- Q" and
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    21
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    22
  left_cong:  "[| P == P';  |- P' ==> ($H |- $F) == ($H' |- $F') |]
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    23
               ==> (P, $H |- $F) == (P', $H' |- $F')"
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    24
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    25
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    26
subsection {* Rewrite rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    27
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    28
lemma conj_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    29
  "|- P & True <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    30
  "|- True & P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    31
  "|- P & False <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    32
  "|- False & P <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    33
  "|- P & P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    34
  "|- P & P & Q <-> P & Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    35
  "|- P & ~P <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    36
  "|- ~P & P <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    37
  "|- (P & Q) & R <-> P & (Q & R)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    38
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    39
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    40
lemma disj_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    41
  "|- P | True <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    42
  "|- True | P <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    43
  "|- P | False <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    44
  "|- False | P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    45
  "|- P | P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    46
  "|- P | P | Q <-> P | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    47
  "|- (P | Q) | R <-> P | (Q | R)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    48
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    49
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    50
lemma not_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    51
  "|- ~ False <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    52
  "|- ~ True <-> False"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    53
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    54
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    55
lemma imp_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    56
  "|- (P --> False) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    57
  "|- (P --> True) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    58
  "|- (False --> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    59
  "|- (True --> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    60
  "|- (P --> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    61
  "|- (P --> ~P) <-> ~P"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    62
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    63
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    64
lemma iff_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    65
  "|- (True <-> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    66
  "|- (P <-> True) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    67
  "|- (P <-> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    68
  "|- (False <-> P) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    69
  "|- (P <-> False) <-> ~P"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    70
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    71
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    72
lemma quant_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    73
  "!!P. |- (ALL x. P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    74
  "!!P. |- (ALL x. x=t --> P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    75
  "!!P. |- (ALL x. t=x --> P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    76
  "!!P. |- (EX x. P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    77
  "!!P. |- (EX x. x=t & P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    78
  "!!P. |- (EX x. t=x & P(x)) <-> P(t)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    79
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    80
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    81
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    82
subsection {* Miniscoping: pushing quantifiers in *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    83
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    84
text {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    85
  We do NOT distribute of ALL over &, or dually that of EX over |
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    86
  Baaz and Leitsch, On Skolemization and Proof Complexity (1994)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    87
  show that this step can increase proof length!
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    88
*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    89
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    90
text {*existential miniscoping*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    91
lemma ex_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    92
  "!!P Q. |- (EX x. P(x) & Q) <-> (EX x. P(x)) & Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    93
  "!!P Q. |- (EX x. P & Q(x)) <-> P & (EX x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    94
  "!!P Q. |- (EX x. P(x) | Q) <-> (EX x. P(x)) | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    95
  "!!P Q. |- (EX x. P | Q(x)) <-> P | (EX x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    96
  "!!P Q. |- (EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    97
  "!!P Q. |- (EX x. P --> Q(x)) <-> P --> (EX x. Q(x))"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
    98
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    99
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   100
text {*universal miniscoping*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   101
lemma all_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   102
  "!!P Q. |- (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   103
  "!!P Q. |- (ALL x. P & Q(x)) <-> P & (ALL x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   104
  "!!P Q. |- (ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   105
  "!!P Q. |- (ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   106
  "!!P Q. |- (ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   107
  "!!P Q. |- (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   108
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   109
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   110
text {*These are NOT supplied by default!*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   111
lemma distrib_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   112
  "|- P & (Q | R) <-> P&Q | P&R"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   113
  "|- (Q | R) & P <-> Q&P | R&P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   114
  "|- (P | Q --> R) <-> (P --> R) & (Q --> R)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   115
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   116
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   117
lemma P_iff_F: "|- ~P ==> |- (P <-> False)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   118
  apply (erule thinR [THEN cut])
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   119
  apply fast
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   120
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   121
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 42795
diff changeset
   122
lemmas iff_reflection_F = P_iff_F [THEN iff_reflection]
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   123
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   124
lemma P_iff_T: "|- P ==> |- (P <-> True)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   125
  apply (erule thinR [THEN cut])
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   126
  apply fast
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   127
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   128
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 42795
diff changeset
   129
lemmas iff_reflection_T = P_iff_T [THEN iff_reflection]
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   130
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   131
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   132
lemma LK_extra_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   133
  "|- P | ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   134
  "|- ~P | P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   135
  "|- ~ ~ P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   136
  "|- (~P --> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   137
  "|- (~P <-> ~Q) <-> (P<->Q)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   138
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   139
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   140
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   141
subsection {* Named rewrite rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   142
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   143
lemma conj_commute: "|- P&Q <-> Q&P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   144
  and conj_left_commute: "|- P&(Q&R) <-> Q&(P&R)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   145
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   146
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   147
lemmas conj_comms = conj_commute conj_left_commute
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   148
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   149
lemma disj_commute: "|- P|Q <-> Q|P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   150
  and disj_left_commute: "|- P|(Q|R) <-> Q|(P|R)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   151
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   152
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   153
lemmas disj_comms = disj_commute disj_left_commute
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   154
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   155
lemma conj_disj_distribL: "|- P&(Q|R) <-> (P&Q | P&R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   156
  and conj_disj_distribR: "|- (P|Q)&R <-> (P&R | Q&R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   157
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   158
  and disj_conj_distribL: "|- P|(Q&R) <-> (P|Q) & (P|R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   159
  and disj_conj_distribR: "|- (P&Q)|R <-> (P|R) & (Q|R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   160
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   161
  and imp_conj_distrib: "|- (P --> (Q&R)) <-> (P-->Q) & (P-->R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   162
  and imp_conj: "|- ((P&Q)-->R)   <-> (P --> (Q --> R))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   163
  and imp_disj: "|- (P|Q --> R)   <-> (P-->R) & (Q-->R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   164
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   165
  and imp_disj1: "|- (P-->Q) | R <-> (P-->Q | R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   166
  and imp_disj2: "|- Q | (P-->R) <-> (P-->Q | R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   167
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   168
  and de_Morgan_disj: "|- (~(P | Q)) <-> (~P & ~Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   169
  and de_Morgan_conj: "|- (~(P & Q)) <-> (~P | ~Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   170
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   171
  and not_iff: "|- ~(P <-> Q) <-> (P <-> ~Q)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   172
  by (fast add!: subst)+
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   173
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   174
lemma imp_cong:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   175
  assumes p1: "|- P <-> P'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   176
    and p2: "|- P' ==> |- Q <-> Q'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   177
  shows "|- (P-->Q) <-> (P'-->Q')"
55233
3229614ca9c5 method_setup "lem";
wenzelm
parents: 55230
diff changeset
   178
  apply (lem p1)
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   179
  apply safe
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   180
   apply (tactic {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   181
     REPEAT (rtac @{thm cut} 1 THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   182
       DEPTH_SOLVE_1
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   183
         (resolve_tac [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   184
           Cla.safe_tac @{context} 1) *})
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   185
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   186
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   187
lemma conj_cong:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   188
  assumes p1: "|- P <-> P'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   189
    and p2: "|- P' ==> |- Q <-> Q'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   190
  shows "|- (P&Q) <-> (P'&Q')"
55233
3229614ca9c5 method_setup "lem";
wenzelm
parents: 55230
diff changeset
   191
  apply (lem p1)
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   192
  apply safe
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   193
   apply (tactic {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   194
     REPEAT (rtac @{thm cut} 1 THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   195
       DEPTH_SOLVE_1
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   196
         (resolve_tac [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   197
           Cla.safe_tac @{context} 1) *})
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   198
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   199
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   200
lemma eq_sym_conv: "|- (x=y) <-> (y=x)"
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   201
  by (fast add!: subst)
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   202
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 45602
diff changeset
   203
ML_file "simpdata.ML"
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 48891
diff changeset
   204
setup {* map_theory_simpset (put_simpset LK_ss) *}
55230
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   205
setup {* Simplifier.method_setup [] *}
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
   206
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   207
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   208
text {* To create substition rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   209
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   210
lemma eq_imp_subst: "|- a=b ==> $H, A(a), $G |- $E, A(b), $F"
55230
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   211
  by simp
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   212
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   213
lemma split_if: "|- P(if Q then x else y) <-> ((Q --> P(x)) & (~Q --> P(y)))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   214
  apply (rule_tac P = Q in cut)
55230
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   215
   prefer 2
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   216
   apply (simp add: if_P)
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   217
  apply (rule_tac P = "~Q" in cut)
55230
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   218
   prefer 2
cb5ef74b32f9 proper Simplifier method setup;
wenzelm
parents: 55228
diff changeset
   219
   apply (simp add: if_not_P)
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   220
  apply fast
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   221
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   222
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   223
lemma if_cancel: "|- (if P then x else x) = x"
55233
3229614ca9c5 method_setup "lem";
wenzelm
parents: 55230
diff changeset
   224
  apply (lem split_if)
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   225
  apply fast
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   226
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   227
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   228
lemma if_eq_cancel: "|- (if x=y then y else x) = x"
55233
3229614ca9c5 method_setup "lem";
wenzelm
parents: 55230
diff changeset
   229
  apply (lem split_if)
55228
901a6696cdd8 misc tuning and modernization;
wenzelm
parents: 51717
diff changeset
   230
  apply safe
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   231
  apply (rule symL)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   232
  apply (rule basic)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   233
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   234
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
   235
end