-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added examples; linked to website; fixed bugs
- Loading branch information
Showing
6 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/# | ||
Results about natural numbers. Needs expansion! | ||
#/ | ||
|
||
include "peano.oak" | ||
|
||
# natural numbers are closed under addition | ||
nat_closed_addition: for all a,b in N, a+b is in N | ||
proof | ||
# define a property to be used for induction | ||
P_def: for some P, for all a in N, | ||
P(a) iff for all b in N, a+b is in N | ||
by comprehension | ||
|
||
P(0) by P_def, peano # base case | ||
|
||
1: take any a in N | ||
2: suppose P(a) # induction hypothesis | ||
3: take any b in N | ||
a+b is in N by P_def, 1, 2, 3 | ||
so (a+b)+1 is in N by peano | ||
so (a+1)+b is in N by peano, 1, 3 | ||
end | ||
so P(a+1) by P_def, peano, 1 | ||
end | ||
end | ||
|
||
so for all a in N, P(a) by induction | ||
so thesis by P_def | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/# | ||
"Enhanced" Peano axioms adapted from: | ||
|
||
Kaye, Richard (1991). Models of Peano Arithmetic. Pages 16-18. | ||
|
||
We include a comprehension schema for definitions. This also allows | ||
induction to be a statement rather than a schema. | ||
#/ | ||
|
||
peano: axiom | ||
|
||
0 is in N and ( | ||
1 is in N ) and ( | ||
for all x in N, x+1 is in N ) and ( | ||
|
||
for all x,y,z in N, (x+y)+z = x+(y+z) ) and ( # + is associative | ||
for all x,y in N, x+y = y+x ) and ( # + is commutative | ||
for all x,y,z in N, (x*y)*z = x*(y*z) ) and ( # * is associative | ||
for all x,y in N, x*y = y*x ) and ( # * is commutative | ||
for all x,y,z in N, x*(y+z) = x*y + x*z ) and ( # * distributes over + | ||
for all x in N, x+0 = x and x*0 = 0 ) and ( # identity of 0 | ||
for all x in N, x*1 = x ) # identity of 1 | ||
|
||
induction: axiom for all P, | ||
if P[0] and | ||
for all n in N, P[n] implies P[n+1] | ||
then | ||
for all n in N, P[n] | ||
|
||
comprehension: axiom schema | ||
for all meta P,n,φ such that not free[P,φ], | ||
`for some P, for all n in N, P[n] iff φ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
DIR="$(dirname "$0")" | ||
DIR=$(dirname "$0") | ||
|
||
# use local ruby if available | ||
if [ -d "$DIR/ruby" ]; then | ||
RUBY=$DIR/ruby/bin/ruby | ||
if hash ruby 2>/dev/null; then | ||
ruby "$DIR/lib/oak.rb" "$@" | ||
else | ||
RUBY=ruby | ||
echo "error: could not find \"ruby\"" | ||
echo "Oak requires the Ruby programming language to be installed." | ||
fi | ||
|
||
$RUBY $DIR/lib/oak.rb "$@" |