src/FOL/FOL.thy
author wenzelm
Thu, 22 Dec 2005 00:28:34 +0100
changeset 18456 8cc35e95450a
parent 16417 9bc16273c2d4
child 18511 beed2bc052a3
permissions -rw-r--r--
updated auxiliary facts for induct method;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
     1
(*  Title:      FOL/FOL.thy
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
     2
    ID:         $Id$
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
     3
    Author:     Lawrence C Paulson and Markus Wenzel
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
     4
*)
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
     5
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
     6
header {* Classical first-order logic *}
4093
5e8f3d57dee7 added claset thy_data;
wenzelm
parents: 0
diff changeset
     7
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
     8
theory FOL
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
     9
imports IFOL
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15481
diff changeset
    10
uses ("FOL_lemmas1.ML") ("cladata.ML") ("blastdata.ML") ("simpdata.ML")
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    11
      ("eqrule_FOL_data.ML")
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    12
      ("~~/src/Provers/eqsubst.ML")
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
    13
begin
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    14
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    15
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    16
subsection {* The classical axiom *}
4093
5e8f3d57dee7 added claset thy_data;
wenzelm
parents: 0
diff changeset
    17
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    18
axioms
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    19
  classical: "(~P ==> P) ==> P"
4093
5e8f3d57dee7 added claset thy_data;
wenzelm
parents: 0
diff changeset
    20
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    21
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    22
subsection {* Lemmas and proof tools *}
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    23
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    24
use "FOL_lemmas1.ML"
12127
219e543496a3 theorems case_split = case_split_thm [case_names True False, cases type: o];
wenzelm
parents: 11988
diff changeset
    25
theorems case_split = case_split_thm [case_names True False, cases type: o]
9525
46fb9ccae463 lemmas atomize = all_eq imp_eq;
wenzelm
parents: 9487
diff changeset
    26
10383
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    27
use "cladata.ML"
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    28
setup Cla.setup
14156
2072802ab0e3 new case_tac method
paulson
parents: 14085
diff changeset
    29
setup cla_setup
2072802ab0e3 new case_tac method
paulson
parents: 14085
diff changeset
    30
setup case_setup
10383
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    31
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    32
use "blastdata.ML"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    33
setup Blast.setup
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    34
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    35
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    36
lemma ex1_functional: "[| EX! z. P(a,z);  P(a,b);  P(a,c) |] ==> b = c"
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    37
by blast
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    38
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    39
ML {*
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    40
val ex1_functional = thm "ex1_functional";
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12367
diff changeset
    41
*}
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    42
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    43
use "simpdata.ML"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    44
setup simpsetup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    45
setup "Simplifier.method_setup Splitter.split_modifiers"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    46
setup Splitter.setup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    47
setup Clasimp.setup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    48
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    49
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    50
subsection {* Lucas Dixon's eqstep tactic *}
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    51
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    52
use "~~/src/Provers/eqsubst.ML";
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    53
use "eqrule_FOL_data.ML";
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    54
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    55
setup EQSubstTac.setup
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    56
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 15019
diff changeset
    57
14085
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    58
subsection {* Other simple lemmas *}
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    59
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    60
lemma [simp]: "((P-->R) <-> (Q-->R)) <-> ((P<->Q) | R)"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    61
by blast
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    62
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    63
lemma [simp]: "((P-->Q) <-> (P-->R)) <-> (P --> (Q<->R))"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    64
by blast
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    65
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    66
lemma not_disj_iff_imp: "~P | Q <-> (P-->Q)"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    67
by blast
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    68
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    69
(** Monotonicity of implications **)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    70
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    71
lemma conj_mono: "[| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    72
by fast (*or (IntPr.fast_tac 1)*)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    73
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    74
lemma disj_mono: "[| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    75
by fast (*or (IntPr.fast_tac 1)*)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    76
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    77
lemma imp_mono: "[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    78
by fast (*or (IntPr.fast_tac 1)*)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    79
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    80
lemma imp_refl: "P-->P"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    81
by (rule impI, assumption)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    82
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    83
(*The quantifier monotonicity rules are also intuitionistically valid*)
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    84
lemma ex_mono: "(!!x. P(x) --> Q(x)) ==> (EX x. P(x)) --> (EX x. Q(x))"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    85
by blast
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    86
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    87
lemma all_mono: "(!!x. P(x) --> Q(x)) ==> (ALL x. P(x)) --> (ALL x. Q(x))"
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    88
by blast
8dc3e532959a moved some lemmas here from ZF
paulson
parents: 13550
diff changeset
    89
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    90
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    91
subsection {* Proof by cases and induction *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    92
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    93
text {* Proper handling of non-atomic rule statements. *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    94
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    95
constdefs
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
    96
  induct_forall where "induct_forall(P) == \<forall>x. P(x)"
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
    97
  induct_implies where "induct_implies(A, B) == A \<longrightarrow> B"
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
    98
  induct_equal where "induct_equal(x, y) == x = y"
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
    99
  induct_conj where "induct_conj(A, B) == A \<and> B"
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   100
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   101
lemma induct_forall_eq: "(!!x. P(x)) == Trueprop(induct_forall(\<lambda>x. P(x)))"
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   102
  by (unfold atomize_all induct_forall_def)
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   103
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   104
lemma induct_implies_eq: "(A ==> B) == Trueprop(induct_implies(A, B))"
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   105
  by (unfold atomize_imp induct_implies_def)
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   106
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   107
lemma induct_equal_eq: "(x == y) == Trueprop(induct_equal(x, y))"
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   108
  by (unfold atomize_eq induct_equal_def)
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   109
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   110
lemma induct_conj_eq:
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   111
  includes meta_conjunction_syntax
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   112
  shows "(A && B) == Trueprop(induct_conj(A, B))"
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   113
  by (unfold atomize_conj induct_conj_def)
11988
8340fb172607 induct_impliesI;
wenzelm
parents: 11848
diff changeset
   114
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   115
lemmas induct_atomize_old = induct_forall_eq induct_implies_eq induct_equal_eq atomize_conj
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   116
lemmas induct_atomize = induct_forall_eq induct_implies_eq induct_equal_eq induct_conj_eq
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   117
lemmas induct_rulify [symmetric, standard] = induct_atomize
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   118
lemmas induct_rulify_fallback =
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   119
  induct_forall_def induct_implies_def induct_equal_def induct_conj_def
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   120
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   121
hide const induct_forall induct_implies induct_equal induct_conj
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   122
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   123
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   124
text {* Method setup. *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   125
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   126
ML {*
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   127
  structure InductMethod = InductMethodFun
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   128
  (struct
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   129
    val cases_default = thm "case_split";
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   130
    val atomize_old = thms "induct_atomize_old";
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   131
    val atomize = thms "induct_atomize";
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   132
    val rulify = thms "induct_rulify";
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 16417
diff changeset
   133
    val rulify_fallback = thms "induct_rulify_fallback";
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   134
  end);
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   135
*}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   136
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   137
setup InductMethod.setup
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
   138
4854
d1850e0964f2 tuned setup;
wenzelm
parents: 4793
diff changeset
   139
end