src/FOL/FOL.thy
author wenzelm
Mon, 19 Nov 2001 20:46:05 +0100
changeset 12240 0760eda193c4
parent 12164 0b219d9e3384
child 12303 67ca723a02dd
permissions -rw-r--r--
induct method: localize rews for rule;
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
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
     8
theory FOL = IFOL
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
     9
files
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    10
  ("FOL_lemmas1.ML") ("cladata.ML") ("blastdata.ML")
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    11
  ("simpdata.ML") ("FOL_lemmas2.ML"):
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    12
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    13
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    14
subsection {* The classical axiom *}
4093
5e8f3d57dee7 added claset thy_data;
wenzelm
parents: 0
diff changeset
    15
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    16
axioms
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    17
  classical: "(~P ==> P) ==> P"
4093
5e8f3d57dee7 added claset thy_data;
wenzelm
parents: 0
diff changeset
    18
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    19
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    20
subsection {* Lemmas and proof tools *}
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    21
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    22
use "FOL_lemmas1.ML"
12127
219e543496a3 theorems case_split = case_split_thm [case_names True False, cases type: o];
wenzelm
parents: 11988
diff changeset
    23
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
    24
10383
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    25
use "cladata.ML"
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    26
setup Cla.setup
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    27
setup clasetup
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 10130
diff changeset
    28
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    29
use "blastdata.ML"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    30
setup Blast.setup
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 5887
diff changeset
    31
use "FOL_lemmas2.ML"
9487
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    32
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    33
use "simpdata.ML"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    34
setup simpsetup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    35
setup "Simplifier.method_setup Splitter.split_modifiers"
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    36
setup Splitter.setup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    37
setup Clasimp.setup
7e377f912629 improved comments;
wenzelm
parents: 8643
diff changeset
    38
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    39
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    40
subsection {* Proof by cases and induction *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    41
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    42
text {* Proper handling of non-atomic rule statements. *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    43
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    44
constdefs
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    45
  induct_forall :: "('a => o) => o"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    46
  "induct_forall(P) == \<forall>x. P(x)"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    47
  induct_implies :: "o => o => o"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    48
  "induct_implies(A, B) == A --> B"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    49
  induct_equal :: "'a => 'a => o"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    50
  "induct_equal(x, y) == x = y"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    51
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    52
lemma induct_forall_eq: "(!!x. P(x)) == Trueprop(induct_forall(\<lambda>x. P(x)))"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    53
  by (simp only: atomize_all induct_forall_def)
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    54
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    55
lemma induct_implies_eq: "(A ==> B) == Trueprop(induct_implies(A, B))"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    56
  by (simp only: atomize_imp induct_implies_def)
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    57
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    58
lemma induct_equal_eq: "(x == y) == Trueprop(induct_equal(x, y))"
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    59
  by (simp only: atomize_eq induct_equal_def)
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    60
11988
8340fb172607 induct_impliesI;
wenzelm
parents: 11848
diff changeset
    61
lemma induct_impliesI: "(A ==> B) ==> induct_implies(A, B)"
8340fb172607 induct_impliesI;
wenzelm
parents: 11848
diff changeset
    62
  by (simp add: induct_implies_def)
8340fb172607 induct_impliesI;
wenzelm
parents: 11848
diff changeset
    63
12164
0b219d9e3384 induct_atomize: include atomize_conj (for mutual induction);
wenzelm
parents: 12160
diff changeset
    64
lemmas induct_atomize = atomize_conj induct_forall_eq induct_implies_eq induct_equal_eq
0b219d9e3384 induct_atomize: include atomize_conj (for mutual induction);
wenzelm
parents: 12160
diff changeset
    65
lemmas induct_rulify1 [symmetric, standard] = induct_forall_eq induct_implies_eq induct_equal_eq
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    66
lemmas induct_rulify2 = induct_forall_def induct_implies_def induct_equal_def
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    67
12240
0760eda193c4 induct method: localize rews for rule;
wenzelm
parents: 12164
diff changeset
    68
lemma all_conj_eq: "(ALL x. P(x)) & (ALL y. Q(y)) == (ALL x y. P(x) & Q(y))"
0760eda193c4 induct method: localize rews for rule;
wenzelm
parents: 12164
diff changeset
    69
  by simp
0760eda193c4 induct method: localize rews for rule;
wenzelm
parents: 12164
diff changeset
    70
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    71
hide const induct_forall induct_implies induct_equal
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    72
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    73
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    74
text {* Method setup. *}
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    75
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    76
ML {*
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    77
  structure InductMethod = InductMethodFun
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    78
  (struct
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    79
    val dest_concls = FOLogic.dest_concls;
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    80
    val cases_default = thm "case_split";
11988
8340fb172607 induct_impliesI;
wenzelm
parents: 11848
diff changeset
    81
    val local_impI = thm "induct_impliesI";
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    82
    val conjI = thm "conjI";
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    83
    val atomize = thms "induct_atomize";
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    84
    val rulify1 = thms "induct_rulify1";
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    85
    val rulify2 = thms "induct_rulify2";
12240
0760eda193c4 induct method: localize rews for rule;
wenzelm
parents: 12164
diff changeset
    86
    val localize = [Thm.symmetric (thm "induct_implies_def"),
0760eda193c4 induct method: localize rews for rule;
wenzelm
parents: 12164
diff changeset
    87
      Thm.symmetric (thm "atomize_all"), thm "all_conj_eq"];
11678
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    88
  end);
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    89
*}
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
setup InductMethod.setup
6aa3e2d26683 moved atomize stuff to theory IFOL;
wenzelm
parents: 11096
diff changeset
    92
4854
d1850e0964f2 tuned setup;
wenzelm
parents: 4793
diff changeset
    93
end