# HG changeset patch # User wenzelm # Date 1551800412 -3600 # Node ID 01732226987a4b720101a53afd45f2bac7d39da2 # Parent c28da0820b8b4ae3eed5d9b0ab1ef54282bb98a6 misc tuning and modernization; diff -r c28da0820b8b -r 01732226987a src/FOL/ex/Nat.thy --- a/src/FOL/ex/Nat.thy Tue Mar 05 14:45:27 2019 +0100 +++ b/src/FOL/ex/Nat.thy Tue Mar 05 16:40:12 2019 +0100 @@ -6,7 +6,7 @@ section \Theory of the natural numbers: Peano's axioms, primitive recursion\ theory Nat -imports FOL + imports FOL begin typedecl nat @@ -14,17 +14,17 @@ axiomatization Zero :: \nat\ (\0\) and - Suc :: \nat => nat\ and - rec :: \[nat, 'a, [nat, 'a] => 'a] => 'a\ + Suc :: \nat \ nat\ and + rec :: \[nat, 'a, [nat, 'a] \ 'a] \ 'a\ where - induct: \[| P(0); !!x. P(x) ==> P(Suc(x)) |] ==> P(n)\ and - Suc_inject: \Suc(m)=Suc(n) ==> m=n\ and - Suc_neq_0: \Suc(m)=0 ==> R\ and + induct: \\P(0); \x. P(x) \ P(Suc(x))\ \ P(n)\ and + Suc_inject: \Suc(m)=Suc(n) \ m=n\ and + Suc_neq_0: \Suc(m)=0 \ R\ and rec_0: \rec(0,a,f) = a\ and rec_Suc: \rec(Suc(m), a, f) = f(m, rec(m,a,f))\ -definition add :: \[nat, nat] => nat\ (infixl \+\ 60) - where \m + n == rec(m, n, %x y. Suc(y))\ +definition add :: \[nat, nat] \ nat\ (infixl \+\ 60) + where \m + n \ rec(m, n, \x y. Suc(y))\ subsection \Proofs about the natural numbers\ @@ -76,7 +76,7 @@ done lemma - assumes prem: \!!n. f(Suc(n)) = Suc(f(n))\ + assumes prem: \\n. f(Suc(n)) = Suc(f(n))\ shows \f(i+j) = i+f(j)\ apply (rule_tac n = \i\ in induct) apply simp diff -r c28da0820b8b -r 01732226987a src/FOL/ex/Nat_Class.thy --- a/src/FOL/ex/Nat_Class.thy Tue Mar 05 14:45:27 2019 +0100 +++ b/src/FOL/ex/Nat_Class.thy Tue Mar 05 16:40:12 2019 +0100 @@ -2,17 +2,19 @@ Author: Markus Wenzel, TU Muenchen *) +section \Theory of the natural numbers: Peano's axioms, primitive recursion\ + theory Nat_Class -imports FOL + imports FOL begin text \ - This is an abstract version of theory \Nat\. Instead of axiomatizing a - single type \nat\ we define the class of all these types (up to + This is an abstract version of \<^file>\Nat.thy\. Instead of axiomatizing a + single type \nat\, it defines the class of all these types (up to isomorphism). - Note: The \rec\ operator had to be made \<^emph>\monomorphic\, because class axioms - may not contain more than one type variable. + Note: The \rec\ operator has been made \<^emph>\monomorphic\, because class + axioms cannot contain more than one type variable. \ class nat =