Logic for computer_scientists

Post on 16-Jul-2015

119 views 1 download

Tags:

Transcript of Logic for computer_scientists

Introduction to Logic: The quest for truth

Bernhard Huemer

The Seven Days Of Creation

Computer scientists’ version Mathematicians’ versions

“God threw something together under a 7-day deadline. He’s still

debugging.”

“God laid down axioms, and all else followed trivially.”

Mathematics at the beginning of the 20th century

Some mathematicians began an ambitious project:

to prove everything.

Sentiment of the time: Analytical machine

Ada Lovelace

Russell’s paradox

Suppose there is a town with just one barber, who is male. In this town, every man keeps himself clean-shaven, and he does so by doing exactly one of two things:

• shaving himself; or • being shaved by the barber.

Also, "The barber is a man in town who shaves all those, and only those, men in town who do not shave themselves."

• “an attempt to describe a set of axioms and inference rules in symbolic logic from which all mathematical truths could in principle be proven”

• Construction of paradoxical sets can be avoided by adding types

Principia Mathematica

.. but then something happened

Kurt Gödel• Mathematician from Austria

• 1906 - 1978 († by starvation)

• Completeness theorem

• close friends with Einstein, also published papers on relativity

Euclid’s postulates1. A straight line segment can be drawn joining any two points.

2. Any straight line segment can be extended indefinitely in a straight line.

3. Given any straight line segment, a circle can be drawn having the segment as radius and one endpoint as center.

4. All right angles are congruent.

5. If two lines are drawn which intersect a third in such a way that the sum of the inner angles on one side is less than two right angles, then the two lines inevitably must intersect each other on that side if extended far enough.

• If two lines are drawn which intersect a third in such a way that the sum of the inner angles on one side is less than two right angles, then the two lines inevitably must intersect each other on that side if extended far enough.

• Conversely, will these two lines ever cross each other?

Euclid’s parallel postulate

Hyperbolic / non-euclidean geometry

Three traditional laws of thought

• The law of identity

• The law of contradiction

• The law of the excluded middle

http://en.wikipedia.org/wiki/Law_of_thought#The_three_traditional_laws

http://www.thenewsh.com/~newsham/formal/curryhoward/

“Just as there are geometries in which Euclid's fifth postulate is not assumed to be true, there are logic systems in which the double-negation rule is not assumed to be true.”

Inference rules

Modus ponens / tollens

If it is raining, the streets are wet. The streets are not wet.

Therefore, it is not raining.

All men are mortal. Socrates is a man.

Therefore, Socrates is mortal.

• Proving the Law of the excluded middle by contradiction, i.e. assume ¬(p ∨ ¬p) and look for a contradiction

Proving by contradiction

Example

There exists irrational numbers and such that is rational.x y xy

is rational

is not rational

Classical proof

22

22

x = 2

y = 2

x = 22

y = 22

2⋅ 2= 2

• Does not tell us which of the two is true .. not particularly useful :(

Constructive proof

x = 2y = 2 ⋅ log2(3)

Intuitionistic logic: Definition

Taken from: Lectures on the Curry-Howard Isomorphism, Volume 149 (Studies in Logic and the Foundations of Mathematics)

Construction rules

Taken from: Lectures on the Curry-Howard Isomorphism, Volume 149 (Studies in Logic and the Foundations of Mathematics)

Classic tautologies that can be proved constructively

Taken from: Lectures on the Curry-Howard Isomorphism, Volume 149 (Studies in Logic and the Foundations of Mathematics)

Classical tautologies that aren’t constructive too

Taken from: Lectures on the Curry-Howard Isomorphism, Volume 149 (Studies in Logic and the Foundations of Mathematics)

Curry-Howard Correspondence

• Direct relationship between computer programs and mathematical proofs

• e.g. tautologies and identity functions ρ → ρ

Curry-Howard Correspondence

Category theory: The rosetta stone

Taken from the paper “Physics, Topology, Logic and Computation: A Rosetta Stone”

More to come ..

Hilbert’s Entscheidungsproblem

• 1936 both Alan Turing and Alonzo Church published papers showing that this was impossible

• If the Halting Problem wasn’t in fact a problem, one could theoretically guess the solution for Fermat’s Last Theorem (i.e. mechanization of mathematics)

an + bn = cn

Q&A

“Either mathematics is too big for the human mind or the human mind is more than

a machine.”

- Kurt Gödel