src/FOLP/ex/Nat.thy
author wenzelm
Sun, 18 Sep 2005 14:25:48 +0200
changeset 17480 fd19f77dcf60
parent 1477 4c51ab632cda
child 25991 31b38a39e589
permissions -rw-r--r--
converted to Isar theory format;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1477
4c51ab632cda expanded tabs
clasohm
parents: 1149
diff changeset
     1
(*  Title:      FOLP/ex/nat.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1477
4c51ab632cda expanded tabs
clasohm
parents: 1149
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
     7
header {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
     8
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
     9
theory Nat
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    10
imports FOLP
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    11
begin
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    12
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    13
typedecl nat
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    14
arities nat         :: "term"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
consts  "0"         :: "nat"    ("0")
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
        Suc         :: "nat=>nat"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
        rec         :: "[nat, 'a, [nat,'a]=>'a] => 'a"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
        "+"         :: "[nat, nat] => nat"              (infixl 60)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
  (*Proof terms*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
       nrec         :: "[nat,p,[nat,p]=>p]=>p"
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    22
       ninj         :: "p=>p"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    23
       nneq         :: "p=>p"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    24
       rec0         :: "p"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    25
       recSuc       :: "p"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    26
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    27
axioms
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    28
  induct:     "[| b:P(0); !!x u. u:P(x) ==> c(x,u):P(Suc(x))
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    29
              |] ==> nrec(n,b,c):P(n)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    31
  Suc_inject: "p:Suc(m)=Suc(n) ==> ninj(p) : m=n"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    32
  Suc_neq_0:  "p:Suc(m)=0      ==> nneq(p) : R"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    33
  rec_0:      "rec0 : rec(0,a,f) = a"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    34
  rec_Suc:    "recSuc : rec(Suc(m), a, f) = f(m, rec(m,a,f))"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    35
  add_def:    "m+n == rec(m, n, %x y. Suc(y))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    37
  nrecB0:     "b: A ==> nrec(0,b,c) = b : A"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    38
  nrecBSuc:   "c(n,nrec(n,b,c)) : A ==> nrec(Suc(n),b,c) = c(n,nrec(n,b,c)) : A"
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    39
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    40
ML {* use_legacy_bindings (the_context ()) *}
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 1477
diff changeset
    41
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
end