Last bit on Inference rules.

Often one mixes quantified and unquantified statements...

then we play the same game as before...

(exists) x (C(x) ^  ~B(x))
(forall) x (C(x) --> P(X))
--------------------------
(exists) x (P(x) ^  ~B(x))

1. (exists) x (C(x) ^  ~B(x))  Premise
2. C(a) ^ ~(B(a)), for some element a,  Existential Instantiation,1
3. C(a),                       simplification
4. (forall) x (C(x) --> P(X))  premise
5. C(a) --> P(a)               Universal Instantiation
6. P(a)                        3,5, Modus Ponens.
7. ~B(a)		       2, Simplification
8. (P(a) ^  ~B(a))             6,7 conjunction
9. (exists) x (P(x) ^  ~B(x))  8, Existential Generalization 

------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------

Proofs.

Direct Proofs. Indirect Proofs, and proofs by contradiction.

Suppose that you want to prove the statement

P --> Q

you need to show "If P is true, then Q is true".

In a direct proof, you assume that P is true, then use inference rules
and other facts to prove that Q is true.

"really, what you are doing is proving then following"

(P ^ all the math facts that have ever been discovered to be always true) --> Q


Now... "all the math facts..." should worry you.  If you are ever
stuck trying to prove something, you should look through the relevant
chapter of the book and see if there is some math fact you are
missing... or how to FORMALLY express some math fact.

For instance (math fact #1):

Let P(n) be the predicate "n is even".

How do you express this?
  P(n) = (exists) a, n = 2a

Our First Proof:

Prove P(14).
(exists) a, 2a = 14          definition of P.

1. choose a = 7, 2(7) = 14.     math.
2. (exists) a, 2a = 14          existential generalization.

Our second proof:

Prove If n is an odd integer, then n2 is an odd integer.

1. Suppose n is an odd integer.
2. exists a such that n = 2a + 1.        
3. n2 = (2a + 1)2
4.    = 4a2 + 4a + 1
5.    = 2(a2+2a) + 1
6. n2 = 2b + 1, for b = a2+2a
7. exists b, n2 = 2b + 1
8. so n is odd --> n2 is odd

QED (quod erat demonstrandum Latin for "what was to be proven". ).
  Yatta!  success!  little black box. or, bizarrely in your book, a
  little triangle.


did we forget anything?

in line 7 we said that we had found and INTEGER b...  is b an integer?

well, yes:  b = a2 + 2a  and (math fact #2), 

the integers are "closed under addition and multiplication".

They are not, for instance, closed under division.

------------------------------------------------------------------------
slightly harder proof?

If a and b are real numbers, then a2 + b2 >= 2ab. 

prove (forall) a,b XXXX

Math Fact #3, forall real numbers a, a squared >= 0.
              forall real numbers a != 0, a squared > 0.
----------------------------------------------------------------------

Prove: The sum of two rational numbers is a rational number. 

Math Fact #4, P(n): n is "rational" <==> (exists) a, (exists)b, n =
a/b

----------------------------------------------------------------------
----------------------------------------------------------------------

Sometimes, it is HARD to do a direct proof.  In these cases, you can
perhaps "apply a logical equivalence" to the formula you are trying to
prove, then prove this equivalent formula.  This is called an
"indirect proof".

an indirect proof of P --> Q is:

~Q --> ~P

so, assume Q is false, and show that then P is false.

remember, that we always use other math facts in our proof so this is
  really:

  (P ^ math) --> Q    <==>    ~Q --> ~(P ^ math)

  ~Q --> (~P v ~math)

  so you can show that your assumption is violated, or some other
  contradiction with known math facts...

ok, now an example of an indirect proof:

If n is an integer and n2 is odd, then n is odd.

  try direct proof.
  try indirect proof.


-------------------------------------------------------------------------
  
Another indirect proof:

There are 41 Home Blues Hockey games.  Prove that at least 6 of them
must be on the same day of the week.

-------------------------------------------------------------------------

Proof by contradiction:  (similar to above, but no premise P)... just:

math --> Q
~Q --> ~math

so assume ~Q and prove any contradiction to known math facts...

-------------------------------------------------------------------------

Theorem. There are infinitely many prime numbers.

Proof. Assume to the contrary that there are only finitely many prime numbers, and all of them are listed as follows: p1, p2 ..., pn. Consider the number q = p1p2... pn + 1. This number is not divisible by any of the listed primes since if we divided pi into q, there would result a remainder of 1 for each i = 1, 2, ..., n. Well then, we must conclude that q is a prime, OR if q is composite, all of its factors must be different than p1, ... pn. This is contradicting our assumption that all primes are in the list p1, p2 ..., pn.