├── .gitignore ├── ADOPTIONS.md ├── Bookml.mk ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── assets ├── by.pdf ├── cc.pdf ├── forallx-coverart-full.pdf ├── forallx-coverart-full.svg ├── forallx-coverart-screen.pdf ├── forallx-coverart-screen.svg ├── remix.pdf ├── sa.pdf ├── ti-color.pdf └── ti-color.png ├── fitch.sty ├── fitchml.css ├── fitchml.sty ├── forallx-yyc-accessibility.tex ├── forallx-yyc-alternatives.tex ├── forallx-yyc-backmatter.tex ├── forallx-yyc-content.tex ├── forallx-yyc-fol.tex ├── forallx-yyc-frontmatter.tex ├── forallx-yyc-interpretations.tex ├── forallx-yyc-metatheory.tex ├── forallx-yyc-ml.tex ├── forallx-yyc-notation.tex ├── forallx-yyc-preface.tex ├── forallx-yyc-prooffol.tex ├── forallx-yyc-prooftfl.tex ├── forallx-yyc-quickreference.tex ├── forallx-yyc-tfl.tex ├── forallx-yyc-truthtables.tex ├── forallx-yyc-what.tex ├── forallxyyc-accessible.tex ├── forallxyyc-accessible.xmpdata ├── forallxyyc-cover-kdp.tex ├── forallxyyc-cover-lulu.tex ├── forallxyyc-html.sty ├── forallxyyc-html.tex ├── forallxyyc-letter.tex ├── forallxyyc-local-sample.sty ├── forallxyyc-print.tex ├── forallxyyc-style.sty ├── forallxyyc.css ├── forallxyyc.sty ├── forallxyyc.tex ├── forallxyyc.xmpdata ├── latexml.sty └── solutions ├── fitch.sty ├── forallx-sol-fol.tex ├── forallx-sol-frontmatter.tex ├── forallx-sol-interpretations.tex ├── forallx-sol-metatheory.tex ├── forallx-sol-ml.tex ├── forallx-sol-prooffol.tex ├── forallx-sol-prooftfl.tex ├── forallx-sol-tfl.tex ├── forallx-sol-truthtables.tex ├── forallx-sol-what.tex ├── forallxyyc-solutions.tex └── latexml.sty /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | 14 | ## Intermediate documents: 15 | *.dvi 16 | *-converted-to.* 17 | # these rules might exclude image files for figures etc. 18 | # *.ps 19 | # *.eps 20 | *.pdf 21 | 22 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 23 | *.bbl 24 | *.bcf 25 | *.blg 26 | *-blx.aux 27 | *-blx.bib 28 | *.brf 29 | *.run.xml 30 | 31 | ## Build tool auxiliary files: 32 | *.fdb_latexmk 33 | *.synctex 34 | *.synctex.gz 35 | *.synctex.gz(busy) 36 | *.pdfsync 37 | 38 | ## Auxiliary and intermediate files from other packages: 39 | # algorithms 40 | *.alg 41 | *.loa 42 | 43 | # achemso 44 | acs-*.bib 45 | 46 | # amsthm 47 | *.thm 48 | 49 | # beamer 50 | *.nav 51 | *.snm 52 | *.vrb 53 | 54 | # cprotect 55 | *.cpt 56 | 57 | # fixme 58 | *.lox 59 | 60 | #(r)(e)ledmac/(r)(e)ledpar 61 | *.end 62 | *.?end 63 | *.[1-9] 64 | *.[1-9][0-9] 65 | *.[1-9][0-9][0-9] 66 | *.[1-9]R 67 | *.[1-9][0-9]R 68 | *.[1-9][0-9][0-9]R 69 | *.eledsec[1-9] 70 | *.eledsec[1-9]R 71 | *.eledsec[1-9][0-9] 72 | *.eledsec[1-9][0-9]R 73 | *.eledsec[1-9][0-9][0-9] 74 | *.eledsec[1-9][0-9][0-9]R 75 | 76 | # glossaries 77 | *.acn 78 | *.acr 79 | *.glg 80 | *.glo 81 | *.gls 82 | *.glsdefs 83 | 84 | # gnuplottex 85 | *-gnuplottex-* 86 | 87 | # hyperref 88 | *.brf 89 | 90 | # knitr 91 | *-concordance.tex 92 | # TODO Comment the next line if you want to keep your tikz graphics files 93 | *.tikz 94 | *-tikzDictionary 95 | 96 | # listings 97 | *.lol 98 | 99 | # makeidx 100 | *.idx 101 | *.ilg 102 | *.ind 103 | *.ist 104 | 105 | # minitoc 106 | *.maf 107 | *.mlf 108 | *.mlt 109 | *.mtc 110 | *.mtc[0-9] 111 | *.mtc[1-9][0-9] 112 | 113 | # minted 114 | _minted* 115 | *.pyg 116 | 117 | # morewrites 118 | *.mw 119 | 120 | # mylatexformat 121 | *.fmt 122 | 123 | # nomencl 124 | *.nlo 125 | 126 | # sagetex 127 | *.sagetex.sage 128 | *.sagetex.py 129 | *.sagetex.scmd 130 | 131 | # sympy 132 | *.sout 133 | *.sympy 134 | sympy-plots-for-*.tex/ 135 | 136 | # pdfcomment 137 | *.upa 138 | *.upb 139 | 140 | # pythontex 141 | *.pytxcode 142 | pythontex-files-*/ 143 | 144 | # thmtools 145 | *.loe 146 | 147 | # TikZ & PGF 148 | *.dpth 149 | *.md5 150 | *.auxlock 151 | 152 | # todonotes 153 | *.tdo 154 | 155 | # xindy 156 | *.xdy 157 | 158 | # xypic precompiled matrices 159 | *.xyc 160 | 161 | # endfloat 162 | *.ttt 163 | *.fff 164 | 165 | # Latexian 166 | TSWLatexianTemp* 167 | 168 | ## Editors: 169 | # WinEdt 170 | *.bak 171 | *.sav 172 | 173 | # Texpad 174 | .texpadtmp 175 | 176 | # Kile 177 | *.backup 178 | 179 | # KBibTeX 180 | *~[0-9]* 181 | 182 | *~ 183 | \#*\# 184 | *.ps 185 | *.png 186 | *.svg 187 | *.xml 188 | *.css 189 | *.js 190 | *.html 191 | *.zip 192 | *.xmpi 193 | *.cache -------------------------------------------------------------------------------- /ADOPTIONS.md: -------------------------------------------------------------------------------- 1 | # Adoptions 2 | 3 | Universities that have used or are using forall x: Calgary as main 4 | text in logic courses: 5 | 6 | - Auburn University 7 | - College of William and Mary 8 | - Concordia University 9 | - Indiana University 10 | - Kansas State University 11 | - McGill University 12 | - Rutgers University 13 | - Old Dominion University 14 | - Northwestern University 15 | - Universität Regensburg 16 | - University of Alberta 17 | - University of British Columbia 18 | - University of Calgary 19 | - University of California, Berkeley 20 | - University of California, Davis 21 | - University of California, San Diego 22 | - University of California, Riverside 23 | - University of Cincinnati 24 | - University of Illinois, Urbana-Champaign 25 | - University of Indiana 26 | - University of Maryland, College Park 27 | - University of Michigan 28 | - University of Notre Dame 29 | - University of Toronto 30 | - University of Victoria 31 | - Utah State University 32 | 33 | Universities using texts based on forall x: Calgary: 34 | 35 | - University of Auckland 36 | - University of Connecticut, Storrs 37 | - Cornell University 38 | - University of Bristol 39 | - University of Illinois, Chicago 40 | - Mississippi State University 41 | - University of Pittsburgh 42 | - University of Utrecht 43 | 44 | Translations: 45 | 46 | - German: Universität Dortmund 47 | - Portuguese: Universidade Federal do Rio Grande de Norte, Brasil 48 | -------------------------------------------------------------------------------- /Bookml.mk: -------------------------------------------------------------------------------- 1 | ### CONFIGURATION 2 | # Remove the initial '#' and change the value to customise the build process 3 | # See CONFIGURATION in bookml/bookml.mk for all the options 4 | # 5 | # Options can also be customized on the command line, for instance 6 | # make SPLITAT= singlepage.zip 7 | # will compile singlepage.tex into a single page 8 | # 9 | # For example: remove '#' below to split your document by chapter 10 | 11 | # split at chapters 12 | SPLITAT = chapter 13 | # includestyles, otherwise fitch.sty is not processed and we get no 14 | # proofs 15 | # --nomathtex to leave out the tex code in ALT tags on math elements 16 | # --nocomments to remove comments from HTML 17 | LATEXMLEXTRAFLAGS = --includestyles --nocomments 18 | LATEXMLPOSTEXTRAFLAGS = --pmml --nomathtex --css=forallxyyc.css --css=fitchml.css 19 | 20 | # Only convert the HTML driver not all the other TEX files 21 | SOURCES = forallxyyc-html.tex 22 | ### END CONFIGURATION 23 | 24 | include bookml/bookml.mk 25 | 26 | # You may also override SPLITAT and other options for a single file, as follows: 27 | #singlepage.zip: SPLITAT= 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Summary of changes 2 | 3 | ## Changes in Fall 2023 edition 4 | 5 | - Fully accessible HTML version and SCORM packages using BookML 6 | ([issue 23](https://github.com/rzach/forallx-yyc/issues/23)). This 7 | required many changes under the hood; see the [blog post on 8 | technical 9 | details](https://richardzach.org/2023/07/converting-latex-to-html-technical-notes/). 10 | - Proofs now label premises by 11 | PR and assumptions by AS (helps with accessibility, and makes 12 | textbook match Carnap's conventions more closely). 13 | - New chapter 13 (Limitations of TFL) based in part on section 12.5 of 14 | F21 edition. 15 | - New chapter 35 (Properties of relations) 16 | - Removed confusing sketch of soundness proof from chapter 22 ([issue 17 | 66](https://github.com/rzach/forallx-yyc/issues/66)) 18 | - Moved section 30.4 (Satisfaction of formulas) to section 32.2 19 | (Expressibility) and expanded it. 20 | - Added solutions to problems in chapters 7 and 29 (Ambiguity) 21 | - Added explanation on quantifier restriction at end of section 25.4 22 | ([issue 57](https://github.com/rzach/forallx-yyc/issues/57)) 23 | - Added material to section 27.3 on vacuous quantification, revised 24 | definitions of substitution to substitute only free occurrences of 25 | variables, and added section 36.6 to explain what can go wrong if 26 | you're not careful with substitution ([issue 27 | 77](https://github.com/rzach/forallx-yyc/issues/77)) 28 | - Revisions to section 4.2 to bring it in line with the terminology of 29 | chapter 3. 30 | - Added brief discussion of asymmetric use of “and” in section 5.2 31 | - Many minor revisons, fixed typos, and fixed formatting 32 | 33 | ## Changes in the Fall 2021 edition 34 | 35 | - Add chapter 45 on chains of equivalences 36 | - Add discussion of “only” and “except” to chapter 37 | - Lots of spelling, grammar fixes 38 | - Notes for instructors in Preface 39 | 40 | ## Changes in the Fall 2020 edition 41 | 42 | - some behind-the-scenes reorganization of the files (e.g, it now 43 | uses a stock `fitch.sty`, `forallxyyc-style.sty` with just the 44 | formatting stuff separate from `forallxyyc.sty` so the latter can 45 | be used in beamer slides) 46 | - renamed “expressively adequate” to “functionally complete” 47 | - incorporated some changes from the Cambridge version 48 | - moved chapter “Sentences of FOL” to before the “Definite 49 | descriptions” chapter 50 | - added two chapters on ambiguity (7, 28) 51 | - added “only” to section 23.1 52 | - split the chapter on normal forms and functional completeness into 53 | two 54 | - corrected some typos 55 | 56 | ## Changes in the Fall 2019 edition 57 | 58 | - New cover design by Mark Lyall. 59 | - Rewritten/revised chapters 1–3, avoiding modality when defining 60 | validity and instead talk about “cases” (the way JC Beall and Shay 61 | Logan do in their book, _Logic: The Basics_). 62 | - Changed the syntax of FOL: formulas are now F(x, y) instead of Fxy. 63 | This can be customized in forallxyyc-local.sty, though. 64 | - Changed some terminology: “logical consistency” is now 65 | “satisfiability” (and cognates), “logical truths” are now 66 | “validities”. 67 | - Sentence letters now allowed in FOL formulas. 68 | - Reiteration is now a basic rule, so that proofs can be in normal 69 | form. 70 | - Chapter 28 now defines satisfaction of a formula by an object, so 71 | that truth conditions for quantifiers can be stated more cleanly. 72 | - New chapters 16, 33 on strategies for constructing proofs. 73 | - Added three chapters on modal logic (natural deduction proof system 74 | and Kripke semantics). They are based on _A Modal Logic Primer_ by 75 | Rob Trueman (University of York), which he was generous enough to 76 | share. I’ve changed his proof system to use Fitch’s modal rules. It 77 | covers the basics of K, T, S4, and S5. 78 | - Added a chapter on soundness for TFL proofs, from Tim Button’s 79 | _Metatheory_. 80 | - Corrected various errors and added various clarifications. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # forall x: Calgary 2 | 3 | [![Book Cover](https://forallx.openlogicproject.org/forallxyyc.png)](https://forallx.openlogicproject.org/forallxyyc.pdf) 4 | 5 | ## Description 6 | 7 | _forall x: Calgary_ is a full-featured textbook on formal logic. It 8 | covers key notions of logic such as consequence and validity of 9 | arguments, the syntax of truth-functional propositional logic TFL and 10 | truth-table semantics, the syntax of first-order (predicate) logic FOL 11 | with identity (first-order interpretations), symbolizing English in 12 | TFL and FOL, and Fitch-style natural deduction proof systems for both 13 | TFL and FOL. It also deals with some advanced topics such as modal 14 | logic, soundness, and functional completeness. Exercises with 15 | solutions are available. It is provided in PDF (for screen reading, 16 | printing, and a special version for dyslexics), HTML (with additional 17 | [accessibility 18 | features](https://forallx.openlogicproject.org/html/A4.html)), and in 19 | LaTeX source code. 20 | 21 | Instructors wishing to adopt it should consider the open-source 22 | [Carnap](https://carnap.io/) system, which supports the notation and 23 | proof systems of _forall x: Calgary_. Check out the [sample 24 | exercises](https://carnap.io/shared/rzach@ucalgary.ca/forall%20x:%20Calgary.md) 25 | for the book on carnap.io. (There is also an outdated and unsupported 26 | proof editor/checker for the proof system used available at 27 | [proofs.openlogicproject.org](https://proofs.openlogicproject.org/).) 28 | 29 | The book has been translated into German ([forall _x_: 30 | Dortmund](https://github.com/sbwimmer/forallx-do)) and Portuguese 31 | ([Para Tod*x*s: 32 | Natal](https://github.com/Grupo-de-Estudos-em-Logica-da-UFRN/Para-Todxs-Natal)). 33 | 34 | ## Read online 35 | 36 | The book is available in HTML [to read 37 | online](https://forallx.openlogicproject.org/html/). 38 | 39 | The HTML conversion is experimental. If you find issues in it, 40 | especially issues that affect screen readers, please report it by 41 | [filing an issue](https://github.com/rzach/forallx-yyc/issues) or send 42 | an email to [Richard Zach](mailto:rzach@ucalgary.ca). Note that 43 | solutions are not yet included in the HTML version. 44 | 45 | ## Download 46 | 47 | You can download PDFs of the **most current version under development** here: 48 | 49 | - [`forallxyyc.pdf`](https://forallx.openlogicproject.org/forallxyyc.pdf) 50 | (in color, for screen reading) 51 | - [`forallxyyc-accessible.pdf`](https://forallx.openlogicproject.org/forallxyyc-accessible.pdf) 52 | (an accessible version for dyslexics) 53 | - [`forallxyyc-print.pdf`](https://forallx.openlogicproject.org/forallxyyc-print.pdf) 54 | (b/w, for printing on Quarto stock) 55 | - [`forallxyyc-letter.pdf`](https://forallx.openlogicproject.org/forallxyyc-letter.pdf) 56 | (b/w, for printing on regular letter-size paper) 57 | - [`forallxyyc-solutions.pdf`](https://forallx.openlogicproject.org/forallxyyc-solutions.pdf) 58 | (solutions booklet) 59 | 60 | The a [SCORM](https://adlnet.gov/past-projects/scorm/) ZIP package of 61 | HTML bundled with plain and accessible versions of the PDF is 62 | available here: 63 | 64 | - [SCORM.forallxyyc.zip](https://forallx.openlogicproject.org/SCORM.forallxyyc.zip) 65 | 66 | You can use this file to easily provide the entire text inside your 67 | LMS (Canvas, Moodle, D2L/Brightspace). 68 | 69 | **Note that these files change whenever the source files change.** So 70 | if you use the text in a course, it is best to download the PDFs or 71 | the SCORM package and make them available to students directly rather 72 | than to link here, to avoid mismatches between versions. 73 | 74 | Major changes between editions are listed in the [changelog](https://github.com/rzach/forallx-yyc/blob/master/CHANGELOG.md). 75 | 76 | PDFs of the **Fall 2021** edition are archived here: 77 | 78 | - [`forallxyyc-f21.pdf`](https://forallx.openlogicproject.org/forallxyyc-f21.pdf) 79 | - [`forallxyyc-accessible-f21.pdf`](https://forallx.openlogicproject.org/forallxyyc-accessible-f21.pdf) 80 | - [`forallxyyc-print-f21.pdf`](https://forallx.openlogicproject.org/forallxyyc-print-f21.pdf) 81 | - [`forallxyyc-letter-f21.pdf`](https://forallx.openlogicproject.org/forallxyyc-letter-f21.pdf) 82 | - [`forallxyyc-solutions-f21.pdf`](https://forallx.openlogicproject.org/forallxyyc-solutions-f21.pdf) 83 | 84 | PDFs of the **Fall 2020** edition are archived here: 85 | 86 | - [`forallxyyc-f20.pdf`](https://forallx.openlogicproject.org/forallxyyc-f20.pdf) 87 | - [`forallxyyc-accessible-f20.pdf`](https://forallx.openlogicproject.org/forallxyyc-accessible-f20.pdf) 88 | - [`forallxyyc-print-f20.pdf`](https://forallx.openlogicproject.org/forallxyyc-print-f20.pdf) 89 | - [`forallxyyc-letter-f20.pdf`](https://forallx.openlogicproject.org/forallxyyc-letter-f20.pdf) 90 | - [`forallxyyc-solutions-f20.pdf`](https://forallx.openlogicproject.org/forallxyyc-solutions-f20.pdf) 91 | 92 | ## Buy a Printed Copy 93 | 94 | If you'd like to purchase a nice paperback copy of the Fall 2023 95 | edition, you can do so on Amazon 96 | ([US](https://www.amazon.com/dp/B0CH2B1ZFG) | 97 | [CA](https://www.amazon.ca/dp/B0CH2B1ZFG) | 98 | [UK](https://www.amazon.co.uk/dp/B0CH2B1ZFG) | 99 | [DE](https://www.amazon.de/dp/B0CH2B1ZFG) | 100 | [AU](https://www.amazon.com.au/dp/B0CH2B1ZFG)), or use search in your 101 | local Amazon store. Be sure to get the latest version that's available 102 | in print (Fall 2023). The version on Amazon usually is not as current 103 | as the PDF. Changes are recorded in the 104 | [Changelog](https://github.com/rzach/forallx-yyc/blob/master/CHANGELOG.md). 105 | 106 | (The process for getting the book printed is described 107 | [here](https://openlogicproject.org/2015/11/22/getting-your-book-to-print/) 108 | and 109 | [here](https://openlogicproject.org/2017/05/19/forall-x-yyc-is-now-on-amazon-and-how-it-got-there/).) 110 | 111 | ## Make PDFs Yourself 112 | 113 | Clone the [GitHub repository](https://github.com/rzach/forallx-yyc) locally or download the ZIP file and run [LaTeX](https://www.latex-project.org/) on one of 114 | 115 | - `forallxyyc.tex` (in color, for screen reading) 116 | - `forallxyyc-accessible.tex` (accessible version) 117 | - `forallxyyc-print.tex` (b/w, for printing on Quarto stock) 118 | - `forallxyyc-letter.tex` (b/w, for printing on regular letter-size paper) 119 | 120 | You'll have to run `makeglossaries` to produce the glossary as well, 121 | or use `latexmk`. 122 | 123 | To make changes to the definitions in the preamble and `forallyyc.sty` 124 | file, put them in a file named `forallxyyc-local.sty`. For instance, 125 | to get the connectives to be ∼, &, ⊃, ≡ instead of ¬, ∧, →, ↔, and 126 | atomic formulas _Lab_ instead of _L(a,b)_, copy 127 | `forallxyyc-local-sample.sty` to that file. 128 | 129 | ## Convert to HTML 130 | 131 | To convert the book to HTML: 132 | 133 | - Install [LaTeXML](https://math.nist.gov/~BMiller/LaTeXML/). 134 | - Install [BookML](https://vlmantova.github.io/bookml/) and its 135 | dependencies. If your source files live in, say, `~/forallx-yyc` you 136 | should have a subdirectory `~/forallx-yyc/bookml`. 137 | - run `make -f Bookml.mk` from inside `~/forallx-yyc`. 138 | 139 | If this works, your HTML files can be found in 140 | `~/forallx-yyc/auxdir/html/forallxyyc-html/` and the SCORM package in 141 | `~/forallx-yyc/SCORM.forallxyyc-html.zip`. 142 | 143 | ## Credits and License 144 | 145 | _forall x: Calgary_ is based on [_forall x: 146 | Cambridge_](https://www.homepages.ucl.ac.uk/~uctytbu/OERs.html), by 147 | [Tim Button](https://www.homepages.ucl.ac.uk/~uctytbu/index.html) used 148 | under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 149 | license, which is based in turn on [_forall 150 | x_](https://www.fecundity.com/logic/), by 151 | [P. D. Magnus](https://www.fecundity.com/job/) used under a [CC BY 152 | 4.0](https://creativecommons.org/licenses/by/3.0/) license, and was 153 | remixed, revised, & expanded by [Aaron 154 | Thomas-Bolduc](https://phil.ucalgary.ca/profiles/aaron-thomas-bolduc) 155 | & [Richard Zach](https://richardzach.org/). It includes additional 156 | material from _forall x_ by P.~D. Magnus and 157 | [_Metatheory_](https://www.homepages.ucl.ac.uk/~uctytbu/OERs.html) by 158 | Tim Button, both used under a [CC BY 159 | 4.0](https://creativecommons.org/licenses/by/4.0/) license, from 160 | [_forall x: Lorain County 161 | Remix_](https://github.com/rob-helpy-chalk/openintroduction), by 162 | [Cathal Woods](https://sites.google.com/site/cathalwoods/) and J. 163 | Robert Loftis, used with permission, and [_A Modal Logic 164 | Primer_](http://www.rtrueman.com/uploads/7/0/3/2/70324387/modal_logic_primer.pdf) 165 | by [Robert Trueman](http://www.rtrueman.com/), used with permission. 166 | 167 | [![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)](https://creativecommons.org/licenses/by/4.0/) 168 | 169 | This work is licensed under a [Creative Commons Attribution 4.0 170 | International License](https://creativecommons.org/licenses/by/4.0/). 171 | 172 | The LaTeX source code for this work is available on GitHub at 173 | [github.com/rzach/forallx-yyc](https://github.com/rzach/forallx-yyc). 174 | 175 | -------------------------------------------------------------------------------- /assets/by.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/by.pdf -------------------------------------------------------------------------------- /assets/cc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/cc.pdf -------------------------------------------------------------------------------- /assets/forallx-coverart-full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/forallx-coverart-full.pdf -------------------------------------------------------------------------------- /assets/forallx-coverart-full.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 54 | 56 | 58 | 62 | 63 | 65 | 69 | 70 | 72 | 76 | 77 | 79 | 83 | 84 | 85 | 90 | 95 | 96 | 101 | 106 | 111 | 116 | 121 | 122 | 127 | 132 | 133 | 138 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /assets/forallx-coverart-screen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/forallx-coverart-screen.pdf -------------------------------------------------------------------------------- /assets/forallx-coverart-screen.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | forall x cover art 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | forall x cover art 28 | 29 | 30 | Mark Lyall 31 | 32 | 33 | 34 | 35 | 36 | 61 | 63 | 65 | 69 | 70 | 72 | 76 | 77 | 79 | 83 | 84 | 86 | 90 | 91 | 92 | 97 | 102 | 103 | 108 | 113 | 118 | 123 | 128 | 129 | 134 | 139 | 140 | 145 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /assets/remix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/remix.pdf -------------------------------------------------------------------------------- /assets/sa.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/sa.pdf -------------------------------------------------------------------------------- /assets/ti-color.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/ti-color.pdf -------------------------------------------------------------------------------- /assets/ti-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzach/forallx-yyc/be6fcc0eac1c5ef58e37bb574ff980a7ccb00ae7/assets/ti-color.png -------------------------------------------------------------------------------- /fitch.sty: -------------------------------------------------------------------------------- 1 | %% fitch.sty 2 | %% Macros for Fitch-style natural deduction 3 | %% Copyright 2002-2023 Peter Selinger 4 | % 5 | % This work may be distributed and/or modified under the 6 | % conditions of the LaTeX Project Public License, either version 1.3 7 | % of this license or (at your option) any later version. 8 | % The latest version of this license is in 9 | % https://www.latex-project.org/lppl.txt 10 | % and version 1.3c or later is part of all distributions of LaTeX 11 | % version 2008 or later. 12 | % 13 | % This work has the LPPL maintenance status `maintained'. 14 | % 15 | % The Current Maintainer of this work is Richard Zach 16 | % 17 | % This work consists of the files fitch.sty and fitchdoc.tex. 18 | 19 | % Original Author: Peter Selinger, Dalhousie University 20 | % Created: Jan 14, 2002 21 | % Modified: December 17, 2023 22 | % Version: 1.0 23 | % Copyright: (C) 2002-2005 Peter Selinger, Richard Zach 24 | % Filename: fitch.sty 25 | % Documentation: fitchdoc.tex 26 | % https://github.com/OpenLogicProject/fitch/ 27 | 28 | % USAGE EXAMPLE: 29 | % 30 | % The following is a simple example illustrating the usage of this 31 | % package. For detailed instructions and additional functionality, see 32 | % the user guide, which can be found in the file fitchdoc.tex. 33 | % 34 | % \[ 35 | % \begin{nd} 36 | % \hypo{1} {P\vee Q} 37 | % \hypo{2} {\neg Q} 38 | % \open 39 | % \hypo{3a} {P} 40 | % \have{3b} {P} \r{3a} 41 | % \close 42 | % \open 43 | % \hypo{4a} {Q} 44 | % \have{4b} {\neg Q} \r{2} 45 | % \have{4c} {\bot} \ne{4a,4b} 46 | % \have{4d} {P} \be{4c} 47 | % \close 48 | % \have{5} {P} \oe{1,3a-3b,4a-4d} 49 | % \end{nd} 50 | % \] 51 | 52 | \NeedsTeXFormat{LaTeX2e} 53 | \ProvidesPackage{fitch}[2023-12-17 v1.0 Macros for Fitch-style natural deduction] 54 | 55 | % Define keyval options 56 | 57 | \RequirePackage{kvoptions} 58 | 59 | \SetupKeyvalOptions{ 60 | family = fitch, 61 | prefix = nd@ % prefix with nd@ for compatibility with old code 62 | } 63 | 64 | \DeclareStringOption[ndrules]{rules} 65 | \DeclareStringOption[array]{arrayenv} 66 | \DeclareStringOption[ndjustformat]{justformat} 67 | \DeclareStringOption[ndrefformat]{refformat} 68 | 69 | \DeclareStringOption[4.5ex]{height}[4.5ex] 70 | \DeclareStringOption[3.5ex]{topheight}[3.5ex] 71 | \DeclareStringOption[1.5ex]{depth}[1.5ex] 72 | \DeclareStringOption[1em]{labelsep}[1em] 73 | \DeclareStringOption[1.6em]{indent}[1.6em] 74 | \DeclareStringOption[1.5ex]{hsep}[1.5ex] 75 | \DeclareStringOption[2.5em]{justsep}[2.5em] 76 | \DeclareStringOption[.2mm]{linethickness}[.2mm] 77 | \DeclareStringOption[1em]{cindent}[1em] 78 | \DeclareBoolOption[true]{outerline} 79 | 80 | % user command to redefine dimensions 81 | \def\nddim#1#2#3#4#5#6#7#8{ 82 | \setkeys{fitch}{ 83 | height=#1, 84 | topheight=#2, 85 | depth=#3, 86 | labelsep=#4, 87 | indent=#5, 88 | hsep=#6, 89 | justsep=#7, 90 | linethickness=#8 91 | } 92 | } 93 | 94 | \DeclareLocalOptions{ 95 | rules, 96 | arrayenv, 97 | justformat, 98 | refformat, 99 | height, 100 | topheight, 101 | depth, 102 | labelsep, 103 | indent, 104 | hsep, 105 | justsep, 106 | linethickness, 107 | cindent, 108 | outerline 109 | } 110 | 111 | \ProcessLocalKeyvalOptions{fitch} 112 | 113 | % Actual fitch.sty code 114 | 115 | \newlength{\nd@dim} 116 | 117 | % References 118 | 119 | \newcount\nd@ctr 120 | \def\nd@render{\expandafter\ifx\expandafter\nd@x\nd@base\nd@x\the\nd@ctr\else\nd@base\ifnum\nd@ctr<0\the\nd@ctr\else\ifnum\nd@ctr>0+\the\nd@ctr\fi\fi\fi} 121 | \expandafter\def\csname nd@-\endcsname{} 122 | 123 | \def\nd@num#1{\nd@numo{\nd@render}{#1}\global\advance\nd@ctr1} 124 | \def\nd@numopt#1#2{\nd@numo{$#1$}{#2}} 125 | \def\nd@numo#1#2{\edef\x{#1}\mbox{$\x$}\expandafter\global\expandafter\let\csname nd@-#2\endcsname\x} 126 | \def\nd@ref#1{\expandafter\let\expandafter\x\csname nd@-#1\endcsname\ifx\x\relax% 127 | \PackageWarning{fitch}{Undefined line reference: #1}\mbox{\textbf{??}}\else\csname\nd@refformat\endcsname{\mbox{$\x$}}\fi} 128 | \def\nd@noop{} 129 | \def\nd@set#1#2{\ifx\relax#1\nd@noop\else\global\def\nd@base{#1}\fi\ifx\relax#2\relax\else\global\nd@ctr=#2\fi} 130 | \def\nd@reset{\nd@set{}{1}} 131 | \def\nd@refa#1{\nd@ref{#1}} 132 | \def\nd@aux#1#2{\ifx#2-\nd@refa{#1}--\def\nd@c{\nd@aux{}}% 133 | \else\ifx#2,\nd@refa{#1}, \def\nd@c{\nd@aux{}}% 134 | \else\ifx#2;\nd@refa{#1}; \def\nd@c{\nd@aux{}}% 135 | \else\ifx#2.\nd@refa{#1}. \def\nd@c{\nd@aux{}}% 136 | \else\ifx#2)\nd@refa{#1})\def\nd@c{\nd@aux{}}% 137 | \else\ifx#2(\nd@refa{#1}(\def\nd@c{\nd@aux{}}% 138 | \else\ifx#2\nd@end\nd@refa{#1}\def\nd@c{}% 139 | \else\def\nd@c{\nd@aux{#1#2}}% 140 | \fi\fi\fi\fi\fi\fi\fi\nd@c} 141 | \def\ndref#1{\nd@aux{}#1\nd@end} 142 | 143 | % Layer A 144 | 145 | % set initial dimensions 146 | %\nddim{4.5ex}{3.5ex}{1.5ex}{1em}{1.6em}{.5em}{2.5em}{.2mm} 147 | 148 | \def\nd@v{\rule[-\nd@depth]{\nd@linethickness}{\nd@height}} 149 | \def\nd@h{\rule[-\nd@depth]{0mm}{\nd@height}} % strut 150 | \def\nd@t{\rule[-\nd@depth]{\nd@linethickness}{\nd@topheight}} 151 | \def\nd@i{\hspace{\nd@indent}} 152 | \def\nd@s{\hspace{\nd@hsep}} 153 | \def\nd@g#1{\nd@f{\makebox[\nd@indent][c]{$#1$}}} 154 | \def\nd@f#1{\raisebox{0pt}[0pt][0pt]{$#1$}} 155 | \def\nd@u#1{\makebox[0pt][l]{\settowidth{\nd@dim}{\nd@f{#1}}% 156 | \addtolength{\nd@dim}{\nd@hsep}\addtolength{\nd@dim}{\nd@hsep}% 157 | \hspace{-\nd@hsep}\rule[-\nd@depth]{\nd@dim}{\nd@linethickness}}\nd@f{#1}} 158 | 159 | % Lists 160 | 161 | \def\nd@push#1#2{\expandafter\gdef\expandafter#1\expandafter% 162 | {\expandafter\nd@cons\expandafter{#1}{#2}}} 163 | \def\nd@pop#1{{\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 164 | {\gdef#1{##1}}#1}} 165 | \def\nd@iter#1#2{{\def\nd@nil{}\def\nd@cons##1##2{##1#2{##2}}#1}} 166 | \def\nd@modify#1#2#3{{\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 167 | {\advance#2-1 ##1\advance#2 1 \ifnum#2=1\nd@push#1{#3}\else% 168 | \nd@push#1{##2}\fi}#1}} 169 | 170 | \def\nd@cont#1{{\def\nd@t{\nd@v}\def\nd@v{\nd@v}\def\nd@g##1{\nd@i}% 171 | \def\nd@i{\nd@i}\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 172 | {##1\expandafter\nd@push\expandafter#1\expandafter{##2}}#1}} 173 | 174 | % Layer B 175 | 176 | \newcount\nd@n 177 | \def\nd@beginb{% 178 | \begingroup 179 | \nd@reset 180 | \gdef\nd@stack{\nd@nil}% 181 | \nd@push\nd@stack{\nd@h}% 182 | \ifnd@outerline 183 | \nd@push\nd@stack{\nd@t}\fi 184 | \begin{\nd@arrayenv}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 185 | \def\nd@resumeb{% 186 | \begingroup 187 | \begin{\nd@arrayenv}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 188 | \def\nd@endb{\end{\nd@arrayenv}\endgroup} 189 | \def\nd@hypob#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{#2}&} 190 | \def\nd@haveb#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{#2}&} 191 | \def\nd@havecontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{\hspace{\nd@cindent}#2}&} 192 | \def\nd@hypocontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{\hspace{\nd@cindent}#2}&} 193 | 194 | \def\nd@openb{\nd@push\nd@stack{\nd@i}\nd@push\nd@stack{\nd@t}} 195 | \def\nd@closeb{\nd@pop\nd@stack\nd@pop\nd@stack} 196 | \def\nd@guardb#1#2{\nd@n=#1\multiply\nd@n by 2 \nd@modify\nd@stack\nd@n{\nd@g{#2}}} 197 | 198 | % Layer C 199 | 200 | \def\nd@clr{\gdef\nd@cmd{}\gdef\nd@typ{\relax}} 201 | \def\nd@sto#1#2#3{\gdef\nd@typ{#1}\gdef\nd@byt{}% 202 | \gdef\nd@cmd{\nd@typ{#2}{#3}\nd@byt\\}} 203 | \def\nd@chtyp{\expandafter\ifx\nd@typ\nd@hypocontb\def\nd@typ{\nd@havecontb}\else\def\nd@typ{\nd@haveb}\fi} 204 | \def\nd@hypoc#1#2{\nd@chtyp\nd@cmd\nd@sto{\nd@hypob}{#1}{#2}} 205 | \def\nd@havec#1#2{\nd@cmd\nd@sto{\nd@haveb}{#1}{#2}} 206 | \def\nd@hypocontc#1{\nd@chtyp\nd@cmd\nd@sto{\nd@hypocontb}{}{#1}} 207 | \def\nd@havecontc#1{\nd@cmd\nd@sto{\nd@havecontb}{}{#1}} 208 | \def\nd@by#1#2{\ifx\nd@x#2\nd@x\gdef\nd@byt{\mbox{#1}}\else\ifx\nd@x#1\nd@x\gdef\nd@byt{\mbox{\ndref{#2}}}\else\gdef\nd@byt{\mbox{\csname\nd@justformat\endcsname{#1}{\ndref{#2}}}}\fi\fi\ignorespaces} 209 | 210 | % multi-line macros 211 | \def\nd@mhypoc#1#2{\nd@mhypocA{#1}#2\\\nd@stop\\} 212 | \def\nd@mhypocA#1#2\\{\nd@hypoc{#1}{#2}\nd@mhypocB} 213 | \def\nd@mhypocB#1\\{\ifx\nd@stop#1\else\nd@hypocontc{#1}\expandafter\nd@mhypocB\fi} 214 | \def\nd@mhavec#1#2{\nd@mhavecA{#1}#2\\\nd@stop\\} 215 | \def\nd@mhavecA#1#2\\{\nd@havec{#1}{#2}\nd@mhavecB} 216 | \def\nd@mhavecB#1\\{\ifx\nd@stop#1\else\nd@havecontc{#1}\expandafter\nd@mhavecB\fi} 217 | \def\nd@mhypocontc#1{\nd@mhypocB#1\\\nd@stop\\} 218 | \def\nd@mhavecontc#1{\nd@mhavecB#1\\\nd@stop\\} 219 | 220 | \def\nd@beginc{\nd@beginb\nd@clr} 221 | \def\nd@resumec{\nd@resumeb\nd@clr} 222 | \def\nd@endc{\nd@cmd\nd@endb} 223 | \def\nd@openc{\nd@cmd\nd@clr\nd@openb} 224 | \def\nd@closec{\nd@cmd\nd@clr\nd@closeb} 225 | \let\nd@guardc\nd@guardb 226 | 227 | % Layer D 228 | 229 | % macros with optional arguments spelled-out 230 | \def\nd@hypod[#1][#2]#3[#4]#5{\ifx\relax#4\relax\else\nd@guardb{1}{#4}\fi\nd@mhypoc{#3}{#5}\nd@set{#1}{#2}\ignorespaces} 231 | \def\nd@haved[#1][#2]#3[#4]#5{\ifx\relax#4\relax\else\nd@guardb{1}{#4}\fi\nd@mhavec{#3}{#5}\nd@set{#1}{#2}\ignorespaces} 232 | \def\nd@havecont#1{\nd@mhavecontc{#1}} 233 | \def\nd@hypocont#1{\nd@mhypocontc{#1}} 234 | \def\nd@base{undefined} 235 | \def\nd@opend[#1]#2{\nd@cmd\nd@clr\nd@openb\nd@guard{#1}#2} 236 | \def\nd@close{\nd@cmd\nd@clr\nd@closeb} 237 | \def\nd@guardd[#1]#2{\nd@guardb{#1}{#2}} 238 | 239 | % Handling of optional arguments. 240 | 241 | \def\nd@optarg#1#2#3{\ifx[#3\def\nd@c{#2#3}\else\def\nd@c{#2[#1]{#3}}\fi\nd@c} 242 | \def\nd@optargg#1#2#3{\ifx[#3\def\nd@c{#1#3}\else\def\nd@c{#2{#3}}\fi\nd@c} 243 | 244 | \def\nd@five#1{\nd@optargg{\nd@four{#1}}{\nd@two{#1}}} 245 | \def\nd@four#1[#2]{\nd@optarg{0}{\nd@three{#1}[#2]}} 246 | \def\nd@three#1[#2][#3]#4{\nd@optarg{}{#1[#2][#3]{#4}}} 247 | \def\nd@two#1{\nd@three{#1}[\relax][]} 248 | 249 | \def\nd@have{\nd@five{\nd@haved}} 250 | \def\nd@hypo{\nd@five{\nd@hypod}} 251 | \def\nd@open{\nd@optarg{}{\nd@opend}} 252 | \def\nd@guard{\nd@optarg{1}{\nd@guardd}} 253 | 254 | \def\nd@init{% 255 | \let\open\nd@open% 256 | \let\close\nd@close% 257 | \let\hypo\nd@hypo% 258 | \let\have\nd@have% 259 | \let\hypocont\nd@hypocont% 260 | \let\havecont\nd@havecont% 261 | \let\by\nd@by% 262 | \let\guard\nd@guard% 263 | \csname\nd@rules\endcsname 264 | } 265 | 266 | % Define default rule names 267 | 268 | \def\ndrules{% 269 | \def\ii{\by{$\Rightarrow$I}}% 270 | \def\ie{\by{$\Rightarrow$E}}% 271 | \def\Ai{\by{$\forall$I}}% 272 | \def\Ae{\by{$\forall$E}}% 273 | \def\Ei{\by{$\exists$I}}% 274 | \def\Ee{\by{$\exists$E}}% 275 | \def\ai{\by{$\wedge$I}}% 276 | \def\ae{\by{$\wedge$E}}% 277 | \def\ai{\by{$\wedge$I}}% 278 | \def\ae{\by{$\wedge$E}}% 279 | \def\oi{\by{$\vee$I}}% 280 | \def\oe{\by{$\vee$E}}% 281 | \def\ni{\by{$\neg$I}}% 282 | \def\ne{\by{$\neg$E}}% 283 | \def\be{\by{$\bot$E}}% 284 | \def\nne{\by{$\neg\neg$E}}% 285 | \def\r{\by{R}}} 286 | 287 | % default justification format 288 | 289 | \newcommand{\ndjustformat}[2]{#1, #2} 290 | 291 | % default line number format 292 | 293 | \newcommand{\ndrefformat}[1]{#1} 294 | 295 | % User-level commands for proofs 296 | 297 | \newenvironment{nd}[1][] 298 | {\begingroup 299 | \setkeys{fitch}{#1}% 300 | \nd@init\nd@beginc\ignorespaces} 301 | {\nd@endc\endgroup} 302 | \newenvironment{ndresume}[1][] 303 | {\begingroup 304 | \setkeys{fitch}{#1}% 305 | \nd@init\nd@resumec\ignorespaces} 306 | {\nd@endc\endgroup} 307 | \newenvironment{fitchproof}[1][] 308 | {\begin{list}{}{\setlength{\leftmargin}{0pt}}\item\begin{nd}[#1]} 309 | {\end{nd}\end{list}} 310 | \newenvironment{fitchproof*}[1][] 311 | {\begin{list}{}{\setlength{\leftmargin}{0pt}}\item\begin{ndresume}[#1]} 312 | {\end{ndresume}\end{list}} 313 | 314 | % End of file fitch.sty 315 | 316 | -------------------------------------------------------------------------------- /fitchml.css: -------------------------------------------------------------------------------- 1 | /* fitchml.css -- style sheet to format fitch tables produced by fitchml 2 | must be loaded when running LaTeXML */ 3 | 4 | .fml-sr-only, thead.fml-sr-only th, thead.fml-sr-only div, .fml-subproof div, .fml-subproof td, .fml-subproof th { 5 | height: 0px; 6 | width: 0px; 7 | overflow: hidden; 8 | padding: 0 !important; 9 | } 10 | 11 | table.fitch td, table.fitch th, table.fitch tr { 12 | padding: 0 !important; 13 | border: none !important; 14 | } 15 | 16 | th.fml-pline, td.fml-pline { 17 | width: 10%; 18 | padding-right: 1ex; 19 | text-align: right; 20 | } 21 | 22 | td.fml-pline, th.fml-pline { 23 | width: 10%; 24 | text-align: right; 25 | font-weight: normal !important; 26 | } 27 | 28 | td.fml-fmla, th.fml-fmla { 29 | width: 45%; 30 | text-align: left; 31 | } 32 | 33 | table.fitch td.fml-just, table.fitch th.fml-just { 34 | width: 45%; 35 | text-align: left; 36 | padding-left: 1em !important; 37 | white-space: nowrap; 38 | vertical-align: baseline; 39 | } 40 | 41 | div.fml-fmla { 42 | display: inline-block; 43 | overflow: visible; 44 | padding-left: 1ex; 45 | padding-right: 1ex; 46 | } 47 | div.fml-as { 48 | display: inline-block; 49 | overflow: visible; 50 | border-bottom: 1pt solid; 51 | padding-left: 1ex; 52 | padding-right: 1ex; 53 | } 54 | div.fml-just { 55 | display: inline-block; 56 | max-width: 100%; 57 | overflow: visible; 58 | } 59 | div.fml-scope { 60 | display: inline; 61 | height: 100%; 62 | border-right: 1pt solid; 63 | margin-left: 1em; 64 | padding-top: 1ex ; 65 | padding-right: 0; 66 | padding-bottom: 0; 67 | padding-top: 2ex 68 | } 69 | div.fml-scope-start { 70 | display: inline; 71 | height: 100%; 72 | border-right: 1pt solid; 73 | margin-left: 1em; 74 | padding-right: 0; 75 | padding-bottom: 1ex; 76 | margin-top: .5ex; 77 | padding-top: 0; 78 | } 79 | div.fml-scope-end { 80 | display: inline; 81 | height: 100%; 82 | border-right: 1pt solid; 83 | margin-left: 1em; 84 | padding-right: 0; 85 | padding-top: .5ex; 86 | padding-bottom: .5ex; 87 | margin-bottom: .5ex; 88 | } -------------------------------------------------------------------------------- /fitchml.sty: -------------------------------------------------------------------------------- 1 | % fitchml.sty -- patch fitch.sty for better HTML output with LaTeXML 2 | 3 | \ProvidesPackage{fitchml} 4 | 5 | % all of this only makes sense if we're compiling to HTML 6 | \iflatexml\else\endinput\fi 7 | 8 | \RequirePackage{fitch} 9 | 10 | \renewenvironment{fitchproof} 11 | {\noindent\par\noindent\begin{nd}} 12 | {\end{nd}\par\noindent\ignorespacesafterend} 13 | 14 | % A counter to keep track of subproof levels 15 | \newcounter{nd@scope} 16 | % toggles used to insert "open subproof" and "close subproof" 17 | \newif\iffmlOpen 18 | \fmlOpenfalse 19 | \newif\iffmlClose 20 | \fmlClosefalse 21 | 22 | \def\nd@openb{\nd@push\nd@stack{\nd@i}\nd@push\nd@stack{\nd@t}\stepcounter{nd@scope}\fmlOpentrue} 23 | \def\nd@closeb{\nd@pop\nd@stack\nd@pop\nd@stack\addtocounter{nd@scope}{-1}\fmlClosetrue} 24 | 25 | \def\nd@starttable{% 26 | \ 27 | % Make an invisible table header 28 | \ 29 | \% 30 | \% 33 | \% 36 | \% 39 | \% 42 | \% 43 | \} 44 | \def\nd@pline#1{\} 45 | \def\nd@scope{% 46 | \} 57 | % cant get this to work 58 | \def\nd@just#1{% 59 | \} 62 | 63 | \def\PR{\by{\PR\}{}} 64 | \def\AS{\by{\AS\}{}} 65 | 66 | \def\nd@h{} 67 | % \def\nd@beginb{\begingroup\nd@reset\gdef\nd@stack{\nd@nil}\nd@push\nd@stack{\nd@t}% 68 | % \begin{array}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 69 | \def\nd@beginb{\begingroup\nd@reset\gdef\nd@stack{\nd@nil}\nd@push\nd@stack{\nd@t}% 70 | \setcounter{nd@scope}{0} 71 | \nd@starttable} 72 | %\def\nd@resumeb{\begingroup\begin{array}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 73 | \def\nd@resumeb{\nd@starttable} 74 | %\def\nd@endb{\end{array}\endgroup} 75 | \def\nd@endb{\
% 31 | \
Line number\
% 32 | \
% 34 | \
Subproof level\
% 35 | \
% 37 | \
Formula\
% 38 | \
% 40 | \
Justification\
% 41 | \
\ensuremath{\nd@num{#1}}\\
\% 47 | \iffmlClose 48 | close subproof, 49 | \global\fmlClosefalse 50 | \fi 51 | \iffmlOpen 52 | open subproof, 53 | \global\fmlOpenfalse 54 | \fi 55 | \arabic{nd@scope}% 56 | \\
\
% 60 | \
\% 61 | #1\\
\
\endgroup} 76 | % \def\nd@hypob#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{#2}&} 77 | \def\nd@hypob#1#2{\\nd@pline{#1}\nd@scope\% 78 | \nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{#2}\} 79 | % \def\nd@hypob#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{#2}&} 80 | \def\nd@haveb#1#2{\\nd@pline{#1}\nd@scope\% 81 | \nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{#2}\} 82 | % line continuations not yet supported! 83 | % \def\nd@havecontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{\hspace{\ndindent}#2}&} 84 | % \def\nd@hypocontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{\hspace{\ndindent}#2}&} 85 | 86 | % \def\nd@sto#1#2#3{\gdef\nd@typ{#1}\gdef\nd@byt{}% 87 | % \gdef\nd@cmd{\nd@typ{#2}{#3}\nd@byt\\}} 88 | \def\nd@sto#1#2#3{\gdef\nd@typ{#1}\gdef\nd@byt{}% 89 | \gdef\nd@cmd{\nd@typ{#2}{#3}\nd@just{\nd@byt}\}} 90 | 91 | %\def\nd@v{\rule[-\nd@depthdim]{\nd@thickness}{\nd@height}} 92 | \def\nd@v{\
\
} 93 | % \def\nd@t{\rule[-\nd@depthdim]{0mm}{\nd@height}\rule[-\nd@depthdim]{\nd@thickness}{\nd@initheight}} 94 | \def\nd@t{\
\
} 95 | % \def\nd@i{\hspace{\nd@indent}} 96 | \def\nd@i{} 97 | % \def\nd@s{\hspace{\nd@hsep}} 98 | \def\nd@s{} 99 | % \def\nd@g#1{\nd@f{\makebox[\nd@indent][c]{$#1$}}} 100 | \def\nd@g#1{} % Guards not supported! 101 | % \def\nd@f#1{\raisebox{0pt}[0pt][0pt]{$#1$}} 102 | \def\nd@f#1{\
\\ensuremath{#1}\\
} % \raisebox{0pt}[0pt][0pt]{$#1$}} 103 | % \def\nd@u#1{\makebox[0pt][l]{\settowidth{\nd@dim}{\nd@f{#1}}% 104 | % \addtolength{\nd@dim}{2\nd@hsep}\hspace{-\nd@hsep}\rule[-\nd@depthdim]{\nd@dim}{\nd@thickness}}\nd@f{#1}} 105 | \def\nd@u#1{\
\\ensuremath{#1}\\
} 106 | 107 | % \def\nd@by#1#2{\ifx\nd@x#2\nd@x\gdef\nd@byt{\mbox{#1}}\else\gdef\nd@byt{\mbox{#1, \ndref{#2}}}\fi} 108 | \def\nd@by#1#2{\ifx\nd@x#2\nd@x\gdef\nd@byt{#1}\else\gdef\nd@byt{#1 \ndref{#2}}\fi} -------------------------------------------------------------------------------- /forallx-yyc-accessibility.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | \chapter{Notes on accessibility} 4 | 5 | Special attention has been paid to make this HTML version as 6 | accessible as possible, especially to readers using Assistive 7 | Technology (AT), such as screen readers like 8 | \href{https://www.nvaccess.org/download/}{NVDA} 9 | and 10 | \href{https://www.freedomscientific.com/products/software/jaws/}{JAWS}. 11 | Screen readers are software designed to enable users with low or no 12 | vision to access and navigate web pages like this book. Some sighted 13 | users also sometimes prefer text-to-speech (TTS) software to read web 14 | pages aloud. TTS software has fewer features than screen readers 15 | designed for non-sighted users and may not convert everything in this 16 | book to audio. 17 | 18 | If you are using the HTML version of this book with a screen reader or 19 | Braille terminal, or are helping a student who relies on such tools 20 | (e.g., as instructor or accessibility advisor), and you have feedback 21 | please \href{mailto:rzach@ucalgary.ca}{get in touch}! 22 | 23 | \paragraph{Navigation and styles} We have adopted the HTML style 24 | provided by \href{https://vlmantova.github.io/bookml/}{BookML}, 25 | developed for the Leeds mathematics department by 26 | \href{https://eps.leeds.ac.uk/maths/staff/4058/dr-vincenzo-l-mantova}{Vincenzo 27 | Mantova}. It provides a collapsible navigation menu, buttons at the 28 | top of each page to select the font size, switch between serif and 29 | sans-serif font, and black-on-white, dark-on-sepia, or light-on-dark 30 | display options. 31 | 32 | The body of the page starts with an invisible link to skip to the 33 | beginning of the content, past the navigation sidebar and style 34 | buttons. The buttons are, in order: 35 | \begin{itemize} 36 | \item ``toggle sidebar'' to turn the navigation bar on or off; 37 | \item ``font settings'' for font size, serif or sans serif font, and 38 | light, sepia, or dark modes; 39 | \item ``download'' for links to download the PDF versions; and 40 | \item ``information about the toolbar'' for a popup that shows 41 | keyboard shortcuts for navigation. 42 | \end{itemize} 43 | Those keyboard shortcuts are: left and right arrow for moving to the 44 | previous and the next page, and `s' to toggle the navigation sidebar. 45 | 46 | \paragraph{Symbols and formulas} 47 | 48 | Logical symbols and formulas in this book are converted to 49 | \href{https://www.w3.org/Math/}{MathML} and displayed using 50 | \href{https://www.mathjax.org/}{MathJax}. MathJax provides additional 51 | \href{https://docs.mathjax.org/en/latest/basic/accessibility.html}{accessibility 52 | features} for formulas, which are found in the MathJax context menu. 53 | With a mouse, you can right click on any formula to activate it. 54 | Screen readers will announce that formulas can be activated (e.g., 55 | NVDA says ``application clickable'' before every formula to indicate 56 | the presence of the MathJax menu.) If your screen reader does not read 57 | out formulas such as $\forall x(A(x) \land B(x))$ you may need to 58 | activate Speech Output in the Speech submenu of the MathJax 59 | Accessibility menu and reload the page. 60 | 61 | Here are some of the more common symbols. Different screen readers and 62 | TTS applications will pronouce them differently, and sometimes not at 63 | all. After each symbol, we provide the customary pronounciation used 64 | by logicians. 65 | \begin{itemize} 66 | \item Uppercase and lowercase italic letters like $A$ (``upper A'') 67 | and $x$ (``lower x'') 68 | \item Uppercase and lowercase script letters like $\metav{A}$ 69 | (``script upper A'') and $\metav{x}$ (``script lower x'') 70 | \item Logical connectives: $\enot$ (``not''), $\eor$ (``or''), 71 | $\eand$ (``and''), $\eif$ (``only if''), $\eiff$ (``if and only if''), $\ered$ (``contradiction'') 72 | \item Quantifiers: $\forall$ (``for all''), $\exists$ (``there exists'') 73 | \item Metatheoretical symbols: $\therefore$ (``therefore''), 74 | $\proves$ (``proves''), $\nproves$ (``does not prove''), $\entails$ (``entails''), $\nentails$ (``does not entail'') 75 | \item Modal operators: $\ebox$ (``box''), $\ediamond$ (``diamond'') 76 | \end{itemize} 77 | 78 | Subscripts should be pronounced by screen readers, although 79 | they may not indicate that they are subscripts. The formula $A_2$ may 80 | be read out as ``upper A sub 2'' or just as ``A2''. 81 | 82 | The expressions `\blank{}' and `\ifeff' (`if' with two `f's) are used 83 | throughout the textbook. In the HTML version, `\blank{}' includes an 84 | invisible spelled-out word `blank' which screen readers should read 85 | out loud. The abbreviation `\ifeff' is short for `if and only if'. In 86 | the HTML version it is coded using an invisible zero-space word joiner 87 | character which should make screen readers pronounce `\ifeff' as 88 | `if-eff' or `aye-eff-eff'. 89 | 90 | \paragraph{Proofs} The natural deduction proofs in 91 | \cref{ch.NDTFL,ch.NDFOL,ch.ML} use vertical lines to indicate where 92 | subproofs start and end. Such vertical lines extend from the 93 | assumption line of the subproof to its last line and are displayed 94 | between the line numbers and the formulas in any given line. This 95 | makes proofs a special challenge for users with low vision or complete 96 | loss of vision. 97 | 98 | To make these proofs accessible in this HTML version, proofs are coded 99 | as tables. Each table line has four columns: the line number, a 100 | subproof level indicator, a formula, and a justification. The subproof 101 | level indicator is a number recording how many nested subproofs the 102 | current line is contained in. It is 0 if the line is not contained in 103 | a subproof, 1 if it is in a subproof, 2 if it is in a subproof nested 104 | within another subproof, and so on. When reading out a subproof level 105 | indicator, screen readers should also announce if a subproof has just 106 | been closed on the previous line, and when a new subproof starts. The 107 | table header rows and subproof level indicators are hidden so that 108 | proofs visually appear as in the printed text. 109 | 110 | Here is an example of such a proof: 111 | \begin{fitchproof} 112 | \hypo{wxyz}{(W \eor X) \eor (Y \eor Z)}\PR 113 | \hypo{xy}{X \eif Y}\PR 114 | \hypo{nz}{\enot Z}\PR 115 | \open 116 | \hypo{wx}{W \eor X}\AS 117 | \open 118 | \hypo{w}{W}\AS 119 | \have{wy1}{W \eor Y}\oi{w} 120 | \close 121 | \open 122 | \hypo{x}{X}\AS 123 | \have{y1}{Y}\ce{xy, x} 124 | \have{wy2}{W \eor Y}\oi{y1} 125 | \close 126 | \have{wy3}{W \eor Y}\oe{wx, w-wy1, x-wy2} 127 | \close 128 | \open 129 | \hypo{yz}{Y \eor Z}\AS 130 | \have{y}{Y}\ds{yz, nz} 131 | \have{wy}{W \eor Y}\oi{y} 132 | \close 133 | \have{wy4}{W \eor Y}\oe{wxyz, wx-wy3, yz-wy} 134 | \end{fitchproof} 135 | It has 14 lines, with 3 premises, 2 levels of subproof nesting, and 136 | two pairs of adjacent subproofs. For instance, the subproof beginning 137 | on line 5 ends at line 6, and line 7 starts another subproof. So the 138 | subproof levels of lines 6 and 7 is the same, but lines 6 and 7 are in 139 | different subproofs. If you cannot see the subproof lines, you have to 140 | pay special attention to how the subproof level numbers change 141 | \emph{and} when a formula is an assumption. A screen reader should 142 | read line 7 approximately as: ``7, close subproof, 2, open subproof, 143 | upper X, AS.'' The abbreviations `\PR' (for `Premise') and `\AS' (for 144 | `Assumption') are coded in the HTML version using the `\verb|abbr|' 145 | tag. 146 | 147 | Note that simple text-to-speech applications may not read out complex 148 | tables such as the ones containing proofs or truth tables at all. 149 | 150 | \paragraph{Diagrams} 151 | 152 | The text also contains a few diagrams. In the HTML version, these are 153 | provided with image descriptions, e.g., 154 | \begin{center} 155 | \begin{tikzpicture} 156 | \node[circle, grey_shape] (cat1) {A}; 157 | \node[right=10pt of cat1, diamond, phantom_shape] (cat2) { } ; 158 | \node[right=10pt of cat2, circle, white_shape] (cat3) {C} ; 159 | \node[right=10pt of cat3, white_shape] (cat4) {D}; 160 | \end{tikzpicture} 161 | \bmlDescription{There are three shapes: the first shape is a grey 162 | circle labelled A, some empty space, the second shape is a white 163 | circle labelled C, and the fourth a white square labelled D.} 164 | \end{center} 165 | The image description here should read: ``There are three shapes: the 166 | first shape is a grey circle labelled A, some empty space, the second 167 | shape is a white circle labelled C, and the fourth a white square 168 | labelled~D.'' 169 | 170 | \paragraph{Table of symbols} 171 | 172 | What follows is a table of all the symbols used in the text, how they 173 | are most likely to be pronounced by screen readers, and what they are 174 | called in the text. In the rightmost column we provide a suggested way 175 | to enter them using ASCII characters, if inserting special symbols (in 176 | a homework assignment or email to your instructor, say) is not an 177 | option. 178 | 179 | \begin{tabular}{lllll} 180 | \lxBeginTableHead{}Symbol\lxTableColumnHead{} & Pronounciation\lxTableColumnHead{} & Meaning\lxTableColumnHead{} & ASCII equivalent\lxTableColumnHead{}\\ 181 | \hline\lxEndTableHead 182 | $\enot$ & not sign & logical not & \verb+~+ or \verb+-+\\ 183 | $\eor$ & or & logical or & \verb+\/+\\ 184 | $\eand$ & and & logical and & \verb+/\+ or \verb+&+\\ 185 | $\eif$ & right arrow & conditional & \verb+->+ or \verb+>+\\ 186 | $\eiff$ & left right arrow & biconditional & \verb+<->+ or \verb+<>+\\ 187 | $\ered$ & up tack & contradiction & \verb+_|_+ or \verb+!?+\\ 188 | $\forall$ & for all & universal quantifier & \verb|A| or \verb|@|\\ 189 | $\exists$ & there exists & existential quantifier & \verb|E| or \verb|3|\\ 190 | $\therefore$ & therefore & therefore & \verb|:.|\\ 191 | $\proves$ & right tack & proves & \verb+|-+\\ 192 | $\nproves$ & does not prove & does not prove & \verb+|/-+\\ 193 | $\entails$ & true & entails & \verb+|=+\\ 194 | $\nentails$ & not true & does not entail & \verb+|/=+\\ 195 | $\ebox$ & white square & necessary & \verb+[]+\\ 196 | $\ediamond$ & white diamond & possible & \verb+<>+ 197 | \end{tabular} 198 | 199 | Subscripts can be represented by an underline, e.g., $A_2$ as 200 | \verb|A_2|. 201 | -------------------------------------------------------------------------------- /forallx-yyc-alternatives.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | \chapter{Alternative proof systems} 4 | In formulating our natural deduction system, we treated certain rules of natural deduction as \emph{basic}, and others as \emph{derived}. However, we could equally well have taken various different rules as basic or derived. We will illustrate this point by considering some alternative treatments of disjunction, negation, and the quantifiers. We will also explain why we have made the choices that we have. 5 | 6 | 7 | \section{Alternative disjunction elimination} 8 | Some systems take DS as their basic rule for disjunction elimination. Such systems can then treat the $\eor$E rule as a derived rule. For they might offer the following proof scheme: 9 | \begin{fitchproof} 10 | \have[m]{ab}{\metav{A}\eor\metav{B}} 11 | \open 12 | \hypo[i]{a}{\metav{A}} \AS 13 | \have[j]{c1}{\metav{C}} 14 | \close 15 | \open 16 | \hypo[k]{b}{\metav{B}} \AS 17 | \have[l]{c2}{\metav{C}} 18 | \close 19 | \have[n]{aic}{\metav{A} \eif \metav{C}}\ci{a-c1} 20 | \have{bic}{\metav{B} \eif \metav{C}}\ci{b-c2} 21 | \open 22 | \hypo{nc}{\enot\metav{C}} \AS 23 | \open 24 | \hypo{a2}{\metav{A}} \AS 25 | \have{c3}{\metav{C}}\ce{a2,aic} 26 | \have{bot1}{\ered}\ne{nc,c3} 27 | \close 28 | \have{na}{\enot\metav{A}}\ni{a2-bot1} 29 | \have{b2}{\metav{B}}\ds{ab,na} 30 | \have{c4}{\metav{C}}\ce{b2,bic} 31 | \have{bot2}{\ered}\ne{nc,c4} 32 | \close 33 | \have{con}{\metav{C}}\ip{nc-bot2} 34 | \end{fitchproof} 35 | So why did we choose to take $\eor$E as basic, rather than DS?\footnote{P.~D.\ Magnus's original version of this book went the other way.} Our reasoning is that DS involves the use of `$\enot$' in the statement of the rule. It is in some sense `cleaner' for our disjunction elimination rule to avoid mentioning \emph{other} connectives. 36 | 37 | 38 | \section{Alternative negation rules} 39 | Some systems take the following rule as their basic negation introduction rule: 40 | \begin{fitchproof} 41 | \open 42 | \hypo[m]{a}{\metav{A}}\AS 43 | \have[n-1]{b}{\metav{B}} 44 | \have[n]{nb}{\enot\metav{B}} 45 | \close 46 | \have[\ ]{}{\enot\metav{A}}\by{$\enot$I*}{a-nb} 47 | \end{fitchproof} 48 | and a corresponding version of the rule we called IP as their basic negation elimination rule: 49 | \begin{fitchproof} 50 | \open 51 | \hypo[m]{na}{\enot\metav{A}} \AS 52 | \have[n][-1]{b}{\metav{B}} 53 | \have{nb}{\enot\metav{B}} 54 | \close 55 | \have[\ ]{a}{\metav{A}}\by{$\enot$E*}{na-nb} 56 | \end{fitchproof} 57 | Using these two rules, we could we could have avoided all use of the symbol `$\ered$' altogether.\footnote{Again, P.~D.\ Magnus's original version of this book went the other way.} The resulting system would have had fewer rules than ours. 58 | 59 | Another way to deal with negation is to use either LEM or DNE as a basic rule and introduce IP as a derived rule. Typically, in such a system the rules are given different names, too. E.g., sometimes what we call $\enot$E is called $\ered$I, and what we call X is called $\ered$E.\footnote{The version of this book due to Tim Button goes this route and replaces IP with LEM, which he calls TND, for ``tertium non datur.''} 60 | 61 | So why did we chose our rules for negation and contradiction? 62 | 63 | Our first reason is that adding the symbol `$\ered$' to our natural deduction system makes proofs considerably easier to work with. For instance, in our system it's always clear what the conclusion of a subproof is: the sentence on the last line, e.g.,\ $\ered$ in IP or $\enot$I. In $\enot$I* and $\enot$E*, subproofs have two conclusions, so you can't check at one glance if an application of them is correct. 64 | 65 | Our second reason is that a lot of fascinating philosophical discussion has focussed on the acceptability or otherwise of indirect proof IP (equivalently, excluded middle, i.e.,\ LEM, or double negation elimination DNE) and explosion (i.e.,\ X). By treating these as separate rules in the proof system, you will be in a better position to engage with that philosophical discussion. In particular: having invoked these rules explicitly, it would be much easier for us to know what a system which lacked these rules would look like. 66 | 67 | This discussion, and in fact the vast majority of mathematical study on applications of natural deduction proofs beyond introductory courses, makes reference to a different version of natural deduction. This version was invented by Gerhard Gentzen in 1935 as refined by Dag Prawitz in 1965. Our set of basic rules coincides with theirs. In other words, the rules we use are those that are standard in philosophical and mathematical discussion of natural deduction proofs outside of introductory courses. 68 | 69 | 70 | 71 | \section{Alternative quantification rules} 72 | An alternative approach to the quantifiers is to take as basic the rules for $\forall$I and $\forall$E from \cref{s:BasicFOL}, and also two CQ rules which allow us to move from $\forall \metav{x}\, \enot \metav{A}$ to $\enot \exists \metav{x}\, \metav{A}$ and vice versa.\footnote{Warren Goldfarb follows this line in \textit{Deductive Logic}, 2003, Hackett Publishing Co.} 73 | 74 | Taking only these rules as basic, we could have derived the $\exists$I and $\exists$E rules provided in \cref{s:BasicFOL}. To derive the $\exists$I rule is fairly simple. Suppose $\metav{A}$ contains the name $\metav{c}$, and contains no instances of the variable $\metav{x}$, and that we want to do the following: 75 | \begin{fitchproof} 76 | \have[m]{a}{\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)} 77 | \have[k]{c}{\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{c}\ldots)} 78 | \end{fitchproof} 79 | This is not yet permitted, since in this new system, we do not have the $\exists$I rule. We can, however, offer the following: 80 | \begin{fitchproof} 81 | \have[m]{a}{\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)} 82 | \open 83 | \hypo{nEna}{\enot \exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{c}\ldots)}\AS 84 | \have{Ana}{\forall \metav{x}\, \enot \metav{A}(\ldots \metav{x} \ldots \metav{c}\ldots)}\cq{nEna} 85 | \have{nAc}{\enot\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)}\Ae{Ana} 86 | \have{red}{\ered}\ne{nAc, a} 87 | \close 88 | \have{nnEa}{\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{c}\ldots)}\ip{nEna-red} 89 | \end{fitchproof}\noindent 90 | To derive the $\exists$E rule is rather more subtle. This is because the $\exists$E rule has an important constraint (as, indeed, does the $\forall$I rule), and we need to make sure that we are respecting it. So, suppose we are in a situation where we \emph{want} to do the following: 91 | \begin{fitchproof} 92 | \have[m]{ExA}{\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{x}\ldots)} 93 | \open 94 | \hypo[i]{Ac}{\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)}\AS 95 | \have[j]{B}{\metav{B}} 96 | \close 97 | \have[k]{end}{\metav{B}} 98 | \end{fitchproof}\noindent 99 | where $\metav{c}$ does not occur in any undischarged assumptions, or in $\metav{B}$, or in $\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{x}\ldots)$. Ordinarily, we would be allowed to use the $\exists$E rule; but we are not here assuming that we have access to this rule as a basic rule. Nevertheless, we could offer the following, more complicated derivation: 100 | 101 | \begin{fitchproof} 102 | \have[m]{ExA}{\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{x}\ldots)} 103 | \open 104 | \hypo[i]{Ac}{\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)}\AS 105 | \have[j]{B}{\metav{B}} 106 | \close 107 | \have[k]{condi}{\metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots) \eif \metav{B}}\ci{Ac-B} 108 | \open 109 | \hypo{nB}{\enot \metav{B}}\AS 110 | \have{nAc}{\enot \metav{A}(\ldots \metav{c} \ldots \metav{c}\ldots)}\mt{condi, nB} 111 | \have{AxnA}{\forall \metav{x} \enot \metav{A}(\ldots \metav{x} \ldots \metav{x}\ldots)}\Ai{nAc} 112 | \have{nEA}{\enot \exists \metav{x} \metav{A}(\ldots \metav{x} \ldots \metav{x}\ldots)}\cq{AxnA} 113 | \have{red2}{\ered}\ne{nEA, ExA} 114 | \close 115 | \have{nnB}{\metav{B}}\ip{nB-red2} 116 | \end{fitchproof}\noindent 117 | We are permitted to use $\forall$I on line $k+3$ because $\metav{c}$ does not occur in any undischarged assumptions or in $\metav{B}$. The entries on lines $k+4$ and $k+1$ contradict each other, because $\metav{c}$ does not occur in $\exists \metav{x}\, \metav{A}(\ldots \metav{x} \ldots \metav{x} \ldots)$. 118 | 119 | Armed with these derived rules, we could now go on to derive the two remaining CQ rules, exactly as in \cref{s:DerivedFOL}. 120 | 121 | So, why did we start with all of the quantifier rules as basic, and then derive the CQ rules? 122 | 123 | Our first reason is that it seems more intuitive to treat the quantifiers as on a par with one another, giving them their own basic rules for introduction and elimination. 124 | 125 | Our second reason relates to the discussion of alternative negation rules. In the derivations of the rules of $\exists$I and $\exists$E that we have offered in this section, we invoked~IP. But, as we mentioned earlier, IP is a contentious rule. So, if we want to move to a system which abandons IP, but which still allows us to use existential quantifiers, we will want to take the introduction and elimination rules for the quantifiers as basic, and take the CQ rules as derived. (Indeed, in a system without IP, LEM, and DNE, we will be \emph{unable} to derive the CQ rule which moves from $\enot \forall \metav{x}\, \metav{A}$ to $\exists \metav{x}\, \enot \metav{A}$.) 126 | -------------------------------------------------------------------------------- /forallx-yyc-backmatter.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | \clearpage 3 | \thispagestyle{plain} 4 | \onecolumn 5 | \ 6 | \vfill 7 | 8 | \parbox{3 in}{ 9 | In the Introduction to his volume \emph{Symbolic Logic}, Charles Lutwidge Dodgson advised: ``When you come to any passage you don't understand, \emph{read it again}: if you \emph{still} don't understand it, \emph{read it again}: if you fail, even after \emph{three} readings, very likely your brain is getting a little tired. In that case, put the book away, and take to other occupations, and next day, when you come to it fresh, you will very likely find that it is \emph{quite} easy.'' 10 | 11 | \medskip 12 | 13 | The same might be said for this volume, although readers are forgiven if they take a break for snacks after \emph{two} readings. 14 | } 15 | 16 | \vfill 17 | 18 | \parbox{3 in}{ 19 | %P.D.\ Magnus is an associate professor of philosophy in Albany, New York. His primary research is in the philosophy of science. 20 | 21 | %\ 22 | %\\Tim Button is a University Lecturer, and Fellow of St John's College, at the University of Cambridge. His first book, \emph{The Limits of Realism}, was published by Oxford University Press in 2013. 23 | } 24 | \vfill 25 | -------------------------------------------------------------------------------- /forallx-yyc-content.tex: -------------------------------------------------------------------------------- 1 | \frontmatter 2 | 3 | \ifHTMLtarget 4 | \tableofcontents 5 | \input{forallx-yyc-frontmatter} 6 | \else 7 | \input{forallx-yyc-frontmatter} 8 | \clearpage 9 | \pagestyle{leadbeater} 10 | \thispagestyle{plain} 11 | \currentpdfbookmark{Table of Contents}{name} 12 | \tableofcontents* 13 | \fi 14 | 15 | \input{forallx-yyc-preface} 16 | 17 | \mainmatter 18 | 19 | \input{forallx-yyc-what} 20 | \input{forallx-yyc-tfl} 21 | \input{forallx-yyc-truthtables} 22 | \input{forallx-yyc-prooftfl} 23 | \input{forallx-yyc-fol} 24 | \input{forallx-yyc-interpretations} 25 | \input{forallx-yyc-prooffol} 26 | \input{forallx-yyc-ml} 27 | \input{forallx-yyc-metatheory} 28 | 29 | \part*{Appendices} 30 | \addcontentsline{toc}{part}{Appendices} 31 | \addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par} 32 | \appendix 33 | 34 | \input{forallx-yyc-notation} % RZ for some reason, with an \input here the TOC gets messed up 35 | \input{forallx-yyc-alternatives} 36 | \input{forallx-yyc-quickreference} 37 | 38 | %\backmatter 39 | 40 | \ifHTMLtarget 41 | \input{forallx-yyc-accessibility} 42 | \fi 43 | 44 | \ifHTMLtarget\else 45 | \glsaddall 46 | \addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par} 47 | \printglossaries 48 | \input{forallx-yyc-backmatter} 49 | \fi 50 | -------------------------------------------------------------------------------- /forallx-yyc-frontmatter.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | \ifHTMLtarget\else 4 | % Bastard Title 5 | 6 | \pagestyle{empty} 7 | 8 | \vspace*{80pt} 9 | 10 | \begin{raggedleft} 11 | \fontsize{30pt}{24pt}\sffamily 12 | \selectfont 13 | \textbf{forall 14 | {\fontsize{37pt}{24pt}\selectfont\rmfamily\textit{x}}: 15 | Calgary} 16 | 17 | \medskip\fontsize{18pt}{20pt}\selectfont 18 | 19 | \textbf{An Introduction to\\ Formal Logic} 20 | 21 | \vfill 22 | \fontsize{12pt}{16pt}\selectfont \textit{By } \textbf{P.~D. Magnus}\\ 23 | \textbf{Tim Button}\\ 24 | \textbf{Robert Trueman}\\ 25 | \textbf{Richard Zach}\\ 26 | \textit{with contributions by}\\ 27 | \textbf{J.~Robert Loftis}\\ 28 | \textbf{Aaron Thomas-Bolduc}\\ 29 | 30 | \vfill 31 | \textbf{\forallxversion}\par 32 | \end{raggedleft} 33 | 34 | \newpage 35 | 36 | \noindent\small% 37 | \fi 38 | This book is based on 39 | \href{https://www.homepages.ucl.ac.uk/~uctytbu/OERs.html}{\forallx: 40 | \textit{Cambridge}}, by 41 | \href{https://www.homepages.ucl.ac.uk/~uctytbu/}{Tim Button} (University College London), 42 | used under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 43 | 4.0} license, which is based in turn 44 | on \href{https://www.fecundity.com/logic/}{\forallx}, by 45 | \href{https://www.fecundity.com/job/}{P.D.\ Magnus} 46 | (University at Albany, State University of New York), 47 | used under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 48 | 4.0} license, 49 | and was remixed, revised, \& expanded by Aaron 50 | Thomas-Bolduc \& \href{https://richardzach.org/}{Richard Zach} 51 | (University of Calgary). 52 | It includes additional material from \forallx{} by P.~D. Magnus and 53 | \href{https://www.homepages.ucl.ac.uk/~uctytbu/OERs.html}{\textit{Metatheory}} by Tim Button, 54 | used under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 55 | 4.0} license, 56 | from \href{https://github.com/rob-helpy-chalk/openintroduction}{\forallx: \textit{Lorain 57 | County Remix}}, 58 | by \href{https://sites.google.com/site/cathalwoods/}{Cathal Woods} and 59 | J. Robert Loftis, and from \href{http://www.rtrueman.com/uploads/7/0/3/2/70324387/modal_logic_primer.pdf}{\textit{A Modal Logic Primer}} by \href{http://www.rtrueman.com/}{Robert Trueman}, used with permission. 60 | 61 | 62 | \ifHTMLtarget\else 63 | \bigskip 64 | 65 | \noindent\footnotesize 66 | \fi 67 | This work is licensed under a \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0} license. 68 | You are free to copy and redistribute the material in any medium or format, and remix, transform, and build upon the material for any purpose, even commercially, under the following terms: 69 | \begin{itemize} 70 | \item You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 71 | \item You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 72 | \end{itemize} 73 | 74 | \ifHTMLtarget\else 75 | \vfil\normalsize\noindent 76 | \fi 77 | The \LaTeX{} source for this book is available on Github at 78 | \href{https://github.com/rzach/forallx-yyc/}{github.com/rzach/forallx-yyc/} and in PDF and 79 | HTML format at 80 | \href{https://forallx.openlogicproject.org}{forallx.openlogicproject.org}. 81 | This version is revision \gitAbbrevHash{} 82 | (\gitCommitterDate). 83 | 84 | \bigskip 85 | \noindent 86 | The preparation of this textbook was made possible by a grant from the \href{https://taylorinstitute.ucalgary.ca/}{Taylor Institute for Teaching and Learning}. 87 | 88 | \bigskip 89 | \noindent 90 | \href{https://taylorinstitute.ucalgary.ca/}{% 91 | \iflatexml 92 | \includegraphics[alt={Logo of the Taylor Institute for Teaching and Learning}] 93 | {assets/ti-color} 94 | \else 95 | \includegraphics[width=8cm]{assets/ti-color} 96 | \fi} 97 | 98 | \ifHTMLtarget 99 | The HTML format is produced using 100 | \href{https://vlmantova.github.io/bookml/}{BookML} by 101 | \href{https://eps.leeds.ac.uk/maths/staff/4058/dr-vincenzo-l-mantova}{Vincenzo Mantova} 102 | and \href{https://dlmf.nist.gov/LaTeXML/}{\LaTeX{}ML} by 103 | \href{https://www.nist.gov/people/bruce-r-miller}{Bruce Miller} and 104 | \href{https://prodg.org/}{Deyan Ginev}. 105 | \else 106 | \bigskip 107 | \noindent Cover design by Mark Lyall. 108 | \fi 109 | -------------------------------------------------------------------------------- /forallx-yyc-notation.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | \chapter{Symbolic notation} 4 | \label{app.notation} 5 | 6 | \section{Alternative nomenclature} 7 | 8 | \paragraph{Truth-functional logic} TFL goes by other names. Sometimes it is called \emph{sentential logic}, because it deals fundamentally with sentences. Sometimes it is called \emph{propositional logic}, on the idea that it deals fundamentally with propositions. We have stuck with \emph{truth-functional logic}, to emphasize the fact that it deals only with assignments of truth and falsity to sentences, and that its connectives are all truth-functional. 9 | 10 | \paragraph{First-order logic} FOL goes by other names. Sometimes it is called \emph{predicate logic}, because it allows us to apply predicates to objects. Sometimes it is called \emph{quantified logic}, because it makes use of quantifiers. 11 | 12 | \paragraph{Formulas} Some texts call formulas \emph{well-formed formulas}. Since `well-formed formula' is such a long and cumbersome phrase, they then abbreviate this as \emph{wff}. This is both barbarous and unnecessary (such texts do not countenance `ill-formed formulas'). We have stuck with `formula'. 13 | 14 | In \cref{s:TFLSentences}, we defined \emph{sentences} of TFL. These are also sometimes called `formulas' (or `well-formed formulas') since in TFL, unlike FOL, there is no distinction between a formula and a sentence. 15 | 16 | \paragraph{Valuations} Some texts call valuations \emph{truth-assignments}, or \emph{truth-value assignments}. 17 | 18 | \paragraph{$n$-Place predicates} We have chosen to call predicates `one-place', `two-place', `three-place', etc. Other texts respectively call them `monadic', `dyadic', `triadic', etc. Still other texts call them `unary', `binary', `ternary', etc. 19 | 20 | \paragraph{Names} In FOL, we have used `$a$', `$b$', `$c$', for names. Some texts call these `constants'. Other texts do not mark any difference between names and variables in the syntax. Those texts focus simply on whether the symbol occurs \emph{bound} or \emph{unbound}. 21 | 22 | \paragraph{Domains} Some texts describe a domain as a `domain of discourse', or a `universe of discourse'. 23 | 24 | \section{Alternative symbols} 25 | In the history of formal logic, different symbols have been used at different times and by different authors. Often, authors were forced to use notation that their printers could typeset. This appendix presents some common symbols, so that you can recognize them if you encounter them in an article or in another book. 26 | 27 | \paragraph{Negation} Two commonly used symbols are the 28 | \emph{hoe},`$\neg$', and the \emph{swung dash} or \emph{tilde}, 29 | `${\sim}$.' In some more advanced formal systems it is necessary to 30 | distinguish between two kinds of negation; the distinction is 31 | sometimes represented by using both `$\neg$' and~`${\sim}$'. Older 32 | texts sometimes indicate negation by a line over the formula being 33 | negated, e.g., `$\overline{A \eand B}$', or by a minus sign~`$-$'. 34 | Many texts use `$x \neq y$' to abbreviate `$\enot x = y$'. 35 | 36 | \paragraph{Disjunction} The symbol `$\vee$' is typically used to 37 | symbolize inclusive disjunction. One etymology is from the Latin word 38 | `vel', meaning `or'. In some texts in the so-called algebraic 39 | tradition, disjunction is written as addition~`$+$'. In many 40 | programming languages, a vertical bar~`\verb+|+' (or two: `\verb+||+') 41 | are used. (This lends itself to confusion with the Sheffer stroke of 42 | \cref{c:FunctionalCompleteness}, which is standardly written 43 | as~`$\mid$'.) 44 | 45 | \paragraph{Conjunction} 46 | Conjunction is often symbolized with the \emph{ampersand}, `{\&}'. The ampersand is a decorative form of the Latin word `et', which means `and'. (Its etymology still lingers in certain fonts, particularly in italic fonts; thus an italic ampersand might appear as `% 47 | \iflatexml 48 | \\&\ 49 | \else 50 | \emph{\&} 51 | \fi 52 | '.) This symbol is commonly used in natural English writing (e.g. `Smith \& Sons'), and so even though it is a natural choice, many logicians use a different symbol to avoid confusion between the object and metalanguage: as a symbol in a formal system, the ampersand is not the English word `\&'. The most common choice now is `$\wedge$', which is a counterpart to the symbol used for disjunction. Sometimes a single dot, `{\scriptsize\textbullet}', is used. In some older texts, there is no symbol for conjunction at all; `$A$ and $B$' is simply written `$AB$'. 53 | 54 | \paragraph{Material conditional} There are two common symbols for the material conditional: the \emph{arrow}, `$\rightarrow$', and the \emph{horseshoe}, `$\supset$'. 55 | 56 | \paragraph{Material biconditional} The \emph{double-headed arrow}, `$\leftrightarrow$', is used in systems that use the arrow to represent the material conditional. Systems that use the horseshoe for the conditional typically use the \emph{triple bar}, `$\equiv$', for the biconditional. 57 | 58 | \paragraph{Quantifiers} The universal quantifier is typically 59 | symbolized as a rotated `A', and the existential quantifier as a 60 | rotated, `E'. In some texts, there is no separate symbol for the 61 | universal quantifier. Instead, the variable is just written in 62 | parentheses in front of the formula that it binds. For example, they 63 | might write `$(x)\atom{P}{x}$' where we would write `$\forall x\, 64 | \atom{P}{x}$'. Some texts also use large versions of our conjunction 65 | and disjunction connectives, i.e., `$\bigwedge$' and `$\bigvee$', for 66 | the universal and existential quantifier, respectively. (The variable 67 | is sometimes set as a subscript to these symbols, or even underneath 68 | them.) 69 | 70 | \bigskip 71 | 72 | These alternative typographies are summarised below: 73 | 74 | \begin{center} 75 | \begin{tabular}{rl} 76 | negation & $\neg$, ${\sim}$, $-$, $\overline{A}$\\ 77 | conjunction & $\wedge$, $\&$, {\scriptsize\textbullet}\\ 78 | disjunction & $\vee$, $+$, \verb+|+, \verb+||+\\ 79 | conditional & $\rightarrow$, $\supset$\\ 80 | biconditional & $\leftrightarrow$, $\equiv$\\ 81 | universal quantifier & $\forall x$, $(x)$, $\bigwedge_x$\\ 82 | existential quantifier &$\exists x$, $\bigvee_x$ 83 | \end{tabular} 84 | \end{center} 85 | 86 | 87 | 88 | 89 | 90 | \section{Polish notation} 91 | 92 | This section briefly discusses sentential logic in Polish notation, a system of notation introduced in the late 1920s by the Polish logician Jan {\L}ukasiewicz. 93 | 94 | Lower case letters are used as sentence letters. The capital letter $N$ is used for negation. $A$ is used for disjunction, $K$ for conjunction, $C$ for the conditional, $E$ for the biconditional. (`$A$' is for alternation, another name for logical disjunction. `$E$' is for equivalence.) 95 | 96 | In Polish notation, a binary connective is written \emph{before} the two sentences that it connects. For example, the sentence $A\eand B$ of TFL would be written $Kab$ in Polish notation. 97 | 98 | The sentences $\enot A\eif B$ and $\enot (A\eif B)$ are very different; the main logical operator of the first is the conditional, but the main connective of the second is negation. In TFL, we show this by putting parentheses around the conditional in the second sentence. In Polish notation, parentheses are never required. The left-most connective is always the main connective. The first sentence would simply be written $CNab$ and the second $NCab$. 99 | 100 | This feature of Polish notation means that it is possible to evaluate sentences simply by working through the symbols from right to left. If you were constructing a truth table for $NKab$, for example, you would first consider the truth-values assigned to $b$ and $a$, then consider their conjunction, and then negate the result. The general rule for what to evaluate next in TFL is not nearly so simple. In TFL, the truth table for $\enot(A\eand B)$ requires looking at $A$ and $B$, then looking in the middle of the sentence at the conjunction, and then at the beginning of the sentence at the negation. Because the order of operations can be specified more mechanically in Polish notation, variants of Polish notation are used as the internal structure for many computer programming languages. 101 | 102 | -------------------------------------------------------------------------------- /forallx-yyc-preface.tex: -------------------------------------------------------------------------------- 1 | \chapter{Preface}\label{preface} 2 | 3 | \paragraph{About this book} 4 | 5 | As the title indicates, this is a textbook on formal logic. Formal logic concerns the study of a certain kind of language which, like any language, can serve to express states of affairs. It is a formal language, i.e., its expressions (such as sentences) are defined formally. This makes it a very useful language for being very precise about the states of affairs its sentences describe. In particular, in formal logic it is impossible to be ambiguous. The study of these languages centres on the relationship of entailment between sentences, i.e., which sentences follow from which other sentences. Entailment is central because by understanding it better we can tell when some states of affairs must obtain provided some other states of affairs obtain. But entailment is not the only important notion. We will also consider the relationship of being satisfiable, i.e., of not being mutually contradictory. These notions can be defined semantically, using precise definitions of entailment based on interpretations of the language---or proof-theoretically, using formal systems of deduction. 6 | 7 | Formal logic is of course a central sub-discipline of philosophy, where the logical relationship of assumptions to conclusions reached from them is important. Philosophers investigate the consequences of definitions and assumptions and evaluate these definitions and assumptions on the basis of their consequences. It is also important in mathematics and computer science. In mathematics, formal languages are used to describe not ``everyday'' states of affairs, but mathematical states of affairs. Mathematicians are also interested in the consequences of definitions and assumptions, and for them it is equally important to establish these consequences (which they call ``theorems'') using completely precise and rigorous methods. Formal logic provides such methods. In computer science, formal logic is applied to describe the state and behaviours of computational systems, e.g., circuits, programs, databases, etc. Methods of formal logic can likewise be used to establish consequences of such descriptions, such as whether a circuit is error-free, whether a program does what it's intended to do, whether a database is consistent or if something is true of the data in it. 8 | 9 | The book is divided into nine parts. \Cref{ch.intro} introduces the topic and notions of logic in an informal way, without introducing a formal language yet. \Crefrange{ch.TFL}{ch.NDTFL} concern truth-functional languages. In it, sentences are formed from basic sentences using a number of connectives (`or', `and', `not', `if \dots then') which just combine sentences into more complicated ones. We discuss logical notions such as entailment in two ways: semantically, using the method of truth tables (in \cref{ch.TruthTables}) and proof-theoretically, using a system of formal derivations (in \cref{ch.NDTFL}). \Crefrange{ch.FOL}{ch.NDFOL} deal with a more complicated language, that of first-order logic. It includes, in addition to the connectives of truth-functional logic, also names, predicates, identity, and the so-called quantifiers. These additional elements of the language make it much more expressive than the truth-functional language, and we'll spend a fair amount of time investigating just how much one can express in it. Again, logical notions for the language of first-order logic are defined semantically, using interpretations, and proof-theoretically, using a more complex version of the formal derivation system introduced in \cref{ch.NDTFL}. \Cref{ch.ML} discusses the extension of TFL by non-truth-functional operators for possibility and necessity: modal logic. \Cref{ch.normalform} covers two advanced topics: that of conjunctive and disjunctive normal forms and the functional completeness of the truth-functional connectives, and the soundness of natural deduction for TFL. 10 | 11 | In the appendices you'll find a discussion of alternative notations for the languages we discuss in this text, of alternative derivation systems, and a quick reference listing most of the important rules and definitions. The central terms are listed in a glossary at the very end. 12 | 13 | \paragraph{Credits} This book is based on a text originally written by 14 | P.~D. Magnus in the version revised and expanded by Tim Button. It 15 | also includes some material (mainly exercises) by J.~Robert Loftis. 16 | The material in \cref{ch.ML} is based on notes by Robert Trueman (but 17 | rewritten to use Fitch's original natural deduction rules for modal 18 | logic), and the material in 19 | \cref{c:NormalForms,c:FunctionalCompleteness,ch:Soundness} on two 20 | chapters from Tim Button's open text \textit{Metatheory}. Aaron 21 | Thomas-Bolduc and Richard Zach have combined elements of these texts 22 | into the present version, changed some of the terminology and 23 | examples, rewritten some sections, and added material of their own. In 24 | particular, Richard Zach rewrote \cref{s:Arguments,s:Valid}, and added 25 | \cref{s:AmbiguityTFL,s:stratTFL,s:ambiguityFOL,ch:PropRelations,ch:equivalences}. 26 | As of the Fall 2019 edition, the part on FOL uses the syntax more 27 | common in advanced texts (such as those based on the 28 | \href{https://openlogicproject.org/}{Open Logic Project}) where 29 | arguments to predicate symbols are enclosed in parentheses (i.e., 30 | `$R(a,b)$' instead of `$Rab$'). This version of \forallx{} also uses 31 | the standard definition of syntax for FOL which allows vacuous 32 | quantification, and Gentzen's original introduction and elimination 33 | rules for natural deduction (i.e., double negation elimination and 34 | excluded middle rules are derived rules, and indirect proof is the 35 | only classical rule). The resulting text is licensed under a Creative 36 | Commons Attribution 4.0 license. There are 37 | \href{https://github.com/OpenLogicProject/OpenLogic/wiki/Other-Logic-Textbooks}{several 38 | other} ``remixes'' of \forallx, including translations of this 39 | version. 40 | 41 | \paragraph{Notes for instructors} The material in this book is suitable for a semester-long introduction to formal logic. I cover \crefrange{ch.intro}{ch.NDFOL} plus \cref{c:NormalForms,c:FunctionalCompleteness,ch:equivalences} in 12 weeks, although I leave out partial truth tables and derived inference rules. 42 | 43 | The most recent version of this book is available in PDF at 44 | \href{https://forallx.openlogicproject.org}{forallx.openlogicproject.org}, 45 | but changes frequently. The CC BY license gives you the right to 46 | download and distribute the book yourself. In order to ensure that all 47 | your students have the same version of the book throughout the term 48 | you're using it, you should do so: upload the PDF you decide to use to 49 | your LMS rather than merely give your students the link. The book is 50 | also available in an 51 | \href{https://forallx.openlogicproject.org/html/}{HTML version}. This 52 | version has been prepared with 53 | \href{https://forallx.openlogicproject.org/html/A4.html}{special 54 | attention to accessibility issues} and should be more suitable for 55 | users who rely on screen readers, e.g., students with low vision or 56 | complete loss of vision. You can download a SCORM bundle including the 57 | HTML and PDF versions for upload to your LMS. You are also free to 58 | have the PDFs printed by your bookstore, but some bookstores may be 59 | able to purchase and stock the softcover books available on Amazon. 60 | 61 | Note that solutions to many exercises in the book are available at the 62 | above site as well (to everyone, including your students). The 63 | solutions are not (yet) part of the HTML version or the SCORM bundle. 64 | 65 | The syntax and proof systems (except those for modal logic) are supported by Graham Leach-Krouse's free, online logic teaching software application \textit{Carnap} (\href{https://carnap.io}{carnap.io}). This allows for submission and automated marking of exercises such as symbolization, truth tables, and natural deduction proofs. Instructors on carnap.io will be able to find \href{https://carnap.io/shared/rzach@ucalgary.ca/forall%20x:%20Calgary.md}{samples of additional exercises} they may wish to adapt or assign as-is. -------------------------------------------------------------------------------- /forallxyyc-accessible.tex: -------------------------------------------------------------------------------- 1 | % forallxyyc-accessible 2 | % Driver file to produce accessible of forall x:YYC for screen reading 3 | % Larger type, line spacing & tracking, dyslexia-friendly typeface, 4 | % no ligatures, no text justification 5 | 6 | \documentclass[openany,oneside,12pt]{memoir} 7 | 8 | % set stock & paper size with narrow margins 9 | 10 | \setstocksize{8in}{5in} 11 | 12 | \settrimmedsize{\stockheight}{\stockwidth}{*} 13 | \settrims{0pt}{0pt} 14 | 15 | % set the size of the type block 16 | 17 | \settypeblocksize{*}{300pt}{1.52} 18 | 19 | % set spine and and edge margin 20 | 21 | \setlrmargins{*}{*}{1} 22 | \setulmargins{.6in}{*}{*} 23 | \setheaderspaces{*}{*}{1} 24 | 25 | \checkandfixthelayout 26 | 27 | % make output PDF/A compliant 28 | 29 | \RequirePackage[a-1b]{pdfx} 30 | 31 | % load forall x style and macro definitions 32 | 33 | \usepackage{forallxyyc-style} 34 | \usepackage{forallxyyc} 35 | 36 | \usepackage[absolute,overlay]{textpos} 37 | 38 | % Accessibility: use a sans-serif font 39 | % GoSans is designed by Bigelow & Holmes, also the makers of the Dyslexia font 40 | 41 | \usepackage[sfdefault]{GoSans} 42 | \usepackage{sfmath} 43 | \usepackage[T1]{fontenc} 44 | 45 | 46 | \renewcommand*{\chaptitlefont}{\normalfont\fontsize{40pt}{40pt}\selectfont\bfseries\color{leadbeater}} 47 | \renewcommand*{\parttitlefont}{\normalfont\fontsize{40pt}{40pt}\selectfont\bfseries\color{leadbeater}} 48 | 49 | \setlength{\midchapskip}{50pt} 50 | 51 | 52 | \makeatletter 53 | \renewcommand*{\printchaptername}{% 54 | \chapnamefont\@chapapp} 55 | \makeatother 56 | 57 | \renewcommand*{\printchaptertitle}[1]{\begin{Spacing}{1.1} 58 | \chaptitlefont #1\\[-\baselineskip]% 59 | \end{Spacing} 60 | \hspace*{-20pt}% 61 | \smash{\color{leadbeater}\rule{7pt}{\barlength}}} 62 | \renewcommand{\printparttitle}[1]{\RaggedRight\parttitlefont #1} 63 | \renewcommand*{\printpartname}{% 64 | \RaggedRight\partnamefont Part} 65 | 66 | \definecolor{lyallpink}{RGB}{222,31,149} 67 | \colorlet{leadbeater}{lyallpink} 68 | \colorlet{dkleadbeater}{lyallpink!80!black} 69 | \colorlet{ltleadbeater}{lyallpink!50} 70 | \colorlet{vltleadbeater}{lyallpink!3} 71 | 72 | % Accessibility 73 | 74 | % used for letter tracking/spacing 75 | \RequirePackage[tracking=alltext]{microtype} 76 | 77 | % Part numbers need more space in TOC 78 | \setlength{\cftpartnumwidth}{5em} 79 | 80 | \renewcommand{\cftchapterfont}{\textsf} 81 | \renewcommand{\cftchapterpagefont}{\textsf} 82 | 83 | % set text ragged right 84 | %\usepackage{ragged2e} % use this to get hyphenation 85 | \let\RaggedRight\raggedright 86 | 87 | \begin{document} 88 | 89 | % discard page after cover 90 | %\AtBeginShipoutNext{\AtBeginShipoutNext{\AtBeginShipoutDiscard}} 91 | 92 | \midsloppy\raggedbottom 93 | 94 | % Cover Page 95 | 96 | \thispagestyle{empty} 97 | \setcounter{page}{0} 98 | 99 | \begin{textblock*}{\stockwidth}(0in,3.5in) 100 | \noindent\includegraphics{assets/forallx-coverart-screen.pdf} 101 | \end{textblock*} 102 | 103 | % make front cover 104 | \begin{textblock*}{0in}(0in,0in) 105 | \noindent\hfill 106 | \begin{minipage}[b][\stockheight][s]{.9\stockwidth} 107 | \begin{raggedleft} 108 | \vspace*{1.2cm} 109 | \hfill 110 | \sffamily\fontsize{66pt}{0pt}\selectfont 111 | \color{lyallpink} 112 | \textbf{forall}% 113 | \fontsize{80pt}{0pt}\selectfont\rmfamily\textit{\textbf{x}\/} 114 | 115 | \vskip.5cm 116 | 117 | \sffamily\fontsize{24pt}{28pt}\selectfont 118 | \color{black} 119 | \textbf{\uppercase{Calgary}\\ (Accessible)} 120 | 121 | \vspace*{1cm} 122 | \color{black} 123 | \sffamily 124 | \fontsize{20pt}{22pt}\selectfont 125 | \textbf{An Introduction to\\ Formal Logic} 126 | 127 | \vfill 128 | \fontsize{11pt}{14pt}\selectfont 129 | \color{white} 130 | \textbf{P.~D. Magnus}\\ 131 | \textbf{Tim Button}\\ 132 | \textbf{Robert Trueman}\\ 133 | \textbf{Richard Zach}\\ 134 | \textit{with contributions by}\\ 135 | \textbf{J.~Robert Loftis}\\ 136 | \textbf{Aaron Thomas-Bolduc}\par 137 | \vspace{1cm} 138 | \forallxversion\par 139 | \vspace{1cm} 140 | \end{raggedleft} 141 | \end{minipage} 142 | \hspace*{1cm} 143 | \end{textblock*} 144 | \ 145 | \newpage\color{black} 146 | 147 | % Turn on accessibility 148 | 149 | % increase line spacing 150 | \setSingleSpace{1.3} 151 | \SingleSpacing 152 | 153 | % set text ragged right and increase paragraph spacing 154 | \RaggedRight 155 | \setlength\parindent{2em} 156 | \setlength\parskip{1em} 157 | 158 | % increase character spacing 159 | \SetTracking[no ligatures = f]{encoding=*,shape=*}{70} 160 | 161 | % avoid italics and small caps 162 | \let\emph\textbf 163 | \renewcommand*{\define}[1]{\textbf{\color{leadbeater}#1}} 164 | 165 | % no all caps in headers 166 | \nouppercaseheads 167 | 168 | \setlength{\barlength}{0pt} 169 | \input{forallx-yyc-content} 170 | 171 | \end{document} 172 | -------------------------------------------------------------------------------- /forallxyyc-accessible.xmpdata: -------------------------------------------------------------------------------- 1 | \Title{forall x: Calgary (Accessible). An Introduction to Formal Logic} 2 | \Author{P. D. Magnus\sep Tim Button\sep J. Rob Loftis\sep Rob Trueman\sep Aaron Thomas-Bolduc\sep Richard Zach} 3 | \Subject{An open access introductory textbook in formal logic} 4 | \Language{en-US} 5 | \Keywords{logic\sep truth-functional logic\sep propositional logic\sep predicate logic\sep first-order logic\sep natural deduction\sep Fitch} 6 | \Copyright{CC BY 4.0} 7 | \PublicationType{book} 8 | \URLlink{https://forallx.openlogicproject.org/} 9 | -------------------------------------------------------------------------------- /forallxyyc-cover-kdp.tex: -------------------------------------------------------------------------------- 1 | % cover-createspace-quarto.tex 2 | 3 | % make a cover PDF for KDP Crown Quarto booksize. 4 | \pdfminorversion=4 5 | \documentclass{memoir} 6 | 7 | \usepackage[absolute,overlay]{textpos} 8 | \usepackage{rotating} 9 | \usepackage{xcolor} 10 | \usepackage{forallxyyc,forallxyyc-style} 11 | 12 | \usepackage{helvet} 13 | 14 | \newlength{\coverheight} 15 | \newlength{\coverwidth} 16 | \newlength{\spinewidth} 17 | \newlength{\spinepos} % spine starts here, width = \spinewidth 18 | \newlength{\coverpos} % front cover starts here, width = \spinepos 19 | \newlength{\sheetwidth} 20 | \setlength{\sheetwidth}{0.002252in} 21 | 22 | \setlength{\coverheight}{9.69in} % trim height 23 | \setlength{\spinepos}{7.44in} % trim width 24 | \setlength{\spinewidth}{438\sheetwidth} 25 | 26 | % compute actual widths 27 | \addtolength{\coverheight}{.25in} % add bleed 28 | \addtolength{\spinepos}{.125in} % adjust for bleed 29 | \setlength{\coverwidth}{\spinepos} 30 | \addtolength{\coverwidth}{\coverwidth} 31 | \addtolength{\coverwidth}{\spinewidth} 32 | 33 | \newlength{\coverartpos} 34 | \setlength{\coverartpos}{-1in} 35 | \addtolength{\coverartpos}{\spinewidth} 36 | 37 | % \coverpos = \spinepso + \spinewidth 38 | \setlength{\coverpos}{\spinepos} 39 | \addtolength{\coverpos}{\spinewidth} 40 | 41 | % set stock size to total width & height of cover 42 | \setstocksize{\coverheight}{\coverwidth} 43 | 44 | % pagesize = stocksize 45 | \settrimmedsize{\stockheight}{\stockwidth}{*} 46 | \settrims{0pt}{0pt} 47 | 48 | % no margins or headers 49 | \setlrmarginsandblock{0pt}{0pt}{*} 50 | \setheadfoot{0pt}{0pt} 51 | \setulmarginsandblock{0pt}{0pt}{*} 52 | \setheadfoot{0pt}{0pt} 53 | \setlength{\headsep}{0pt} 54 | 55 | 56 | % finalize the page layout 57 | \checkandfixthelayout[fixed] 58 | \typeoutlayout 59 | 60 | \color{black} 61 | 62 | %\usepackage[x-1a]{pdfx} 63 | 64 | \begin{document} 65 | 66 | \sffamily 67 | 68 | \definecolor{lyallpink}{RGB}{222,31,149} 69 | % no folios 70 | \pagestyle{empty} 71 | 72 | \begin{textblock*}{\coverwidth}(\coverartpos,3.646in) 73 | \noindent\includegraphics{assets/forallx-coverart-full.pdf} 74 | \end{textblock*} 75 | 76 | % make a spine 77 | \begin{textblock*}{\spinewidth}(\spinepos,0bp)% 78 | \noindent\hfil 79 | \rotatebox{-90}{% make spine text readable when book is lying cover up 80 | \hbox to \coverheight{ 81 | \hskip 1.5cm 82 | \fontsize{16pt}{19pt}\sffamily\bfseries\selectfont 83 | \color{black} 84 | forall x: Calgary\hfil 85 | \color{white} 86 | \forallxshortversion\hspace{1.1cm}}}% 87 | \hfil 88 | \end{textblock*} 89 | \newbox\adjust 90 | 91 | % make front cover 92 | \begin{textblock*}{\spinepos}(\coverpos,0pt) 93 | \noindent\hfill 94 | \begin{minipage}[b][\coverheight][s]{.8\spinepos} 95 | \begin{raggedleft} 96 | \vspace*{1.7cm} 97 | \hfill 98 | \sffamily\fontsize{87pt}{0pt}\selectfont 99 | \color{lyallpink} 100 | \textbf{forall}% 101 | \fontsize{110pt}{0pt}\selectfont\rmfamily\textit{\textbf{x}\/} 102 | 103 | \vskip.5cm 104 | 105 | \sffamily\fontsize{32pt}{0pt}\selectfont 106 | \color{black} 107 | \textbf{\uppercase{Calgary}} 108 | 109 | \vspace*{1cm} 110 | \color{black} 111 | \sffamily 112 | \fontsize{25pt}{25pt}\selectfont 113 | \textbf{An Introduction to\\ Formal Logic} 114 | 115 | \vfill 116 | \fontsize{16pt}{19pt}\selectfont 117 | \color{white} 118 | \textbf{P.~D. Magnus}\\ 119 | \textbf{Tim Button}\\ 120 | \textbf{Robert Trueman}\\ 121 | \textbf{Richard Zach}\\ 122 | \textit{with contributions by}\\ 123 | \textbf{J.~Robert Loftis}\\ 124 | \textbf{Aaron Thomas-Bolduc}\\ \par 125 | \vspace{1.2cm} 126 | \textbf{\forallxversion}\par 127 | \vspace{1.15cm} 128 | \end{raggedleft} 129 | \end{minipage} 130 | \hspace*{1.7cm} 131 | \end{textblock*} 132 | 133 | % make back cover 134 | \begin{textblock*}{\spinepos}(0pt,0pt) 135 | \noindent\hspace{1.5cm} 136 | \begin{minipage}[b][\coverheight][b]{.85\spinepos} 137 | \begin{minipage}[b]{1.7cm} 138 | \includegraphics[width=1.1cm]{assets/cc.pdf} 139 | \includegraphics[width=1.1cm]{assets/by.pdf} 140 | \includegraphics[width=1.1cm]{assets/remix.pdf} 141 | \end{minipage} 142 | \hspace{.3cm} 143 | \begin{minipage}[b]{5cm} 144 | \begin{raggedright} 145 | \fontsize{14pt}{16pt}\selectfont\color{white} 146 | \textit{forall x: Calgary} by P.~D. Magnus et al.\ is 147 | licensed under a Creative Commons Attribution 4.0 International 148 | License.\par 149 | \end{raggedright} 150 | \end{minipage} 151 | \hfill 152 | \vspace{1cm} 153 | 154 | \noindent\fontsize{14pt}{16pt}\selectfont\color{white} Free download at forallx.openlogicproject.org 155 | \vspace*{2cm} 156 | \end{minipage} 157 | \hfill 158 | \end{textblock*} 159 | 160 | \end{document} 161 | -------------------------------------------------------------------------------- /forallxyyc-cover-lulu.tex: -------------------------------------------------------------------------------- 1 | % cover-lulu-quarto.tex 2 | 3 | % make a cover PDF for lulu.com's Crown Quarto booksize. 4 | 5 | % note: Lulu will flatten this PDF and get the colors wrong. Convert 6 | % this PDF to PNG first (eg, using GIMP: just import at 300dpi then 7 | % export as PNG). 8 | 9 | \documentclass{memoir} 10 | \usepackage[sfdefault]{universalis} 11 | \usepackage[osf]{Baskervaldx} % oldstyle figures 12 | 13 | \newcommand{\olpath}{../../} 14 | 15 | \usepackage[absolute,overlay]{textpos} 16 | \usepackage{rotating} 17 | \usepackage{forallxyyc} 18 | 19 | \colorlet{leadbeater}{darkred} 20 | 21 | % lulu.com's instructions: 22 | % Spine width: 50.27 Postscript points wide (1.773 cm) (209 px) 23 | % Spine begins 545 Postscript points (19.224 cm) (2271 px) from the left. 24 | % Total cover width: 1140.27 X 715 Postscript points (40.221 cm X 25.220 cm) (4751px X 2979px) 25 | 26 | \newlength{\coverheight} 27 | \newlength{\coverwidth} 28 | \newlength{\spinewidth} 29 | \newlength{\spinepos} % spine starts here, width = \spinewidth 30 | \newlength{\coverpos} % front cover starts here, width = \spinepos 31 | 32 | \setlength{\coverheight}{715bp} 33 | \setlength{\coverwidth}{1140.27bp} 34 | \setlength{\spinewidth}{50.27bp} 35 | \setlength{\spinepos}{545bp} 36 | 37 | % \coverpos = \spinepso + \spinewidth 38 | \setlength{\coverpos}{\spinepos} 39 | \addtolength{\coverpos}{\spinewidth} 40 | 41 | % set stock size to total width & height of cover 42 | \setstocksize{\coverheight}{\coverwidth} 43 | 44 | % pagesize = stocksize 45 | \settrimmedsize{\stockheight}{\stockwidth}{*} 46 | \settrims{0pt}{0pt} 47 | 48 | % no margins or headers 49 | \setlrmarginsandblock{0pt}{0pt}{*} 50 | \setheadfoot{0pt}{0pt} 51 | \setulmarginsandblock{0pt}{0pt}{*} 52 | \setheadfoot{0pt}{0pt} 53 | \setlength{\headsep}{0pt} 54 | 55 | 56 | % finalize the page layout 57 | \checkandfixthelayout[fixed] 58 | \typeoutlayout 59 | 60 | \color{black} 61 | 62 | \begin{document} 63 | % no folios 64 | \pagestyle{empty} 65 | 66 | % set back background to Matt's orange 67 | 68 | \pagecolor{leadbeater} 69 | 70 | % make a spine 71 | \begin{textblock*}{\spinewidth}(\spinepos,0bp)% 72 | \noindent\hfil\rotatebox{-90}{% make spine text readable when book is lying cover up 73 | \hbox to \coverheight{\hfil 74 | \huge\sffamily\bfseries\color{white} 75 | forall \textit{x}: An Introduction to Formal Logic\hfil \forallxshortversion\hspace{2cm}}}\hfil 76 | \end{textblock*} 77 | \newbox\adjust 78 | % make front cover 79 | \begin{textblock*}{\spinepos}(\coverpos,0pt) 80 | \noindent\hfil 81 | \begin{minipage}[b][\coverheight][s]{.8\spinepos}\color{white} 82 | \vspace*{3cm} 83 | \noindent {\fontsize{46pt}{0pt}\selectfont forall $x$} 84 | 85 | \ 86 | 87 | \noindent{\Huge{Calgary Remix}} 88 | 89 | \vspace*{1cm} 90 | \noindent{\huge \emph{An Introduction to Formal Logic}} 91 | 92 | \vfill 93 | \noindent{\fontsize{16pt}{18pt}\selectfont \textbf{P.~D. Magnus}\\ 94 | \textbf{Tim Button}\\ 95 | \textit{with additions by}\\ 96 | \textbf{J.~Robert Loftis}\\ \textit{remixed and revised by}\\ 97 | \textbf{Aaron Thomas-Bolduc}\\ \textbf{Richard Zach}\par} 98 | \vfill 99 | \noindent 100 | \includegraphics[width=1cm]{assets/cc.pdf} 101 | \includegraphics[width=1cm]{assets/by.pdf} 102 | \includegraphics[width=1cm]{assets/remix.pdf} 103 | \hfill \vbox to 1cm{\vfill\hbox{\LARGE \forallxversion}\vfill} 104 | \vspace{2cm} 105 | \end{minipage} 106 | \hfil 107 | \end{textblock*} 108 | 109 | % make back cover 110 | \begin{textblock*}{\spinepos}(0pt,0pt) 111 | \noindent\hspace{1.5cm} 112 | \begin{minipage}[b][\coverheight][b]{.85\spinepos} 113 | \begin{minipage}[b]{2.5cm} 114 | \includegraphics[width=1.2cm]{assets/cc.pdf} 115 | \includegraphics[width=1.2cm]{assets/by.pdf} 116 | \includegraphics[width=1.2cm]{assets/remix.pdf} 117 | \end{minipage} 118 | \hspace{.3cm} 119 | \begin{minipage}[b]{4.7cm} 120 | \fontsize{11pt}{1.2em}\selectfont\color{white}\textit{forall x: 121 | Calgary Remix} by P.~D. Magnus et al.\ is licensed under a 122 | Creative Commons Attribution 4.0 International License. 123 | 124 | \end{minipage} 125 | \hfill\color{black} 126 | \colorbox{white}{\includegraphics{isbn_barcode.pdf}} 127 | 128 | \vspace*{2cm} 129 | \end{minipage} 130 | \hfill 131 | \end{textblock*} 132 | 133 | \end{document} 134 | -------------------------------------------------------------------------------- /forallxyyc-html.sty: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | % forallxyyc-html provides layout and style setup for HTML version 4 | 5 | \NeedsTeXFormat{LaTeX2e} 6 | \ProvidesPackage{forallxyyc-html} 7 | 8 | \RequirePackage{hyperref,ifthen,graphicx,xcolor} 9 | 10 | % Make glossary commands do nothing if converting to HTML 11 | \newcommand{\newglossaryentry}[2]{} 12 | \newcommand{\glspl}[1]{#1s} 13 | \newcommand{\gls}[1]{#1} 14 | \newcommand{\printglossaries}{} 15 | \newcommand{\glsaddall}{} 16 | 17 | % \factoidbox{...} produces a highlighted paragraph of text 18 | 19 | \usepackage{framed} 20 | \colorlet{shadecolor}{lyallpink!5} 21 | \newenvironment{factoidboxe}{\begin{shaded*}\noindent}{\end{shaded*}} 22 | \newcommand{\factoidbox}[1]{\begin{factoidboxe}#1\end{factoidboxe}} 23 | 24 | \let\emph\textbf 25 | \renewcommand*{\define}[1]{\#1\} 26 | 27 | \usepackage{mathrsfs} 28 | \renewcommand*{\script}[1]{\ensuremath{\mathscr{#1}}} 29 | \renewcommand*{\metav}[1]{\ensuremath{\mathscr{#1}}} -------------------------------------------------------------------------------- /forallxyyc-html.tex: -------------------------------------------------------------------------------- 1 | % forallxyyc-html 2 | % Driver file to produce HTML etc. version of forall x:YYC 3 | % using LaTeXML/bookml 4 | 5 | \documentclass{book} 6 | \usepackage{bookml/bookml} 7 | \bmlImageEnvironment{tikzpicture} 8 | 9 | \RequirePackage{xcolor,tabularx,wrapfig} 10 | \definecolor{lyallpink}{RGB}{222,31,149} 11 | \colorlet{leadbeater}{lyallpink} 12 | \colorlet{dkleadbeater}{lyallpink!80!black} 13 | \colorlet{ltleadbeater}{lyallpink!50} 14 | \colorlet{vltleadbeater}{lyallpink!3} 15 | 16 | \usepackage{forallxyyc} 17 | \usepackage{forallxyyc-html} 18 | \usepackage{gitinfo2} 19 | 20 | \usepackage{fitchml}% patch fitch for HTML 21 | 22 | \HTMLtargettrue 23 | 24 | \title{forall x: Calgary} 25 | 26 | \author{P.~D. Magnus\and 27 | Tim Button\and 28 | Robert Trueman\and 29 | Richard Zach} 30 | 31 | \date{\forallxversion{} (\gitCommitterDate~\gitAbbrevHash)} 32 | 33 | \bmlAltFormat{forallxyyc.pdf}{PDF} 34 | \bmlAltFormat{forallxyyc-accessible.pdf}{PDF (accessible)} 35 | 36 | \begin{document} 37 | 38 | \begin{wrapfigure}{r}{.4\textwidth} 39 | \includegraphics[width=.4\textwidth, 40 | alt={Book cover with title, authors, and a large forall sign in red on pink background}] 41 | {forallxyyc.png}\bmlPlusClass{bml\_no\_invert fxcover} 42 | \end{wrapfigure} 43 | % \iflatexml 44 | % \
45 | % \

forall x: Calgary\
An Introduction to Formal Logic\

46 | % \

\\P. D. Magnus\\ 47 | % \  \\\Tim Button\\ 48 | % \  \\\Robert Trueman 49 | % \\ 50 | % \  \\\Richard Zach\\\

51 | % \

\forallxversion{} (\gitCommitterDate~\gitAbbrevHash)\

52 | % \
53 | % \
54 | % \

With contributions by J. Robert Loftis and Aaron Thomas-Bolduc\

55 | % \
56 | % \else 57 | \maketitle 58 | 59 | With contributions by J. Robert Loftis and Aaron Thomas-Bolduc 60 | % \fi 61 | 62 | \input{forallx-yyc-content} 63 | 64 | \end{document} 65 | -------------------------------------------------------------------------------- /forallxyyc-letter.tex: -------------------------------------------------------------------------------- 1 | % forallxyyc-letter 2 | % Driver file to produce version of forall x:YYC on letter-size paper 3 | % for printing (in black and white) 4 | 5 | \documentclass[openany,11pt,letterpaper]{memoir} 6 | 7 | \usepackage{forallxyyc-style} 8 | \usepackage{forallxyyc} 9 | 10 | \colorlet{leadbeater}{black} 11 | \colorlet{dkleadbeater}{black} 12 | \colorlet{ltleadbeater}{black!50} 13 | \colorlet{vltleadbeater}{black!3} 14 | 15 | \hypersetup{hidelinks} 16 | 17 | \begin{document} 18 | 19 | \midsloppy 20 | 21 | \input{forallx-yyc-content} 22 | 23 | \end{document} 24 | -------------------------------------------------------------------------------- /forallxyyc-local-sample.sty: -------------------------------------------------------------------------------- 1 | % Copy this file to forallxyyc-local.sty to get symbols like in the Logic Book 2 | 3 | \def\eand{\ensuremath{\mathbin{\&}}} 4 | \def\eif{\ensuremath{\mathbin{\supset}}} 5 | \def\enot{\ensuremath{\mathord{\sim}}} 6 | \def\eiff{\ensuremath{\mathbin{\equiv}}} 7 | 8 | % The next line makes atomic formulas be Fxy instead of F(x,y) 9 | \renewcommand{\atom}[2]{\mathord{#1}\args{#2}} 10 | -------------------------------------------------------------------------------- /forallxyyc-print.tex: -------------------------------------------------------------------------------- 1 | % forallxyyc-print 2 | % Driver file to produce version of forall x:YYC on quarto stock 3 | % for printing in black and white via Amazon KDP or similar print-on-demand service. 4 | 5 | %\pdfminorversion=3 6 | 7 | \documentclass[openany,twoside,11pt]{memoir} 8 | 9 | % set stock & paper size to Quarto 10 | 11 | \setstocksize{24.589cm}{18.91cm} 12 | 13 | \settrimmedsize{\stockheight}{\stockwidth}{*} 14 | \settrims{0pt}{0pt} 15 | 16 | % set the size of the type block to golden ratio calculated width 17 | 18 | \settypeblocksize{*}{300pt}{1.62} 19 | 20 | % set spine and and edge margin 21 | 22 | \setlrmargins{*}{*}{1.3} 23 | \setulmargins{90pt}{*}{*} 24 | \setheaderspaces{*}{*}{1} 25 | 26 | \checkandfixthelayout 27 | 28 | % make output PDF/X compliant 29 | 30 | \RequirePackage[x-1a]{pdfx} 31 | 32 | % load forall x style and macro definitions 33 | 34 | \usepackage{forallxyyc-style} 35 | \usepackage{forallxyyc} 36 | 37 | \colorlet{leadbeater}{black} 38 | \colorlet{dkleadbeater}{black} 39 | \colorlet{ltleadbeater}{black!50} 40 | \colorlet{vltleadbeater}{black!3} 41 | 42 | \makeatletter 43 | \makepsmarks{leadbeater}{% 44 | \createmark{chapter}{both}{shownumber}{\@chapapp\ }{. \ } 45 | \createmark{section}{right}{shownumber}{}{. \ } 46 | \createplainmark{toc}{both}{\contentsname} 47 | \createplainmark{lof}{both}{\listfigurename} 48 | \createplainmark{lot}{both}{\listtablename} 49 | \createplainmark{bib}{both}{\bibname} 50 | \createplainmark{index}{both}{\indexname} 51 | \createplainmark{glossary}{both}{\glossaryname} 52 | } 53 | \makeatother 54 | 55 | \begin{document} 56 | 57 | \midsloppy 58 | 59 | \input{forallx-yyc-content} 60 | 61 | \end{document} 62 | -------------------------------------------------------------------------------- /forallxyyc-style.sty: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | 3 | % forallxyyc-style provides layout and style setup for forall x: YYC books 4 | 5 | \NeedsTeXFormat{LaTeX2e} 6 | \ProvidesPackage{forallxyyc-style} 7 | 8 | \ifdefined\bmlDescription\else 9 | \newenvironment{bmlimage}{}{} 10 | \newcommand{\bmlDescription}[1]{} 11 | \fi 12 | 13 | \RequirePackage{hyperref,ifthen,graphicx,xcolor} 14 | 15 | \usepackage[numbered]{bookmark} %TB: added for speedy navigation 16 | \usepackage[nonumberlist,toc,style=index]{glossaries} 17 | \makeglossaries 18 | \usepackage{tabu} 19 | \usepackage[defaultlines=2,all]{nowidow} 20 | 21 | %RZ: typefaces 22 | 23 | \usepackage{helvet} 24 | \usepackage[osf]{Baskervaldx} % oldstyle figures 25 | \RequirePackage{amssymb} % ensure this is loaded before newtxmath 26 | \usepackage[bigdelims,baskervaldx]{newtxmath} 27 | 28 | %RZ: Make sure we have a copyright symbol 29 | 30 | \def\copyright{\textcircled{C}} 31 | 32 | %RZ: Include git revision info 33 | 34 | \usepackage{gitinfo2} 35 | 36 | % RZ: TOC widths 37 | 38 | \setlength{\cftpartnumwidth}{3em} 39 | \setlength{\cftchapternumwidth}{2.2em} 40 | \setlength{\cftsectionnumwidth}{3.3em} 41 | \setlength{\cftbeforechapterskip}{0pt} %TB: to leave no gap between sections (which LaTeX regards as chapters) in the TOC 42 | \renewcommand{\cftchapterfont}{\textrm} 43 | \renewcommand{\cftchapterpagefont}{\textrm} 44 | 45 | % Chapter style 46 | 47 | \newlength{\barlength} 48 | \setlength{\barlength}{400pt} 49 | \makechapterstyle{leadbeater}{% 50 | \setlength{\afterchapskip}{40pt} 51 | \setlength{\beforechapskip}{50pt} 52 | \setlength{\midchapskip}{10pt} 53 | \renewcommand*{\afterchapternum}{\par\nobreak\vskip 0pt} 54 | \renewcommand*{\chapnamefont}{\fontsize{14pt}{0pt}\selectfont\sffamily\bfseries} 55 | \renewcommand*{\chapnumfont}{\fontsize{14pt}{0pt}\selectfont\sffamily\bfseries} 56 | \renewcommand*{\chaptitlefont}{\normalfont\fontsize{48pt}{48pt}\selectfont\bfseries\itshape\color{leadbeater}} 57 | \renewcommand*{\printchaptername}{% 58 | \chapnamefont\MakeUppercase{\@chapapp}} 59 | \renewcommand*{\printchaptertitle}[1]{% 60 | \chaptitlefont ##1\\[-\baselineskip]% 61 | \hspace*{-20pt}% 62 | \smash{\color{leadbeater}\rule{7pt}{\barlength}}} 63 | } 64 | 65 | \renewcommand*{\partnamefont}{\fontsize{24pt}{0pt}\selectfont\sffamily\bfseries} 66 | \renewcommand*{\partnumfont}{\fontsize{24pt}{0pt}\selectfont\sffamily\bfseries} 67 | \renewcommand*{\parttitlefont}{\normalfont\fontsize{48pt}{48pt}\selectfont\bfseries\itshape\color{leadbeater}} 68 | \renewcommand*{\printpartname}{% 69 | \partnamefont PART} 70 | 71 | \newcommand{\trailingperiod}[1]{#1.} 72 | \setparaheadstyle{\normalsize\bfseries\trailingperiod} 73 | \copypagestyle{leadbeater}{headings} 74 | 75 | \chapterstyle{leadbeater} 76 | 77 | \makeoddhead{leadbeater}{\small\sffamily\color{leadbeater}\rightmark}{} 78 | {\color{leadbeater}\sffamily\bfseries\thepage} 79 | 80 | \makeevenhead{leadbeater}{\color{leadbeater}\sffamily\bfseries\thepage}{} 81 | {\small\sffamily\color{leadbeater}\leftmark} 82 | 83 | \usepackage[font={small,it}]{caption} 84 | 85 | % restart numbering of example sentences for every chapter 86 | \addtodef{\chapter}{\restartlist{enumerate}}{} 87 | 88 | % \factoidbox{...} produces a highlighted paragraph of text 89 | 90 | \usepackage{tcolorbox} 91 | \newenvironment{factoidboxe}{% 92 | \begin{tcolorbox}[%width=.9\textwidth, 93 | % leftright skip=.05\textwidth, 94 | sharp corners=downhill, 95 | beforeafter skip=.7em, 96 | colframe={leadbeater},colback={vltleadbeater}]}{ 97 | \end{tcolorbox}} 98 | \newcommand{\factoidbox}[1]{\begin{factoidboxe}#1\end{factoidboxe}} 99 | 100 | % TB: information originally in the main body; but it is style information, so I have included it here. 101 | \hypersetup{pdfinfo={Title={forall x: Calgary}, Author={P.D. Magnus, Tim Button, J. Rob Loftis, Rob Trueman, Aaron Thomas-Bolduc, Richard Zach}, Subject={An open access introductory textbook in formal logic}, Keywords={truth-functional logic, propositional logic, predicate logic, first-order logic, natural deduction, Fitch}}, % 102 | % bookmarks={true}, % 103 | bookmarksopen = true, 104 | colorlinks={true}, % 105 | allcolors={dkleadbeater}, 106 | pdfdisplaydoctitle={true}} 107 | \urlstyle{same} -------------------------------------------------------------------------------- /forallxyyc.css: -------------------------------------------------------------------------------- 1 | /* forallxyyc.css -- style sheet to fix spacing etc. in BookML and LaTeXML styles 2 | Must be passed to LaTeXML and BookML */ 3 | 4 | /* hide the "blank" text in \blank's */ 5 | 6 | span.fxblank { 7 | display: inline-block; 8 | height: 0px; 9 | overflow: hidden; 10 | } 11 | 12 | /* draw a border around the book cover */ 13 | 14 | img.fxcover { 15 | border: 1px solid !important; 16 | background-color: white; 17 | margin-left: 2em; 18 | } 19 | 20 | /* style dfn tags */ 21 | 22 | dfn { 23 | font-style: italic; 24 | font-weight: bold; 25 | color: #B21978; 26 | } 27 | 28 | /* make
's (i.e., the description environment used by earg appear 29 | nicely */ 30 | 31 | dl.ltx_description dt, 32 | dt span.ltx_tag { 33 | font-style: normal !important; 34 | font-weight: normal !important; 35 | font-size: inherit !important; 36 | } 37 | 38 | dl.ltx_description dt { 39 | text-align: right; 40 | min-width: 6em; 41 | } 42 | 43 | dd, dd p.ltx_p { 44 | margin-bottom: 0px !important; 45 | } 46 | 47 | dl.ltx_description { 48 | margin-left: 0.5em; 49 | } 50 | 51 | /* fix LaTeXML.css handling of paras inside list items without tags */ 52 | 53 | .ltx_item .ltx_para:first-child .ltx_p { display:inline; } 54 | 55 | /* fix LaTeXML.css spacing between {paragraph}s */ 56 | 57 | .ltx_paragraph .ltx_title + .ltx_para .ltx_p { 58 | display: block; 59 | } -------------------------------------------------------------------------------- /forallxyyc.sty: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | \NeedsTeXFormat{LaTeX2e} 3 | \ProvidesPackage{forallxyyc}[2023/09/01 support for a logic textbook] 4 | 5 | % The current book version 6 | \def\forallxversion{Fall 2023} 7 | \def\forallxshortversion{F23} 8 | 9 | \RequirePackage{amssymb,amsmath,pifont,rotating} 10 | \usepackage[cal=boondoxo]{mathalfa} 11 | \usepackage[german,english]{babel} 12 | \usepackage[utf8]{inputenc} 13 | \usepackage{latexml} 14 | \RequirePackage{hyperref,ifthen,graphicx,xcolor} 15 | \RequirePackage{enumitem} 16 | 17 | % References using cleveref 18 | 19 | \RequirePackage[nameinlink]{cleveref} 20 | \crefname{enumi}{sentence}{sentences} 21 | 22 | % \ifHTMLtarget -- for conditional code depending on whether we're 23 | % compiling to HTML or to PDF. To be used for anything that would also 24 | % compile to PDF for testing and because BookML runs the file through 25 | % LaTeX. Use \iflatexml to test for when we're *actually* running 26 | % through LaTeXML (e.g., inserting raw HTML) 27 | \newif\ifHTMLtarget 28 | \HTMLtargetfalse 29 | 30 | % The original forallx.sty was written in 2005 31 | % Comments marked "TB" are additions by Tim Button in September 2012 32 | 33 | % **************************************** 34 | % * TITLE AND VERSION DATA * 35 | % **************************************** 36 | % the title of the book 37 | 38 | \newcommand*{\forallx}{\texttt{forall}\textit{x}} 39 | \newcommand*{\forallxyyc}{\texttt{forall}\textit{x}\texttt{:Calgary}} 40 | 41 | % **************************************** 42 | % * LOGICAL SYMBOLS * 43 | % **************************************** 44 | % 45 | % There are, of course, many different symbols used for the truth-functional 46 | % connectives. In order to make the book adaptable, the symbols are defined 47 | % here in the style sheet and these commands are used throughout the book. 48 | % To change conjunction from the ampersand to the carat, for instance, 49 | % change the definition of \eand from ~\&~ to \wedge. To change negation from 50 | % the hoe to the swung dash, change \enot from \neg to {\sim}. Other examples 51 | % are given below. 52 | % 53 | \let\oldtherefore\therefore 54 | \def\therefore{\ensuremath{\oldtherefore}} 55 | \iflatexml 56 | \def\texttherefore{∴} 57 | \else 58 | \let\texttherefore\therefore 59 | \fi 60 | % disjunction 61 | \def\eor{\ensuremath{\vee}} 62 | % conjunction: 63 | % {\,^{_{_{_{_{\mbox{\footnotesize\textbullet}}}}}}} gives the dot 64 | \def\eand{\ensuremath{\wedge}} 65 | % conditional: \supset gives the horseshoe 66 | \def\eif{\ensuremath{\rightarrow}} 67 | % biconditional: \equiv gives the triple bar 68 | \def\eiff{\ensuremath{\leftrightarrow}} 69 | % negation: {\sim} gives the swung dash 70 | \def\enot{\ensuremath{\neg}} 71 | \def\ered{\ensuremath{\bot}}% TB: added to give an absurdity sign 72 | \newcommand*{\ebox}{\ensuremath{\Box}} 73 | \def\ediamond{\ensuremath{\Diamond}} 74 | \iflatexml 75 | \def\maththe{\ensuremath{\iota}} 76 | \else 77 | \def\maththe{\rotatebox[origin=c]{180}{$\iota$}} % TB: added to give definite description operator 78 | \fi 79 | \def\proves{\ensuremath{\vdash}} 80 | \def\entails{\ensuremath{\vDash}} 81 | \def\nproves{\ensuremath{\nvdash}} 82 | \def\nentails{\ensuremath{\nvDash}} 83 | 84 | % modal logic systems 85 | \def\mlK{\ensuremath{\mathbf{K}}} 86 | \def\mlT{\ensuremath{\mathbf{T}}} 87 | \def\mlSfour{\ensuremath{\mathbf{S4}}} 88 | \def\mlSfive{\ensuremath{\mathbf{S5}}} 89 | 90 | % args -- format a list of arguments separated by commas without commas 91 | 92 | \newcommand*{\args}[1]{% 93 | \let\@argsep\@argsepinit 94 | \@for\@arg:=#1\do{% 95 | \@argsep\@arg}% 96 | } 97 | 98 | \def\@argsepinit{\let\@argsep\argsep} 99 | 100 | \newcommand{\argsep}{} 101 | 102 | \newcommand{\atom}[2]{\ensuremath{\lxFcn{#1}(#2)}} 103 | 104 | % **************************************** 105 | % * SYMBOLS AND SCRIPTY BITS * 106 | % **************************************** 107 | % equivalent to commenting something out, but usable on multiple lines 108 | \providecommand{\nix}[1]{} 109 | 110 | \newcommand*{\script}[1]{\ensuremath{\mathcal{#1}}} 111 | \newcommand*{\metav}[1]{\ensuremath{\mathcal{#1}}} 112 | 113 | % create a blank that SRs read out as "blank" 114 | \iflatexml 115 | \newcommand*{\blank}{\underline{blank~}\bmlPlusClass{fxblank}} 116 | \else 117 | \newcommand*{\blank}{\underline{\hspace*{2.5em}}} 118 | \fi 119 | \newcommand*{\gap}[1]{\blank$_{#1}$} % TB: used for keys, to avoid use/mention confusion 120 | 121 | % make SRs read out "iff" as "if-f" by putting in invisible U+2060 122 | % https://en.wikipedia.org/wiki/Word_joiner 123 | \iflatexml 124 | \newcommand*{\ifeff}{if⁠f} 125 | \else 126 | \newcommand*{\ifeff}{iff} 127 | \fi 128 | 129 | % These are included for discussing formal semantics in predicate logic. 130 | \newcommand*{\model}[1]{\ensuremath{\mathbb{#1}}} 131 | \newcommand*{\extension}[1]{\ensuremath{\mbox{extension}(#1)}} 132 | \newcommand*{\referent}[1]{\ensuremath{\mbox{referent}(#1)}} 133 | % I personally dislike the default LaTeX angle brackets. I think that 134 | % they are too narrow. If you want to use them, though, you can 135 | % replace < and > in the commands below with \langle and \rangle 136 | \newcommand*{\openntuple}{\langle} 137 | \newcommand*{\closentuple}{\rangle} 138 | \newcommand*{\ntuple}[1]{\ensuremath{\mathopen{\openntuple}}#1\ensuremath{\mathclose{\closentuple}}} 139 | % definitions 140 | \newcommand*{\define}[1]{\textsc{\lowercase{\color{dkleadbeater}#1}}} 141 | 142 | % **************************************** 143 | % * LIST ENVIRONMENTS * 144 | % **************************************** 145 | % The {earg} environment is used for arguments and example sentences. 146 | % The {ekey} environment is used for symbolization keys. 147 | % \newcounter{eargnum} 148 | % \newcounter{OLDeargnum} 149 | % \newenvironment{earg}% 150 | % {\begin{list}{\arabic{eargnum}.}{\usecounter{eargnum}\itemsep=0pt \parsep=0pt}}% 151 | % {\setcounter{OLDeargnum}{\arabic{eargnum}}\end{list}} 152 | 153 | \newlist{factoiditems}{itemize}{1} 154 | 155 | \iflatexml 156 | \setlist[itemize]{label=‣,noitemsep} 157 | \setlist[factoiditems]{label=‣} 158 | \else 159 | \setlist[itemize]{label=$\triangleright$,noitemsep} 160 | \setlist[factoiditems]{label=$\triangleright$,labelindent=0pt,leftmargin=*} 161 | \fi 162 | 163 | % earg -- an unordered list for arguments, no labels 164 | %\newenvironment{earg}{\begin{itemize}[noitemsep,label={},align=right]}{\end{itemize}} 165 | \newlist{earg}{itemize}{1} 166 | \setlist[earg]{noitemsep,label={},align=right} 167 | 168 | % ebullet - a bulleted list 169 | \newenvironment{ebullet}% TB: added to give a nice bulleted enivronment 170 | {\begin{itemize}[noitemsep,label=\textbullet]}{\end{itemize}} 171 | 172 | % ekey - for symbolization keys. TODO: turn this into a description 173 | % list for better A11Y 174 | % \newcommand{\ekeylabel}[1]{{\makebox[8ex][r]{\ensuremath{ #1}:}}} 175 | % \newenvironment{ekey}{\begin{list}{}{\renewcommand{\makelabel}{\ekeylabel} 176 | % \itemsep=0pt \parsep=0pt}}{\end{list}} 177 | \newlist{ekeylist}{description}{1} 178 | \setlist[ekeylist]{noitemsep,labelwidth=4em,align=right,font=\normalfont} 179 | \def\ekeylabel#1{\hfil\normalfont\ensuremath{#1}:} 180 | \newenvironment{ekey}{\begin{ekeylist}\renewcommand{\makelabel}{\ekeylabel}}{\end{ekeylist}} 181 | 182 | % compactlist -- a numbered list with tight spacing 183 | \newlist{compactlist}{enumerate}{1} 184 | \setlist[compactlist]{noitemsep,label=\arabic*.} 185 | % numberlist -- a numbered list with standard spacing 186 | \newlist{numberlist}{enumerate}{1} 187 | \setlist[numberlist]{label=\arabic*.} 188 | 189 | % enumerate -- used for numbered examples; counter resets every 190 | % chapter 191 | \setlist[enumerate]{resume,noitemsep,labelwidth=4em} 192 | \@addtoreset{enumi}{chapter} 193 | 194 | % **************************************** 195 | % * TRUTH TABLES * 196 | % **************************************** 197 | 198 | % This facilitates the typesetting of truth tables by 199 | % effectively eliminating the intercolumn space. 200 | % This allows truth tables with the Ts and Fs immediately 201 | % below arbitrary connectives. 202 | % An example follows: 203 | %\begin{center} 204 | %\begin{tabular}{c|c|@{\TTon}*{5}{c}@{\TToff}} 205 | %$A$&$B$&$(A$&\eand&$B)$&\eif&A\\ 206 | %\hline 207 | % T & T & & T & & T & \\ 208 | % T & F & & F & & T & \\ 209 | % F & T & & F & & T & \\ 210 | % F & F & & T & & T & 211 | %\end{tabular} 212 | %\end{center} 213 | %\newcommand*{\TTon}{\hspace{1.5em}\extracolsep{-1em}} 214 | %\newcommand*{\TToff}{\extracolsep{-1em}\hspace{.3em}} 215 | 216 | \RequirePackage{multicol,array} 217 | 218 | % Moving to Memoir breaks Magnus's elegant macro 219 | % In the preceding column definition, I would offer instead: 220 | %\begin{tabular}{c c | d e e e f} 221 | % d for left-most columns, e for middle ones, f for right-most ones. The ensuing spacing is ok. 222 | \newcolumntype{d}{ c@{\extracolsep{0.1em}}} 223 | \newcolumntype{e}{@{\extracolsep{0.1em}}c@{\extracolsep{0.1em}}} 224 | \newcolumntype{f}{@{\extracolsep{0.1em}}c } 225 | \newcommand*{\TTbf}[1]{\textbf{#1}} 226 | 227 | 228 | % **************************************** 229 | % * PROOFS * 230 | % **************************************** 231 | 232 | \usepackage[arrayenv=tabular]{fitch} 233 | 234 | % I keep mixing up the \ce and \ae commands, so I define a less ambiguous 235 | % alternate set of commands 236 | 237 | \newcommand*{\notI}{\ni} 238 | \newcommand*{\notE}{\ne} 239 | \newcommand*{\iffI}{\bi} 240 | \newcommand*{\iffE}{\be} 241 | \newcommand*{\ifI}{\ci} 242 | \newcommand*{\ifE}{\ce} 243 | \newcommand*{\andI}{\ai} 244 | \newcommand*{\andE}{\ae} 245 | \newcommand*{\orI}{\oi} 246 | \newcommand*{\orE}{\oe} 247 | \newcommand*{\forallI}{\Ai} 248 | \newcommand*{\forallE}{\Ae} 249 | \newcommand*{\existsI}{\Ei} 250 | \newcommand*{\existsE}{\Ee} 251 | 252 | \newcommand*{\PR}{\by{PR}{}} 253 | \newcommand*{\AS}{\by{AS}{}} 254 | 255 | % a command for indicating the goal in a proof or subproof 256 | \newcommand*{\want}[1]{\by{want \ensuremath{#1}}{}} 257 | 258 | \def\ndrules{ 259 | \def\bi{\by{{\eiff}I}}% 260 | \def\be{\by{{\eiff}E}}% 261 | \def\ci{\by{{\eif}I}}% 262 | \def\ce{\by{{\eif}E}}% 263 | \def\Ai{\by{$\forall$I}}% 264 | \def\Ae{\by{$\forall$E}}% 265 | \def\Ei{\by{$\exists$I}}% 266 | \def\Ee{\by{$\exists$E}}% 267 | \def\ae{\by{{\eand}E}}% 268 | \def\ai{\by{{\eand}I}}% 269 | \def\oi{\by{{\eor}I}}% 270 | \def\oe{\by{{\eor}E}}% 271 | \def\ni{\by{{\enot}I}}% 272 | \def\ne{\by{{\enot}E}}% 273 | \def\ri{\by{{\enot}E}}% RZ: this is now \enot E 274 | \def\re{\by{X}}% RZ: this is now X (explosion) 275 | \def\ii{\by{$=$I}}% 276 | \def\ie{\by{$=$E}}% 277 | \def\tnd{\by{LEM}}% RZ: Law of excluded middle 278 | \def\ip{\by{IP}}% RZ: indirect proof 279 | \def\dne{\by{DNE}}% TB: double negation elimination (derived rule) 280 | \def\mt{\by{MT}}% TB: modus tollens (derived rule) 281 | \def\ds{\by{DS}}% TB: disjunctive syllogism (a derived rule in Cambridge version) 282 | \def\dem{\by{DeM}}% TB: De Morgan rule (derived rule) 283 | \def\cq{\by{CQ}}% TB: conversion of quantifiers (derived rule) 284 | \def\boxi{\by{{\ebox}I}}% 285 | \def\boxe{\by{{\ebox}E}}% 286 | \def\mc{\by{MC}}% 287 | \def\diadf{\by{Def{\ediamond}}}% 288 | \def\rt{\by{R$\mathbf{T}$}}% 289 | \def\rfour{\by{R$\mathbf{4}$}}% 290 | \def\rfive{\by{R$\mathbf{5}$}}% 291 | \def\ellipsesline{\have[ ]{}{\vdots}}% 292 | } 293 | \def\by#1#2{#1} % allow \by outside proofs 294 | 295 | \setkeys{fitch}{ 296 | height=4.5ex, 297 | topheight=3.5ex, 298 | depth=1.5ex, 299 | labelsep=.7em, 300 | indent=1em, 301 | hsep=.5em, 302 | justsep=1.5em, 303 | linethickness=.2mm, 304 | arrayenv=tabular 305 | } 306 | 307 | % **************************************** 308 | % * DIAGRAMS IN TIKZ * 309 | % **************************************** 310 | % TB: I use diagrams in a few places, always using Tikz. 311 | % A. To illustrate an argument for the truth table of the material conditional 312 | % B. To draw graphs illustrating small finite interpretations. 313 | % All these drawings are done using tikz 314 | \usepackage{tikz} 315 | \usetikzlibrary{arrows,positioning,shapes} 316 | 317 | \tikzset{phantom_shape/.style={thick, fill=none, minimum width=30pt, minimum height=30pt}, % TB: renders the shape invisible 318 | grey_shape/.style={thick, fill=black!20, draw, minimum width=30pt, minimum height=30pt}, % TB: renders a light grey shape with a black outline 319 | white_shape/.style={thick, fill=none, draw, minimum width=30pt, minimum height=30pt} % TB: renders a white shape with a black outline 320 | } 321 | 322 | % **************************************** 323 | % * PRACTICE PROBLEMS * 324 | % **************************************** 325 | \newcounter{ProbPart} 326 | \renewcommand{\theProbPart}{\Alph{ProbPart}} 327 | \renewcommand{\theHProbPart}{\thechapter.\theProbPart} 328 | % This inserts a heading and resets the counter: 329 | \newcommand*{\practiceproblems}{ 330 | \setcounter{ProbPart}{0}\section*{Practice exercises}% 331 | \sectionmark{Practice exercises}% 332 | \addcontentsline{toc}{section}{Practice exercises} 333 | } 334 | % This starts a new section which is automatically numbered: 335 | \newcommand*{\problempart}{\par\noindent\refstepcounter{ProbPart}\textbf{\Alph{ProbPart}. }} 336 | % This bullet is used to indicate that solutions appear at the end of 337 | % the book. 338 | \newcommand*{\solutions}{} %TB: removed, since I am not including the solutions in the book 339 | % When solutions are only given for selected problems, the 340 | % star is placed left of the problem number. 341 | \newcommand*{\leftsolutions}{\hspace{-2.2em}\makebox[2em][l]{\solutions}} 342 | 343 | % This is used at the beginning of a section in the solutions 344 | % appendix. 345 | \newcommand*{\solutionsection}[2]{% 346 | \textbf{\textsc{Chapter {\ref{#1}} Part {\ref{#2}}}}% 347 | \markright{solutions for ch.~\ref{#1}}% 348 | \setcounter{countSeq}{0} 349 | } 350 | 351 | % This is used to enumerate things that have a given property. 352 | % For example: \nextSeq\nextSeq\noSeq\lastSeq are valid. 353 | % produces : 1, 2, and 4 are valid. 354 | \newcounter{countSeq} 355 | \newcommand*{\nextSeq}{\stepcounter{countSeq}\arabic{countSeq}, } 356 | \newcommand*{\noSeq}{\stepcounter{countSeq}} 357 | \newcommand*{\lastSeq}{and \stepcounter{countSeq}\arabic{countSeq} } 358 | 359 | % **************************************** 360 | % * TABLE OF CONTENTS, ETC. * 361 | % **************************************** 362 | \renewcommand{\thechapter}{\arabic{chapter}} 363 | \renewcommand{\thepart}{\Roman{part}} 364 | \renewcommand{\thesection}{\thechapter.\arabic{section}} 365 | 366 | \setcounter{tocdepth}{0} %TB: only chapters and sections to appear 367 | 368 | \setlength{\columnsep}{2em} % Sets 2em space between columns when calling multicol 369 | 370 | \newcommand\myanswer[1]{\textcolor{dkleadbeater}{#1}} % TB: puts model answers in blue 371 | 372 | % aria-label environment to provide accessible descriptions for inline 373 | % SVG diagrams 374 | \iflatexml 375 | \newenvironment{arialabel}[1]{\\\} 376 | \else 377 | \newenvironment{arialabel}[1]{}{} 378 | \fi 379 | 380 | \IfFileExists{forallxyyc-local.sty}{\usepackage{forallxyyc-local}}{} 381 | -------------------------------------------------------------------------------- /forallxyyc.tex: -------------------------------------------------------------------------------- 1 | % forallxyyc 2 | % Driver file to produce version of forall x:YYC for screen reading 3 | 4 | \documentclass[openany,oneside,11pt]{memoir} 5 | 6 | % set stock & paper size with narrow margins 7 | 8 | \setstocksize{8in}{5in} 9 | 10 | \settrimmedsize{\stockheight}{\stockwidth}{*} 11 | \settrims{0pt}{0pt} 12 | 13 | % Text width hard coded to 300pt 14 | 15 | % set the size of the type block to golden ratio calculated width 16 | 17 | \settypeblocksize{*}{300pt}{1.62} 18 | 19 | % set spine and and edge margin 20 | 21 | \setlrmargins{*}{*}{1} 22 | \setulmargins{.6in}{*}{*} 23 | \setheaderspaces{*}{*}{1} 24 | 25 | \checkandfixthelayout 26 | 27 | % make output PDF/A compliant 28 | 29 | \RequirePackage[a-1b]{pdfx} 30 | 31 | % load forall x style and macro definitions 32 | 33 | \usepackage{forallxyyc-style} 34 | \usepackage{forallxyyc} 35 | 36 | \usepackage[absolute,overlay]{textpos} 37 | 38 | \definecolor{lyallpink}{RGB}{222,31,149} 39 | \colorlet{leadbeater}{lyallpink} 40 | \colorlet{dkleadbeater}{lyallpink!80!black} 41 | \colorlet{ltleadbeater}{lyallpink!50} 42 | \colorlet{vltleadbeater}{lyallpink!3} 43 | 44 | \begin{document} 45 | 46 | \midsloppy 47 | 48 | % Cover Page 49 | 50 | \thispagestyle{empty} 51 | \setcounter{page}{0} 52 | 53 | \begin{textblock*}{\stockwidth}(0in,3.5in) 54 | \noindent\includegraphics{assets/forallx-coverart-screen.pdf} 55 | \end{textblock*} 56 | 57 | % make front cover 58 | \begin{textblock*}{0in}(0in,0in) 59 | \noindent\hfill 60 | \begin{minipage}[b][\stockheight][s]{.9\stockwidth} 61 | \begin{raggedleft} 62 | \vspace*{1.7cm} 63 | \hfill 64 | \sffamily\fontsize{66pt}{0pt}\selectfont 65 | \color{lyallpink} 66 | \textbf{forall}% 67 | \fontsize{80pt}{0pt}\selectfont\rmfamily\textit{\textbf{x}\/} 68 | 69 | \vskip.5cm 70 | 71 | \sffamily\fontsize{24pt}{0pt}\selectfont 72 | \color{black} 73 | \textbf{\uppercase{Calgary}} 74 | 75 | \vspace*{1cm} 76 | \color{black} 77 | \sffamily 78 | \fontsize{20pt}{22pt}\selectfont 79 | \textbf{An Introduction to\\ Formal Logic} 80 | 81 | \vfill 82 | \fontsize{11pt}{14pt}\selectfont 83 | \color{white} 84 | \textbf{P.~D. Magnus}\\ 85 | \textbf{Tim Button}\\ 86 | \textbf{Robert Trueman}\\ 87 | \textbf{Richard Zach}\\ 88 | \textit{with contributions by}\\ 89 | \textbf{J.~Robert Loftis}\\ 90 | \textbf{Aaron Thomas-Bolduc}\par 91 | \vspace{1cm} 92 | \textbf{\forallxversion}\par 93 | \vspace{1cm} 94 | \end{raggedleft} 95 | \end{minipage} 96 | \hspace*{1cm} 97 | \end{textblock*} 98 | \ 99 | \newpage 100 | \color{black} 101 | \setlength{\barlength}{0pt} % no bar next to chapter headings in ebook 102 | 103 | \input{forallx-yyc-content} 104 | 105 | \end{document} 106 | -------------------------------------------------------------------------------- /forallxyyc.xmpdata: -------------------------------------------------------------------------------- 1 | \Title{forall x: Calgary. An Introduction to Formal Logic} 2 | \Author{P. D. Magnus\sep Tim Button\sep J. Rob Loftis\sep Rob Trueman\sep Aaron Thomas-Bolduc\sep Richard Zach} 3 | \Subject{An open access introductory textbook in formal logic} 4 | \Language{en-US} 5 | \Keywords{logic\sep truth-functional logic\sep propositional logic\sep predicate logic\sep first-order logic\sep natural deduction\sep Fitch} 6 | \Copyright{CC BY 4.0} 7 | \CopyrightURL{https://forallx.openlogicproject.org/} 8 | \PublicationType{book} 9 | \Source{https://github.com/rzach/forallx-yyc} 10 | \URLlink{https://forallx.openlogicproject.org/} 11 | \Publisher{Open Logic Project} 12 | -------------------------------------------------------------------------------- /latexml.sty: -------------------------------------------------------------------------------- 1 | % /=====================================================================\ % 2 | % | latexml.sty | % 3 | % | Style file for latexml documents | % 4 | % |=====================================================================| % 5 | % | Part of LaTeXML: | % 6 | % | Public domain software, produced as part of work done by the | % 7 | % | United States Government & not subject to copyright in the US. | % 8 | % |---------------------------------------------------------------------| % 9 | % | Bruce Miller %_% | % 10 | % | http://dlmf.nist.gov/LaTeXML/ (o o) | % 11 | % \=========================================================ooo==U==ooo=/ % 12 | 13 | 14 | % You can conditionalize code for latexml or normal latex using this. 15 | \newif\iflatexml\latexmlfalse 16 | %====================================================================== 17 | \DeclareOption{ids}{} 18 | \DeclareOption{noids}{} 19 | \DeclareOption{comments}{} 20 | \DeclareOption{nocomments}{} 21 | \DeclareOption{profiling}{} 22 | \DeclareOption{noprofiling}{} 23 | \DeclareOption{mathparserspeculate}{} 24 | \DeclareOption{nomathparserspeculate}{} 25 | \DeclareOption{guesstabularheaders}{} 26 | \DeclareOption{noguesstabularheaders}{} 27 | % Just ignore unknown options, so that binding can evolve more easily. 28 | \DeclareOption*{\PackageWarning{latexml}{option \CurrentOption\space ignored}} 29 | \ProcessOptions 30 | %====================================================================== 31 | % NOTE: Figure out where this should go. 32 | % At least should define various `semantic enhancement' macros that 33 | % authors using latexml might want. 34 | % But, be careful not to step on the toes of other packages (naming scheme), 35 | % Nor, to assume to much about what semantics authors might want. 36 | % NOTE: Am I stepping on toes by including these here? 37 | % Common markup junk for LaTeXML docs. 38 | \providecommand{\XML}{\textsc{xml}}% 39 | \providecommand{\SGML}{\textsc{sgml}}% 40 | \providecommand{\HTML}{\textsc{html}}% 41 | \providecommand{\XHTML}{\textsc{xhtml}}% 42 | \providecommand{\XSLT}{\textsc{xslt}}% 43 | \providecommand{\CSS}{\textsc{css}}% 44 | \providecommand{\MathML}{\textsc{MathML}}% 45 | \providecommand{\OpenMath}{OpenMath}% 46 | 47 | \RequirePackage{url} 48 | % Shorthand to present a URL the actual text (also linked in HTML) 49 | % \URL[alternative text]{url} 50 | \def\URL{\@ifnextchar[{\@URL}{\@@URL}}%] 51 | %\def\@@URL{\begingroup\def\UrlLeft##1\UrlRight{\stepcounter{footnote}% 52 | %[Footnote~\thefootnote\footnotetext{##1}]}\Url} 53 | \def\@@URL{\begingroup\Url} 54 | \def\@URL[#1]{#1\begingroup\def\UrlLeft##1\UrlRight{\footnote{\texttt{##1}}}\Url} 55 | 56 | % The LaTeXML Logo. 57 | \DeclareRobustCommand{\LaTeXML}{L\kern-.36em% 58 | {\sbox\z@ T% 59 | \vbox to\ht\z@{\hbox{\check@mathfonts 60 | \fontsize\sf@size\z@ 61 | \math@fontsfalse\selectfont 62 | A}% 63 | \vss}% 64 | }% 65 | \kern-.15em% 66 | % T\kern-.1667em\lower.5ex\hbox{E}\kern-.125em\relax 67 | % {\tt XML}} 68 | T\kern-.1667em\lower.4ex\hbox{E}\kern-0.05em\relax 69 | {\scshape xml}}% 70 | 71 | \providecommand{\LaTeXMLversion}{} 72 | \providecommand{\LaTeXMLrevision}{} 73 | \providecommand{\LaTeXMLfullversion}{\LaTeXML} 74 | 75 | %====================================================================== 76 | % id related features 77 | \providecommand{\lxDocumentID}[1]{}% 78 | \def\LXMID#1#2{\expandafter\gdef\csname xmarg#1\endcsname{#2}\csname xmarg#1\endcsname} 79 | \def\LXMRef#1{\csname xmarg#1\endcsname} 80 | 81 | %====================================================================== 82 | % class related features 83 | % Add a class to the constructed xml (ignored in latex) 84 | \providecommand{\lxAddClass}[1]{}% 85 | \providecommand{\lxWithClass}[2]{#2}% 86 | \providecommand{\lxAddAnnotation}[1]{}% 87 | \providecommand{\lxWithAnnotation}[2]{#2}% 88 | 89 | %====================================================================== 90 | % links 91 | \def\lxRef#1#2{#2} 92 | %====================================================================== 93 | % Resources 94 | \providecommand{\lxRequireResource}[2][]{} 95 | 96 | %====================================================================== 97 | % Page customization 98 | \def\lxKeywords#1{} 99 | 100 | \RequirePackage{comment} 101 | \def\lxContextTOC{}% 102 | \excludecomment{lxNavbar} 103 | \excludecomment{lxHeader} 104 | \excludecomment{lxFooter} 105 | 106 | %====================================================================== 107 | % Table beautification. 108 | % Low-level support to mark column and row headers. 109 | % This really calls for styling, but why should we get into that game? 110 | % There are many other packages for that. 111 | 112 | % To mark the table head/foot (table column headers) 113 | % Put this before first table heading row 114 | \def\lxBeginTableHead{} 115 | % put this after the \\ ending the table heading. 116 | \def\lxEndTableHead{} 117 | % Ditto for table foot (last rows in table) 118 | \def\lxBeginTableFoot{} 119 | \def\lxEndTableFoot{} 120 | 121 | % To mark an individual cell as a column header 122 | \def\lxTableColumnHead{} 123 | % To mark an individual cell as a row header 124 | \def\lxTableRowHead{} 125 | % Easy way to mark a whole column as row headers: 126 | % \usepackage{array} 127 | % then put this in the column spec 128 | % >{\lxTableRowHead} 129 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 130 | % Declarative information for Mathematics 131 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 132 | %====================================================================== 133 | % Marking the type of particular instances of a symbol 134 | % Expose other declarative macros 135 | \providecommand{\lxFcn}[1]{#1} 136 | \providecommand{\lxID}[1]{#1} 137 | \providecommand{\lxPunct}[1]{#1} 138 | \providecommand{\lxMathTweak}[2]{#2} 139 | %====================================================================== 140 | % Math definining macro. 141 | % Define a math function such that the TeX output is what you might 142 | % expect, while providing the semantic hooks for generating useful xml. 143 | 144 | % \lxDefMath{\cs}[nargs][optargs]{presentation}[declarations] 145 | \providecommand{\lxDefMath}{\lx@defmath}% 146 | \def\lx@defmath#1{% 147 | \@ifnextchar[{\lx@defmath@a{#1}}{\lx@defmath@a{#1}[0]}}% 148 | \def\lx@defmath@a#1[#2]{% 149 | \@ifnextchar[{\lx@defmath@opt{#1}[#2]}{\lx@defmath@noopt{#1}[#2]}}% 150 | \def\lx@defmath@opt#1[#2][#3]#4{% 151 | \providecommand{#1}[#2][#3]{#4}% 152 | \@ifnextchar[{\lx@@skipopt}{}}% 153 | \def\lx@defmath@noopt#1[#2]#3{% 154 | \providecommand{#1}[#2]{#3}% 155 | \@ifnextchar[{\lx@@skipopt}{}}% 156 | \def\lx@@skipopt[#1]{}% 157 | 158 | % \lxDeclare[declarations]{match} 159 | \newcommand{\lxDeclare}[2][]{\@bsphack\@esphack}% 160 | % \lxDeclRef{label} 161 | \newcommand{\lxRefDeclaration}[2][]{\@bsphack\@esphack}% 162 | 163 | % NOTE: It would be good to incorporate Scoping into this macro. 164 | % As defined, it obeys TeX's usual grouping scope. 165 | % However, scoping by `module' (M.Kohlhase's approach) and/or 166 | % `document' scoping could be useful. 167 | 168 | % In module scoping, the definition is only available within a 169 | % module environment that defines it, AND in other module envs 170 | % that `use' it. 171 | 172 | % In document scoping, the definition would only be available within 173 | % the current sectional unit. I'm not sure the best way to achieve this 174 | % within latex, itself, but have ideas about latexml... 175 | % But, perhaps it is only the declarative aspects that are important to 176 | % latexml... 177 | -------------------------------------------------------------------------------- /solutions/fitch.sty: -------------------------------------------------------------------------------- 1 | %% fitch.sty 2 | %% Macros for Fitch-style natural deduction 3 | %% Copyright 2002-2023 Peter Selinger 4 | % 5 | % This work may be distributed and/or modified under the 6 | % conditions of the LaTeX Project Public License, either version 1.3 7 | % of this license or (at your option) any later version. 8 | % The latest version of this license is in 9 | % https://www.latex-project.org/lppl.txt 10 | % and version 1.3c or later is part of all distributions of LaTeX 11 | % version 2008 or later. 12 | % 13 | % This work has the LPPL maintenance status `maintained'. 14 | % 15 | % The Current Maintainer of this work is Richard Zach 16 | % 17 | % This work consists of the files fitch.sty and fitchdoc.tex. 18 | 19 | % Original Author: Peter Selinger, Dalhousie University 20 | % Created: Jan 14, 2002 21 | % Modified: December 17, 2023 22 | % Version: 1.0 23 | % Copyright: (C) 2002-2005 Peter Selinger, Richard Zach 24 | % Filename: fitch.sty 25 | % Documentation: fitchdoc.tex 26 | % https://github.com/OpenLogicProject/fitch/ 27 | 28 | % USAGE EXAMPLE: 29 | % 30 | % The following is a simple example illustrating the usage of this 31 | % package. For detailed instructions and additional functionality, see 32 | % the user guide, which can be found in the file fitchdoc.tex. 33 | % 34 | % \[ 35 | % \begin{nd} 36 | % \hypo{1} {P\vee Q} 37 | % \hypo{2} {\neg Q} 38 | % \open 39 | % \hypo{3a} {P} 40 | % \have{3b} {P} \r{3a} 41 | % \close 42 | % \open 43 | % \hypo{4a} {Q} 44 | % \have{4b} {\neg Q} \r{2} 45 | % \have{4c} {\bot} \ne{4a,4b} 46 | % \have{4d} {P} \be{4c} 47 | % \close 48 | % \have{5} {P} \oe{1,3a-3b,4a-4d} 49 | % \end{nd} 50 | % \] 51 | 52 | \NeedsTeXFormat{LaTeX2e} 53 | \ProvidesPackage{fitch}[2023-12-17 v1.0 Macros for Fitch-style natural deduction] 54 | 55 | % Define keyval options 56 | 57 | \RequirePackage{kvoptions} 58 | 59 | \SetupKeyvalOptions{ 60 | family = fitch, 61 | prefix = nd@ % prefix with nd@ for compatibility with old code 62 | } 63 | 64 | \DeclareStringOption[ndrules]{rules} 65 | \DeclareStringOption[array]{arrayenv} 66 | \DeclareStringOption[ndjustformat]{justformat} 67 | \DeclareStringOption[ndrefformat]{refformat} 68 | 69 | \DeclareStringOption[4.5ex]{height}[4.5ex] 70 | \DeclareStringOption[3.5ex]{topheight}[3.5ex] 71 | \DeclareStringOption[1.5ex]{depth}[1.5ex] 72 | \DeclareStringOption[1em]{labelsep}[1em] 73 | \DeclareStringOption[1.6em]{indent}[1.6em] 74 | \DeclareStringOption[1.5ex]{hsep}[1.5ex] 75 | \DeclareStringOption[2.5em]{justsep}[2.5em] 76 | \DeclareStringOption[.2mm]{linethickness}[.2mm] 77 | \DeclareStringOption[1em]{cindent}[1em] 78 | \DeclareBoolOption[true]{outerline} 79 | 80 | % user command to redefine dimensions 81 | \def\nddim#1#2#3#4#5#6#7#8{ 82 | \setkeys{fitch}{ 83 | height=#1, 84 | topheight=#2, 85 | depth=#3, 86 | labelsep=#4, 87 | indent=#5, 88 | hsep=#6, 89 | justsep=#7, 90 | linethickness=#8 91 | } 92 | } 93 | 94 | \DeclareLocalOptions{ 95 | rules, 96 | arrayenv, 97 | justformat, 98 | refformat, 99 | height, 100 | topheight, 101 | depth, 102 | labelsep, 103 | indent, 104 | hsep, 105 | justsep, 106 | linethickness, 107 | cindent, 108 | outerline 109 | } 110 | 111 | \ProcessLocalKeyvalOptions{fitch} 112 | 113 | % Actual fitch.sty code 114 | 115 | \newlength{\nd@dim} 116 | 117 | % References 118 | 119 | \newcount\nd@ctr 120 | \def\nd@render{\expandafter\ifx\expandafter\nd@x\nd@base\nd@x\the\nd@ctr\else\nd@base\ifnum\nd@ctr<0\the\nd@ctr\else\ifnum\nd@ctr>0+\the\nd@ctr\fi\fi\fi} 121 | \expandafter\def\csname nd@-\endcsname{} 122 | 123 | \def\nd@num#1{\nd@numo{\nd@render}{#1}\global\advance\nd@ctr1} 124 | \def\nd@numopt#1#2{\nd@numo{$#1$}{#2}} 125 | \def\nd@numo#1#2{\edef\x{#1}\mbox{$\x$}\expandafter\global\expandafter\let\csname nd@-#2\endcsname\x} 126 | \def\nd@ref#1{\expandafter\let\expandafter\x\csname nd@-#1\endcsname\ifx\x\relax% 127 | \PackageWarning{fitch}{Undefined line reference: #1}\mbox{\textbf{??}}\else\csname\nd@refformat\endcsname{\mbox{$\x$}}\fi} 128 | \def\nd@noop{} 129 | \def\nd@set#1#2{\ifx\relax#1\nd@noop\else\global\def\nd@base{#1}\fi\ifx\relax#2\relax\else\global\nd@ctr=#2\fi} 130 | \def\nd@reset{\nd@set{}{1}} 131 | \def\nd@refa#1{\nd@ref{#1}} 132 | \def\nd@aux#1#2{\ifx#2-\nd@refa{#1}--\def\nd@c{\nd@aux{}}% 133 | \else\ifx#2,\nd@refa{#1}, \def\nd@c{\nd@aux{}}% 134 | \else\ifx#2;\nd@refa{#1}; \def\nd@c{\nd@aux{}}% 135 | \else\ifx#2.\nd@refa{#1}. \def\nd@c{\nd@aux{}}% 136 | \else\ifx#2)\nd@refa{#1})\def\nd@c{\nd@aux{}}% 137 | \else\ifx#2(\nd@refa{#1}(\def\nd@c{\nd@aux{}}% 138 | \else\ifx#2\nd@end\nd@refa{#1}\def\nd@c{}% 139 | \else\def\nd@c{\nd@aux{#1#2}}% 140 | \fi\fi\fi\fi\fi\fi\fi\nd@c} 141 | \def\ndref#1{\nd@aux{}#1\nd@end} 142 | 143 | % Layer A 144 | 145 | % set initial dimensions 146 | %\nddim{4.5ex}{3.5ex}{1.5ex}{1em}{1.6em}{.5em}{2.5em}{.2mm} 147 | 148 | \def\nd@v{\rule[-\nd@depth]{\nd@linethickness}{\nd@height}} 149 | \def\nd@h{\rule[-\nd@depth]{0mm}{\nd@height}} % strut 150 | \def\nd@t{\rule[-\nd@depth]{\nd@linethickness}{\nd@topheight}} 151 | \def\nd@i{\hspace{\nd@indent}} 152 | \def\nd@s{\hspace{\nd@hsep}} 153 | \def\nd@g#1{\nd@f{\makebox[\nd@indent][c]{$#1$}}} 154 | \def\nd@f#1{\raisebox{0pt}[0pt][0pt]{$#1$}} 155 | \def\nd@u#1{\makebox[0pt][l]{\settowidth{\nd@dim}{\nd@f{#1}}% 156 | \addtolength{\nd@dim}{\nd@hsep}\addtolength{\nd@dim}{\nd@hsep}% 157 | \hspace{-\nd@hsep}\rule[-\nd@depth]{\nd@dim}{\nd@linethickness}}\nd@f{#1}} 158 | 159 | % Lists 160 | 161 | \def\nd@push#1#2{\expandafter\gdef\expandafter#1\expandafter% 162 | {\expandafter\nd@cons\expandafter{#1}{#2}}} 163 | \def\nd@pop#1{{\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 164 | {\gdef#1{##1}}#1}} 165 | \def\nd@iter#1#2{{\def\nd@nil{}\def\nd@cons##1##2{##1#2{##2}}#1}} 166 | \def\nd@modify#1#2#3{{\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 167 | {\advance#2-1 ##1\advance#2 1 \ifnum#2=1\nd@push#1{#3}\else% 168 | \nd@push#1{##2}\fi}#1}} 169 | 170 | \def\nd@cont#1{{\def\nd@t{\nd@v}\def\nd@v{\nd@v}\def\nd@g##1{\nd@i}% 171 | \def\nd@i{\nd@i}\def\nd@nil{\gdef#1{\nd@nil}}\def\nd@cons##1##2% 172 | {##1\expandafter\nd@push\expandafter#1\expandafter{##2}}#1}} 173 | 174 | % Layer B 175 | 176 | \newcount\nd@n 177 | \def\nd@beginb{% 178 | \begingroup 179 | \nd@reset 180 | \gdef\nd@stack{\nd@nil}% 181 | \nd@push\nd@stack{\nd@h}% 182 | \ifnd@outerline 183 | \nd@push\nd@stack{\nd@t}\fi 184 | \begin{\nd@arrayenv}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 185 | \def\nd@resumeb{% 186 | \begingroup 187 | \begin{\nd@arrayenv}{l@{\hspace{\nd@labelsep}}l@{\hspace{\nd@justsep}}l}} 188 | \def\nd@endb{\end{\nd@arrayenv}\endgroup} 189 | \def\nd@hypob#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{#2}&} 190 | \def\nd@haveb#1#2{\nd@f{\nd@num{#1}}&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{#2}&} 191 | \def\nd@havecontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@f{\hspace{\nd@cindent}#2}&} 192 | \def\nd@hypocontb#1#2{&\nd@iter\nd@stack\relax\nd@cont\nd@stack\nd@s\nd@u{\hspace{\nd@cindent}#2}&} 193 | 194 | \def\nd@openb{\nd@push\nd@stack{\nd@i}\nd@push\nd@stack{\nd@t}} 195 | \def\nd@closeb{\nd@pop\nd@stack\nd@pop\nd@stack} 196 | \def\nd@guardb#1#2{\nd@n=#1\multiply\nd@n by 2 \nd@modify\nd@stack\nd@n{\nd@g{#2}}} 197 | 198 | % Layer C 199 | 200 | \def\nd@clr{\gdef\nd@cmd{}\gdef\nd@typ{\relax}} 201 | \def\nd@sto#1#2#3{\gdef\nd@typ{#1}\gdef\nd@byt{}% 202 | \gdef\nd@cmd{\nd@typ{#2}{#3}\nd@byt\\}} 203 | \def\nd@chtyp{\expandafter\ifx\nd@typ\nd@hypocontb\def\nd@typ{\nd@havecontb}\else\def\nd@typ{\nd@haveb}\fi} 204 | \def\nd@hypoc#1#2{\nd@chtyp\nd@cmd\nd@sto{\nd@hypob}{#1}{#2}} 205 | \def\nd@havec#1#2{\nd@cmd\nd@sto{\nd@haveb}{#1}{#2}} 206 | \def\nd@hypocontc#1{\nd@chtyp\nd@cmd\nd@sto{\nd@hypocontb}{}{#1}} 207 | \def\nd@havecontc#1{\nd@cmd\nd@sto{\nd@havecontb}{}{#1}} 208 | \def\nd@by#1#2{\ifx\nd@x#2\nd@x\gdef\nd@byt{\mbox{#1}}\else\ifx\nd@x#1\nd@x\gdef\nd@byt{\mbox{\ndref{#2}}}\else\gdef\nd@byt{\mbox{\csname\nd@justformat\endcsname{#1}{\ndref{#2}}}}\fi\fi\ignorespaces} 209 | 210 | % multi-line macros 211 | \def\nd@mhypoc#1#2{\nd@mhypocA{#1}#2\\\nd@stop\\} 212 | \def\nd@mhypocA#1#2\\{\nd@hypoc{#1}{#2}\nd@mhypocB} 213 | \def\nd@mhypocB#1\\{\ifx\nd@stop#1\else\nd@hypocontc{#1}\expandafter\nd@mhypocB\fi} 214 | \def\nd@mhavec#1#2{\nd@mhavecA{#1}#2\\\nd@stop\\} 215 | \def\nd@mhavecA#1#2\\{\nd@havec{#1}{#2}\nd@mhavecB} 216 | \def\nd@mhavecB#1\\{\ifx\nd@stop#1\else\nd@havecontc{#1}\expandafter\nd@mhavecB\fi} 217 | \def\nd@mhypocontc#1{\nd@mhypocB#1\\\nd@stop\\} 218 | \def\nd@mhavecontc#1{\nd@mhavecB#1\\\nd@stop\\} 219 | 220 | \def\nd@beginc{\nd@beginb\nd@clr} 221 | \def\nd@resumec{\nd@resumeb\nd@clr} 222 | \def\nd@endc{\nd@cmd\nd@endb} 223 | \def\nd@openc{\nd@cmd\nd@clr\nd@openb} 224 | \def\nd@closec{\nd@cmd\nd@clr\nd@closeb} 225 | \let\nd@guardc\nd@guardb 226 | 227 | % Layer D 228 | 229 | % macros with optional arguments spelled-out 230 | \def\nd@hypod[#1][#2]#3[#4]#5{\ifx\relax#4\relax\else\nd@guardb{1}{#4}\fi\nd@mhypoc{#3}{#5}\nd@set{#1}{#2}\ignorespaces} 231 | \def\nd@haved[#1][#2]#3[#4]#5{\ifx\relax#4\relax\else\nd@guardb{1}{#4}\fi\nd@mhavec{#3}{#5}\nd@set{#1}{#2}\ignorespaces} 232 | \def\nd@havecont#1{\nd@mhavecontc{#1}} 233 | \def\nd@hypocont#1{\nd@mhypocontc{#1}} 234 | \def\nd@base{undefined} 235 | \def\nd@opend[#1]#2{\nd@cmd\nd@clr\nd@openb\nd@guard{#1}#2} 236 | \def\nd@close{\nd@cmd\nd@clr\nd@closeb} 237 | \def\nd@guardd[#1]#2{\nd@guardb{#1}{#2}} 238 | 239 | % Handling of optional arguments. 240 | 241 | \def\nd@optarg#1#2#3{\ifx[#3\def\nd@c{#2#3}\else\def\nd@c{#2[#1]{#3}}\fi\nd@c} 242 | \def\nd@optargg#1#2#3{\ifx[#3\def\nd@c{#1#3}\else\def\nd@c{#2{#3}}\fi\nd@c} 243 | 244 | \def\nd@five#1{\nd@optargg{\nd@four{#1}}{\nd@two{#1}}} 245 | \def\nd@four#1[#2]{\nd@optarg{0}{\nd@three{#1}[#2]}} 246 | \def\nd@three#1[#2][#3]#4{\nd@optarg{}{#1[#2][#3]{#4}}} 247 | \def\nd@two#1{\nd@three{#1}[\relax][]} 248 | 249 | \def\nd@have{\nd@five{\nd@haved}} 250 | \def\nd@hypo{\nd@five{\nd@hypod}} 251 | \def\nd@open{\nd@optarg{}{\nd@opend}} 252 | \def\nd@guard{\nd@optarg{1}{\nd@guardd}} 253 | 254 | \def\nd@init{% 255 | \let\open\nd@open% 256 | \let\close\nd@close% 257 | \let\hypo\nd@hypo% 258 | \let\have\nd@have% 259 | \let\hypocont\nd@hypocont% 260 | \let\havecont\nd@havecont% 261 | \let\by\nd@by% 262 | \let\guard\nd@guard% 263 | \csname\nd@rules\endcsname 264 | } 265 | 266 | % Define default rule names 267 | 268 | \def\ndrules{% 269 | \def\ii{\by{$\Rightarrow$I}}% 270 | \def\ie{\by{$\Rightarrow$E}}% 271 | \def\Ai{\by{$\forall$I}}% 272 | \def\Ae{\by{$\forall$E}}% 273 | \def\Ei{\by{$\exists$I}}% 274 | \def\Ee{\by{$\exists$E}}% 275 | \def\ai{\by{$\wedge$I}}% 276 | \def\ae{\by{$\wedge$E}}% 277 | \def\ai{\by{$\wedge$I}}% 278 | \def\ae{\by{$\wedge$E}}% 279 | \def\oi{\by{$\vee$I}}% 280 | \def\oe{\by{$\vee$E}}% 281 | \def\ni{\by{$\neg$I}}% 282 | \def\ne{\by{$\neg$E}}% 283 | \def\be{\by{$\bot$E}}% 284 | \def\nne{\by{$\neg\neg$E}}% 285 | \def\r{\by{R}}} 286 | 287 | % default justification format 288 | 289 | \newcommand{\ndjustformat}[2]{#1, #2} 290 | 291 | % default line number format 292 | 293 | \newcommand{\ndrefformat}[1]{#1} 294 | 295 | % User-level commands for proofs 296 | 297 | \newenvironment{nd}[1][] 298 | {\begingroup 299 | \setkeys{fitch}{#1}% 300 | \nd@init\nd@beginc\ignorespaces} 301 | {\nd@endc\endgroup} 302 | \newenvironment{ndresume}[1][] 303 | {\begingroup 304 | \setkeys{fitch}{#1}% 305 | \nd@init\nd@resumec\ignorespaces} 306 | {\nd@endc\endgroup} 307 | \newenvironment{fitchproof}[1][] 308 | {\begin{list}{}{\setlength{\leftmargin}{0pt}}\item\begin{nd}[#1]} 309 | {\end{nd}\end{list}} 310 | \newenvironment{fitchproof*}[1][] 311 | {\begin{list}{}{\setlength{\leftmargin}{0pt}}\item\begin{ndresume}[#1]} 312 | {\end{ndresume}\end{list}} 313 | 314 | % End of file fitch.sty 315 | 316 | -------------------------------------------------------------------------------- /solutions/forallx-sol-frontmatter.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc.tex 2 | % Cover Page 3 | 4 | \thispagestyle{empty} 5 | 6 | \begin{textblock*}{\stockwidth}(0in,3.5in) 7 | \noindent\includegraphics{../assets/forallx-coverart-screen.pdf} 8 | \end{textblock*} 9 | 10 | % make front cover 11 | \begin{textblock*}{0in}(0in,0in) 12 | \noindent\hfill 13 | \begin{minipage}[b][\stockheight][s]{.9\stockwidth} 14 | \begin{raggedleft} 15 | \vspace*{1.7cm} 16 | \hfill 17 | \sffamily\fontsize{66pt}{0pt}\selectfont 18 | \color{lyallpink} 19 | \textbf{forall}% 20 | \fontsize{80pt}{0pt}\selectfont\rmfamily\textit{\textbf{x}\/} 21 | 22 | \vskip.5cm 23 | 24 | \sffamily\fontsize{24pt}{0pt}\selectfont 25 | \color{black} 26 | \textbf{\uppercase{Calgary}} 27 | 28 | \vspace*{1cm} 29 | \color{black} 30 | \sffamily 31 | \fontsize{20pt}{22pt}\selectfont 32 | \textbf{Solutions to\\ Selected Exercises} 33 | 34 | \vfill 35 | \fontsize{11pt}{14pt}\selectfont 36 | \color{white} 37 | \textbf{P.~D. Magnus}\\ 38 | \textbf{Tim Button}\\ 39 | \textbf{Richard Zach}\\ 40 | \textit{with contributions by}\\ 41 | \textbf{Robert Trueman}\\ 42 | \textbf{J.~Robert Loftis}\\ 43 | \textbf{Aaron Thomas-Bolduc}\\ \par 44 | \vspace{1cm} 45 | \textbf{\forallxversion}\par 46 | \vspace{1cm} 47 | \end{raggedleft} 48 | \end{minipage} 49 | \hspace*{1cm} 50 | \end{textblock*} 51 | \ 52 | \newpage 53 | \color{black} 54 | \setlength{\barlength}{0pt} % no bar next to chapter headings in ebook 55 | 56 | \noindent This booklet is based on the solutions booklet to \href{https://www.homepages.ucl.ac.uk/~uctytbu/OERs.html}{\forallx: \emph{Cambridge}}, by\\[2ex] 57 | \href{https://www.homepages.ucl.ac.uk/~uctytbu/}{Tim Button}\\ 58 | \emph{University of Cambridge}\\[2ex] 59 | used under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 4.0} license, based in turn on \href{https://www.fecundity.com/logic/}{\forallx}, by\\[2ex] 60 | \href{https://www.fecundity.com/job/}{P.D.\ Magnus}\\ 61 | \emph{University at Albany, State University of New York}\\[2ex] 62 | used under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 63 | 4.0} license, and was remixed \& expanded by\\[2ex] {Aaron 64 | Thomas-Bolduc \& \href{https://richardzach.org/}{Richard Zach}}\\ 65 | \emph{University of Calgary} 66 | \\ 67 | \\ 68 | It includes additional material from \forallx{} by P.D. Magnus, used 69 | under a \href{https://creativecommons.org/licenses/by/4.0/}{CC BY 4.0} 70 | license, and 71 | from \href{https://github.com/rob-helpy-chalk/openintroduction}{\forallx: \emph{Lorain 72 | County Remix}}, 73 | by \href{https://sites.google.com/site/cathalwoods/}{Cathal Woods} and 74 | J. Robert Loftis, and from 75 | \href{http://www.rtrueman.com/uploads/7/0/3/2/70324387/modal_logic_primer.pdf}{\emph{A Modal Logic Primer}} by \href{http://www.rtrueman.com/}{Robert 76 | Trueman}, used with permission. 77 | 78 | \bigskip 79 | 80 | \noindent This work is licensed under a \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0} license. 81 | You are free to copy and redistribute the material in any medium or format, and remix, transform, and build upon the material for any purpose, even commercially, under the following terms: 82 | \begin{itemize} 83 | \item You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 84 | \item You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 85 | \end{itemize} 86 | The \LaTeX{} source for this book is available on 87 | \href{https://github.com/rzach/forallx-yyc/}{GitHub} and a PDF at 88 | \href{https://forallx.openlogicproject.org}{forallx.openlogicproject.org}. 89 | This version is revision \gitAbbrevHash{} (\gitCommitterDate). 90 | 91 | \bigskip 92 | \noindent The preparation of this textbook was made possible by a grant from the \href{https://taylorinstitute.ucalgary.ca/}{Taylor Institute for Teaching and Learning}. 93 | 94 | \bigskip 95 | \noindent 96 | \href{https://taylorinstitute.ucalgary.ca/}{\includegraphics[width=8cm]{../assets/ti-color}} 97 | -------------------------------------------------------------------------------- /solutions/forallx-sol-interpretations.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc-solutions.tex 2 | %\part{Interpretations} 3 | %\label{ch.semantics} 4 | %\addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par} 5 | 6 | \stepcounter{chapter} % Extensionality 7 | 8 | \chapter{Truth in FOL}\setcounter{ProbPart}{0} 9 | \problempart 10 | \label{pr.TorF1} 11 | Consider the following interpretation: 12 | \begin{itemize} 13 | \item The domain comprises only Corwin and Benedict 14 | \item `$\atom{A}{x}$' is to be true of both Corwin and Benedict 15 | \item `$\atom{B}{x}$' is to be true of Benedict only 16 | \item `$\atom{N}{x}$' is to be true of no one 17 | \item `$c$' is to refer to Corwin 18 | \end{itemize} 19 | Determine whether each of the following sentences is true or false in that interpretation: 20 | \begin{compactlist} 21 | \item $\atom{B}{c}$ \hfill \myanswer{False} 22 | \item $\atom{A}{c} \eiff \enot \atom{N}{c}$ \hfill \myanswer{True} 23 | \item $\atom{N}{c} \eif (\atom{A}{c} \eor \atom{B}{c})$ \hfill \myanswer{True} 24 | \item $\forall x\,\atom{A}{x}$ \hfill \myanswer{True} 25 | \item $\forall x \enot \atom{B}{x}$ \hfill \myanswer{False} 26 | \item $\exists x(\atom{A}{x} \eand \atom{B}{x})$ \hfill \myanswer{True} 27 | \item $\exists x(\atom{A}{x} \eif \atom{N}{x})$ \hfill \myanswer{False} 28 | \item $\forall x(\atom{N}{x} \eor \enot \atom{N}{x})$ \hfill \myanswer{True} 29 | \item $\exists x\,\atom{B}{x} \eif \forall x\,\atom{A}{x}$ \hfill \myanswer{True} 30 | \end{compactlist} 31 | 32 | \problempart 33 | \label{pr.TorF2} 34 | Consider the following interpretation: 35 | \begin{itemize} 36 | \item The domain comprises only Lemmy, Courtney and Eddy 37 | \item `$\atom{G}{x}$' is to be true of Lemmy, Courtney and Eddy. 38 | \item `$\atom{H}{x}$' is to be true of and only of Courtney 39 | \item `$\atom{M}{x}$' is to be true of and only of Lemmy and Eddy 40 | \item `$c$' is to refer to Courtney 41 | \item `$e$' is to refer to Eddy 42 | \end{itemize} 43 | Determine whether each of the following sentences is true or false in that interpretation: 44 | \begin{compactlist} 45 | \item $\atom{H}{c}$ \hfill \myanswer{True} 46 | \item $\atom{H}{e}$\hfill \myanswer{False} 47 | \item $\atom{M}{c} \eor \atom{M}{e}$ \hfill \myanswer{True} 48 | \item $\atom{G}{c} \eor \enot \atom{G}{c}$ \hfill \myanswer{True} 49 | \item $\atom{M}{c} \eif \atom{G}{c}$ \hfill \myanswer{True} 50 | \item $\exists x\,\atom{H}{x}$ \hfill \myanswer{True} 51 | \item $\forall x\,\atom{H}{x}$ \hfill \myanswer{False} 52 | \item $\exists x \enot \atom{M}{x}$ \hfill \myanswer{True} 53 | \item $\exists x(\atom{H}{x} \eand \atom{G}{x})$ \hfill \myanswer{True} 54 | \item $\exists x(\atom{M}{x} \eand \atom{G}{x})$ \hfill \myanswer{True} 55 | \item $\forall x(\atom{H}{x} \eor \atom{M}{x})$ \hfill \myanswer{True} 56 | \item $\exists x\,\atom{H}{x} \eand \exists x\,\atom{M}{x}$ \hfill \myanswer{True} 57 | \item $\forall x(\atom{H}{x} \eiff \enot \atom{M}{x})$ \hfill \myanswer{True} 58 | \item $\exists x\,\atom{G}{x} \eand \exists x \enot \atom{G}{x}$ \hfill \myanswer{False} 59 | \item $\forall x\exists y(\atom{G}{x} \eand \atom{H}{y})$ \hfill \myanswer{True} 60 | \end{compactlist} 61 | 62 | \problempart 63 | \label{pr.TorF3} 64 | Following the diagram conventions introduced at the end of \S23, consider the following interpretation: 65 | \begin{center} 66 | \begin{tikzpicture} 67 | \node (atom1) at (0,2) {1}; 68 | \node (atom2) at (2,2) {2}; 69 | \node (atom4) at (0,0) {3}; 70 | \node (atom5) at (2,0) {4}; 71 | \node (atom6) at (4,0) {5}; 72 | \draw[->, thick] (atom1)+(-0.15,0.15) arc (-330:-30:.3); 73 | \draw[->, thick] (atom6)+(0.15,-0.15) arc (-150:150:.3); 74 | \draw[->, thick] (atom1) -- (atom2); 75 | \draw[->, thick] (atom1) -- (atom4); 76 | \draw[<->, thick] (atom1) -- (atom5); 77 | \draw[->, thick] (atom1) -- (atom6); 78 | \draw[->, thick] (atom2) -- (atom6); 79 | \end{tikzpicture} 80 | \end{center} 81 | Determine whether each of the following sentences is true or false in that interpretation: 82 | \begin{compactlist} 83 | \item $\exists x\,\atom{R}{x,x}$ \hfill \myanswer{True} 84 | \item $\forall x\,\atom{R}{x,x}$ \hfill \myanswer{False} 85 | \item $\exists x \forall y\,\atom{R}{x,y}$ \hfill \myanswer{True} 86 | \item $\exists x \forall y\,\atom{R}{y,x}$ \hfill \myanswer{False} 87 | \item $\forall x \forall y \forall z ((\atom{R}{x,y} \eand \atom{R}{y,z}) \eif \atom{R}{x,z})$ \hfill \myanswer{False} 88 | \item $\forall x \forall y \forall z ((\atom{R}{x,y} \eand \atom{R}{x,z}) \eif \atom{R}{y,z})$ \hfill \myanswer{False} 89 | \item $\exists x \forall y \enot \atom{R}{x,y}$ \hfill \myanswer{True} 90 | \item $\forall x(\exists y\,\atom{R}{x,y} \eif \exists y\,\atom{R}{y,x})$ \hfill \myanswer{True} 91 | \item $\exists x \exists y (\enot x = y \eand \atom{R}{x,y} \eand \atom{R}{y,x})$ \hfill \myanswer{True} 92 | \item $\exists x \forall y(\atom{R}{x,y} \eiff x = y)$ \hfill \myanswer{True} 93 | \item $\exists x \forall y(\atom{R}{y,x} \eiff x = y)$ \hfill \myanswer{False} 94 | \item $\exists x \exists y(\enot x = y \eand \atom{R}{x,y} \eand \forall z(\atom{R}{z,x} \eiff y = z))$ \hfill \myanswer{True} 95 | \end{compactlist} 96 | 97 | \chapter{Semantic concepts} 98 | \setcounter{ProbPart}{0} 99 | 100 | \solutions 101 | \problempart 102 | Given the following interpretation: 103 | \begin{ekey} 104 | \item[\text{domain}] people 105 | \item[\atom{W}{x}] \gap{x} is a woman (or girl) 106 | \item[\atom{M}{x}] \gap{x} is a man (or boy) 107 | \item[\atom{Y}{x,y}] \gap{x} is younger than \gap{y} 108 | \item[\atom{O}{x,y}] \gap{x} is an offspring of \gap{y} 109 | \item[d] Dana 110 | \item[a] Alex 111 | \end{ekey} 112 | express the following relations: 113 | \begin{compactlist} 114 | \item \gap{x} is older than \gap{y} \hfill\myanswer{$\atom{Y}{y,x}$} 115 | \item \gap{x} is \gap{y}'s mother \hfill\myanswer{$\atom{O}{y,x} 116 | \eand \atom{W}{x}$} 117 | \item \gap{x} and \gap{y} are siblings (note that you can't be your 118 | own sibling) \hfill\myanswer{$\exists z(\atom{O}{x,z} \eand 119 | \atom{O}{y,z}) \eand \enot x=y$} 120 | \item \gap{x} is \gap{y}'s brother \hfill\myanswer{$\exists z(\atom{O}{x,z} \eand 121 | \atom{O}{y,z}) \eand \enot x=y \eand \atom{M}{x}$} 122 | \end{compactlist} 123 | 124 | \problempart 125 | Using the symbolization key from the previous 126 | exercise, symbolize the following sentences: 127 | \begin{compactlist} 128 | \item Alex and Dana are sisters. \hfill\myanswer{$\exists z(\atom{O}{a,z} \eand 129 | \atom{O}{d,z}) \eand \enot a=d \eand \atom{W}{a} \eand \atom{W}{d}$} 130 | \item Fathers are older than their children. 131 | \hfill\myanswer{$\forall x\forall y((\atom{O}{x,y} \eand 132 | \atom{M}{y}) \eif \atom{Y}{x,y})$} 133 | \item Alex's parents are the same age. \hfill\myanswer{$\forall 134 | x\forall y((\atom{O}{x,a} \eand 135 | \atom{O}{y,a}) \eif \enot \atom{Y}{x,y})$} 136 | \end{compactlist} 137 | 138 | \chapter{Using Interpretations}\setcounter{ProbPart}{0} 139 | 140 | \solutions 141 | \problempart 142 | \label{pr.Contingent} 143 | Show that each of the following is neither a validity nor a contradiction: 144 | \begin{compactlist} 145 | \item $\atom{D}{a} \eand \atom{D}{b}$ 146 | 147 | \myanswer{The sentence is true in this model: 148 | \begin{ekey} 149 | \item[\text{domain}] Stan 150 | \item[D(x)] Stan 151 | \item[a] Stan 152 | \item[b] Stan 153 | \end{ekey} 154 | And it is false in this model: 155 | \begin{ekey} 156 | \item[\text{domain}] Stan 157 | \item[D(x)] % $\emptyset$ 158 | \item[a] Stan 159 | \item[b] Stan 160 | \end{ekey}} 161 | \item \leftsolutions\ $\exists x\,\atom{T}{x,h}$ 162 | 163 | \myanswer{The sentence is true in this model: 164 | \begin{ekey} 165 | \item[\text{domain}] Stan 166 | \item[T(x,y)] \ntuple{Stan, Stan} 167 | \item[h] Stan 168 | \end{ekey} 169 | And it is false in this model: 170 | \begin{ekey} 171 | \item[\text{domain}] Stan 172 | \item[T(x,y)] % $\emptyset$ 173 | \item[h] Stan 174 | \end{ekey}} 175 | 176 | \item $\atom{P}{m} \eand \enot\forall x\,\atom{P}{x}$ 177 | 178 | \myanswer{ The sentence is true in this model: 179 | \begin{ekey} 180 | \item[\text{domain}] Stan, Ollie 181 | \item[P(x)] Stan 182 | \item[m] Stan 183 | \end{ekey} 184 | And it is false in this model: 185 | \begin{ekey} 186 | \item[\text{domain}] Stan 187 | \item[P(x)] % $\emptyset$ 188 | \item[m] Stan 189 | \end{ekey}} 190 | \item $\forall z\, \atom{J}{z} \eiff \exists y\,\atom{J}{y}$ 191 | \item $\forall x (\atom{W}{x,m,n} \eor \exists y\,\atom{L}{x,y})$ 192 | \item $\exists x (\atom{G}{x} \eif \forall y\,\atom{M}{y})$ 193 | \item $\exists x (x = h \eand x = i)$ 194 | \end{compactlist} 195 | 196 | \solutions 197 | \problempart 198 | \label{pr.NotEquiv} 199 | Show that the following pairs of sentences are not logically equivalent. 200 | \begin{compactlist} 201 | \item $\atom{J}{a}$, $\atom{K}{a}$ 202 | 203 | \myanswer{Making the first sentence true and the second false: 204 | \begin{ekey} 205 | \item[\text{domain}] $0$ 206 | \item[J(x)] $0$ 207 | \item[K(x)] % $\emptyset$ 208 | \item[a] $0$ 209 | \end{ekey}} 210 | \item $\exists x\,\atom{J}{x}$, $\atom{J}{m}$ 211 | 212 | \myanswer{Making the first sentence true and the second false: 213 | \begin{ekey} 214 | \item[\text{domain}] $0$, $1$ 215 | \item[J(x)] $0$ 216 | \item[m] $1$ 217 | \end{ekey}} 218 | \item $\forall x\,\atom{R}{x,x}$, $\exists x\,\atom{R}{x,x}$ 219 | 220 | \myanswer{Making the first sentence false and the second true: 221 | \begin{ekey} 222 | \item[\text{domain}] $0$, $1$ 223 | \item[R(x,y)] \ntuple{$0$,$0$} 224 | \end{ekey}} 225 | \item $\exists x\,\atom{P}{x} \eif \atom{Q}{c}$, $\exists x (\atom{P}{x} \eif \atom{Q}{c})$ 226 | 227 | \myanswer{Making the first sentence false and the second true: 228 | \begin{ekey} 229 | \item[\text{domain}] $0$, $1$ 230 | \item[P(x)] $0$ 231 | \item[Q(x)] % $\emptyset$ 232 | \item[c] $0$ 233 | \end{ekey}} 234 | \item $\forall x(\atom{P}{x} \eif \enot \atom{Q}{x})$, $\exists x(\atom{P}{x} \eand \enot \atom{Q}{x})$ 235 | 236 | \myanswer{Making the first sentence true and the second false: 237 | \begin{ekey} 238 | \item[\text{domain}] $0$ 239 | \item[P(x)] % $\emptyset$ 240 | \item[Q(x)] % $\emptyset$ 241 | \end{ekey}} 242 | \item $\exists x(\atom{P}{x} \eand \atom{Q}{x})$, $\exists x(\atom{P}{x} \eif \atom{Q}{x})$ 243 | 244 | \myanswer{Making the first sentence false and the second true: 245 | \begin{ekey} 246 | \item[\text{domain}] $0$ 247 | \item[P(x)] % $\emptyset$ 248 | \item[Q(x)] $0$ 249 | \end{ekey}} 250 | \item $\forall x(\atom{P}{x}\eif \atom{Q}{x})$, $\forall x(\atom{P}{x} \eand \atom{Q}{x})$ 251 | 252 | \myanswer{Making the first sentence true and the second false: 253 | \begin{ekey} 254 | \item[\text{domain}] $0$ 255 | \item[P(x)] % $\emptyset$ 256 | \item[Q(x)] $0$ 257 | \end{ekey}} 258 | \item $\forall x\exists y\,\atom{R}{x,y}$, $\exists x\forall y\,\atom{R}{x,y}$ 259 | 260 | \myanswer{Making the first sentence true and the second false: 261 | \begin{ekey} 262 | \item[\text{domain}] $0$, $1$ 263 | \item[R(x,y)] \ntuple{$0$, $1$}, \ntuple{$1$, $0$} 264 | \end{ekey}} 265 | \item $\forall x\exists y\,\atom{R}{x,y}$, $\forall x\exists y\,\atom{R}{y,x}$ 266 | 267 | \myanswer{Making the first sentence false and the second true: 268 | \begin{ekey} 269 | \item[\text{domain}] $0$, $1$ 270 | \item[R(x,y)] \ntuple{$0$, $0$}, \ntuple{$0$, $1$} 271 | \end{ekey}} 272 | \end{compactlist} 273 | 274 | 275 | \problempart 276 | Show that the following sentences are jointly satisfiable: 277 | \begin{compactlist} 278 | \item $\atom{M}{a}, \enot \atom{N}{a}, Pa, \enot \atom{Q}{a}$ 279 | \item $\atom{L}{e,e}, \atom{L}{e,g}, \enot \atom{L}{g,e}, \enot \atom{L}{g,g}$ 280 | \item $\enot (\atom{M}{a} \eand \exists x\,\atom{A}{x}), Ma \eor \atom{F}{a}, \forall x(\atom{F}{x} \eif \atom{A}{x})$ 281 | \item $\atom{M}{a} \eor \atom{M}{b}, \atom{M}{a} \eif \forall x \enot \atom{M}{x}$ 282 | \item $\forall y\,\atom{G}{y}, \forall x (\atom{G}{x} \eif \atom{H}{x}), \exists y \enot \atom{I}{y}$ 283 | \item $\exists x(\atom{B}{x} \eor \atom{A}{x}), \forall x \enot \atom{C}{x}, \forall x\bigl[(\atom{A}{x} \eand \atom{B}{x}) \eif \atom{C}{x}\bigr]$ 284 | \item $\exists x\,\atom{X}{x}, \exists x\,\atom{Y}{x}, \forall x(\atom{X}{x} \eiff \enot \atom{Y}{x})$ 285 | \item $\forall x(\atom{P}{x} \eor \atom{Q}{x}), \exists x\enot(\atom{Q}{x} \eand \atom{P}{x})$ 286 | \item $\exists z(\atom{N}{z} \eand \atom{O}{z,z}), \forall x\forall y(\atom{O}{x,y} \eif \atom{O}{y,x})$ 287 | \item $\enot \exists x \forall y\,\atom{R}{x,y}, \forall x \exists y\,\atom{R}{x,y}$ 288 | \item $\enot \atom{R}{a,a}$, $\forall x (x=a \eor \atom{R}{x,a})$ 289 | 290 | \myanswer{The sentences are both true in this interpretation: 291 | \begin{ekey} 292 | \item[\text{domain}] Harry, Sally 293 | \item[R(x,y)]\ntuple{Sally, Harry} 294 | \item[a] Harry 295 | \end{ekey}} 296 | \item $\forall x\forall y\forall z[(x=y \eor y=z )\eor x=z]$, $\exists x\exists y\ \enot x= y$ 297 | 298 | \myanswer{There are no predicates or constants, so we only need to give a domain. 299 | Any domain with 2 elements will do.} 300 | \item $\exists x\exists y((\atom{Z}{x} \eand \atom{Z}{y} )\eand x=y)$, $\enot \atom{Z}{d}$, $d=e$ 301 | \end{compactlist} 302 | 303 | \problempart 304 | Show that the following arguments are invalid: 305 | \begin{compactlist} 306 | \item $\forall x(\atom{A}{x} \eif \atom{B}{x}) \therefore \exists x\,\atom{B}{x}$ 307 | \item $\forall x(\atom{R}{x} \eif \atom{D}{x}), \forall x(\atom{R}{x} \eif \atom{F}{x}) \therefore \exists x(\atom{D}{x} \eand \atom{F}{x})$ 308 | \item $\exists x(\atom{P}{x}\eif \atom{Q}{x}) \therefore \exists x\,\atom{P}{x}$ 309 | \item $\atom{N}{a} \eand \atom{N}{b} \eand \atom{N}{c} \therefore \forall x\,\atom{N}{x}$ 310 | \item $\atom{R}{d,e}, \exists x\,\atom{R}{xd} \therefore \atom{R}{e,d}$ 311 | \item $\exists x(\atom{E}{x} \eand \atom{F}{x}), \exists x\,\atom{F}{x} \eif \exists x\,\atom{G}{x} \therefore \exists x(\atom{E}{x} \eand \atom{G}{x})$ 312 | \item $\forall x\,\atom{O}{x,c}, \forall x\,\atom{O}{c,x} \therefore \forall x\,\atom{O}{x,x}$ 313 | \item $\exists x(\atom{J}{x} \eand \atom{K}{x}), \exists x \enot \atom{K}{x}, \exists x \enot \atom{J}{x} \therefore \exists x(\enot \atom{J}{x} \eand \enot \atom{K}{x})$ 314 | \item $\atom{L}{a,b} \eif \forall x\,\atom{L}{x,b}, \exists x\,\atom{L}{x,b} \therefore \atom{L}{b,b}$ 315 | \item $\forall x(\atom{D}{x} \eif \exists y\,\atom{T}{y,x}) \therefore \exists y \exists z\ \enot y= z$ 316 | \end{compactlist} 317 | 318 | \stepcounter{chapter} % Reasoning about interpretations 319 | 320 | \chapter{Properties of relations} 321 | \setcounter{ProbPart}{0} 322 | 323 | \solutions 324 | \problempart 325 | Give examples of relations with the following properties: 326 | \begin{compactlist} 327 | \item Reflexive but not symmetric \hfill\myanswer{\gap{x} is no 328 | older than \gap{y}} 329 | \item Symmetric but not transitive \hfill\myanswer{\gap{x} is within 330 | 1~km of \gap{y}} 331 | \item Transitive, symmetric, but not reflexive 332 | \hfill\myanswer{\gap{x} is a full (i.e., not half) sibling of \gap{y}} 333 | \end{compactlist} 334 | 335 | \problempart 336 | Show that a relation can be both symmetric and anti-symmetric by 337 | giving an interpretation that makes both of the following sentences 338 | true: 339 | \begin{align*} 340 | & \forall x\forall y(\atom{R}{x,y} \eif \atom{R}{y,x})\\ 341 | & \forall x\forall y((\atom{R}{x,y} \eand \atom{R}{y,x}) \eif x=y) 342 | \end{align*} 343 | \myanswer{\begin{ekey} 344 | \item[\text{domain}] $0$ 345 | \item[\atom{R}{x,y}] \ntuple{$0$, $0$} 346 | \end{ekey}} 347 | -------------------------------------------------------------------------------- /solutions/forallx-sol-metatheory.tex: -------------------------------------------------------------------------------- 1 | 2 | \chapter{Normal forms}\setcounter{ProbPart}{0} 3 | 4 | \problempart 5 | \label{pr.DNF} 6 | Consider the following sentences: 7 | \begin{compactlist} 8 | \item $(A \eif \enot B)$ 9 | \item $\enot (A \eiff B)$ 10 | \item $(\enot A \eor \enot (A \eand B))$ 11 | \item $(\enot (A \eif B ) \eand (A \eif C))$ 12 | \item $(\enot (A \eor B) \eiff ((\enot C \eand \enot A) \eif \enot B))$ 13 | \item $((\enot (A \eand \enot B) \eif C) \eand \enot (A \eand D))$ 14 | \end{compactlist} 15 | For each sentence, find an equivalent sentence in DNF and one in CNF. 16 | \myanswer{We give a solution for (2). The truth table for $\enot (A \eiff B)$ is: 17 | \begin{center} 18 | \begin{tabular}{c c | l} 19 | $A$ & $B$ & $\enot (A \eiff B)$\\ 20 | \hline 21 | T & T & F \\ 22 | T & F & T \\ 23 | F & T & T \\ 24 | F & F & F \\ 25 | \end{tabular} 26 | \end{center} 27 | A sentence in DNF can be read off from lines 2 and 3: 28 | \[(A \eand \enot B) \eor (\enot A \eand B)\] 29 | and one in CNF from lines 1 and~4: 30 | \[(\enot A \eor \enot B) \eand (A \eor B).\]} 31 | 32 | \stepcounter{chapter} % Functional completeness 33 | 34 | \chapter{Proving equivalences}\setcounter{ProbPart}{0} 35 | 36 | \problempart 37 | \label{pr.DNF2} 38 | Consider the following sentences: 39 | \begin{compactlist} 40 | \item $(A \eif \enot B)$ 41 | \item $\enot (A \eiff B)$ 42 | \item $(\enot A \eor \enot (A \eand B))$ 43 | \item $(\enot (A \eif B ) \eand (A \eif C))$ 44 | \item $(\enot (A \eor B) \eiff ((\enot C \eand \enot A) \eif \enot B))$ 45 | \item $((\enot (A \eand \enot B) \eif C) \eand \enot (A \eand D))$ 46 | \end{compactlist} 47 | For each sentence, find an equivalent sentence in DNF and one inCNF by giving a chain of equivalences. Use (Id), (Absorp), and (Simp) to simplify your sentences as much as possible. 48 | \myanswer{We give a solution for (2). Removing `$\eiff$' and pushing negations inward is common to both: 49 | \begin{align*} 50 | & \enot (A \eiff B)\\ 51 | & \enot((A \eif B) \eand (B \eif A)) && \text{Bicond}\\ 52 | & \enot((\enot A \eor B) \eand (B \eif A)) && \text{Cond}\\ 53 | & \enot((\enot A \eor B) \eand (\enot B \eor A)) && \text{Cond}\\ 54 | & \enot(\enot A \eor B) \eor \enot(\enot B \eor A) && \text{DeM}\\ 55 | & (\enot\enot A \eand \enot B) \eor (\enot\enot B \eand \enot A) && \text{DeM}\\ 56 | & (A \eand \enot B) \eor (\enot\enot B \eand \enot A) && \text{DN}\\ 57 | & (A \eand \enot B) \eor (B \eand \enot A) && \text{DN} 58 | \intertext{The result is now in DNF. To obtain a CNF, we keep going, using (Comm) and (Dist):} 59 | & ((A \eand \enot B) \eor B) \eand ((A \eand \enot B) \eor \enot A) && \text{Dist}\\ 60 | & (B \eor (A \eand \enot B)) \eand ((A \eand \enot B) \eor \enot A) && \text{Comm}\\ 61 | & ((B \eor A) \eand (B \eor \enot B)) \eand ((A \eand \enot B) \eor \enot A) && \text{Dist}\\ 62 | & ((B \eor A) \eand (B \eor \enot B)) \eand (\enot A \eor (A \eand \enot B)) && \text{Comm}\\ 63 | & ((B \eor A) \eand (B \eor \enot B)) \eand ((\enot A \eor A) \eand (\enot A \eor \enot B)) && \text{Dist}\\ 64 | \intertext{The result can be simplified using (Simp):} 65 | & (B \eor A) \eand ((\enot A \eor A) \eand (\enot A \eor \enot B)) && \text{Simp}\\ 66 | & (B \eor A) \eand (\enot A \eor \enot B) && \text{Simp} 67 | \end{align*}} 68 | 69 | \stepcounter{chapter} % Soundness -------------------------------------------------------------------------------- /solutions/forallx-sol-tfl.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc-solutions.tex 2 | %\part{Truth-functional logic} 3 | %\label{ch.TFL} 4 | %\addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par} 5 | 6 | 7 | \stepcounter{chapter} % first steps 8 | 9 | \chapter{Connectives}\setcounter{ProbPart}{0} 10 | \problempart Using the symbolization key given, symbolize each English sentence in TFL.\label{pr.monkeysuits} 11 | \begin{ekey} 12 | \item[M] Those creatures are men in suits 13 | \item[C] Those creatures are chimpanzees 14 | \item[G] Those creatures are gorillas 15 | \end{ekey} 16 | \begin{compactlist} 17 | \item Those creatures are not men in suits. 18 | \item[] \myanswer{$\enot M$} 19 | \item Those creatures are men in suits, or they are not. 20 | \item[] \myanswer{$(M \eor \enot M$)} 21 | \item Those creatures are either gorillas or chimpanzees. 22 | \item[] \myanswer{$(G \eor C)$} 23 | \item Those creatures are neither gorillas nor chimpanzees. 24 | \item[] \myanswer{$\enot (C \eor G)$} 25 | \item If those creatures are chimpanzees, then they are neither gorillas nor men in suits. 26 | \item[] \myanswer{$(C \eif \enot(G \eor M))$} 27 | \item Unless those creatures are men in suits, they are either chimpanzees or they are gorillas. 28 | \item[] \myanswer{$(M \eor (C \eor G))$} 29 | \end{compactlist} 30 | 31 | \problempart Using the symbolization key given, symbolize each English sentence in TFL. 32 | \begin{ekey} 33 | \item[A] Mister Ace was murdered 34 | \item[B] The butler did it 35 | \item[C] The cook did it 36 | \item[D] The Duchess is lying 37 | \item[E] Mister Edge was murdered 38 | \item[F] The murder weapon was a frying pan 39 | \end{ekey} 40 | \begin{compactlist} 41 | \item Either Mister Ace or Mister Edge was murdered. 42 | \item[] \myanswer{$(A \eor E)$} 43 | \item If Mister Ace was murdered, then the cook did it. 44 | \item[] \myanswer{$(A \eif C)$} 45 | \item If Mister Edge was murdered, then the cook did not do it. 46 | \item[] \myanswer{$(E \eif \enot C)$} 47 | \item Either the butler did it, or the Duchess is lying. 48 | \item[] \myanswer{$(B \eor D)$} 49 | \item The cook did it only if the Duchess is lying. 50 | \item[] \myanswer{$(C \eif D)$} 51 | \item If the murder weapon was a frying pan, then the culprit must have been the cook. 52 | \item[] \myanswer{$(F \eif C)$} 53 | \item If the murder weapon was not a frying pan, then the culprit was either the cook or the butler. 54 | \item[] \myanswer{$(\enot F \eif (C \eor B))$} 55 | \item Mister Ace was murdered if and only if Mister Edge was not murdered. 56 | \item[] \myanswer{$(A \eiff \enot E)$} 57 | \item The Duchess is lying, unless it was Mister Edge who was murdered. 58 | \item[] \myanswer{$(D \eor E)$} 59 | \item If Mister Ace was murdered, he was done in with a frying pan. 60 | \item[] \myanswer{$(A \eif F)$} 61 | \item Since the cook did it, the butler did not. 62 | \item[] \myanswer{$(C \eand \enot B)$} 63 | \item Of course the Duchess is lying! 64 | \item[] \myanswer{$D$} 65 | \end{compactlist} 66 | 67 | \solutions 68 | 69 | \problempart Using the symbolization key given, symbolize each English sentence in TFL.\label{pr.avacareer} 70 | \begin{ekey} 71 | \item[E_1] Ava is an electrician 72 | \item[E_2] Harrison is an electrician 73 | \item[F_1] Ava is a firefighter 74 | \item[F_2] Harrison is a firefighter 75 | \item[S_1] Ava is satisfied with her career 76 | \item[S_2] Harrison is satisfied with his career 77 | \end{ekey} 78 | \begin{compactlist} 79 | \item Ava and Harrison are both electricians. 80 | \item[] \myanswer{$(E_1 \eand E_2)$} 81 | \item If Ava is a firefighter, then she is satisfied with her career. 82 | \item[] \myanswer{$(F_1 \eif S_1)$} 83 | \item Ava is a firefighter, unless she is an electrician. 84 | \item[] \myanswer{$(F_1 \eor E_1)$} 85 | \item Harrison is an unsatisfied electrician. 86 | \item[] \myanswer{$(E_2 \eand \enot S_2)$} 87 | \item Neither Ava nor Harrison is an electrician. 88 | \item[] \myanswer{$\enot (E_1 \eor E_2)$} 89 | \item Both Ava and Harrison are electricians, but neither of them find it satisfying. 90 | \item[] \myanswer{$((E_1 \eand E_2) \eand \enot (S_1 \eor S_2))$} 91 | \item Harrison is satisfied only if he is a firefighter. 92 | \item[] \myanswer{$(S_2 \eif F_2)$} 93 | \item If Ava is not an electrician, then neither is Harrison, but if she is, then he is too. 94 | \item[] \myanswer{$((\enot E_1 \eif \enot E_2) \eand (E_1 \eif E_2))$} 95 | \item Ava is satisfied with her career if and only if Harrison is not satisfied with his. 96 | \item[] \myanswer{$(S_1 \eiff \enot S_2)$} 97 | \item If Harrison is both an electrician and a firefighter, then he must be satisfied with his work. 98 | \item[] \myanswer{$((E_2 \eand F_2) \eif S_2)$} 99 | \item It cannot be that Harrison is both an electrician and a firefighter. 100 | \item[] \myanswer{$\enot (E_2 \eand F_2)$} 101 | \item Harrison and Ava are both firefighters if and only if neither of them is an electrician. 102 | \item[] \myanswer{$((F_2 \eand F_1) \eiff \enot(E_2 \eor E_1))$} 103 | \end{compactlist} 104 | 105 | \problempart 106 | Using the symbolization key given, translate each English-language sentence into TFL. 107 | \label{pr.jazzinstruments} 108 | \begin{ekey} 109 | \item[J_1] John Coltrane played tenor sax 110 | \item[J_2] John Coltrane played soprano sax 111 | \item[J_3] John Coltrane played tuba 112 | \item[M_1] Miles Davis played trumpet 113 | \item[M_2] Miles Davis played tuba 114 | \end{ekey} 115 | 116 | \begin{compactlist} 117 | \item John Coltrane played tenor and soprano sax. 118 | \item[~] \myanswer{$J_1 \eand J_2$} 119 | \item Neither Miles Davis nor John Coltrane played tuba. 120 | \item[~] \myanswer{$\enot(M_2 \eor J_3)$ or $\enot M_2 \eand \enot J_3$} 121 | \item John Coltrane did not play both tenor sax and tuba. 122 | \item[~] \myanswer{$\enot(J_1 \eand J_3)$ or $\enot J_1 \eor \enot J_3$} 123 | \item John Coltrane did not play tenor sax unless he also played soprano sax. 124 | \item[~] \myanswer{$\enot J_1 \eor J_2$} 125 | \item John Coltrane did not play tuba, but Miles Davis did. 126 | \item[~] \myanswer{$\enot J_3 \eand M_2$} 127 | \item Miles Davis played trumpet only if he also played tuba. 128 | \item[~] \myanswer{$M_1 \eif M_2$} 129 | \item If Miles Davis played trumpet, then John Coltrane played at least one of these three instruments: tenor sax, soprano sax, or tuba. 130 | \item[~] \myanswer{$M_1 \eif (J_1 \eor (J_2 \eor J_3))$} 131 | \item If John Coltrane played tuba then Miles Davis played neither trumpet nor tuba. 132 | \item[~] \myanswer{$J_3 \eif \enot(M_1 \eor M_2)$ or $J_3 \eif (\enot M_1 \eand \enot M_2)$} 133 | \item Miles Davis and John Coltrane both played tuba if and only if Coltrane did not play tenor sax and Miles Davis did not play trumpet. 134 | \item[~] \myanswer{$(J_3 \eand M_2) \eiff (\enot J_1 \wedge \enot M_1)$ or $(J_3 \eand M_2) \eiff \enot (J_1 \eor M_1)$} 135 | \end{compactlist} 136 | 137 | \problempart 138 | \label{pr.spies} 139 | Give a symbolization key and symbolize the following English sentences in TFL. 140 | \myanswer{\begin{ekey} 141 | \item[A] Alice is a spy 142 | \item[B] Bob is a spy 143 | \item[C] The code has been broken 144 | \item[G] The German embassy will be in an uproar 145 | \end{ekey}} 146 | \begin{compactlist} 147 | \item Alice and Bob are both spies. 148 | \item[] \myanswer{$(A \eand B)$} 149 | \item If either Alice or Bob is a spy, then the code has been broken. 150 | \item[] \myanswer{$((A \eor B) \eif C)$} 151 | \item If neither Alice nor Bob is a spy, then the code remains unbroken. 152 | \item[] \myanswer{$(\enot (A \eor B) \eif \enot C)$} 153 | \item The German embassy will be in an uproar, unless someone has broken the code. 154 | \item[] \myanswer{$(G \eor C)$} 155 | \item Either the code has been broken or it has not, but the German embassy will be in an uproar regardless. 156 | \item[] \myanswer{$((C \eor \enot C) \eand G)$} 157 | \item Either Alice or Bob is a spy, but not both. 158 | \item[] \myanswer{$((A \eor B) \eand \enot (A \eand B))$} 159 | \end{compactlist} 160 | 161 | 162 | \problempart Give a symbolization key and symbolize the following English sentences in TFL. 163 | \myanswer{\begin{ekey} 164 | \item[F] There is food to be found in the pridelands 165 | \item[R] Rafiki will talk about squashed bananas 166 | \item[A] Simba is alive 167 | \item[K] Scar will remain as king 168 | \end{ekey}} 169 | \begin{compactlist} 170 | \item If there is food to be found in the pridelands, then Rafiki will talk about squashed bananas. 171 | \item[] \myanswer{$(F \eif R)$} 172 | \item Rafiki will talk about squashed bananas unless Simba is alive. 173 | \item[] \myanswer{$(R \eor A)$} 174 | \item Rafiki will either talk about squashed bananas or he won't, but there is food to be found in the pridelands regardless. 175 | \item[] \myanswer{$((R \eor \enot R) \eand F)$} 176 | \item Scar will remain as king if and only if there is food to be found in the pridelands. 177 | \item[] \myanswer{$(K \eiff F)$} 178 | \item If Simba is alive, then Scar will not remain as king. 179 | \item[] \myanswer{$(A \eif \enot K)$} 180 | \end{compactlist} 181 | 182 | 183 | \problempart 184 | For each argument, write a symbolization key and symbolize all of the sentences of the argument in TFL. 185 | \begin{compactlist} 186 | \item If Dorothy plays the piano in the morning, then Roger wakes up cranky. Dorothy plays piano in the morning unless she is distracted. So if Roger does not wake up cranky, then Dorothy must be distracted. 187 | \myanswer{\begin{ekey} 188 | \item[P] Dorothy plays the Piano in the morning 189 | \item[C] Roger wakes up cranky 190 | \item[D] Dorothy is distracted 191 | \end{ekey}} 192 | \item[] \myanswer{$(P \eif C)$, $(P \eor D)$, $(\enot C \eif D)$} 193 | \item It will either rain or snow on Tuesday. If it rains, Neville will be sad. If it snows, Neville will be cold. Therefore, Neville will either be sad or cold on Tuesday. 194 | \myanswer{\begin{ekey} 195 | \item[T_1] It rains on Tuesday 196 | \item[T_2] It snows on Tuesday 197 | \item[S] Neville is sad on Tuesday 198 | \item[C] Neville is cold on Tuesday 199 | \end{ekey}} 200 | \item[] \myanswer{$(T_1 \eor T_2)$, $(T_1 \eif S)$, $(T_2 \eif C)$, $(S \eor C)$} 201 | \item If Zoog remembered to do his chores, then things are clean but not neat. If he forgot, then things are neat but not clean. Therefore, things are either neat or clean; but not both. 202 | \myanswer{\begin{ekey} 203 | \item[Z] Zoog remembered to do his chores 204 | \item[C] Things are clean 205 | \item[N] Things are neat 206 | \end{ekey}} 207 | \item[] \myanswer{$(Z \eif (C \eand \enot N))$, $(\enot Z \eif (N \eand \enot C))$, $((N \eor C) \eand \enot (N \eand C))$.} 208 | \end{compactlist} 209 | 210 | \problempart 211 | For each argument, write a symbolization key and translate the argument as well as possible into TFL. The part of the passage in italics is there to provide context for the argument, and doesn't need to be symbolized. 212 | \begin{compactlist} 213 | \item It is going to rain soon. I know because my leg is hurting, and my leg hurts if it's going to rain. 214 | 215 | \item \emph{Spider-man tries to figure out the bad guy's plan.} If Doctor Octopus gets the uranium, he will blackmail the city. I am certain of this because if Doctor Octopus gets the uranium, he can make a dirty bomb, and if he can make a dirty bomb, he will blackmail the city. 216 | 217 | \item \emph{A westerner tries to predict the policies of the Chinese government.} If the Chinese government cannot solve the water shortages in Beijing, they will have to move the capital. They don't want to move the capital. Therefore they must solve the water shortage. But the only way to solve the water shortage is to divert almost all the water from the Yangzi river northward. Therefore the Chinese government will go with the project to divert water from the south to the north. 218 | 219 | \end{compactlist} 220 | 221 | \problempart 222 | We symbolized an \emph{exclusive or} using `$\eor$', `$\eand$', and `$\enot$'. How could you symbolize an \emph{exclusive or} using only two connectives? Is there any way to symbolize an \emph{exclusive or} using only one connective? 223 | \\\myanswer{For two connectives, we could offer any of the following: 224 | \begin{center} 225 | $\enot(\metav{A} \eiff \metav{B})$\\ 226 | $(\enot\metav{A} \eiff \metav{B})$\\ 227 | $(\enot (\enot \metav{A} \eand \enot \metav{B}) \eand \enot (\metav{A} \eand \metav{B}))$ 228 | \end{center} 229 | But if we wanted to symbolize it using only one connective, we would have to introduce a new primitive connective. 230 | } 231 | 232 | \chapter{Sentences of TFL}\setcounter{ProbPart}{0} 233 | \problempart 234 | \label{pr.wiffTFL} 235 | For each of the following: (a) Is it a sentence of TFL, strictly speaking? (b) Is it a sentence of TFL, allowing for our relaxed bracketing conventions? 236 | \begin{compactlist} 237 | \item $(A)$\hfill \myanswer{(a) no (b) no} 238 | \item $J_{374} \eor \enot J_{374}$\hfill \myanswer{(a) no (b) yes} 239 | \item $\enot \enot \enot \enot F$\hfill \myanswer{(a) yes (b) yes} 240 | \item $\enot \eand S$\hfill \myanswer{(a) no (b) no} 241 | \item $(G \eand \enot G)$\hfill \myanswer{(a) yes (b) yes} 242 | \item $(A \eif (A \eand \enot F)) \eor (D \eiff E)$\hfill \myanswer{(a) no (b) yes} 243 | \item $[(Z \eiff S) \eif W] \eand [J \eor X]$\hfill \myanswer{(a) no (b) yes} 244 | \item $(F \eiff \enot D \eif J) \eor (C \eand D)$\hfill \myanswer{(a) no (b) no} 245 | \end{compactlist} 246 | 247 | \problempart 248 | Are there any sentences of TFL that contain no atomic sentences? Explain your answer. 249 | \\\myanswer{No. Atomic sentences contain atomic sentences (trivially). And every more complicated sentence is built up out of less complicated sentences, that were in turn built out of less complicated sentences, \ldots, that were ultimately built out of atomic sentences.}\\ 250 | 251 | 252 | \problempart 253 | What is the scope of each connective in the sentence 254 | $$\bigl[(H \eif I) \eor (I \eif H)\bigr] \eand (J \eor K)$$ 255 | \myanswer{The scope of the left-most instance of `$\eif$' is `$(H \eif I)$'.\\ 256 | The scope of the right-most instance of `$\eif$' is `$(I \eif H)$'.\\ 257 | The scope of the left-most instance of `$\eor$ is `$\bigl[(H \eif I) \eor (I \eif H)\bigr]$'\\ 258 | The scope of the right-most instance of `$\eor$' is `$(J \eor K)$'\\ 259 | The scope of the conjunction is the entire sentence; so conjunction is the main logical connective of the sentence.} 260 | 261 | \chapter{Ambiguity} 262 | \setcounter{ProbPart}{0} 263 | 264 | \practiceproblems 265 | \solutions 266 | \problempart The following sentences are ambiguous. Give symbolization keys for each and symbolize the different readings. 267 | \begin{compactlist} 268 | \item Haskell is a birder and enjoys watching cranes. 269 | \myanswer{\begin{ekey} 270 | \item[B] Haskell is a birder 271 | \item[C_1] Haskell enjoys watching cranes (the bird) 272 | \item[C_2] Haskell enjoys watching cranes (the construction equipment) 273 | \end{ekey}} 274 | \myanswer{$B \eand C_1$\\ $B \eand C_2$} 275 | \item The zoo has lions or tigers and bears. 276 | \item[]\myanswer{\begin{ekey} 277 | \item[L] The zoo has lions 278 | \item[T] The zoo has tigers 279 | \item[B] The zoo has bears 280 | \end{ekey}} 281 | \myanswer{$L \eor (T \eand B)$\\ $(L \eor T) \eand B$.} 282 | \item The flower is not red or fragrant. 283 | \item[]\myanswer{\begin{ekey} 284 | \item[R] The flower is red 285 | \item[F] The flower is fragrant 286 | \end{ekey}} 287 | \item[] \myanswer{$\enot(R \eor F)$\\ $\enot R \eor F$} 288 | \end{compactlist} 289 | 290 | \stepcounter{chapter} % Use and mention 291 | -------------------------------------------------------------------------------- /solutions/forallx-sol-what.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = forallxyyc-solutions.tex 2 | %\part{Key notions} 3 | %\label{ch.intro} 4 | %\addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par} 5 | 6 | \chapter{Arguments} 7 | Highlight the phrase which expresses the conclusion of each of these arguments: 8 | \begin{compactlist} 9 | \item It is sunny. So \myanswer{I should take my sunglasses}. 10 | \item \myanswer{It must have been sunny}. I did wear my sunglasses, after all. 11 | \item No one but you has had their hands in the cookie-jar. And the scene of the crime is littered with cookie-crumbs. \myanswer{You're the culprit}! 12 | \item Miss Scarlett and Professor Plum were in the study at the time 13 | of the murder. And Reverend Green had the candlestick in the 14 | ballroom, and we know that there is no blood on his hands. Hence 15 | \myanswer{Colonel Mustard did it in the kitchen with the lead 16 | pipe}. Recall, after all, that the gun had not been fired. 17 | \end{compactlist} 18 | 19 | \chapter{The scope of logic} 20 | \problempart 21 | Which of the following arguments is valid? Which is invalid? 22 | \begin{compactlist} 23 | \item\begin{earg} 24 | \item Socrates is a man. 25 | \item All men are carrots. 26 | \item[\texttherefore] Socrates is a carrot. \hfill \myanswer{Valid} 27 | \end{earg} 28 | 29 | \item\begin{earg} 30 | \item Abe Lincoln was either born in Illinois or he was once president. 31 | \item Abe Lincoln was never president. 32 | \item[\texttherefore] Abe Lincoln was born in Illinois. \hfill \myanswer{Valid} 33 | \end{earg} 34 | 35 | \item\begin{earg} 36 | \item If I pull the trigger, Abe Lincoln will die. 37 | \item I do not pull the trigger. 38 | \item[\texttherefore] Abe Lincoln will not die. \hfill \myanswer{Invalid \\ Abe Lincoln might die for some other reason: someone else might pull the trigger; he might die of old age.} 39 | \end{earg} 40 | 41 | \item\begin{earg} 42 | \item Abe Lincoln was either from France or from Luxemborg. 43 | \item Abe Lincoln was not from Luxemborg. 44 | \item[\texttherefore] Abe Lincoln was from France. \hfill \myanswer{Valid} 45 | \end{earg} 46 | 47 | \item\begin{earg} 48 | \item If the world were to end today, then I would not need to get up tomorrow morning. 49 | \item I will need to get up tomorrow morning. 50 | \item[\texttherefore] The world will not end today. \hfill \myanswer{Valid} 51 | \end{earg} 52 | 53 | \item\begin{earg} 54 | \item Joe is now 19 years old. 55 | \item Joe is now 87 years old. 56 | \item[\texttherefore] Bob is now 20 years old. \hfill \myanswer{Valid} 57 | \\\myanswer{An argument is valid if and only if it is impossible for all the premises to be true and the conclusion false. It is impossible for all the premises to be true; so it is certainly impossible that the premises are all true and the conclusion is false.} 58 | \end{earg} 59 | \end{compactlist} 60 | 61 | \problempart 62 | \label{pr.EnglishCombinations} 63 | Could there be: 64 | \begin{compactlist} 65 | \item A valid argument that has one false premise and one true premise? \hfill \myanswer{Yes. \\Example: the first argument, above.} 66 | \item A valid argument that has only false premises? \hfill \myanswer{Yes.\\Example: Socrates is a frog, all frogs are excellent pianists, therefore Socrates is an excellent pianist.} 67 | \item A valid argument with only false premises and a false conclusion? \hfill \myanswer{Yes. \\The same example will suffice.} 68 | \item An invalid argument that can be made valid by the addition of a new premise? \hfill\myanswer{Yes.\\ Plenty of examples, but let me offer a more general observation. We can \emph{always} make an invalid argument valid, by adding a contradiction into the premises. For an argument is valid if and only if it is impossible for all the premises to be true and the conclusion false. If the premises are contradictory, then it is impossible for them all to be true (and the conclusion false).} 69 | \item A valid argument that can be made invalid by the addition of a new premise? \hfill \myanswer{No.\\ An argument is valid if and only if it is impossible for all the premises to be true and the conclusion false. Adding another premise will only make it harder for the premises all to be true together.} 70 | \end{compactlist} 71 | In each case: if so, give an example; if not, explain why not. 72 | 73 | \chapter{Other logical notions} 74 | \setcounter{ProbPart}{0} 75 | \problempart 76 | \label{pr.EnglishTautology} 77 | For each of the following: Is it necessarily true, necessarily false, or contingent? 78 | \begin{compactlist} 79 | \item Caesar crossed the Rubicon. 80 | \hfill \myanswer{Contingent} 81 | \item Someone once crossed the Rubicon. 82 | \hfill \myanswer{Contingent} 83 | \item No one has ever crossed the Rubicon. 84 | \hfill \myanswer{Contingent} 85 | \item If Caesar crossed the Rubicon, then someone has. 86 | \hfill \myanswer{Necessarily true} 87 | \item Even though Caesar crossed the Rubicon, no one has ever crossed the Rubicon. 88 | \hfill \myanswer{Necessarily false} 89 | \item If anyone has ever crossed the Rubicon, it was Caesar. 90 | \hfill \myanswer{Contingent} 91 | \end{compactlist} 92 | 93 | \problempart 94 | For each of the following: Is it a necessary truth, a necessary falsehood, or contingent? 95 | \begin{compactlist} 96 | \item Elephants dissolve in water. 97 | \item Wood is a light, durable substance useful for building things. 98 | \item If wood were a good building material, it would be useful for building things. 99 | \item I live in a three story building that is two stories tall. 100 | \item If gerbils were mammals they would nurse their young. 101 | \end{compactlist} 102 | 103 | \problempart Which of the following pairs of sentences are necessarily equivalent? 104 | 105 | \begin{compactlist} 106 | \item Elephants dissolve in water. \\ 107 | If you put an elephant in water, it will disintegrate. 108 | \item All mammals dissolve in water.\\ 109 | If you put an elephant in water, it will disintegrate. 110 | \item George Bush was the 43rd president. \\ 111 | Barack Obama is the 44th president. 112 | \item Barack Obama is the 44th president. \\ 113 | Barack Obama was president immediately after the 43rd president. 114 | \item Elephants dissolve in water. \\ 115 | All mammals dissolve in water. 116 | \end{compactlist} 117 | 118 | \problempart Which of the following pairs of sentences are necessarily equivalent? 119 | 120 | \begin{compactlist} 121 | \item Thelonious Monk played piano. \\ 122 | John Coltrane played tenor sax. 123 | \item Thelonious Monk played gigs with John Coltrane. \\ 124 | John Coltrane played gigs with Thelonious Monk. 125 | \item All professional piano players have big hands. \\ 126 | Piano player Bud Powell had big hands. 127 | \item Bud Powell suffered from severe mental illness. \\ 128 | All piano players suffer from severe mental illness. 129 | \item John Coltrane was deeply religious. \\ 130 | John Coltrane viewed music as an expression of spirituality. 131 | \end{compactlist} 132 | 133 | \noindent 134 | \problempart 135 | \label{pr.MartianGiraffes} 136 | Consider the following sentences: 137 | \begin{compactlist}%[label=(\alph*)] 138 | \item[G1.] \label{itm:at_least_four}There are at least four giraffes at the wild animal park. 139 | \item[G2.] \label{itm:exactly_seven} There are exactly seven gorillas at the wild animal park. 140 | \item[G3.] \label{itm:not_more_than_two} There are not more than two Martians at the wild animal park. 141 | \item[G4.] \label{itm:martians} Every giraffe at the wild animal park is a Martian. 142 | \end{compactlist} 143 | 144 | Now consider each of the following collections of sentences. Which are jointly possible? Which are jointly impossible? 145 | \begin{compactlist} 146 | \item Sentences G2, G3, and G4 147 | \hfill \myanswer{Jointly possible} 148 | \item Sentences G1, G3, and G4 149 | \hfill \myanswer{Jointly impossible} 150 | \item Sentences G1, G2, and G4 151 | \hfill \myanswer{Jointly possible} 152 | \item Sentences G1, G2, and G3 153 | \hfill \myanswer{Jointly possible} 154 | \end{compactlist} 155 | 156 | \problempart Consider the following sentences. 157 | \begin{compactlist}%[label=(\alph*)] 158 | \item[M1.] \label{itm:allmortal} All people are mortal. 159 | \item[M2.] \label{itm:socperson} Socrates is a person. 160 | \item[M3.] \label{itm:socnotdie} Socrates will never die. 161 | \item[M4.] \label{itm:socmortal} Socrates is mortal. 162 | \end{compactlist} 163 | Which combinations of sentences are jointly possible? Mark each ``possible'' or ``impossible.'' 164 | \begin{compactlist} 165 | \item Sentences M1, M2, and M3 166 | \item Sentences M2, M3, and M4 167 | \item Sentences M2 and M3 168 | \item Sentences M1 and M4 169 | \item Sentences M1, M2, M3, and M4 170 | \end{compactlist} 171 | 172 | \problempart 173 | \label{pr.EnglishCombinations2} 174 | Which of the following is possible? If it is possible, give an example. If it is not possible, explain why. 175 | \begin{compactlist} 176 | \item A valid argument that has one false premise and one true premise 177 | \item[] \myanswer{Yes: `All whales are mammals (\emph{true}). All mammals 178 | are plants (\emph{false}). So all whales are plants.' } 179 | \item A valid argument that has a false conclusion 180 | \item[] \myanswer{Yes. (See example from previous exercise.)} 181 | \item A valid argument, the conclusion of which is a necessary falsehood 182 | \item[] \myanswer{Yes: `$1+1=3$. So $1+2=4$.'} 183 | \item An invalid argument, the conclusion of which is a necessary truth 184 | \item[] \myanswer{No. If the conclusion is necessarily true, then there is no way to make it false, and hence no way to make it false whilst making all the premises true.} 185 | \item A necessary truth that is contingent 186 | \item[] \myanswer{No. If a sentence is a necessary truth, it cannot 187 | possibly be false, but a contingent sentence can be false.} 188 | \item Two necessarily equivalent sentences, both of which are necessary truths 189 | \item[] \myanswer{Yes: `4 is even', `4 is divisible by 2'.} 190 | \item Two necessarily equivalent sentences, one of which is a necessary truth and one of which is contingent 191 | \item[] \myanswer{No. A necessary truth cannot possibly be false, 192 | while a contingent sentence can be false. So in any situation in 193 | which the contingent sentence is false, it will have a different 194 | truth value from the necessary truth. Thus they will not necessarily 195 | have the same truth value, and so will not be equivalent.} 196 | \item Two necessarily equivalent sentences that together are jointly impossible 197 | \item[] \myanswer{Yes: `$1+1=4$' and `$1+1=3$'.} 198 | \item A jointly possible collection of sentences that contains a necessary falsehood 199 | \item[] \myanswer{No. If a sentence is necessarily false, there is no way to make it true, let alone it along with all the other sentences.} 200 | \item A jointly impossible set of sentences that contains a necessary truth 201 | \item[] \myanswer{Yes: `$1+1=4$' and `$1+1=2$'.} 202 | \end{compactlist} 203 | 204 | \problempart 205 | Which of the following is possible? If it is possible, give an example. If it is not possible, explain why. 206 | 207 | \begin{compactlist} 208 | \item A valid argument, whose premises are all necessary truths, and whose conclusion is contingent 209 | \item A valid argument with true premises and a false conclusion 210 | \item A jointly possible collection of sentences that contains two sentences that are not necessarily equivalent 211 | \item A jointly possible collection of sentences, all of which are contingent 212 | \item A false necessary truth 213 | \item A valid argument with false premises 214 | \item A necessarily equivalent pair of sentences that are not jointly possible 215 | \item A necessary truth that is also a necessary falsehood 216 | \item A jointly possible collection of sentences that are all necessary falsehoods 217 | \end{compactlist} 218 | -------------------------------------------------------------------------------- /solutions/forallxyyc-solutions.tex: -------------------------------------------------------------------------------- 1 | \documentclass[openany,oneside,10pt]{memoir} 2 | 3 | \usepackage{../forallxyyc-style} 4 | \usepackage{../forallxyyc} 5 | 6 | \IfFileExists{../forallxyyc-local.sty}{\usepackage{../forallxyyc-local}}{} 7 | 8 | \hypersetup{pdfinfo={Title={forall x: Calgary. Solutions to Selected Exercises}, 9 | Author={P.D. Magnus, Tim Button, J. Rob Loftis, Robert Trueman, Aaron Thomas-Bolduc, Richard Zach}, Subject={An open access introductory textbook in formal logic}, Keywords={truth-functional logic, propositional logic, predicate logic, first-order logic, natural deduction, fitch, modal logic}}, 10 | bookmarks={true}, 11 | bookmarksopen = {true}, 12 | colorlinks={true}, 13 | allcolors={dkleadbeater}, 14 | pdfdisplaydoctitle={true}} 15 | 16 | \usepackage[absolute,overlay]{textpos} 17 | 18 | \usepackage{longtable} 19 | \setkeys{fitch}{arrayenv=longtable} 20 | \setlength{\LTleft}{0pt} 21 | \setlength\LTright\fill 22 | 23 | % set stock & paper size with narrow margins 24 | 25 | \setstocksize{8in}{5in} 26 | 27 | \settrimmedsize{\stockheight}{\stockwidth}{*} 28 | \settrims{0pt}{0pt} 29 | 30 | % let's calculate the line length for 65 characters in \normalfont 31 | 32 | \setlxvchars 33 | 34 | % set the size of the type block to golden ratio calculated width 35 | 36 | \settypeblocksize{*}{1.05\lxvchars}{1.62} 37 | 38 | % set spine and and edge margin 39 | 40 | \setlrmargins{*}{*}{1} 41 | \setulmargins{.6in}{*}{*} 42 | \setheaderspaces{*}{*}{1} 43 | 44 | \checkandfixthelayout 45 | 46 | \definecolor{lyallpink}{RGB}{222,31,149} 47 | \colorlet{leadbeater}{lyallpink} 48 | \colorlet{dkleadbeater}{lyallpink!80!black} 49 | \colorlet{ltleadbeater}{lyallpink!50} 50 | \colorlet{vltleadbeater}{lyallpink!3} 51 | 52 | \begin{document} 53 | \midsloppy 54 | 55 | \pagestyle{leadbeater} 56 | 57 | \frontmatter 58 | \include{forallx-sol-frontmatter} 59 | 60 | \currentpdfbookmark{Table of Contents}{name} 61 | \tableofcontents* 62 | 63 | \mainmatter 64 | \include{forallx-sol-what} 65 | \include{forallx-sol-tfl} 66 | \include{forallx-sol-truthtables} 67 | \include{forallx-sol-prooftfl} 68 | \include{forallx-sol-fol} 69 | \include{forallx-sol-interpretations} 70 | \include{forallx-sol-prooffol} 71 | \include{forallx-sol-ml} 72 | \include{forallx-sol-metatheory} 73 | 74 | 75 | \end{document} 76 | -------------------------------------------------------------------------------- /solutions/latexml.sty: -------------------------------------------------------------------------------- 1 | % /=====================================================================\ % 2 | % | latexml.sty | % 3 | % | Style file for latexml documents | % 4 | % |=====================================================================| % 5 | % | Part of LaTeXML: | % 6 | % | Public domain software, produced as part of work done by the | % 7 | % | United States Government & not subject to copyright in the US. | % 8 | % |---------------------------------------------------------------------| % 9 | % | Bruce Miller %_% | % 10 | % | http://dlmf.nist.gov/LaTeXML/ (o o) | % 11 | % \=========================================================ooo==U==ooo=/ % 12 | 13 | 14 | % You can conditionalize code for latexml or normal latex using this. 15 | \newif\iflatexml\latexmlfalse 16 | %====================================================================== 17 | \DeclareOption{ids}{} 18 | \DeclareOption{noids}{} 19 | \DeclareOption{comments}{} 20 | \DeclareOption{nocomments}{} 21 | \DeclareOption{profiling}{} 22 | \DeclareOption{noprofiling}{} 23 | \DeclareOption{mathparserspeculate}{} 24 | \DeclareOption{nomathparserspeculate}{} 25 | \DeclareOption{guesstabularheaders}{} 26 | \DeclareOption{noguesstabularheaders}{} 27 | % Just ignore unknown options, so that binding can evolve more easily. 28 | \DeclareOption*{\PackageWarning{latexml}{option \CurrentOption\space ignored}} 29 | \ProcessOptions 30 | %====================================================================== 31 | % NOTE: Figure out where this should go. 32 | % At least should define various `semantic enhancement' macros that 33 | % authors using latexml might want. 34 | % But, be careful not to step on the toes of other packages (naming scheme), 35 | % Nor, to assume to much about what semantics authors might want. 36 | % NOTE: Am I stepping on toes by including these here? 37 | % Common markup junk for LaTeXML docs. 38 | \providecommand{\XML}{\textsc{xml}}% 39 | \providecommand{\SGML}{\textsc{sgml}}% 40 | \providecommand{\HTML}{\textsc{html}}% 41 | \providecommand{\XHTML}{\textsc{xhtml}}% 42 | \providecommand{\XSLT}{\textsc{xslt}}% 43 | \providecommand{\CSS}{\textsc{css}}% 44 | \providecommand{\MathML}{\textsc{MathML}}% 45 | \providecommand{\OpenMath}{OpenMath}% 46 | 47 | \RequirePackage{url} 48 | % Shorthand to present a URL the actual text (also linked in HTML) 49 | % \URL[alternative text]{url} 50 | \def\URL{\@ifnextchar[{\@URL}{\@@URL}}%] 51 | %\def\@@URL{\begingroup\def\UrlLeft##1\UrlRight{\stepcounter{footnote}% 52 | %[Footnote~\thefootnote\footnotetext{##1}]}\Url} 53 | \def\@@URL{\begingroup\Url} 54 | \def\@URL[#1]{#1\begingroup\def\UrlLeft##1\UrlRight{\footnote{\texttt{##1}}}\Url} 55 | 56 | % The LaTeXML Logo. 57 | \DeclareRobustCommand{\LaTeXML}{L\kern-.36em% 58 | {\sbox\z@ T% 59 | \vbox to\ht\z@{\hbox{\check@mathfonts 60 | \fontsize\sf@size\z@ 61 | \math@fontsfalse\selectfont 62 | A}% 63 | \vss}% 64 | }% 65 | \kern-.15em% 66 | % T\kern-.1667em\lower.5ex\hbox{E}\kern-.125em\relax 67 | % {\tt XML}} 68 | T\kern-.1667em\lower.4ex\hbox{E}\kern-0.05em\relax 69 | {\scshape xml}}% 70 | 71 | \providecommand{\LaTeXMLversion}{} 72 | \providecommand{\LaTeXMLrevision}{} 73 | \providecommand{\LaTeXMLfullversion}{\LaTeXML} 74 | 75 | %====================================================================== 76 | % id related features 77 | \providecommand{\lxDocumentID}[1]{}% 78 | \def\LXMID#1#2{\expandafter\gdef\csname xmarg#1\endcsname{#2}\csname xmarg#1\endcsname} 79 | \def\LXMRef#1{\csname xmarg#1\endcsname} 80 | 81 | %====================================================================== 82 | % class related features 83 | % Add a class to the constructed xml (ignored in latex) 84 | \providecommand{\lxAddClass}[1]{}% 85 | \providecommand{\lxWithClass}[2]{#2}% 86 | \providecommand{\lxAddAnnotation}[1]{}% 87 | \providecommand{\lxWithAnnotation}[2]{#2}% 88 | 89 | %====================================================================== 90 | % links 91 | \def\lxRef#1#2{#2} 92 | %====================================================================== 93 | % Resources 94 | \providecommand{\lxRequireResource}[2][]{} 95 | 96 | %====================================================================== 97 | % Page customization 98 | \def\lxKeywords#1{} 99 | 100 | \RequirePackage{comment} 101 | \def\lxContextTOC{}% 102 | \excludecomment{lxNavbar} 103 | \excludecomment{lxHeader} 104 | \excludecomment{lxFooter} 105 | 106 | %====================================================================== 107 | % Table beautification. 108 | % Low-level support to mark column and row headers. 109 | % This really calls for styling, but why should we get into that game? 110 | % There are many other packages for that. 111 | 112 | % To mark the table head/foot (table column headers) 113 | % Put this before first table heading row 114 | \def\lxBeginTableHead{} 115 | % put this after the \\ ending the table heading. 116 | \def\lxEndTableHead{} 117 | % Ditto for table foot (last rows in table) 118 | \def\lxBeginTableFoot{} 119 | \def\lxEndTableFoot{} 120 | 121 | % To mark an individual cell as a column header 122 | \def\lxTableColumnHead{} 123 | % To mark an individual cell as a row header 124 | \def\lxTableRowHead{} 125 | % Easy way to mark a whole column as row headers: 126 | % \usepackage{array} 127 | % then put this in the column spec 128 | % >{\lxTableRowHead} 129 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 130 | % Declarative information for Mathematics 131 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 132 | %====================================================================== 133 | % Marking the type of particular instances of a symbol 134 | % Expose other declarative macros 135 | \providecommand{\lxFcn}[1]{#1} 136 | \providecommand{\lxID}[1]{#1} 137 | \providecommand{\lxPunct}[1]{#1} 138 | \providecommand{\lxMathTweak}[2]{#2} 139 | %====================================================================== 140 | % Math definining macro. 141 | % Define a math function such that the TeX output is what you might 142 | % expect, while providing the semantic hooks for generating useful xml. 143 | 144 | % \lxDefMath{\cs}[nargs][optargs]{presentation}[declarations] 145 | \providecommand{\lxDefMath}{\lx@defmath}% 146 | \def\lx@defmath#1{% 147 | \@ifnextchar[{\lx@defmath@a{#1}}{\lx@defmath@a{#1}[0]}}% 148 | \def\lx@defmath@a#1[#2]{% 149 | \@ifnextchar[{\lx@defmath@opt{#1}[#2]}{\lx@defmath@noopt{#1}[#2]}}% 150 | \def\lx@defmath@opt#1[#2][#3]#4{% 151 | \providecommand{#1}[#2][#3]{#4}% 152 | \@ifnextchar[{\lx@@skipopt}{}}% 153 | \def\lx@defmath@noopt#1[#2]#3{% 154 | \providecommand{#1}[#2]{#3}% 155 | \@ifnextchar[{\lx@@skipopt}{}}% 156 | \def\lx@@skipopt[#1]{}% 157 | 158 | % \lxDeclare[declarations]{match} 159 | \newcommand{\lxDeclare}[2][]{\@bsphack\@esphack}% 160 | % \lxDeclRef{label} 161 | \newcommand{\lxRefDeclaration}[2][]{\@bsphack\@esphack}% 162 | 163 | % NOTE: It would be good to incorporate Scoping into this macro. 164 | % As defined, it obeys TeX's usual grouping scope. 165 | % However, scoping by `module' (M.Kohlhase's approach) and/or 166 | % `document' scoping could be useful. 167 | 168 | % In module scoping, the definition is only available within a 169 | % module environment that defines it, AND in other module envs 170 | % that `use' it. 171 | 172 | % In document scoping, the definition would only be available within 173 | % the current sectional unit. I'm not sure the best way to achieve this 174 | % within latex, itself, but have ideas about latexml... 175 | % But, perhaps it is only the declarative aspects that are important to 176 | % latexml... 177 | --------------------------------------------------------------------------------