In this discussion we applied our proof methods, for both the propositional and predicate calculi, to prove some statements about numbers and strings.
First, recall the definitions of a string over a fixed alphabet, the concatenation of two strings, and the reversal wR of a string w (which is w written backwards). We will assume the following two facts, which we aren't prepared to prove yet:
A palindrome is a string w such that wR = 2. Examples the empty string λ, "hannah", and a statement attributed to Napoleon, "Able was I ere I saw Elba", which is a palindrome as long as we ignore capitalization. We'll write Pal(w) to mean "w is a palindrome".
One string is a prefix of another if you can make the second by concatenating some string onto the first -- using quantifiers:
Pre(u,v) ↔ ∃w:(uw=v)
∀x:forall;y: [Odd(x) ∧ Odd(y)] → [Even(x+y) ∧ Odd(xy)]
Since we want to prove a universal statement, we start by letting a and b
we arbitrary naturals. We assume Odd(a) and Odd(b) to start a direct proof
of the implication [Odd(a) ∧ Odd(b)] → [Even(a+b) ∧ Odd(ab)].
By the definition of Odd, we have ∃c:a = 2c+1 and ∃d: b = 2d+1.
By Instantiation, let c and d be naturals such that a = 2c+1 and b = 2d+1.
By arithmetic, a+b = 2c + 2d + 2 = 2(c+d+1). By Existence, letting e = c+d+1,
we get that ∃e: a+b = 2e which is the definition of Even(a+b). By more
arithmetic, ab = (2c+1)(2d+1) = 4cd + 2c + 2d + 1 = 2(2cd+c+d) + 1. Using
Existence with
f = 2cd+c+d, we have ∃f: ab = 2f+1 which is the definition of Odd(ab).
Assuming Odd(a) ∧ Odd(b), we have proved Even(a+b) ∧ Odd(ab), so we
have proved the desired implication by direct proof.
Since a and b were arbitrary, by Generalization we may conclude
∀x:∀y:[Odd(x) ∧ Odd(y)] → [Even(x+y) ∧ Odd(ab)].
∀x:∃y: Pre(x,y) ∧ Pal(y)
This one is tricky in that the first step of the formal proof requires us
to decide what u is going to be. But note that u is going to have the property
that for any v, we can find a w to make v = (uw)R true. If v
happens to be empty, uw will have to be empty and thus u will have to be empty.
Last modified 26 September 2007