Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Logic and Modelling
lecture: undecidability and incompleteness of predicate logic
Jörg Endrullis
Clemens Grabmayer
VU University Amsterdam
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
3. Meta-theorems of predicate logic (continued)
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
3. Meta-theorems of predicate logic (continued)
I
I
timeline: from logic to computability
undecidability theorem
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
3. Meta-theorems of predicate logic (continued)
I
I
timeline: from logic to computability
undecidability theorem
I
validity of a formula in predicate logic is undecidable
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
3. Meta-theorems of predicate logic (continued)
I
I
timeline: from logic to computability
undecidability theorem
I
I
validity of a formula in predicate logic is undecidable
proof by using undecidability of PCP
Today
Undecidability and incompleteness
1. Definability and undefinability in predicate logic (rest)
I
reachability
2. Decidability and undecidability
I
decision problems (definition, examples)
I
the termination problem
I
sketch of proof of undecidability of termination problem
I
Post’s Correspondence Problem (PCP)
I
undecidability of PCP
3. Meta-theorems of predicate logic (continued)
I
I
timeline: from logic to computability
undecidability theorem
I
validity of a formula in predicate logic is undecidable
I
proof by using undecidability of PCP
I
incompleteness theorem
A difficult step on Monday
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ Γ ⊥
Proof
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ ¬∃M, ` ∀φ ∈ Γ M ` φ
⇐⇒ ∀M, ` ¬∀φ ∈ Γ M ` φ
⇐⇒ ∀M, `(∀φ ∈ Γ M ` φ ⇒ M ` ⊥)
(use: (∀x¬Px) ↔ ∀x(P(x) → ⊥)
⇐⇒ Γ ⊥
A difficult step on Monday
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ Γ ⊥
Proof
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ ¬∃M, ` ∀φ ∈ Γ M ` φ
⇐⇒ ∀M, ` ¬∀φ ∈ Γ M ` φ
=⇒ ∀M, `(∀φ ∈ Γ M ` φ ⇒ M ` ⊥)
(use: premise of inner implication is false)
⇐⇒ Γ ⊥
A difficult step on Monday
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ Γ ⊥
Proof
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ ¬∃M, ` ∀φ ∈ Γ M ` φ
⇐⇒ ∀M, ` ¬∀φ ∈ Γ M ` φ
⇐= ∀M, `(∀φ ∈ Γ M ` φ ⇒ M ` ⊥)
(use that M 6 ` ⊥ holds for all M, `)
⇐⇒ Γ ⊥
A difficult step on Monday
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ Γ ⊥
Proof
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ ¬∃M, ` ∀φ ∈ Γ M ` φ
⇐⇒ ∀M, ` ¬∀φ ∈ Γ M ` φ
⇐⇒ ∀M, `(∀φ ∈ Γ M ` φ ⇒ M ` ⊥)
(use: (∀x¬Px) ↔ ∀x(P(x) → ⊥)
⇐⇒ Γ ⊥
A difficult step on Monday
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ Γ ⊥
Proof
For all sets Γ of formulas:
Γ is inconsistent ⇐⇒ ¬∃M, ` ∀φ ∈ Γ M ` φ
⇐⇒ ∀M, ` ¬∀φ ∈ Γ M ` φ
⇐⇒ ∀M, `(∀φ ∈ Γ M ` φ ⇒ M ` ⊥)
(use: (∀x¬Px) ↔ ∀x(P(x) → ⊥)
⇐⇒ Γ ⊥
Reformulation
For all sets Γ of formulas:
Γ is consistent ⇐⇒ Γ 6 ⊥
Definability/undefinability results: current overview
definable
by a sentence
definable
by a set of sentences
finiteness
×
×
infiniteness
×
model property
at least n values
at most n values
R-reachability
R-unreachability
1. definability and undefinability results
(for
P-reachability)
Reachability via R
For a binary predicate symbol R we want to express:
v is reachable via R from u
Reachability via R
For a binary predicate symbol R we want to express:
v is reachable via R from u
Thinking of R as arrows in the drawing of a model, this means:
by following the arrows, it is possible to go from v to u
(by 0, 1, or more steps)
Reachability via R
For a binary predicate symbol R we want to express:
v is reachable via R from u
Thinking of R as arrows in the drawing of a model, this means:
by following the arrows, it is possible to go from v to u
(by 0, 1, or more steps)
Example
If we consider the relation R :
R(u, v ) :
u is child of v
Reachability via R
For a binary predicate symbol R we want to express:
v is reachable via R from u
Thinking of R as arrows in the drawing of a model, this means:
by following the arrows, it is possible to go from v to u
(by 0, 1, or more steps)
Example
If we consider the relation R :
R(u, v ) :
u is child of v
Then reachability via R is the relation:
‘u is descendant of, or is the same person as v ’
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
‘Natural’ choices for χn :
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
χ1 : R(u, v )
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
χ1 : R(u, v )
χ2 : ∃x1 (R(u, x1 ) ∧ R(x1 , v ))
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M χn (u, v ) ⇐⇒ u M is reachable from v M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
χ1 : R(u, v )
χ2 : ∃x1 (R(u, x1 ) ∧ R(x1 , v ))
χ3 : ∃x1 ∃x2 (R(u, x1 ) ∧ R(x1 , x2 ) ∧ R(x2 , v ))
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M ` χn (c, d) ⇐⇒ d M is reachable from c M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
χ1 : R(u, v )
χ2 : ∃x1 (R(u, x1 ) ∧ R(x1 , v ))
χ3 : ∃x1 ∃x2 (R(u, x1 ) ∧ R(x1 , x2 ) ∧ R(x2 , v ))
..
..
.
.
χn : ∃x1 ∃x2 . . . ∃xn−1 (R(u, x1 ) ∧ R(x1 , x2 ) ∧ . . . ∧ R(xn−1 , v ))
Notation
We’ll work with constants c, d: we write χ(c, d) for χ[c/u][d/v ].
Reachable in n steps
We search for formulas χn that express reachability in n steps,
in the sense that it holds for all M :
M ` χn (c, d) ⇐⇒ d M is reachable from c M by n R M -steps
‘Natural’ choices for χn :
χ0 : u = v
χ1 : R(u, v )
χ2 : ∃x1 (R(u, x1 ) ∧ R(x1 , v ))
χ3 : ∃x1 ∃x2 (R(u, x1 ) ∧ R(x1 , x2 ) ∧ R(x2 , v ))
..
..
.
.
χn : ∃x1 ∃x2 . . . ∃xn−1 (R(u, x1 ) ∧ R(x1 , x2 ) ∧ . . . ∧ R(xn−1 , v ))
Notation
We’ll work with constants c, d: we write χ(c, d) for χ[c/u][d/v ].
Example
χ2 (c, d) denotes the formula ∃x1 (R(c, x1 ) ∧ R(x1 , d)).
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability.
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent:
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d),
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d), then d M is
reachable from c M by R-steps,
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d), then d M is
reachable from c M by R-steps, say by m steps.
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d), then d M is
reachable from c M by R-steps, say by m steps. Hence
M χm (c, d),
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d), then d M is
reachable from c M by R-steps, say by m steps. Hence
M χm (c, d), and so M 6 ¬χm (c, d).
Reachability is undefinable (proof)
(1) Suppose that χ expresses reachability. That is, for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent: If M χ(c, d), then d M is
reachable from c M by R-steps, say by m steps. Hence
M χm (c, d), and so M 6 ¬χm (c, d). Consequently
M 6 ∆.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent:
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
M χ(c, d) .
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
M χ(c, d) .
M χn0 (c, d),
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
M χ(c, d) .
M χn0 (c, d), (i.e. M 6 ¬χn0 (c, d) ).
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
I
M χ(c, d) .
M χn0 (c, d), (i.e. M 6 ¬χn0 (c, d) ).
M ¬χn (c, d) for all n 6= n0 .
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
I
M χ(c, d) .
M χn0 (c, d), (i.e. M 6 ¬χn0 (c, d) ).
M ¬χn (c, d) for all n 6= n0 .
So in M all formulas of ∆ are true except ¬χn0 (c, d), but
which is not in ∆0 .
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
I
M χ(c, d) .
M χn0 (c, d), (i.e. M 6 ¬χn0 (c, d) ).
M ¬χn (c, d) for all n 6= n0 .
So in M all formulas of ∆ are true except ¬χn0 (c, d), but
which is not in ∆0 . Hence M ∆0 ,
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, i.e. for all M :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent: Let ∆0 ⊆ ∆ be finite.
Then ¬χn0 (c, d) ∈
/ ∆0 for some n0 .
Now we consider a model M that consists of c M and d M
together with precisely n0 R M -steps that link these two
values. Then we find:
I
I
I
M χ(c, d) .
M χn0 (c, d), (i.e. M 6 ¬χn0 (c, d) ).
M ¬χn (c, d) for all n 6= n0 .
So in M all formulas of ∆ are true except ¬χn0 (c, d), but
which is not in ∆0 . Hence M ∆0 , and we conclude that
∆0 is consistent.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, ie, for all M, ` :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, ie, for all M, ` :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent.
(5) A set ∆ of formulas with (3) and (4) contradicts the
compactness theorem.
Reachability is undefinable (proof)
(1) Suppose sentence χ expresses reachability, ie, for all M, ` :
M χ(c, d) ⇐⇒ d M is reachable from c M by R M -steps
(2) Then we consider the set ∆ of formulas:
∆ = {χ(c, d)} ∪ {¬χ0 (c, d), ¬χ1 (c, d), ¬χ2 (c, d), . . .}
= {χ(c, d)} ∪ {¬χn (c, d) | n ∈ N}
(3) The set ∆ is inconsistent.
(4) Yet every finite ∆0 ⊆ ∆ is consistent.
(5) A set ∆ of formulas with (3) and (4) contradicts the
compactness theorem.
(6) The problem must be assumption (1). So we conclude that
there cannot be such a formula χ.
Definability results for reachability/unreachability
Proposition
Let R be a binary relation symbol.
1. In predicate logic, reachability by R-steps is:
I
not definable by a sentence.
I
not definable by a set of sentences.
2. In predicate logic, unreachability by R-steps is:
I
definable by the set ∆ = {¬χn | n ∈ N} of sentences
I
not definable by a single sentence.
Definability results for reachability/unreachability
Proposition
Let R be a binary relation symbol.
1. In predicate logic, reachability by R-steps is:
I
not definable by a sentence.
I
not definable by a set of sentences.
2. In predicate logic, unreachability by R-steps is:
I
definable by the set ∆ = {¬χn | n ∈ N} of sentences
I
not definable by a single sentence.
Proof.
Similar to definability and undefinability results (see earlier) for
finiteness and infiniteness.
Some definability and undefinability results: overview
definable
by a sentence
definable
by a set of sentences
finiteness
×
×
infiniteness
×
R-reachability
×
R-unreachability
×
model property
at least n values
at most n values
×
1. Decidability and undecidability
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
input (instance): a natural number n
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Termination Problem
Decide whether a program terminates:
I
input: a program P and input w
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Termination Problem
Decide whether a program terminates:
I
I
input: a program P and input w
output: yes if P started with input w terminates, no else
(Termination means that the program does not run forever.)
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Termination Problem
Decide whether a program terminates:
I
I
input: a program P and input w
output: yes if P started with input w terminates, no else
(Termination means that the program does not run forever.)
Validity Problem
Determine whether a formula is valid:
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Termination Problem
Decide whether a program terminates:
I
I
input: a program P and input w
output: yes if P started with input w terminates, no else
(Termination means that the program does not run forever.)
Validity Problem
Determine whether a formula is valid:
I
input: a formula φ of predicate logic
Decision Problems: Examples
Prime Problem
Determine whether a number is prime:
I
I
input (instance): a natural number n
output (desired answer): yes if n is prime, no otherwise
Termination Problem
Decide whether a program terminates:
I
I
input: a program P and input w
output: yes if P started with input w terminates, no else
(Termination means that the program does not run forever.)
Validity Problem
Determine whether a formula is valid:
I
I
input: a formula φ of predicate logic
output: yes if φ is valid, no otherwise
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Prime Problem
I
I
I=N
Y = { n ∈ N | n is prime }
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Prime Problem
I
I
I=N
Y = { n ∈ N | n is prime }
Termination Problem
I
I
I = set of all pairs hJava program, inputi
Y = {hP, wi | P terminates on input w}
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Prime Problem
I
I
I=N
Y = { n ∈ N | n is prime }
Termination Problem
I
I
I = set of all pairs hJava program, inputi
Y = {hP, wi | P terminates on input w}
Validity Problem
I
I
I = set of formulas of predicate logic
Y = set of valid formulas in predicate logic
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Prime Problem
I
I
I=N
Y = { n ∈ N | n is prime }
Termination Problem
I
I
I = set of all pairs hJava program, inputi
Y = {hP, wi | P terminates on input w}
Validity Problem
I
I
I = set of formulas of predicate logic
Y = set of valid formulas in predicate logic
Can we write a program that on the input of i ∈ I tells if i ∈ Y ?
Decision Problems
A decision problem consists of a set I and a predicate Y ⊆ I.
Prime Problem
I
I
I=N
Y = { n ∈ N | n is prime }
Termination Problem
I
I
I = set of all pairs hJava program, inputi
Y = {hP, wi | P terminates on input w}
Validity Problem
I
I
I = set of formulas of predicate logic
Y = set of valid formulas in predicate logic
Can we write a program that on the input of i ∈ I tells if i ∈ Y ?
If such program exists, the predicate Y is called decidable.
Decidability
Decidability
A decision problem Y ⊆ I is called solvable or decidable if there
exists a program that tells for every i ∈ I whether i ∈ Y :
I
I
input: i ∈ I
output: yes if i ∈ Y
no if i 6∈ Y
Decidability
Decidability
A decision problem Y ⊆ I is called solvable or decidable if there
exists a program that tells for every i ∈ I whether i ∈ Y :
I
I
input: i ∈ I
output: yes if i ∈ Y
no if i 6∈ Y
Clearly, the prime problem is decidable.
We can write a program deciding whether a number is prime.
Decidability
Decidability
A decision problem Y ⊆ I is called solvable or decidable if there
exists a program that tells for every i ∈ I whether i ∈ Y :
I
I
input: i ∈ I
output: yes if i ∈ Y
no if i 6∈ Y
Clearly, the prime problem is decidable.
We can write a program deciding whether a number is prime.
Is there such a program for every decision problem?
Decidability
Decidability
A decision problem Y ⊆ I is called solvable or decidable if there
exists a program that tells for every i ∈ I whether i ∈ Y :
I
I
input: i ∈ I
output: yes if i ∈ Y
no if i 6∈ Y
Clearly, the prime problem is decidable.
We can write a program deciding whether a number is prime.
Is there such a program for every decision problem?
Can we write a program that decides termination?
Termination
Assume there was a program T that decides termination:
I
I
input: a program P and input w
output: yes if P terminates on input w, no otherwise
Termination
Assume there was a program T that decides termination:
I
I
input: a program P and input w
output: yes if P terminates on input w, no otherwise
Then using T we can create a program Ton-itself that decides
whether a program terminates when started with itself as input.
Termination
Assume there was a program T that decides termination:
I
I
input: a program P and input w
output: yes if P terminates on input w, no otherwise
Then using T we can create a program Ton-itself that decides
whether a program terminates when started with itself as input.
Then there exists a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on input ‘code of P’,
no otherwise
Note that Ton-itself is a special case of T where w = P.
Termination
Assume there was a program T that decides termination:
I
I
input: a program P and input w
output: yes if P terminates on input w, no otherwise
Then using T we can create a program Ton-itself that decides
whether a program terminates when started with itself as input.
Then there exists a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on input ‘code of P’,
no otherwise
Note that Ton-itself is a special case of T where w = P.
Thus to show that T does not exist, it suffices to show that
Ton-itself does not exist.
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
initial part Ton-itself decides whether Z terminates on input Z
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
if the result is no, then Z terminates
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
if the result is no, then Z terminates ×
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
if the result is no, then Z terminates ×
Thus Ton-itself has made a mistake!
Termination
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
if the result is no, then Z terminates ×
Thus Ton-itself has made a mistake! And thus also T !
Termination is undecidable!
Assume there would be a program Ton-itself with the behaviour:
I
I
input: a program P
output: yes if P terminates on ‘code of P’, no otherwise
program Ton-itself
p = read input;
..
.
print result;
program Z
if result = yes
then loop forever
else terminate
What happens if we run Z with input Z ?
I
I
I
initial part Ton-itself decides whether Z terminates on input Z
if the result is yes, then Z runs forever ×
if the result is no, then Z terminates ×
Thus Ton-itself has made a mistake! And thus also T !
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
⇓
P terminates input on w
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Z terminates on input P ⇐⇒ P does not terminate on input P
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Z terminates on input P ⇐⇒ P does not terminate on input P
⇓
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Z terminates on input P ⇐⇒ P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
Z does not terminate on input Z
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Z terminates on input P ⇐⇒ P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
Z does not terminate on input Z
Termination is undecidable (structure of argument)
Theorem
The termination problem is unsolvable (undecidable).
×
T terminates on input hP, wi ⇐⇒
P terminates input on w
⇓
Ton-itself terminates on input P ⇐⇒ P terminates input on P
⇓
Z terminates on input P ⇐⇒ P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
Z does not terminate on input Z
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
Z does not terminate on input Z
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
barber shaves x ⇐⇒
Z does not terminate on input Z
x does not shave x
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
barber shaves x ⇐⇒
⇓
Z does not terminate on input Z
x does not shave x
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
barber shaves x ⇐⇒
Z does not terminate on input Z
x does not shave x
⇓
barber shaves barber ⇐⇒
barber does not shave barber
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
barber shaves x ⇐⇒
Z does not terminate on input Z
x does not shave x
⇓
barber shaves barber ⇐⇒
×
barber does not shave barber
Analogy with Russell’s barber paradox
×
Z terminates on input P ⇐⇒
P does not terminate on input P
⇓
Z terminates on input Z ⇐⇒
×
×
barber shaves x ⇐⇒
Z does not terminate on input Z
x does not shave x
⇓
barber shaves barber ⇐⇒
×
barber does not shave barber
Post’s Correspondence Problem
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
Examples of PCP instances
I
hh1, 101i, h10, 00i, h011, 11ii
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
hh1, 101i, h10, 00i, h011, 11ii
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii no solution
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii no solution
hh1, 111i, h10111, 10i, h10, 0ii
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii no solution
hh1, 111i, h10111, 10i, h10, 0ii solution h2, 1, 1, 3i
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii no solution
hh1, 111i, h10111, 10i, h10, 0ii solution h2, 1, 1, 3i
hh001, 0i, h01, 011i, h01, 101i, h10, 001ii
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
Examples of PCP instances
I
I
I
I
hh1, 101i, h10, 00i, h011, 11ii solution h1, 3, 2, 3i
hh110, 0i, h00, 1ii no solution
hh1, 111i, h10111, 10i, h10, 0ii solution h2, 1, 1, 3i
hh001, 0i, h01, 011i, h01, 101i, h10, 001ii
‘shortest solution has length 66’
Post’s Correspondence Problem
Post’s Correspondence Problem (PCP)
Determine whether a PCP-instance has a solution:
I
I
instance: a finite sequence hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
of pairs of binary strings
output: yes if this instance has a solution, i.e. a sequence
hi1 , i2 , . . . , in i of indices i1 , i2 , . . . , in ∈ {1, . . . , k } with
si1 si2 · · · sin equals t i1 t i2 · · · t in
and no otherwise
PCP as decision problem
I
I
PCP = {hhs1 , t1 i, . . . , hsk , tk ii | k ≥ 1, si , ti binary strings}
Y = {i ∈ PCP | i has a solution}
PCP is undecidable
Theorem
Post’s Correspondence Problem is undecidable.
Idea of the Proof.
The termination problem can be encoded into (reduced to) PCP.
PCP is undecidable
Theorem
Post’s Correspondence Problem is undecidable.
Idea of the Proof.
The termination problem can be encoded into (reduced to) PCP.
More precisely, there is a computable function r that maps
instances of the termination problem to instances of PCP:
r : hP, wi 7−→ IhP,wi
PCP is undecidable
Theorem
Post’s Correspondence Problem is undecidable.
Idea of the Proof.
The termination problem can be encoded into (reduced to) PCP.
More precisely, there is a computable function r that maps
instances of the termination problem to instances of PCP:
r : hP, wi 7−→ IhP,wi
such that it holds:
P terminates on input w ⇐⇒ IhP,wi has a solution
PCP is undecidable
Theorem
Post’s Correspondence Problem is undecidable.
Idea of the Proof.
The termination problem can be encoded into (reduced to) PCP.
More precisely, there is a computable function r that maps
instances of the termination problem to instances of PCP:
r : hP, wi 7−→ IhP,wi
such that it holds:
P terminates on input w ⇐⇒ IhP,wi has a solution
(r is a computable reduction from termination problem to PCP.)
PCP is undecidable
Theorem
Post’s Correspondence Problem is undecidable.
Idea of the Proof.
The termination problem can be encoded into (reduced to) PCP.
More precisely, there is a computable function r that maps
instances of the termination problem to instances of PCP:
r : hP, wi 7−→ IhP,wi
such that it holds:
P terminates on input w ⇐⇒ IhP,wi has a solution
(r is a computable reduction from termination problem to PCP.)
Then if we had a PCP-solver (decides solvability of PCP-inst.)
we would obtain a solver for the termination problem. ×
2. Meta-Theorems of predicate logic
(continued)
Undecidability of validity and provability
Theorem
The decision problem of validity in predicate logic is
undecidable:
Undecidability of validity and provability
Theorem
The decision problem of validity in predicate logic is
undecidable:
I
there cannot be a program that, given any formula φ,
decides whether or not φ holds.
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
We will describe a computable function r that maps instances
of PCP to instances of the validity problem:
r : I 7−→ φI
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
We will describe a computable function r that maps instances
of PCP to instances of the validity problem:
r : I 7−→ φI
such that it holds:
I has a solution ⇐⇒ φI (i.e. φI is valid)
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
We will describe a computable function r that maps instances
of PCP to instances of the validity problem:
r : I 7−→ φI
such that it holds:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(r is a computable reduction from PCP to validity problem.)
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
We will describe a computable function r that maps instances
of PCP to instances of the validity problem:
r : I 7−→ φI
such that it holds:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(r is a computable reduction from PCP to validity problem.)
Then if we had a complete validity checker for predicate logic,
Validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
PCP can be encoded into (reduced to) the validity problem.
We will describe a computable function r that maps instances
of PCP to instances of the validity problem:
r : I 7−→ φI
such that it holds:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(r is a computable reduction from PCP to validity problem.)
Then if we had a complete validity checker for predicate logic,
we would obtain a PCP-solver. ×
Encoding of binary strings as terms
The formula φI will be defined over functions and predicate in:
F = {e/0, f0 /1, f1 /1}
P = {P /2}
Encoding of binary strings as terms
The formula φI will be defined over functions and predicate in:
F = {e/0, f0 /1, f1 /1}
P = {P /2}
We consider the encoding of binary strings into F-terms:
Encoding of binary strings as terms
The formula φI will be defined over functions and predicate in:
F = {e/0, f0 /1, f1 /1}
P = {P /2}
We consider the encoding of binary strings into F-terms:
binary word
e
0
1
01
10
...
b1 b2 . . . bl−1 bl
term encoding
(empty word)
f0 (e)
f1 (e)
f1 (f0 (e))
f0 (f1 (e))
...
fbl (fbl−1 (. . . fb2 (fb1 (e))))
Encoding of binary strings as terms
The formula φI will be defined over functions and predicate in:
F = {e/0, f0 /1, f1 /1}
P = {P /2}
We consider the encoding of binary strings into F-terms:
binary word
e
0
1
01
10
...
b1 b2 . . . bl−1 bl
term encoding
(empty word)
f0 (e)
f1 (e)
f1 (f0 (e))
f0 (f1 (e))
...
fbl (fbl−1 (. . . fb2 (fb1 (e))))
For every binary word w = b1 b2 . . . bl−1 bl and all F-terms t we
define the abbreviation:
def
fw (t) = fbl (fbl−1 (. . . fb2 (fb1 (e))))
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
we define the encoding of I into a formula φI of predicate logic
as follows:
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
we define the encoding of I into a formula φI of predicate logic
as follows:
def
φI = φ1 ∧ φ2 → φ3
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
we define the encoding of I into a formula φI of predicate logic
as follows:
def
φI = φ1 ∧ φ2 → φ3
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
we define the encoding of I into a formula φI of predicate logic
as follows:
def
φI = φ1 ∧ φ2 → φ3
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
Encoding a PCP-instance I into a formula φI
Now given a PCP instance
I = hhs1 , t1 i, hs2 , t2 i, . . . , hsk , tk ii
we define the encoding of I into a formula φI of predicate logic
as follows:
def
φI = φ1 ∧ φ2 → φ3
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
I eMI = (empty word)
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
I eMI = (empty word)
I f0 MI : B → B, w 7→ w0
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
I eMI = (empty word)
I f0 MI : B → B, w 7→ w0
I f1 MI : B → B, w 7→ w1
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
I eMI = (empty word)
I f0 MI : B → B, w 7→ w0
I f1 MI : B → B, w 7→ w1
I P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices
such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Encoding a PCP-instance I into a formula φI
def
φ1 =
^
P(fsi (e), fti (e))
i=1,...,k
def
φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y ))
i=1,...,k
def
φ3 = ∃z P(z, z)
To understand these formulas we consider the model MI :
I domain B = set of binary words
I eMI = (empty word)
I f0 MI : B → B, w 7→ w0
I f1 MI : B → B, w 7→ w1
I P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices
such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ3 = ∃z P(z, z) in MI we find:
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ3 = ∃z P(z, z) in MI we find:
MI ` φ3
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ3 = ∃z P(z, z) in MI we find:
MI ` φ3 ⇐⇒ there is a w ∈ B such that hw, wi ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ3 = ∃z P(z, z) in MI we find:
MI ` φ3 ⇐⇒ there is a w ∈ B such that hw, wi ∈ P MI
⇐⇒ there is a sequence hi1 , i2 , . . . , in i of indices
such that si1 si2 · · · sin and t i1 t i2 · · · t in
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ3 = ∃z P(z, z) in MI we find:
MI ` φ3 ⇐⇒ there is a w ∈ B such that hw, wi ∈ P MI
⇐⇒ there is a sequence hi1 , i2 , . . . , in i of indices
such that si1 si2 · · · sin and t i1 t i2 · · · t in
⇐⇒ PCP instance I is solvable
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
⇐⇒ for all i with 1 ≤ i ≤ k : MI ` P(fsi (e), fti (e))
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
⇐⇒ for all i with 1 ≤ i ≤ k : MI ` P(fsi (e), fti (e))
⇐⇒ for all i with 1 ≤ i ≤ k : h(fsi (e))MI , (fti (e))MI i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
⇐⇒ for all i with 1 ≤ i ≤ k : MI ` P(fsi (e), fti (e))
⇐⇒ for all i with 1 ≤ i ≤ k : h(fsi (e))MI , (fti (e))MI i ∈ P MI
⇐⇒ for all i with 1 ≤ i ≤ k : hsi , ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
⇐⇒ for all i with 1 ≤ i ≤ k : MI ` P(fsi (e), fti (e))
⇐⇒ for all i with 1 ≤ i ≤ k : h(fsi (e))MI , (fti (e))MI i ∈ P MI
⇐⇒ for all i with 1 ≤ i ≤ k : hsi , ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
Then for all w ∈ B it holds: (fw (e))MI = w.
def
Interpreting φ1 =
^
P(fsi (e), fti (e)) in MI we find:
i=1,...,k
MI ` φ1
⇐⇒ for all i with 1 ≤ i ≤ k : MI ` P(fsi (e), fti (e))
⇐⇒ for all i with 1 ≤ i ≤ k : h(fsi (e))MI , (fti (e))MI i ∈ P MI
⇐⇒ for all i with 1 ≤ i ≤ k : hsi , ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y )) :
i=1,...,k
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒ . . .
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
Interpreting φ2 = ∀x∀y P(x, y ) →
^
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒
⇐⇒ . . .
for all u, v ∈ B : hu, v i ∈ P MI =⇒
^
husi , v ti i ∈ P MI
i=1,...,k
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
^
Interpreting φ2 = ∀x∀y P(x, y ) →
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒
⇐⇒ . . .
for all u, v ∈ B : hu, v i ∈ P MI =⇒
^
husi , v ti i ∈ P MI
i=1,...,k
⇐⇒
hsi1 si2 · · · sin , t i1 t i2 · · · t in i ∈ P
MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
^
Interpreting φ2 = ∀x∀y P(x, y ) →
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒
⇐⇒ . . .
for all u, v ∈ B : hu, v i ∈ P MI =⇒
^
husi , v ti i ∈ P MI
i=1,...,k
⇐⇒
hsi1 si2 · · · sin , t i1 t i2 · · · t in i ∈ P
MI
=⇒ hsi1 si2 · · · sin si , t i1 t i2 · · · t in ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
^
Interpreting φ2 = ∀x∀y P(x, y ) →
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒
⇐⇒ . . .
for all u, v ∈ B : hu, v i ∈ P MI =⇒
^
husi , v ti i ∈ P MI
i=1,...,k
⇐⇒
hsi1 si2 · · · sin , t i1 t i2 · · · t in i ∈ P
MI
=⇒ hsi1 si2 · · · sin si , t i1 t i2 · · · t in ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
Model MI :
I
I
I
I
I
domain B = set of binary words
eMI = (empty word)
f0 MI : B → B, w 7→ w0
f1 MI : B → B, w 7→ w1
P MI = hs, ti : there is a sequence hi1 , i2 , . . . , in i of indices such that s = si1 si2 · · · sin and t = t i1 t i2 · · · t in
def
^
Interpreting φ2 = ∀x∀y P(x, y ) →
P(fsi (x), fti (y )) :
i=1,...,k
MI ` φ2
⇐⇒
⇐⇒ . . .
for all u, v ∈ B : hu, v i ∈ P MI =⇒
^
husi , v ti i ∈ P MI
i=1,...,k
⇐⇒
hsi1 si2 · · · sin , t i1 t i2 · · · t in i ∈ P
MI
=⇒ hsi1 si2 · · · sin si , t i1 t i2 · · · t in ti i ∈ P MI
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
⇐⇒ I is solvable
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
⇐⇒ I is solvable
and furthermore:
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
⇐⇒ I is solvable
and furthermore:
φI is valid
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
⇐⇒ I is solvable
and furthermore:
φI is valid =⇒ MI φI
Encoding a PCP-instance I into a formula φI
So we have shown:
MI φ1
MI φ2
MI φ3 ⇐⇒ I is solvable
Hence we conclude:
MI φI ⇐⇒ MI φ1 ∧ φ2 → φ3
⇐⇒ I is solvable
and furthermore:
φI is valid =⇒ MI φI
=⇒ I is solvable
Back to the outer argument for: validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
There is a computable function r (just described!) that maps
instances of PCP to instances of the validity problem:
r : I 7−→ φI
such that:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(?)
Then if we had a complete validity checker for predicate logic,
we would obtain a PCP-solver. ×
Back to the outer argument for: validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
There is a computable function r (just described!) that maps
instances of PCP to instances of the validity problem:
r : I 7−→ φI
such that:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(?)
Then if we had a complete validity checker for predicate logic,
we would obtain a PCP-solver. ×
‘⇐=’ in (?): just shown
.
Back to the outer argument for: validity is undecidable
Theorem
The validity problem in predicate logic is undecidable.
Proof (outer structure).
There is a computable function r (just described!) that maps
instances of PCP to instances of the validity problem:
r : I 7−→ φI
such that:
I has a solution ⇐⇒ φI (i.e. φI is valid)
(?)
Then if we had a complete validity checker for predicate logic,
we would obtain a PCP-solver. ×
‘⇐=’ in (?): just shown
.
‘=⇒’ in (?): see Huth & Ryan p. 134,135.
Alan Turing
Alan Mathison Turing (1912–1954)
Undecidability of validity and provability
Theorem (Church, 1936, Turing, 1937)
The decision problem of validity in predicate logic is
undecidable:
Undecidability of validity and provability
Theorem (Church, 1936, Turing, 1937)
The decision problem of validity in predicate logic is
undecidable:
I
there cannot be a program that, given any formula φ,
decides whether or not φ holds.
Undecidability of validity and provability
Theorem (Church, 1936, Turing, 1937)
The decision problem of validity in predicate logic is
undecidable:
I
there cannot be a program that, given any formula φ,
decides whether or not φ holds.
Using the soundness and completeness theorem we obtain:
Corollary (undecidability of provability)
The decision problem of provability in predicate logic is
undecidable:
Undecidability of validity and provability
Theorem (Church, 1936, Turing, 1937)
The decision problem of validity in predicate logic is
undecidable:
I
there cannot be a program that, given any formula φ,
decides whether or not φ holds.
Using the soundness and completeness theorem we obtain:
Corollary (undecidability of provability)
The decision problem of provability in predicate logic is
undecidable:
I
there cannot be a program that, given any formula φ,
decides whether or not ` φ holds.
I
limits the power of theorem provers
building better theorem provers is an open-ended
endeavour (creativity will always be needed)
I
Also satisfiability is undecidable
Proposition
For sentences φ it holds:
φ is unsatisfiable ⇐⇒ ¬φ is valid
φ is satisfiable ⇐⇒ ¬φ is not valid
Since this defines an easy reduction of the satisfiability problem
to the validity problem, it follows (rather easily):
Theorem
The decision problem of satisfiability in predicate logic is
undecidable.
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
and between ` and provability:
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
and between ` and provability:
φ1 ,φ2 , . . . ,φn ` ψ
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
and between ` and provability:
φ1 ,φ2 , . . . ,φn ` ψ ⇐⇒
` φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
and between ` and provability:
φ1 ,φ2 , . . . ,φn ` ψ ⇐⇒
` φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is provable
Undecidability of and `
Deduction Theorem: Easy connection between and validity:
φ1 ,φ2 , . . . ,φn ψ ⇐⇒
φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is valid
and between ` and provability:
φ1 ,φ2 , . . . ,φn ` ψ ⇐⇒
` φ1 ∧ φ2 ∧ . . . ∧ φn → ψ
⇐⇒ φ1 ∧ φ2 ∧ . . . ∧ φn → ψ is provable
Corollary (undecidability of entailment relations and `)
The decision problems of the relations and ` in predicate
logic is undecidable:
I
there cannot be a program that, given formulas φ1 , . . . , φn ,
ψ decides whether or not it holds:
φ1 , . . . ,φn ψ
or equivalently:
φ1 , . . . ,φn ` ψ
Kurt Gödel
with Albert Einstein (Princeton, around 1950)
Kurt Gödel
with Albert Einstein (Princeton, around 1950)
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
domain of N is N, the natural numbers (with 0)
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
S N = {hn, n + 1i | n ∈ N}
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
S N = {hn, n + 1i | n ∈ N}
+N : N × N → N, hn, mi →
7 n+m
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
I
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
S N = {hn, n + 1i | n ∈ N}
+N : N × N → N, hn, mi →
7 n+m
N
· : N × N → N, hn, mi →
7 n·m
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
I
I
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
S N = {hn, n + 1i | n ∈ N}
+N : N × N → N, hn, mi →
7 n+m
N
· : N × N → N, hn, mi →
7 n·m
N
< = {hn, mi | n, m ∈ N such that n < m}
Incompleteness theorem
We consider the sets of function and predicate symbols:
F = {0, S, +, ·}
P = {<}
with as intended model number theory N :
I
I
I
I
I
I
domain of N is N, the natural numbers (with 0)
0N = 0
S N = {hn, n + 1i | n ∈ N}
+N : N × N → N, hn, mi →
7 n+m
N
· : N × N → N, hn, mi →
7 n·m
N
< = {hn, mi | n, m ∈ N such that n < m}
One would like to have a complete theory ` for N that allows
to derive all formulas that are true in N .
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
I
an effective list A of axioms (pred. logic hF, Pi-formulas)
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
I
I
an effective list A of axioms (pred. logic hF, Pi-formulas)
finitely many rules R
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
I
I
I
an effective list A of axioms (pred. logic hF, Pi-formulas)
finitely many rules R
` φ means: there is a derivation of φ from axioms A
that only used rules from R
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
an effective list A of axioms (pred. logic hF, Pi-formulas)
I finitely many rules R
I ` φ means: there is a derivation of φ from axioms A
that only used rules from R
that is syntactically consistent, and complete for N :
I
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
an effective list A of axioms (pred. logic hF, Pi-formulas)
I finitely many rules R
I ` φ means: there is a derivation of φ from axioms A
that only used rules from R
that is syntactically consistent, and complete for N :
I
N φ ⇐⇒
` φ
(for all hF, Pi-formulas φ)
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
an effective list A of axioms (pred. logic hF, Pi-formulas)
I finitely many rules R
I ` φ means: there is a derivation of φ from axioms A
that only used rules from R
that is syntactically consistent, and complete for N :
I
N φ ⇐⇒
` φ
(for all hF, Pi-formulas φ)
Yet it turned out that this is impossible.
Incompleteness theorem
Desirable: an axiomatizable first-order theory ` for N :
an effective list A of axioms (pred. logic hF, Pi-formulas)
I finitely many rules R
I ` φ means: there is a derivation of φ from axioms A
that only used rules from R
that is syntactically consistent, and complete for N :
I
N φ ⇐⇒
` φ
(for all hF, Pi-formulas φ)
Yet it turned out that this is impossible.
First incompleteness theorem (Gödel, 1931)
Every axiomatizable and consistent theory ` of first-order logic
for number theory with language hF, Pi is incomplete, i.e.
it contains sentences φ that are true in N , but unprovable in ` :
N φ , yet
6` φ
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
1931
Gödel: incompleteness theorems for first-order arithmetic
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
1931
Gödel: incompleteness theorems for first-order arithmetic
1932
Church: λ-calculus
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
1931
Gödel: incompleteness theorems for first-order arithmetic
1932
Church: λ-calculus
1933/34
Herbrand/Gödel: general recursive functions
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
1931
Gödel: incompleteness theorems for first-order arithmetic
1932
Church: λ-calculus
1933/34
Herbrand/Gödel: general recursive functions
1936
Church/Kleene: λ-definable ∼ general recursive
Church Thesis: ‘effectively calculable’ be defined as either
Church shows: the ‘Entscheidungsproblem’ is unsolvable
Timeline: From logic to computability
1900
Hilbert’s 23 Problems in mathematics
1921
Schönfinkel: Combinatory logic
1928
Hilbert/Ackermann: formulate completeness/decision problems
for the predicate calculus (the latter called ‘Entscheidungsproblem’)
1929
Presburger: completeness/decidability of theory of addition on Z
1930
Gödel: completeness theorem of predicate calculus
1931
Gödel: incompleteness theorems for first-order arithmetic
1932
Church: λ-calculus
1933/34
Herbrand/Gödel: general recursive functions
1936
Church/Kleene: λ-definable ∼ general recursive
Church Thesis: ‘effectively calculable’ be defined as either
Church shows: the ‘Entscheidungsproblem’ is unsolvable
1937
Post: machine model; Church’s thesis as ‘working hypothesis’
Turing: convincing analysis of a ‘human computer’
leading to the ‘Turing machine’
Take home
I exercise classes tomorrow
I
definability and undefinability: reachability
I
decision problems
I
I
I
definition and examples
PCP
meta-theorems of predicate logic
I
undecidability of:
I
I
validity, provability, satisfiability, and entailment
proof for validity by encoding PCP in predicate logic