src/Sequents/LK.thy
author bulwahn
Thu, 07 Jul 2011 23:33:14 +0200
changeset 43704 47b0be18ccbe
parent 42795 66fcc9882784
child 45602 2a858377c3d2
permissions -rw-r--r--
floor and ceiling definitions are not code equations -- this enables trivial evaluation of floor and ceiling
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
uses ("simpdata.ML")
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    18
begin
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    19
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    20
axiomatization where
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    21
  monotonic:  "($H |- P ==> $H |- Q) ==> $H, P |- Q" and
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    22
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    23
  left_cong:  "[| P == P';  |- P' ==> ($H |- $F) == ($H' |- $F') |]
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
    24
               ==> (P, $H |- $F) == (P', $H' |- $F')"
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
    25
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    26
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    27
subsection {* Rewrite rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    28
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    29
lemma conj_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    30
  "|- P & True <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    31
  "|- True & P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    32
  "|- P & False <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    33
  "|- False & P <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    34
  "|- P & P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    35
  "|- P & P & Q <-> P & Q"
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 & P <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    38
  "|- (P & Q) & R <-> P & (Q & R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    39
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    40
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    41
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    42
lemma disj_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    43
  "|- P | True <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    44
  "|- True | P <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    45
  "|- P | False <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    46
  "|- False | P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    47
  "|- P | P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    48
  "|- P | P | Q <-> P | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    49
  "|- (P | Q) | R <-> P | (Q | R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    50
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    51
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    52
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    53
lemma not_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    54
  "|- ~ False <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    55
  "|- ~ True <-> False"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    56
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    57
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    58
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    59
lemma imp_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    60
  "|- (P --> False) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    61
  "|- (P --> True) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    62
  "|- (False --> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    63
  "|- (True --> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    64
  "|- (P --> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    65
  "|- (P --> ~P) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    66
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    67
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    68
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    69
lemma iff_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    70
  "|- (True <-> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    71
  "|- (P <-> True) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    72
  "|- (P <-> P) <-> True"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    73
  "|- (False <-> P) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    74
  "|- (P <-> False) <-> ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    75
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    76
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    77
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    78
lemma quant_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    79
  "!!P. |- (ALL x. P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    80
  "!!P. |- (ALL x. x=t --> P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    81
  "!!P. |- (ALL x. t=x --> P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    82
  "!!P. |- (EX x. P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    83
  "!!P. |- (EX x. x=t & P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    84
  "!!P. |- (EX x. t=x & P(x)) <-> P(t)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    85
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    86
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    87
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
subsection {* Miniscoping: pushing quantifiers in *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    90
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    91
text {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    92
  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
    93
  Baaz and Leitsch, On Skolemization and Proof Complexity (1994)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    94
  show that this step can increase proof length!
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    95
*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    96
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    97
text {*existential miniscoping*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    98
lemma ex_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
    99
  "!!P Q. |- (EX x. P(x) & Q) <-> (EX x. P(x)) & Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   100
  "!!P Q. |- (EX x. P & Q(x)) <-> P & (EX x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   101
  "!!P Q. |- (EX x. P(x) | Q) <-> (EX x. P(x)) | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   102
  "!!P Q. |- (EX x. P | Q(x)) <-> P | (EX x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   103
  "!!P Q. |- (EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   104
  "!!P Q. |- (EX x. P --> Q(x)) <-> P --> (EX x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   105
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   106
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   107
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   108
text {*universal miniscoping*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   109
lemma all_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   110
  "!!P Q. |- (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   111
  "!!P Q. |- (ALL x. P & Q(x)) <-> P & (ALL x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   112
  "!!P Q. |- (ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   113
  "!!P Q. |- (ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   114
  "!!P Q. |- (ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   115
  "!!P Q. |- (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   116
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   117
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   118
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   119
text {*These are NOT supplied by default!*}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   120
lemma distrib_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   121
  "|- P & (Q | R) <-> P&Q | P&R"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   122
  "|- (Q | R) & P <-> Q&P | R&P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   123
  "|- (P | Q --> R) <-> (P --> R) & (Q --> R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   124
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   125
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   126
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   127
lemma P_iff_F: "|- ~P ==> |- (P <-> False)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   128
  apply (erule thinR [THEN cut])
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   129
  apply (tactic {* fast_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   130
  done
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
lemmas iff_reflection_F = P_iff_F [THEN iff_reflection, standard]
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   133
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   134
lemma P_iff_T: "|- P ==> |- (P <-> True)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   135
  apply (erule thinR [THEN cut])
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   136
  apply (tactic {* fast_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   137
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   138
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   139
lemmas iff_reflection_T = P_iff_T [THEN iff_reflection, standard]
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
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   142
lemma LK_extra_simps:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   143
  "|- P | ~P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   144
  "|- ~P | P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   145
  "|- ~ ~ P <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   146
  "|- (~P --> P) <-> P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   147
  "|- (~P <-> ~Q) <-> (P<->Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   148
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   149
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   150
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   151
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   152
subsection {* Named rewrite rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   153
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   154
lemma conj_commute: "|- P&Q <-> Q&P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   155
  and conj_left_commute: "|- P&(Q&R) <-> Q&(P&R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   156
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   157
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   158
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   159
lemmas conj_comms = conj_commute conj_left_commute
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
lemma disj_commute: "|- P|Q <-> Q|P"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   162
  and disj_left_commute: "|- P|(Q|R) <-> Q|(P|R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   163
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   164
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   165
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   166
lemmas disj_comms = disj_commute disj_left_commute
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
lemma conj_disj_distribL: "|- P&(Q|R) <-> (P&Q | P&R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   169
  and conj_disj_distribR: "|- (P|Q)&R <-> (P&R | Q&R)"
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 disj_conj_distribL: "|- P|(Q&R) <-> (P|Q) & (P|R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   172
  and disj_conj_distribR: "|- (P&Q)|R <-> (P|R) & (Q|R)"
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
  and imp_conj_distrib: "|- (P --> (Q&R)) <-> (P-->Q) & (P-->R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   175
  and imp_conj: "|- ((P&Q)-->R)   <-> (P --> (Q --> R))"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   176
  and imp_disj: "|- (P|Q --> R)   <-> (P-->R) & (Q-->R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   177
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   178
  and imp_disj1: "|- (P-->Q) | R <-> (P-->Q | R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   179
  and imp_disj2: "|- Q | (P-->R) <-> (P-->Q | R)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   180
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   181
  and de_Morgan_disj: "|- (~(P | Q)) <-> (~P & ~Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   182
  and de_Morgan_conj: "|- (~(P & Q)) <-> (~P | ~Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   183
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   184
  and not_iff: "|- ~(P <-> Q) <-> (P <-> ~Q)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   185
  apply (tactic {* ALLGOALS (fast_tac (LK_pack add_safes @{thms subst})) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   186
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   187
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   188
lemma imp_cong:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   189
  assumes p1: "|- P <-> P'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   190
    and p2: "|- P' ==> |- Q <-> Q'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   191
  shows "|- (P-->Q) <-> (P'-->Q')"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   192
  apply (tactic {* lemma_tac @{thm p1} 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   193
  apply (tactic {* safe_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   194
   apply (tactic {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   195
     REPEAT (rtac @{thm cut} 1 THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   196
       DEPTH_SOLVE_1
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   197
         (resolve_tac [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   198
           safe_tac LK_pack 1) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   199
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   200
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   201
lemma conj_cong:
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   202
  assumes p1: "|- P <-> P'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   203
    and p2: "|- P' ==> |- Q <-> Q'"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   204
  shows "|- (P&Q) <-> (P'&Q')"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   205
  apply (tactic {* lemma_tac @{thm p1} 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   206
  apply (tactic {* safe_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   207
   apply (tactic {*
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   208
     REPEAT (rtac @{thm cut} 1 THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   209
       DEPTH_SOLVE_1
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   210
         (resolve_tac [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   211
           safe_tac LK_pack 1) *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   212
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   213
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   214
lemma eq_sym_conv: "|- (x=y) <-> (y=x)"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   215
  apply (tactic {* fast_tac (LK_pack add_safes @{thms subst}) 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   216
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   217
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
   218
use "simpdata.ML"
42795
66fcc9882784 clarified map_simpset versus Simplifier.map_simpset_global;
wenzelm
parents: 41959
diff changeset
   219
setup {* Simplifier.map_simpset_global (K LK_ss) *}
17481
75166ebb619b converted to Isar theory format;
wenzelm
parents: 7117
diff changeset
   220
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   221
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   222
text {* To create substition rules *}
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   223
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   224
lemma eq_imp_subst: "|- a=b ==> $H, A(a), $G |- $E, A(b), $F"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   225
  apply (tactic {* asm_simp_tac LK_basic_ss 1 *})
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 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
   229
  apply (rule_tac P = Q in cut)
30607
c3d1590debd8 eliminated global SIMPSET, CLASET etc. -- refer to explicit context;
wenzelm
parents: 28952
diff changeset
   230
   apply (tactic {* simp_tac (@{simpset} addsimps @{thms if_P}) 2 *})
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   231
  apply (rule_tac P = "~Q" in cut)
30607
c3d1590debd8 eliminated global SIMPSET, CLASET etc. -- refer to explicit context;
wenzelm
parents: 28952
diff changeset
   232
   apply (tactic {* simp_tac (@{simpset} addsimps @{thms if_not_P}) 2 *})
27149
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   233
  apply (tactic {* fast_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   234
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   235
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   236
lemma if_cancel: "|- (if P then x else x) = x"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   237
  apply (tactic {* lemma_tac @{thm split_if} 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   238
  apply (tactic {* fast_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   239
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   240
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   241
lemma if_eq_cancel: "|- (if x=y then y else x) = x"
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   242
  apply (tactic {* lemma_tac @{thm split_if} 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   243
  apply (tactic {* safe_tac LK_pack 1 *})
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   244
  apply (rule symL)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   245
  apply (rule basic)
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   246
  done
123377499a8e converted ML proofs from simpdata.ML;
wenzelm
parents: 21428
diff changeset
   247
2073
fb0655539d05 New unified treatment of sequent calculi by Sara Kalvala
paulson
parents:
diff changeset
   248
end