author  paulson 
Tue, 01 Jul 2003 10:50:26 +0200  
changeset 14085  8dc3e532959a 
parent 13550  5a176b8dda84 
child 14156  2072802ab0e3 
permissions  rwrr 
9487  1 
(* Title: FOL/FOL.thy 
2 
ID: $Id$ 

3 
Author: Lawrence C Paulson and Markus Wenzel 

11678  4 
*) 
9487  5 

11678  6 
header {* Classical firstorder logic *} 
4093  7 

7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
5887
diff
changeset

8 
theory FOL = IFOL 
9487  9 
files 
10 
("FOL_lemmas1.ML") ("cladata.ML") ("blastdata.ML") 

11 
("simpdata.ML") ("FOL_lemmas2.ML"): 

12 

13 

14 
subsection {* The classical axiom *} 

4093  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  18 

9487  19 

11678  20 
subsection {* Lemmas and proof tools *} 
9487  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  24 

10383  25 
use "cladata.ML" 
26 
setup Cla.setup 

27 
setup clasetup 

28 

9487  29 
use "blastdata.ML" 
30 
setup Blast.setup 

13550  31 

32 

33 
lemma ex1_functional: "[ EX! z. P(a,z); P(a,b); P(a,c) ] ==> b = c" 

34 
by blast 

35 

36 
ML {* 

37 
val ex1_functional = thm "ex1_functional"; 

38 
*} 

9487  39 

40 
use "simpdata.ML" 

41 
setup simpsetup 

42 
setup "Simplifier.method_setup Splitter.split_modifiers" 

43 
setup Splitter.setup 

44 
setup Clasimp.setup 

45 

14085  46 
subsection {* Other simple lemmas *} 
47 

48 
lemma [simp]: "((P>R) <> (Q>R)) <> ((P<>Q)  R)" 

49 
by blast 

50 

51 
lemma [simp]: "((P>Q) <> (P>R)) <> (P > (Q<>R))" 

52 
by blast 

53 

54 
lemma not_disj_iff_imp: "~P  Q <> (P>Q)" 

55 
by blast 

56 

57 
(** Monotonicity of implications **) 

58 

59 
lemma conj_mono: "[ P1>Q1; P2>Q2 ] ==> (P1&P2) > (Q1&Q2)" 

60 
by fast (*or (IntPr.fast_tac 1)*) 

61 

62 
lemma disj_mono: "[ P1>Q1; P2>Q2 ] ==> (P1P2) > (Q1Q2)" 

63 
by fast (*or (IntPr.fast_tac 1)*) 

64 

65 
lemma imp_mono: "[ Q1>P1; P2>Q2 ] ==> (P1>P2)>(Q1>Q2)" 

66 
by fast (*or (IntPr.fast_tac 1)*) 

67 

68 
lemma imp_refl: "P>P" 

69 
by (rule impI, assumption) 

70 

71 
(*The quantifier monotonicity rules are also intuitionistically valid*) 

72 
lemma ex_mono: "(!!x. P(x) > Q(x)) ==> (EX x. P(x)) > (EX x. Q(x))" 

73 
by blast 

74 

75 
lemma all_mono: "(!!x. P(x) > Q(x)) ==> (ALL x. P(x)) > (ALL x. Q(x))" 

76 
by blast 

77 

11678  78 

79 
subsection {* Proof by cases and induction *} 

80 

81 
text {* Proper handling of nonatomic rule statements. *} 

82 

83 
constdefs 

84 
induct_forall :: "('a => o) => o" 

85 
"induct_forall(P) == \<forall>x. P(x)" 

86 
induct_implies :: "o => o => o" 

87 
"induct_implies(A, B) == A > B" 

88 
induct_equal :: "'a => 'a => o" 

89 
"induct_equal(x, y) == x = y" 

90 

91 
lemma induct_forall_eq: "(!!x. P(x)) == Trueprop(induct_forall(\<lambda>x. P(x)))" 

92 
by (simp only: atomize_all induct_forall_def) 

93 

94 
lemma induct_implies_eq: "(A ==> B) == Trueprop(induct_implies(A, B))" 

95 
by (simp only: atomize_imp induct_implies_def) 

96 

97 
lemma induct_equal_eq: "(x == y) == Trueprop(induct_equal(x, y))" 

98 
by (simp only: atomize_eq induct_equal_def) 

99 

11988  100 
lemma induct_impliesI: "(A ==> B) ==> induct_implies(A, B)" 
101 
by (simp add: induct_implies_def) 

102 

12164
0b219d9e3384
induct_atomize: include atomize_conj (for mutual induction);
wenzelm
parents:
12160
diff
changeset

103 
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

104 
lemmas induct_rulify1 [symmetric, standard] = induct_forall_eq induct_implies_eq induct_equal_eq 
11678  105 
lemmas induct_rulify2 = induct_forall_def induct_implies_def induct_equal_def 
106 

12240  107 
lemma all_conj_eq: "(ALL x. P(x)) & (ALL y. Q(y)) == (ALL x y. P(x) & Q(y))" 
108 
by simp 

109 

11678  110 
hide const induct_forall induct_implies induct_equal 
111 

112 

113 
text {* Method setup. *} 

114 

115 
ML {* 

116 
structure InductMethod = InductMethodFun 

117 
(struct 

118 
val dest_concls = FOLogic.dest_concls; 

119 
val cases_default = thm "case_split"; 

11988  120 
val local_impI = thm "induct_impliesI"; 
11678  121 
val conjI = thm "conjI"; 
122 
val atomize = thms "induct_atomize"; 

123 
val rulify1 = thms "induct_rulify1"; 

124 
val rulify2 = thms "induct_rulify2"; 

12240  125 
val localize = [Thm.symmetric (thm "induct_implies_def"), 
126 
Thm.symmetric (thm "atomize_all"), thm "all_conj_eq"]; 

11678  127 
end); 
128 
*} 

129 

130 
setup InductMethod.setup 

131 

4854  132 
end 