IST 4
Information and Logic
mon tue wed thr fri
1 M1 1
8 M1
15 1 2 M2
22 PCP 2
29 M2
6 3
13 3 4
20 PCP 4 5
27
3 5
x= hw#x out x= hw#x due
Mx= MQx out Mx= MQx due
oh oh
oh oh
oh oh
oh
oh
oh oh
oh
oh oh oh
oh
oh oh
oh = office hours T oh
= today
T oh
oh
oh
oh
sun
PCP= Programming Challenge
Midterms
- Lecture 1: Life: DNA sequences and evolution
- Lecture 2: Human brain: natural languages
- Lecture 3: Artificial languages: numbers and writing
(limited) memory and innovation process (artificial languages)
information systems
- Lecture 4: Languages for quantities: Babylonian mathematics
- Lecture 5: Contrast: Babylonian mathematics vs Greek mathematics
- Lecture 6: Flow: Euclid to Algorizmi to Fibonacci to Leibniz
- Lecture 9: Boolean Algebra – a new language for logic
- Lecture 7: beyond arithmetic – a language of syntax boxes - Lecture 8: Leibniz – syntax for reasoning, Aristotle and Boole
Midterm Perspective
We are “memory machines”
However,
our memory sense is limited
We discovered how to augment our memory
external memories and new languages
Managing external memories algorizms and computing
The language of numbers
positional number systems mathematics
Written languages
~5,000ya Babylonians
our number sense is 3
Axioms Theorems
Proofs
Euclid,300BC
Greeks
Pythagoras 570-495 BC
~2,500ya
Formal languages
Logic
Syllogism Inference
...
Aristotle 384-322 BC
Greeks
• People that are wise are Babylonians
• Leibniz was wise
• Leibniz was a Babylonian
our logical sense is 3
Formal languages
~2,500ya
Algorizms
~300ya
Algorizmi
780-850AD 1170-1250ADFibonacci
It is all about (small) syntax!!
Gottfried Leibniz 1646-1716
~1000ya
Gottfried Leibniz 1646-1716
2 symbol adder c
s
d1 d2
c
parity majority
a b m
0 0
1 0
1 0
1 1
1 1 1 0
magic box
finite universality
Algorizms and syntax boxes
Formal languages for ideas
Gottfried Leibniz 1646-1716
“Let us calculate without further ado, to see who is right"
Let’s Google it!!
Let’s Leibniz it!!
~300ya
Gottfried Leibniz 1646-1716
We need a
language for ...
we need a
language for ...
The ‘Leibniz challenges’:
~300ya
Aristotle
Algorizmi
George Boole 1815–1864
Calculus for logic,1847
“Boole was a Babylonian...”
and Calculus for
syntax boxes...1938
No perfection but…
a lot of inspiration
Shannon 1916-2001
~170ya
~80ya
Progress on ‘Leibniz challenges’:
Boolean Algebra
Huntington 1904; concise set of axioms
Edward Huntington
1874-1952 Undergrad and Masters at Harvard
PhD at the U of Strasbourg, Germany (1901) Professor at Harvard – until 1941
“Huntington was a Greek...”
The Algebra (Boolean Calculus)
Algebraic system: set of elements B,
two binary operations + and
B has at least two elements (0 and 1) • If the following axioms are true
then it is a Boolean Algebra:
A1. identity
A2. complement A3. commutative
A4. distributive
consistent
independent complete
Properties of an Axiomatic System consistent
Can we prove
‘EVERYTHING’?
Complete: Every true statement in the math theory can be derived using the axioms
Can we build
‘EVERYTHING’?
Can we prove
‘EVERYTHING’?
Is everything
‘countable’?
A simpler question:
Are infinite length binary strings countable?
1 1 0 0 0 0 0 0 0 0 0 ...
2 1 1 1 1 1 1 1 1 1 1 ...
3 0 0 0 0 0 0 0 0 0 1 ...
4 0 0 0 0 0 0 0 0 1 1 ...
5 0 0 0 0 0 0 0 1 1 1 ...
6 0 0 0 0 0 0 1 1 1 1 ...
7 0 0 0 0 0 1 1 1 1 1 ...
8 0 0 0 0 1 1 1 1 1 1 ...
9 0 0 0 1 1 1 1 1 1 1 ...
10 0 0 1 1 1 1 1 1 1 1 ...
… … … … … … … … … … … ...
... ... ... ... ... ... ... ... … … … …
Proof by contradiction:
Assume that it is countable and reach a contradiction
Are infinite length binary strings countable?
1 1 0 0 0 0 0 0 0 0 0 ...
2 1 1 1 1 1 1 1 1 1 1 ...
3 0 0 0 0 0 0 0 0 0 1 ...
4 0 0 0 0 0 0 0 0 1 1 ...
5 0 0 0 0 0 0 0 1 1 1 ...
6 0 0 0 0 0 0 1 1 1 1 ...
7 0 0 0 0 0 1 1 1 1 1 ...
8 0 0 0 0 1 1 1 1 1 1 ...
9 0 0 0 1 1 1 1 1 1 1 ...
10 0 0 1 1 1 1 1 1 1 1 ...
… … … … … … … … … … … ...
... ... ... ... ... ... ... ... … … … …
? 0 0 1 1 1 1 0 0 0 0 ...
Idea: Complement the diagonal
This string is binary and is not counted, contradiction!…
‘Diagonal argument’
George Cantor, 1891
Cantor 1845-1918
Can we prove
‘EVERYTHING’?
Is everything
‘countable’? NO
Complete: Every true statement in the math theory can be derived using the axioms
Consistent: No contradictions in the math theory
Kurt Gödel
1906-1978 1931: For any axiomatic
system that is powerful enough to describe the arithmetic of the natural numbers:
If the system is consistent, it cannot be complete
In a consistent system there are statements that are not provable....
The key idea: represent the axiomatic system using numbers, use the diagonal argument of Cantor
@IAS Princeton
Can we prove
‘EVERYTHING’?
A simple example
6, 3, 10, 5, 16, 8, 4, 2, 1
11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Source: wikipedia
6, 3, 10, 5, 16, 8, 4, 2, 1
11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Source: wikipedia
n even
n odd
Does it always reach 1?
Other options? cycle or infinity
Which number in 1-15 has the longest sequence to reach 1?
Source: wikipedia
13, 40, 20, 10, 5, 16, 8, 4, 2, 1 16, 8, 4, 2, 1
Source: wikipedia
The number 9, a sequence with 20 numbers
7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Which number in 1-15 has the longest sequence to reach 1?
9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Lothar Collatz
1910-1990 The Collatz conjecture (1937):
For every starting value m, the sequence always reaches 1
Verified up to some large number (2017): 87 x 260
“Empirical evidence:”
True False
Prove that it is impossible to decide if the conjecture is true or false
Lothar Collatz
1910-1990 The Collatz conjecture (1937):
For every starting value m, the sequence always reaches 1
A generalization:
1/2 3
0 1
p equations:
Undecidable:
Given a function f, does the Collatz sequence reach 1, for all n>0?
Undecidable even if p = 6480 is fixed The Collatz conjecture (1937):
For every starting value m, the sequence always reaches 1
This generalization is undecidable, J. Conway, 1972
We can prove that it is
impossible to decide if true or false
Open problem...
There are problems that
cannot be solved by an algorizm
Algorizmi 780-850AD
There are theorems that
cannot be proved
Euclid,300BC
There are objects that
cannot be counted
Cantor 1845-1918
Gödel 1906-1978
Turing 1912-1954
Languages:: possible
and impossible
consistent
independent complete
Boolean Algebra is:
Boolean Algebra
Proving theorems Syntax, syntax, syntax
Intuition is not natural… it comes with practice
Boolean Algebra
A simple example 0-1 algebra
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND xy OR(x,y)
00 01 10 11
0 1 1 1
xy AND(x,y) 00
01 10 11
0 0 0 1
0 iff both x and y are 0 1 iff both x and y are 1 Is it a Boolean Algebra?
If I satisfy the
axioms then I am a Boolean Algebra
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND The following axioms are obviously true:
A1. identity
A2. complement A3. commutative A4. distributive
???
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A1. identity
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y)
00 01 10 11
0 1 1 1
a + 0 = a a x 1 = a
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A1. identity
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y)
00 01 10 11
0 1 1 1
a + 0 = a a x 1 = a 0 + 0 = 0
1 + 0 = 1
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A1. identity
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y)
00 01 10 11
0 1 1 1
a + 0 = a a x 1 = a 0 x 1 = 0 1 x 1 = 1
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A2. complement
xy OR(x,y)
00 01 10 11
0 1 1 1
xy AND(x,y)
00 01 10 11
0 0 0 1
a + a = 1 a x a = 0
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A2. complement
xy OR(x,y)
00 01 10 11
0 1 1 1
xy AND(x,y)
00 01 10 11
0 0 0 1
0 a complement of 1 1 a complement of 0 a + a = 1 a x a = 0 0 + 1 = 1
1 + 0 = 1
0 x 1 = 0 1 x 0 = 0
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A3. commutative
xy OR(x,y) 00
01 10 11
0 1 1 1
xy AND(x,y) 00
01 10 11
0 0 0 1
a + b = b + a a x b = b x a
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A3. commutative
xy OR(x,y) 00
01 10 11
0 1 1 1
xy AND(x,y) 00
01 10 11
0 0 0 1
a + b = b + a a x b = b x a 0 + 0 = 0 + 0
0 + 1 = 1 + 0 1 + 0 = 0 + 1 1 + 1 = 1 + 1
0 x 0 = 0 x 0 0 x 1 = 1 x 0 1 x 0 = 0 x 1 1 x 1 = 1 x 1
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A4. distributive a + (b x c) = (a + b) x (a + c)
a x (b + c) = (a x b) + (a x c)
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y) 00
01 10 11
0 1 1 1
0-1 Boolean Algebra
Boolean Algebra: set of elements B={0,1},
two binary operations OR and AND A4. distributive a + (b x c) = (a + b) x (a + c)
0 + (1 x 0) = (0 + 1) x (0 + 0)
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y) 00
01 10 11
0 1 1 1
1 + (0 x 0) = (1 + 0) x (1 + 0) We can check all the cases...
Now, to our
first
Booleanproof
Lemma 1:
Proof:
AbsorptionSelf
xy AND(x,y) 00
01 10 11
0 0 0 1
xy OR(x,y) 00
01 10 11
0 1 1 1
Is the lemma true?
Two-valued Boolean Algebra:
set of elements B={0,1},
two binary operations OR and AND ME-MYSELF&I
Lemma 1:
Proof: A1
A2 A4 A2
A1 Q
AbsorptionSelf
ME-MYSELF&I
Lemma 1:
Proof:
AbsorptionSelf
We only proved that Need to prove
ME-MYSELF&I
Ideas?
Boolean Algebra
Duality
Duality
Theorem 0:
Any identity that is true in a Boolean algebra, is also true
if + and are interchanged, and 0 and 1 are interchanged.
Lemma 1:
Proof:
A1 A2 A4 A2 A1
ME-MYSELF&I
if + and . are interchanged, and 0 and 1 are interchanged
Duality
Proof: ????
Theorem 0:
Any identity that is true in a Boolean algebra, is also true
if + and are interchanged, and 0 and 1 are interchanged.
It is a syntax machine:
It is true for the axioms!
Theorem 0:
Any identity that is true algebra, is also true
if + and . are interchanged, and 0 and 1 are interchanged.
Back to the Axioms
Q1: Is the complement unique / well defined?
Boolean Algebra
One way to say NO
Theorem 1:
Each element of a Boolean Algebra has exactly one complement.
Proof:
One Way to Say No!
Assume that:
By Lemma 1:
??
Warm-up: First we will prove that an element is not self-complement
However by A2:
L1: Self Absorption
Theorem 1:
Each element of a Boolean Algebra has exactly one complement.
Proof: Warm-up: First we will prove that an element is not self-complement
Q
One Way to Say No!
Assume that:
By Lemma 1:
However by A2:
Contradiction!
By duality:
0 and 1 are distinct
L1: Self Absorption
One Way to Say No!
Theorem 1:
Each element of a Boolean Algebra has exactly one complement.
Proof:
Next will prove that the complement is unique
We proved that an element is not self-complement
One Way to Say No!
Proof:
Need to prove that the complement is unique
By contradiction: Assume an element has two distinct complements
A1 A2 A4
A2 A3
One Way to Say No!
Proof:
Need to prove that the complement is unique
By contradiction: Assume an element has two distinct complements
A1 A2 A4
A2 A3
A1 A2 A4
One Way to Say No!
Proof:
Need to prove that the complement is unique
By contradiction: Assume an element has two distinct complements
Contradiction! Q
A1 A2 A4
A2 A3
A3
A2 A1
A2 A4
So far… True for any Boolean Algebra
T1: one complement per element
T0: duality principle
L1: Self Absorption
Quiz time
Quiz #7 – 10min
Prove that the following statement is true for a 0-1 Boolean algebra:
0-1 Boolean Algebra:
set of elements B={0,1}
two binary operations OR and AND xy OR(x,y)
00 01 10 11
0 1 1 1
xy AND(x,y) 00
01 10 11
0 0 0 1
No need to use the axioms!