Source and provenance
All 12 authority files and 1854 lines are shown exactly. The projected chapter slice is byte-checked at SHA-256 3f6186470ab3bfacdaabb2268f9e16150a039bf6c8144d5d2f40d7c8567a3794. AI production model: OpenAI Codex gpt-5.6-sol, Ultra. Source authorship remains with the credited Open Logic Project contributors.
content/first-order-logic/completeness/completeness.tex
42 lines; SHA-256 35cbcfc7f12046ceabc5c4407c43817d71d3907e9e9d57a1b5928fcbe10c672c. Open preserved source.
% Part: first-order-logic% Chapter: completeness\documentclass[../../../include/open-logic-chapter]{subfiles}\begin{document}\iftag{FOL}{\olchapter{fol}{com}{The Completeness Theorem}}{\olchapter{pl}{com}{The Completeness Theorem}}\olimport{introduction}\olimport{outline}\olimport{complete-consistent-sets}\iftag{FOL}{%\olimport{henkin-expansions}}{}\olimport{lindenbaums-lemma}\olimport{construction-of-model}\iftag{FOL}{%\olimport{identity}}{}\olimport{completeness-thm}\olimport{compactness}\olimport{compactness-direct}\iftag{FOL}{%\olimport{downward-ls}}{}\OLEndChapterHook\end{document}
content/first-order-logic/completeness/introduction.tex
75 lines; SHA-256 40a994a78343dccb102c8347722a6eb85fd3a12dd4c6565a37960f7b24673500. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: introduction\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{int}}{\olfileid{pl}{com}{int}}\olsection{Introduction}The completeness theorem is one of the most fundamental results aboutlogic. It comes in two formulations, the equivalence of which we'llprove. In its first formulation it says something fundamental aboutthe relationship between semantic consequence and our !!{derivation}system: if !!a{sentence}~$!A$ follows from some !!{sentence}s$\Gamma$, then there is also !!a{derivation} that establishes $\Gamma\Proves !A$. Thus, the !!{derivation} system is as strong as it canpossibly be without proving things that don't actually follow.In its second formulation, it can be stated as a model existenceresult: every consistent set of !!{sentence}s is satisfiable.Consistency is a proof-theoretic notion: it says that our!!{derivation} system is unable to produce certain !!{derivation}s.But who's to say that just because there are no !!{derivation}s of acertain sort from~$\Gamma$, it's guaranteed that there is\iftag{FOL}{!!a{structure}~$\Struct{M}$}{!!{valuation}{~$\pAssign{v}$}with $\iftag{FOL}{\Sat{M}}{\pSat{v}}{\Gamma}$}? Before thecompleteness theorem was first proved---in fact before we had the!!{derivation} systems we now do---the great German mathematicianDavid Hilbert held the view that consistency of mathematical theoriesguarantees the existence of the objects they are about. He put it asfollows in a letter to Gottlob Frege:\begin{quote}If the arbitrarily given axioms do not contradict one another withall their consequences, then they are true and the things defined bythe axioms exist. This is for me the criterion of truth andexistence.\end{quote}Frege vehemently disagreed. The second formulation of the completenesstheorem shows that Hilbert was right in at least the sense that if theaxioms are consistent, then \emph{some}\iftag{FOL}{!!{structure}}{!!{valuation}} exists that makes them alltrue.These aren't the only reasons the completeness theorem---or rather,its proof---is important. It has a number of important consequences,some of which we'll discuss separately. For instance, since any!!{derivation} that shows $\Gamma \Proves !A$ is finite and so canonly use finitely many of the !!{sentence}s in~$\Gamma$, it follows bythe completeness theorem that if $!A$ is a consequence of~$\Gamma$, itis already a consequence of a finite subset of~$\Gamma$. This iscalled \emph{compactness}. Equivalently, if every finite subset of$\Gamma$ is consistent, then $\Gamma$ itself must be consistent.Although the compactness theorem follows from the completeness theoremvia the detour through !!{derivation}s, it is also possible to use the\emph{the proof of} the completeness theorem to establish itdirectly. For what the proof does is take a set of !!{sentence}s witha certain property---consistency---and constructs !!a{structure} outof this set that has certain properties (in this case, that itsatisfies the set). Almost the very same construction can be used todirectly establish compactness, by starting from ``finitelysatisfiable'' sets of !!{sentence}s instead of consistent ones.\iftag{FOL}{The construction also yields other consequences, e.g.,that any satisfiable set of !!{sentence}s has a finite or!!{denumerable}s model. (This result is called theL\"owenheim--Skolem theorem.) In general, the construction of!!{structure}s from sets of !!{sentence}s is used often in logic,and sometimes even in philosophy.}{}\end{document}
content/first-order-logic/completeness/outline.tex
170 lines; SHA-256 e86bb4893ff5da65af4fa5b8b7eebec5807e0b4aa0562ca5388fac369aec642e. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: outline\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{out}}{\olfileid{pl}{com}{out}}\olsection{Outline of the Proof}The proof of the completeness theorem is a bit complex, and upon firstreading it, it is easy to get lost. So let us outline the proof. Thefirst step is a shift of perspective, that allows us to see a route toa proof. When completeness is thought of as ``whenever $\Gamma\Entails !A$ then $\Gamma \Proves !A$,'' it may be hard to even comeup with an idea: for to show that $\Gamma \Proves !A$ we have to find!!a{derivation}, and it does not look like the hypothesis that$\Gamma \Entails !A$ helps us for this in any way. For some proofsystems it is possible to directly construct !!a{derivation}, but wewill take a slightly different approach. The shift in perspectiverequired is this: completeness can also be formulated as: ``if$\Gamma$ is consistent, it is satisfiable.'' Perhaps we can use theinformation in~$\Gamma$ together with the hypothesis that it isconsistent to construct \iftag{FOL}{!!a{structure}}{!!a{valuation}}that satisfies every \iftag{FOL}{!!{sentence}}{!!{formula}}in~$\Gamma$. After all, we knowwhat kind of \iftag{FOL}{!!{structure}}{!!{valuation}} we are lookingfor: one that is as $\Gamma$ describes it!{}If $\Gamma$ contains only \iftag{FOL}{atomic!!{sentence}s}{!!{propositional variable}s}, it is easy to constructa model for it.\iftag{FOL}{ Suppose the atomic !!{sentence}s are allof the form $\Atom{P}{a_1,\dots,a_n}$ where the $a_i$ are!!{constant}s.}{} All we have to do is come up with\iftag{FOL}{%!!a{domain}~$\Domain{M}$ and an assignment for~$P$ so that$\Sat{M}{\Atom{P}{a_1,\ldots,a_n}}$. But that's not very hard:put $\Domain{M} = \Nat$, $\Assign{\Obj c_i}{M} = i$, and for every$\Atom{P}{a_1,\ldots,a_n} \in \Gamma$, put the tuple $\tuple{k_1,\dots, k_n}$ into $\Assign{P}{M}$, where $k_i$ is the index of theconstant symbol~$a_i$ (i.e., $a_i \ident \Obj c_{k_i}$).}{%!!a{valuation}~$\pAssign{v}$ such that $\pSat{v}{p}$ for all $p \in\Gamma$. Well, let $\pAssign{v}(p) = \True$ iff $p \in \Gamma$.}Now suppose $\Gamma$ contains some !!{formula}~$\lnot !B$, with $!B$atomic. We might worry that the construction of$\iftag{FOL}{\Struct{M}}{\pAssign{v}}$ interferes with the possibilityof making $\lnot !B$ true. But here's where the consistencyof~$\Gamma$ comes in: if $\lnot !B \in \Gamma$, then $!B \notin\Gamma$, or else $\Gamma$ would be inconsistent. And if $!B \notin\Gamma$, then according to our constructionof~$\iftag{FOL}{\Struct{M}}{\pAssign{v}}$,$\iftag{FOL}{\Sat/{M}}{\pSat/{v}}{!B}$, so$\iftag{FOL}{\Sat{M}}{\pSat{v}}{\lnot !B}$. So far so good.What if $\Gamma$ contains complex, non-atomic formulas? Say itcontains $!A \land !B$. To make that true, we should proceed as ifboth $!A$ and $!B$ were in~$\Gamma$. And if $!A \lor !B \in \Gamma$,then we will have to make at least one of them true, i.e., proceed asif one of them was in~$\Gamma$.This suggests the following idea: we add additional !!{formula}sto~$\Gamma$ so as to (a)~keep the resulting set consistent and(b)~make sure that for every possible atomic !!{sentence}~$!A$, either$!A$ is in the resulting set, or $\lnot !A$ is, and (c)~such that,whenever $!A \land !B$ is in the set, so are both $!A$ and $!B$, if$!A \lor !B$ is in the set, at least one of $!A$ or $!B$ is also, etc.We keep doing this (potentially forever). Call the set of all!!{formula}s so added~$\Gamma^*$. Then our construction above wouldprovide us with \iftag{FOL}{!!a{structure}~$\Struct{M}$}{!!a{valuation}~$\pAssign{v}$}for which we could prove, by induction, that it satisfies all sentencesin~$\Gamma^*$, and hence also all sentence in~$\Gamma$since $\Gamma \subseteq \Gamma^*$. It turns out that guaranteeing (a)and~(b) is enough. A set of sentences for which (b) holds is called\emph{complete}. So our task will be to extend the consistentset~$\Gamma$ to a consistent and complete set~$\Gamma^*$.\iftag{FOL}{%There is one wrinkle in this plan: if $\lexists[x][!A(x)] \in \Gamma$we would hope to be able to pick some !!{constant}~$c$ and add $!A(c)$in this process. But how do we know we can always do that? Perhaps weonly have a few !!{constant}s in our language, and for each one ofthem we have $\lnot !A(c) \in \Gamma$. We can't also add $!A(c)$,since this would make the set inconsistent, and we wouldn't knowwhether $\Struct{M}$ has to make $!A(c)$ or $\lnot !A(c)$ true.Moreover, it might happen that $\Gamma$ contains only sentences in alanguage that has no constant symbols at all (e.g., the language ofset theory).The solution to this problem is to simply add infinitely manyconstants at the beginning, plus sentences that connect them with thequantifiers in the right way. (Of course, we have to verify that thiscannot introduce an inconsistency.)Our original construction works well if we only have !!{constant}s inthe atomic sentences. But the language might also contain!!{function}s. In that case, it might be tricky to find the rightfunctions on~$\Nat$ to assign to these !!{function}s to makeeverything work. So here's another trick: instead of using $i$ tointerpret $\Obj c_i$, just take the set of !!{constant}s itself as thedomain. Then $\Struct M$ can assign every !!{constant} to itself:$\Assign{\Obj c_i}{M} = \Obj c_i$. But why not go all the way: let$\Domain{M}$ be all \emph{terms} of the language!{} If we do this,there is an obvious assignment of functions (that take terms asarguments and have terms as values) to !!{function}s: we assign to the!!{function}~$\Obj f^n_i$ the function which, given $n$ terms $t_1$,\dots,~$t_n$ as input, produces the term $\Obj f^n_i(t_1, \dots, t_n)$as value.The last piece of the puzzle is what to do with~$\eq$. The!!{predicate}~$\eq$ has a fixed interpretation: $\Sat{M}{\eq[t][t']}$iff $\Value{t}{M} = \Value{t'}{M}$. Now if we set things up so that the!!{value} of a term~$t$ is $t$ itself, then this !!{structure}will make \emph{no} sentence of the form $\eq[t][t']$ trueunless $t$ and $t'$ are one and the same term. And ofcourse this is a problem, since basically every interesting theory ina language with !!{function}s will have as theorems sentences$\eq[t][t']$ where $t$ and $t'$ are not the same term (e.g., intheories of arithmetic: $\eq[(\Obj 0+ \Obj 0)][\Obj 0]$). To solvethis problem, we change the domain of~$\Struct M$: instead of using terms asthe objects in~$\Domain{M}$, we use sets of terms, and each set is sothat it contains all those terms which the sentences in~$\Gamma$require to be equal. So, e.g., if $\Gamma$ is a theory of arithmetic,one of these sets will contain: $\Obj 0$, $(\Obj 0 + \Obj 0)$, $(\Obj0 \times \Obj 0)$, etc. This will be the set we assign to $\Obj 0$,and it will turn out that this set is also the value of all the termsin it, e.g., also of $(\Obj 0 + \Obj 0)$. Therefore, the sentence$\eq[(\Obj 0+ \Obj 0)][\Obj 0]$ will be true in this revised!!{structure}.}{}So here's what we'll do. First we investigate the properties of!!{complete} consistent sets, in particular we prove that!!a{complete} consistent set contains $!A \land !B$ iff it containsboth $!A$ and~$!B$, $!A \lor !B$ iff it contains at least one of them,etc. (\olref[ccs]{prop:ccs}).\iftag{FOL}{ Then we define andinvestigate ``saturated'' sets of sentences. A saturated set is onewhich contains conditionals that link each quantified !!{sentence}to instances of it (\olref[hen]{defn:henkin-exp}). We show that anyconsistent set~$\Gamma$ can always be extended to a saturatedset~$\Gamma'$ (\olref[hen]{lem:henkin}). If a set is consistent,saturated, and !!{complete} it also has the property that itcontains \iftag{prvEx}{$\lexists[x][!A(x)]$ iff it contains $!A(t)$for some closed term~$t$}{}\iftag{defEx,defAll}{}{ and}\iftag{prvAll}{$\lforall[x][!A(x)]$ iff it contains $!A(t)$ for allclosed terms~$t$}{} (\olref[hen]{prop:saturated-instances}).}{}We'll then take the\iftag{FOL}{ saturated}{} consistentset~$\iftag{FOL}{\Gamma'}{\Gamma}$ and show that it can be extendedto a \iftag{FOL}{saturated, consistent, and}{consistent and}!!{complete} set~$\Gamma^*$ (\olref[lin]{lem:lindenbaum}). This set$\Gamma^*$ is what we'll use to define our \iftag{FOL}{termmodel~$\Struct M(\Gamma^*)$}{!!{valuation}~$\pAssign v(\Gamma^*)$}.\iftag{FOL}{The term model has the set of closed terms as its domain,and the interpretation of its !!{predicate}s is given by the atomic!!{sentence}s}{The valuation is determined by the !!{propositionalvariable}s} in~$\Gamma^*$ (\olref[mod]{defn:termmodel}). We'lluse the properties of\iftag{FOL}{ saturated,}{} complete consistentsets to show that indeed$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!A}$ iff $!A \in\Gamma^*$ (\olref[mod]{lem:truth}), and thus in particular,$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\Gamma}$.\iftag{FOL}{Finally, we'll consider how to define a term model if$\Gamma$ contains~$\eq$ as well(\olref[ide]{defn:term-model-factor}) and show that itsatisfies~$\Gamma^*$ (\olref[ide]{lem:truth}).}{}\end{document}
content/first-order-logic/completeness/complete-consistent-sets.tex
223 lines; SHA-256 cf7d517de5d2d257492c66f2cf16347fce490f2d932681a3f6ebd2386e9b1ffd. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: complete-sets% Definition of complete consistent sets. Properties of complete sets required% for completeness proved are in provability.tex in the% chapter on the proof system used.\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{ccs}}{\olfileid{pl}{com}{ccs}}\olsection{Complete Consistent Sets of \usetoken{P}{sentence}}\begin{defn}[Complete set]\ollabel{def:complete-set} A set~$\Gamma$ of !!{sentence}s is\emph{!!{complete}} iff for any !!{sentence}~$!A$, either $!A \in\Gamma$ or $\lnot !A \in \Gamma$.\end{defn}\begin{explain}!!^{complete} sets of sentences leave no questions unanswered. Forany !!{sentence}~$!A$, $\Gamma$ ``says'' if $!A$ is true or false. Theimportance of !!{complete} sets extends beyond the proof of thecompleteness theorem. A theory which is !!{complete} andaxiomatizable, for instance, is always decidable.\end{explain}\begin{explain}!!^{complete} consistent sets are important in the completeness proofsince we can guarantee that every consistent set of!!{sentence}s~$\Gamma$ is contained in !!a{complete} consistentset~$\Gamma^*$. !!^a{complete} consistent set contains, for each!!{sentence}~$!A$, either $!A$ or its negation $\lnot !A$, but notboth. This is true in particular for \iftag{FOL}{atomic!!{sentence}s}{propositional variables}, so from !!a{complete}consistent set\iftag{FOL}{ in a language suitably expanded by!!{constant}s}{}, we can construct\iftag{FOL}{!!a{structure}}{!!a{valuation}} where the\iftag{FOL}{interpretation of !!{predicate}s}{truth value assigned topropositional variables} is defined according to which\iftag{FOL}{atomic !!{sentence}s}{!!{propositional variable}s} arein~$\Gamma^*$. This \iftag{FOL}{!!{structure}}{!!{valuation}} can thenbe shown to make all !!{sentence}s in~$\Gamma^*$ (and hence also allthose in~$\Gamma$) true. The proof of this latter fact requires that$\lnot !A \in \Gamma^*$ iff $!A \notin \Gamma^*$, $(!A \lor !B) \in\Gamma^*$ iff $!A \in \Gamma^*$ or $!B \in \Gamma^*$, etc.\end{explain}In what follows, we will often tacitly use the properties ofreflexivity, monotonicity, and transitivity of $\Proves$ (see\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ptn:sec},prfND/{fol:ntd:ptn:sec},prfAX/{fol:axd:ptn:sec},prfTab/{fol:tab:ptn:sec}}}{%\tagrefs{prfSC/{pl:seq:ptn:sec},prfND/{pl:ntd:ptn:sec},prfAX/{pl:axd:ptn:sec},prfTab/{pl:tab:ptn:sec}}}).\begin{prop}\ollabel{prop:ccs}Suppose $\Gamma$ is !!{complete} and consistent. Then:\begin{enumerate}\item \ollabel{prop:ccs-prov-in} If $\Gamma \Proves !A$, then $!A \in\Gamma$.\tagitem{prvAnd}{\ollabel{prop:ccs-and} $!A \land !B \in \Gamma$iff both $!A \in \Gamma$ and $!B \in \Gamma$.}{}\tagitem{prvOr}{\ollabel{prop:ccs-or} $!A \lor !B \in \Gamma$ iffeither $!A \in \Gamma$ or $!B \in \Gamma$.}{}\tagitem{prvIf}{\ollabel{prop:ccs-if} $!A \lif !B \in \Gamma$ iffeither $!A \notin \Gamma$ or $!B \in \Gamma$.}{}\end{enumerate}\end{prop}\begin{proof}Let us suppose for all of the following that $\Gamma$ is !!{complete} andconsistent.\begin{enumerate}\item If $\Gamma \Proves !A$, then $!A \in \Gamma$.Suppose that $\Gamma \Proves !A$. Suppose to the contrary that $!A\notin \Gamma$. Since $\Gamma$ is !!{complete}, $\lnot !A \in \Gamma$.By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:prv:prop:explicit-inc},prfND/{fol:ntd:prv:prop:explicit-inc},prfAX/{fol:axd:prv:prop:explicit-inc},prfTab/{fol:tab:prv:prop:explicit-inc}}}{%\tagrefs{prfSC/{pl:seq:prv:prop:explicit-inc},prfND/{pl:ntd:prv:prop:explicit-inc},prfAX/{pl:axd:prv:prop:explicit-inc},prfTab/{pl:tab:prv:prop:explicit-inc}}},$\Gamma$ is inconsistent. This contradicts the assumption that$\Gamma$ is consistent. Hence, it cannot be the case that $!A \notin\Gamma$, so $!A \in \Gamma$.\tagitem{defAnd}{}{%\iftag{probAnd}{Exercise.}{%$!A \land !B \in \Gamma$ iff both $!A \in \Gamma$ and $!B \in \Gamma$:For the forward direction, suppose $!A \land !B \in \Gamma$. Thenby\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-land},prfND/{fol:ntd:ppr:prop:provability-land},prfAX/{fol:axd:ppr:prop:provability-land},prfTab/{fol:tab:ppr:prop:provability-land}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-land},prfND/{pl:ntd:ppr:prop:provability-land},prfAX/{pl:axd:ppr:prop:provability-land},prfTab/{pl:tab:ppr:prop:provability-land}}}, item~(1),$\Gamma \Proves !A$ and $\Gamma \Proves !B$. By\olref{prop:ccs-prov-in}, $!A \in \Gamma$ and $!B \in \Gamma$, asrequired.For the reverse direction, let $!A \in \Gamma$ and $!B \in\Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-land},prfND/{fol:ntd:ppr:prop:provability-land},prfAX/{fol:axd:ppr:prop:provability-land},prfTab/{fol:tab:ppr:prop:provability-land}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-land},prfND/{pl:ntd:ppr:prop:provability-land},prfAX/{pl:axd:ppr:prop:provability-land},prfTab/{pl:tab:ppr:prop:provability-land}}}, item~(2),$\Gamma \Proves !A \land !B$. By \olref{prop:ccs-prov-in}, $!A \land!B \in \Gamma$.}}\tagitem{defOr}{}{%\iftag{probOr}{Exercise.}{%First we show that if $!A \lor !B \in \Gamma$, then either $!A \in\Gamma$ or $!B \in \Gamma$. Suppose $!A \lor !B \in \Gamma$ but $!A\notin \Gamma$ and $!B \notin \Gamma$. Since $\Gamma$ is!!{complete}, $\lnot !A \in \Gamma$ and $\lnot !B \in \Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-lor},prfND/{fol:ntd:ppr:prop:provability-lor},prfAX/{fol:axd:ppr:prop:provability-lor},prfTab/{fol:tab:ppr:prop:provability-lor}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-lor},prfND/{pl:ntd:ppr:prop:provability-lor},prfAX/{pl:axd:ppr:prop:provability-lor},prfTab/{pl:tab:ppr:prop:provability-lor}}},item (1), $\Gamma$ is inconsistent, a contradiction. Hence, either $!A\in \Gamma$ or $!B \in \Gamma$.For the reverse direction, suppose that $!A \in \Gamma$ or $!B \in\Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-lor},prfND/{fol:ntd:ppr:prop:provability-lor},prfAX/{fol:axd:ppr:prop:provability-lor},prfTab/{fol:tab:ppr:prop:provability-lor}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-lor},prfND/{pl:ntd:ppr:prop:provability-lor},prfAX/{pl:axd:ppr:prop:provability-lor},prfTab/{pl:tab:ppr:prop:provability-lor}}}, item (2),$\Gamma \Proves !A \lor !B$. By \olref{prop:ccs-prov-in}, $!A \lor!B \in \Gamma$, as required.}}\tagitem{defIf}{}{%\iftag{probIf}{Exercise.}{%For the forward direction, suppose $!A \lif !B \in \Gamma$, and supposeto the contrary that $!A \in \Gamma$ and $!B \notin \Gamma$. On theseassumptions, $!A \lif !B \in \Gamma$ and $!A \in \Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-lif},prfND/{fol:ntd:ppr:prop:provability-lif},prfAX/{fol:axd:ppr:prop:provability-lif},prfTab/{fol:tab:ppr:prop:provability-lif}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-lif},prfND/{pl:ntd:ppr:prop:provability-lif},prfAX/{pl:axd:ppr:prop:provability-lif},prfTab/{pl:tab:ppr:prop:provability-lif}}}, item (1),$\Gamma \Proves !B$. But then by \olref{prop:ccs-prov-in}, $!B \in\Gamma$, contradicting the assumption that $!B \notin \Gamma$.For the reverse direction, first consider the case where $!A \notin\Gamma$. Since $\Gamma$ is !!{complete}, $\lnot !A \in \Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-lif},prfND/{fol:ntd:ppr:prop:provability-lif},prfAX/{fol:axd:ppr:prop:provability-lif},prfTab/{fol:tab:ppr:prop:provability-lif}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-lif},prfND/{pl:ntd:ppr:prop:provability-lif},prfAX/{pl:axd:ppr:prop:provability-lif},prfTab/{pl:tab:ppr:prop:provability-lif}}}, item (2),$\Gamma \Proves !A \lif !B$. Again by \olref{prop:ccs-prov-in}, we getthat $!A \lif !B \in \Gamma$, as required.Now consider the case where $!B \in \Gamma$. By\iftag{FOL}{%\tagrefs{prfSC/{fol:seq:ppr:prop:provability-lif},prfND/{fol:ntd:ppr:prop:provability-lif},prfTab/{fol:tab:ppr:prop:provability-lif},prfAX/{fol:axd:ppr:prop:provability-lif}}}{%\tagrefs{prfSC/{pl:seq:ppr:prop:provability-lif},prfND/{pl:ntd:ppr:prop:provability-lif},prfTab/{pl:tab:ppr:prop:provability-lif},prfAX/{pl:axd:ppr:prop:provability-lif}}},item (2) again, $\Gamma \Proves !A \lif !B$. By\olref{prop:ccs-prov-in}, $!A \lif !B \in \Gamma$.}}\end{enumerate}\end{proof}\tagprob{FOL}\begin{prob}Complete the proof of \olref[fol][com][ccs]{prop:ccs}.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Complete the proof of \olref[pl][com][ccs]{prop:ccs}.\end{prob}\tagendprob\end{document}
content/first-order-logic/completeness/henkin-expansions.tex
213 lines; SHA-256 a42f0551e062db3102c47f082be24cd4f8506504989a0008df4b87564e1f9335. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: henkin-expansion\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{fol}{com}{hen}\olsection{Henkin Expansion}\begin{explain}Part of the challenge in proving the completeness theorem is that themodel we construct from a complete consistent set~$\Gamma$ must makeall the quantified !!{formula}s in~$\Gamma$ true. In order toguarantee this, we use a trick due to Leon Henkin. In essence, thetrick consists in expanding the language by infinitely many !!{constant}sand adding, for each !!{formula} with one free !!{variable} $!A(x)$ aformula of the form\iftag{prvEx}{$\lexists[x][!A(x)] \lif !A(c)$}{$\lnot\lforall[x][!A(x)] \lif \lnot !A(c)$},where $c$ is one of the new !!{constant}s. When we construct the!!{structure} satisfying~$\Gamma$, this will guarantee that each\iftag{prvEx}{true existential sentence has a witness}{false universal sentence has a counterexample}among the new constants.\end{explain}\begin{prop}\ollabel{prop:lang-exp}If $\Gamma$ is consistent in $\Lang L$ and $\Lang L'$ is obtained from$\Lang L$ by adding !!a{denumerable} set of new !!{constant}s $\Obj d_0$,$\Obj d_1$, \dots, then $\Gamma$ is consistent in~$\Lang L'$.\end{prop}\begin{defn}[Saturated set]A set $\Gamma$ of !!{formula}s of a language $\Lang {L}$ is\emph{saturated} iff for each !!{formula}~$!A(x) \in \Frm[L]$ with onefree !!{variable}~$x$ there is !!a{constant}~$c \in \Lang{L}$ suchthat\iftag{prvEx}{$\lexists[x][!A(x)] \lif !A(c) \in \Gamma$}{$\lnot\lforall[x][!A(x)] \lif \lnot !A(c) \in \Gamma$}.\end{defn}The following definition will be used in the proof of the next theorem.\begin{defn}\ollabel{defn:henkin-exp}Let $\Lang L'$ be as in \olref{prop:lang-exp}. Fix an enumeration$!A_0(x_0)$, $!A_1(x_1)$, \dots of all !!{formula}s~$!A_i(x_i)$of~$\Lang L'$ in which one variable ($x_i$) occurs free. We definethe !!{sentence}s~$!D_n$ by induction on~$n$.Let $c_0$ be the first !!{constant} among the $\Obj d_i$ we addedto~$\Lang{L}$ which does not occur in~$!A_0(x_0)$. Assuming that$!D_0$, \dots,~$!D_{n-1}$ have already been defined, let $c_n$ be thefirst among the new !!{constant}s~$\Obj d_i$ that occurs neither in$!D_0$, \dots,~$!D_{n-1}$ nor in~$!A_n(x_n)$.Now let $!D_{n}$ be the !!{formula} \iftag{prvEx}{$\lexists[x_{n}][!A_{n}(x_{n})] \lif!A_{n}(c_{n})$}{$\lnot\lforall[x_{n}][!A_{n}(x_{n})] \lif \lnot!A_{n}(c_{n})$}.\end{defn}\begin{lem}\ollabel{lem:henkin}Every consistent set~$\Gamma$ can be extended to a saturatedconsistent set~$\Gamma'$.\end{lem}\begin{proof}Given a consistent set of sentences~$\Gamma$ in a language~$\Lang{L}$,expand the language by adding !!a{denumerable} set of new!!{constant}s to form~$\Lang{L'}$. By \olref{prop:lang-exp}, $\Gamma$is still consistent in the richer language. Further, let $!D_i$ be asin \olref{defn:henkin-exp}. Let\begin{align*}\Gamma_0 & = \Gamma \\\Gamma_{n+1} & = \Gamma_n \cup \{!D_n \}\end{align*}i.e., $\Gamma_{n+1} = \Gamma \cup \{ !D_0, \dots, !D_n \}$, and let$\Gamma' = \bigcup_{n} \Gamma_n$. $\Gamma'$ is clearly saturated.If $\Gamma'$ were inconsistent, then for some $n$, $\Gamma_n$ would beinconsistent (Exercise: explain why). So to show that $\Gamma'$ isconsistent it suffices to show, by induction on~$n$, that eachset~$\Gamma_n$ is consistent.The induction basis is simply the claim that $\Gamma_0 = \Gamma$ isconsistent, which is the hypothesis of the theorem. For the inductionstep, suppose that $\Gamma_{n}$ is consistent but $\Gamma_{n+1} =\Gamma_n \cup \{!D_n\}$ is inconsistent. Recall that $!D_n$~is\iftag{prvEx}{$\lexists[x_{n}][!A_{n}(x_n)] \lif !A_{n}(c_{n})$}{$\lnot\lforall[x_{n}][!A_{n}(x_n)] \lif \lnot !A_{n}(c_{n})$},where $!A_n(x_n)$ is !!a{formula} of $\Lang{L'}$ with only thevariable~$x_n$ free. By the way we've chosen the~$c_n$ (see\olref{defn:henkin-exp}), $c_n$ does not occur in~$!A_n(x_n)$ norin~$\Gamma_n$.If $\Gamma_n \cup \{!D_n\}$ is inconsistent, then $\Gamma_n\Proves \lnot !D_n$, and hence both of the following hold:\iftag{prvEx}{\[\Gamma_n \Proves \lexists[x_n][!A_n(x_n)]\qquad\Gamma_n \Proves \lnot !A_n(c_n)\]}{\[\Gamma_n \Proves \lnot\lforall[x_n][!A_n(x_n)]\qquad\Gamma_n \Proves !A_n(c_n)\]}Since $c_n$ does not occur in$\Gamma_n$ or in~$!A_n(x_n)$,\tagrefs{prfAX/{fol:axd:qpr:thm:strong-generalization},prfSC/{fol:seq:qpr:thm:strong-generalization},prfND/{fol:ntd:qpr:thm:strong-generalization},prfTab/{fol:tab:qpr:thm:strong-generalization}} applies.From \iftag{prvEx}{$\Gamma_n \Proves \lnot !A_n(c_n)$}{$\Gamma_n \Proves !A_n(c_n)$},we obtain\iftag{prvEx}{$\Gamma_n \Proves \lforall[x_n][\lnot !A_n(x_n)]$}{$\Gamma_n \Proves \lforall[x_n][!A_n(x_n)]$}.Thus we have that both\iftag{prvEx}{$\Gamma_n \Proves \lexists[x_n][!A_n(x_n)]$ and$\Gamma_n \Proves \lforall[x_n][\lnot !A_n(x_n)]$}{$\Gamma_n \Proves \lnot\lforall[x_n][!A_n(x_n)]$ and$\Gamma_n \Proves \lforall[x_n][!A_n(x_n)]$},so $\Gamma_n$ itself is inconsistent.\iftag{prvEx}{(Note that\iftag{prvAll}{$\lforall[x_n][\lnot !A_n(x_n)] \Proves\lnot\lexists[x_n][!A_n(x_n)]$}{$\lforall[x_n][\lnot !A_n]$ is defined as$\lnot\lexists[x_n][\lnot\lnot !A_n(x_n)]$ and$\lnot\lexists[x_n][\lnot\lnot !A_n(x_n)] \Proves\lnot\lexists[x_n][!A_n(x_n)]$}.)}{}Contradiction: $\Gamma_n$ was supposed to be consistent. Hence$\Gamma_n \cup \{ !D_n\}$ is consistent.\end{proof}\begin{explain}We'll now show that \emph{complete}, consistent sets which aresaturated have the property that \iftag{prvAll}{it contains auniversally quantified !!{sentence} iff it contains all itsinstances}{}\iftag{defAll,defEx}{}{ and }\iftag{prvAll}{it contains anexistentially quantified !!{sentence} iff it contains at least oneinstance}{}. We'll use this to show that the !!{structure} we'llgenerate from a complete, consistent, saturated set makes all itsquantified sentences true.\end{explain}\begin{prop}\ollabel{prop:saturated-instances}Suppose $\Gamma$ is complete, consistent, and saturated.\begin{tagenumerate}{prvEx,prvAll}\tagitem{prvEx}{$\lexists[x][!A(x)] \in \Gamma$ iff $!A(t) \in \Gamma$for at least one closed term~$t$.}{}\tagitem{prvAll}{$\lforall[x][!A(x)] \in \Gamma$ iff $!A(t) \in \Gamma$for all closed terms~$t$.}{}\end{tagenumerate}\end{prop}\begin{proof}\begin{tagenumerate}{prvEx,prvAll}\tagitem{prvEx}{%\iftag{probEx}{Exercise.}{First suppose that $\lexists[x][!A(x)]\in \Gamma$. Because $\Gamma$ is saturated,$(\lexists[x][!A(x)] \lif !A(c)) \in \Gamma$ for some!!{constant}~$c$. By\tagrefs{prfAX/{fol:axd:ppr:prop:provability-lif},prfSC/{fol:seq:ppr:prop:provability-lif},prfND/{fol:ntd:ppr:prop:provability-lif},prfTab/{fol:tab:ppr:prop:provability-lif}}, item~(1),and \olref[ccs]{prop:ccs}\olref[ccs]{prop:ccs-prov-in}, $!A(c)\in \Gamma$.For the other direction, saturation is not necessary: Suppose$!A(t) \in \Gamma$. Then $\Gamma \Proves \lexists[x][!A(x)]$ by\tagrefs{prfAX/{fol:axd:qpr:prop:provability-quantifiers},prfSC/{fol:seq:qpr:prop:provability-quantifiers},prfND/{fol:ntd:qpr:prop:provability-quantifiers},prfTab/{fol:tab:qpr:prop:provability-quantifiers}}, item~(1). By\olref[ccs]{prop:ccs}\olref[ccs]{prop:ccs-prov-in},$\lexists[x][!A(x)] \in \Gamma$.}}{}\tagitem{prvAll}{%\iftag{probAll}{Exercise.}{Suppose that $!A(t) \in \Gamma$ forall closed terms~$t$. By way of contradiction, assume$\lforall[x][!A(x)] \notin \Gamma$. Since $\Gamma$ is complete,$\lnot\lforall[x][!A(x)] \in \Gamma$. By saturation,\iftag{prvEx}{$(\lexists[x][\lnot !A(x)] \lif \lnot !A(c)) \in\Gamma$}{$(\lnot\lforall[x][!A(x)] \lif \lnot !A(c)) \in\Gamma$} for some !!{constant}~$c$. By assumption, since $c$is a closed term, $!A(c) \in \Gamma$. But this would make$\Gamma$ inconsistent. (Exercise: give the !!{derivation} that shows\[\lnot \lforall[x][!A(x)],\iftag{prvEx}{\lexists[x][\lnot !A(x)] \lif \lnot!A(c)}{\lnot\lforall[x][!A(x)] \lif \lnot!A(c)}, !A(c)\]is inconsistent.)For the reverse direction, we do not need saturation: Suppose$\lforall[x][!A(x)] \in \Gamma$. Then $\Gamma \Proves !A(t)$by\tagrefs{prfAX/{fol:axd:qpr:prop:provability-quantifiers},prfSC/{fol:seq:qpr:prop:provability-quantifiers},prfND/{fol:ntd:qpr:prop:provability-quantifiers},prfTab/{fol:tab:qpr:prop:provability-quantifiers}},item~(2). We get $!A(t) \in \Gamma$ by\olref[ccs]{prop:ccs}.}}{}\end{tagenumerate}\end{proof}\end{document}
content/first-order-logic/completeness/lindenbaums-lemma.tex
99 lines; SHA-256 1ee3d9dd14df1c3368c3e7a12d68e4d6627b9e92030a00820270b75ceb4bdf78. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: lindenbaums-lemma\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{lin}}{\olfileid{pl}{com}{lin}}\olsection{Lindenbaum's Lemma}\begin{explain}We now prove a lemma that shows that any consistent set of!!{sentence}s is contained in some set of sentences which is not justconsistent, but also !!{complete}. The proof works by adding one!!{sentence} at a time, guaranteeing at each step that the set remainsconsistent. We do this so that for every $!A$, either $!A$ or $\lnot!A$ gets added at some stage. The union of all stages in thatconstruction then contains either $!A$ or its negation~$\lnot !A$ andis thus complete. It is also consistent, since we make sure at eachstage not to introduce an inconsistency.\end{explain}\begin{lem}[Lindenbaum's Lemma]\ollabel{lem:lindenbaum} Every consistentset~$\Gamma$ in a language~$\Lang{L}$ can beextended to !!a{complete} and consistent set~$\Gamma^*$.\end{lem}\begin{proof}Let $\Gamma$ be consistent. Let $!A_0$, $!A_1$,\dots{} be an enumeration of all the !!{sentence}s of~$\Lang L$.Define $\Gamma_0 = \Gamma$, and\[\Gamma_{n+1} =\begin{cases}\Gamma_n \cup \{ !A_n \} & \textrm{if $\Gamma_n \cup \{!A_n\}$ isconsistent;} \\\Gamma_n \cup \{ \lnot !A_n \} & \textrm{otherwise.}\end{cases}\]Let $\Gamma^* = \bigcup_{n \geq 0} \Gamma_n$.Each $\Gamma_n$ is consistent: $\Gamma_0$ is consistent by definition.If $\Gamma_{n+1} = \Gamma_n \cup \{!A_n\}$, this is because the latteris consistent. If it isn't, $\Gamma_{n+1} = \Gamma_n \cup \{\lnot!A_n\}$. We have to verify that $\Gamma_n \cup \{\lnot !A_n\}$ isconsistent. Suppose it's not. Then \emph{both} $\Gamma_n \cup\{!A_n\}$ and $\Gamma_n \cup \{\lnot !A_n\}$ are inconsistent. Thismeans that $\Gamma_n$ would be inconsistent by\iftag{FOL}{%\tagrefs{prfAX/{fol:axd:prv:prop:provability-exhaustive},prfSC/{fol:seq:prv:prop:provability-exhaustive},prfND/{fol:ntd:prv:prop:provability-exhaustive},prfTab/{fol:tab:prv:prop:provability-exhaustive}}}{%\tagrefs{prfAX/{pl:axd:prv:prop:provability-exhaustive},prfSC/{pl:seq:prv:prop:provability-exhaustive},prfND/{pl:ntd:prv:prop:provability-exhaustive},prfTab/{pl:tab:prv:prop:provability-exhaustive}}},contrary to the induction hypothesis.For every~$n$ and every $i < n$, $\Gamma_i \subseteq \Gamma_n$. Thisfollows by a simple induction on~$n$. For $n=0$, there are no $i < 0$,so the claim holds automatically. For the inductive step, suppose itis true for~$n$. We show that if $i < n+1$ then $\Gamma_i \subseteq\Gamma_{n+1}$. We have $\Gamma_{n+1} = \Gamma_n \cup \{!A_n\}$ or $=\Gamma_n \cup \{\lnot !A_n\}$ by construction. So $\Gamma_n \subseteq\Gamma_{n+1}$. If $i < n+1$, then $\Gamma_i \subseteq \Gamma_n$ byinductive hypothesis (if $i < n$) or the trivial fact that $\Gamma_n\subseteq \Gamma_n$ (if $i = n$). We get that $\Gamma_i \subseteq\Gamma_{n+1}$ by transitivity of~$\subseteq$.From this it follows that $\Gamma^*$ is consistent. Here's why: Let$\Gamma' \subseteq \Gamma^*$ be finite. Each $!B \in \Gamma'$ is alsoin~$\Gamma_i$ for some~$i$. Let $n$ be the largest of these. Since$\Gamma_i \subseteq \Gamma_n$ if $i \le n$, every $!B \in \Gamma'$ isalso $\in \Gamma_n$, i.e., $\Gamma' \subseteq \Gamma_n$, and$\Gamma_n$~is consistent. So, every finite subset $\Gamma' \subseteq\Gamma^*$ is consistent. By \iftag{FOL}{%\tagrefs{prfAX/{fol:axd:ptn:prop:proves-compact},prfSC/{fol:seq:ptn:prop:proves-compact},prfND/{fol:ntd:ptn:prop:proves-compact},prfTab/{fol:tab:ptn:prop:proves-compact}}}{%\tagrefs{prfAX/{pl:axd:ptn:prop:proves-compact},prfSC/{pl:seq:ptn:prop:proves-compact},prfND/{pl:ntd:ptn:prop:proves-compact},prfTab/{pl:tab:ptn:prop:proves-compact}}}, $\Gamma^*$ isconsistent.Every !!{sentence} of $\Frm[L]$ appears on the list used todefine~$\Gamma^*$. If $!A_n \notin \Gamma^*$, then that is because$\Gamma_n \cup \{!A_n\}$ was inconsistent. But then $\lnot !A_n\in \Gamma^*$, so $\Gamma^*$ is !!{complete}.\end{proof}\end{document}
content/first-order-logic/completeness/construction-of-model.tex
279 lines; SHA-256 e8f3c25a2b378ac1996cc9cebb1192b2bdc2527df547e922008dad3822d29969. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: construction-of-model\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{mod}}{\olfileid{pl}{com}{mod}}\olsection{Construction of a Model}\begin{explain}\iftag{FOL}{Right now we are not concerned about $\eq$, i.e., we onlywant to show that a consistent set~$\Gamma$ of !!{sentence}s notcontaining~$\eq$ is satisfiable. We first extend~$\Gamma$ to aconsistent, !!{complete}, and saturated set~$\Gamma^*$. In thiscase, the definition of a model~$\Struct{M(\Gamma^*)}$ is simple: Wetake the set of closed terms of~$\Lang{L'}$ as the domain. We assignevery !!{constant} to itself, and make sure that more generally, forevery closed term~$t$, $\Value{t}{M(\Gamma^*)} = t$. The!!{predicate}s are assigned extensions in such a way that an atomic!!{sentence} is true in $\Struct{M(\Gamma^*)}$ iff it isin~$\Gamma^*$. This will obviously make all the atomic!!{sentence}s in~$\Gamma^*$ true in $\Struct{M(\Gamma^*)}$. The restare true provided the $\Gamma^*$ we start with is consistent,complete, and saturated.}{We are now ready to define !!a{valuation}that makes all $!A \in \Gamma$ true. To do this, we first applyLindenbaum's Lemma: we get a complete consistent $\Gamma^* \supseteq\Gamma$. We let the !!{propositional variable}s in~$\Gamma^*$determine~$\pAssign v(\Gamma^*)$.}\end{explain}\iftag{FOL}{%\begin{defn}[Term model]\ollabel{defn:termmodel}Let $\Gamma^*$ be !!a{complete} and consistent,saturated set of !!{sentence}s in a language~$\Lang L$. The \emph{termmodel}~$\Struct M(\Gamma^*)$ of $\Gamma^*$ is the !!{structure}defined as follows:\begin{enumerate}\item The !!{domain}~$\Domain{M(\Gamma^*)}$ is the set of all closedterms of~$\Lang L$.\item The interpretation of !!a{constant} $c$ is $c$ itself:$\Assign{c}{M(\Gamma^*)} = c$.\item The !!{function}~$f$ is assigned the function which, given asarguments the closed terms $t_1$, \dots, $t_n$, has as value theclosed term $f(t_1, \dots, t_n)$:\[\Assign{f}{M(\Gamma^*)}(t_1, \dots, t_n) = f(t_1,\dots, t_n)\]\item If $R$ is an $n$-place !!{predicate}, then\[\tuple{t_1, \dots,t_n} \in \Assign{R}{M(\Gamma^*)} \text{ iff } \Atom{R}{t_1, \dots,t_n} \in \Gamma^*.\]\end{enumerate}\end{defn}}{%\begin{defn}\ollabel{defn:termmodel}Suppose $\Gamma^*$ is a complete consistent set of !!{formula}s. Then we let\[\pAssign v(\Gamma^*)(p) = \begin{cases}\True & \text{if $p \in \Gamma^*$}\\\False & \text{if $p \notin \Gamma^*$}\end{cases}\]\end{defn}}\iftag{FOL}{%We will now check that we indeed have $\Value{t}{M(\Gamma^*)} = t$.\begin{lem}\ollabel{lem:val-in-termmodel} Let $\Struct M(\Gamma^*)$ be the term modelof \olref{defn:termmodel}, then $\Value{t}{M(\Gamma^*)} = t$.\end{lem}\begin{proof}The proof is by induction on $t$, where the base case, when $t$is !!a{constant}, follows directly from the definition of the termmodel. For the induction step assume $t_1, \ldots, t_n$ are closed termssuch that $\Value{t_i}{M(\Gamma^*)} = t_i$ and that $f$ is an $n$-ary!!{function}. Then\begin{align*}\Value{f(t_1,\ldots,t_n)}{M(\Gamma^*)} &= \Assign{f}{M(\Gamma^*)}(\Value{t_1}{M(\Gamma^*)},\ldots, \Value{t_n}{M(\Gamma^*)}) \\&= \Assign{f}{M(\Gamma^*)}(t_1, \dots, t_n) \\&= f(t_1,\dots, t_n),\end{align*}and so by induction this holds for every closed term~$t$.\end{proof}}\iftag{FOL}{%\begin{explain}\iftag{prvEx}{!!^a{structure}~$\Struct{M}$ may make an existentiallyquantified !!{sentence}~$\lexists[x][!A(x)]$ true without therebeing an instance~$!A(t)$ that it makes true.}{}\iftag{prvAll}{!!^a{structure}~$\Struct{M}$ may make allinstances~$!A(t)$ of a universally quantified!!{sentence}~$\lforall[x][!A(x)]$ true, withoutmaking~$\lforall[x][!A(x)]$ true.}{} This is because in generalnot every !!{element} of~$\Domain{M}$ is the value of a closed term($\Struct{M}$ may not be covered). This is the reason thesatisfaction relation is defined via variable assignments. However,for our term model~$\Struct{M(\Gamma^*)}$ this wouldn't benecessary---because it is covered. This is the content of the nextresult.\end{explain}\begin{prop}\ollabel{prop:quant-termmodel}Let $\Struct M(\Gamma^*)$ be the term model of \olref{defn:termmodel}.\begin{tagenumerate}{prvEx,prvAll}\tagitem{prvEx}{$\Sat{M(\Gamma^*)}{\lexists[x][!A(x)]}$ iff$\Sat{M(\Gamma^*)}{!A(t)}$ for at least one closed term~$t$.}{}\tagitem{prvAll}{$\Sat{M(\Gamma^*)}{\lforall[x][!A(x)]}$ iff$\Sat{M(\Gamma^*)}{!A(t)}$ for all closed terms~$t$.}{}\end{tagenumerate}\end{prop}\begin{proof}\begin{tagenumerate}{prvEx,prvAll}\tagitem{prvEx}{%\iftag{probEx}{Exercise.}{By \olref[syn][ass]{prop:sat-quant},$\Sat{M(\Gamma^*)}{\lexists[x][!A(x)]}$ iff for at least onevariable assignment~$s$, $\Sat{M(\Gamma^*)}{!A(x)}[s]$. As$\Domain{M(\Gamma^*)}$ consists of the closed terms of~$\Lang{L}$,this is the case iff there is at least one closed term~$t$ suchthat $s(x) = t$ and $\Sat{M(\Gamma^*)}{!A(x)}[s]$. By\olref[fol][syn][ext]{prop:ext-formulas},$\Sat{M(\Gamma^*)}{!A(x)}[s]$ iff $\Sat{M(\Gamma^*)}{!A(t)}[s]$,where $s(x) = t$. By \olref[fol][syn][ass]{prop:sentence-sat-true},$\Sat{M(\Gamma^*)}{!A(t)}[s]$ iff $\Sat{M(\Gamma^*)}{!A(t)}$,since $!A(t)$ is a sentence.}}{}\tagitem{prvAll}{%\iftag{probAll}{Exercise.}{By \olref[syn][ass]{prop:sat-quant},$\Sat{M(\Gamma^*)}{\lforall[x][!A(x)]}$ iff for every variableassignment $s$, $\Sat{M(\Gamma^*)}{!A(x)}[s]$. Recall that$\Domain{M(\Gamma^*)}$ consists of the closed terms of~$\Lang{L}$,so for every closed term~$t$, $s(x) = t$ is such a variableassignment, and for any variable assignment, $s(x)$ is some closedterm~$t$. By \olref[fol][syn][ext]{prop:ext-formulas},$\Sat{M(\Gamma^*)}{!A(x)}[s]$ iff $\Sat{M(\Gamma^*)}{!A(t)}[s]$,where $s(x) = t$. By \olref[fol][syn][ass]{prop:sentence-sat-true},$\Sat{M(\Gamma^*)}{!A(t)}[s]$ iff $\Sat{M(\Gamma^*)}{!A(t)}$,since $!A(t)$ is a sentence.}}{}\end{tagenumerate}\end{proof}}{}\tagprob[FOL]{probEx,probAll}\begin{prob}Complete the proof of \olref[fol][com][mod]{prop:quant-termmodel}.\end{prob}\tagendprob\begin{lem}[Truth Lemma]\ollabel{lem:truth} \iftag{FOL}{Suppose $!A$ does not contain~$\eq$. Then}{}$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!A}$ iff $!A \in \Gamma^*$.\end{lem}\begin{proof}We prove both directions simultaneously, and by induction on $!A$.\begin{enumerate}\tagitem{prvFalse}{\indcase{!A}{\lfalse}{$\iftag{FOL}{\Sat/{M(\Gamma^*)}{\lfalse}}{\pSat/{v(\Gamma^*)}{\lfalse}}$by definition of satisfaction. On the other hand, $\lfalse \notin\Gamma^*$ since $\Gamma^*$ is consistent.}}{}\tagitem{prvTrue}{\indcase{!A}{\ltrue}{$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\ltrue}$by definition of satisfaction. On the other hand, $\ltrue \in\Gamma^*$ since $\Gamma^*$ is consistent and !!{complete}, and$\Gamma^* \Proves \ltrue$.}}{}\tagitem{FOL}{\indcase{!A}{R(t_1, \dots, t_n)}{$\Sat{M(\Gamma^*)}{\Atom{R}{t_1, \dots, t_n}}$ iff $\tuple{t_1,\dots, t_n} \in \Assign{R}{M(\Gamma^*)}$ (by the definition ofsatisfaction) iff $R(t_1, \dots, t_n) \in \Gamma^*$ (by theconstruction of $\StructM(\Gamma^*)$).}}{\indcase{!A}{p}{$\pSat{v(\Gamma^*)}{p}$ iff$\pAssign v(\Gamma^*)(p) = \True$ (by the definition ofsatisfaction) iff $p \in \Gamma^*$ (by the construction of$\pAssign v(\Gamma^*)$).}}\tagitem{prvNot}{%\indcase{!A}{\lnot !B}{$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\indfrm}$ iff$\iftag{FOL}{\Sat/{M(\Gamma^*)}{!B}}{\pSat/{v(\Gamma^*)}{!B}}$ (bydefinition of satisfaction). By induction hypothesis,$\iftag{FOL}{\Sat/{M(\Gamma^*)}{!B}}{\pSat/{v(\Gamma^*)}{!B}}$ iff$!B \notin \Gamma^*$. Since $\Gamma^*$ is consistent and!!{complete}, $!B\notin \Gamma^*$ iff $\lnot !B \in \Gamma^*$.}}{}\tagitem{prvAnd}{%\iftag{probAnd}{%\indcase!{!A}{!B \land !C}{}}{%\indcase{!A}{!B \land!C}{$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\indfrm}$iff we have both$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!B}$ and$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!C}$ (bydefinition of satisfaction) iff both $!B \in \Gamma^*$ and $!C \in\Gamma^*$ (by the induction hypothesis). By\olref[ccs]{prop:ccs}\olref[ccs]{prop:ccs-and}, this is the caseiff $(!B \land !C) \in \Gamma^*$.}}}{}\tagitem{prvOr}{%\iftag{probOr}{%\indcase!{!A}{!B \lor !C}{}}{%\indcase{!A}{!B \lor !C}{$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\indfrm}$iff $\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!B}$ or$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!C}$ (bydefinition of satisfaction) iff $!B \in \Gamma^*$ or $!C \in\Gamma^*$ (by induction hypothesis). This is the case iff $(!B\lor !C) \in \Gamma^*$ (by\olref[ccs]{prop:ccs}\olref[ccs]{prop:ccs-or}).}}}{}\tagitem{prvIf}{%\iftag{probIf}{%\indcase!{!A}{!B \lif !C}{}}{%\indcase{!A}{!B \lif !C}{$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{\indfrm}$iff $\iftag{FOL}{\Sat/{M(\Gamma^*)}}{\pSat/{v(\Gamma^*)}}{!B}$ or $\iftag{FOL}{\Sat{M (\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!C}$ (bydefinition of satisfaction) iff $!B \notin \Gamma^*$ or $!C \in\Gamma^*$ (by induction hypothesis). This is the case iff $(!B\lif !C) \in \Gamma^*$ (by\olref[ccs]{prop:ccs}\olref[ccs]{prop:ccs-if}).}}}{}\iftag{FOL}{%\tagitem{prvAll}{%\iftag{probAll}{%\indcase!{!A}{\lforall[x][!B(x)]}{}}{%\indcase{!A}{\lforall[x][!B(x)]}{$\Sat{M(\Gamma^*)}{\indfrm}$ iff$\Sat{M(\Gamma^*)}{!B(t)}$ for all terms~$t$(\olref{prop:quant-termmodel}). By induction hypothesis, thisis the case iff $!B(t) \in \Gamma^*$ for all terms~$t$, by\olref[hen]{prop:saturated-instances}, this in turn is the caseiff $\lforall[x][!A(x)] \in \Gamma^*$.}}}{}\tagitem{prvEx}{%\iftag{probEx}{%\indcase!{!A}{\lexists[x][!B(x)]}{}}{%\indcase{!A}{\lexists[x][!B(x)]}{$\Sat{M(\Gamma^*)}{\indfrm}$ iff$\Sat{M(\Gamma^*)}{!B(t)}$ for at least one term~$t$(\olref{prop:quant-termmodel}). By induction hypothesis, thisis the case iff $!B(t) \in \Gamma^*$ for at least one term~$t$.By \olref[hen]{prop:saturated-instances}, this in turn is thecase iff $\lexists[x][!B(x)] \in \Gamma^*$.}}}{}}{}\end{enumerate}\end{proof}\tagprob[FOL]{probOr,probAnd,probIf,probEx,probAll}\begin{prob}Complete the proof of \olref[fol][com][mod]{lem:truth}.\end{prob}\tagendprob\tagprob[notFOL]{probOr,probAnd,probIf}\begin{prob}Complete the proof of \olref[pl][com][mod]{lem:truth}.\end{prob}\tagendprob\end{document}
content/first-order-logic/completeness/identity.tex
205 lines; SHA-256 2b497ead07aad76f2db101bd56768abd9bc71df7c819164edf0183656d148e7d. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: identity\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{fol}{com}{ide}\olsection{Identity}\begin{explain}The construction of the term model given in the preceding section isenough to establish completeness for first-order logic forsets~$\Gamma$ that do not contain~$\eq$. The term model satisfiesevery $!A \in \Gamma^*$ which does not contain~$\eq$ (and hence all$!A \in \Gamma$). It does not work, however, if $\eq$ is present.The reason is that $\Gamma^*$ then may contain!!a{sentence}~$\eq[t][t']$, but in the term model the value of anyterm is that term itself. Hence, if $t$ and $t'$ are different terms,their values in the term model---i.e., $t$ and $t'$,respectively---are different, and so $\eq[t][t']$ is false. We canfix this, however, using a construction known as ``factoring.''\end{explain}\begin{defn}Let $\Gamma^*$ be a consistent and !!{complete} set of sentencesin~$\Lang L$. We define the relation $\approx$ on the set of closedterms of~$\Lang L$ by\[t \approx t' \text{\quad iff \quad} \eq[t][t'] \in \Gamma^*\]\end{defn}\begin{prop}\ollabel{prop:approx-equiv}The relation $\approx$ has the following properties:\begin{enumerate}\item $\approx$ is reflexive.\item $\approx$ is symmetric.\item $\approx$ is transitive.\item If $t \approx t'$, $f$ is !!a{function}, and $t_1$, \dots,$t_{i-1}$, $t_{i+1}$, \dots, $t_n$ are closed terms, then\[\Atom{f}{t_1,\dots, t_{i-1}, t, t_{i+1}, \dots, t_n} \approx\Atom{f}{t_1,\dots, t_{i-1}, t', t_{i+1}, \dots, t_n}.\]\item If $t \approx t'$, $R$ is !!a{predicate}, and $t_1$, \dots,$t_{i-1}$, $t_{i+1}$, \dots, $t_n$ are closed terms, then\begin{multline*}\Atom{R}{t_1,\dots, t_{i-1}, t, t_{i+1}, \dots, t_n} \in \Gamma^* \text{ iff } \\\Atom{R}{t_1,\dots, t_{i-1}, t', t_{i+1}, \dots, t_n} \in \Gamma^*.\end{multline*}\end{enumerate}\end{prop}\begin{proof}Since $\Gamma^*$ is consistent and !!{complete}, $\eq[t][t'] \in\Gamma^*$ iff $\Gamma^* \Proves \eq[t][t']$. Thus it is enough toshow the following:\begin{enumerate}\item $\Gamma^* \Proves \eq[t][t]$ for all closed terms~$t$.\item If $\Gamma^* \Proves \eq[t][t']$ then $\Gamma^* \Proves \eq[t'][t]$.\item If $\Gamma^* \Proves \eq[t][t']$ and $\Gamma^* \Proves\eq[t'][t'']$, then $\Gamma^* \Proves \eq[t][t'']$.\item If $\Gamma^* \Proves \eq[t][t']$, then\[\Gamma^* \Proves\eq[\Atom{f}{t_1,\dots,t_{i-1},t,t_{i+1},,\dots,t_n}][\Atom{f}{t_1,\dots,t_{i-1},t',t_{i+1},\dots,t_n}]\]for every $n$-place !!{function}~$f$ and closed terms $t_1$, \dots,$t_{i-1}$, $t_{i+1}$, \dots,~$t_n$.\item If $\Gamma^* \Proves \eq[t][t']$ and$\Gamma^* \Proves\Atom{R}{t_1,\dots,t_{i-1},t,t_{i+1},\dots,t_n}$, then$\Gamma^* \Proves \Atom{R}{t_1,\dots,t_{i-1},t',t_{i+1},\dots,t_n}$for every $n$-place !!{predicate}~$R$ and closed terms $t_1$, \dots,$t_{i-1}$, $t_{i+1}$, \dots,~$t_n$.\end{enumerate}\end{proof}\begin{prob}Complete the proof of~\olref[fol][com][ide]{prop:approx-equiv}.\end{prob}\begin{defn}Suppose $\Gamma^*$ is a consistent and !!{complete} set in alanguage~$\Lang L$, $t$ is a closed term, and $\approx$ as in theprevious definition. Then:\[\equivrep{t}{\approx} = \Setabs{t'}{t'\in \Trm[L], t \approx t'}\]and $\equivclass{\Trm[L]}{\approx} = \Setabs{\equivrep{t}{\approx}}{t \in \Trm[L]}$.\end{defn}\begin{defn}\ollabel{defn:term-model-factor}Let $\Struct M = \Struct M(\Gamma^*)$ be the term modelfor~$\Gamma^*$ from \olref[mod]{defn:termmodel}. Then $\Struct{\equivclass{M}{\approx}}$ is the following!!{structure}:\begin{enumerate}\item $\Domain{\equivclass{M}{\approx}} = \equivclass{\Trm[L]}{\approx}$.\item $\Assign{c}{\equivclass{M}{\approx}} = \equivrep{c}{\approx}$\item $\Assign{f}{\equivclass{M}{\approx}}(\equivrep{t_1}{\approx}, \dots,\equivrep{t_n}{\approx}) = \equivrep{\Atom{f}{t_1,\dots, t_n}}{\approx}$\item $\tuple{\equivrep{t_1}{\approx}, \dots, \equivrep{t_n}{\approx}} \in\Assign{R}{\equivclass{M}{\approx}}$ iff$\Sat{M}{\Atom{R}{t_1,\dots, t_n}}$, i.e., iff $\Atom{R}{t_1,\dots,t_n} \in \Gamma^*$.\end{enumerate}\end{defn}\begin{explain}Note that we have defined $\Assign{f}{\equivclass{M}{\approx}}$ and$\Assign{R}{\equivclass{M}{\approx}}$ for elements of$\equivclass{\Trm[L]}{\approx}$ by referring to them as$\equivrep{t}{\approx}$, i.e., via \emph{representatives}~$t \in\equivrep{t}{\approx}$. We have to make sure that these definitionsdo not depend on the choice of these representatives, i.e., that forsome other choices~$t'$ which determine the same equivalence classes($\equivrep{t}{\approx} = \equivrep{t'}{\approx}$), the definitionsyield the same result. For instance, if $R$ is a one-place!!{predicate}, the last clause of the definition says that$\equivrep{t}{\approx} \in \Assign{R}{\equivclass{M}{\approx}}$ iff$\Sat{M}{\Atom{R}{t}}$. If for some other term~$t'$ with $t \approxt'$, $\Sat/{M}{\Atom{R}{t}}$, then the definition would require$\equivrep{t'}{\approx} \notin \Assign{R}{\equivclass{M}{\approx}}$.If $t \approx t'$, then $\equivrep{t}{\approx} =\equivrep{t'}{\approx}$, but we can't have both $\equivrep{t}{\approx}\in \Assign{R}{\equivclass{M}{\approx}}$ and $\equivrep{t}{\approx}\notin \Assign{R}{\equivclass{M}{\approx}}$. However,\olref{prop:approx-equiv} guarantees that this cannot happen.\end{explain}\begin{prop}$\Struct{\equivclass{M}{\approx}}$ is well defined, i.e., if $t_1$,\dots, $t_n$, $t_1'$, \dots, $t_n'$ are closed terms,and $t_i \approx t_i'$ then\begin{enumerate}\item $\equivrep{\Atom{f}{t_1,\dots, t_n}}{\approx} =\equivrep{\Atom{f}{t_1',\dots, t_n'}}{\approx}$, i.e.,\[\Atom{f}{t_1,\dots, t_n} \approx \Atom{f}{t_1',\dots, t_n'}\]and\item $\Sat{M}{\Atom{R}{t_1,\dots, t_n}}$ iff$\Sat{M}{\Atom{R}{t_1',\dots, t_n'}}$, i.e.,\[\Atom{R}{t_1,\dots, t_n} \in \Gamma^* \text{ iff }\Atom{R}{t_1',\dots, t_n'} \in \Gamma^*.\]\end{enumerate}\end{prop}\begin{proof}Follows from \olref{prop:approx-equiv} by induction on~$n$.\end{proof}As in the case of the term model, before proving the truth lemma we need thefollowing lemma.\begin{lem}\ollabel{lem:val-in-termmodel-factored} Let $\Struct M = \Struct M(\Gamma^*)$, then $\Value{t}{\equivclass{M}{\approx}} = \equivrep{t}{\approx}$.\end{lem}\begin{proof}The proof is similar to that of \olref[mod]{lem:val-in-termmodel}.\end{proof}\begin{prob}Complete the proof of~\olref[fol][com][ide]{lem:val-in-termmodel-factored}.\end{prob}\begin{lem}\ollabel{lem:truth}$\Sat{\equivclass{M}{\approx}}{!A}$ iff $!A \in \Gamma^*$ for allsentences~$!A$.\end{lem}\begin{proof}By induction on~$!A$, just as in the proof of \olref[mod]{lem:truth}.The only case that needs additional attention is when $!A \ident\eq[t][t']$.\begin{align*}\Sat{\equivclass{M}{\approx}}{\eq[t][t']} & \text{ iff } \equivrep{t}{\approx} = \equivrep{t'}{\approx}\text{ (by definition of $\Struct{\equivclass{M}{\approx}}$)}\\& \text{ iff } t \approx t' \text{ (by definition of $\equivrep{t}{\approx}$)}\\& \text{ iff } \eq[t][t'] \in \Gamma^* \text{ (by definition of $\approx$).}\end{align*}\end{proof}\begin{digress}Note that while $\Struct{M(\Gamma^*)}$ is always !!{enumerable} andinfinite, $\Struct{\equivclass{M}{\approx}}$ may be finite, since itmay turn out that there are only finitely many classes$\equivrep{t}{\approx}$. This is to be expected, since $\Gamma$ maycontain !!{sentence}s which require any !!{structure} in which theyare true to be finite. For instance, $\lforall[x][\lforall[y][x =y]]$ is a consistent !!{sentence}, but is satisfied only in!!{structure}s with !!a{domain} that contains exactly one!!{element}.\end{digress}\end{document}
content/first-order-logic/completeness/completeness-thm.tex
125 lines; SHA-256 5510644c6a3ff18e97d5e97a928d00cb0b091506e8c10bafa504c1b2c38b242b. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: completeness-theorem\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{cth}}{\olfileid{pl}{com}{cth}}\olsection{The Completeness Theorem}\begin{explain}Let's combine our results: we arrive at the completeness theorem.\end{explain}\begin{thm}[Completeness Theorem]\ollabel{thm:completeness}Let $\Gamma$ be a set of !!{sentence}s. If $\Gamma$ is consistent, itis satisfiable.\end{thm}\begin{proof}Suppose $\Gamma$ is consistent.\iftag{FOL}{ By\olref[hen]{lem:henkin}, there is a saturated consistent set$\Gamma' \supseteq \Gamma$.}{} By \olref[lin]{lem:lindenbaum}, thereis a $\Gamma^* \supseteq \iftag{FOL}{\Gamma'}{\Gamma}$ which isconsistent and !!{complete}.\iftag{FOL}{Since $\Gamma' \subseteq \Gamma^*$, for each!!{formula}~$!A(x)$, $\Gamma^*$ contains !!a{sentence} of the form\iftag{prvEx}{$\lexists[x][!A(x)] \lif !A(c)$}{$\lnot\lforall[x][!A(x)] \lif \lnot !A(c)$}and so $\Gamma^*$ is saturated. If $\Gamma$does not contain~$\eq$, then by}{By}\olref[mod]{lem:truth},$\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!A}$ iff $!A \in\Gamma^*$. From this it follows in particular that for all $!A \in\Gamma$, $\iftag{FOL}{\Sat{M(\Gamma^*)}}{\pSat{v(\Gamma^*)}}{!A}$, so$\Gamma$ is satisfiable.\iftag{FOL}{If $\Gamma$ does contain~$\eq$,then by \olref[ide]{lem:truth}, for all !!{sentence}s~$!A$,$\Sat{\equivclass{M}{\approx}}{!A}$ iff $!A \in \Gamma^*$. Inparticular, $\Sat{\equivclass{M}{\approx}}{!A}$ for all $!A \in\Gamma$, so $\Gamma$ is satisfiable.}{}\end{proof}\begin{cor}[Completeness Theorem, Second Version]\ollabel{cor:completeness}For all $\Gamma$ and !!{sentence}s~$!A$: if $\Gamma \Entails !A$ then$\Gamma \Proves !A$.\end{cor}\begin{proof}Note that the $\Gamma$'s in \olref{cor:completeness} and\olref{thm:completeness} are universally quantified. To make sure wedo not confuse ourselves, let us restate \olref{thm:completeness}using a different variable: for any set of !!{sentence}s~$\Delta$, if$\Delta$ is consistent, it is satisfiable. By contraposition, if$\Delta$ is not satisfiable, then $\Delta$ is inconsistent. We willuse this to prove the corollary.Suppose that $\Gamma \Entails !A$. Then $\Gamma \cup \{\lnot !A\}$ isunsatisfiable by \olref[syn][sem]{prop:entails-unsat}. Taking $\Gamma\cup \{\lnot !A\}$ as our $\Delta$, the previous version of\olref{thm:completeness} gives us that $\Gamma \cup \{\lnot !A\}$ isinconsistent. By\iftag{FOL}{%\tagrefs{prfAX/{fol:axd:prv:prop:prov-incons},prfSC/{fol:seq:prv:prop:prov-incons},prfND/{fol:ntd:prv:prop:prov-incons},prfTab/{fol:tab:prv:prop:prov-incons}}}{%\tagrefs{prfAX/{pl:axd:prv:prop:prov-incons},prfSC/{pl:seq:prv:prop:prov-incons},prfND/{pl:ntd:prv:prop:prov-incons},prfTab/{pl:tab:prv:prop:prov-incons}}},$\Gamma \Proves !A$.\end{proof}\tagprob{FOL}\begin{prob}Use \olref[fol][com][cth]{cor:completeness} to prove\olref[fol][com][cth]{thm:completeness}, thus showing that the twoformulations of the completeness theorem are equivalent.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Use \olref[pl][com][cth]{cor:completeness} to prove\olref[pl][com][cth]{thm:completeness}, thus showing that the twoformulations of the completeness theorem are equivalent.\end{prob}\tagendprob\tagprob{FOL}\begin{prob}In order for !!a{derivation} system to be complete, its rules must bestrong enough to prove every unsatisfiable set inconsistent. Which ofthe rules of !!{derivation} were necessary to prove completeness? Are anyof these rules not used anywhere in the proof? In order to answerthese questions, make a list or diagram that shows which of the rulesof !!{derivation} were used in which results that lead up to the proof of\olref[fol][com][cth]{thm:completeness}. Be sure to note any tacituses of rules in these proofs.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}In order for !!a{derivation} system to be complete, its rules must bestrong enough to prove every unsatisfiable set inconsistent. Which ofthe rules of !!{derivation} were necessary to prove completeness? Are anyof these rules not used anywhere in the proof? In order to answerthese questions, make a list or diagram that shows which of the rulesof !!{derivation} were used in which results that lead up to the proof of\olref[pl][com][cth]{thm:completeness}. Be sure to note any tacituses of rules in these proofs.\end{prob}\tagendprob\end{document}
content/first-order-logic/completeness/compactness.tex
199 lines; SHA-256 a872b7018576b26eb53179792e27b5b0af3338b5220712086e1be7d928b3d65c. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: compactness\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{com}}{\olfileid{pl}{com}{com}}\olsection{The Compactness Theorem}One important consequence of the completeness theorem is thecompactness theorem. The compactness theorem states that if each\emph{finite} subset of a set of !!{sentence}s is satisfiable, theentire set is satisfiable---even if the set itself is infinite. Thisis far from obvious. There is nothing that seems to rule out, at firstglance at least, the possibility of there being infinite sets of!!{sentence}s which are contradictory, but the contradiction onlyarises, so to speak, from the infinite number. The compactnesstheorem says that such a scenario can be ruled out: there are nounsatisfiable infinite sets of !!{sentence}s each finite subset ofwhich is satisfiable. Like the completeness theorem, it has a versionrelated to entailment: if an infinite set of !!{sentence}s entailssomething, already a finite subset does.\begin{defn}A set $\Gamma$ of !!{formula}s is \emph{finitely satisfiable} iff every finite $\Gamma_0 \subseteq \Gamma$ is satisfiable.\end{defn}\begin{thm}[Compactness Theorem]\ollabel{thm:compactness}The following hold for any sentences $\Gamma$ and $!A$:\begin{enumerate}\item $\Gamma \Entails !A$ iff there is a finite $\Gamma_0\subseteq \Gamma$ such that $\Gamma_0 \Entails !A$.\item $\Gamma$ is satisfiable iff it is finitelysatisfiable.\end{enumerate}\end{thm}\begin{proof}We prove (2). If $\Gamma$ is satisfiable, then there is\iftag{FOL}{!!a{structure}~$\Struct{M}$}{!!a{valuation}~$\pAssign{v}$}such that $\iftag{FOL}{\Sat{M}}{\pSat{v}}{!A}$ for all $!A \in\Gamma$. Of course, this $\iftag{FOL}{\Struct{M}}{\pAssign{v}}$ alsosatisfies every finite subset of~$\Gamma$, so $\Gamma$ is finitelysatisfiable.Now suppose that $\Gamma$ is finitely satisfiable. Then every finitesubset~$\Gamma_0 \subseteq \Gamma$ is satisfiable. By soundness(\iftag{FOL}{%\tagrefs{prfAX/{fol:axd:sou:cor:consistency-soundness},prfSC/{fol:seq:sou:cor:consistency-soundness},prfND/{fol:ntd:sou:cor:consistency-soundness},prfTab/{fol:tab:sou:cor:consistency-soundness}}}{%\tagrefs{prfAX/{pl:axd:sou:cor:consistency-soundness},prfSC/{pl:seq:sou:cor:consistency-soundness},prfND/{pl:ntd:sou:cor:consistency-soundness},prfTab/{pl:tab:sou:cor:consistency-soundness}}}),every finite subset is consistent. Then $\Gamma$ itself must beconsistent by\iftag{FOL}{%\tagrefs{prfAX/{fol:axd:ptn:prop:proves-compact},prfSC/{fol:seq:ptn:prop:proves-compact},prfND/{fol:ntd:ptn:prop:proves-compact},prfTab/{fol:tab:ptn:prop:proves-compact}}}{%\tagrefs{prfAX/{pl:axd:ptn:prop:proves-compact},prfSC/{pl:seq:ptn:prop:proves-compact},prfND/{pl:ntd:ptn:prop:proves-compact},prfTab/{pl:tab:ptn:prop:proves-compact}}}.By completeness (\olref[cth]{thm:completeness}), since $\Gamma$~isconsistent, it is satisfiable.\end{proof}\tagprob{FOL}\begin{prob}Prove (1) of \olref[fol][com][com]{thm:compactness}.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Prove (1) of \olref[pl][com][com]{thm:compactness}.\end{prob}\tagendprob\iftag{FOL}{%\begin{ex}In every model~$\Struct{M}$ of a theory~$\Gamma$, each term~$t$ ofcourse picks out !!a{element} of~$\Domain{M}$. Can we guarantee thatit is also true that every !!{element} of~$\Domain{M}$ is picked outby some term or other? In other words, are there theories~$\Gamma$ allmodels of which are covered? The compactness theorem shows that thisis not the case if $\Gamma$ has infinite models. Here's how to seethis: Let $\Struct{M}$ be an infinite model of~$\Gamma$, and let $c$be !!a{constant} not in the language of~$\Gamma$. Let $\Delta$ be theset of all sentences $\eq/[c][t]$ for $t$ a term in thelanguage~$\Lang{L}$ of~$\Gamma$, i.e.,\[\Delta = \Setabs{\eq/[c][t]}{t \in \Trm[L]}.\]A finite subset of $\Gamma \cup \Delta$ can be written as $\Gamma'\cup \Delta'$, with $\Gamma' \subseteq \Gamma$ and $\Delta' \subseteq\Delta$. Since $\Delta'$ is finite, it can contain only finitely manyterms. Let $a \in \Domain{M}$ be !!a{element} of $\Domain{M}$ notpicked out by any of them, and let $\Struct{M'}$ be the !!{structure}that is just like $\Struct{M}$, but also $\Assign{c}{M'} = a$. Since$a \neq \Value{t}{M}$ for all~$t$ occurring in~$\Delta'$,$\Sat{M'}{\Delta'}$. Since $\Sat{M}{\Gamma}$, $\Gamma' \subseteq\Gamma$, and $c$ does not occur in~$\Gamma$, also$\Sat{M'}{\Gamma'}$. Together, $\Sat{M'}{\Gamma' \cup \Delta'}$ forevery finite subset $\Gamma' \cup \Delta'$ of $\Gamma \cup \Delta$. Soevery finite subset of $\Gamma \cup \Delta$ is satisfiable. Bycompactness, $\Gamma \cup \Delta$ itself is satisfiable. So there aremodels~$\Sat{M}{\Gamma \cup \Delta}$. Every such $\Struct{M}$ is amodel of~$\Gamma$, but is not covered, since $\Value{c}{M} \neq\Value{t}{M}$ for all terms~$t$ of~$\Lang{L}$.\end{ex}\begin{ex}Consider !!a{language} $\Lang{L}$ containing the !!{predicate}~$<$,!!{constant}s $\Obj{0}$, $\Obj{1}$, and !!{function}s $+$, $\times$, and$-$. Let $\Gamma$ be the set of all !!{sentence}s in this!!{language} true in the !!{structure}~$\Struct{Q}$ with domain~$\Rat$ and the obviousinterpretations. $\Gamma$~is the set of all !!{sentence}sof~$\Lang{L}$ true about the rational numbers. Of course, in~$\Rat$(and even in~$\Real$), there are no numbers~$r$ which are greater than~$0$but less than $1/k$ for all $k \in \PosInt$. Such a number, if itexisted, would be an \emph{infinitesimal:} non-zero, but infinitelysmall. The compactness theorem can be used to show that there aremodels of~$\Gamma$ in which infinitesimals exist. We do not have!!a{function} for division in our language (division by zero isundefined, and !!{function}s have to be interpreted by total functions).However, we can still express that $r < 1/k$, since this is the case iff$r \cdot k < 1$. Now let $c$ be a new !!{constant} and let $\Delta$ be\[\{\Obj{0} < c\}\cup \Setabs{ c \times \num k < \Obj{1} }{k \in \PosInt}\](where $\num{k} = (\Obj{1} + (\Obj{1} + \dots + (\Obj{1} +\Obj{1})\dots))$ with $k$~$\Obj{1}$'s). For any finitesubset~$\Delta_0$ of~$\Delta$ there is a~$K$ such that for all the!!{sentence}s $c \times \num{k} < \Obj{1}$ in~$\Delta_0$ have $k < K$.If we expand $\Struct{Q}$ to~$\Struct{Q'}$ with $\Assign{c}{Q'} = 1/K$we have that $\Sat{Q'}{\Gamma_0 \cup \Delta_0}$ for any finite$\Gamma_0 \subseteq \Gamma$, and so $\Gamma \cup \Delta$ is finitelysatisfiable (Exercise: prove this in detail). By compactness, $\Gamma\cup \Delta$ is satisfiable. Any model~$\Struct{S}$ of $\Gamma \cup\Delta$ contains an infinitesimal, namely~$\Assign{c}{S}$.\end{ex}}{}\tagprob{FOL}\begin{prob}In the standard model of arithmetic~$\Struct{N}$, there is no!!{element}~$k \in \Domain{N}$ which satisfies every formula~$\num{n}< x$ (where $\num{n}$ is $\Obj{0}^{\prime\dots\prime}$ with $n$$\prime$'s). Use the compactness theorem to show that the set of!!{sentence}s in the language of arithmetic which are true in the standardmodel of arithmetic $\Struct{N}$ are also true in!!a{structure}~$\Struct{N'}$ that contains !!a{element} which\emph{does} satisfy every formula $\num{n} < x$.\end{prob}\tagendprob\iftag{FOL}{\begin{ex}We know that first-order logic with !!{identity} can express that thesize of the !!{domain} must have some minimal size: Thesentence~$!A_{\ge n}$ (which says ``there are at least $n$ distinctobjects'') is true only in structures where $\Domain{M}$ has atleast~$n$ objects. So if we take\[\Delta = \Setabs{!A_{\ge n}}{n \ge 1}\]then any model of $\Delta$ must be infinite. Thus, we can guaranteethat a theory only has infinite models by adding~$\Delta$ to it: themodels of $\Gamma \cup \Delta$ are all and only the infinite modelsof~$\Gamma$.So first-order logic can express infinitude. The compactness theoremshows that it cannot express finitude, however. For suppose some setof sentences $\Lambda$ were satisfied in all and only finite!!{structure}s. Then $\Delta \cup \Lambda$ is finitelysatisfiable. Why? Suppose $\Delta' \cup \Lambda' \subseteq \Delta \cup\Lambda$ is finite with $\Delta' \subseteq \Delta$ and $\Lambda'\subseteq \Lambda$. Let $n$ be the largest number such that $!A_{\ge n}\in \Delta'$. $\Lambda$, being satisfied in all finite structures, hasa model~$\Struct{M}$ with finitely many but $\ge n$ !!{element}s. Butthen $\Sat{M}{\Delta' \cup \Lambda'}$. By compactness, $\Delta \cup\Lambda$ has an infinite model, contradicting the assumption that$\Lambda$ is satisfied only in finite !!{structure}s.\end{ex}}{}\end{document}
content/first-order-logic/completeness/compactness-direct.tex
161 lines; SHA-256 e6398fcc96ac7a2e787c5128d1b2dbf8f515dbd0e780004831abcfd0c3f327d8. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: compactness-direct\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\iftag{FOL}{\olfileid{fol}{com}{cpd}}{\olfileid{pl}{com}{cpd}}\olsection{A Direct Proof of the Compactness Theorem}We can prove the Compactness Theorem directly, without appealing tothe Completeness Theorem, using the same ideas as in the proof of thecompleteness theorem. In the proof of the Completeness Theorem westarted with a consistent set~$\Gamma$ of !!{sentence}s, expanded itto a consistent\iftag{FOL}{, saturated,}{} and !!{complete}set~$\Gamma^*$ of !!{sentence}s, and then showed that in the\iftag{FOL}{termmodel~$\Struct{M(\Gamma^*)}$}{!!{valuation}~$\pAssign{v(\Gamma^*)}$}constructed from $\Gamma^*$, all !!{sentence}s of~$\Gamma$ are true,so $\Gamma$ is satisfiable.We can use the same method to show that a finitely satisfiable set ofsentences is satisfiable. We just have to prove the correspondingversions of the results leading to the truth lemma where we replace``consistent'' with ``finitely satisfiable.''\begin{prop}\ollabel{prop:fsat-ccs}Suppose $\Gamma$ is !!{complete} and finitely satisfiable. Then:\begin{enumerate}\tagitem{prvAnd}{$(!A \land !B) \in \Gamma$iff both $!A \in \Gamma$ and $!B \in \Gamma$.}{}\tagitem{prvOr}{$(!A \lor !B) \in \Gamma$ iffeither $!A \in \Gamma$ or $!B \in \Gamma$.}{}\tagitem{prvIf}{$(!A \lif !B) \in \Gamma$ iffeither $!A \notin \Gamma$ or $!B \in \Gamma$.}{}\end{enumerate}\end{prop}\tagprob{FOL}\begin{prob}Prove \olref[fol][com][cpd]{prop:fsat-ccs}. Avoid the use of $\Proves$.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Prove \olref[pl][com][cpd]{prop:fsat-ccs}. Avoid the use of $\Proves$.\end{prob}\tagendprob\iftag{FOL}{%\begin{lem}\ollabel{lem:fsat-henkin} Every finitely satisfiable set~$\Gamma$ canbe extended to a saturated finitely satisfiable set~$\Gamma'$.\end{lem}}{}\tagprob{FOL}\begin{prob}Prove \olref[fol][com][cpd]{lem:fsat-henkin}. (Hint: The crucial stepis to show that if $\Gamma_n$ is finitely satisfiable, so is $\Gamma_n\cup \{!D_n\}$, without any appeal to !!{derivation}s or consistency.)\end{prob}\tagendprob\iftag{FOL}{\begin{prop}\ollabel{prop:fsat-instances}Suppose $\Gamma$ is complete, finitely satisfiable, and saturated.\begin{tagenumerate}{prvEx,prvAll}\tagitem{prvEx}{$\lexists[x][!A(x)] \in \Gamma$ iff $!A(t) \in \Gamma$for at least one closed term~$t$.}{}\tagitem{prvAll}{$\lforall[x][!A(x)] \in \Gamma$ iff $!A(t) \in \Gamma$for all closed terms~$t$.}{}\end{tagenumerate}\end{prop}}{}\tagprob{FOL}\begin{prob}Prove \olref[fol][com][cpd]{prop:fsat-instances}.\end{prob}\tagendprob\begin{lem}\ollabel{lem:fsat-lindenbaum} Every finitely satisfiable set~$\Gamma$can be extended to !!a{complete} and finitely satisfiableset~$\Gamma^*$.\end{lem}\tagprob{FOL}\begin{prob}Prove \olref[fol][com][cpd]{lem:fsat-lindenbaum}. (Hint: the crucialstep is to show that if $\Gamma_n$ is finitely satisfiable, theneither $\Gamma_n \cup \{!A_n\}$ or $\Gamma_n \cup \{\lnot !A_n\}$ isfinitely satisfiable.)\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Prove \olref[pl][com][cpd]{lem:fsat-lindenbaum}. (Hint: the crucialstep is to show that if $\Gamma_n$ is finitely satisfiable, theneither $\Gamma_n \cup \{!A_n\}$ or $\Gamma_n \cup \{\lnot !A_n\}$ isfinitely satisfiable.)\end{prob}\tagendprob\begin{thm}[Compactness]\ollabel{thm:compactness-direct} $\Gamma$ is satisfiable if and onlyif it is finitely satisfiable.\end{thm}\begin{proof}If $\Gamma$ is satisfiable, then there is\iftag{FOL}{!!a{structure}~$\Struct{M}$}{!!a{valuation}~$\pAssign{v}$}such that $\iftag{FOL}{\Sat{M}}{\pSat{v}}{!A}$ for all $!A \in \Gamma$.Of course, this \iftag{FOL}{$\Struct{M}$}{$\pAssign{v}$} alsosatisfies every finite subset of~$\Gamma$, so $\Gamma$ is finitelysatisfiable.Now suppose that $\Gamma$ is finitely satisfiable.\iftag{FOL}{ By\olref{lem:fsat-henkin}, there is a finitely satisfiable, saturatedset $\Gamma' \supseteq \Gamma$.}{} By \olref{lem:fsat-lindenbaum},$\iftag{FOL}{\Gamma'}{\Gamma}$ can be extended to !!a{complete} andfinitely satisfiable set~$\Gamma^*$\iftag{FOL}{, and $\Gamma^*$ isstill saturated}{}. Construct the \iftag{FOL}{termmodel~$\Struct{M(\Gamma^*)}$}{!!{valuation}~$\pAssign{v(\Gamma^*)}$}as in \olref[mod]{defn:termmodel}.\iftag{FOL}{ Note that\olref[mod]{prop:quant-termmodel} did not rely on the fact that$\Gamma^*$ is consistent (or !!{complete} or saturated, for thatmatter), but just on the fact that $\Struct{M(\Gamma^*)}$ is covered.}{}The proof of the Truth Lemma (\olref[mod]{lem:truth}) goes through ifwe replace references to \olref[ccs]{prop:ccs}\iftag{FOL}{ and\olref[hen]{prop:saturated-instances} by references to\olref{prop:fsat-ccs} and \olref{prop:fsat-instances}}.\end{proof}\tagprob{FOL}\begin{prob}Write out the complete proof of the Truth Lemma(\olref[fol][com][mod]{lem:truth}) in the version required for theproof of \olref[fol][com][cpd]{thm:compactness-direct}.\end{prob}\tagendprob\tagprob{notFOL}\begin{prob}Write out the complete proof of the Truth Lemma(\olref[pl][com][mod]{lem:truth}) in the version required for theproof of \olref[pl][com][cpd]{thm:compactness-direct}.\end{prob}\tagendprob\end{document}
content/first-order-logic/completeness/downward-ls.tex
63 lines; SHA-256 6f442281e52dd720acdd540039544c4e8b998906154aa5c4cf7f5da0d9500c48. Open preserved source.
% Part: first-order-logic% Chapter: completeness% Section: downward-ls\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{fol}{com}{dls}\olsection{The L\"owenheim--Skolem Theorem}The L\"owenheim--Skolem Theorem says that if a theory has an infinitemodel, then it also has a model that is at most !!{denumerable}. Animmediate consequence of this fact is that first-order logic cannotexpress that the size of !!a{structure} is !!{nonenumerable}: any!!{sentence} or set of !!{sentence}s satisfied in all!!{nonenumerable} !!{structure}s is also satisfied in some!!{enumerable} structure.\begin{thm}\ollabel{thm:downward-ls} If $\Gamma$ is consistent then it has!!a{enumerable} model, i.e., it is satisfiable in !!a{structure}whose domain is either finite or !!{denumerable}.\end{thm}\begin{proof}If $\Gamma$ is consistent, the !!{structure}~$\Struct M$ delivered bythe proof of the completeness theorem has a domain $\Domain{M}$ thatis no larger than the set of the terms of the language~$\Lang L$. So$\Struct M$ is at most !!{denumerable}.\end{proof}\begin{thm}\ollabel{noidentity-ls} If $\Gamma$ is a consistent set of !!{sentence}sin the language of first-order logic without identity, then it has!!a{denumerable} model, i.e., it is satisfiable in !!a{structure}whose domain is infinite and !!{enumerable}.\end{thm}\begin{proof}If $\Gamma$ is consistent and contains no sentences in which identityappears, then the !!{structure}~$\Struct M$ delivered by the proof ofthe completeness theorem has a domain $\Domain{M}$ identical to the setof terms of the language~$\Lang L'$. So $\Struct{M}$ is!!{denumerable}, since $\Trm[L']$ is.\end{proof}\begin{ex}[Skolem's Paradox]Zermelo--Fraenkel set theory~$\Log{ZFC}$ is a very powerful frameworkin which practically all mathematical statements can be expressed,including facts about the sizes of sets. So for instance, $\Log{ZFC}$can prove that the set~$\Real$ of real numbers is !!{nonenumerable},it can prove Cantor's Theorem that the power set of any set is largerthan the set itself, etc. If $\Log{ZFC}$ is consistent, its modelsare all infinite, and moreover, they all contain !!{element}s aboutwhich the theory says that they are !!{nonenumerable}, such as theelement that makes true the theorem of~$\Log{ZFC}$ that the power setof the natural numbers exists. By the L\"owenheim--Skolem Theorem,$\Log{ZFC}$ also has !!{enumerable} models---models that contain``!!{nonenumerable}'' sets but which themselves are !!{enumerable}.\end{ex}\end{document}