src/FOL/ex/Nat.thy
author clasohm
Mon, 05 Feb 1996 13:44:28 +0100
changeset 1473 e8d4606e6502
parent 1322 9b3d3362a048
child 3115 24ed05500380
permissions -rw-r--r--
expanded tabs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1473
e8d4606e6502 expanded tabs
clasohm
parents: 1322
diff changeset
     1
(*  Title:      FOL/ex/nat.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1473
e8d4606e6502 expanded tabs
clasohm
parents: 1322
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
Examples for the manual "Introduction to Isabelle"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
Theory of the natural numbers: Peano's axioms, primitive recursion
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
INCOMPATIBLE with nat2.thy, Nipkow's example
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
Nat = FOL +
352
fd3ab8bcb69d removal of obsolete type-declaration syntax
lcp
parents: 0
diff changeset
    14
types   nat
fd3ab8bcb69d removal of obsolete type-declaration syntax
lcp
parents: 0
diff changeset
    15
arities nat :: term
1322
9b3d3362a048 removed quotes from types in consts section
clasohm
parents: 352
diff changeset
    16
consts  "0" :: nat      ("0")
9b3d3362a048 removed quotes from types in consts section
clasohm
parents: 352
diff changeset
    17
        Suc :: nat=>nat  
9b3d3362a048 removed quotes from types in consts section
clasohm
parents: 352
diff changeset
    18
        rec :: [nat, 'a, [nat,'a]=>'a] => 'a  
9b3d3362a048 removed quotes from types in consts section
clasohm
parents: 352
diff changeset
    19
        "+" :: [nat, nat] => nat                (infixl 60)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
rules   induct      "[| P(0);  !!x. P(x) ==> P(Suc(x)) |]  ==> P(n)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
        Suc_inject  "Suc(m)=Suc(n) ==> m=n"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
        Suc_neq_0   "Suc(m)=0      ==> R"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
        rec_0       "rec(0,a,f) = a"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
        rec_Suc     "rec(Suc(m), a, f) = f(m, rec(m,a,f))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
        add_def     "m+n == rec(m, n, %x y. Suc(y))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
end