3115
|
1 |
(* Title: FOL/ex/Nat.thy
|
0
|
2 |
ID: $Id$
|
1473
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
0
|
4 |
Copyright 1992 University of Cambridge
|
|
5 |
*)
|
|
6 |
|
17245
|
7 |
header {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
|
|
8 |
|
|
9 |
theory Nat
|
|
10 |
imports FOL
|
|
11 |
begin
|
|
12 |
|
|
13 |
typedecl nat
|
|
14 |
arities nat :: "term"
|
|
15 |
|
|
16 |
consts
|
|
17 |
0 :: nat ("0")
|
|
18 |
Suc :: "nat => nat"
|
|
19 |
rec :: "[nat, 'a, [nat,'a]=>'a] => 'a"
|
|
20 |
add :: "[nat, nat] => nat" (infixl "+" 60)
|
|
21 |
|
|
22 |
axioms
|
|
23 |
induct: "[| P(0); !!x. P(x) ==> P(Suc(x)) |] ==> P(n)"
|
|
24 |
Suc_inject: "Suc(m)=Suc(n) ==> m=n"
|
|
25 |
Suc_neq_0: "Suc(m)=0 ==> R"
|
|
26 |
rec_0: "rec(0,a,f) = a"
|
|
27 |
rec_Suc: "rec(Suc(m), a, f) = f(m, rec(m,a,f))"
|
|
28 |
add_def: "m+n == rec(m, n, %x y. Suc(y))"
|
|
29 |
|
|
30 |
ML {* use_legacy_bindings (the_context ()) *}
|
|
31 |
|
0
|
32 |
end
|