src/HOL/HOL.thy
author wenzelm
Sun, 15 Oct 2000 19:50:35 +0200
changeset 10220 2a726de6e124
parent 9970 dfe4747c8318
child 10383 a092ae7bb2a6
permissions -rw-r--r--
proper symbol markup with \isamath, \isatext; support sub/super scripts:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title:      HOL/HOL.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author:     Tobias Nipkow
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
     6
Higher-Order Logic.
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
     9
theory HOL = CPure
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
    10
files ("HOL_lemmas.ML") ("cladata.ML") ("blastdata.ML") ("simpdata.ML")
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
    11
  ("meson_lemmas.ML") ("Tools/meson.ML"):
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    13
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    14
(** Core syntax **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    15
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    16
global
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    17
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    18
classes "term" < logic
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    19
defaultsort "term"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    21
typedecl bool
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
arities
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    24
  bool :: "term"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    25
  fun :: ("term", "term") "term"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
consts
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    30
  (* Constants *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    32
  Trueprop      :: "bool => prop"                   ("(_)" 5)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    33
  Not           :: "bool => bool"                   ("~ _" [40] 40)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    34
  True          :: bool
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    35
  False         :: bool
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    36
  If            :: "[bool, 'a, 'a] => 'a"           ("(if (_)/ then (_)/ else (_))" 10)
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
    37
  arbitrary     :: 'a
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
  (* Binders *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    41
  Eps           :: "('a => bool) => 'a"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    42
  All           :: "('a => bool) => bool"           (binder "ALL " 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    43
  Ex            :: "('a => bool) => bool"           (binder "EX " 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    44
  Ex1           :: "('a => bool) => bool"           (binder "EX! " 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    45
  Let           :: "['a, 'a => 'b] => 'b"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    47
  (* Infixes *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    49
  "="           :: "['a, 'a] => bool"               (infixl 50)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    50
  &             :: "[bool, bool] => bool"           (infixr 35)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    51
  "|"           :: "[bool, bool] => bool"           (infixr 30)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    52
  -->           :: "[bool, bool] => bool"           (infixr 25)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    54
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    55
(* Overloaded Constants *)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    56
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
    57
axclass zero  < "term"
8940
55bc03d9f168 new type class "zero" so that 0 can be overloaded
paulson
parents: 8800
diff changeset
    58
axclass plus  < "term"
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    59
axclass minus < "term"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    60
axclass times < "term"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    61
axclass power < "term"
3370
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    62
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    63
consts
8940
55bc03d9f168 new type class "zero" so that 0 can be overloaded
paulson
parents: 8800
diff changeset
    64
  "0"           :: "('a::zero)"                     ("0")
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    65
  "+"           :: "['a::plus, 'a]  => 'a"          (infixl 65)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    66
  -             :: "['a::minus, 'a] => 'a"          (infixl 65)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    67
  uminus        :: "['a::minus] => 'a"              ("- _" [81] 80)
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
    68
  abs           :: "('a::minus) => 'a"
7426
e0be36ee7ab9 *: no quotes;
wenzelm
parents: 7369
diff changeset
    69
  *             :: "['a::times, 'a] => 'a"          (infixl 70)
3370
5c5fdce3a4e4 Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents: 3320
diff changeset
    70
  (*See Nat.thy for "^"*)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    71
8959
9d793220a46a installing the plus_ac0 axclass
paulson
parents: 8940
diff changeset
    72
axclass plus_ac0 < plus, zero
9d793220a46a installing the plus_ac0 axclass
paulson
parents: 8940
diff changeset
    73
    commute: "x + y = y + x"
9d793220a46a installing the plus_ac0 axclass
paulson
parents: 8940
diff changeset
    74
    assoc:   "(x + y) + z = x + (y + z)"
9d793220a46a installing the plus_ac0 axclass
paulson
parents: 8940
diff changeset
    75
    zero:    "0 + x = x"
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
    76
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
    77
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    78
(** Additional concrete syntax **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
    79
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
    80
nonterminals
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
  letbinds  letbind
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
  case_syn  cases_syn
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
syntax
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    85
  ~=            :: "['a, 'a] => bool"                    (infixl 50)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    86
  "_Eps"        :: "[pttrn, bool] => 'a"                 ("(3SOME _./ _)" [0, 10] 10)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
  (* Let expressions *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    89
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    90
  "_bind"       :: "[pttrn, 'a] => letbind"              ("(2_ =/ _)" 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    91
  ""            :: "letbind => letbinds"                 ("_")
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    92
  "_binds"      :: "[letbind, letbinds] => letbinds"     ("_;/ _")
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    93
  "_Let"        :: "[letbinds, 'a] => 'a"                ("(let (_)/ in (_))" 10)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    95
  (* Case expressions *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
9060
b0dd884b1848 rename @case to _case_syntax (improves on low-level errors);
wenzelm
parents: 8959
diff changeset
    97
  "_case_syntax":: "['a, cases_syn] => 'b"               ("(case _ of/ _)" 10)
b0dd884b1848 rename @case to _case_syntax (improves on low-level errors);
wenzelm
parents: 8959
diff changeset
    98
  "_case1"      :: "['a, 'b] => case_syn"                ("(2_ =>/ _)" 10)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
    99
  ""            :: "case_syn => cases_syn"               ("_")
9060
b0dd884b1848 rename @case to _case_syntax (improves on low-level errors);
wenzelm
parents: 8959
diff changeset
   100
  "_case2"      :: "[case_syn, cases_syn] => cases_syn"  ("_/ | _")
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
translations
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
   103
  "x ~= y"                == "~ (x = y)"
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
   104
  "SOME x. P"             == "Eps (%x. P)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
  "_Let (_binds b bs) e"  == "_Let b (_Let bs e)"
1114
c8dfb56a7e95 Prod is now a parent of Lfp.
nipkow
parents: 1068
diff changeset
   106
  "let x = a in e"        == "Let a (%x. e)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   108
syntax ("" output)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   109
  "op ="        :: "['a, 'a] => bool"                    ("(_ =/ _)" [51, 51] 50)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   110
  "op ~="       :: "['a, 'a] => bool"                    ("(_ ~=/ _)" [51, 51] 50)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   111
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   112
syntax (symbols)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   113
  Not           :: "bool => bool"                        ("\\<not> _" [40] 40)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   114
  "op &"        :: "[bool, bool] => bool"                (infixr "\\<and>" 35)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   115
  "op |"        :: "[bool, bool] => bool"                (infixr "\\<or>" 30)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   116
  "op -->"      :: "[bool, bool] => bool"                (infixr "\\<midarrow>\\<rightarrow>" 25)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   117
  "op ~="       :: "['a, 'a] => bool"                    (infixl "\\<noteq>" 50)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   118
  "ALL "        :: "[idts, bool] => bool"                ("(3\\<forall>_./ _)" [0, 10] 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   119
  "EX "         :: "[idts, bool] => bool"                ("(3\\<exists>_./ _)" [0, 10] 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   120
  "EX! "        :: "[idts, bool] => bool"                ("(3\\<exists>!_./ _)" [0, 10] 10)
9060
b0dd884b1848 rename @case to _case_syntax (improves on low-level errors);
wenzelm
parents: 8959
diff changeset
   121
  "_case1"      :: "['a, 'b] => case_syn"                ("(2_ \\<Rightarrow>/ _)" 10)
b0dd884b1848 rename @case to _case_syntax (improves on low-level errors);
wenzelm
parents: 8959
diff changeset
   122
(*"_case2"      :: "[case_syn, cases_syn] => cases_syn"  ("_/ \\<orelse> _")*)
2372
a2999e19703b fixed alternative quantifier symbol syntax;
wenzelm
parents: 2368
diff changeset
   123
9950
879e88b1e552 \<epsilon>: syntax (input);
wenzelm
parents: 9890
diff changeset
   124
syntax (input)
879e88b1e552 \<epsilon>: syntax (input);
wenzelm
parents: 9890
diff changeset
   125
  "_Eps"        :: "[pttrn, bool] => 'a"                 ("(3\\<epsilon>_./ _)" [0, 10] 10)
879e88b1e552 \<epsilon>: syntax (input);
wenzelm
parents: 9890
diff changeset
   126
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   127
syntax (symbols output)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   128
  "op ~="       :: "['a, 'a] => bool"                    ("(_ \\<noteq>/ _)" [51, 51] 50)
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3370
diff changeset
   129
6027
9dd06eeda95c added new print_mode "xsymbols" for extended symbol support
oheimb
parents: 5786
diff changeset
   130
syntax (xsymbols)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   131
  "op -->"      :: "[bool, bool] => bool"                (infixr "\\<longrightarrow>" 25)
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   132
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   133
syntax (HTML output)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   134
  Not           :: "bool => bool"                        ("\\<not> _" [40] 40)
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   135
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
   136
syntax (HOL)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   137
  "_Eps"        :: "[pttrn, bool] => 'a"                 ("(3@ _./ _)" [0, 10] 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   138
  "ALL "        :: "[idts, bool] => bool"                ("(3! _./ _)" [0, 10] 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   139
  "EX "         :: "[idts, bool] => bool"                ("(3? _./ _)" [0, 10] 10)
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   140
  "EX! "        :: "[idts, bool] => bool"                ("(3?! _./ _)" [0, 10] 10)
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
   141
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 7220
diff changeset
   142
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6289
diff changeset
   143
2260
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   144
(** Rules and definitions **)
b59781f2b809 added symbols syntax;
wenzelm
parents: 1674
diff changeset
   145
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
   146
local
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3842
diff changeset
   147
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   148
axioms
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   149
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   150
  eq_reflection: "(x=y) ==> (x==y)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   151
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   152
  (* Basic Rules *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   153
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   154
  refl:         "t = (t::'a)"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   155
  subst:        "[| s = t; P(s) |] ==> P(t::'a)"
6289
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   156
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   157
  (*Extensionality is built into the meta-logic, and this rule expresses
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   158
    a related property.  It is an eta-expanded version of the traditional
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   159
    rule, and similar to the ABS rule of HOL.*)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   160
  ext:          "(!!x::'a. (f x ::'b) = g x) ==> (%x. f x) = (%x. g x)"
6289
062aa156a300 added a commment on the "ext" rule
paulson
parents: 6027
diff changeset
   161
9970
dfe4747c8318 the final renaming: selectI -> someI
paulson
parents: 9950
diff changeset
   162
  someI:        "P (x::'a) ==> P (@x. P x)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   163
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   164
  impI:         "(P ==> Q) ==> P-->Q"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   165
  mp:           "[| P-->Q;  P |] ==> Q"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   166
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   167
defs
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   168
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   169
  True_def:     "True      == ((%x::bool. x) = (%x. x))"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   170
  All_def:      "All(P)    == (P = (%x. True))"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   171
  Ex_def:       "Ex(P)     == P(@x. P(x))"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   172
  False_def:    "False     == (!P. P)"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   173
  not_def:      "~ P       == P-->False"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   174
  and_def:      "P & Q     == !R. (P-->Q-->R) --> R"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   175
  or_def:       "P | Q     == !R. (P-->R) --> (Q-->R) --> R"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   176
  Ex1_def:      "Ex1(P)    == ? x. P(x) & (! y. P(y) --> y=x)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   177
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   178
axioms
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   179
  (* Axioms *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   180
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   181
  iff:          "(P-->Q) --> (Q-->P) --> (P=Q)"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   182
  True_or_False:  "(P=True) | (P=False)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   183
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   184
defs
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   185
  (*misc definitions*)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   186
  Let_def:      "Let s f == f(s)"
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   187
  if_def:       "If P x y == @z::'a. (P=True --> z=x) & (P=False --> z=y)"
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   188
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   189
  (*arbitrary is completely unspecified, but is made to appear as a
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4868
diff changeset
   190
    definition syntactically*)
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   191
  arbitrary_def:  "False ==> arbitrary == (@x. False)"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   192
3320
3a5e4930fb77 Added `arbitrary'
nipkow
parents: 3248
diff changeset
   193
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   194
7357
d0e16da40ea2 proper bootstrap of HOL theory and packages;
wenzelm
parents: 7238
diff changeset
   195
(* theory and package setup *)
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   196
9736
332fab43628f Fixed rulify.
nipkow
parents: 9713
diff changeset
   197
use "HOL_lemmas.ML"
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   198
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   199
use "cladata.ML"
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   200
setup hypsubst_setup
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   201
setup Classical.setup
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   202
setup clasetup
9488
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   203
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   204
lemma all_eq: "(!!x. P x) == Trueprop (ALL x. P x)"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   205
proof (rule equal_intr_rule)
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   206
  assume "!!x. P x"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   207
  show "ALL x. P x" ..
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   208
next
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   209
  assume "ALL x. P x"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   210
  thus "!!x. P x" ..
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   211
qed
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   212
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   213
lemma imp_eq: "(A ==> B) == Trueprop (A --> B)"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   214
proof (rule equal_intr_rule)
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   215
  assume r: "A ==> B"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   216
  show "A --> B"
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   217
    by (rule) (rule r)
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   218
next
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   219
  assume "A --> B" and A
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   220
  thus B ..
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   221
qed
f11bece4e2db added all_eq, imp_eq (for blast);
wenzelm
parents: 9352
diff changeset
   222
9529
d9434a9277a4 lemmas atomize = all_eq imp_eq;
wenzelm
parents: 9488
diff changeset
   223
lemmas atomize = all_eq imp_eq
d9434a9277a4 lemmas atomize = all_eq imp_eq;
wenzelm
parents: 9488
diff changeset
   224
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   225
use "blastdata.ML"
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   226
setup Blast.setup
4868
843a9f5b3c3d nonterminals;
wenzelm
parents: 4793
diff changeset
   227
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   228
use "simpdata.ML"
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   229
setup Simplifier.setup
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   230
setup "Simplifier.method_setup Splitter.split_modifiers" setup simpsetup
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   231
setup Splitter.setup setup Clasimp.setup
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   232
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   233
use "meson_lemmas.ML"
9839
da5ca8b30244 loads Tools/meson.ML: meson_tac installed by default
paulson
parents: 9736
diff changeset
   234
use "Tools/meson.ML"
9869
95dca9f991f2 improved meson setup;
wenzelm
parents: 9852
diff changeset
   235
setup meson_setup
9839
da5ca8b30244 loads Tools/meson.ML: meson_tac installed by default
paulson
parents: 9736
diff changeset
   236
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   237
end