Source and provenance

All 11 authority files and all 725 lines are shown exactly and copied byte-for-byte. Ten files belong to the accepted TR-015 semantic chapter; the first-order part wrapper is an explicitly accounted TR000 bridge. Reader corrections are disclosures only; the source text below is not altered.

content/first-order-logic/first-order-logic.tex

59 lines; SHA-256 3fee444ae39c4094bd1bb1963010c0bf6350b5702c79d9e8bc62c430592f527e. Open the byte-exact preserved source file.

  1. % Part: first-order logic
  2. \documentclass[../../include/open-logic-part]{subfiles}
  3. \begin{document}
  4. \olpart{fol}{First-order Logic}
  5. \begin{editorial}
  6. This part covers the metatheory of first-order logic through
  7. completeness. Currently it does not rely on a separate treatment of
  8. propositional logic; everything is proved. The source files will
  9. exclude the material on quantifiers (and replace ``!!{structure}''
  10. with ``!!{valuation}'', $\Struct{M}$ with $\pAssign{v}$, etc.) if
  11. the ``FOL'' tag is false. In fact, most of the material in the part
  12. on propositional logic is simply the first-order material with the
  13. ``FOL'' tag turned off.
  14. If the part on propositional logic is included, this results in a
  15. lot of repetition. It is planned, however, to make it possible to
  16. let this part take into account the material on propositional logic
  17. (and exclude the material already covered, as well as shorten proofs
  18. with references to the respective places in the propositional
  19. part).
  20. \end{editorial}
  21. \olimport[introduction]{introduction}
  22. \olimport[syntax-and-semantics]{syntax}
  23. \olimport[syntax-and-semantics]{semantics}
  24. \olimport[models-theories]{models-theories}
  25. \olimport[proof-systems]{proof-systems}
  26. \iftag{prfSC}{%
  27. \olimport[sequent-calculus]{sequent-calculus}
  28. }{}
  29. \iftag{prfND}{%
  30. \olimport[natural-deduction]{natural-deduction}
  31. }{}
  32. \iftag{prfTab}{%
  33. \olimport[tableaux]{tableaux}
  34. }{}
  35. \iftag{prfAX}{%
  36. \olimport[axiomatic-deduction]{axiomatic-deduction}
  37. }{}
  38. \olimport[completeness]{completeness}
  39. \olimport[beyond]{beyond}
  40. \OLEndPartHook
  41. \end{document}

content/first-order-logic/introduction/introduction.tex

30 lines; SHA-256 3da46f27a563094a0904eacf23838c601ce3a22b0db9d82cfe33d95d8a507b95. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. \documentclass[../../../include/open-logic-chapter]{subfiles}
  4. \begin{document}
  5. \olchapter{fol}{int}{Introduction to First-Order Logic}
  6. \olimport{first-order-logic}
  7. \olimport{syntax}
  8. \olimport{formulas}
  9. \olimport{satisfaction}
  10. \olimport{sentences}
  11. \olimport{semantic-notions}
  12. \olimport{substitution}
  13. \olimport{models-theories}
  14. \olimport{soundness-completeness}
  15. \OLEndChapterHook
  16. \end{document}

content/first-order-logic/introduction/first-order-logic.tex

88 lines; SHA-256 32887943e2083de8ae7402ced896b1e5c85beee1c52df199a5dce311cdc91627. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: first-order-logic
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{fol}
  7. \olsection{First-Order Logic}
  8. You are probably familiar with first-order logic from your first
  9. introduction to formal logic.\footnote{In fact, we more or less assume
  10. you are!{} If you're not, you could review a more elementary textbook,
  11. such as \emph{forall x} \citep{Magnus2021}.} You may know it as
  12. ``quantificational logic'' or ``predicate logic.'' First-order
  13. logic, first of all, is a formal language. That means, it has a
  14. certain vocabulary, and its expressions are strings from this
  15. vocabulary. But not every string is permitted. There are different
  16. kinds of permitted expressions: terms, !!{formula}s, and
  17. !!{sentence}s. We are mainly interested in !!{sentence}s of
  18. first-order logic: they provide us with a formal analogue of sentences
  19. of English, and about them we can ask the questions a logician
  20. typically is interested in. For instance:
  21. \begin{itemize}
  22. \item Does $!B$ follow from~$!A$ logically?
  23. \item Is $!A$ logically true, logically false, or
  24. contingent?
  25. \item Are $!A$ and $!B$ equivalent?
  26. \end{itemize}
  27. These questions are primarily questions about the ``meaning'' of
  28. !!{sentence}s of first-order logic. For instance, a philosopher would
  29. analyze the question of whether $!B$ follows logically from~$!A$ as
  30. asking: is there a case where $!A$ is true but~$!B$ is false ($!B$
  31. doesn't follow from~$!A$), or does every case that makes $!A$ true
  32. also make~$!B$ true ($!B$ does follow from~$!A$)? But we haven't been
  33. told yet what a ``case'' is---that is the job of \emph{semantics}. The
  34. semantics of first-order logic provides a mathematically precise model
  35. of the philosopher's intuitive idea of ``case,'' and also---and this
  36. is important---of what it is for !!a{sentence}~$!A$ to be \emph{true
  37. in} a case. We call the mathematically precise model that we will
  38. develop !!a{structure}. The relation which makes ``true in'' precise,
  39. is called the relation of \emph{satisfaction}. So what we will define
  40. is ``$!A$ is satisfied in~$\Struct{M}$'' (in symbols: $\Sat{M}{!A}$)
  41. for !!{sentence}s~$!A$ and !!{structure}s~$\Struct{M}$. Once this is
  42. done, we can also give precise definitions of the other semantical
  43. terms such as ``follows from'' or ``is logically true.'' These
  44. definitions will make it possible to settle, again with mathematical
  45. precision, whether, e.g., $\lforall[x][(!A(x) \lif !B(x)),
  46. \lexists[x][!A(x)] \Entails \lexists[x][!B(x)]]$. The answer will, of
  47. course, be ``yes.'' If you've already been trained to symbolize
  48. sentences of English in first-order logic, you will recognize this as,
  49. e.g., the symbolizations of, say, ``All ants are insects, there are
  50. ants, therefore there are insects.'' That is obviously a valid
  51. argument, and so our mathematical model of ``follows from'' for our
  52. formal language should give the same answer.
  53. Another topic you probably remember from your first introduction to
  54. formal logic is that there are \emph{!!{derivation}s}. If you have
  55. taken a first formal logic course, your instructor will have made you
  56. practice finding such !!{derivation}s, perhaps even !!a{derivation}
  57. that shows that the above entailment holds. There are many different
  58. ways to give !!{derivation}s: you may have done something called
  59. ``natural deduction'' or ``truth trees,'' but there are many others.
  60. The purpose of !!{derivation} systems is to provide tools using which the
  61. logicians' questions above can be answered: e.g., a natural deduction
  62. !!{derivation} in which $\lforall[x][(!A(x) \lif !B(x))$ and
  63. $\lexists[x][!A(x)]$ are premises and $\lexists[x][!B(x)]]$ is the
  64. conclusion (last line) \emph{verifies} that $\lexists[x][!B(x)]$
  65. logically follows from $\lforall[x][(!A(x) \lif !B(x))]$ and
  66. $\lexists[x][!A(x)]$.
  67. But why is that? On the face of it, !!{derivation} systems have nothing to do
  68. with semantics: giving a formal !!{derivation} merely involves arranging symbols
  69. in certain rule-governed ways; they don't mention ``cases'' or ``true
  70. in'' at all. The connection between !!{derivation} systems and semantics has
  71. to be established by a meta-logical investigation. What's needed is a
  72. mathematical proof, e.g., that a formal !!{derivation} of $\lexists[x][!B(x)]$
  73. from premises $\lforall[x][(!A(x) \lif !B(x))]$ and
  74. $\lexists[x][!A(x)]$ is possible, if, and only if, $\lforall[x][(!A(x)
  75. \lif !B(x))$ and $\lexists[x][!A(x)]$ together
  76. entail~$\lexists[x][!B(x)]]$. Before this can be done, however, a
  77. lot of painstaking work has to be carried out to get the definitions
  78. of syntax and semantics correct.
  79. \end{document}

content/first-order-logic/introduction/syntax.tex

54 lines; SHA-256 91d8aaea25b2d821af6aa8016f994b2e0abbf5cd2debdef7354409fa8ce767d8. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: syntax
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{syn}
  7. \olsection{Syntax}
  8. We first must make precise what strings of symbols count as
  9. !!{sentence}s of first-order logic. We'll do this later; for now
  10. we'll just proceed by example. The basic building blocks---the
  11. vocabulary---of first-order logic divides into two parts. The first
  12. part is the symbols we use to say specific things or to pick out
  13. specific things. We pick out things using !!{constant}s, and we say
  14. stuff about the things we pick out using !!{predicate}s. E.g, we
  15. might use $\Obj a$ as !!a{constant} to pick out a single thing, and
  16. then say something about it using the !!{sentence}~$\Atom{\Obj P}{\Obj
  17. a}$. If you have meanings for ``$\Obj a$'' and ``$\Obj P$'' in mind,
  18. you can read $\Atom{\Obj P}{\Obj a}$ as a sentence of English (and you
  19. probably have done so when you first learned formal logic). Once you
  20. have such simple !!{sentence}s of first-order logic, you can build
  21. more complex ones using the second part of the vocabulary: the logical
  22. symbols (connectives and quantifiers). So, for instance, we can form
  23. expressions like $(\Atom{\Obj P}{\Obj a} \land \Atom{\Obj Q}{\Obj b})$
  24. or~$\lexists[\Obj x][\Atom{\Obj P}{\Obj x}]$.
  25. In order to provide the precise definitions of semantics and the rules
  26. of our !!{derivation} systems required for rigorous meta-logical study, we
  27. first of all have to give a precise definition of what counts as
  28. !!a{sentence} of first-order logic. The basic idea is easy enough to
  29. understand: there are some simple !!{sentence}s we can form from just
  30. !!{predicate}s and !!{constant}s, such as~$\Atom{\Obj P}{\Obj a}$. And
  31. then from these we form more complex ones using the connectives and
  32. quantifiers. But what exactly are the rules by which we are allowed to
  33. form more complex !!{sentence}s? These must be specified, otherwise
  34. we have not defined ``!!{sentence} of first-order logic'' precisely
  35. enough. There are a few issues. The first one is to get the right
  36. strings to count as !!{sentence}s. The second one is to do this in
  37. such a way that we can give mathematical proofs about \emph{all}
  38. !!{sentence}s. Finally, we'll have to also give precise definitions of
  39. some rudimentary operations with !!{sentence}s, such as ``replace
  40. every $\Obj x$ in~$!A$ by~$\Obj b$.'' The trouble is that the
  41. quantifiers and !!{variable}s we have in first-order logic make it not
  42. entirely obvious how this should be done. E.g., should $\lexists[\Obj
  43. x][\Atom{\Obj P}{\Obj a}]$ count as !!a{sentence}? What about
  44. $\lexists[\Obj x][\lexists[\Obj x][\Atom{\Obj P}{\Obj x}]]$? What
  45. should the result of ``replace $\Obj x$ by~$\Obj b$ in $(\Atom{\Obj
  46. P}{\Obj x} \land \lexists[\Obj x][\Atom{\Obj P}{\Obj x}])$'' be?
  47. \end{document}

content/first-order-logic/introduction/formulas.tex

89 lines; SHA-256 43b36e58c2cf5bd1c22018eb0a758d0ed31ab304dc1b3d5532358f6e9703a7c1. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: formulas
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{fml}
  7. \section{\usetoken{P}{formula}}
  8. Here is the approach we will use to rigorously specify !!{sentence}s
  9. of first-order logic and to deal with the issues arising from the use
  10. of !!{variable}s. We first define a \emph{different} set of
  11. expressions: !!{formula}s. Once we've done that, we can consider the
  12. role !!{variable}s play in them---and on the basis of some other
  13. ideas, namely those of ``free'' and ``bound'' !!{variable}s, we can
  14. define what !!a{sentence} is (namely, !!a{formula} without free
  15. !!{variable}s). We do this not just because it makes the definition of
  16. ``!!{sentence}'' more manageable, but also because it will be crucial
  17. to the way we define the semantic notion of satisfaction.
  18. Let's define ``!!{formula}'' for a simple first-order language, one
  19. containing only a single !!{predicate}~$\Obj P$ and a single
  20. !!{constant}~$\Obj a$, and only the logical symbols $\lnot$, $\land$,
  21. and~$\lexists$. Our full definitions will be much more general:
  22. we'll allow infinitely many !!{predicate}s and !!{constant}s. In fact,
  23. we will also consider !!{function}s which can be combined with
  24. !!{constant}s and !!{variable}s to form ``terms.'' For now, $\Obj a$
  25. and the variables will be our only terms. We do need infinitely many
  26. !!{variable}s. We'll officially use the symbols $\Obj v_0$, $\Obj
  27. v_1$, \dots, as variables.
  28. \begin{defn}
  29. The set of \emph{!!{formula}s}~$\Frm$ is defined as follows:
  30. \begin{enumerate}
  31. \item\ollabel{fmls-atom} $\Atom{\Obj P}{\Obj a}$ and $\Atom{\Obj
  32. P}{\Obj v_i}$ are !!{formula}s ($i \in \Nat$).
  33. \tagitem{prvNot}{\ollabel{fmls-not}If $!A$ is !!a{formula}, then $\lnot !A$ is
  34. !!{formula}.}{}
  35. \tagitem{prvAnd}{If $!A$ and $!B$ are !!{formula}s, then $(!A \land
  36. !B)$ is !!a{formula}.}{}
  37. \tagitem{prvEx}{\ollabel{fmls-ex}If $!A$ is !!a{formula} and $x$ is !!a{variable},
  38. then $\lexists[x][!A]$ is !!a{formula}.}{}
  39. \tagitem{limitClause}{\ollabel{fmls-limit}Nothing else is !!a{formula}.}{}
  40. \end{enumerate}
  41. \end{defn}
  42. \olref{fmls-atom} tells us that $\Atom{\Obj P}{\Obj a}$ and
  43. $\Atom{\Obj P}{\Obj v_i}$ are !!{formula}s, for any $i \in
  44. \Nat$. These are the so-called \emph{atomic} !!{formula}s. They give
  45. us something to start from. The other clauses give us ways of forming
  46. new !!{formula}s from ones we have already formed. So for instance, by
  47. \olref{fmls-not}, we get that $\lnot \Atom{\Obj P}{\Obj v_2}$ is
  48. !!a{formula}, since $\Atom{\Obj P}{\Obj v_2}$ is already !!a{formula}
  49. by \olref{fmls-atom}. Then, by \olref{fmls-ex}, we get that
  50. $\lexists[\Obj v_2][\lnot \Atom{\Obj P}{\Obj v_2}]$ is another
  51. !!{formula}, and so on. \olref{fmls-limit} tells us that \emph{only}
  52. strings we can form in this way count as !!{formula}s. In particular,
  53. $\lexists[\Obj v_0][\Atom{\Obj P}{\Obj a}]$ and $\lexists[\Obj
  54. v_0][\lexists[\Obj v_0][\Atom{\Obj P}{\Obj a}]]$ \emph{do} count as
  55. !!{formula}s, and $(\lnot \Atom{\Obj P}{\Obj a})$ does not, because of
  56. the extraneous outer parentheses.
  57. This way of defining !!{formula}s is called an \emph{inductive
  58. definition}, and it allows us to prove things about !!{formula}s using
  59. a version of proof by induction called \emph{structural induction}.
  60. These are discussed in a general way in \olref[mth][ind][idf]{sec} and
  61. \olref[mth][ind][sti]{sec}, which you should review before delving
  62. into the proofs later on. Basically, the idea is that if you want to
  63. give a proof that something is true for all !!{formula}s, you show
  64. first that it is true for the atomic !!{formula}s, and then that
  65. \emph{if} it's true for any !!{formula}~$!A$ (and~$!B$), it's
  66. \emph{also} true for $\lnot !A$, $(!A \land !B)$, and
  67. $\lexists[x][!A]$. For instance, this proves that it's true for
  68. $\lexists[\Obj v_2][\lnot \Atom{\Obj P}{\Obj v_2}]$: from the first
  69. part you know that it's true for the atomic !!{formula}~$\Atom{\Obj
  70. P}{\Obj v_2}$. Then you get that it's true for $\lnot \Atom{\Obj
  71. P}{\Obj v_2}$ by the second part, and then again that it's true for
  72. $\lexists[\Obj v_2][\lnot \Atom{\Obj P}{\Obj v_2}]$ itself. Since all
  73. !!{formula}s are inductively generated from atomic !!{formula}s, this
  74. works for any of them.
  75. \end{document}

content/first-order-logic/introduction/satisfaction.tex

114 lines; SHA-256 7131c06390c685ff0af79611754cf0b98a22dd8a77256a332c84bf39e2f5cc0a. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: satisfaction
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{sat}
  7. \olsection{Satisfaction}
  8. We can already skip ahead to the semantics of first-order logic once
  9. we know what !!{formula}s are: here, the basic definition is that of
  10. !!a{structure}. For our simple language, !!a{structure}~$\Struct M$ has
  11. just three components: a non-empty set $\Domain{M}$ called the
  12. \emph{!!{domain}}, what $\Obj a$ picks out in~$\Struct M$, and what
  13. $\Obj P$ is true of in~$\Struct M$. The object picked out by~$\Obj a$
  14. is denoted~$\Assign{\Obj a}{M}$ and the set of things $\Obj P$ is true
  15. of by~$\Assign{\Obj P}{M}$. !!^a{structure}~$\Struct{M}$ consists of
  16. just these three things: $\Domain{M}$, $\Assign{\Obj a}{M} \in
  17. \Domain{M}$ and $\Assign{\Obj P}{M} \subseteq \Domain{M}$. The general
  18. case will be more complicated, since there will be many !!{predicate}s
  19. and !!{constant}s, the !!{constant}s can have more than one place, and
  20. there will also be !!{function}s.
  21. This is enough to give a definition of satisfaction for !!{formula}s
  22. that don't contain !!{variable}s. The idea is to give an inductive
  23. definition that mirrors the way we have defined !!{formula}s. We
  24. specify when an atomic formula is satisfied in~$\Struct{M}$, and then
  25. when, e.g., $\lnot !A$ is satisfied in~$\Struct{M}$ on the basis of
  26. whether or not $!A$ is satisfied in~$\Struct{M}$. E.g., we could
  27. define:
  28. \begin{enumerate}
  29. \item $\Atom{\Obj P}{\Obj a}$ is satisfied in~$\Struct{M}$ iff
  30. $\Assign{\Obj a}{M} \in \Assign{\Obj P}{M}$.
  31. \item $\lnot !A$ is satisfied in~$\Struct{M}$ iff $!A$ is not
  32. satisfied in~$\Struct{M}$.
  33. \item $(!A \land !B)$ is satisfied in~$\Struct{M}$ iff $!A$ is
  34. satisfied in~$\Struct{M}$, and $!B$ is satisfied in~$\Struct{M}$ as
  35. well.
  36. \end{enumerate}
  37. Let's say that $\Domain{M} = \{0, 1, 2\}$, $\Assign{\Obj a}{M} = 1$,
  38. and $\Assign{\Obj P}{M} = \{1, 2\}$. This definition would tell us
  39. that $\Atom{\Obj P}{\Obj a}$ is satisfied in~$\Struct{M}$ (since
  40. $\Assign{\Obj a}{M} = 1 \in \{1,2\} = \Assign{\Obj P}{M}$). It tells
  41. us further that $\lnot \Atom{\Obj P}{\Obj a}$ is not satisfied
  42. in~$\Struct{M}$, and that in turn $\lnot\lnot \Atom{\Obj P}{\Obj
  43. a}$ is and $(\lnot \Atom{\Obj P}{\Obj a} \land \Atom{\Obj P}{\Obj a})$
  44. is not satisfied, and so on.
  45. The trouble comes when we want to give a definition for the
  46. quantifiers: we'd like to say something like, ``$\lexists[\Obj
  47. v_0][\Atom{\Obj P}{\Obj v_0}]$ is satisfied iff $\Atom{\Obj P}{\Obj
  48. v_0}$ is satisfied.'' But the !!{structure}~$\Struct{M}$ doesn't tell
  49. us what to do about !!{variable}s. What we actually want to say is
  50. that $\Atom{\Obj P}{\Obj v_0}$ is satisfied \emph{for some value
  51. of~$\Obj v_0$}. To make this precise we need a way to assign
  52. !!{element}s of~$\Domain{M}$ not just to $\Obj a$ but also to~$\Obj
  53. v_0$. To this end, we introduce !!{variable} \emph{assignments}.
  54. !!^a{variable} assignment is simply a function~$s$ that maps
  55. !!{variable}s to !!{element}s of~$\Domain{M}$ (in our example, to one
  56. of $1$, $2$, or~$3$). Since we don't know beforehand which
  57. !!{variable}s might appear in !!a{formula} we can't limit which
  58. !!{variable}s $s$ assigns values to. The simple solution is to
  59. require that $s$ assigns values to \emph{all} !!{variable}s~$\Obj
  60. v_0$, $\Obj v_1$, \dots\@ We'll just use only the ones we need.
  61. Instead of defining satisfaction of !!{formula}s just relative to
  62. !!a{structure}, we'll define it relative to
  63. !!a{structure}~$\Struct{M}$ \emph{and} !!a{variable} assignment~$s$,
  64. and write $\Sat{M}{!A}[s]$ for short. Our definition will now include
  65. an additional clause to deal with atomic !!{formula}s containing
  66. !!{variable}s:
  67. \begin{enumerate}
  68. \item $\Sat{M}{\Atom{\Obj P}{\Obj a}}[s]$ iff
  69. $\Assign{\Obj a}{M} \in \Assign{\Obj P}{M}$.
  70. \item $\Sat{M}{\Atom{\Obj P}{\Obj v_i}}[s]$ iff
  71. $s(\Obj v_i) \in \Assign{\Obj P}{M}$.
  72. \item $\Sat{M}{\lnot !A}[s]$ iff not $\Sat{M}{!A}[s]$.
  73. \item $\Sat{M}{(!A \land !B)}[s]$ iff $\Sat{M}{!A}[s]$ and $\Sat{M}{!B}[s]$.
  74. \end{enumerate}
  75. Ok, this solves one problem: we can now say when $\Struct{M}$
  76. satisfies $\Atom{\Obj P}{\Obj v_0}$ for the value~$s(\Obj v_0)$. To
  77. get the definition right for $\lexists[\Obj v_0][\Atom{\Obj P}{\Obj
  78. v_0}]$ we have to do one more thing: We want to have that
  79. $\Sat{M}{\lexists[\Obj v_0][\Atom{\Obj P}{\Obj v_0}]}[s]$ iff
  80. $\Sat{M}{\Atom{\Obj P}{\Obj v_0}}[s']$ for \emph{some} way $s'$ of
  81. assigning a value to~$\Obj v_0$. But the value assigned to~$\Obj v_0$
  82. does not necessarily have to be the value that $s(\Obj v_0)$ picks
  83. out. We'll introduce a notation for that: if $m \in \Domain{M}$, then
  84. we let $\Subst{s}{m}{\Obj v_0}$ be the assignment that is just
  85. like~$s$ (for all !!{variable}s other than~$\Obj v_0$), except to
  86. $\Obj v_0$ it assigns~$m$. Now our definition can be:
  87. \begin{enumerate}\setcounter{enumi}{4}
  88. \item $\Sat{M}{\lexists[\Obj v_i][!A]}[s]$ iff
  89. $\Sat{M}{!A}[\Subst{s}{m}{\Obj v_i}]$ for some~$m \in \Domain{M}$.
  90. \end{enumerate}
  91. Does it work out? Let's say we let $s(\Obj v_i) = 0$ for all~$i \in
  92. \Nat$. $\Sat{M}{\lexists[\Obj v_0][\Atom{\Obj P}{\Obj v_0}]}[s]$ iff
  93. there is an $m \in \Domain{M}$ so that $\Sat{M}{\Atom{\Obj P}{\Obj
  94. v_0}}[\Subst{s}{m}{\Obj v_0}]$. And there is: we can choose $m = 1$ or
  95. $m = 2$. Note that this is true even if the value~$s(\Obj v_0)$
  96. assigned to~$\Obj v_0$ by $s$ itself---in this case, $0$---doesn't do
  97. the job. We have $\Sat{M}{\Atom{\Obj P}{\Obj v_0}}[\Subst{s}{1}{\Obj
  98. v_0}]$ but not $\Sat{M}{\Atom{\Obj P}{\Obj v_0}}[s]$.
  99. If this looks confusing and cumbersome: it is. But the added
  100. complexity is required to give a precise, inductive definition of
  101. satisfaction for all !!{formula}s, and we need something like it to
  102. precisely define the semantic notions. There are other ways of doing
  103. it, but they are all equally (in)elegant.
  104. \end{document}

content/first-order-logic/introduction/sentences.tex

58 lines; SHA-256 e02b1d562648ce99867d653622b5c8bcb4cd4eeb9e02d335fa59715e193b3cc9. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: sentences
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{snt}
  7. \olsection{\usetoken{P}{sentence}}
  8. Ok, now we have a (sketch of a) definition of satisfaction (``true
  9. in'') for !!{structure}s and !!{formula}s. But it needs this
  10. additional bit---!!a{variable} assignment---and what we wanted is a
  11. definition of !!{sentence}s. How do we get rid of assignments, and
  12. what are !!{sentence}s?
  13. You probably remember a discussion in your first introduction to
  14. formal logic about the relation between !!{variable}s and quantifiers.
  15. A quantifier is always followed by !!a{variable}, and then in the part
  16. of the !!{sentence} to which that quantifier applies (its ``scope''),
  17. we understand that the !!{variable} is ``bound'' by that quantifier.
  18. In !!{formula}s it was not required that every !!{variable} has a
  19. matching quantifier, and !!{variable}s without matching quantifiers
  20. are ``free'' or ``unbound.'' We will take !!{sentence}s to be all
  21. those !!{formula}s that have no free !!{variable}s.
  22. Again, the intuitive idea of when an occurrence of !!a{variable} in
  23. !!a{formula}~$!A$ is bound, which quantifier binds it, and when it is
  24. free, is not difficult to get. You may have learned a method for
  25. testing this, perhaps involving counting parentheses. We have to
  26. insist on a precise definition---and because we have defined
  27. !!{formula}s by induction, we can give a definition of the free and
  28. bound occurrences of !!a{variable}~$x$ in !!a{formula}~$!A$ also by
  29. induction. E.g., it might look like this for our simplified language:
  30. \begin{enumerate}
  31. \item If $!A$ is atomic, all occurrences of $x$ in it are free (that
  32. is, the occurrence of $x$ in~$\Atom{\Obj P}{x}$ is free).
  33. \item If $!A$ is of the form $\lnot !B$, then an occurrence of~$x$
  34. in~$\lnot !B$ is free iff the corresponding occurrence of~$x$ is
  35. free in~$!B$ (that is, the free occurrences of variables in~$
  36. !B$ are exactly the corresponding occurrences in~$\lnot !B$).
  37. \item If $!A$ is of the form $(!B \land !C)$, then an occurrence of~$x$
  38. in~$(!B \land !C)$ is free iff the corresponding occurrence of~$x$ is
  39. free in~$!B$ or in~$!C$.
  40. \item If $!A$ is of the form $\lexists[x][!B]$, then no occurrence
  41. of $x$ in~$!A$ is free; if it is of the form $\lexists[y][!B]$ where
  42. $y$ is a different !!{variable} than~$x$, then an occurrence of~$x$
  43. in $\lexists[y][!B]$ is free iff the corresponding occurrence of~$x$
  44. is free in~$!B$.
  45. \end{enumerate}
  46. Once we have a precise definition of free and bound occurrences of
  47. variables, we can simply say: !!a{sentence} is any !!{formula} without
  48. free occurrences of !!{variable}s.
  49. \end{document}

content/first-order-logic/introduction/semantic-notions.tex

48 lines; SHA-256 5b59ab9c84aad202080a9a834229b1310ba7fb18cbc6891024c072723b9fbadd. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: semantic-notions
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{sem}
  7. \olsection{Semantic Notions}
  8. We mentioned above that when we consider whether $\Sat{M}{!A}[s]$
  9. holds, we (for convenience) let $s$ assign values to all !!{variable}s,
  10. but only the values it assigns to !!{variable}s in~$!A$ are used. In
  11. fact, it's only the values of \emph{free} variables in~$!A$ that
  12. matter. Of course, because we're careful, we are going to prove this
  13. fact. Since !!{sentence}s have no free variables, $s$~doesn't matter
  14. at all when it comes to whether or not they are satisfied in
  15. !!a{structure}. So, when $!A$ is !!a{sentence} we can define
  16. $\Sat{M}{!A}$ to mean ``$\Sat{M}{!A}[s]$ for all~$s$,'' which as it
  17. happens is true iff $\Sat{M}{!A}[s]$ for at least one~$s$. We need to
  18. introduce !!{variable} assignments to get a working definition of
  19. satisfaction for !!{formula}s, but for !!{sentence}s, satisfaction is
  20. independent of the !!{variable} assignments.
  21. Once we have a definition of ``$\Sat{M}{!A}$,'' we know what ``case''
  22. and ``true in'' mean as far as !!{sentence}s of first-order logic are
  23. concerned. On the basis of the definition of $\Sat{M}{!A}$ for
  24. !!{sentence}s we can then define the basic semantic notions of
  25. validity, entailment, and satisfiability. A sentence is valid,
  26. $\Entails !A$, if every !!{structure} satisfies it. It is entailed by
  27. a set of !!{sentence}s, $\Gamma \Entails !A$, if every !!{structure}
  28. that satisfies all the !!{sentence}s in~$\Gamma$ also satisfies~$!A$.
  29. And a set of !!{sentence}s is satisfiable if some !!{structure}
  30. satisfies all !!{sentence}s in it at the same time.
  31. Because !!{formula}s are inductively defined, and satisfaction is in
  32. turn defined by induction on the structure of !!{formula}s, we can use
  33. induction to prove properties of our semantics and to relate the
  34. semantic notions defined. We'll collect and prove some of these
  35. properties, partly because they are individually interesting, but
  36. mainly because many of them will come in handy when we go on to
  37. investigate the relation between semantics and !!{derivation} systems. In order
  38. to do so, we'll also have to define (precisely, i.e., by induction)
  39. some syntactic notions and operations we haven't mentioned yet.
  40. \end{document}

content/first-order-logic/introduction/substitution.tex

47 lines; SHA-256 d1e27e94b43fda8329176530bfa9528c859d444123257a7408d5a979151b8941. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: substitution
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{sub}
  7. \olsection{Substitution}
  8. We'll discuss an example to illustrate how things hang together, and
  9. how the development of syntax and semantics lays the foundation for
  10. our more advanced investigations later. Our !!{derivation} systems should let
  11. us !!{derive} $\Atom{\Obj P}{\Obj a}$ from $\lforall[\Obj
  12. v_0][\Atom{\Obj P}]{\Obj v_0}$. Maybe we even want to state this as a
  13. rule of inference. However, to do so, we must be able to state it in
  14. the most general terms: not just for $\Obj P$, $\Obj a$, and $\Obj
  15. v_0$, but for any !!{formula}~$!A$, and term~$t$, and
  16. !!{variable}~$x$. (Recall that !!{constant}s are terms, but we'll
  17. consider also more complicated terms built from !!{constant}s and
  18. !!{function}s.) So we want to be able to say something like,
  19. ``whenever you have !!{derive}d $\lforall[x][!A(x)]$ you are justified
  20. in inferring~$!A(t)$---the result of removing $\lforall[x]$ and
  21. replacing~$x$ by~$t$.'' But what exactly does ``replacing $x$ by~$t$''
  22. mean? What is the relation between $!A(x)$ and~$!A(t)$? Does this
  23. always work?
  24. To make this precise, we define the operation of \emph{substitution}.
  25. Substitution is actually tricky, because we can't just replace
  26. all~$x$'s in~$!A$ by~$t$, and not every~$t$ can be substituted for
  27. any~$x$. We'll deal with this, again, using inductive definitions. But
  28. once this is done, specifying an inference rule as ``infer $!A(t)$
  29. from $\lforall[x][!A(x)]$'' becomes a precise definition. Moreover,
  30. we'll be able to show that this is a good inference rule in the sense
  31. that $\lforall[x][!A(x)]$ entails~$!A(t)$. But to prove this, we have
  32. to again prove something that may at first glance prompt you to ask
  33. ``why are we doing this?'' That $\lforall[x][!A(x)]$ entails~$!A(t)$
  34. relies on the fact that whether or not $\Sat{M}{!A(t)}$ holds depends
  35. only on the value of the term~$t$, i.e., if we let $m$ be whatever
  36. !!{element} of~$\Domain{M}$ is picked out by~$t$, then
  37. $\Sat{M}{!A(t)}[s]$ iff $\Sat{M}{!A(x)}[\Subst{s}{m}{x}]$. This holds
  38. even when $t$ contains !!{variable}s, but we'll have to be careful
  39. with how exactly we state the result.
  40. \end{document}

content/first-order-logic/introduction/models-theories.tex

70 lines; SHA-256 9207639415c1946c70ead4464cefaec9ed2972f35121e88272980b6c9a076ca8. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: models-theories
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{mod}
  7. \olsection{Models and Theories}
  8. Once we've defined the syntax and semantics of first-order logic, we
  9. can get to work investigating the properties of !!{structure}s and the
  10. semantic notions. We can also define !!{derivation} systems, and
  11. investigate those. For a set of !!{sentence}s, we can ask: what
  12. !!{structure}s make all the !!{sentence}s in that set true? Given a
  13. set of !!{sentence}s~$\Gamma$, !!a{structure}~$\Struct{M}$ that
  14. satisfies them is called a \emph{model of~$\Gamma$}. We might start
  15. from~$\Gamma$ and try to find its models---what do they look like? How
  16. big or small do they have to be? But we might also start with a single
  17. !!{structure} or collection of !!{structure}s and ask: what
  18. !!{sentence}s are true in them? Are there !!{sentence}s that
  19. \emph{characterize} these !!{structure}s in the sense that they, and
  20. only they, are true in them? These kinds of questions are the domain
  21. of \emph{model theory}. They also underlie the \emph{axiomatic
  22. method}: describing a collection of !!{structure}s by a set of
  23. !!{sentence}s, the axioms of a theory. This is made possible by the
  24. observation that exactly those !!{sentence}s entailed in first-order
  25. logic by the axioms are true in all models of the axioms.
  26. As a very simple example, consider preorders. A preorder is a
  27. relation~$R$ on some set~$A$ which is both reflexive and transitive.
  28. A set~$A$ with a two-place relation $R \subseteq A \times A$ on it is
  29. exactly what we would need to give !!a{structure} for a first-order
  30. language with a single two-place relation symbol~$\Obj P$: we would
  31. set $\Domain{M} = A$ and $\Assign{\Obj P}{M} = R$. Since $R$~is a
  32. preorder, it is reflexive and transitive, and we can find a
  33. set~$\Gamma$ of !!{sentence}s of first-order logic that say this:
  34. \begin{align*}
  35. & \lforall[\Obj v_0][\Atom{\Obj P}{\Obj v_0,\Obj v_0}]\\
  36. & \lforall[\Obj v_0][\lforall[\Obj v_1][\lforall[\Obj v_2][((\Atom{\Obj P}{\Obj v_0,\Obj v_1} \land \Atom{\Obj P}{\Obj v_1,\Obj v_2}) \lif \Atom{\Obj P}{\Obj v_0,\Obj v_2})]]]
  37. \end{align*}
  38. These !!{sentence}s are just the symbolizations of ``for any~$x$,
  39. $Rxx$'' ($R$ is reflexive) and ``whenever $Rxy$ and $Ryz$ then also
  40. $Rxz$'' ($R$ is transitive). We see that !!a{structure}~$\Struct{M}$
  41. is a model of these two !!{sentence}s~$\Gamma$ iff $R$ (i.e.,
  42. $\Assign{\Obj P}{M}$), is a preorder on~$A$ (i.e., $\Domain{M}$). In
  43. other words, the models of $\Gamma$ are exactly the preorders. Any
  44. property of all preorders that can be expressed in the first-order
  45. language with just~$\Obj P$ as !!{predicate} (like reflexivity and
  46. transitivity above), is entailed by the two !!{sentence}s in~$\Gamma$
  47. and vice versa. So anything we can prove about models of~$\Gamma$ we
  48. have proved about all preorders.
  49. For any particular theory and class of models (such as $\Gamma$ and
  50. all preorders), there will be interesting questions about what can be
  51. expressed in the corresponding first-order language, and what cannot
  52. be expressed. There are some properties of !!{structure}s that are
  53. interesting for all languages and classes of models, namely those
  54. concerning the size of the !!{domain}. One can always express, for
  55. instance, that the !!{domain} contains exactly $n$~!!{element}s, for
  56. any~$n \in \PosInt$. One can also express, using a set of infinitely
  57. many !!{sentence}s, that the !!{domain} is infinite. But one cannot
  58. express that the domain is finite, or that the domain is
  59. !!{nonenumerable}. These results about the limitations of first-order
  60. languages are consequences of the compactness and L\"owenheim--Skolem
  61. theorems.
  62. \end{document}

content/first-order-logic/introduction/soundness-completeness.tex

68 lines; SHA-256 49f9a2fb437d680d3e796d72b46d1bc1c5a60c58e3e13ac2e19e6bac6976336e. Open the byte-exact preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: introduction
  3. % Section: soundness-completeness
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{fol}{int}{scp}
  7. \olsection{Soundness and Completeness}
  8. We'll also introduce !!{derivation} systems for first-order logic. There are
  9. many !!{derivation} systems that logicians have developed, but they all define
  10. the same !!{derivability} relation between !!{sentence}s. We say that
  11. $\Gamma$ \emph{!!{derive}s}~$!A$, $\Gamma \Proves !A$, if there is
  12. !!a{derivation} of a certain precisely defined sort. !!^{derivation}s
  13. are always finite arrangements of symbols---perhaps a list of
  14. !!{sentence}s, or some more complicated structure. The purpose of
  15. !!{derivation} systems is to provide a tool to determine if !!a{sentence} is
  16. entailed by some set~$\Gamma$. In order to serve that purpose, it
  17. must be true that $\Gamma \Entails !A$ if, and only if, $\Gamma
  18. \Proves !A$.
  19. If $\Gamma \Proves !A$ but not $\Gamma \Entails !A$, our !!{derivation} system
  20. would be too strong, prove too much. The property that if $\Gamma
  21. \Proves !A$ then $\Gamma \Entails !A$ is called \emph{soundness}, and
  22. it is a minimal requirement on any good !!{derivation} system. On the other
  23. hand, if $\Gamma \Entails !A$ but not $\Gamma \Proves !A$, then our
  24. !!{derivation} system is too weak, it doesn't prove enough. The property that
  25. if $\Gamma \Entails !A$ then $\Gamma \Proves !A$ is called
  26. \emph{completeness}. Soundness is usually relatively easy to prove (by
  27. induction on the structure of !!{derivation}s, which are inductively
  28. defined). Completeness is harder to prove.
  29. Soundness and completeness have a number of important consequences. If
  30. a set of !!{sentence}s~$\Gamma$ !!{derive}s a contradiction (such as
  31. $!A \land \lnot !A$) it is called \emph{inconsistent}. Inconsistent
  32. $\Gamma$s cannot have any models, they are unsatisfiable. From
  33. completeness the converse follows: any $\Gamma$ that is not
  34. inconsistent---or, as we will say, \emph{consistent}---has a model. In
  35. fact, this is equivalent to completeness, and is the form of
  36. completeness we will actually prove. It is a deep and perhaps
  37. surprising result: just because you cannot prove $!A \land \lnot !A$
  38. from $\Gamma$ guarantees that there is !!a{structure} that is as
  39. $\Gamma$ describes it. So completeness gives an answer to the
  40. question: which sets of !!{sentence}s have models? Answer: all and only
  41. consistent sets do.
  42. The soundness and completeness theorems have two important
  43. consequences: the compactness and the L\"owenheim--Skolem theorem.
  44. These are important results in the theory of models, and can be used
  45. to establish many interesting results. We've already mentioned two:
  46. first-order logic cannot express that the !!{domain} of !!a{structure}
  47. is finite or that it is !!{nonenumerable}.
  48. Historically, all of this---how to define syntax and semantics of
  49. first-order logic, how to define good !!{derivation} systems, how to prove that
  50. they are sound and complete, getting clear about what can and cannot
  51. be expressed in first-order languages---took a long time to figure out
  52. and get right. We now know how to do it, but going through all the
  53. details can still be confusing and tedious. But it's also important,
  54. because the methods developed here for the formal language of
  55. first-order logic are applied all over the place in logic, computer
  56. science, and linguistics. So working through the details pays off in
  57. the long run.
  58. \end{document}