Skip to content

Commit aee165c

Browse files
committed
adding proof-theory/proof-search
1 parent 1a64050 commit aee165c

8 files changed

Lines changed: 761 additions & 5 deletions

File tree

content/proof-theory/cut-elimination/cut-elimination.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
\olimport{midsequent}
1414
\olimport{interpolation}
1515

16-
1716
\OLEndChapterHook
1817

1918
\end{document}
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
% Part: proof-theory
2+
% Chapter: proof-search
3+
% Section: completeness
4+
5+
\documentclass[../../../include/open-logic-section]{subfiles}
6+
7+
\begin{document}
8+
9+
\olfileid{pt}{ps}{cpl}
10+
11+
\olsection{Completeness}
12+
13+
We now show that the proof search algorithm is fool-proof, i.e., if it
14+
aborts or never halts, there is no !!{proof} of the starting
15+
sequent~$\Gamma \Sequent \Delta$. To do this, we define
16+
!!a{structure}~$\Struct M$ such that for all $!A \in \Gamma$,
17+
$\Sat{M}{!A}$, and for all~$! \in \Delta$, $\Sat/{M}{!A}$. In other
18+
words, all !!{formula}s in~$\Gamma$ are true and all !!{formula}s
19+
in~$\Delta$ are false in~$\Struct M$, i.e., $\Gamma \Sequent \Delta$
20+
is not valid. Since \Log{G3c} is sound, $\Gamma \Sequent \Delta$ has
21+
no !!{proof}
22+
23+
We define $\Struct{M}$ from a pair $\Theta, \Xi$ of !!{formula}s and a
24+
set~$C$ of !!{constant}s. We obtain $\Theta, \Xi$ and~$C$ from a
25+
\emph{failure branch} of the failed (aborted or non-terminating) run
26+
of the proof search. A failure branch is a sequence $\Pi_n \Sequent
27+
\Lambda_n$ of sequents and sets of !!{constant}s~$C_n$ such that
28+
$\Pi_0 \Sequent \Lambda_0$ is the end-sequent $\Gamma \Sequent
29+
\Delta$, and $\Pi_{n+1} \Sequent \Lambda_{n+1}$ is a premise of $\Pi_n
30+
\Sequent \Lambda_n$ generated at stage~$n+1$ for which the algorithm
31+
does not find !!a{proof}. Such a premise must obviously exist for
32+
each~$n$, since otherwise the algorithm would have found !!a{proof}.
33+
We let $C_n$ be the set of !!{constant}s associated with~$\Pi_n
34+
\Sequent \Delta_n$.
35+
36+
If the algorithm aborts at a top-most sequent consisting only of
37+
atomic !!{formula}s, the branch ending in that sequent is a failure
38+
branch. If if the algorithm never terminates, it keeps generating
39+
larger and larger trees. You can think of these as growing an infinite
40+
tree (the tree you'd have after infinitely many steps of the algorithm
41+
had run). This would be an infinite tree which is, however, finitely
42+
branching (every node only has one or two children---the sequents
43+
immediately above it). Every infinite, finitely branching tree must
44+
have an infinite branch by K\H{o}nig's Lemma. Such an infinite branch
45+
would be a failure branch in the case where the search algorithm runs
46+
forever.
47+
48+
If the sequence of $\Pi_n \Sequent \Lambda_n$ and $C_n$ is a failure
49+
branch, let $\Theta = \bigcup_n \Pi_n$ and $\Xi = \bigcup_n \Lambda_n$
50+
(removing indices and multiple occurrences of !!{formula}s) and $C =
51+
\bigcup_n C_n$.
52+
53+
We are ready to define~$\Struct{M}$.
54+
\begin{enumerate}
55+
\item The domain $\Domain{M}$ is the
56+
set of terms that can be formed from~$C$ and the !!{function}s
57+
in~$\Gamma \Sequent \Delta$, if there are any, but no !!{variable}s.
58+
\item If $c \in \Domain{M}$, $\Assign{c}{M} = c$.
59+
\item If $f$ is an $m$-place !!{function} in $\Gamma \Sequent \Delta$, and $t_1$,
60+
\dots, $t_m \in \Domain{M}$, then $\Assign{f}{M}(t_1, \dots, t_m) =
61+
f(t_1, \dots, t_n)$.
62+
\item If $R$ is an $m$-place !!{predicate} in $\Gamma \Sequent
63+
\Delta$, then $\Assign{R}{M} = \Setabs{\tuple{t_1, \dots, t_m} \in
64+
\Domain{M}^n}{R(t_1, \dots, t_n) \in \Theta}$.
65+
\end{enumerate}
66+
$\Struct{M}$ is a \emph{term model} in that its domain is a set of
67+
terms, and the !!{constant}s and !!{function}s are interpreted so as
68+
to guarantee that $\Value{t}{M} = t$. The atomic !!{formula}s
69+
in~$\Theta$ are used to define $\Assign{R}{M}$ in such a way as to
70+
guarantee that $\Sat{M}{R(t_1, \dots, t_n)}$ iff $R(t_1, \dots, t_n)
71+
\in \Theta$.
72+
73+
\begin{lem}\ollabel{lem:truth}
74+
For all $!A \in \Theta \cup \Xi$:
75+
\begin{enumerate}
76+
\item If $!A \in \Theta$ then $\Sat{M}{!A}$.
77+
\item If $!A \in \Xi$ then $\Sat/{M}{!A}$.
78+
\end{enumerate}
79+
\end{lem}
80+
81+
\begin{proof}
82+
By induction on $\depth{!A}$.
83+
84+
First assume $!A$ is atomic, i.e., either $!A \ident \lfalse$ or $!A
85+
\ident R(t_1, \dots, t_m)$.
86+
87+
Because $\Pi_n \Sequent \Lambda_n$ is a failure branch, no $\Pi_n$ can
88+
contain $\lfalse$ (otherwise $\Pi_n \Sequent \Lambda_n$ would be an
89+
axiom). $\Sat{M}{R(t_1, \dots, t_m)}$ iff $R(t_1, \dots, t_m) \in
90+
\Theta$ by definition of~$\Struct{M}$. Together we have: if $!A \in
91+
\Theta$, then $\Sat{M}{!A}$.
92+
93+
If $!A$ is atomic and $!A \in \Pi_n$ then $!A \in \Pi_{n+1}$ and if
94+
$!A \in \Lambda_n$ then $!A \in \Lambda_{n+1}$. (This follows from the
95+
way the proof search algorithm generates successor sequents.) Hence,
96+
if $!A \in \Theta \cap \Xi$ then for some~$n$, $!A \in \Pi_n \cap
97+
\Lambda_n$. This means that $\Pi_n \Sequent \Lambda_n$ is an axiom,
98+
and the failure branch can contain no axioms. So $!A \notin \Theta
99+
\cap \Xi$ for atomic~$!A$ by construction, and consequently if $!A \in
100+
\Xi$ then $!A \notin \Theta$. This implies that if $!A \in \Xi$ then
101+
$\Sat/{M}{!A}$ by definition of~$\Struct{M}$.
102+
103+
For the inductive step, assume (1) and (2) hold for all !!{formula}s
104+
of lower !!{depth} than~$!A$. We prove (1) and (2) for $!A$ by
105+
distinguishing cases.
106+
107+
First note that when $!A^i$ occurs in $\Pi_n \Sequent \Lambda_n$ then
108+
$!A^i$ also occurs in $\Pi_{n+1} \Sequent \Lambda_{n+1}$ unless $i$ is
109+
the smallest index in $\Pi_n \Sequent \Lambda_n$. Since the smallest
110+
index increases in topmost sequents added at each stage, eventually we
111+
reach $\Pi_n \Sequent \Lambda_n$ in which $!A^i$ occurs, and $i$ is
112+
the smallest index. At stage $n+1$ the algorithm reduces~$!A^i$. In
113+
other words, if $!A \in \Theta$, then for some $n$, $\Pi_n = \Pi_n',
114+
!A^i$ and $i$ is the smallest index. And if $!A \in \Xi$, then for
115+
some $n$, $\Lambda_n = \Lambda_n', !A^i$ and $i$~is the smallest
116+
index.
117+
118+
\begin{enumerate}
119+
\item $!A \in \Theta$ and $!A \ident !B \land !C$. Then for some
120+
$n$, $\Pi_n = \Pi_n', (!B \land !C)^i$. $\Pi_{n+1} \Sequent
121+
\Lambda_{n+1}$ is the corresponding premise of~\LeftR{\land}, i.e.,
122+
$\Pi_{n+1} = \Pi_n', !B^k, !C^{k+1}$. Consequently, $!B, !C \in
123+
\Theta$. By inductive hypothesis, $\Sat{M}{!B}$ and $\Sat{M}{!C}$.
124+
By definition of $\Sat{M}{}$, we have $\Sat{M}{!B \land !C}$.
125+
126+
\item $!A \in \Xi$ and $!A \ident !B \land !C$. Then for some $n$,
127+
$\Lambda_n = \Lambda_n', !B \land !C$. $\Pi_{n+1} \Sequent
128+
\Lambda_{n+1}$ is one of the two premises of~\RightR{\land} with
129+
conclusion $\Pi_n \Sequent \Lambda'_n, !B \land !C$, i.e.,
130+
$\Lambda_{n+1} = \Lambda_n', !B^k$ or $\Lambda_{n+1} = \Lambda_n',
131+
!C^k$. Consequently, either $!B \in \Xi$ or $!C \in \Xi$. By
132+
inductive hypothesis, either $\Sat/{M}{!B}$ or $\Sat/{M}{!C}$. By
133+
definition of $\Sat{M}{}$, we have $\Sat/{M}{!B \land !C}$.
134+
135+
\item The cases where $!A \ident \lnot !B$, $!A \ident !B \lor !C$,
136+
and $!A \ident !B \lif !C$ are similar and left as exercises.
137+
138+
\item $!A \in \Theta$ and $!A \ident \lexists[x][!B(x)]$. Then for
139+
some $n$, $\Pi_n = \Pi_n', \lexists[x][!B(x)]^i$. $\Pi_{n+1}
140+
\Sequent \Lambda_{n+1}$ is the corresponding premise
141+
of~\LeftR{\lexists}, i.e., $\Pi_{n+1} = \Pi_n', !B(c)^k$ for
142+
some~$c$. Consequently, $!B(c) \in \Theta$ and~$c \in C$. By
143+
inductive hypothesis, $\Sat{M}{!B(c)}$. By definition of
144+
$\Sat{M}{}$, we have $\Sat{M}{\lexists[x][!B(x)]}$.
145+
146+
\item $!A \in \Xi$ and $!A \ident \lexists[x][!B(x)]$. Then for some
147+
$n$, $\Lambda_n = \Lambda_n', \lexists[x][!B(x)]^i$. Since every time
148+
$\lexists[x][!B(x)]$ is reduced, $\lexists[x][!B(x)]$ remains on the
149+
right side of the premise sequent with a new index,
150+
$\lexists[x][!B(x)]$ is reduced infinitely often on the right side
151+
in a failure branch if it occurs there. Every term $t \in
152+
\Domain{M}$ eventually is ``the first term only containing constants
153+
in~$C_n$ not already used in a reduction of $\lexists[x][!B(x)]$ on
154+
the right'' on a failure branch. Hence, for all $t \in \Domain{M}$,
155+
$!B(t) \in \Lambda_n$ for some~$n$ and consequently $!B(t) \in \Xi$.
156+
By inductive hypothesis, $\Sat/{M}{!B(t)}$ for all $t \in
157+
\Domain{M}$. By definition of $\Sat{M}{}$, we have
158+
$\Sat/{M}{\lexists[x][!B(x)]}$.
159+
160+
\item The cases where $!A \ident \lforall[x][!B(x)]$ are similar and
161+
left as exercises.
162+
\end{enumerate}
163+
\end{proof}
164+
165+
\begin{cor}\ollabel{cor:complete} The proof search algorithm for
166+
\Log{G3c} is complete: if it aborts or never halts, the starting
167+
sequent~$\Gamma \Sequent \Delta$ is not valid and hence has no
168+
!!{proof}.
169+
\end{cor}
170+
171+
\begin{proof}
172+
If the algorithm aborts or never halts, there is a failure branch
173+
from which $\Struct{M}$ can be defined. By \olref{lem:truth}, for
174+
all $!A \in \Gamma$, $\Sat{M}{!A}$ and for all $!A \in \Delta$,
175+
$\Sat/{M}{!A}$. (Recall that $\Pi_0 = \Gamma$ and $\Lambda_0 =
176+
\Delta$, so $\Gamma \subseteq \Theta$ and $\Delta \subseteq \Xi$.)
177+
So $\Gamma \Sequent \Delta$ is not valid. By soundness of~\Log{G3c},
178+
$\Gamma \Sequent \Delta$ has no !!{proof}.
179+
\end{proof}
180+
181+
\begin{cor}
182+
\Log{G3c} is complete: if $\Gamma \Sequent \Delta$ is valid,
183+
$\Log{G3c} \Proves \Gamma \Sequent \Delta$.
184+
\end{cor}
185+
186+
\begin{proof}
187+
We prove the contrapositive. Suppose $\Log{G3c} \Proves/ \Gamma
188+
\Sequent \Delta$. Then the proof search algorithm must abort or
189+
never halt, as there is no !!{proof} to be found. By \olref{cor:complete}, $\Gamma \Sequent \Delta$ is not
190+
valid.
191+
\end{proof}
192+
193+
194+
\end{document}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
% Part: proof-theory
2+
% Chapter: proof-search
3+
% Section: introduction
4+
5+
\documentclass[../../../include/open-logic-section]{subfiles}
6+
7+
\begin{document}
8+
9+
\olfileid{pt}{ps}{int}
10+
11+
\olsection{Introduction}
12+
13+
The axioms and inference rules of !!{proof} systems like \Log{G3c} or
14+
\Log{N1i} define what trees of sequents or !!{formula}s count as
15+
correct !!{proof}s. Given such a tree of sequents or !!{formula}s
16+
(possibly with additional information such as which rules are applied
17+
at each step, or labels for assumptions and inference rules that
18+
discharge them) the definitions of axioms and rules allow us to check
19+
whether the given tree is a correct !!{proof}. It is a diferent, and
20+
typically more difficult, problem to \emph{find} !!a{proof} of a given
21+
sequent or of a given !!{formula} from given assumptions. That is the
22+
problem of \emph{proof search}.
23+
24+
There is a very simple-minded procedure for proof search. We can think
25+
of !!{formula}s as sequences of symbols from a finite alphabet.
26+
Sequents and trees of sequents or !!{formula}s can be thought of as
27+
sequences of !!{formula}s as well (perhaps using special brackets to
28+
indicate tree branching). The axioms and rules allow us to
29+
mechanically check if a sequence of symbols represents a correct
30+
!!{proof}. Consequently, we can mechanically generate \emph{all
31+
possible} correct !!{proof}s (by generating all sequences of symbols
32+
from the alphabet used to represent !!{proof}s and checking for each
33+
candidate sequence whether it represents a correct !!{proof}). The
34+
simple-minded proof search precedure is: generate all correct
35+
!!{proof}s until we find one that is a !!{proof} of the given sequent
36+
(or of the given !!{formula} with open assumptions among the given
37+
ones).
38+
39+
A better method is to use the naive method you'd use to find
40+
!!a{proof} by hand: you start with the end-sequent, pick !!a{formula},
41+
and apply an inference rule ``backwards'' to generate a premise or
42+
premises which, if they had !!{proof}s, would combine with the last
43+
inference to !!a{proof} of the given sequent. A similar method
44+
(although more complicated) is what you'd use to find !!a{proof} in a
45+
natural deduction system.
46+
47+
But this method is not fool-proof: if you pick the wrong rule, or
48+
!!{formula}s in the wrong order, you may hit a dead end. It is also
49+
not completely specified: at each point, there may be more than one
50+
possible !!{formula} to chose, or more than one rule to apply
51+
backwards. A \emph{proof search algorithm} is a completely specified
52+
procedure that will find !!a{proof} if one exists (i.e., is
53+
fool-proof).
54+
55+
Some !!{proof} systems lend themselves to simpler proof search
56+
algorithms than others. In sequent systems, the !!{main operator} of
57+
!!a{formula}, and whether it occurs on the left or the right,
58+
determines which rule to apply backwards. E.g., if you want to find
59+
!!a{proof} of $\Gamma \Sequent \Delta, !A \land !B$ in which $!A \land
60+
!B$ occurs on the right, you should apply \RightR{\land} backwards and
61+
generate two corresponding premises $\Gamma \Sequent \Delta, !A$ and
62+
$\Gamma \Sequent \Delta, !B$. If your system is \Log{G1c}, however,
63+
the presence of contraction makes things more difficult because it
64+
gives you more options: You could also apply \RightR{\Contraction}
65+
backward and generate the premise $\Gamma \Sequent \Delta, !A \land
66+
!B, !A \land !B$ instead. And then the premise $\Gamma \Sequent
67+
\Delta, !A \land !B, !A \land !B, !A \land !B$, and so on. In
68+
\Log{G2c} it's even worse. Applying the rule \RightR{\land} backwards
69+
also means you have to guess $\Gamma_1$, $\Gamma_2$ such that $\Gamma
70+
= \Gamma_1 \cup \Gamma_2$ and $\Delta_1$, $\Delta_2$ such that $\Delta
71+
= \Delta_1 \cup \Delta_2$ and try your luck with the premises
72+
$\Gamma_1 \Sequent \Delta_1, !A$ and $\Gamma_2 \Sequent \Delta_2, !B$.
73+
A wrong guess might lead you into a dead end later on, and you'd have
74+
to backtrack to the beginning and pick different $\Gamma_1$,
75+
$\Gamma_2$, $\Delta_1$, $\Delta_2$. If the !!{formula} is $!A \lor !B$
76+
you have to chose one of the two possibilities for \RightR{\lor},
77+
producing one of the two possible premises $\Gamma \Sequent \Delta,
78+
!A$ or $\Gamma \Sequent \Delta, !B$. A wrong choice would again lead
79+
to having to backtrack.
80+
81+
The system \Log{G3c} does not have these problems. It has no
82+
structural rules, and the choice of inference rule is determined by
83+
the !!{main operator} and the side the !!{formula} occurs on. Hence,
84+
\Log{G3c} is better suited to proof search than \Log{G1c} or
85+
\Log{G2c}. A successful search will yield !!a{proof} in \Log{G3c}, and
86+
that !!{proof} can then be translated into \Log{G1c} or \Log{G2c} (or
87+
\Log{N1c} for that matter). So having a proof search algorithm for
88+
\Log{G3c} and translation algorithms for \Log{G3c} !!{proof}s to
89+
!!{proof}s in other systems also solves the proof search methods for
90+
those systems.
91+
92+
How do we know that a proof search algorithm is fool-proof? This would
93+
involve showing that if the algorithm fails to find !!a{proof}, no
94+
!!{proof} can exist. After all, if we pick a bad algorithm, we might
95+
run into cases where it fails to find a proof even if one exists. This
96+
is not a problem the simple minded algorithm has, because it searches
97+
through all possible !!{proof}s. But a proof search algorithm is
98+
supposed to be efficient and expend the minimum amount of effort.
99+
100+
The key idea to showing that a proof search algorithm is fool-proof is
101+
to show that if the algorithm fails, we can show from the way it fails
102+
that the sequent can't possibly have !!a{proof}. And the way to show
103+
that is to show that it is not valid. In classical first-order logic,
104+
valid sequents $\Gamma \Sequent \Delta$ are those where every
105+
!!{structure} makes at least one !!{formula} in $\Gamma$ is false or
106+
at least one !!{formula} in~$\Delta$ is true. \Log{G3c} is
107+
\emph{sound}, i.e., it !!{prove}s only valid sequents. This is
108+
established by induction on !!{proof}s: Axioms are obvioulsy valid,
109+
and if the premises of a rule are valid, so is the conclusion. To show
110+
that a proof search algorithm is fool-proof we show that if the search
111+
for !!a{proof} of $\Gamma \Sequent \Delta$ fails, we can define
112+
!!a{structure} in which all !!{formula}s in $\Gamma$ are true and all
113+
!!{formula}s in~$\Delta$ are false. This also establishes that
114+
\Log{G3c} is \emph{complete}, i.e., that if $\Gamma \Sequent \Delta$
115+
is valid, there is a \Log{G3c}-!!{proof} of it. Since all failed
116+
proof searches show that $\Gamma \Sequent \Delta$ is invalid, every
117+
proof search for a valid sequent must succeed.
118+
119+
\end{document}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
% Part: proof-theory
2+
% Chapter: proof-search
3+
4+
\documentclass[../../../include/open-logic-chapter]{subfiles}
5+
6+
\begin{document}
7+
8+
\olchapter{pt}{ps}{Proof Search}
9+
10+
\olimport{introduction}
11+
\olimport{search-algorithm}
12+
\olimport{completeness}
13+
\olimport{tableaux}
14+
15+
\OLEndChapterHook
16+
17+
\end{document}

0 commit comments

Comments
 (0)