ebook img

A first course in logic PDF

250 Pages·2019·1.97 MB·English
by  LawsonMark V
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview A first course in logic

A First Course in Logic A First Course in Logic Mark V. Lawson Heriot-Watt University, Edinburgh CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2019 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-0-8153-8665-0 (Paperback) International Standard Book Number-13: 978-0-8153-8664-3 (Hardback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging‑in‑Publication Data Names: Lawson, Mark V., author. Title: A first course in logic / Mark V. Lawson. Description: Boca Raton, Florida : CRC Press, [2018] | Includes bibliographical references and index. Identifiers: LCCN 2018024672| ISBN 9780815386643 (hardback : alk. paper) | ISBN 9780815386650 (pbk. : alk. paper) | ISBN 9781351175388 (ebook). Subjects: LCSH: Logic, Symbolic and mathematical--Problems, exercises, etc. | Logic. Classification: LCC QA9 .L37256 2018 | DDC 511.3--dc23 LC record available at https://lccn.loc.gov/2018024672 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com This book is dedicated to the memory of my mother Shirley Lawson (1935–2017) “...for the growing good of the world is partly dependent on un- historicacts;andthatthingsarenotsoillwithyouandmeasthey might have been, is half owing to the number who lived faithfully a hidden life ...” – George Eliot. Contents Preface ix Introduction xi 1 Propositional logic 1 1.1 Informal propositional logic . . . . . . . . . . . . . . . . . . . 1 1.2 Syntax of propositional logic . . . . . . . . . . . . . . . . . . 9 1.3 Semantics of propositional logic . . . . . . . . . . . . . . . . 16 1.4 Logical equivalence . . . . . . . . . . . . . . . . . . . . . . . 23 1.4.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.4.2 Logical patterns . . . . . . . . . . . . . . . . . . . . . 25 1.4.3 Applications . . . . . . . . . . . . . . . . . . . . . . . 27 1.5 PL in action . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.5.1 PL as a programming language . . . . . . . . . . . . . 32 1.5.2 PL can be used to model some computers . . . . . . . 36 1.6 Adequate sets of connectives . . . . . . . . . . . . . . . . . . 42 1.7 Truth functions . . . . . . . . . . . . . . . . . . . . . . . . . 45 1.8 Normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . 48 1.8.1 Negation normal form (NNF) . . . . . . . . . . . . . . 48 1.8.2 Disjunctive normal form (DNF) . . . . . . . . . . . . . 49 1.8.3 Conjunctive normal form (CNF) . . . . . . . . . . . . 50 1.8.4 Prologue to PROLOG . . . . . . . . . . . . . . . . . . 51 1.9 P =NP? or How to win a million dollars . . . . . . . . . . . 56 1.10 Valid arguments . . . . . . . . . . . . . . . . . . . . . . . . . 61 1.10.1 Definitions and examples . . . . . . . . . . . . . . . . 62 1.10.2 Proof in mathematics (I) . . . . . . . . . . . . . . . . 66 1.11 Truth trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 1.11.1 The truth tree algorithm . . . . . . . . . . . . . . . . 72 1.11.2 The theory of truth trees . . . . . . . . . . . . . . . . 83 1.12 Sequent calculus . . . . . . . . . . . . . . . . . . . . . . . . . 87 1.12.1 Deduction trees . . . . . . . . . . . . . . . . . . . . . . 89 1.12.2 Truth trees revisited . . . . . . . . . . . . . . . . . . . 94 1.12.3 Gentzen’s system LK . . . . . . . . . . . . . . . . . . 99 vii viii Contents 2 Boolean algebras 103 2.1 More set theory . . . . . . . . . . . . . . . . . . . . . . . . . 103 2.2 Boolean algebras . . . . . . . . . . . . . . . . . . . . . . . . . 110 2.2.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . 110 2.2.2 Definition and examples . . . . . . . . . . . . . . . . . 112 2.2.3 Algebra in a Boolean algebra . . . . . . . . . . . . . . 114 2.3 Combinational circuits . . . . . . . . . . . . . . . . . . . . . 120 2.3.1 How gates build circuits . . . . . . . . . . . . . . . . . 120 2.3.2 A simple calculator . . . . . . . . . . . . . . . . . . . . 127 2.4 Sequential circuits . . . . . . . . . . . . . . . . . . . . . . . . 134 3 First-order logic 145 3.1 First steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 3.1.1 Names and predicates . . . . . . . . . . . . . . . . . . 146 3.1.2 Relations . . . . . . . . . . . . . . . . . . . . . . . . . 148 3.1.3 Structures . . . . . . . . . . . . . . . . . . . . . . . . . 150 3.1.4 Quantification . . . . . . . . . . . . . . . . . . . . . . 152 3.1.5 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 3.1.6 Variables: their care and maintenance . . . . . . . . . 156 3.1.7 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . 160 3.1.8 De Morgan’s laws for quantifiers . . . . . . . . . . . . 167 3.1.9 Quantifier examples . . . . . . . . . . . . . . . . . . . 168 3.2 Gödel’s completeness theorem . . . . . . . . . . . . . . . . . 173 3.2.1 An example . . . . . . . . . . . . . . . . . . . . . . . . 173 3.2.2 Truth trees for FOL . . . . . . . . . . . . . . . . . . . 174 3.2.3 The soundness theorem . . . . . . . . . . . . . . . . . 180 3.2.4 The completeness theorem. . . . . . . . . . . . . . . . 182 3.3 Proof in mathematics (II) . . . . . . . . . . . . . . . . . . . . 188 3.4 Further reading . . . . . . . . . . . . . . . . . . . . . . . . . 190 Solutions to all exercises 193 Bibliography 225 Index 231 Preface When you come to a fork in the road, take it! — Yogi Berra. This book grew out of notes written to accompany my Heriot-Watt Uni- versitymoduleF17LP Logic and proofwhichIhavebeenteachingsince2011. ThismodulewasinfactinstigatedbymycolleaguesinComputerScienceand was therefore intendedoriginally forfirst-year computersciencestudents, but the module was subsequently also offered as an option to second-year mathe- matics students (in the Scottish university system). There are three chapters. Chapters 1 and 2 focus on propositional logic and Boolean algebras, respec- tively, and Chapter 3 is a short introduction to the basic ideas of first-order logic.Ihavetreatedpropositionallogicasasubjectinitsownrightratherthan as just a stopover to a more interesting destination. In particular, I outline the intuitive background to the question of whether P = NP, describe how thisquestionisrelatedtothesatisfiabilityproblemofpropositionallogic,and why all this matters. The theory of Boolean algebras is the algebraic face of propositionallogicandisusedtodesigncircuits:boththecombinationalones thathavenomemoryandthesequentialonesthatdo.Eachsectionconcludes withexercises,allofwhosesolutionscanbefoundattheendofthebook.Let me stress that this is very much a first introduction to logic. I have therefore assumed as few prerequisites as possible; specifically, I have tried to keep any mathematical background to the absolute minimum. The real mathematical prerequisiteisanabilitytomanipulatesymbols:inotherwords,basicalgebra. Anyone who can write programs should have this ability already. In addition, Idonottrytofolloweverylogicalbyway,rathermygoalistoinspireinterest and curiosity about this subject and lay the foundations for further study. In writingthisbook,Ihavebeenparticularlyinfluenced,likemanyothers,bythe workofSmullyan1,particularly[67].Chapters1and3coverroughlythesame material as the first 65 pages of his [67] together with part of his Chapter XI. For a complete list of all the references I consulted, see the bibliography, but letmehighlightafewparticularexampleshere.InbothChapter1andChap- ter 3, I have used truth trees. These are vastly superior to the Hilbert-style systems often containedin manyintroductions to logic. Though such systems have their place, they are a stumbling block in an introduction such as this. I first learnt about them from [65]. I have, however, included a short introduc- 1RaymondSmullyan(1919–2017)wasthedoyenoflogic,andhisworkdidmuchtobring ittoawideraudience. ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.