Source and provenance

All 7 files in the exact Syntax and Semantics source boundary appear line by line and are copied byte-for-byte for download. All 374 formulas link to exact source coordinates.

content/propositional-logic/syntax-and-semantics/formation-sequences.tex

153 lines; SHA-256 4057bf6b85c70ad9ee56dc5365b21a1daa0a99550079bdafb1ab16f36b943356. Open the preserved source file.

  1. % Part: first-order-logic
  2. % Chapter: syntax-and-semantics
  3. % Section: formation-sequences
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{fseq}
  7. \olsection{Formation Sequences}
  8. Defining !!{formula}s via an inductive definition, and the
  9. complementary technique of proving properties of !!{formula}s via
  10. induction, is an elegant and efficient approach. However, it can
  11. also be useful to consider a more bottom-up, step-by-step approach
  12. to the construction of !!{formula}s, which we do here using the
  13. notion of a \emph{formation sequence}.
  14. \begin{defn}[Formation sequences for formulas]
  15. \ollabel{defn:fseq-frm}
  16. A finite sequence $\tuple{!A_0,\dotsc,!A_n}$ of strings of
  17. symbols from the language~$\Lang L_0$ is a \emph{formation
  18. sequence} for $!A$ if $!A \ident !A_n$ and for all $i \leq n$,
  19. either $!A_i$ is an atomic formula or there exist $j,k < i$
  20. such that one of the following holds:
  21. \begin{enumerate}
  22. \tagitem{prvNot}{$!A_i \ident \lnot !A_j$.}{}%
  23. \tagitem{prvAnd}{$!A_i \ident (!A_j \land !A_k)$.}{}%
  24. \tagitem{prvOr}{$!A_i \ident (!A_j \lor !A_k)$.}{}%
  25. \tagitem{prvIf}{$!A_i \ident (!A_j \lif !A_k)$.}{}%
  26. \tagitem{prvIff}{$!A_i \ident (!A_j \liff !A_k)$.}{}%
  27. \end{enumerate}
  28. \end{defn}
  29. \begin{ex}
  30. \[
  31. \tuple{
  32. \Obj p_0,
  33. \Obj p_1,
  34. (\Obj p_1 \land \Obj p_0),
  35. \lnot (\Obj p_1 \land \Obj p_0)
  36. }
  37. \]
  38. is a formation sequence of
  39. $\lnot (\Obj p_1 \land \Obj p_0)$, as is
  40. \[
  41. \tuple{
  42. \Obj p_0,
  43. \Obj p_1,
  44. \Obj p_0,
  45. (\Obj p_1 \land \Obj p_0),
  46. (\Obj p_0 \lif \Obj p_1),
  47. \lnot (\Obj p_1 \land \Obj p_0)
  48. }.
  49. \]
  50. %
  51. As can be seen from the second example, formation sequences
  52. may contain `junk': formulas which are redundant or do not
  53. contribute to the construction.
  54. \end{ex}
  55. \begin{prop}
  56. \ollabel{prop:formed}
  57. Every !!{formula}~$!A$ in~$\Frm[L_0]$ has a formation sequence.
  58. \end{prop}
  59. \begin{proof}
  60. Suppose $!A$ is atomic. Then the sequence~$\tuple{!A}$ is a
  61. formation sequence for~$!A$.
  62. %
  63. Now suppose that $!B$ and~$!C$ have formation sequences
  64. $\tuple{!B_0,\dotsc,!B_n}$ and $\tuple{!C_0,\dotsc,!C_m}$
  65. respectively.
  66. %
  67. \begin{enumerate}
  68. \tagitem{prvNot}{If $!A \ident \lnot !B$,
  69. then $\tuple{!B_0,\dotsc,!B_n,\lnot !B_n}$
  70. is a formation sequence for~$!A$.}{}
  71. \tagitem{prvAnd}{If $!A \ident (!B \land !C)$,
  72. then $\tuple{!B_0,\dotsc,!B_n,!C_0,\dotsc,!C_m,(!B_n \land !C_m)}$
  73. is a formation sequence for~$!A$.}{}
  74. \tagitem{prvOr}{If $!A \ident (!B \lor !C)$,
  75. then $\tuple{!B_0,\dotsc,!B_n,!C_0,\dotsc,!C_m,(!B_n \lor !C_m)}$
  76. is a formation sequence for~$!A$.}{}
  77. \tagitem{prvIf}{If $!A \ident (!B \lif !C)$,
  78. then $\tuple{!B_0,\dotsc,!B_n,!C_0,\dotsc,!C_m,(!B_n \lif !C_m)}$
  79. is a formation sequence for~$!A$.}{}
  80. \tagitem{prvIff}{If $!A \ident (!B \liff !C)$,
  81. then $\tuple{!B_0,\dotsc,!B_n,!C_0,\dotsc,!C_m,(!B_n \liff !C_m)}$
  82. is a formation sequence for~$!A$.}{}
  83. \end{enumerate}
  84. By the principle of induction on !!{formula}s,
  85. every !!{formula} has a formation sequence.
  86. \end{proof}
  87. We can also prove the converse. This is important because it shows
  88. that our two ways of defining formulas are equivalent: they give
  89. the same results. It also means that we can prove theorems about
  90. formulas by using ordinary induction on the length of formation
  91. sequences.
  92. \begin{lem}
  93. \ollabel{lem:fseq-init}
  94. Suppose that $\tuple{!A_0,\dotsc,!A_n}$ is a formation sequence
  95. for~$!A_n$, and that $k \leq n$. Then $\tuple{!A_0,\dotsc,!A_k}$
  96. is a formation sequence for~$!A_k$.
  97. \end{lem}
  98. \begin{proof}
  99. Exercise.
  100. \end{proof}
  101. \begin{thm}
  102. \ollabel{thm:fseq-frm-equiv}
  103. $\Frm[L_0]$ is the set of all strings of symbols
  104. in the language~$\Lang L_0$ with a formation sequence.
  105. \end{thm}
  106. \begin{proof}
  107. Let $F$ be the set of all strings of symbols in the
  108. language~$\Lang L_0$ that have a formation sequence.
  109. We have seen in \olref[pl][syn][fseq]{prop:formed} that
  110. $\Frm[L_0] \subseteq F$, so now we prove the converse.
  111. Suppose $!A$ has a formation sequence $\tuple{!A_0,\dotsc,!A_n}$.
  112. We prove that $!A \in \Frm[L_0]$ by strong induction on~$n$.
  113. Our induction hypothesis is that every string of symbols with a
  114. formation sequence of length $m < n$ is in~$\Frm[L_0]$.
  115. By the definition of a formation sequence, either $!A_n$ is
  116. atomic or there must exist $j,k < n$ such that one of the
  117. following is the case:
  118. \begin{enumerate}
  119. \tagitem{prvNot}{$!A_n \ident \lnot !A_j$.}{}%
  120. \tagitem{prvAnd}{$!A_n \ident (!A_j \land !A_k)$.}{}%
  121. \tagitem{prvOr}{$!A_n \ident (!A_j \lor !A_k)$.}{}%
  122. \tagitem{prvIf}{$!A_n \ident (!A_j \lif !A_k)$.}{}%
  123. \tagitem{prvIff}{$!A_n \ident (!A_j \liff !A_k)$.}{}%
  124. \end{enumerate}
  125. Now we reason by cases. If $!A_n$ is atomic then
  126. $!A_n \in \Frm[L_0]$. Suppose instead that $!A \equiv
  127. (!A_j \land !A_k)$. By \olref[pl][syn][fseq]{lem:fseq-init},
  128. $\tuple{!A_0,\dotsc,!A_j}$ and $\tuple{!A_0,\dotsc,!A_k}$ are
  129. formation sequences for $!A_j$ and~$!A_k$ respectively. Since
  130. these are proper initial subsequences of the formation sequence
  131. for~$!A$, they both have length less than~$n$. Therefore by
  132. the induction hypothesis, $!A_j$ and~$!A_k$ are in~$\Frm[L_0]$,
  133. and so by the definition of !!a{formula}, so is
  134. $(!A_j \land !A_k)$. The other cases follow by parallel
  135. reasoning.
  136. \end{proof}
  137. \end{document}

content/propositional-logic/syntax-and-semantics/formulas.tex

182 lines; SHA-256 8777d77e48e3a41a527b1b737c67e00cb7850f4fa0902ce24846000b40724756. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: syntax-and-semantics
  3. % Section: formulas
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{fml}
  7. \olsection{Propositional \usetoken{P}{formula}}
  8. !!^{formula}s of propositional logic are built up from
  9. \emph{!!{propositional
  10. variable}s}\iftag{prvFalse}{\iftag{prvTrue}{,}{ and} the
  11. propositional constant~$\lfalse$}{}\iftag{prvTrue}{\iftag{prvFalse}{
  12. and}{} the propositional constant~$\ltrue$}{} using \emph{logical
  13. connectives}.
  14. \begin{enumerate}
  15. \item !!^a{denumerable} set~$\PVar$ of !!{propositional variable}s $\Obj p_0$,
  16. $\Obj p_1$, \dots
  17. \tagitem{prvFalse}{The propositional constant for !!{falsity}~$\lfalse$.}{}
  18. \tagitem{prvTrue}{The propositional constant for !!{truth}~$\ltrue$.}{}
  19. \item The logical connectives:
  20. \startycommalist
  21. \iftag{prvNot}{\ycomma $\lnot$ (negation)}{}%
  22. \iftag{prvAnd}{\ycomma $\land$ (conjunction)}{}%
  23. \iftag{prvOr}{\ycomma $\lor$ (disjunction)}{}%
  24. \iftag{prvIf}{\ycomma $\lif$ (!!{conditional})}{}%
  25. \iftag{prvIff}{\ycomma $\liff$ (!!{biconditional})}{}%
  26. \item Punctuation marks: (, ), and the comma.
  27. \end{enumerate}
  28. We denote this language of propositional logic by $\Lang L_0$.
  29. \iftag{defNot,defOr,defAnd,defIf,defIff,defTrue,defFalse,defEx,defAll}{%
  30. In addition to the primitive connectives introduced
  31. above, we also use the following \emph{defined} symbols:
  32. \startycommalist
  33. \iftag{defNot}{\ycomma $\lnot$ (negation)}{}%
  34. \iftag{defAnd}{\ycomma $\land$ (conjunction)}{}%
  35. \iftag{defOr}{\ycomma $\lor$ (disjunction)}{}%
  36. \iftag{defIf}{\ycomma $\lif$ (!!{conditional})}{}%
  37. \iftag{defIff}{\ycomma $\liff$ (!!{biconditional})}{}%
  38. \iftag{defFalse}{\ycomma $\lfalse$ (!!{falsity})}{}%
  39. \iftag{defTrue}{\ycomma $\ltrue$ (!!{truth})}}{}.
  40. \begin{tagblock}{defNot,defOr,defAnd,defIf,defIff,defTrue,defFalse,defEx,defAll}
  41. \begin{explain}
  42. A defined symbol is not officially part of the language, but is
  43. introduced as an informal abbreviation: it allows us to abbreviate
  44. formulas which would, if we only used primitive symbols, get quite
  45. long. This is obviously an advantage. The bigger advantage, however,
  46. is that proofs become shorter. If a symbol is primitive, it has to be
  47. treated separately in proofs. The more primitive symbols, therefore,
  48. the longer our proofs.
  49. \end{explain}
  50. \end{tagblock}
  51. % Alternate symbols
  52. \begin{intro}
  53. You may be familiar with different terminology and symbols than the
  54. ones we use above. Logic texts (and teachers) commonly use either
  55. $\sim$, $\neg$, and~!\ for ``negation'', $\wedge$, $\cdot$, and $\&$
  56. for ``conjunction''. Commonly used symbols for the ``conditional'' or
  57. ``implication'' are $\rightarrow$, $\Rightarrow$, and $\supset$.
  58. \iftag{prvIff,defIff}{Symbols for ``biconditional,'' ``bi-implication,''
  59. or ``(material) equivalence'' are $\leftrightarrow$,
  60. $\Leftrightarrow$, and $\equiv$.}{}
  61. \iftag{prvFalse,defFalse}{The $\lfalse$ symbol is variously called
  62. ``falsity,'' ``falsum,'' ``absurdity,'' or ``bottom.''}{}
  63. \iftag{prvTrue,defTrue}{The $\ltrue$ symbol is variously called
  64. ``truth,'' ``verum,'' or ``top.''}{}
  65. \end{intro}
  66. \begin{defn}[Formula]
  67. \ollabel{defn:formulas}
  68. The set~$\Frm[L_0]$ of \emph{!!{formula}s} of propositional logic
  69. is defined inductively as follows:
  70. \begin{enumerate}
  71. \tagitem{prvFalse}{$\lfalse$ is an atomic !!{formula}.}{}
  72. \tagitem{prvTrue}{$\ltrue$ is an atomic !!{formula}.}{}
  73. \item Every !!{propositional variable}~$\Obj p_i$ is an atomic
  74. !!{formula}.
  75. \tagitem{prvNot}{If $!A$ is !!a{formula}, then $\lnot !A$ is
  76. !!a{formula}.}{}
  77. \tagitem{prvAnd}{If $!A$ and $!B$ are !!{formula}s, then $(!A \land
  78. !B)$ is !!a{formula}.}{}
  79. \tagitem{prvOr}{If $!A$ and $!B$ are !!{formula}s, then $(!A \lor !B)$
  80. is !!a{formula}.}{}
  81. \tagitem{prvIf}{If $!A$ and $!B$ are !!{formula}s, then $(!A \lif !B)$
  82. is !!a{formula}.}{}
  83. \tagitem{prvIff}{If $!A$ and $!B$ are !!{formula}s, then $(!A \liff !B)$
  84. is !!a{formula}.}{}
  85. \tagitem{limitClause}{Nothing else is !!a{formula}.}{}
  86. \end{enumerate}
  87. \end{defn}
  88. \begin{explain}
  89. The definition of !!{formula}s is an
  90. \emph{inductive definition}. Essentially, we construct the set of
  91. !!{formula}s in infinitely many stages. In the initial stage, we
  92. pronounce all atomic formulas to be formulas; this corresponds to the
  93. first few cases of the definition, i.e., the cases for
  94. \iftag{prvTrue}{$\ltrue$, }{}%
  95. \iftag{prvFalse}{$\lfalse$, }{}%
  96. $\Obj p_i$. ``Atomic !!{formula}''
  97. thus means any !!{formula} of this form.
  98. The other cases of the definition give rules for constructing new
  99. !!{formula}s out of !!{formula}s already constructed. At the second
  100. stage, we can use them to construct !!{formula}s out of atomic
  101. !!{formula}s. At the third stage, we construct new formulas from the
  102. atomic formulas and those obtained in the second stage, and so on. A
  103. !!{formula} is anything that is eventually constructed at such a
  104. stage, and nothing else.
  105. \end{explain}
  106. When writing a formula $(!B \ast !C)$ constructed from $!B$, $!C$
  107. using a two-place connective~$\ast$, we will often leave out the
  108. outermost pair of parentheses and write simply~$!B \ast !C$.
  109. \begin{tagblock}{defNot,defOr,defAnd,defIf,defIff,defTrue,defFalse,defEx,defAll}
  110. \begin{defn}
  111. Formulas constructed using the defined operators are to be understood
  112. as follows:
  113. \begin{tagenumerate}{defTrue,defFalse,defNot,defOr,defAnd,defIf,defIff,defEx,defAll}
  114. \tagitem{defTrue}{$\ltrue$ abbreviates
  115. \iftag{prvFalse}{$\lnot\lfalse$}{$(!A \lor \lnot !A)$ for some
  116. fixed atomic !!{formula}~$!A$}.}{}
  117. \tagitem{defFalse}{$\lfalse$ abbreviates
  118. \iftag{prvTrue}{$\lnot\ltrue$}{$(!A \land \lnot !A)$ for some
  119. fixed atomic !!{formula}~$!A$}.}{}
  120. \tagitem{defNot}{$\lnot !A$ abbreviates $!A \lif \lfalse$.}{}
  121. \tagitem{defOr}{$!A \lor !B$ abbreviates
  122. \iftag{prvAnd}{$\lnot(\lnot !A \land \lnot !B)$}{$\lnot !A \lif
  123. !B$}.}{}
  124. \tagitem{defAnd}{$!A \land !B$ abbreviates
  125. \iftag{prvOr}{$\lnot(\lnot !A \lor \lnot !B)$}{$\lnot (!A \lif
  126. \lnot !B)$}.}{}
  127. \tagitem{defIf}{$!A \lif !B$ abbreviates
  128. \iftag{prvOr}{$\lnot !A \lor !B)$}{$\lnot (!A \land \lnot !B)$}.}{}
  129. \tagitem{defIff}{$!A \liff !B$ abbreviates $(!A \lif !B) \land (!B
  130. \lif !A)$.}{}
  131. \end{tagenumerate}
  132. \end{defn}
  133. \end{tagblock}
  134. \begin{defn}[Syntactic identity]
  135. The symbol $\ident$ expresses syntactic identity between strings of
  136. symbols, i.e., $!A \ident !B$ iff $!A$ and $!B$ are strings of symbols
  137. of the same length and which contain the same symbol in each place.
  138. \end{defn}
  139. The $\ident$ symbol may be flanked by strings obtained by
  140. concatenation, e.g., $!A \ident (!B \lor !C)$ means: the string of
  141. symbols~$!A$ is the same string as the one obtained by concatenating
  142. an opening parenthesis, the string $!B$, the $\lor$ symbol, the
  143. string~$!C$, and a closing parenthesis, in this order. If this is the
  144. case, then we know that the first symbol of $!A$ is an opening
  145. parenthesis, $!A$ contains $!B$ as a substring (starting at the second
  146. symbol), that substring is followed by $\lor$, etc.
  147. \end{document}

content/propositional-logic/syntax-and-semantics/introduction.tex

79 lines; SHA-256 2ad06497283fa1399d56862c75caf1a418bb753fbb0195658af9f0c57183a441. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: syntax-and-semantics
  3. % Section: introduction
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{int}
  7. \olsection{Introduction}
  8. Propositional logic deals with !!{formula}s that are built from
  9. !!{propositional variable}s using the propositional connectives
  10. $\lnot$, $\land$, $\lor$, $\lif$, and $\liff$. Intuitively,
  11. !!a{propositional variable}~$p$ stands for a sentence or proposition
  12. that is true or false. Whenever the ``truth value'' of the
  13. !!{propositional variable} in !!a{formula} is determined, so is the
  14. truth value of any !!{formula}s formed from them using propositional
  15. connectives. We say that propositional logic is \emph{truth
  16. functional}, because its semantics is given by functions of truth
  17. values. In particular, in propositional logic we leave out of
  18. consideration any further determination of truth and falsity, e.g.,
  19. whether something is necessarily true rather than just contingently
  20. true, or whether something is known to be true, or whether something
  21. is true now rather than was true or will be true. We only consider
  22. two truth values true ($\True$) and false ($\False$), and so exclude
  23. from discussion the possibility that a statement may be neither true
  24. nor false, or only half true. We also concentrate only on connectives where
  25. the truth value of !!a{formula} built from them is completely
  26. determined by the truth values of its parts (and not, say, on its
  27. meaning). In particular, whether the truth value of conditionals in
  28. English is truth functional in this sense is contentious. The material
  29. conditional~$\lif$ is; other logics deal with conditionals that are
  30. not truth functional.
  31. In order to develop the theory and metatheory of truth-functional
  32. propositional logic, we must first define the syntax and semantics of
  33. its expressions. We will describe one way of constructing
  34. !!{formula}s from !!{propositional variable}s using the connectives.
  35. Alternative definitions are possible. Other systems will choose
  36. different symbols, will select different sets of connectives as
  37. primitive, and will use parentheses differently (or even not at all,
  38. as in the case of so-called Polish notation). What all approaches
  39. have in common, though, is that the formation rules define the set of
  40. !!{formula}s \emph{inductively}. If done properly, every expression
  41. can result essentially in only one way according to the formation
  42. rules. The inductive definition resulting in expressions that are
  43. \emph{uniquely readable} means we can give meanings to these
  44. expressions using the same method---inductive definition.
  45. Giving the meaning of expressions is the domain of semantics. The
  46. central concept in semantics for propositional logic is that of
  47. satisfaction in !!a{valuation}. !!^a{valuation}~$\pAssign{v}$ assigns
  48. truth values $\True$, $\False$ to the !!{propositional variable}s. Any
  49. !!{valuation} determines a truth value $\pValue{v}(!A)$ for any
  50. !!{formula}~$!A$. !!^a{formula} is satisfied in
  51. !!a{valuation}~$\pAssign{v}$ iff $\pValue{v}(!A) = \True$---we write
  52. this as $\pSat{v}{!A}$. This relation can also be defined by induction on
  53. the structure of~$!A$, using the truth functions for the logical
  54. connectives to define, say, satisfaction of $!A \land !B$ in terms of
  55. satisfaction (or not) of $!A$ and~$!B$.
  56. On the basis of the satisfaction relation $\pSat{v}{!A}$ for sentences
  57. we can then define the basic semantic notions of tautology,
  58. entailment, and satisfiability. !!^a{formula} is a tautology,
  59. $\Entails !A$, if every !!{valuation} satisfies it, i.e.,
  60. $\pValue{v}(!A) = \True$ for any~$\pAssign{v}$. It is entailed by a
  61. set of !!{formula}s, $\Gamma \Entails !A$, if every !!{valuation} that
  62. satisfies all the !!{formula}s in~$\Gamma$ also satisfies~$!A$. And a
  63. set of !!{formula}s is satisfiable if some !!{valuation} satisfies all
  64. !!{formula}s in it at the same time. Because !!{formula}s are
  65. inductively defined, and satisfaction is in turn defined by induction
  66. on the structure of !!{formula}s, we can use induction to prove
  67. properties of our semantics and to relate the semantic notions
  68. defined.
  69. \end{document}

content/propositional-logic/syntax-and-semantics/preliminaries.tex

120 lines; SHA-256 78673f8419aa1f936f1ecc5629c0fa92c74fd4ee3102badf5f389e3d775f48d6. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: propositional-logic
  3. % Section: preliminaries
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{pre}
  7. \olsection{Preliminaries}
  8. \begin{thm}[\emph{Principle of induction on !!{formula}s}]
  9. \ollabel{thm:induction}
  10. If some property~$P$ holds for all the atomic !!{formula}s and is
  11. such that
  12. \begin{enumerate}
  13. \tagitem{prvNot}{it holds for $\lnot !A$ whenever it holds
  14. for~$!A$;}{}
  15. \tagitem{prvAnd}{it holds for $(!A \land !B)$
  16. whenever it holds for $!A$ and~$!B$;}{}
  17. \tagitem{prvOr}{it holds for $(!A \lor !B)$
  18. whenever it holds for $!A$ and~$!B$;}{}
  19. \tagitem{prvIf}{it holds for $(!A \lif !B)$
  20. whenever it holds for $!A$ and~$!B$;}{}
  21. \tagitem{prvIff}{it holds for $(!A \liff !B)$
  22. whenever it holds for $!A$ and~$!B$;}{}
  23. \end{enumerate}
  24. then $P$ holds for all !!{formula}s.
  25. \end{thm}
  26. \begin{proof}
  27. Let $S$ be the collection of all !!{formula}s with
  28. property~$P$. Clearly $S \subseteq \Frm[L_0]$. $S$~satisfies all the
  29. conditions of \olref[fml]{defn:formulas}: it contains all atomic
  30. !!{formula}s and is closed under the !!{operator}s. $\Frm[L_0]$ is
  31. the smallest such class, so $\Frm[L_0] \subseteq S$. So $\Frm[L_0] = S$, and
  32. every formula has property~$P$.
  33. \end{proof}
  34. \begin{prop}\ollabel{prop:balanced}
  35. Any !!{formula} in~$\Frm[L_0]$ is \emph{balanced}, in that it has
  36. as many left parentheses as right ones.
  37. \end{prop}
  38. \begin{prob}
  39. Prove \olref[pl][syn][pre]{prop:balanced}
  40. \end{prob}
  41. \begin{prop} \ollabel{prop:noinit}
  42. No proper initial segment of !!a{formula} is !!a{formula}.
  43. \end{prop}
  44. \begin{prob}
  45. Prove \olref[pl][syn][pre]{prop:noinit}
  46. \end{prob}
  47. \begin{prop}[Unique Readability]
  48. Any !!{formula}~$!A$ in $ \Frm[L_0]$ has exactly one parsing as one of
  49. the following
  50. \begin{enumerate}
  51. \tagitem{prvFalse}{$\lfalse$.}{}
  52. \tagitem{prvTrue}{$\ltrue$.}{}
  53. \item $\Obj p_n$ for some $\Obj p_n \in \PVar$.
  54. \tagitem{prvNot}{$\lnot !B$ for some !!{formula}~$!B$.}{}
  55. \tagitem{prvAnd}{$(!B \land !C)$ for some !!{formula}s $!B$ and~$!C$.}{}
  56. \tagitem{prvOr}{$(!B \lor !C)$ for some !!{formula}s $!B$ and~$!C$.}{}
  57. \tagitem{prvIf}{$(!B \lif !C)$ for some !!{formula}s $!B$ and~$!C$.}{}
  58. \tagitem{prvIff}{$(!B \liff !C)$ for some !!{formula}s $!B$ and~$!C$.}{}
  59. \end{enumerate}
  60. Moreover, this parsing is \emph{unique}.
  61. \end{prop}
  62. \begin{proof}
  63. By induction on $!A$. For instance, suppose that $!A$ has two distinct
  64. readings as $(!B \lif !C)$ and $(!B' \lif !C')$. Then $!B$ and $!B'$
  65. must be the same (or else one would be a proper initial segment of the
  66. other); so if the two readings of $!A$ are distinct it must be because
  67. $!C$ and $!C'$ are distinct readings of the same sequence of symbols,
  68. which is impossible by the inductive hypothesis.
  69. \end{proof}
  70. \begin{defn}[Uniform Substitution]
  71. If $!A$ and $!B$ are !!{formula}s, and $\Obj p_i$ is a !!{propositional
  72. variable}, then $\Subst{!A}{!B}{\Obj p_i}$ denotes the result of
  73. replacing each occurrence of $\Obj p_i$ by an occurrence of $!B$ in $!A$;
  74. similarly, the simultaneous substitution of $\Obj p_1$, \dots,~$\Obj p_n$ by
  75. !!{formula}s $!B_1$, \dots,~$!B_n$ is denoted by
  76. $\SSubst{!A}{\subst{!B_1}{\Obj p_1},\dots,\subst{!B_n}{\Obj p_n}}$.
  77. \end{defn}
  78. \begin{prob} For each of the five !!{formula}s below determine whether the
  79. !!{formula} can be expressed as a substitution \( \Subst{!A}{!B}{\Obj p_i} \)
  80. where \( !A \) is (i) \( \Obj p_0 \); (ii) \( ( \lnot \Obj p_0 \land \Obj
  81. p_1) \); and (iii) \( ( ( \lnot \Obj p_0 \lif \Obj p_1 ) \land \Obj
  82. p_2 ) \). In each case specify the relevant substitution.
  83. \begin{enumerate}
  84. \item \( \Obj p_1 \)
  85. \item \( ( \lnot \Obj p_0 \land \Obj p_0 ) \)
  86. \item \( ( ( \Obj p_0 \lor \Obj p_1 ) \land \Obj p_2 ) \)
  87. \item \( \lnot ( ( \Obj p_0 \lif \Obj p_1 ) \land \Obj p_2 ) \)
  88. \item \( (( \lnot ( \Obj p_0 \lif \Obj p_1 ) \lif ( \Obj p_0 \lor \Obj p_1 )) \land \lnot ( \Obj p_0 \land \Obj p_1 )) \)
  89. \end{enumerate}
  90. \end{prob}
  91. \begin{prob}
  92. Give a mathematically rigorous definition of $\Subst{!A}{!B}{p}$ by
  93. induction.
  94. \end{prob}
  95. \end{document}

content/propositional-logic/syntax-and-semantics/semantic-notions.tex

96 lines; SHA-256 0167b2bab0dc2a75d011556643190a246d29831244a60bde5515b1b2f431406a. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: syntax-and-semantics
  3. % Section: semantic-notions
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{sem}
  7. \olsection{Semantic Notions}
  8. We define the following semantic notions:
  9. \begin{defn}
  10. \begin{enumerate}
  11. \item !!^a{formula}~$!A$ is \emph{satisfiable} if for
  12. some~$\pAssign{v}$, $\pSat{v}{!A}$; it is
  13. \emph{unsatisfiable} if for no $\pAssign{v}$, $\pSat{v}{!A}$;
  14. \item !!^a{formula}~$!A$ is a \emph{tautology} if $\pSat{v}{!A}$ for
  15. all !!{valuation}s~$\pAssign{v}$;
  16. \item !!^a{formula}~$!A$ is \emph{contingent} if it is satisfiable but
  17. not a tautology;
  18. \item If $\Gamma$ is a set of !!{formula}s, $\Gamma \Entails !A$ (``$\Gamma$
  19. entails $!A$'') if and only if $\pSat{v}{!A}$ for every
  20. !!{valuation}~$\pAssign{v}$ for which $\pSat{v}{\Gamma}$.
  21. \item If $\Gamma$ is a set of !!{formula}s, $\Gamma$ is
  22. \emph{satisfiable} if there is !!a{valuation}~$\pAssign{v}$ for which
  23. $\pSat{v}{\Gamma}$, and $\Gamma$ is
  24. \emph{unsatisfiable} otherwise.
  25. \end{enumerate}
  26. \end{defn}
  27. \begin{prob}
  28. For each of the following four !!{formula}s determine whether it
  29. is (a)~satisfiable, (b)~tautology, and (c)~contingent.
  30. \begin{enumerate}
  31. \item \( ( \Obj p_0 \lif ( \lnot \Obj p_1 \lif \lnot \Obj p_0 ) ) \).
  32. \item \( ( ( \Obj p_0 \land \lnot \Obj p_1 ) \lif ( \lnot \Obj p_0 \land \Obj p_2 )) \liff ( ( \Obj p_2 \lif \Obj p_0 ) \lif ( \Obj p_0 \lif \Obj p_1 )) \).
  33. \item \( ( \Obj p_0 \liff \Obj p_1 ) \lif ( \Obj p_2 \liff \lnot \Obj p_1 ) \).
  34. \item \( (( \Obj p_0 \liff ( \lnot \Obj p_1 \land \Obj p_2 )) \lor ( \Obj p_2 \lif ( \Obj p_0 \liff \Obj p_1 ))) \).
  35. \end{enumerate}
  36. \end{prob}
  37. \begin{prop}
  38. \ollabel{prop:semanticalfacts}
  39. \begin{enumerate}
  40. \item $!A$ is a tautology if and only if
  41. $\emptyset \Entails !A$;
  42. \item If $\Gamma \Entails !A$ and $\Gamma \Entails !A \lif !B$ then
  43. $\Gamma \Entails !B$;
  44. \item If $\Gamma$ is satisfiable then every finite subset of $\Gamma$
  45. is also satisfiable;
  46. \item \ollabel{def:monotonicity} Monotonicity: if $\Gamma \subseteq \Delta$
  47. and $\Gamma \Entails !A$ then also $\Delta \Entails !A$;
  48. \item \ollabel{def:Cut} Transitivity: if $\Gamma \Entails !A$ and
  49. $\Delta \cup \{ !A\} \Entails !B$ then $\Gamma \cup \Delta \Entails
  50. !B$.
  51. \end{enumerate}
  52. \end{prop}
  53. \begin{proof}
  54. Exercise.
  55. \end{proof}
  56. \begin{prob}
  57. Prove \olref[pl][syn][sem]{prop:semanticalfacts}
  58. \end{prob}
  59. \begin{prop}\ollabel{prop:entails-unsat}
  60. $\Gamma \Entails !A$ if and only if $\Gamma \cup \{\lnot !A\}$
  61. is unsatisfiable.
  62. \end{prop}
  63. \begin{proof}
  64. Exercise.
  65. \end{proof}
  66. \begin{prob}
  67. Prove \olref[pl][syn][sem]{prop:entails-unsat}
  68. \end{prob}
  69. \begin{thm}[Semantic Deduction Theorem]
  70. \ollabel{thm:sem-deduction} $\Gamma \Entails !A \lif !B$ if and only
  71. if $\Gamma \cup \{!A\} \Entails !B$.
  72. \end{thm}
  73. \begin{proof}
  74. Exercise.
  75. \end{proof}
  76. \begin{prob}
  77. Prove \olref[pl][syn][sem]{thm:sem-deduction}
  78. \end{prob}
  79. \end{document}

content/propositional-logic/syntax-and-semantics/syntax-and-semantics.tex

30 lines; SHA-256 799d1dab63cda19a28c1dbf7097052fb790bbce609aecd5367d2e368decdb18b. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: syntax-and-semantics
  3. \documentclass[../../../include/open-logic-chapter]{subfiles}
  4. \begin{document}
  5. \olchapter{pl}{syn}{Syntax and Semantics}
  6. \begin{editorial}
  7. This is a very quick summary of definitions only. It should be
  8. expanded to provide a gentle intro to proofs by induction on
  9. formulas, with lots more examples.
  10. \end{editorial}
  11. \olimport{introduction}
  12. \olimport{formulas}
  13. \olimport{preliminaries}
  14. \olimport{formation-sequences}
  15. \olimport{valuations-sat}
  16. \olimport{semantic-notions}
  17. \OLEndChapterHook
  18. \end{document}

content/propositional-logic/syntax-and-semantics/valuations-sat.tex

198 lines; SHA-256 d1454e8c2366f3a204a371523f41feacbdc72402f7a3a7ae6635b60b17c90481. Open the preserved source file.

  1. % Part: propositional-logic
  2. % Chapter: syntax-and-semantics
  3. % Section: valuations-sat
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{pl}{syn}{val}
  7. \olsection{\usetoken{P}{valuation} and Satisfaction}
  8. \begin{defn}[!!^{valuation}s]
  9. Let $\{\True, \False\}$ be the set of the two truth values, ``true''
  10. and ``false.'' A \emph{!!{valuation}} for $\Lang{L_0}$ is a
  11. function~$\pAssign{v}$ assigning either $\True$ or $\False$ to the
  12. !!{propositional variable}s of the language, i.e., $\pAssign{v} \colon
  13. \PVar \to \{\True, \False \}$.
  14. \end{defn}
  15. \begin{defn}
  16. Given !!a{valuation}~$\pAssign{v}$, define the evaluation function
  17. $\pValue{v} \colon \Frm[L_0] \to \{\True, \False \}$ inductively by:
  18. \begin{align*}
  19. \iftag{prvFalse}{\pValue{v}(\lfalse) & = \False; \\}{}
  20. \iftag{prvTrue}{\pValue{v}(\ltrue) & = \True; \\}{}
  21. \pValue{v}(\Obj p_n) & = \pAssign{v}(\Obj p_n); \\
  22. \iftag{prvNot}{\pValue{v}(\lnot !A) & = \begin{cases}
  23. \True & \text{if } \pValue{v}(!A) = \False;\\
  24. \False & \text{otherwise.}
  25. \end{cases} \\ }{}
  26. \iftag{prvAnd}{\pValue{v}(!A \land !B) & = \begin{cases}
  27. \True &
  28. \text{if $\pValue{v}(!A) = \True$ and $\pValue{v}(!B) = \True$;}\\
  29. \False &
  30. \text{if $\pValue{v}(!A) = \False$ or $\pValue{v}(!B) = \False$}.
  31. \end{cases}\\}{}
  32. \iftag{prvOr}{\pValue{v}(!A \lor !B) & = \begin{cases}
  33. \True &
  34. \text{if $\pValue{v}(!A) = \True$ or $\pValue{v}(!B) = \True$;}\\
  35. \False &
  36. \text{if $\pValue{v}(!A) = \False$ and $\pValue{v}(!B) = \False$}.
  37. \end{cases}\\}{}
  38. \iftag{prvIf}{\pValue{v}(!A \lif !B) & = \begin{cases}
  39. \True &
  40. \text{if $\pValue{v}(!A) = \False$ or $\pValue{v}(!B) = \True$;}\\
  41. \False &
  42. \text{if $\pValue{v}(!A) = \True$ and $\pValue{v}(!B) = \False$}.
  43. \end{cases}\\}{}
  44. \iftag{prvIff}{\pValue{v}(!A \liff !B) & = \begin{cases}
  45. \True &
  46. \text{if $\pValue{v}(!A) = \pValue{v}(!B)$;}\\
  47. \False &
  48. \text{if $\pValue{v}(!A) \neq \pValue{v}(!B)$}.
  49. \end{cases}}{}
  50. \end{align*}
  51. \end{defn}
  52. \begin{explain}
  53. The clauses correspond to the following truth tables:
  54. \begin{center}
  55. \iftag{prvNot}{
  56. \begin{tabular}{|c||c|} \hline
  57. $!A$ & $ \lnot !A$ \\
  58. \hline \hline
  59. $\True$ & $\False$ \\
  60. $\False$ & $\True$ \\
  61. \hline
  62. \end{tabular}
  63. }{}
  64. \iftag{prvAnd}{
  65. \begin{tabular}{|cc||c|} \hline
  66. $!A$ & $!B$ & $!A \land !B$ \\
  67. \hline \hline
  68. $\True$ & $\True$ & $\True$ \\
  69. $\True$ & $\False$ & $\False$ \\
  70. $\False$ & $\True$ & $\False$ \\
  71. $\False$ & $\False$ & $\False$ \\
  72. \hline
  73. \end{tabular}
  74. }{}
  75. \iftag{prvOr}{
  76. \begin{tabular}{|cc||c|} \hline
  77. $!A$ & $!B$ & $!A \lor !B$ \\
  78. \hline \hline
  79. $\True$ & $\True$ & $\True$ \\
  80. $\True$ & $\False$ & $\True$ \\
  81. $\False$ & $\True$ & $\True$ \\
  82. $\False$ & $\False$ & $\False$ \\
  83. \hline
  84. \end{tabular}
  85. }{}%
  86. \iftag{notprvNot,notprvAnd,notprvOr,notprvIf}{}{\\[1em]}
  87. \iftag{prvIf}{
  88. \begin{tabular}{|cc||c|} \hline
  89. $!A$ & $!B$ & $!A \lif !B$ \\
  90. \hline \hline
  91. $\True$ & $\True$ & $\True$ \\
  92. $\True$ & $\False$ & $\False$ \\
  93. $\False$ & $\True$ & $\True$ \\
  94. $\False$ & $\False$ & $\True$ \\
  95. \hline
  96. \end{tabular}
  97. }{}
  98. \iftag{prvIff}{
  99. \begin{tabular}{|cc||c|} \hline
  100. $!A$ & $!B$ & $!A \liff !B$ \\
  101. \hline \hline
  102. $\True$ & $\True$ & $\True$ \\
  103. $\True$ & $\False$ & $\False$ \\
  104. $\False$ & $\True$ & $\False$ \\
  105. $\False$ & $\False$ & $\True$ \\
  106. \hline
  107. \end{tabular}
  108. }{}
  109. \end{center}
  110. \end{explain}
  111. \begin{prob}
  112. Consider adding to $\Lang{L_0}$ a ternary connective $\diamondsuit$
  113. with evaluation given by
  114. \begin{gather*}
  115. \pValue{v}(\diamondsuit( !A , !B , !C ) ) = \begin{cases}
  116. \pValue{v}( !B ) &
  117. \text{if $\pValue{v}(!A) = \True$;}\\
  118. \pValue{v}( !C ) &
  119. \text{if $\pValue{v}(!A) = \False $}.
  120. \end{cases}
  121. \end{gather*}
  122. Write down the truth table for this connective.
  123. \end{prob}
  124. \begin{thm}[Local Determination]
  125. \ollabel{thm:LocalDetermination} Suppose that $\pAssign{v_1}$ and
  126. $\pAssign{v_2}$ are !!{valuation}s that agree on the !!{propositional
  127. variable}s occurring in $!A$, i.e., $\pAssign{v_1}(\Obj p_n) =
  128. \pAssign{v_2}(\Obj p_n)$ whenever $\Obj p_n$ occurs in some
  129. !!{formula}~$!A$. Then $\pValue{v_1}$ and $\pValue{v_2}$ also agree
  130. on~$!A$, i.e., $\pValue{v_1}(!A) = \pValue{v_2}(!A)$.
  131. \end{thm}
  132. \begin{proof}
  133. By induction on $!A$.
  134. \end{proof}
  135. \begin{defn}[Satisfaction]
  136. \ollabel{defn:satisfaction} We can inductively define the notion of
  137. \emph{satisfaction of !!a{formula}~$!A$ by
  138. !!a{valuation}~$\pAssign{v}$}, $\pSat{v}{!A}$, as follows.
  139. (We write $\pSat/{v}{!A}$ to mean ``not $\pSat{v}{!A}$.'')
  140. \begin{enumerate}
  141. \tagitem{prvFalse}{%
  142. \indcase{!A}{\lfalse}{$\pSat/{v}{\indfrm}$.}}{}
  143. \tagitem{prvTrue}{%
  144. \indcase{!A}{\ltrue}{$\pSat{v}{\indfrm}$.}}{}
  145. \item \indcase{!A}{\Obj p_i}{$\pSat{v}{\indfrm}$
  146. iff $\pAssign{v}(\Obj p_i) = \True$.}
  147. \tagitem{prvNot}{%
  148. \indcase{!A}{\lnot !B}{$\pSat{v}{\indfrm}$ iff
  149. $\pSat/{v}{!B}$.}}{}
  150. \tagitem{prvAnd}{%
  151. \indcase{!A}{(!B \land !C)}{$\pSat{v}{\indfrm}$ iff $\pSat{v}{!B}$
  152. and $\pSat{v}{!C}$.}}{}
  153. \tagitem{prvOr}{%
  154. \indcase{!A}{(!B \lor !C)}{$\pSat{v}{\indfrm}$ iff
  155. $\pSat{v}{!B}$ or $\pSat{v}{!C}$ (or both).}}{}
  156. \tagitem{prvIf}{%
  157. \indcase{!A}{(!B \lif !C)}{$\pSat{v}{\indfrm}$ iff $\pSat/{v}{!B}$
  158. or $\pSat{v}{!C}$ (or both).}}{}
  159. \tagitem{prvIff}{%
  160. \indcase{!A}{(!B \liff !C)}{$\pSat{v}{\indfrm}$ iff either both
  161. $\pSat{v}{!B}$ and $\pSat{v}{!C}$, or neither $\pSat{v}{!B}$
  162. nor $\pSat{v}{!C}$.}}{}
  163. \end{enumerate}
  164. If $\Gamma$ is a set of !!{formula}s, $\pSat{v}{\Gamma}$ iff
  165. $\pSat{v}{!A}$ for every~$!A \in \Gamma$.
  166. \end{defn}
  167. \begin{prop}\ollabel{prop:sat-value}
  168. $\pSat{v}{!A}$ iff $\pValue{v}(!A) = \True$.
  169. \end{prop}
  170. \begin{proof}
  171. By induction on~$!A$.
  172. \end{proof}
  173. \begin{prob}
  174. Prove \olref[pl][syn][val]{prop:sat-value}
  175. \end{prob}
  176. \end{document}

Propositional Logic: introduction to this part

Verbatim source for the part wrapper; imports and tags are source scaffolding, not omitted book prose.

content/propositional-logic/propositional-logic.tex

% Part: propositional-logic

\documentclass[../../include/open-logic-part]{subfiles}

\begin{document}

\olpart{pl}{Propositional Logic}

\begin{editorial}
  This part contains material on classical propositional logic. The
  first chapter is relatively rudimentary and just lists definitions
  and results, many proofs are not carried out but are left as
  exercises. The material on proof systems and the completeness
  theorem is included from the part on first-order logic, with the
  ``FOL'' tag set to false. This leaves out everything related to
  predicates, terms, and quantifiers, and replaces talk of
  !!{structure}s~$\Struct{M}$ with talk about
  !!{valuation}s~$\pAssign{v}$.

  It is planned to expand this part to include
  more detail, and to add further topics and results, such as
  truth-functional completeness.
\end{editorial}

\olimport[syntax-and-semantics]{syntax-and-semantics}

\tagfalse{FOL}

\olimport[../first-order-logic/proof-systems]{proof-systems}

\iftag{prfSC}{%
  \olimport[../first-order-logic/sequent-calculus]{sequent-calculus}
}{}

\iftag{prfND}{%
  \olimport[../first-order-logic/natural-deduction]{natural-deduction}
}{}

\iftag{prfTab}{%
  \olimport[../first-order-logic/tableaux]{tableaux}
}{}

\iftag{prfAX}{%
  \olimport[../first-order-logic/axiomatic-deduction]{axiomatic-deduction}
}{}

\olimport[../first-order-logic/completeness]{completeness}

\tagtrue{FOL}

\OLEndPartHook

\end{document}