src/FOL/IFOL.thy
author wenzelm
Thu, 04 Oct 2001 15:28:00 +0200
changeset 11677 ee12f18599e5
parent 9886 897d6602cbfb
child 11734 7a21bf539412
permissions -rw-r--r--
atomize stuff from theory FOL; tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1268
f6ef556b3ede corrected title
clasohm
parents: 928
diff changeset
     1
(*  Title:      FOL/IFOL.thy
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
     2
    ID:         $Id$
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     3
    Author:     Lawrence C Paulson and Markus Wenzel
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     4
*)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
     5
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
     6
header {* Intuitionistic first-order logic *}
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
     7
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
     8
theory IFOL = Pure
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
     9
files ("IFOL_lemmas.ML") ("fologic.ML") ("hypsubstdata.ML") ("intprover.ML"):
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    10
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    12
subsection {* Syntax and axiomatic basis *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    13
3906
5ae0e1324c56 global;
wenzelm
parents: 3835
diff changeset
    14
global
5ae0e1324c56 global;
wenzelm
parents: 3835
diff changeset
    15
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    16
classes "term" < logic
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    17
defaultsort "term"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    19
typedecl o
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    20
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    21
consts
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    23
  Trueprop      :: "o => prop"                  ("(_)" 5)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    24
  True          :: o
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    25
  False         :: o
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    26
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    27
  (* Connectives *)
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    28
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    29
  "="           :: "['a, 'a] => o"              (infixl 50)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
    30
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    31
  Not           :: "o => o"                     ("~ _" [40] 40)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    32
  &             :: "[o, o] => o"                (infixr 35)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    33
  "|"           :: "[o, o] => o"                (infixr 30)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    34
  -->           :: "[o, o] => o"                (infixr 25)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    35
  <->           :: "[o, o] => o"                (infixr 25)
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    36
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    37
  (* Quantifiers *)
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    38
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    39
  All           :: "('a => o) => o"             (binder "ALL " 10)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    40
  Ex            :: "('a => o) => o"             (binder "EX " 10)
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    41
  Ex1           :: "('a => o) => o"             (binder "EX! " 10)
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    42
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
928
cb31a4e97f75 Moved declaration of ~= to a syntax section
lcp
parents: 278
diff changeset
    44
syntax
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    45
  "~="          :: "['a, 'a] => o"              (infixl 50)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
    46
translations
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    47
  "x ~= y"      == "~ (x = y)"
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    48
2257
c8154379738c symbol names changes;
wenzelm
parents: 2205
diff changeset
    49
syntax (symbols)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    50
  Not           :: "o => o"                     ("\<not> _" [40] 40)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    51
  "op &"        :: "[o, o] => o"                (infixr "\<and>" 35)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    52
  "op |"        :: "[o, o] => o"                (infixr "\<or>" 30)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    53
  "op -->"      :: "[o, o] => o"                (infixr "\<midarrow>\<rightarrow>" 25)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    54
  "op <->"      :: "[o, o] => o"                (infixr "\<leftarrow>\<rightarrow>" 25)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    55
  "ALL "        :: "[idts, o] => o"             ("(3\<forall>_./ _)" [0, 10] 10)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    56
  "EX "         :: "[idts, o] => o"             ("(3\<exists>_./ _)" [0, 10] 10)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    57
  "EX! "        :: "[idts, o] => o"             ("(3\<exists>!_./ _)" [0, 10] 10)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    58
  "op ~="       :: "['a, 'a] => o"              (infixl "\<noteq>" 50)
2205
c5a7c72746ac added symbolfont syntax;
wenzelm
parents: 1322
diff changeset
    59
6027
9dd06eeda95c added new print_mode "xsymbols" for extended symbol support
oheimb
parents: 4854
diff changeset
    60
syntax (xsymbols)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    61
  "op -->"      :: "[o, o] => o"                (infixr "\<longrightarrow>" 25)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    62
  "op <->"      :: "[o, o] => o"                (infixr "\<longleftrightarrow>" 25)
35
d71f96f1780e ifol.thy: added ~= for "not equals"
lcp
parents: 0
diff changeset
    63
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6027
diff changeset
    64
syntax (HTML output)
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
    65
  Not           :: "o => o"                     ("\<not> _" [40] 40)
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6027
diff changeset
    66
7d5cbd5819a0 HTML output;
wenzelm
parents: 6027
diff changeset
    67
3932
wenzelm
parents: 3906
diff changeset
    68
local
3906
5ae0e1324c56 global;
wenzelm
parents: 3835
diff changeset
    69
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    70
axioms
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    72
  (* Equality *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    74
  refl:         "a=a"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    75
  subst:        "[| a=b;  P(a) |] ==> P(b)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    77
  (* Propositional logic *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    79
  conjI:        "[| P;  Q |] ==> P&Q"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    80
  conjunct1:    "P&Q ==> P"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    81
  conjunct2:    "P&Q ==> Q"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    83
  disjI1:       "P ==> P|Q"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    84
  disjI2:       "Q ==> P|Q"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    85
  disjE:        "[| P|Q;  P ==> R;  Q ==> R |] ==> R"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    87
  impI:         "(P ==> Q) ==> P-->Q"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    88
  mp:           "[| P-->Q;  P |] ==> Q"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    90
  FalseE:       "False ==> P"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    91
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    93
  (* Definitions *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    95
  True_def:     "True  == False-->False"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    96
  not_def:      "~P    == P-->False"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
    97
  iff_def:      "P<->Q == (P-->Q) & (Q-->P)"
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    98
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
    99
  (* Unique existence *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   101
  ex1_def:      "EX! x. P(x) == EX x. P(x) & (ALL y. P(y) --> y=x)"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   102
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
79
74e68ed3b4fd added white-space;
wenzelm
parents: 35
diff changeset
   104
  (* Quantifiers *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   106
  allI:         "(!!x. P(x)) ==> (ALL x. P(x))"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   107
  spec:         "(ALL x. P(x)) ==> P(x)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   109
  exI:          "P(x) ==> (EX x. P(x))"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   110
  exE:          "[| EX x. P(x);  !!x. P(x) ==> R |] ==> R"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
  (* Reflection *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   114
  eq_reflection:  "(x=y)   ==> (x==y)"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   115
  iff_reflection: "(P<->Q) ==> (P==Q)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
4092
9faf228771dc added simpset thy_data;
wenzelm
parents: 3932
diff changeset
   117
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   118
subsection {* Lemmas and proof tools *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   119
9886
897d6602cbfb updated setup;
wenzelm
parents: 9526
diff changeset
   120
setup Simplifier.setup
897d6602cbfb updated setup;
wenzelm
parents: 9526
diff changeset
   121
use "IFOL_lemmas.ML"
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   122
use "fologic.ML"
9886
897d6602cbfb updated setup;
wenzelm
parents: 9526
diff changeset
   123
use "hypsubstdata.ML"
897d6602cbfb updated setup;
wenzelm
parents: 9526
diff changeset
   124
setup hypsubst_setup
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   125
use "intprover.ML"
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 6340
diff changeset
   126
4092
9faf228771dc added simpset thy_data;
wenzelm
parents: 3932
diff changeset
   127
11677
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   128
subsection {* Atomizing meta-level rules *}
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   129
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   130
lemma atomize_all: "(!!x. P(x)) == Trueprop (ALL x. P(x))"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   131
proof (rule equal_intr_rule)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   132
  assume "!!x. P(x)"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   133
  show "ALL x. P(x)" by (rule allI)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   134
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   135
  assume "ALL x. P(x)"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   136
  thus "!!x. P(x)" by (rule allE)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   137
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   138
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   139
lemma atomize_imp: "(A ==> B) == Trueprop (A --> B)"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   140
proof (rule equal_intr_rule)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   141
  assume r: "A ==> B"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   142
  show "A --> B" by (rule impI) (rule r)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   143
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   144
  assume "A --> B" and A
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   145
  thus B by (rule mp)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   146
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   147
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   148
lemma atomize_eq: "(x == y) == Trueprop (x = y)"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   149
proof (rule equal_intr_rule)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   150
  assume "x == y"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   151
  show "x = y" by (unfold prems) (rule refl)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   152
next
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   153
  assume "x = y"
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   154
  thus "x == y" by (rule eq_reflection)
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   155
qed
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   156
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   157
lemmas atomize = atomize_all atomize_imp
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   158
lemmas atomize' = atomize atomize_eq
ee12f18599e5 atomize stuff from theory FOL;
wenzelm
parents: 9886
diff changeset
   159
4854
d1850e0964f2 tuned setup;
wenzelm
parents: 4793
diff changeset
   160
end