src/FOL/IFOL.thy
author wenzelm
Wed, 12 Sep 2012 22:00:29 +0200
changeset 49339 d1fcb4de8349
parent 48891 c0eafbd55de3
child 51798 ad3a241def73
permissions -rw-r--r--
eliminated some old material that is unused in the visible universe;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1268
f6ef556b3ede corrected title
clasohm
parents: 928
diff changeset
     1
(*  Title:      FOL/IFOL.thy
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     2
    Author:     Lawrence C Paulson and Markus Wenzel
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     3
*)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
     4
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     5
header {* Intuitionistic first-order logic *}
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
     6
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15377
diff changeset
     7
theory IFOL
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15377
diff changeset
     8
imports Pure
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15377
diff changeset
     9
begin
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    10
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    11
ML_file "~~/src/Tools/misc_legacy.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    12
ML_file "~~/src/Provers/splitter.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    13
ML_file "~~/src/Provers/hypsubst.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    14
ML_file "~~/src/Tools/IsaPlanner/zipper.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    15
ML_file "~~/src/Tools/IsaPlanner/isand.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    16
ML_file "~~/src/Tools/IsaPlanner/rw_inst.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    17
ML_file "~~/src/Tools/eqsubst.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    18
ML_file "~~/src/Provers/quantifier1.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    19
ML_file "~~/src/Tools/intuitionistic.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    20
ML_file "~~/src/Tools/project_rule.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    21
ML_file "~~/src/Tools/atomize_elim.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
    22
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    24
subsection {* Syntax and axiomatic basis *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    25
39557
fe5722fce758 renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
wenzelm
parents: 39159
diff changeset
    26
setup Pure_Thy.old_appl_syntax_setup
26956
1309a6a0a29f setup PureThy.old_appl_syntax_setup -- theory Pure provides regular application syntax by default;
wenzelm
parents: 26580
diff changeset
    27
14854
61bdf2ae4dc5 removed obsolete sort 'logic';
wenzelm
parents: 14565
diff changeset
    28
classes "term"
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35417
diff changeset
    29
default_sort "term"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    31
typedecl o
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    32
11747
17a6dcd6f3cf judgment Trueprop;
wenzelm
parents: 11734
diff changeset
    33
judgment
17a6dcd6f3cf judgment Trueprop;
wenzelm
parents: 11734
diff changeset
    34
  Trueprop      :: "o => prop"                  ("(_)" 5)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    36
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    37
subsubsection {* Equality *}
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
    38
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    39
axiomatization
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    40
  eq :: "['a, 'a] => o"  (infixl "=" 50)
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    41
where
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    42
  refl:         "a=a" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    43
  subst:        "a=b \<Longrightarrow> P(a) \<Longrightarrow> P(b)"
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    44
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    46
subsubsection {* Propositional logic *}
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    47
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    48
axiomatization
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    49
  False :: o and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    50
  conj :: "[o, o] => o"  (infixr "&" 35) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    51
  disj :: "[o, o] => o"  (infixr "|" 30) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    52
  imp :: "[o, o] => o"  (infixr "-->" 25)
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    53
where
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    54
  conjI: "[| P;  Q |] ==> P&Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    55
  conjunct1: "P&Q ==> P" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    56
  conjunct2: "P&Q ==> Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    57
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    58
  disjI1: "P ==> P|Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    59
  disjI2: "Q ==> P|Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    60
  disjE: "[| P|Q;  P ==> R;  Q ==> R |] ==> R" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    61
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    62
  impI: "(P ==> Q) ==> P-->Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    63
  mp: "[| P-->Q;  P |] ==> Q" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    64
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    65
  FalseE: "False ==> P"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    66
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    67
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    68
subsubsection {* Quantifiers *}
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    69
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    70
axiomatization
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    71
  All :: "('a => o) => o"  (binder "ALL " 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    72
  Ex :: "('a => o) => o"  (binder "EX " 10)
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    73
where
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    74
  allI: "(!!x. P(x)) ==> (ALL x. P(x))" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    75
  spec: "(ALL x. P(x)) ==> P(x)" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    76
  exI: "P(x) ==> (EX x. P(x))" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    77
  exE: "[| EX x. P(x);  !!x. P(x) ==> R |] ==> R"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    78
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    79
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    80
subsubsection {* Definitions *}
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    81
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    82
definition "True == False-->False"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    83
definition Not ("~ _" [40] 40) where not_def: "~P == P-->False"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    84
definition iff  (infixr "<->" 25) where "P<->Q == (P-->Q) & (Q-->P)"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    85
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    86
definition Ex1 :: "('a => o) => o"  (binder "EX! " 10)
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    87
  where ex1_def: "EX! x. P(x) == EX x. P(x) & (ALL y. P(y) --> y=x)"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    88
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    89
axiomatization where  -- {* Reflection, admissible *}
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    90
  eq_reflection: "(x=y) ==> (x==y)" and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    91
  iff_reflection: "(P<->Q) ==> (P==Q)"
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    92
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    93
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    94
subsubsection {* Additional notation *}
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    95
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    96
abbreviation not_equal :: "['a, 'a] => o"  (infixl "~=" 50)
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
    97
  where "x ~= y == ~ (x = y)"
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    98
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 19756
diff changeset
    99
notation (xsymbols)
19656
09be06943252 tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents: 19380
diff changeset
   100
  not_equal  (infixl "\<noteq>" 50)
19363
667b5ea637dd refined 'abbreviation';
wenzelm
parents: 19120
diff changeset
   101
21210
c17fd2df4e9e renamed 'const_syntax' to 'notation';
wenzelm
parents: 19756
diff changeset
   102
notation (HTML output)
19656
09be06943252 tuned concrete syntax -- abbreviation/const_syntax;
wenzelm
parents: 19380
diff changeset
   103
  not_equal  (infixl "\<noteq>" 50)
19363
667b5ea637dd refined 'abbreviation';
wenzelm
parents: 19120
diff changeset
   104
21524
7843e2fd14a9 updated (binder) syntax/notation;
wenzelm
parents: 21404
diff changeset
   105
notation (xsymbols)
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   106
  Not  ("\<not> _" [40] 40) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   107
  conj  (infixr "\<and>" 35) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   108
  disj  (infixr "\<or>" 30) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   109
  All  (binder "\<forall>" 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   110
  Ex  (binder "\<exists>" 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   111
  Ex1  (binder "\<exists>!" 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   112
  imp  (infixr "\<longrightarrow>" 25) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   113
  iff  (infixr "\<longleftrightarrow>" 25)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
   114
21524
7843e2fd14a9 updated (binder) syntax/notation;
wenzelm
parents: 21404
diff changeset
   115
notation (HTML output)
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   116
  Not  ("\<not> _" [40] 40) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   117
  conj  (infixr "\<and>" 35) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   118
  disj  (infixr "\<or>" 30) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   119
  All  (binder "\<forall>" 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   120
  Ex  (binder "\<exists>" 10) and
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   121
  Ex1  (binder "\<exists>!" 10)
14236
c73d62ce9d1c partial conversion to Isar scripts
paulson
parents: 13779
diff changeset
   122
13779
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   123
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   124
subsection {* Lemmas and proof tools *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   125
46972
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   126
lemmas strip = impI allI
ef6fc1a0884d modernized axiomatization;
wenzelm
parents: 44121
diff changeset
   127
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   128
lemma TrueI: True
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   129
  unfolding True_def by (rule impI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   130
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   131
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   132
(*** Sequent-style elimination rules for & --> and ALL ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   133
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   134
lemma conjE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   135
  assumes major: "P & Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   136
    and r: "[| P; Q |] ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   137
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   138
  apply (rule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   139
   apply (rule major [THEN conjunct1])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   140
  apply (rule major [THEN conjunct2])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   141
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   142
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   143
lemma impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   144
  assumes major: "P --> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   145
    and P
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   146
  and r: "Q ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   147
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   148
  apply (rule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   149
  apply (rule major [THEN mp])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   150
  apply (rule `P`)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   151
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   152
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   153
lemma allE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   154
  assumes major: "ALL x. P(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   155
    and r: "P(x) ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   156
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   157
  apply (rule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   158
  apply (rule major [THEN spec])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   159
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   160
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   161
(*Duplicates the quantifier; for use with eresolve_tac*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   162
lemma all_dupE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   163
  assumes major: "ALL x. P(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   164
    and r: "[| P(x); ALL x. P(x) |] ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   165
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   166
  apply (rule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   167
   apply (rule major [THEN spec])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   168
  apply (rule major)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   169
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   170
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   171
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   172
(*** Negation rules, which translate between ~P and P-->False ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   173
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   174
lemma notI: "(P ==> False) ==> ~P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   175
  unfolding not_def by (erule impI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   176
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   177
lemma notE: "[| ~P;  P |] ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   178
  unfolding not_def by (erule mp [THEN FalseE])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   179
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   180
lemma rev_notE: "[| P; ~P |] ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   181
  by (erule notE)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   182
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   183
(*This is useful with the special implication rules for each kind of P. *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   184
lemma not_to_imp:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   185
  assumes "~P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   186
    and r: "P --> False ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   187
  shows Q
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   188
  apply (rule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   189
  apply (rule impI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   190
  apply (erule notE [OF `~P`])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   191
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   192
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   193
(* For substitution into an assumption P, reduce Q to P-->Q, substitute into
27150
a42aef558ce3 tuned comments;
wenzelm
parents: 26956
diff changeset
   194
   this implication, then apply impI to move P back into the assumptions.*)
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   195
lemma rev_mp: "[| P;  P --> Q |] ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   196
  by (erule mp)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   197
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   198
(*Contrapositive of an inference rule*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   199
lemma contrapos:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   200
  assumes major: "~Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   201
    and minor: "P ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   202
  shows "~P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   203
  apply (rule major [THEN notE, THEN notI])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   204
  apply (erule minor)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   205
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   206
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   207
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   208
(*** Modus Ponens Tactics ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   209
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   210
(*Finds P-->Q and P in the assumptions, replaces implication by Q *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   211
ML {*
22139
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   212
  fun mp_tac i = eresolve_tac [@{thm notE}, @{thm impE}] i  THEN  assume_tac i
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   213
  fun eq_mp_tac i = eresolve_tac [@{thm notE}, @{thm impE}] i  THEN  eq_assume_tac i
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   214
*}
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   215
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   216
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   217
(*** If-and-only-if ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   218
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   219
lemma iffI: "[| P ==> Q; Q ==> P |] ==> P<->Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   220
  apply (unfold iff_def)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   221
  apply (rule conjI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   222
   apply (erule impI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   223
  apply (erule impI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   224
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   225
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   226
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   227
(*Observe use of rewrite_rule to unfold "<->" in meta-assumptions (prems) *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   228
lemma iffE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   229
  assumes major: "P <-> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   230
    and r: "P-->Q ==> Q-->P ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   231
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   232
  apply (insert major, unfold iff_def)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   233
  apply (erule conjE)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   234
  apply (erule r)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   235
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   236
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   237
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   238
(* Destruct rules for <-> similar to Modus Ponens *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   239
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   240
lemma iffD1: "[| P <-> Q;  P |] ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   241
  apply (unfold iff_def)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   242
  apply (erule conjunct1 [THEN mp])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   243
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   244
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   245
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   246
lemma iffD2: "[| P <-> Q;  Q |] ==> P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   247
  apply (unfold iff_def)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   248
  apply (erule conjunct2 [THEN mp])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   249
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   250
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   251
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   252
lemma rev_iffD1: "[| P; P <-> Q |] ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   253
  apply (erule iffD1)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   254
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   255
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   256
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   257
lemma rev_iffD2: "[| Q; P <-> Q |] ==> P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   258
  apply (erule iffD2)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   259
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   260
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   261
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   262
lemma iff_refl: "P <-> P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   263
  by (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   264
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   265
lemma iff_sym: "Q <-> P ==> P <-> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   266
  apply (erule iffE)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   267
  apply (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   268
  apply (assumption | erule mp)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   269
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   270
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   271
lemma iff_trans: "[| P <-> Q;  Q<-> R |] ==> P <-> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   272
  apply (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   273
  apply (assumption | erule iffE | erule (1) notE impE)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   274
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   275
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   276
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   277
(*** Unique existence.  NOTE THAT the following 2 quantifications
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   278
   EX!x such that [EX!y such that P(x,y)]     (sequential)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   279
   EX!x,y such that P(x,y)                    (simultaneous)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   280
 do NOT mean the same thing.  The parser treats EX!x y.P(x,y) as sequential.
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   281
***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   282
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   283
lemma ex1I:
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   284
  "P(a) \<Longrightarrow> (!!x. P(x) ==> x=a) \<Longrightarrow> EX! x. P(x)"
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   285
  apply (unfold ex1_def)
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   286
  apply (assumption | rule exI conjI allI impI)+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   287
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   288
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   289
(*Sometimes easier to use: the premises have no shared variables.  Safe!*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   290
lemma ex_ex1I:
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   291
  "EX x. P(x) \<Longrightarrow> (!!x y. [| P(x); P(y) |] ==> x=y) \<Longrightarrow> EX! x. P(x)"
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   292
  apply (erule exE)
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   293
  apply (rule ex1I)
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   294
   apply assumption
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   295
  apply assumption
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   296
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   297
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   298
lemma ex1E:
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   299
  "EX! x. P(x) \<Longrightarrow> (!!x. [| P(x);  ALL y. P(y) --> y=x |] ==> R) \<Longrightarrow> R"
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   300
  apply (unfold ex1_def)
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   301
  apply (assumption | erule exE conjE)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   302
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   303
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   304
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   305
(*** <-> congruence rules for simplification ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   306
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   307
(*Use iffE on a premise.  For conj_cong, imp_cong, all_cong, ex_cong*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   308
ML {*
22139
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   309
  fun iff_tac prems i =
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   310
    resolve_tac (prems RL @{thms iffE}) i THEN
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   311
    REPEAT1 (eresolve_tac [@{thm asm_rl}, @{thm mp}] i)
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   312
*}
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   313
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   314
lemma conj_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   315
  assumes "P <-> P'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   316
    and "P' ==> Q <-> Q'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   317
  shows "(P&Q) <-> (P'&Q')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   318
  apply (insert assms)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   319
  apply (assumption | rule iffI conjI | erule iffE conjE mp |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   320
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   321
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   322
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   323
(*Reversed congruence rule!   Used in ZF/Order*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   324
lemma conj_cong2:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   325
  assumes "P <-> P'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   326
    and "P' ==> Q <-> Q'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   327
  shows "(Q&P) <-> (Q'&P')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   328
  apply (insert assms)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   329
  apply (assumption | rule iffI conjI | erule iffE conjE mp |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   330
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   331
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   332
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   333
lemma disj_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   334
  assumes "P <-> P'" and "Q <-> Q'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   335
  shows "(P|Q) <-> (P'|Q')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   336
  apply (insert assms)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   337
  apply (erule iffE disjE disjI1 disjI2 | assumption | rule iffI | erule (1) notE impE)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   338
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   339
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   340
lemma imp_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   341
  assumes "P <-> P'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   342
    and "P' ==> Q <-> Q'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   343
  shows "(P-->Q) <-> (P'-->Q')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   344
  apply (insert assms)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   345
  apply (assumption | rule iffI impI | erule iffE | erule (1) notE impE |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   346
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   347
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   348
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   349
lemma iff_cong: "[| P <-> P'; Q <-> Q' |] ==> (P<->Q) <-> (P'<->Q')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   350
  apply (erule iffE | assumption | rule iffI | erule (1) notE impE)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   351
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   352
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   353
lemma not_cong: "P <-> P' ==> ~P <-> ~P'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   354
  apply (assumption | rule iffI notI | erule (1) notE impE | erule iffE notE)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   355
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   356
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   357
lemma all_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   358
  assumes "!!x. P(x) <-> Q(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   359
  shows "(ALL x. P(x)) <-> (ALL x. Q(x))"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   360
  apply (assumption | rule iffI allI | erule (1) notE impE | erule allE |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   361
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   362
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   363
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   364
lemma ex_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   365
  assumes "!!x. P(x) <-> Q(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   366
  shows "(EX x. P(x)) <-> (EX x. Q(x))"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   367
  apply (erule exE | assumption | rule iffI exI | erule (1) notE impE |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   368
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   369
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   370
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   371
lemma ex1_cong:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   372
  assumes "!!x. P(x) <-> Q(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   373
  shows "(EX! x. P(x)) <-> (EX! x. Q(x))"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   374
  apply (erule ex1E spec [THEN mp] | assumption | rule iffI ex1I | erule (1) notE impE |
39159
0dec18004e75 more antiquotations;
wenzelm
parents: 38522
diff changeset
   375
    tactic {* iff_tac @{thms assms} 1 *})+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   376
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   377
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   378
(*** Equality rules ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   379
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   380
lemma sym: "a=b ==> b=a"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   381
  apply (erule subst)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   382
  apply (rule refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   383
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   384
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   385
lemma trans: "[| a=b;  b=c |] ==> a=c"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   386
  apply (erule subst, assumption)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   387
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   388
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   389
(**  **)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   390
lemma not_sym: "b ~= a ==> a ~= b"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   391
  apply (erule contrapos)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   392
  apply (erule sym)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   393
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   394
  
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   395
(* Two theorms for rewriting only one instance of a definition:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   396
   the first for definitions of formulae and the second for terms *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   397
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   398
lemma def_imp_iff: "(A == B) ==> A <-> B"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   399
  apply unfold
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   400
  apply (rule iff_refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   401
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   402
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   403
lemma meta_eq_to_obj_eq: "(A == B) ==> A = B"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   404
  apply unfold
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   405
  apply (rule refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   406
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   407
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   408
lemma meta_eq_to_iff: "x==y ==> x<->y"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   409
  by unfold (rule iff_refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   410
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   411
(*substitution*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   412
lemma ssubst: "[| b = a; P(a) |] ==> P(b)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   413
  apply (drule sym)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   414
  apply (erule (1) subst)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   415
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   416
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   417
(*A special case of ex1E that would otherwise need quantifier expansion*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   418
lemma ex1_equalsE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   419
    "[| EX! x. P(x);  P(a);  P(b) |] ==> a=b"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   420
  apply (erule ex1E)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   421
  apply (rule trans)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   422
   apply (rule_tac [2] sym)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   423
   apply (assumption | erule spec [THEN mp])+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   424
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   425
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   426
(** Polymorphic congruence rules **)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   427
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   428
lemma subst_context: "[| a=b |]  ==>  t(a)=t(b)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   429
  apply (erule ssubst)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   430
  apply (rule refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   431
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   432
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   433
lemma subst_context2: "[| a=b;  c=d |]  ==>  t(a,c)=t(b,d)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   434
  apply (erule ssubst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   435
  apply (rule refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   436
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   437
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   438
lemma subst_context3: "[| a=b;  c=d;  e=f |]  ==>  t(a,c,e)=t(b,d,f)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   439
  apply (erule ssubst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   440
  apply (rule refl)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   441
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   442
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   443
(*Useful with eresolve_tac for proving equalties from known equalities.
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   444
        a = b
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   445
        |   |
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   446
        c = d   *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   447
lemma box_equals: "[| a=b;  a=c;  b=d |] ==> c=d"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   448
  apply (rule trans)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   449
   apply (rule trans)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   450
    apply (rule sym)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   451
    apply assumption+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   452
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   453
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   454
(*Dual of box_equals: for proving equalities backwards*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   455
lemma simp_equals: "[| a=c;  b=d;  c=d |] ==> a=b"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   456
  apply (rule trans)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   457
   apply (rule trans)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   458
    apply assumption+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   459
  apply (erule sym)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   460
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   461
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   462
(** Congruence rules for predicate letters **)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   463
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   464
lemma pred1_cong: "a=a' ==> P(a) <-> P(a')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   465
  apply (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   466
   apply (erule (1) subst)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   467
  apply (erule (1) ssubst)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   468
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   469
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   470
lemma pred2_cong: "[| a=a';  b=b' |] ==> P(a,b) <-> P(a',b')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   471
  apply (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   472
   apply (erule subst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   473
   apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   474
  apply (erule ssubst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   475
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   476
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   477
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   478
lemma pred3_cong: "[| a=a';  b=b';  c=c' |] ==> P(a,b,c) <-> P(a',b',c')"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   479
  apply (rule iffI)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   480
   apply (erule subst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   481
   apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   482
  apply (erule ssubst)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   483
  apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   484
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   485
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   486
(*special case for the equality predicate!*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   487
lemma eq_cong: "[| a = a'; b = b' |] ==> a = b <-> a' = b'"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   488
  apply (erule (1) pred2_cong)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   489
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   490
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   491
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   492
(*** Simplifications of assumed implications.
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   493
     Roy Dyckhoff has proved that conj_impE, disj_impE, and imp_impE
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   494
     used with mp_tac (restricted to atomic formulae) is COMPLETE for 
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   495
     intuitionistic propositional logic.  See
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   496
   R. Dyckhoff, Contraction-free sequent calculi for intuitionistic logic
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   497
    (preprint, University of St Andrews, 1991)  ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   498
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   499
lemma conj_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   500
  assumes major: "(P&Q)-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   501
    and r: "P-->(Q-->S) ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   502
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   503
  by (assumption | rule conjI impI major [THEN mp] r)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   504
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   505
lemma disj_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   506
  assumes major: "(P|Q)-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   507
    and r: "[| P-->S; Q-->S |] ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   508
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   509
  by (assumption | rule disjI1 disjI2 impI major [THEN mp] r)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   510
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   511
(*Simplifies the implication.  Classical version is stronger. 
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   512
  Still UNSAFE since Q must be provable -- backtracking needed.  *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   513
lemma imp_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   514
  assumes major: "(P-->Q)-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   515
    and r1: "[| P; Q-->S |] ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   516
    and r2: "S ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   517
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   518
  by (assumption | rule impI major [THEN mp] r1 r2)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   519
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   520
(*Simplifies the implication.  Classical version is stronger. 
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   521
  Still UNSAFE since ~P must be provable -- backtracking needed.  *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   522
lemma not_impE:
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   523
  "~P --> S \<Longrightarrow> (P ==> False) \<Longrightarrow> (S ==> R) \<Longrightarrow> R"
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   524
  apply (drule mp)
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   525
   apply (rule notI)
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   526
   apply assumption
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   527
  apply assumption
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   528
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   529
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   530
(*Simplifies the implication.   UNSAFE.  *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   531
lemma iff_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   532
  assumes major: "(P<->Q)-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   533
    and r1: "[| P; Q-->S |] ==> Q"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   534
    and r2: "[| Q; P-->S |] ==> P"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   535
    and r3: "S ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   536
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   537
  apply (assumption | rule iffI impI major [THEN mp] r1 r2 r3)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   538
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   540
(*What if (ALL x.~~P(x)) --> ~~(ALL x.P(x)) is an assumption? UNSAFE*)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   541
lemma all_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   542
  assumes major: "(ALL x. P(x))-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   543
    and r1: "!!x. P(x)"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   544
    and r2: "S ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   545
  shows R
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   546
  apply (rule allI impI major [THEN mp] r1 r2)+
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   547
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   548
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   549
(*Unsafe: (EX x.P(x))-->S  is equivalent to  ALL x.P(x)-->S.  *)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   550
lemma ex_impE:
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   551
  assumes major: "(EX x. P(x))-->S"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   552
    and r: "P(x)-->S ==> R"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   553
  shows R
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   554
  apply (assumption | rule exI impI major [THEN mp] r)+
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   555
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   556
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   557
(*** Courtesy of Krzysztof Grabczewski ***)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   558
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   559
lemma disj_imp_disj:
23393
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   560
  "P|Q \<Longrightarrow> (P==>R) \<Longrightarrow> (Q==>S) \<Longrightarrow> R|S"
31781b2de73d tuned proofs: avoid implicit prems;
wenzelm
parents: 23171
diff changeset
   561
  apply (erule disjE)
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   562
  apply (rule disjI1) apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   563
  apply (rule disjI2) apply assumption
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   564
  done
11734
7a21bf539412 declare impE iffD1 iffD2 ad elim of Pure;
wenzelm
parents: 11677
diff changeset
   565
18481
b75ce99617c7 structure ProjectRule;
wenzelm
parents: 17702
diff changeset
   566
ML {*
32172
c4e55f30d527 renamed functor ProjectRuleFun to Project_Rule;
wenzelm
parents: 31299
diff changeset
   567
structure Project_Rule = Project_Rule
c4e55f30d527 renamed functor ProjectRuleFun to Project_Rule;
wenzelm
parents: 31299
diff changeset
   568
(
22139
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   569
  val conjunct1 = @{thm conjunct1}
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   570
  val conjunct2 = @{thm conjunct2}
539a63b98f76 tuned ML setup;
wenzelm
parents: 21539
diff changeset
   571
  val mp = @{thm mp}
32172
c4e55f30d527 renamed functor ProjectRuleFun to Project_Rule;
wenzelm
parents: 31299
diff changeset
   572
)
18481
b75ce99617c7 structure ProjectRule;
wenzelm
parents: 17702
diff changeset
   573
*}
b75ce99617c7 structure ProjectRule;
wenzelm
parents: 17702
diff changeset
   574
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
   575
ML_file "fologic.ML"
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   576
42303
wenzelm
parents: 41779
diff changeset
   577
lemma thin_refl: "[|x=x; PROP W|] ==> PROP W" .
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   578
42799
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   579
ML {*
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   580
structure Hypsubst = Hypsubst
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   581
(
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   582
  val dest_eq = FOLogic.dest_eq
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   583
  val dest_Trueprop = FOLogic.dest_Trueprop
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   584
  val dest_imp = FOLogic.dest_imp
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   585
  val eq_reflection = @{thm eq_reflection}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   586
  val rev_eq_reflection = @{thm meta_eq_to_obj_eq}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   587
  val imp_intr = @{thm impI}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   588
  val rev_mp = @{thm rev_mp}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   589
  val subst = @{thm subst}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   590
  val sym = @{thm sym}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   591
  val thin_refl = @{thm thin_refl}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   592
);
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   593
open Hypsubst;
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   594
*}
4e33894aec6d modernized functor names;
wenzelm
parents: 42303
diff changeset
   595
9886
897d6602cbfb updated setup;
wenzelm
parents: 9526
diff changeset
   596
setup hypsubst_setup
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 46972
diff changeset
   597
ML_file "intprover.ML"
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   598
4092
9faf228771dc added simpset thy_data;
wenzelm
parents: 3932
diff changeset
   599
12875
wenzelm
parents: 12662
diff changeset
   600
subsection {* Intuitionistic Reasoning *}
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   601
31299
0c5baf034d0e modernized method setup;
wenzelm
parents: 30242
diff changeset
   602
setup {* Intuitionistic.method_setup @{binding iprover} *}
30165
6ee87f67d9cd moved generic intuitionistic prover to src/Tools/intuitionistic.ML;
wenzelm
parents: 30160
diff changeset
   603
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   604
lemma impE':
12937
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   605
  assumes 1: "P --> Q"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   606
    and 2: "Q ==> R"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   607
    and 3: "P --> Q ==> P"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   608
  shows R
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   609
proof -
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   610
  from 3 and 1 have P .
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   611
  with 1 have Q by (rule impE)
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   612
  with 2 show R .
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   613
qed
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   614
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   615
lemma allE':
12937
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   616
  assumes 1: "ALL x. P(x)"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   617
    and 2: "P(x) ==> ALL x. P(x) ==> Q"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   618
  shows Q
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   619
proof -
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   620
  from 1 have "P(x)" by (rule spec)
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   621
  from this and 1 show Q by (rule 2)
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   622
qed
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   623
12937
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   624
lemma notE':
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   625
  assumes 1: "~ P"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   626
    and 2: "~ P ==> P"
0c4fd7529467 clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents: 12875
diff changeset
   627
  shows R
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   628
proof -
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   629
  from 2 and 1 have P .
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   630
  with 1 show R by (rule notE)
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   631
qed
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   632
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   633
lemmas [Pure.elim!] = disjE iffE FalseE conjE exE
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   634
  and [Pure.intro!] = iffI conjI impI TrueI notI allI refl
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   635
  and [Pure.elim 2] = allE notE' impE'
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   636
  and [Pure.intro] = exI disjI2 disjI1
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   637
33369
470a7b233ee5 modernized structure Context_Rules;
wenzelm
parents: 32172
diff changeset
   638
setup {* Context_Rules.addSWrapper (fn tac => hyp_subst_tac ORELSE' tac) *}
12349
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   639
94e812f9683e setup "rules" method;
wenzelm
parents: 12114
diff changeset
   640
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   641
lemma iff_not_sym: "~ (Q <-> P) ==> ~ (P <-> Q)"
17591
33d409318266 renamed rules to iprover
nipkow
parents: 17276
diff changeset
   642
  by iprover
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   643
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   644
lemmas [sym] = sym iff_sym not_sym iff_not_sym
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   645
  and [Pure.elim?] = iffD1 iffD2 impE
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   646
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   647
13435
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   648
lemma eq_commute: "a=b <-> b=a"
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   649
apply (rule iffI) 
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   650
apply (erule sym)+
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   651
done
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   652
05631e8f0258 new theorem eq_commute
paulson
parents: 12937
diff changeset
   653
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   654
subsection {* Atomizing meta-level rules *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   655
11747
17a6dcd6f3cf judgment Trueprop;
wenzelm
parents: 11734
diff changeset
   656
lemma atomize_all [atomize]: "(!!x. P(x)) == Trueprop (ALL x. P(x))"
11976
075df6e46cef equal_intr_rule already declared in Pure;
wenzelm
parents: 11953
diff changeset
   657
proof
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   658
  assume "!!x. P(x)"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   659
  then show "ALL x. P(x)" ..
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   660
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   661
  assume "ALL x. P(x)"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   662
  then show "!!x. P(x)" ..
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   663
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   664
11747
17a6dcd6f3cf judgment Trueprop;
wenzelm
parents: 11734
diff changeset
   665
lemma atomize_imp [atomize]: "(A ==> B) == Trueprop (A --> B)"
11976
075df6e46cef equal_intr_rule already declared in Pure;
wenzelm
parents: 11953
diff changeset
   666
proof
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   667
  assume "A ==> B"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   668
  then show "A --> B" ..
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   669
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   670
  assume "A --> B" and A
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   671
  then show B by (rule mp)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   672
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   673
11747
17a6dcd6f3cf judgment Trueprop;
wenzelm
parents: 11734
diff changeset
   674
lemma atomize_eq [atomize]: "(x == y) == Trueprop (x = y)"
11976
075df6e46cef equal_intr_rule already declared in Pure;
wenzelm
parents: 11953
diff changeset
   675
proof
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   676
  assume "x == y"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   677
  show "x = y" unfolding `x == y` by (rule refl)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   678
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   679
  assume "x = y"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   680
  then show "x == y" by (rule eq_reflection)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   681
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   682
18813
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   683
lemma atomize_iff [atomize]: "(A == B) == Trueprop (A <-> B)"
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   684
proof
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   685
  assume "A == B"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   686
  show "A <-> B" unfolding `A == B` by (rule iff_refl)
18813
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   687
next
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   688
  assume "A <-> B"
22931
11cc1ccad58e tuned proofs;
wenzelm
parents: 22139
diff changeset
   689
  then show "A == B" by (rule iff_reflection)
18813
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   690
qed
fc35dcc2558b added atomize_iff;
wenzelm
parents: 18708
diff changeset
   691
28856
5e009a80fe6d Pure syntax: more coherent treatment of aprop, permanent TERM and &&&;
wenzelm
parents: 28699
diff changeset
   692
lemma atomize_conj [atomize]: "(A &&& B) == Trueprop (A & B)"
11976
075df6e46cef equal_intr_rule already declared in Pure;
wenzelm
parents: 11953
diff changeset
   693
proof
28856
5e009a80fe6d Pure syntax: more coherent treatment of aprop, permanent TERM and &&&;
wenzelm
parents: 28699
diff changeset
   694
  assume conj: "A &&& B"
19120
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   695
  show "A & B"
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   696
  proof (rule conjI)
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   697
    from conj show A by (rule conjunctionD1)
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   698
    from conj show B by (rule conjunctionD2)
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   699
  qed
11953
f98623fdf6ef atomize_conj;
wenzelm
parents: 11848
diff changeset
   700
next
19120
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   701
  assume conj: "A & B"
28856
5e009a80fe6d Pure syntax: more coherent treatment of aprop, permanent TERM and &&&;
wenzelm
parents: 28699
diff changeset
   702
  show "A &&& B"
19120
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   703
  proof -
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   704
    from conj show A ..
353d349740de not_equal: replaced syntax translation by abbreviation;
wenzelm
parents: 18861
diff changeset
   705
    from conj show B ..
11953
f98623fdf6ef atomize_conj;
wenzelm
parents: 11848
diff changeset
   706
  qed
f98623fdf6ef atomize_conj;
wenzelm
parents: 11848
diff changeset
   707
qed
f98623fdf6ef atomize_conj;
wenzelm
parents: 11848
diff changeset
   708
12368
2af9ad81ea56 sym declarations;
wenzelm
parents: 12352
diff changeset
   709
lemmas [symmetric, rulify] = atomize_all atomize_imp
18861
38269ef5175a declare defn rules;
wenzelm
parents: 18813
diff changeset
   710
  and [symmetric, defn] = atomize_all atomize_imp atomize_eq atomize_iff
11771
b7b100a2de1d moved rulify to ObjectLogic;
wenzelm
parents: 11747
diff changeset
   711
11848
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   712
26580
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   713
subsection {* Atomizing elimination rules *}
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   714
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   715
setup AtomizeElim.setup
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   716
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   717
lemma atomize_exL[atomize_elim]: "(!!x. P(x) ==> Q) == ((EX x. P(x)) ==> Q)"
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   718
by rule iprover+
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   719
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   720
lemma atomize_conjL[atomize_elim]: "(A ==> B ==> C) == (A & B ==> C)"
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   721
by rule iprover+
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   722
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   723
lemma atomize_disjL[atomize_elim]: "((A ==> C) ==> (B ==> C) ==> C) == ((A | B ==> C) ==> C)"
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   724
by rule iprover+
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   725
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   726
lemma atomize_elimL[atomize_elim]: "(!!B. (A ==> B) ==> B) == Trueprop(A)" ..
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   727
c3e597a476fd Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents: 26286
diff changeset
   728
11848
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   729
subsection {* Calculational rules *}
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   730
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   731
lemma forw_subst: "a = b ==> P(b) ==> P(a)"
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   732
  by (rule ssubst)
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   733
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   734
lemma back_subst: "P(a) ==> a = b ==> P(b)"
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   735
  by (rule subst)
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   736
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   737
text {*
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   738
  Note that this list of rules is in reverse order of priorities.
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   739
*}
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   740
12019
abe9b7c6016e transitive declared in Pure;
wenzelm
parents: 11976
diff changeset
   741
lemmas basic_trans_rules [trans] =
11848
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   742
  forw_subst
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   743
  back_subst
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   744
  rev_mp
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   745
  mp
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   746
  trans
6e3017adb8c0 calculational rules moved from FOL to IFOL;
wenzelm
parents: 11771
diff changeset
   747
13779
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   748
subsection {* ``Let'' declarations *}
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   749
41229
d797baa3d57c replaced command 'nonterminals' by slightly modernized version 'nonterminal';
wenzelm
parents: 39557
diff changeset
   750
nonterminal letbinds and letbind
13779
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   751
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35054
diff changeset
   752
definition Let :: "['a::{}, 'a => 'b] => ('b::{})" where
13779
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   753
    "Let(s, f) == f(s)"
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   754
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   755
syntax
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   756
  "_bind"       :: "[pttrn, 'a] => letbind"           ("(2_ =/ _)" 10)
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   757
  ""            :: "letbind => letbinds"              ("_")
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   758
  "_binds"      :: "[letbind, letbinds] => letbinds"  ("_;/ _")
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   759
  "_Let"        :: "[letbinds, 'a] => 'a"             ("(let (_)/ in (_))" 10)
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   760
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   761
translations
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   762
  "_Let(_binds(b, bs), e)"  == "_Let(b, _Let(bs, e))"
35054
a5db9779b026 modernized some syntax translations;
wenzelm
parents: 33369
diff changeset
   763
  "let x = a in e"          == "CONST Let(a, %x. e)"
13779
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   764
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   765
2a34dc5cf79e moving "let" from ZF to FOL
paulson
parents: 13435
diff changeset
   766
lemma LetI: 
21539
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   767
  assumes "!!x. x=t ==> P(u(x))"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   768
  shows "P(let x=t in u(x))"
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   769
  apply (unfold Let_def)
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   770
  apply (rule refl [THEN assms])
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   771
  done
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   772
c5cf9243ad62 converted legacy ML scripts;
wenzelm
parents: 21524
diff changeset
   773
26286
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   774
subsection {* Intuitionistic simplification rules *}
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   775
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   776
lemma conj_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   777
  "P & True <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   778
  "True & P <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   779
  "P & False <-> False"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   780
  "False & P <-> False"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   781
  "P & P <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   782
  "P & P & Q <-> P & Q"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   783
  "P & ~P <-> False"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   784
  "~P & P <-> False"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   785
  "(P & Q) & R <-> P & (Q & R)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   786
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   787
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   788
lemma disj_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   789
  "P | True <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   790
  "True | P <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   791
  "P | False <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   792
  "False | P <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   793
  "P | P <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   794
  "P | P | Q <-> P | Q"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   795
  "(P | Q) | R <-> P | (Q | R)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   796
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   797
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   798
lemma not_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   799
  "~(P|Q)  <-> ~P & ~Q"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   800
  "~ False <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   801
  "~ True <-> False"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   802
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   803
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   804
lemma imp_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   805
  "(P --> False) <-> ~P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   806
  "(P --> True) <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   807
  "(False --> P) <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   808
  "(True --> P) <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   809
  "(P --> P) <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   810
  "(P --> ~P) <-> ~P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   811
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   812
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   813
lemma iff_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   814
  "(True <-> P) <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   815
  "(P <-> True) <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   816
  "(P <-> P) <-> True"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   817
  "(False <-> P) <-> ~P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   818
  "(P <-> False) <-> ~P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   819
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   820
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   821
(*The x=t versions are needed for the simplification procedures*)
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   822
lemma quant_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   823
  "!!P. (ALL x. P) <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   824
  "(ALL x. x=t --> P(x)) <-> P(t)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   825
  "(ALL x. t=x --> P(x)) <-> P(t)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   826
  "!!P. (EX x. P) <-> P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   827
  "EX x. x=t"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   828
  "EX x. t=x"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   829
  "(EX x. x=t & P(x)) <-> P(t)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   830
  "(EX x. t=x & P(x)) <-> P(t)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   831
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   832
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   833
(*These are NOT supplied by default!*)
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   834
lemma distrib_simps:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   835
  "P & (Q | R) <-> P&Q | P&R"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   836
  "(Q | R) & P <-> Q&P | R&P"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   837
  "(P | Q --> R) <-> (P --> R) & (Q --> R)"
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   838
  by iprover+
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   839
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   840
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   841
text {* Conversion into rewrite rules *}
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   842
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   843
lemma P_iff_F: "~P ==> (P <-> False)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   844
lemma iff_reflection_F: "~P ==> (P == False)" by (rule P_iff_F [THEN iff_reflection])
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   845
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   846
lemma P_iff_T: "P ==> (P <-> True)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   847
lemma iff_reflection_T: "P ==> (P == True)" by (rule P_iff_T [THEN iff_reflection])
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   848
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   849
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   850
text {* More rewrite rules *}
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   851
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   852
lemma conj_commute: "P&Q <-> Q&P" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   853
lemma conj_left_commute: "P&(Q&R) <-> Q&(P&R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   854
lemmas conj_comms = conj_commute conj_left_commute
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   855
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   856
lemma disj_commute: "P|Q <-> Q|P" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   857
lemma disj_left_commute: "P|(Q|R) <-> Q|(P|R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   858
lemmas disj_comms = disj_commute disj_left_commute
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   859
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   860
lemma conj_disj_distribL: "P&(Q|R) <-> (P&Q | P&R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   861
lemma conj_disj_distribR: "(P|Q)&R <-> (P&R | Q&R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   862
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   863
lemma disj_conj_distribL: "P|(Q&R) <-> (P|Q) & (P|R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   864
lemma disj_conj_distribR: "(P&Q)|R <-> (P|R) & (Q|R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   865
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   866
lemma imp_conj_distrib: "(P --> (Q&R)) <-> (P-->Q) & (P-->R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   867
lemma imp_conj: "((P&Q)-->R)   <-> (P --> (Q --> R))" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   868
lemma imp_disj: "(P|Q --> R)   <-> (P-->R) & (Q-->R)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   869
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   870
lemma de_Morgan_disj: "(~(P | Q)) <-> (~P & ~Q)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   871
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   872
lemma not_ex: "(~ (EX x. P(x))) <-> (ALL x.~P(x))" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   873
lemma imp_ex: "((EX x. P(x)) --> Q) <-> (ALL x. P(x) --> Q)" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   874
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   875
lemma ex_disj_distrib:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   876
  "(EX x. P(x) | Q(x)) <-> ((EX x. P(x)) | (EX x. Q(x)))" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   877
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   878
lemma all_conj_distrib:
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   879
  "(ALL x. P(x) & Q(x)) <-> ((ALL x. P(x)) & (ALL x. Q(x)))" by iprover
3ff5d257f175 added lemmas from simpdata.ML;
wenzelm
parents: 24830
diff changeset
   880
4854
d1850e0964f2 tuned setup;
wenzelm
parents: 4793
diff changeset
   881
end